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.
431 lines
1.3 MiB
431 lines
1.3 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[271,5,7,10,13],{"+GGh":function(ht,et){ht.exports="data:image/png;base64,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"},"+NIl":function(ht,et,Z){(function(oe){oe(Z("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function(j,M){"use strict";function X(c,u){c.cmdState.push(u)}function D(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function F(c){var u=c.cmdState.pop();u&&u.closeBracket()}function K(c){for(var u=c.cmdState,f=u.length-1;f>=0;f--){var s=u[f];if(s.name=="DEFAULT")continue;return s}return{styleIdentifier:function(){return null}}}function H(c,u,f){return function(){this.name=c,this.bracketNo=0,this.style=u,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=H("importmodule","tag",["string","builtin"]),P.documentclass=H("documentclass","tag",["","atom"]),P.usepackage=H("usepackage","tag",["atom"]),P.begin=H("begin","tag",["atom"]),P.end=H("end","tag",["atom"]),P.label=H("label","tag",["atom"]),P.ref=H("ref","tag",["atom"]),P.eqref=H("eqref","tag",["atom"]),P.cite=H("cite","tag",["atom"]),P.bibitem=H("bibitem","tag",["atom"]),P.Bibitem=H("Bibitem","tag",["atom"]),P.RBibitem=H("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(c,u){c.f=u}function y(c,u){var f;if(c.match(/^\\[a-zA-Z@]+/)){var s=c.current().slice(1);return f=P.hasOwnProperty(s)?P[s]:P.DEFAULT,f=new f,X(u,f),I(u,p),f.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(u,function(a,d){return m(a,d,"\\]")}),"keyword";if(c.match("\\("))return I(u,function(a,d){return m(a,d,"\\)")}),"keyword";if(c.match("$$"))return I(u,function(a,d){return m(a,d,"$$")}),"keyword";if(c.match("$"))return I(u,function(a,d){return m(a,d,"$")}),"keyword";var r=c.next();if(r=="%")return c.skipToEnd(),"comment";if(r=="}"||r=="]"){if(f=D(u),f)f.closeBracket(r),I(u,p);else return"error";return"bracket"}else return r=="{"||r=="["?(f=P.DEFAULT,f=new f,X(u,f),"bracket"):/\d/.test(r)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),f=K(u),f.name=="begin"&&(f.argument=c.current()),f.styleIdentifier())}function m(c,u,f){if(c.eatSpace())return null;if(f&&c.match(f))return I(u,y),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variable-2";if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/]/))return"tag";if(c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var s=c.next();return s=="{"||s=="}"||s=="["||s=="]"||s=="("||s==")"?"bracket":s=="%"?(c.skipToEnd(),"comment"):"error"}function p(c,u){var f=c.peek(),s;return f=="{"||f=="["?(s=D(u),s.openBracket(f),c.eat(f),I(u,y),"bracket"):/[ \t\r]/.test(f)?(c.eat(f),null):(I(u,y),F(u),y(c,u))}return{startState:function(){var c=M.inMathMode?function(u,f){return m(u,f)}:y;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,u){return u.f(c,u)},blankLine:function(c){c.f=y,c.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"+ua5":function(ht,et,Z){},"19Vz":function(ht,et,Z){(function(oe){oe(Z("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(H,P,I){var y=I&&I!=oe.Init;if(P&&!y)H.on("blur",D),H.on("change",F),H.on("swapDoc",F),oe.on(H.getInputField(),"compositionupdate",H.state.placeholderCompose=function(){X(H)}),F(H);else if(!P&&y){H.off("blur",D),H.off("change",F),H.off("swapDoc",F),oe.off(H.getInputField(),"compositionupdate",H.state.placeholderCompose),j(H);var m=H.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}P&&!H.hasFocus()&&D(H)});function j(H){H.state.placeholder&&(H.state.placeholder.parentNode.removeChild(H.state.placeholder),H.state.placeholder=null)}function M(H){j(H);var P=H.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=H.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var I=H.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),P.appendChild(I),H.display.lineSpace.insertBefore(P,H.display.lineSpace.firstChild)}function X(H){setTimeout(function(){var P=!1,I=H.getInputField();I.nodeName=="TEXTAREA"?P=!I.value:H.lineCount()==1&&(P=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),P?M(H):j(H)},20)}function D(H){K(H)&&M(H)}function F(H){var P=H.getWrapperElement(),I=K(H);P.className=P.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?M(H):j(H)}function K(H){return H.lineCount()===1&&H.getLine(0)===""}})},"1eCo":function(ht,et,Z){(function(oe){oe(Z("VrN/"))})(function(oe){"use strict";var j={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function(X,D){var F=X.indentUnit,K={},H=D.htmlMode?j:M;for(var P in H)K[P]=H[P];for(var P in D)K[P]=D[P];var I,y;function m(l,_){function h(N){return _.tokenize=N,N(l,_)}var g=l.next();if(g=="<")return l.eat("!")?l.eat("[")?l.match("CDATA[")?h(u("atom","]]>")):null:l.match("--")?h(u("comment","-->")):l.match("DOCTYPE",!0,!0)?(l.eatWhile(/[\w\._\-]/),h(f(1))):null:l.eat("?")?(l.eatWhile(/[\w\._\-]/),_.tokenize=u("meta","?>"),"meta"):(I=l.eat("/")?"closeTag":"openTag",_.tokenize=p,"tag bracket");if(g=="&"){var T;return l.eat("#")?l.eat("x")?T=l.eatWhile(/[a-fA-F\d]/)&&l.eat(";"):T=l.eatWhile(/[\d]/)&&l.eat(";"):T=l.eatWhile(/[\w\.\-:]/)&&l.eat(";"),T?"atom":"error"}else return l.eatWhile(/[^&<]/),null}m.isInText=!0;function p(l,_){var h=l.next();if(h==">"||h=="/"&&l.eat(">"))return _.tokenize=m,I=h==">"?"endTag":"selfcloseTag","tag bracket";if(h=="=")return I="equals",null;if(h=="<"){_.tokenize=m,_.state=d,_.tagName=_.tagStart=null;var g=_.tokenize(l,_);return g?g+" tag error":"tag error"}else return/[\'\"]/.test(h)?(_.tokenize=c(h),_.stringStartCol=l.column(),_.tokenize(l,_)):(l.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(l){var _=function(h,g){for(;!h.eol();)if(h.next()==l){g.tokenize=p;break}return"string"};return _.isInAttribute=!0,_}function u(l,_){return function(h,g){for(;!h.eol();){if(h.match(_)){g.tokenize=m;break}h.next()}return l}}function f(l){return function(_,h){for(var g;(g=_.next())!=null;){if(g=="<")return h.tokenize=f(l+1),h.tokenize(_,h);if(g==">")if(l==1){h.tokenize=m;break}else return h.tokenize=f(l-1),h.tokenize(_,h)}return"meta"}}function s(l,_,h){this.prev=l.context,this.tagName=_,this.indent=l.indented,this.startOfLine=h,(K.doNotIndent.hasOwnProperty(_)||l.context&&l.context.noIndent)&&(this.noIndent=!0)}function r(l){l.context&&(l.context=l.context.prev)}function a(l,_){for(var h;;){if(!l.context)return;if(h=l.context.tagName,!K.contextGrabbers.hasOwnProperty(h)||!K.contextGrabbers[h].hasOwnProperty(_))return;r(l)}}function d(l,_,h){return l=="openTag"?(h.tagStart=_.column(),L):l=="closeTag"?C:d}function L(l,_,h){return l=="word"?(h.tagName=_.current(),y="tag",O):K.allowMissingTagName&&l=="endTag"?(y="tag bracket",O(l,_,h)):(y="error",L)}function C(l,_,h){if(l=="word"){var g=_.current();return h.context&&h.context.tagName!=g&&K.implicitlyClosed.hasOwnProperty(h.context.tagName)&&r(h),h.context&&h.context.tagName==g||K.matchClosing===!1?(y="tag",x):(y="tag error",R)}else return K.allowMissingTagName&&l=="endTag"?(y="tag bracket",x(l,_,h)):(y="error",R)}function x(l,_,h){return l!="endTag"?(y="error",x):(r(h),d)}function R(l,_,h){return y="error",x(l,_,h)}function O(l,_,h){if(l=="word")return y="attribute",w;if(l=="endTag"||l=="selfcloseTag"){var g=h.tagName,T=h.tagStart;return h.tagName=h.tagStart=null,l=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(g)?a(h,g):(a(h,g),h.context=new s(h,g,T==h.indented)),d}return y="error",O}function w(l,_,h){return l=="equals"?E:(K.allowMissing||(y="error"),O(l,_,h))}function E(l,_,h){return l=="string"?b:l=="word"&&K.allowUnquoted?(y="string",O):(y="error",O(l,_,h))}function b(l,_,h){return l=="string"?b:O(l,_,h)}return{startState:function(l){var _={tokenize:m,state:d,indented:l||0,tagName:null,tagStart:null,context:null};return l!=null&&(_.baseIndent=l),_},token:function(l,_){if(!_.tagName&&l.sol()&&(_.indented=l.indentation()),l.eatSpace())return null;I=null;var h=_.tokenize(l,_);return(h||I)&&h!="comment"&&(y=null,_.state=_.state(I||h,l,_),y&&(h=y=="error"?h+" error":y)),h},indent:function(l,_,h){var g=l.context;if(l.tokenize.isInAttribute)return l.tagStart==l.indented?l.stringStartCol+1:l.indented+F;if(g&&g.noIndent)return oe.Pass;if(l.tokenize!=p&&l.tokenize!=m)return h?h.match(/^(\s*)/)[0].length:0;if(l.tagName)return K.multilineTagIndentPastTag!==!1?l.tagStart+l.tagName.length+2:l.tagStart+F*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(_))return 0;var T=_&&/^<(\/)?([\w_:\.-]*)/.exec(_);if(T&&T[1])for(;g;)if(g.tagName==T[2]){g=g.prev;break}else if(K.implicitlyClosed.hasOwnProperty(g.tagName))g=g.prev;else break;else if(T)for(;g;){var N=K.contextGrabbers[g.tagName];if(N&&N.hasOwnProperty(T[2]))g=g.prev;else break}for(;g&&g.prev&&!g.startOfLine;)g=g.prev;return g?g.indent+F:l.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(l){l.state==E&&(l.state=O)},xmlCurrentTag:function(l){return l.tagName?{name:l.tagName,close:l.type=="closeTag"}:null},xmlCurrentContext:function(l){for(var _=[],h=l.context;h;h=h.prev)h.tagName&&_.push(h.tagName);return _.reverse()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(ht,et,Z){"use strict";Z.d(et,"a",function(){return a});var oe=Z("Ty5D"),j=Z("dI71"),M=Z("cDcd"),X=Z.n(M),D=Z("YS25"),F=Z("17x9"),K=Z.n(F),H=Z("wx14"),P=Z("zLVn"),I=Z("9R94"),y=function(E){Object(j.a)(b,E);function b(){for(var _,h=arguments.length,g=new Array(h),T=0;T<h;T++)g[T]=arguments[T];return _=E.call.apply(E,[this].concat(g))||this,_.history=Object(D.a)(_.props),_}var l=b.prototype;return l.render=function(){return X.a.createElement(oe.c,{history:this.history,children:this.props.children})},b}(X.a.Component),m=function(E){Object(j.a)(b,E);function b(){for(var _,h=arguments.length,g=new Array(h),T=0;T<h;T++)g[T]=arguments[T];return _=E.call.apply(E,[this].concat(g))||this,_.history=Object(D.b)(_.props),_}var l=b.prototype;return l.render=function(){return X.a.createElement(oe.c,{history:this.history,children:this.props.children})},b}(X.a.Component),p=function(b,l){return typeof b=="function"?b(l):b},c=function(b,l){return typeof b=="string"?Object(D.c)(b,null,null,l):b},u=function(b){return b},f=X.a.forwardRef;typeof f=="undefined"&&(f=u);function s(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var r=f(function(E,b){var l=E.innerRef,_=E.navigate,h=E.onClick,g=Object(P.a)(E,["innerRef","navigate","onClick"]),T=g.target,N=Object(H.a)({},g,{onClick:function(Y){try{h&&h(Y)}catch(U){throw Y.preventDefault(),U}!Y.defaultPrevented&&Y.button===0&&(!T||T==="_self")&&!s(Y)&&(Y.preventDefault(),_())}});return u!==f?N.ref=b||l:N.ref=l,X.a.createElement("a",N)}),a=f(function(E,b){var l=E.component,_=l===void 0?r:l,h=E.replace,g=E.to,T=E.innerRef,N=Object(P.a)(E,["component","replace","to","innerRef"]);return X.a.createElement(oe.e.Consumer,null,function(V){V||Object(I.a)(!1);var Y=V.history,U=c(p(g,V.location),V.location),A=U?Y.createHref(U):"",J=Object(H.a)({},N,{href:A,navigate:function(){var se=p(g,V.location),fe=h?Y.replace:Y.push;fe(se)}});return u!==f?J.ref=b||T:J.innerRef=T,X.a.createElement(_,J)})});if(!1)var d,L;var C=function(b){return b},x=X.a.forwardRef;typeof x=="undefined"&&(x=C);function R(){for(var E=arguments.length,b=new Array(E),l=0;l<E;l++)b[l]=arguments[l];return b.filter(function(_){return _}).join(" ")}var O=x(function(E,b){var l=E["aria-current"],_=l===void 0?"page":l,h=E.activeClassName,g=h===void 0?"active":h,T=E.activeStyle,N=E.className,V=E.exact,Y=E.isActive,U=E.location,A=E.sensitive,J=E.strict,te=E.style,se=E.to,fe=E.innerRef,Ue=Object(P.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(oe.e.Consumer,null,function(Re){Re||Object(I.a)(!1);var De=U||Re.location,Fe=c(p(se,De),De),Me=Fe.pathname,ye=Me&&Me.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),le=ye?Object(oe.f)(De.pathname,{path:ye,exact:V,sensitive:A,strict:J}):null,Se=!!(Y?Y(le,De):le),ot=Se?R(N,g):N,it=Se?Object(H.a)({},te,{},T):te,ct=Object(H.a)({"aria-current":Se&&_||null,className:ot,style:it,to:Fe},Ue);return C!==x?ct.ref=b||fe:ct.innerRef=fe,X.a.createElement(a,ct)})});if(!1)var w},"5VLF":function(ht,et,Z){"use strict";var oe,j;function M(X,D,F){var K=function(H,P){return X.js_beautify(H,P)};return K.js=X.js_beautify,K.css=D.css_beautify,K.html=F.html_beautify,K.js_beautify=X.js_beautify,K.css_beautify=D.css_beautify,K.html_beautify=F.html_beautify,K}!(oe=[Z("6UM0"),Z("TXwP"),Z("psGv")],j=function(X,D,F){return M(X,D,F)}.apply(et,oe),j!==void 0&&(ht.exports=j))},"6UM0":function(ht,et,Z){var oe,j;(function(){var M;(function(){"use strict";var D=[function(P,I,y){var m=y(1).Beautifier,p=y(5).Options;function c(u,f){var s=new m(u,f);return s.beautify()}P.exports=c,P.exports.defaultOptions=function(){return new p}},function(P,I,y){var m=y(2).Output,p=y(3).Token,c=y(4),u=y(5).Options,f=y(7).Tokenizer,s=y(7).line_starters,r=y(7).positionable_operators,a=y(7).TOKEN;function d(A,J){return J.indexOf(A)!==-1}function L(A){return A.replace(/^\s+/g,"")}function C(A){for(var J={},te=0;te<A.length;te++)J[A[te].replace(/-/g,"_")]=A[te];return J}function x(A,J){return A&&A.type===a.RESERVED&&A.text===J}function R(A,J){return A&&A.type===a.RESERVED&&d(A.text,J)}var O=["case","return","do","if","throw","else","await","break","continue","async"],w=["before-newline","after-newline","preserve-newline"],E=C(w),b=[E.before_newline,E.preserve_newline],l={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(A,J){if(J.multiline_frame||J.mode===l.ForInitializer||J.mode===l.Conditional)return;A.remove_indent(J.start_line_index)}function h(A){A=A.replace(c.allLineBreaks,`
|
|
`);for(var J=[],te=A.indexOf(`
|
|
`);te!==-1;)J.push(A.substring(0,te)),A=A.substring(te+1),te=A.indexOf(`
|
|
`);return A.length&&J.push(A),J}function g(A){return A===l.ArrayLiteral}function T(A){return d(A,[l.Expression,l.ForInitializer,l.Conditional])}function N(A,J){for(var te=0;te<A.length;te++){var se=A[te].trim();if(se.charAt(0)!==J)return!1}return!0}function V(A,J){for(var te=0,se=A.length,fe;te<se;te++)if(fe=A[te],fe&&fe.indexOf(J)!==0)return!1;return!0}function Y(A,J){J=J||{},this._source_text=A||"",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 u(J)}Y.prototype.create_flags=function(A,J){var te=0;A&&(te=A.indentation_level,!this._output.just_added_newline()&&A.line_indent_level>te&&(te=A.line_indent_level));var se={mode:J,parent:A,last_token:A?A.last_token:new p(a.START_BLOCK,""),last_word:A?A.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:te,alignment:0,line_indent_level:A?A.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return se},Y.prototype._reset=function(A){var J=A.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,J),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(l.BlockStatement);var te=new f(A,this._options);return this._tokens=te.tokenize(),A},Y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A,J=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
|
|
`,J&&c.lineBreak.test(J||"")&&(te=J.match(c.lineBreak)[0]));for(var se=this._tokens.next();se;)this.handle_token(se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=se,se=this._tokens.next();return A=this._output.get_code(te),A},Y.prototype.handle_token=function(A,J){A.type===a.START_EXPR?this.handle_start_expr(A):A.type===a.END_EXPR?this.handle_end_expr(A):A.type===a.START_BLOCK?this.handle_start_block(A):A.type===a.END_BLOCK?this.handle_end_block(A):A.type===a.WORD?this.handle_word(A):A.type===a.RESERVED?this.handle_word(A):A.type===a.SEMICOLON?this.handle_semicolon(A):A.type===a.STRING?this.handle_string(A):A.type===a.EQUALS?this.handle_equals(A):A.type===a.OPERATOR?this.handle_operator(A):A.type===a.COMMA?this.handle_comma(A):A.type===a.BLOCK_COMMENT?this.handle_block_comment(A,J):A.type===a.COMMENT?this.handle_comment(A,J):A.type===a.DOT?this.handle_dot(A):A.type===a.EOF?this.handle_eof(A):A.type===a.UNKNOWN?this.handle_unknown(A,J):this.handle_unknown(A,J)},Y.prototype.handle_whitespace_and_comments=function(A,J){var te=A.newlines,se=this._options.keep_array_indentation&&g(this._flags.mode);if(A.comments_before)for(var fe=A.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,J),this.handle_token(fe,J),fe=A.comments_before.next();if(se)for(var Ue=0;Ue<te;Ue+=1)this.print_newline(Ue>0,J);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,J);for(var Re=1;Re<te;Re+=1)this.print_newline(!0,J)}};var U=["async","break","continue","return","throw","yield"];Y.prototype.allow_wrap_or_preserved_newline=function(A,J){if(J=J===void 0?!1:J,this._output.just_added_newline())return;var te=this._options.preserve_newlines&&A.newlines||J,se=d(this._flags.last_token.text,r)||d(A.text,r);if(se){var fe=d(this._flags.last_token.text,r)&&d(this._options.operator_position,b)||d(A.text,r);te=te&&fe}if(te)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,U))return;this._output.set_wrap_point()}},Y.prototype.print_newline=function(A,J){if(!J&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var te=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&x(te,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(A)&&(this._flags.multiline_frame=!0)},Y.prototype.print_token_line_indentation=function(A){this._output.just_added_newline()&&(this._options.keep_array_indentation&&A.newlines&&(A.text==="["||g(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(A.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))},Y.prototype.print_token=function(A){if(this._output.raw){this._output.add_raw_token(A);return}if(this._options.comma_first&&A.previous&&A.previous.type===a.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var J=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(J),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(A),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(A),this._output.non_breaking_space=!0,this._output.add_token(A.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Y.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.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))},Y.prototype.set_mode=function(A){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,A),this._flags=this.create_flags(this._previous_flags,A),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===l.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Y.prototype.start_of_object_property=function(){return this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},Y.prototype.start_of_statement=function(A){var J=!1;return J=J||R(this._flags.last_token,["var","let","const"])&&A.type===a.WORD,J=J||x(this._flags.last_token,"do"),J=J||!(this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement)&&R(this._flags.last_token,U)&&!A.newlines,J=J||x(this._flags.last_token,"else")&&!(x(A,"if")&&!A.comments_before),J=J||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===l.ForInitializer||this._previous_flags.mode===l.Conditional),J=J||this._flags.last_token.type===a.WORD&&this._flags.mode===l.BlockStatement&&!this._flags.in_case&&!(A.text==="--"||A.text==="++")&&this._last_last_text!=="function"&&A.type!==a.WORD&&A.type!==a.RESERVED,J=J||this._flags.mode===l.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),J?(this.set_mode(l.Statement),this.indent(),this.handle_whitespace_and_comments(A,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A,R(A,["do","for","if","while"])),!0):!1},Y.prototype.handle_start_expr=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A);var J=l.Expression;if(A.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(A),this.set_mode(J),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}J=l.ArrayLiteral,g(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())),d(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,J=l.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,J=l.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&A.whitespace_before===""?this._output.space_before_token=!1:(d(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===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var se=this._tokens.peek(-4);R(te,["async","function"])||te.text==="*"&&R(se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===l.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(se.text==="{"||se.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(A);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(A,A.newlines),this.print_token(A),this.set_mode(J),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Y.prototype.handle_end_expr=function(A){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(A,A.text==="]"&&g(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(A),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===l.Conditional&&(this._previous_flags.mode=l.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Y.prototype.handle_start_block=function(A){this.handle_whitespace_and_comments(A);var J=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(l.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(l.BlockStatement):te&&(d(te.text,[":",","])&&d(J.type,[a.STRING,a.WORD,a.RESERVED])||d(J.text,["get","set","..."])&&d(te.type,[a.WORD,a.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(te.text,[":",","])?this.set_mode(l.BlockStatement):this.set_mode(l.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(l.BlockStatement):d(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(l.ObjectLiteral):this.set_mode(l.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var se=!J.comments_before&&J.text==="}",fe=se&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var Ue=0,Re=null;this._flags.inline_frame=!0;do if(Ue+=1,Re=this._tokens.peek(Ue-1),Re.newlines){this._flags.inline_frame=!1;break}while(Re.type!==a.EOF&&!(Re.type===a.END_BLOCK&&Re.opened===A))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(fe||this._flags.last_token.type===a.EQUALS||R(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(g(this._previous_flags.mode)&&(this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(A),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(A),this.indent(),!se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Y.prototype.handle_end_block=function(A){for(this.handle_whitespace_and_comments(A);this._flags.mode===l.Statement;)this.restore_mode();var J=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!J?this._output.space_before_token=!0:this._options.brace_style==="expand"?J||this.print_newline():J||(g(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(A)},Y.prototype.handle_word=function(A){if(A.type===a.RESERVED){if(d(A.text,["set","get"])&&this._flags.mode!==l.ObjectLiteral)A.type=a.WORD;else if(A.text==="import"&&d(this._tokens.peek().text,["(","."]))A.type=a.WORD;else if(d(A.text,["as","from"])&&!this._flags.import_block)A.type=a.WORD;else if(this._flags.mode===l.ObjectLiteral){var J=this._tokens.peek();J.text===":"&&(A.type=a.WORD)}}if(this.start_of_statement(A)?R(this._flags.last_token,["var","let","const"])&&A.type===a.WORD&&(this._flags.declaration_statement=!0):A.newlines&&!T(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(A),this.print_newline()):this.handle_whitespace_and_comments(A),this._flags.do_block&&!this._flags.do_while)if(x(A,"while")){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&x(A,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===l.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(A,["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(A),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A)),x(A,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!A.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,U)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(T(this._flags.mode)||g(this._flags.mode))||this.print_newline(),this.print_token(A),this._flags.last_word=A.text;return}var te="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":R(A,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===l.BlockStatement?te="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&T(this._flags.mode)?te="SPACE":this._flags.last_token.type===a.STRING?te="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&d(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),R(A,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),R(A,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===l.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var se=this._output.current_line;se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?R(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(A,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!R(A,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(A,"if")&&x(A.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(A,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&g(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);A.previous&&(A.previous.type===a.WORD||A.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(A),this._flags.last_word=A.text,A.type===a.RESERVED&&(A.text==="do"?this._flags.do_block=!0:A.text==="if"?this._flags.if_block=!0:A.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(A,"from")&&(this._flags.import_block=!1))},Y.prototype.handle_semicolon=function(A){this.start_of_statement(A)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(A);for(var J=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&x(J,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(A)},Y.prototype.handle_string=function(A){A.text.startsWith("`")&&A.newlines===0&&A.whitespace_before===""&&(A.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(A)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(A),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A):A.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(A.previous.text==="]"||A.previous.text===")")&&A.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(A)},Y.prototype.handle_equals=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0},Y.prototype.handle_comma=function(A){this.handle_whitespace_and_comments(A,!0),this.print_token(A),this._output.space_before_token=!0,this._flags.declaration_statement?(T(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(A)):this._flags.mode===l.ObjectLiteral||this._flags.mode===l.Statement&&this._flags.parent.mode===l.ObjectLiteral?(this._flags.mode===l.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)},Y.prototype.handle_operator=function(A){var J=A.text==="*"&&(R(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),te=d(A.text,["-","+"])&&(d(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||d(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(A)){var se=!J;this.handle_whitespace_and_comments(A,se)}if(A.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(A);return}if(A.text==="::"){this.print_token(A);return}if(this._flags.last_token.type===a.OPERATOR&&d(this._options.operator_position,b)&&this.allow_wrap_or_preserved_newline(A),A.text===":"&&this._flags.in_case){this.print_token(A),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var fe=!0,Ue=!0,Re=!1;if(A.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,Re=!0):A.text==="?"&&(this._flags.ternary_depth+=1),!te&&!J&&this._options.preserve_newlines&&d(A.text,r)){var De=A.text===":",Fe=De&&Re,Me=De&&!Re;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!Me,this.print_token(A),(!De||Fe)&&this.allow_wrap_or_preserved_newline(A),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!De||Fe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(A):this._output.space_before_token=!1,this.print_token(A),this._output.space_before_token=!0;return;case E.preserve_newline:Me||this.allow_wrap_or_preserved_newline(A),fe=!(this._output.just_added_newline()||Me),this._output.space_before_token=fe,this.print_token(A),this._output.space_before_token=!0;return}}if(J){this.allow_wrap_or_preserved_newline(A),fe=!1;var ye=this._tokens.peek();Ue=ye&&d(ye.type,[a.WORD,a.RESERVED])}else if(A.text==="...")this.allow_wrap_or_preserved_newline(A),fe=this._flags.last_token.type===a.START_BLOCK,Ue=!1;else if(d(A.text,["--","++","!","~"])||te){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(A),fe=!1,Ue=!1,A.newlines&&(A.text==="--"||A.text==="++"||A.text==="~")){var le=R(this._flags.last_token,O)&&A.newlines;le&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(le,!0)}this._flags.last_token.text===";"&&T(this._flags.mode)&&(fe=!0),this._flags.last_token.type===a.RESERVED?fe=!0:this._flags.last_token.type===a.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(A.text==="--"||A.text==="++")):this._flags.last_token.type===a.OPERATOR&&(fe=d(A.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(A.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(Ue=!0)),(this._flags.mode===l.BlockStatement&&!this._flags.inline_frame||this._flags.mode===l.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||fe,this.print_token(A),this._output.space_before_token=Ue},Y.prototype.handle_block_comment=function(A,J){if(this._output.raw){this._output.add_raw_token(A),A.directives&&A.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(A.directives){this.print_newline(!1,J),this.print_token(A),A.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(A.text)&&!A.newlines){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0;return}else this.print_block_commment(A,J)},Y.prototype.print_block_commment=function(A,J){var te=h(A.text),se,fe=!1,Ue=!1,Re=A.whitespace_before,De=Re.length;if(this.print_newline(!1,J),this.print_token_line_indentation(A),this._output.add_token(te[0]),this.print_newline(!1,J),te.length>1){for(te=te.slice(1),fe=N(te,"*"),Ue=V(te,Re),fe&&(this._flags.alignment=1),se=0;se<te.length;se++)fe?(this.print_token_line_indentation(A),this._output.add_token(L(te[se]))):Ue&&te[se]?(this.print_token_line_indentation(A),this._output.add_token(te[se].substring(De))):(this._output.current_line.set_indent(-1),this._output.add_token(te[se])),this.print_newline(!1,J);this._flags.alignment=0}},Y.prototype.handle_comment=function(A,J){A.newlines?this.print_newline(!1,J):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(A),this.print_newline(!1,J)},Y.prototype.handle_dot=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(A,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(A)},Y.prototype.handle_unknown=function(A,J){this.print_token(A),A.text[A.text.length-1]===`
|
|
`&&this.print_newline(!1,J)},Y.prototype.handle_eof=function(A){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A)},P.exports.Beautifier=Y},function(P){function I(p){this.__parent=p,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=[]}I.prototype.clone_empty=function(){var p=new I(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},I.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},I.prototype.has_match=function(p){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(p))return!0;return!1},I.prototype.set_indent=function(p,c){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.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)},I.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},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(p){this.__items.push(p);var c=p.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=p.length-c:this.__character_count+=p.length},I.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function y(p,c){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),c=c||"",p.indent_level>0&&(c=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}y.prototype.get_indent_size=function(p,c){var u=this.__base_string_length;return c=c||0,p<0&&(u=0),u+=p*this.__indent_size,u+=c,u},y.prototype.get_indent_string=function(p,c){var u=this.__base_string;return c=c||0,p<0&&(p=0,u=""),c+=p*this.__indent_size,this.__ensure_cache(c),u+=this.__cache[c],u},y.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var p=this.__cache.length,c=0,u="";this.__indent_size&&p>=this.__indent_size&&(c=Math.floor(p/this.__indent_size),p-=c*this.__indent_size,u=new Array(c+1).join(this.__indent_string)),p&&(u+=new Array(p+1).join(" ")),this.__cache.push(u)};function m(p,c){this.__indent_cache=new y(p,c),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,c){return this.__indent_cache.get_indent_string(p,c)},m.prototype.get_indent_size=function(p,c){return this.__indent_cache.get_indent_size(p,c)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(u=u.replace(/[\n]/g,p)),u},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,c){return p=p||0,c=c||0,this.next_line.set_indent(p,c),this.__lines.length>1?(this.current_line.set_indent(p,c),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var c=0;c<p.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(p){for(var c=this.__lines.length;p<c;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,c){for(var u=this.__lines.length-2;u>=0;){var f=this.__lines[u];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==c){this.__lines.splice(u+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},P.exports.Output=m},function(P){function I(y,m,p,c){this.type=y,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}P.exports.Token=I},function(P,I){var y="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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",c="\\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",u="(?:\\\\u[0-9a-fA-F]{4}|["+y+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+c+"])*";I.identifier=new RegExp(u+f,"g"),I.identifierStart=new RegExp(u),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+c+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|
|
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(P,I,y){var m=y(6).Options,p=["before-newline","after-newline","preserve-newline"];function c(u){m.call(this,u,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var 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",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new m,P.exports.Options=c},function(P){function I(p,c){this.raw_options=y(p,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(p,c){var u=this.raw_options[p],f=c||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(f=u.concat()):typeof u=="string"&&(f=u.split(/[^a-zA-Z0-9_\/\-]+/)),f},I.prototype._get_boolean=function(p,c){var u=this.raw_options[p],f=u===void 0?!!c:!!u;return f},I.prototype._get_characters=function(p,c){var u=this.raw_options[p],f=c||"";return typeof u=="string"&&(f=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},I.prototype._get_number=function(p,c){var u=this.raw_options[p];c=parseInt(c,10),isNaN(c)&&(c=0);var f=parseInt(u,10);return isNaN(f)&&(f=c),f},I.prototype._get_selection=function(p,c,u){var f=this._get_selection_list(p,c,u);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f[0]},I.prototype._get_selection_list=function(p,c,u){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[c[0]],!this._is_valid_selection(u,c))throw new Error("Invalid Default Value!");var f=this._get_array(p,u);if(!this._is_valid_selection(f,c))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f},I.prototype._is_valid_selection=function(p,c){return p.length&&c.length&&!p.some(function(u){return c.indexOf(u)===-1})};function y(p,c){var u={};p=m(p);var f;for(f in p)f!==c&&(u[f]=p[f]);if(c&&p[c])for(f in p[c])u[f]=p[c][f];return u}function m(p){var c={},u;for(u in p){var f=u.replace(/-/g,"_");c[f]=p[u]}return c}P.exports.Options=I,P.exports.normalizeOpts=m,P.exports.mergeOpts=y},function(P,I,y){var m=y(8).InputScanner,p=y(9).Tokenizer,c=y(9).TOKEN,u=y(13).Directives,f=y(4),s=y(12).Pattern,r=y(14).TemplatablePattern;function a(N,V){return V.indexOf(N)!==-1}var d={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:c.START,RAW:c.RAW,EOF:c.EOF},L=new u(/\/\*/,/\*\//),C=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,R=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),w=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";w=w.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),w="\\?\\.(?!\\d) "+w,w=w.replace(/ /g,"|");var E=new RegExp(w),b="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),l=b.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+l.join("|")+")$"),h,g=function(N,V){p.call(this,N,V),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Y=new s(this._input),U=new r(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(f.identifier).matching(f.identifierMatch),number:Y.matching(C),punct:Y.matching(E),comment:Y.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Y.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Y.matching(/<!--/),html_comment_end:Y.matching(/-->/),include:Y.starting_with(/#include/).until_after(f.lineBreak),shebang:Y.starting_with(/#!/).until_after(f.lineBreak),xml:Y.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(/[`}\\]/)}};g.prototype=new p,g.prototype._is_comment=function(N){return N.type===d.COMMENT||N.type===d.BLOCK_COMMENT||N.type===d.UNKNOWN},g.prototype._is_opening=function(N){return N.type===d.START_BLOCK||N.type===d.START_EXPR},g.prototype._is_closing=function(N,V){return(N.type===d.END_BLOCK||N.type===d.END_EXPR)&&V&&(N.text==="]"&&V.text==="["||N.text===")"&&V.text==="("||N.text==="}"&&V.text==="{")},g.prototype._reset=function(){h=!1},g.prototype._get_next_token=function(N,V){var Y=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(d.EOF,""):(Y=Y||this._read_non_javascript(U),Y=Y||this._read_string(U),Y=Y||this._read_word(N),Y=Y||this._read_singles(U),Y=Y||this._read_comment(U),Y=Y||this._read_regexp(U,N),Y=Y||this._read_xml(U,N),Y=Y||this._read_punctuation(),Y=Y||this._create_token(d.UNKNOWN,this._input.next()),Y)},g.prototype._read_word=function(N){var V;if(V=this.__patterns.identifier.read(),V!=="")return V=V.replace(f.allLineBreaks,`
|
|
`),!(N.type===d.DOT||N.type===d.RESERVED&&(N.text==="set"||N.text==="get"))&&_.test(V)?(V==="in"||V==="of")&&(N.type===d.WORD||N.type===d.STRING)?this._create_token(d.OPERATOR,V):this._create_token(d.RESERVED,V):this._create_token(d.WORD,V);if(V=this.__patterns.number.read(),V!=="")return this._create_token(d.WORD,V)},g.prototype._read_singles=function(N){var V=null;return N==="("||N==="["?V=this._create_token(d.START_EXPR,N):N===")"||N==="]"?V=this._create_token(d.END_EXPR,N):N==="{"?V=this._create_token(d.START_BLOCK,N):N==="}"?V=this._create_token(d.END_BLOCK,N):N===";"?V=this._create_token(d.SEMICOLON,N):N==="."&&R.test(this._input.peek(1))?V=this._create_token(d.DOT,N):N===","&&(V=this._create_token(d.COMMA,N)),V&&this._input.next(),V},g.prototype._read_punctuation=function(){var N=this.__patterns.punct.read();if(N!=="")return N==="="?this._create_token(d.EQUALS,N):N==="?."?this._create_token(d.DOT,N):this._create_token(d.OPERATOR,N)},g.prototype._read_non_javascript=function(N){var V="";if(N==="#"){if(this._is_first_token()&&(V=this.__patterns.shebang.read(),V))return this._create_token(d.UNKNOWN,V.trim()+`
|
|
`);if(V=this.__patterns.include.read(),V)return this._create_token(d.UNKNOWN,V.trim()+`
|
|
`);N=this._input.next();var Y="#";if(this._input.hasNext()&&this._input.testChar(x)){do N=this._input.next(),Y+=N;while(this._input.hasNext()&&N!=="#"&&N!=="=");return N==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Y+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Y+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,Y)}this._input.back()}else if(N==="<"&&this._is_first_token()){if(V=this.__patterns.html_comment_start.read(),V){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)V+=this._input.next();return h=!0,this._create_token(d.COMMENT,V)}}else if(h&&N==="-"&&(V=this.__patterns.html_comment_end.read(),V))return h=!1,this._create_token(d.COMMENT,V);return null},g.prototype._read_comment=function(N){var V=null;if(N==="/"){var Y="";if(this._input.peek(1)==="*"){Y=this.__patterns.block_comment.read();var U=L.get_directives(Y);U&&U.ignore==="start"&&(Y+=L.readIgnored(this._input)),Y=Y.replace(f.allLineBreaks,`
|
|
`),V=this._create_token(d.BLOCK_COMMENT,Y),V.directives=U}else this._input.peek(1)==="/"&&(Y=this.__patterns.comment.read(),V=this._create_token(d.COMMENT,Y))}return V},g.prototype._read_string=function(N){if(N==="`"||N==="'"||N==='"'){var V=this._input.next();return this.has_char_escapes=!1,N==="`"?V+=this._read_string_recursive("`",!0,"${"):V+=this._read_string_recursive(N),this.has_char_escapes&&this._options.unescape_strings&&(V=T(V)),this._input.peek()===N&&(V+=this._input.next()),V=V.replace(f.allLineBreaks,`
|
|
`),this._create_token(d.STRING,V)}return null},g.prototype._allow_regexp_or_xml=function(N){return N.type===d.RESERVED&&a(N.text,["return","case","throw","else","do","typeof","yield"])||N.type===d.END_EXPR&&N.text===")"&&N.opened.previous.type===d.RESERVED&&a(N.opened.previous.text,["if","while","for"])||a(N.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},g.prototype._read_regexp=function(N,V){if(N==="/"&&this._allow_regexp_or_xml(V)){for(var Y=this._input.next(),U=!1,A=!1;this._input.hasNext()&&(U||A||this._input.peek()!==N)&&!this._input.testChar(f.newline);)Y+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?A=!0:this._input.peek()==="]"&&(A=!1)),this._input.next();return this._input.peek()===N&&(Y+=this._input.next(),Y+=this._input.read(f.identifier)),this._create_token(d.STRING,Y)}return null},g.prototype._read_xml=function(N,V){if(this._options.e4x&&N==="<"&&this._allow_regexp_or_xml(V)){var Y="",U=this.__patterns.xml.read_match();if(U){for(var A=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),J=A.indexOf("{")===0,te=0;U;){var se=!!U[1],fe=U[2],Ue=!!U[U.length-1]||fe.slice(0,8)==="![CDATA[";if(!Ue&&(fe===A||J&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--te:++te),Y+=U[0],te<=0)break;U=this.__patterns.xml.read_match()}return U||(Y+=this._input.match(/[\s\S]*/g)[0]),Y=Y.replace(f.allLineBreaks,`
|
|
`),this._create_token(d.STRING,Y)}}return null};function T(N){for(var V="",Y=0,U=new m(N),A=null;U.hasNext();)if(A=U.match(/([\s]|[^\\]|\\\\)+/g),A&&(V+=A[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")A=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")A=U.match(/u([0-9A-Fa-f]{4})/g);else{V+="\\",U.hasNext()&&(V+=U.next());continue}if(!A)return N;if(Y=parseInt(A[1],16),Y>126&&Y<=255&&A[0].indexOf("x")===0)return N;if(Y>=0&&Y<32){V+="\\"+A[0];continue}else Y===34||Y===39||Y===92?V+="\\"+String.fromCharCode(Y):V+=String.fromCharCode(Y)}return V}g.prototype._read_string_recursive=function(N,V,Y){var U,A;N==="'"?A=this.__patterns.single_quote:N==='"'?A=this.__patterns.double_quote:N==="`"?A=this.__patterns.template_text:N==="}"&&(A=this.__patterns.template_expression);for(var J=A.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===N||!V&&f.newline.test(te)){this._input.back();break}else te==="\\"&&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(),te+=this._input.next()):Y&&(Y==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),Y===te&&(N==="`"?te+=this._read_string_recursive("}",V,"`"):te+=this._read_string_recursive("`",V,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=A.read(),J+=te}return J},P.exports.Tokenizer=g,P.exports.TOKEN=d,P.exports.positionable_operators=O.slice(),P.exports.line_starters=b.slice()},function(P){var I=RegExp.prototype.hasOwnProperty("sticky");function y(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},y.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},y.prototype.__match=function(m,p){m.lastIndex=p;var c=m.exec(this.__input);return c&&!(I&&m.sticky)&&(c.index!==p&&(c=null)),c},y.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},y.prototype.testChar=function(m,p){var c=this.peek(p);return m.lastIndex=0,c!==null&&m.test(c)},y.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},y.prototype.read=function(m,p,c){var u="",f;return m&&(f=this.match(m),f&&(u+=f[0])),p&&(f||!m)&&(u+=this.readUntil(p,c)),u},y.prototype.readUntil=function(m,p){var c="",u=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(u=f.index,p&&(u+=f[0].length)):u=this.__input_length,c=this.__input.substring(this.__position,u),this.__position=u,c},y.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},y.prototype.get_regexp=function(m,p){var c=null,u="g";return p&&I&&(u="y"),typeof m=="string"&&m!==""?c=new RegExp(m,u):m&&(c=new RegExp(m.source,u)),c},y.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(m){var p=this.__position,c=this.readUntilAfter(m);return this.__position=p,c},y.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},P.exports.InputScanner=y},function(P,I,y){var m=y(8).InputScanner,p=y(3).Token,c=y(10).TokenStream,u=y(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(r,a){this._input=new m(r),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var r,a=new p(f.START,""),d=null,L=[],C=new c;a.type!==f.EOF;){for(r=this._get_next_token(a,d);this._is_comment(r);)C.add(r),r=this._get_next_token(a,d);C.isEmpty()||(r.comments_before=C,C=new c),r.parent=d,this._is_opening(r)?(L.push(d),d=r):d&&this._is_closing(r,d)&&(r.opened=d,d.closed=r,d=L.pop(),r.parent=d),r.previous=a,a.next=r,this.__tokens.add(r),a=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,a){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(f.RAW,d):this._create_token(f.EOF,"")},s.prototype._is_comment=function(r){return!1},s.prototype._is_opening=function(r){return!1},s.prototype._is_closing=function(r,a){return!1},s.prototype._create_token=function(r,a){var d=new p(r,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},P.exports.Tokenizer=s,P.exports.TOKEN=f},function(P){function I(y){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=y}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__tokens[this.__position],this.__position+=1),y},I.prototype.peek=function(y){var m=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(m=this.__tokens[y]),m},I.prototype.add=function(y){this.__parent_token&&(y.parent=this.__parent_token),this.__tokens.push(y),this.__tokens_length+=1},P.exports.TokenStream=I},function(P,I,y){var m=y(12).Pattern;function p(c,u){m.call(this,c,u),u?this._line_regexp=this._input.get_regexp(u._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new m,p.prototype.__set_whitespace_patterns=function(c,u){c+="\\t ",u+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+u+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+u+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var u=this.__split(this._newline_regexp,c);this.newline_count=u.length-1,this.whitespace_before_token=u[this.newline_count]}return c},p.prototype.matching=function(c,u){var f=this._create();return f.__set_whitespace_patterns(c,u),f._update(),f},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(c,u){c.lastIndex=0;for(var f=0,s=[],r=c.exec(u);r;)s.push(u.substring(f,r.index)),f=r.index+r[0].length,r=c.exec(u);return f<u.length?s.push(u.substring(f,u.length)):s.push(""),s},P.exports.WhitespacePattern=p},function(P){function I(y,m){this._input=y,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}I.prototype.read=function(){var y=this._input.read(this._starting_pattern);return(!this._starting_pattern||y)&&(y+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),y},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(y){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(y),m._update(),m},I.prototype.until=function(y){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(y),m._update(),m},I.prototype.starting_with=function(y){var m=this._create();return m._starting_pattern=this._input.get_regexp(y,!0),m._update(),m},I.prototype.matching=function(y){var m=this._create();return m._match_pattern=this._input.get_regexp(y,!0),m._update(),m},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},P.exports.Pattern=I},function(P){function I(y,m){y=typeof y=="string"?y:y.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+m,"g")}I.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(y);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(y);return m},I.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},P.exports.Directives=I},function(P,I,y){var m=y(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(u,f){m.call(this,u,f),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),f&&(this.__template_pattern=this._input.get_regexp(f.__template_pattern),this._excluded=Object.assign(this._excluded,f._excluded),this._disabled=Object.assign(this._disabled,f._disabled));var s=new m(u);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}/)}}c.prototype=new m,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(u){var f=this._create();return f._disabled[u]=!0,f._update(),f},c.prototype.read_options=function(u){var f=this._create();for(var s in p)f._disabled[s]=u.templating.indexOf(s)===-1;return f._update(),f},c.prototype.exclude=function(u){var f=this._create();return f._excluded[u]=!0,f._update(),f},c.prototype.read=function(){var u="";this._match_pattern?u=this._input.read(this._starting_pattern):u=this._input.read(this._starting_pattern,this.__template_pattern);for(var f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),u+=f,f=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},c.prototype.__set_templated_pattern=function(){var u=[];this._disabled.php||u.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||u.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(u.push(this.__patterns.django._starting_pattern.source),u.push(this.__patterns.django_value._starting_pattern.source),u.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||u.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&u.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+u.join("|")+")")},c.prototype._read_template=function(){var u="",f=this._input.peek();if(f==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(u=u||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(u=u||this.__patterns.handlebars_comment.read(),u=u||this.__patterns.handlebars_unescaped.read(),u=u||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(u=u||this.__patterns.django_value.read()),this._excluded.django||(u=u||this.__patterns.django_comment.read(),u=u||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(u=u||this.__patterns.smarty_comment.read(),u=u||this.__patterns.smarty_literal.read(),u=u||this.__patterns.smarty.read()));return u},P.exports.TemplatablePattern=c}],F={};function K(P){var I=F[P];if(I!==void 0)return I.exports;var y=F[P]={exports:{}};return D[P](y,y.exports,K),y.exports}var H=K(0);M=H})();var X=M;!(oe=[],j=function(){return{js_beautify:X}}.apply(et,oe),j!==void 0&&(ht.exports=j))})()},"6nfa":function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___24EuS",flex_space_between:"flex_space_between___H0sq_",flex_box_vertical_center:"flex_box_vertical_center___lroQv",flex_box_center_end:"flex_box_center_end___2zqAg",flex_box_column:"flex_box_column___1sePp",row:"row___FQAuJ",title:"title___1l3-g",tagsWrap:"tagsWrap___18FE-",action:"action___asdVT",bar:"bar___M_nl0",name:"name___BKyJY",active:"active___1eybt",tagsBorderWrap:"tagsBorderWrap___1NzgL"}},"7Cbv":function(ht,et,Z){"use strict";var oe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),j=new Uint8Array(16);function M(){if(!oe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oe(j)}var X=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function D(p){return typeof p=="string"&&X.test(p)}for(var F=D,K=[],H=0;H<256;++H)K.push((H+256).toString(16).substr(1));function P(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,u=(K[p[c+0]]+K[p[c+1]]+K[p[c+2]]+K[p[c+3]]+"-"+K[p[c+4]]+K[p[c+5]]+"-"+K[p[c+6]]+K[p[c+7]]+"-"+K[p[c+8]]+K[p[c+9]]+"-"+K[p[c+10]]+K[p[c+11]]+K[p[c+12]]+K[p[c+13]]+K[p[c+14]]+K[p[c+15]]).toLowerCase();if(!F(u))throw TypeError("Stringified UUID is invalid");return u}var I=P;function y(p,c,u){p=p||{};var f=p.random||(p.rng||M)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,c){u=u||0;for(var s=0;s<16;++s)c[u+s]=f[s];return c}return I(f)}var m=et.a=y},"7ahc":function(ht,et,Z){"use strict";Z.d(et,"a",function(){return L});var oe=Z("k1fw"),j=Z("0Owb"),M=Z("+L6B"),X=Z("2/Rp"),D=Z("y8nQ"),F=Z("Vl3Y"),K=Z("tJVT"),H=Z("OaEy"),P=Z("2fM7"),I=Z("cDcd"),y=Z.n(I),m=Z("VrN/"),p=Z.n(m),c=Z("p77/"),u=Z.n(c),f=Z("c5Ni"),s=Z.n(f),r=P.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},d={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};et.b=function(C){var x=C.callback,R=C.onCancel,O=Object(I.useState)("python"),w=Object(K.a)(O,2),E=w[0],b=w[1];function l(h){b(d[h][1])}function _(h){x(h)}return y.a.createElement(F.a,Object(j.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),y.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(P.a,{onChange:l},Object.keys(d).map(function(h){return y.a.createElement(r,{key:h,value:h},d[h][0])}))),y.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(L,{mode:E})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(X.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function L(C){var x=C.value,R=C.onChange,O=C.mode,w=C.options,E=w===void 0?{}:w,b=Object(I.useRef)(),l=Object(I.useState)(),_=Object(K.a)(l,2),h=_[0],g=_[1];return Object(I.useEffect)(function(){if(h){function T(N){var V=N.getValue();R&&R(V)}return h.on("change",T),function(){h.off("change",T)}}},[h,R]),Object(I.useEffect)(function(){h&&h.setOption("mode",O)},[h,O]),Object(I.useEffect)(function(){h&&((x!==h.getValue()||x==="")&&setTimeout(function(){h.setValue(x||" ")},300))},[h,x]),Object(I.useEffect)(function(){if(b.current&&!h){var T=p.a.fromTextArea(b.current,Object(oe.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));g(T)}},[b.current,h]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:b}))}},"7qnI":function(ht,et,Z){"use strict";var oe=Z("5Dmo"),j=Z("3S7+"),M=Z("fWQN"),X=Z("mtLc"),D=Z("yKVA"),F=Z("879j"),K=Z("5NDa"),H=Z("5rEg"),P=Z("cDcd"),I=Z.n(P),y=Z("O2Wb"),m=Z.n(y),p=H.a.TextArea,c=function(u){Object(D.a)(s,u);var f=Object(F.a)(s);function s(){return Object(M.a)(this,s),f.apply(this,arguments)}return Object(X.a)(s,[{key:"render",value:function(){var a=this,d=this.props,L=d.index,C=d.onAnswerChange,x=d.addChildAnswer,R=d.exerciseIsPublish,O=d.answers,w=d.activeOptionErrorIndex,E=d.flex,b=E===void 0?"0 0 1000px":E;return I.a.createElement("div",{className:m.a.flex},I.a.createElement("div",{className:"".concat(m.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",L+1,"):"),I.a.createElement("div",{className:"".concat(m.a.flex," ").concat(m.a.flex1),style:{flexDirection:"column"}},O.map(function(l,_){var h="".concat(L,"-").concat(_);return I.a.createElement("div",{className:"".concat(m.a.flex," ").concat(m.a.flex1),key:_},I.a.createElement("div",{className:m.a.flex1,style:{flex:b}},I.a.createElement("div",null,I.a.createElement(p,{className:h===w?m.a.error:"",spellCheck:!1,rows:4,value:l||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(_==0?"":"(\u53EF\u9009)"),onChange:function(T){return C(L,_,T.target.value)},style:{minHeight:95}}))),!R&&I.a.createElement(I.a.Fragment,null,_!=0&&I.a.createElement(j.a,{title:"\u5220\u9664"},I.a.createElement("i",{className:"".concat(m.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return a.props.deleteChildAnswer(L,_)},style:{float:"right"}})),_===0&&I.a.createElement(j.a,{title:"\u5220\u9664"},I.a.createElement("i",{className:"".concat(m.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return a.props.deleteChildAnswermain(L,_)},style:{float:"right"}})),I.a.createElement(j.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},I.a.createElement("i",{className:"".concat(m.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return x(L)},style:{float:"right",visibility:_==O.length-1?"":"hidden"}}))))})))}}]),s}(P.Component);et.a=c},"8EBN":function(ht,et,Z){(function(oe){oe(Z("VrN/"))})(function(oe){"use strict";oe.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var j=0;j<oe.modeInfo.length;j++){var M=oe.modeInfo[j];M.mimes&&(M.mime=M.mimes[0])}oe.findModeByMIME=function(X){X=X.toLowerCase();for(var D=0;D<oe.modeInfo.length;D++){var F=oe.modeInfo[D];if(F.mime==X)return F;if(F.mimes){for(var K=0;K<F.mimes.length;K++)if(F.mimes[K]==X)return F}}if(/\+xml$/.test(X))return oe.findModeByMIME("application/xml");if(/\+json$/.test(X))return oe.findModeByMIME("application/json")},oe.findModeByExtension=function(X){X=X.toLowerCase();for(var D=0;D<oe.modeInfo.length;D++){var F=oe.modeInfo[D];if(F.ext){for(var K=0;K<F.ext.length;K++)if(F.ext[K]==X)return F}}},oe.findModeByFileName=function(X){for(var D=0;D<oe.modeInfo.length;D++){var F=oe.modeInfo[D];if(F.file&&F.file.test(X))return F}var K=X.lastIndexOf("."),H=K>-1&&X.substring(K+1,X.length);if(H)return oe.findModeByExtension(H)},oe.findModeByName=function(X){X=X.toLowerCase();for(var D=0;D<oe.modeInfo.length;D++){var F=oe.modeInfo[D];if(F.name.toLowerCase()==X)return F;if(F.alias){for(var K=0;K<F.alias.length;K++)if(F.alias[K].toLowerCase()==X)return F}}}})},"8WcF":function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___2fahw",flex_space_between:"flex_space_between___1h4HM",flex_box_vertical_center:"flex_box_vertical_center___2kxeE",flex_box_center_end:"flex_box_center_end___OjPB4",flex_box_column:"flex_box_column___3zY1h",orderWrap:"orderWrap___VQuq1",orderIconWrap:"orderIconWrap___18q7W",orderAsc:"orderAsc___3WBGg",orderDesc:"orderDesc____ipxK",active:"active___3EMfI",cursorPointer:"cursorPointer___3og_L",orderTextWrap:"orderTextWrap___XQlmv"}},"8hTe":function(ht,et,Z){ht.exports={button:"button___1wy9m"}},"8mKB":function(ht,et,Z){"use strict";var oe=Z("rePB"),j=Z("1OyB"),M=Z("vuIU"),X=Z("Ji7U"),D=Z("md7G"),F=Z("foSv"),K=Z("cDcd"),H=Z.n(K),P=Z("m+aA"),I=Z("TSYQ"),y=Z.n(I),m=Z("4IlW");function p(E){var b=E.pageXOffset,l="scrollLeft";if(typeof b!="number"){var _=E.document;b=_.documentElement[l],typeof b!="number"&&(b=_.body[l])}return b}function c(E){var b,l,_=E.ownerDocument,h=_.body,g=_&&_.documentElement,T=E.getBoundingClientRect();return b=T.left,l=T.top,b-=g.clientLeft||h.clientLeft||0,l-=g.clientTop||h.clientTop||0,{left:b,top:l}}function u(E){var b=c(E),l=E.ownerDocument,_=l.defaultView||l.parentWindow;return b.left+=p(_),b.left}function f(E){var b=s();return function(){var _=Object(F.a)(E),h;if(b){var g=Object(F.a)(this).constructor;h=Reflect.construct(_,arguments,g)}else h=_.apply(this,arguments);return Object(D.a)(this,h)}}function s(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(E){return!1}}var r=function(E){Object(X.a)(l,E);var b=f(l);function l(){var _;return Object(j.a)(this,l),_=b.apply(this,arguments),_.onHover=function(h){var g=_.props,T=g.onHover,N=g.index;T(h,N)},_.onClick=function(h){var g=_.props,T=g.onClick,N=g.index;T(h,N)},_.onKeyDown=function(h){var g=_.props,T=g.onClick,N=g.index;h.keyCode===13&&T(h,N)},_}return Object(M.a)(l,[{key:"getClassName",value:function(){var h=this.props,g=h.prefixCls,T=h.index,N=h.value,V=h.allowHalf,Y=h.focused,U=T+1,A=g;return N===0&&T===0&&Y?A+=" ".concat(g,"-focused"):V&&N+.5>=U&&N<U?(A+=" ".concat(g,"-half ").concat(g,"-active"),Y&&(A+=" ".concat(g,"-focused"))):(A+=U<=N?" ".concat(g,"-full"):" ".concat(g,"-zero"),U===N&&Y&&(A+=" ".concat(g,"-focused"))),A}},{key:"render",value:function(){var h=this.onHover,g=this.onClick,T=this.onKeyDown,N=this.props,V=N.disabled,Y=N.prefixCls,U=N.character,A=N.characterRender,J=N.index,te=N.count,se=N.value,fe=typeof U=="function"?U(this.props):U,Ue=H.a.createElement("li",{className:this.getClassName()},H.a.createElement("div",{onClick:V?null:g,onKeyDown:V?null:T,onMouseMove:V?null:h,role:"radio","aria-checked":se>J?"true":"false","aria-posinset":J+1,"aria-setsize":te,tabIndex:V?-1:0},H.a.createElement("div",{className:"".concat(Y,"-first")},fe),H.a.createElement("div",{className:"".concat(Y,"-second")},fe)));return A&&(Ue=A(Ue,this.props)),Ue}}]),l}(H.a.Component);function a(E,b){var l=Object.keys(E);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(E);b&&(_=_.filter(function(h){return Object.getOwnPropertyDescriptor(E,h).enumerable})),l.push.apply(l,_)}return l}function d(E){for(var b=1;b<arguments.length;b++){var l=arguments[b]!=null?arguments[b]:{};b%2?a(Object(l),!0).forEach(function(_){Object(oe.a)(E,_,l[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(l)):a(Object(l)).forEach(function(_){Object.defineProperty(E,_,Object.getOwnPropertyDescriptor(l,_))})}return E}function L(E){var b=C();return function(){var _=Object(F.a)(E),h;if(b){var g=Object(F.a)(this).constructor;h=Reflect.construct(_,arguments,g)}else h=_.apply(this,arguments);return Object(D.a)(this,h)}}function C(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(E){return!1}}function x(){}var R=function(E){Object(X.a)(l,E);var b=L(l);function l(_){var h;Object(j.a)(this,l),h=b.call(this,_),h.onHover=function(T,N){var V=h.props.onHoverChange,Y=h.getStarValue(N,T.pageX),U=h.state.cleanedValue;Y!==U&&h.setState({hoverValue:Y,cleanedValue:null}),V(Y)},h.onMouseLeave=function(){var T=h.props.onHoverChange;h.setState({hoverValue:void 0,cleanedValue:null}),T(void 0)},h.onClick=function(T,N){var V=h.props.allowClear,Y=h.state.value,U=h.getStarValue(N,T.pageX),A=!1;V&&(A=U===Y),h.onMouseLeave(),h.changeValue(A?0:U),h.setState({cleanedValue:A?U:null})},h.onFocus=function(){var T=h.props.onFocus;h.setState({focused:!0}),T&&T()},h.onBlur=function(){var T=h.props.onBlur;h.setState({focused:!1}),T&&T()},h.onKeyDown=function(T){var N=T.keyCode,V=h.props,Y=V.count,U=V.allowHalf,A=V.onKeyDown,J=V.direction,te=J==="rtl",se=h.state.value;N===m.a.RIGHT&&se<Y&&!te?(U?se+=.5:se+=1,h.changeValue(se),T.preventDefault()):N===m.a.LEFT&&se>0&&!te||N===m.a.RIGHT&&se>0&&te?(U?se-=.5:se-=1,h.changeValue(se),T.preventDefault()):N===m.a.LEFT&&se<Y&&te&&(U?se+=.5:se+=1,h.changeValue(se),T.preventDefault()),A&&A(T)},h.saveRef=function(T){return function(N){h.stars[T]=N}},h.saveRate=function(T){h.rate=T};var g=_.value;return g===void 0&&(g=_.defaultValue),h.stars={},h.state={value:g,focused:!1,cleanedValue:null},h}return Object(M.a)(l,[{key:"componentDidMount",value:function(){var h=this.props,g=h.autoFocus,T=h.disabled;g&&!T&&this.focus()}},{key:"getStarDOM",value:function(h){return Object(P.a)(this.stars[h])}},{key:"getStarValue",value:function(h,g){var T=this.props,N=T.allowHalf,V=T.direction,Y=V==="rtl",U=h+1;if(N){var A=this.getStarDOM(h),J=u(A),te=A.clientWidth;(Y&&g-J>te/2||!Y&&g-J<te/2)&&(U-=.5)}return U}},{key:"focus",value:function(){var h=this.props.disabled;h||this.rate.focus()}},{key:"blur",value:function(){var h=this.props.disabled;h||this.rate.blur()}},{key:"changeValue",value:function(h){var g=this.props.onChange;"value"in this.props||this.setState({value:h}),g(h)}},{key:"render",value:function(){for(var h=this.props,g=h.count,T=h.allowHalf,N=h.style,V=h.prefixCls,Y=h.disabled,U=h.className,A=h.character,J=h.characterRender,te=h.tabIndex,se=h.direction,fe=this.state,Ue=fe.value,Re=fe.hoverValue,De=fe.focused,Fe=[],Me=Y?"".concat(V,"-disabled"):"",ye=0;ye<g;ye+=1)Fe.push(H.a.createElement(r,{ref:this.saveRef(ye),index:ye,count:g,disabled:Y,prefixCls:"".concat(V,"-star"),allowHalf:T,value:Re===void 0?Ue:Re,onClick:this.onClick,onHover:this.onHover,key:ye,character:A,characterRender:J,focused:De}));var le=y()(V,Me,U,Object(oe.a)({},"".concat(V,"-rtl"),se==="rtl"));return H.a.createElement("ul",{className:le,style:N,onMouseLeave:Y?null:this.onMouseLeave,tabIndex:Y?-1:te,onFocus:Y?null:this.onFocus,onBlur:Y?null:this.onBlur,onKeyDown:Y?null:this.onKeyDown,ref:this.saveRate,role:"radiogroup"},Fe)}}],[{key:"getDerivedStateFromProps",value:function(h,g){return"value"in h&&h.value!==void 0?d(d({},g),{},{value:h.value}):g}}]),l}(H.a.Component);R.defaultProps={defaultValue:0,count:5,allowHalf:!1,allowClear:!0,style:{},prefixCls:"rc-rate",onChange:x,character:"\u2605",onHoverChange:x,tabIndex:0,direction:"ltr"};var O=R,w=et.a=O},"9Bee":function(ht,et,Z){"use strict";var oe=Z("DYRE"),j=Z("zeV3"),M=Z("+L6B"),X=Z("2/Rp"),D=Z("k1fw"),F=Z("9og8"),K=Z("tJVT"),H=Z("WmNS"),P=Z.n(H),I=Z("cDcd"),y=Z.n(I),m=Z("vg9a"),p=Z("DlQD"),c=Z.n(p),u=Z("rUJ1");function f(G,v){var S=G.match(/^(\s+)(?:```)/);if(S===null)return v;var B=S[1];return v.split(`
|
|
`).map(function(q){var W=q.match(/^\s+/);if(W===null)return q;var ue=Object(K.a)(W,1),We=ue[0];return We.length>=B.length?q.slice(B.length):q}).join(`
|
|
`)}var s=[],r=["<ul>"],a=new c.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function L(){s.length=0,r=["<ul>"]}var C={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(G,v,S,B){if(v>=G.length||G[v].level<=S)return v;var q=G[v];B.push("<li><a href='#"+q.anchor+"'>"+q.text+"</a>"),v++;var W=[];return v=x(G,v,q.level,W),W.length>0&&(B.push("<ul>"),W.forEach(function(ue){B.push(ue)}),B.push("</ul>")),B.push("</li>"),v=x(G,v,S,B),v}function R(){return x(s,0,0,r),r.push("</ul>"),r.join("")}var O={heading:function(v){var S=d.exec(v);if(S)return{type:"heading",raw:S[0],depth:S[1].length,text:S[2]}},fences:function(v){var S=this.rules.block.fences.exec(v);if(S){var B=S[0],q=f(B,S[3]||""),W=S[2]?S[2].trim():S[2];if(["latex","katex","math"].indexOf(W)>=0){var ue=b(),We=q;q=ue,l[ue]={type:"block",expression:We}}return{type:"code",raw:B,lang:W,text:q}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,b=function(){return"__special_katext_id_".concat(E++,"__")},l={};function _(){return l}function h(){E=0,l={}}function g(G){return G=G.replace(w,function(v,S){var B=b();return l[B]={type:"inline",expression:S},B}),G}var T=a.listitem;a.listitem=function(G){return T(g(G))};var N=a.paragraph;a.paragraph=function(G){return N(g(G))};var V=a.tablecell;a.tablecell=function(G,v){return V(g(G),v)},a.code=function(G,v,S){var B=(v||"").match(/\S*/)[0];return B?["latex","katex","math"].indexOf(B)>=0?"<p class='editormd-tex'>".concat(G,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(v,'">').concat(S?G:Object(u.escape)(G,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(S?G:Object(u.escape)(G,!0))+"</code></pre>"},a.heading=function(G,v,S){var B=this.options.headerPrefix+S.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:B,level:v,text:G}),"<h"+v+' id="'+B+'">'+G+"</h"+v+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:O,renderer:a});var Y=c.a,U=Z("SJMd"),A=Z("ulZh"),J=Z.n(A),te=Z("m3rI"),se=Z("Oy/b"),fe=Z("p5ED"),Ue=Z("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Re=function(G,v){return(Re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,B){S.__proto__=B}||function(S,B){for(var q in B)Object.prototype.hasOwnProperty.call(B,q)&&(S[q]=B[q])})(G,v)};function De(G,v){function S(){this.constructor=G}Re(G,v),G.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}function Fe(G,v,S,B){return new(S||(S=Promise))(function(q,W){function ue(Lt){try{Ye(B.next(Lt))}catch(Ke){W(Ke)}}function We(Lt){try{Ye(B.throw(Lt))}catch(Ke){W(Ke)}}function Ye(Lt){var Ke;Lt.done?q(Lt.value):(Ke=Lt.value,Ke instanceof S?Ke:new S(function(gt){gt(Ke)})).then(ue,We)}Ye((B=B.apply(G,v||[])).next())})}function Me(G,v){var S,B,q,W,ue={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return W={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(W[Symbol.iterator]=function(){return this}),W;function We(Ye){return function(Lt){return function(Ke){if(S)throw new TypeError("Generator is already executing.");for(;ue;)try{if(S=1,B&&(q=2&Ke[0]?B.return:Ke[0]?B.throw||((q=B.return)&&q.call(B),0):B.next)&&!(q=q.call(B,Ke[1])).done)return q;switch(B=0,q&&(Ke=[2&Ke[0],q.value]),Ke[0]){case 0:case 1:q=Ke;break;case 4:return ue.label++,{value:Ke[1],done:!1};case 5:ue.label++,B=Ke[1],Ke=[0];continue;case 7:Ke=ue.ops.pop(),ue.trys.pop();continue;default:if(!(q=ue.trys,(q=q.length>0&&q[q.length-1])||Ke[0]!==6&&Ke[0]!==2)){ue=0;continue}if(Ke[0]===3&&(!q||Ke[1]>q[0]&&Ke[1]<q[3])){ue.label=Ke[1];break}if(Ke[0]===6&&ue.label<q[1]){ue.label=q[1],q=Ke;break}if(q&&ue.label<q[2]){ue.label=q[2],ue.ops.push(Ke);break}q[2]&&ue.ops.pop(),ue.trys.pop();continue}Ke=v.call(G,ue)}catch(gt){Ke=[6,gt],B=0}finally{S=q=0}if(5&Ke[0])throw Ke[1];return{value:Ke[0]?Ke[1]:void 0,done:!0}}([Ye,Lt])}}}function ye(){for(var G=0,v=0,S=arguments.length;v<S;v++)G+=arguments[v].length;var B=Array(G),q=0;for(v=0;v<S;v++)for(var W=arguments[v],ue=0,We=W.length;ue<We;ue++,q++)B[q]=W[ue];return B}var le=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(v,S){for(var B=0,q=S;B<q.length;B++){var W=q[B],ue=W[0],We=W[1];v.setAttribute(ue,We)}},G.createRect=function(v,S,B){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",v.toString()),q.setAttribute("height",S.toString()),B&&G.setAttributes(q,B),q},G.createLine=function(v,S,B,q,W){var ue=document.createElementNS("http://www.w3.org/2000/svg","line");return ue.setAttribute("x1",v.toString()),ue.setAttribute("y1",S.toString()),ue.setAttribute("x2",B.toString()),ue.setAttribute("y2",q.toString()),W&&G.setAttributes(ue,W),ue},G.createPolygon=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","polygon");return B.setAttribute("points",v),S&&G.setAttributes(B,S),B},G.createCircle=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","circle");return B.setAttribute("cx",(v/2).toString()),B.setAttribute("cy",(v/2).toString()),B.setAttribute("r",v.toString()),S&&G.setAttributes(B,S),B},G.createEllipse=function(v,S,B){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(v/2).toString()),q.setAttribute("cy",(S/2).toString()),q.setAttribute("rx",(v/2).toString()),q.setAttribute("ry",(S/2).toString()),B&&G.setAttributes(q,B),q},G.createGroup=function(v){var S=document.createElementNS("http://www.w3.org/2000/svg","g");return v&&G.setAttributes(S,v),S},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(v,S,B,q,W,ue,We){var Ye=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(Ye,[["id",v],["orient",S],["markerWidth",B.toString()],["markerHeight",q.toString()],["refX",W.toString()],["refY",ue.toString()]]),Ye.appendChild(We),Ye},G.createText=function(v){var S=document.createElementNS("http://www.w3.org/2000/svg","text");return S.setAttribute("x","0"),S.setAttribute("y","0"),v&&G.setAttributes(S,v),S},G.createTSpan=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","tspan");return B.textContent=v,S&&G.setAttributes(B,S),B},G.createImage=function(v){var S=document.createElementNS("http://www.w3.org/2000/svg","image");return v&&G.setAttributes(S,v),S},G.createPoint=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return B.x=v,B.y=S,B},G.createPath=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","path");return B.setAttribute("d",v),S&&G.setAttributes(B,S),B},G}(),Se=function(){function G(){}return G.addKey=function(v){G.key=v},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),ot=function(){function G(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return G.prototype.rasterize=function(v,S,B){var q=this;return new Promise(function(W){var ue=B!==void 0?B:document.createElement("canvas");v===null&&(q.markersOnly=!0,q.naturalSize=!1);var We=document.createElementNS("http://www.w3.org/2000/svg","svg");We.setAttribute("xmlns","http://www.w3.org/2000/svg"),We.setAttribute("width",S.width.baseVal.valueAsString),We.setAttribute("height",S.height.baseVal.valueAsString),We.setAttribute("viewBox","0 0 "+S.viewBox.baseVal.width.toString()+" "+S.viewBox.baseVal.height.toString()),We.innerHTML=S.innerHTML,q.naturalSize===!0?(We.width.baseVal.value=v.naturalWidth,We.height.baseVal.value=v.naturalHeight):q.width!==void 0&&q.height!==void 0&&(We.width.baseVal.value=q.width,We.height.baseVal.value=q.height),ue.width=We.width.baseVal.value,ue.height=We.height.baseVal.value;var Ye=We.outerHTML,Lt=ue.getContext("2d");q.markersOnly!==!0&&Lt.drawImage(v,0,0,ue.width,ue.height);var Ke=window.URL,gt=new Image(ue.width,ue.height);gt.setAttribute("crossOrigin","anonymous");var an=new Blob([Ye],{type:"image/svg+xml"}),Hn=Ke.createObjectURL(an);gt.onload=function(){Lt.drawImage(gt,0,0),Ke.revokeObjectURL(Hn);var qn=ue.toDataURL(q.imageType,q.imageQuality);W(qn)},gt.src=Hn})},G}(),it=function(){},ct=function(){function G(v){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+v+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),G.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},G.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)},G.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 xt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new xt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new xt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Xe("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Xe("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},G.prototype.removeStyleSheet=function(){var v;this.styleSheet&&(((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),xt=function(G,v){this.selector=G,this.style=v},Xe=function(G,v){this.localName=G,this.style=v},qe=function(){function G(v,S,B,q,W){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=v,this.displayMode=S,this.markerItems=B,this.uiStyleSettings=q,this.styles=W,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return G.prototype.show=function(v){var S=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 B=document.createElement("div");B.className=this.toolbarBlockStyleClass.name,B.style.whiteSpace="nowrap",this.uiContainer.appendChild(B),this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(W){var ue=document.createElement("div");ue.className=""+S.toolbarButtonStyleClass.name,ue.setAttribute("data-type-name",W.typeName),ue.innerHTML=W.icon,ue.addEventListener("click",function(){S.markerToolbarButtonClicked(ue,W)}),S.buttons.push(ue),S.markerButtons.push(ue)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},G.prototype.addButtonClickListener=function(v){this.buttonClickListeners.push(v)},G.prototype.removeButtonClickListener=function(v){this.buttonClickListeners.indexOf(v)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(v),1)},G.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},G.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 S=0;S<this.markerButtons.length;S++)S<v||S===v&&this.markerButtons.length-1===v?this.markerButtonBlock.appendChild(this.markerButtons[S]):(S===v&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[S]))}},G.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")},G.prototype.resetButtonStyles=function(){var v=this;this.buttons.forEach(function(S){S.className=S.className.replace(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name,"").trim(),S.className=S.className.replace(v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:v.toolbarActiveButtonStyleColorsClass.name,"").trim(),S.className+=" "+(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name)})},G.prototype.addActionButton=function(v,S,B){var q=this,W=document.createElement("div");switch(W.className=""+this.toolbarButtonStyleClass.name,W.innerHTML=S,W.setAttribute("data-action",B),W.addEventListener("click",function(){q.actionToolbarButtonClicked(W,B)}),B){case"select":W.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":W.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":W.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":W.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":W.style.fill=this.uiStyleSettings.closeButtonColor}v.appendChild(W),this.buttons.push(W)},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Xe("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 Xe("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Xe("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Xe("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 Xe("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var v=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Xe("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 Xe("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Xe("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},G.prototype.markerToolbarButtonClicked=function(v,S){this.setActiveButton(v),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("marker",S)}),this.markerButtonOverflowBlock.style.display="none"},G.prototype.actionToolbarButtonClicked=function(v,S){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("action",S)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},G.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)},G.prototype.setActiveMarkerButton=function(v){var S=this.markerButtons.find(function(B){return B.getAttribute("data-type-name")===v});S&&this.setActiveButton(S)},G.prototype.setCurrentMarker=function(v){var S=this;this.currentMarker=v,this.buttons.filter(function(B){return/delete|notes/.test(B.getAttribute("data-action"))}).forEach(function(B){S.currentMarker===void 0?(B.style.fillOpacity="0.4",B.style.pointerEvents="none"):(B.style.fillOpacity="1",B.style.pointerEvents="all")})},G}(),dt=function(){function G(v,S,B,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=v,this.displayMode=S,this.uiStyleSettings=B,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return G.prototype.addStyles=function(){var v;this.toolboxStyleClass=this.styles.addClass(new Xe("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 Xe("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var S=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Xe("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Xe("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Xe("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 Xe("toolbox-panel-row_colors",`
|
|
background-color: `+((v=this.uiStyleSettings.toolboxBackgroundColor)!==null&&v!==void 0?v:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Xe("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
|
|
padding: `+S+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Xe("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Xe("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new xt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new xt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},G.prototype.show=function(v){var S;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolboxStyleClass.name+" "+((S=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&S!==void 0?S:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},G.prototype.setPanelButtons=function(v){var S,B,q=this;this.panels=v,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((S=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&S!==void 0?S:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((B=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(W){var ue;W.uiStyleSettings=q.uiStyleSettings;var We=document.createElement("div");We.className=q.toolboxButtonStyleClass.name+" "+((ue=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ue!==void 0?ue:q.toolboxButtonStyleColorsClass.name),We.innerHTML=W.icon,We.title=W.title,We.addEventListener("click",function(){q.panelButtonClick(W)}),q.panelButtons.push(We),q.buttonRow.appendChild(We)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},G.prototype.panelButtonClick=function(v){var S=this,B=-1;if(v!==this.activePanel){B=this.panels.indexOf(v),this.panelRow.innerHTML="";var q=v.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=v}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){S.displayMode==="inline"?S.panelRow.style.display="none":S.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(W,ue){var We,Ye;W.className=S.toolboxButtonStyleClass.name+" "+(ue===B?""+((We=S.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&We!==void 0?We:S.toolboxActiveButtonStyleColorsClass.name):""+((Ye=S.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ye!==void 0?Ye:S.toolboxButtonStyleColorsClass.name))})},G}(),vt=function(G,v){this.title=G,this.icon=v},st=function(G){function v(S,B,q,W){var ue=G.call(this,S,W||'<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 ue.colors=[],ue.addTransparent=!1,ue.colorBoxes=[],ue.colors=B,ue.currentColor=q,ue.setCurrentColor=ue.setCurrentColor.bind(ue),ue.getColorBox=ue.getColorBox.bind(ue),ue}return De(v,G),v.prototype.getUi=function(){var S=this,B=document.createElement("div");return B.style.overflow="hidden",B.style.whiteSpace="nowrap",this.colors.forEach(function(q){var W=S.getColorBox(q);B.appendChild(W),S.colorBoxes.push(W)}),B},v.prototype.getColorBox=function(S){var B=this,q=this.uiStyleSettings.toolbarHeight/4,W=this.uiStyleSettings.toolbarHeight-q,ue=document.createElement("div");ue.style.display="inline-block",ue.style.boxSizing="content-box",ue.style.width=W-2+"px",ue.style.height=W-2+"px",ue.style.padding="1px",ue.style.marginRight="2px",ue.style.marginBottom="2px",ue.style.borderWidth="2px",ue.style.borderStyle="solid",ue.style.borderRadius=(W+2)/2+"px",ue.style.borderColor=S===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ue.addEventListener("click",function(){B.setCurrentColor(S,ue)});var We=document.createElement("div");return We.style.display="inline-block",We.style.width=W-2+"px",We.style.height=W-2+"px",We.style.backgroundColor=S,We.style.borderRadius=W/2+"px",S==="transparent"&&(We.style.fill=this.uiStyleSettings.toolboxAccentColor,We.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>`),ue.appendChild(We),ue},v.prototype.setCurrentColor=function(S,B){var q=this;this.currentColor=S,this.colorBoxes.forEach(function(W){W.style.borderColor=W===B?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(S)},v}(vt),tt=function(){function G(v,S,B){this._state="new",this._isSelected=!1,this._container=v,this._overlayContainer=S,this.globalSettings=B,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(G.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),G.prototype.ownsTarget=function(v){return!1},Object.defineProperty(G.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),G.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},G.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},G.prototype.pointerDown=function(v,S){},G.prototype.dblClick=function(v,S){},G.prototype.manipulate=function(v){},G.prototype.pointerUp=function(v){this.stateChanged()},G.prototype.dispose=function(){},G.prototype.addMarkerVisualToContainer=function(v){this.container.childNodes.length>0?this.container.insertBefore(v,this.container.childNodes[0]):this.container.appendChild(v)},G.prototype.getState=function(){return{typeName:G.typeName,state:this.state,notes:this.notes}},G.prototype.restoreState=function(v){this._state=v.state,this.notes=v.notes},G.prototype.scale=function(v,S){},G.prototype.colorChanged=function(v){this.onColorChanged&&this.onColorChanged(v),this.stateChanged()},G.prototype.fillColorChanged=function(v){this.onFillColorChanged&&this.onFillColorChanged(v),this.stateChanged()},G.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)}},G.typeName="MarkerBase",G}(),rt=function(){function G(){this.findGripByVisual=this.findGripByVisual.bind(this)}return G.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},G}(),Bt=function(){function G(){this.GRIP_SIZE=10,this.visual=le.createGroup(),this.visual.appendChild(le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(le.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},G}(),Pt=function(){function G(){}return G.toITransformMatrix=function(v){return{a:v.a,b:v.b,c:v.c,d:v.d,e:v.e,f:v.f}},G.toSVGMatrix=function(v,S){return v.a=S.a,v.b=S.b,v.c=S.c,v.d=S.d,v.e=S.e,v.f=S.f,v},G}(),Ct=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.left=0,W.top=0,W.width=0,W.height=0,W.defaultSize={x:50,y:20},W.offsetX=0,W.offsetY=0,W.rotationAngle=0,W.CB_DISTANCE=10,W._suppressMarkerCreateEvent=!1,W.container.transform.baseVal.appendItem(le.createTransform()),W.setupControlBox(),W}return De(v,G),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(S){this._visual=S;var B=le.createTransform();this._visual.transform.baseVal.appendItem(B)},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(S){return!!G.prototype.ownsTarget.call(this,S)||!!(this.controlGrips.findGripByVisual(S)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(S))},v.prototype.pointerDown=function(S,B){G.prototype.pointerDown.call(this,S,B),this.state==="new"&&(this.left=S.x,this.top=S.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(S);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(B),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(B)){this.activeGrip=this.rotatorGrip;var W=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=W.x-this.width/2,this.top=W.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ue=this.container.transform.baseVal.getItem(0);ue.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ue,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},v.prototype.pointerUp=function(S){var B=this.state;G.prototype.pointerUp.call(this,S),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(S),this._state="select",B==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},v.prototype.moveVisual=function(S){this.visual.style.transform="translate("+S.x+"px, "+S.y+"px)"},v.prototype.manipulate=function(S){var B=this.unrotatePoint(S);this.state==="creating"?this.resize(S):this.state==="move"?(this.left=this.manipulationStartLeft+(B.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(B.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(B):this.state==="rotate"&&this.rotate(S)},v.prototype.resize=function(S){var B=this.manipulationStartLeft,q=this.manipulationStartWidth,W=this.manipulationStartTop,ue=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:B=this.manipulationStartLeft+S.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-B;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+S.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:W=this.manipulationStartTop+S.y-this.manipulationStartY,ue=this.manipulationStartHeight+this.manipulationStartTop-W;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ue=this.manipulationStartHeight+S.y-this.manipulationStartY}q>=0?(this.left=B,this.width=q):(this.left=B+q,this.width=-q),ue>=0?(this.top=W,this.height=ue):(this.top=W+ue,this.height=-ue),this.setSize()},v.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},v.prototype.rotate=function(S){if(Math.abs(S.x-this.centerX)>.1){var B=Math.sign(S.x-this.centerX);this.rotationAngle=180*Math.atan((S.y-this.centerY)/(S.x-this.centerX))/Math.PI+90*B,this.applyRotation()}},v.prototype.applyRotation=function(){var S=this.container.transform.baseVal.getItem(0);S.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(S,0)},v.prototype.rotatePoint=function(S){if(this.rotationAngle===0)return S;var B=this.container.getCTM(),q=le.createPoint(S.x,S.y);return{x:(q=q.matrixTransform(B)).x,y:q.y}},v.prototype.unrotatePoint=function(S){if(this.rotationAngle===0)return S;var B=this.container.getCTM();B=B.inverse();var q=le.createPoint(S.x,S.y);return{x:(q=q.matrixTransform(B)).x,y:q.y}},v.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=le.createGroup();var S=le.createTransform();S.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(S),this.container.appendChild(this.controlBox),this.controlRect=le.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=le.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 rt,this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){var S=this.controlBox.transform.baseVal.getItem(0);S.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(S,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 S=new Bt;return S.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(S.visual),S},v.prototype.positionGrips=function(){var S=this.controlGrips.topLeft.GRIP_SIZE,B=-S/2,q=B,W=(this.width+this.CB_DISTANCE)/2-S/2,ue=(this.height+this.CB_DISTANCE)/2-S/2,We=this.height+this.CB_DISTANCE-S/2,Ye=this.width+this.CB_DISTANCE-S/2;this.positionGrip(this.controlGrips.topLeft.visual,B,q),this.positionGrip(this.controlGrips.topCenter.visual,W,q),this.positionGrip(this.controlGrips.topRight.visual,Ye,q),this.positionGrip(this.controlGrips.centerLeft.visual,B,ue),this.positionGrip(this.controlGrips.centerRight.visual,Ye,ue),this.positionGrip(this.controlGrips.bottomLeft.visual,B,We),this.positionGrip(this.controlGrips.bottomCenter.visual,W,We),this.positionGrip(this.controlGrips.bottomRight.visual,Ye,We),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,W,q-3*this.CB_DISTANCE)},v.prototype.positionGrip=function(S,B,q){var W=S.transform.baseVal.getItem(0);W.setTranslate(B,q),S.transform.baseVal.replaceItem(W,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:Pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Pt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},G.prototype.getState.call(this))},v.prototype.restoreState=function(S){G.prototype.restoreState.call(this,S);var B=S;this.left=B.left,this.top=B.top,this.width=B.width,this.height=B.height,this.rotationAngle=B.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,B.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,B.containerTransformMatrix))},v.prototype.scale=function(S,B){G.prototype.scale.call(this,S,B);var q=this.rotatePoint({x:this.left,y:this.top}),W=this.unrotatePoint({x:q.x*S,y:q.y*B});this.left=W.x,this.top=W.y,this.width=this.width*S,this.height=this.height*B,this.adjustControlBox()},v}(tt),_t=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.fillColor="transparent",W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.opacity=1,W.setStrokeColor=W.setStrokeColor.bind(W),W.setFillColor=W.setFillColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.createVisual=W.createVisual.bind(W),W}return De(v,G),v.prototype.ownsTarget=function(S){return!(!G.prototype.ownsTarget.call(this,S)&&S!==this.visual)},v.prototype.createVisual=function(){this.visual=le.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(S,B){G.prototype.pointerDown.call(this,S,B),this.state==="new"&&(this.createVisual(),this.moveVisual(S),this._state="creating")},v.prototype.manipulate=function(S){G.prototype.manipulate.call(this,S)},v.prototype.resize=function(S){G.prototype.resize.call(this,S),this.setSize()},v.prototype.setSize=function(){G.prototype.setSize.call(this),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(S){G.prototype.pointerUp.call(this,S),this.setSize()},v.prototype.setStrokeColor=function(S){this.strokeColor=S,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(S),this.stateChanged()},v.prototype.setFillColor=function(S){this.fillColor=S,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},v.prototype.setStrokeWidth=function(S){this.strokeWidth=S,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(S){this.strokeDasharray=S,this.visual&&le.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},G.prototype.getState.call(this))},v.prototype.restoreState=function(S){var B=S;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),G.prototype.restoreState.call(this,S),this.setSize()},v.prototype.scale=function(S,B){G.prototype.scale.call(this,S,B),this.setSize()},v.title="Rectangle marker",v}(Ct),Vt=function(G){function v(S,B,q,W){var ue=G.call(this,S,W||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ue.widths=[],ue.widthBoxes=[],ue.widths=B,ue.currentWidth=q,ue.setCurrentWidth=ue.setCurrentWidth.bind(ue),ue}return De(v,G),v.prototype.getUi=function(){var S=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",this.widths.forEach(function(q){var W=document.createElement("div");W.style.display="flex",W.style.flexGrow="2",W.style.alignItems="center",W.style.justifyContent="space-between",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.borderColor=q===S.currentWidth?S.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){S.setCurrentWidth(q,W)}),B.appendChild(W);var ue=document.createElement("div");ue.innerText=q.toString(),ue.style.marginRight="5px",W.appendChild(ue);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.display="flex",We.style.alignItems="center";var Ye=document.createElement("hr");Ye.style.minWidth="20px",Ye.style.border="0px",Ye.style.borderTop=q+"px solid "+S.uiStyleSettings.toolboxColor,Ye.style.flexGrow="2",We.appendChild(Ye),W.appendChild(We),S.widthBoxes.push(W)}),B},v.prototype.setCurrentWidth=function(S,B){var q=this;this.currentWidth=S,this.widthBoxes.forEach(function(W){W.style.borderColor=W===B?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},v}(vt),Ot=function(G){function v(S,B,q,W){var ue=G.call(this,S,W||'<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 ue.styles=[],ue.styleBoxes=[],ue.styles=B,ue.currentStyle=q,ue.setCurrentStyle=ue.setCurrentStyle.bind(ue),ue}return De(v,G),v.prototype.getUi=function(){var S=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",this.styles.forEach(function(q){var W=document.createElement("div");W.style.display="flex",W.style.alignItems="center",W.style.justifyContent="space-between",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.overflow="hidden",W.style.maxWidth=100/S.styles.length-5+"%",W.style.borderColor=q===S.currentStyle?S.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){S.setCurrentStyle(q,W)}),B.appendChild(W);var ue=document.createElement("div");ue.style.minHeight="20px",ue.style.flexGrow="2",ue.style.overflow="hidden";var We=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+S.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(q!==""?'stroke-dasharray="'+q+'"':"")+` />
|
|
</svg>`;ue.innerHTML=We,W.appendChild(ue),S.styleBoxes.push(W)}),B},v.prototype.setCurrentStyle=function(S,B){var q=this;this.currentStyle=S,this.styleBoxes.forEach(function(W){W.style.borderColor=W===B?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},v}(vt),Rt=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.strokeColor=q.defaultColor,W.strokeWidth=q.defaultStrokeWidth,W.strokeDasharray=q.defaultStrokeDasharray,W.strokePanel=new st("Line color",q.defaultColorSet,q.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.strokeWidthPanel=new Vt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new Ot("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W}return De(v,G),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=G.prototype.getState.call(this);return S.typeName=v.typeName,S},v.typeName="FrameMarker",v.title="Frame marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',v}(_t),Ve=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},Xt=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.x1=0,W.y1=0,W.x2=0,W.y2=0,W.defaultLength=50,W.manipulationStartX=0,W.manipulationStartY=0,W.manipulationStartX1=0,W.manipulationStartY1=0,W.manipulationStartX2=0,W.manipulationStartY2=0,W.setupControlBox(),W}return De(v,G),v.prototype.ownsTarget=function(S){return!!G.prototype.ownsTarget.call(this,S)||!(!this.grip1.ownsTarget(S)&&!this.grip2.ownsTarget(S))},v.prototype.pointerDown=function(S,B){G.prototype.pointerDown.call(this,S,B),this.manipulationStartX=S.x,this.manipulationStartY=S.y,this.state==="new"&&(this.x1=S.x,this.y1=S.y,this.x2=S.x,this.y2=S.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(B)?this.activeGrip=this.grip1:this.grip2.ownsTarget(B)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},v.prototype.pointerUp=function(S){var B=this.state;G.prototype.pointerUp.call(this,S),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(S),this._state="select",B==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},v.prototype.adjustVisual=function(){},v.prototype.manipulate=function(S){this.state==="creating"?this.resize(S):this.state==="move"?(this.x1=this.manipulationStartX1+S.x-this.manipulationStartX,this.y1=this.manipulationStartY1+S.y-this.manipulationStartY,this.x2=this.manipulationStartX2+S.x-this.manipulationStartX,this.y2=this.manipulationStartY2+S.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(S)},v.prototype.resize=function(S){switch(this.activeGrip){case this.grip1:this.x1=S.x,this.y1=S.y;break;case this.grip2:case void 0:this.x2=S.x,this.y2=S.y}this.adjustVisual(),this.adjustControlBox()},v.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=le.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 S=new Bt;return S.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(S.visual),S},v.prototype.positionGrips=function(){var S=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-S/2,this.y1-S/2),this.positionGrip(this.grip2.visual,this.x2-S/2,this.y2-S/2)},v.prototype.positionGrip=function(S,B,q){var W=S.transform.baseVal.getItem(0);W.setTranslate(B,q),S.transform.baseVal.replaceItem(W,0)},v.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},G.prototype.getState.call(this))},v.prototype.restoreState=function(S){G.prototype.restoreState.call(this,S);var B=S;this.x1=B.x1,this.y1=B.y1,this.x2=B.x2,this.y2=B.y2},v.prototype.scale=function(S,B){G.prototype.scale.call(this,S,B),this.x1=this.x1*S,this.y1=this.y1*B,this.x2=this.x2*S,this.y2=this.y2*B,this.adjustVisual(),this.adjustControlBox()},v}(tt),At=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.setStrokeColor=W.setStrokeColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.strokeColor=q.defaultColor,W.strokeWidth=q.defaultStrokeWidth,W.strokeDasharray=q.defaultStrokeDasharray,W.strokePanel=new st("Line color",q.defaultColorSet,q.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.strokeWidthPanel=new Vt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new Ot("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W}return De(v,G),v.prototype.ownsTarget=function(S){return!(!G.prototype.ownsTarget.call(this,S)&&S!==this.visual&&S!==this.selectorLine&&S!==this.visibleLine)},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorLine=le.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=le.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(S,B){G.prototype.pointerDown.call(this,S,B),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()),le.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setStrokeColor=function(S){this.strokeColor=S,this.adjustVisual(),this.colorChanged(S)},v.prototype.setStrokeWidth=function(S){this.strokeWidth=S,this.adjustVisual()},v.prototype.setStrokeDasharray=function(S){this.strokeDasharray=S,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 S=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},G.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){G.prototype.restoreState.call(this,S);var B=S;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.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}(Xt),ze=function(G){function v(S,B,q,W){var ue=G.call(this,S,W||'<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 ue.fonts=[],ue.fontBoxes=[],ue.fonts=B,ue.currentFont=q,ue.setCurrentFont=ue.setCurrentFont.bind(ue),ue}return De(v,G),v.prototype.getUi=function(){var S=this,B=document.createElement("div");return B.style.overflow="hidden",B.style.flexGrow="2",this.fonts.forEach(function(q){var W=document.createElement("div");W.style.display="inline-block",W.style.alignItems="center",W.style.justifyContent="space-between",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.overflow="hidden",W.style.maxWidth=100/S.fonts.length-5+"%",W.style.borderColor=q===S.currentFont?S.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){S.setCurrentFont(q,W)}),B.appendChild(W);var ue=document.createElement("div");ue.style.display="flex",ue.style.minHeight="20px",ue.style.flexGrow="2",ue.style.fontFamily=q,ue.style.overflow="hidden";var We=document.createElement("div");We.style.whiteSpace="nowrap",We.style.overflow="hidden",We.style.textOverflow="ellipsis",We.innerHTML="The quick brown fox jumps over the lazy dog",ue.appendChild(We),W.appendChild(ue),S.fontBoxes.push(W)}),B},v.prototype.setCurrentFont=function(S,B){var q=this;this.currentFont=S,this.fontBoxes.forEach(function(W){W.style.borderColor=W===B?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},v}(vt),at=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.color="transparent",W.padding=5,W.DEFAULT_TEXT="your text here",W.text=W.DEFAULT_TEXT,W.isMoved=!1,W.color=q.defaultColor,W.fontFamily=q.defaultFontFamily,W.defaultSize={x:100,y:30},W.setColor=W.setColor.bind(W),W.setFont=W.setFont.bind(W),W.renderText=W.renderText.bind(W),W.sizeText=W.sizeText.bind(W),W.textEditDivClicked=W.textEditDivClicked.bind(W),W.showTextEditor=W.showTextEditor.bind(W),W.setSize=W.setSize.bind(W),W.positionTextEditor=W.positionTextEditor.bind(W),W.colorPanel=new st("Color",q.defaultColorSet,q.defaultColor),W.colorPanel.onColorChanged=W.setColor,W.fontFamilyPanel=new ze("Font",q.defaultFontFamilies,q.defaultFontFamily),W.fontFamilyPanel.onFontChanged=W.setFont,W}return De(v,G),v.prototype.ownsTarget=function(S){if(G.prototype.ownsTarget.call(this,S)||S===this.visual||S===this.textElement||S===this.bgRectangle)return!0;var B=!1;return this.textElement.childNodes.forEach(function(q){q===S&&(B=!0)}),B},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.bgRectangle=le.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=le.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},v.prototype.pointerDown=function(S,B){G.prototype.pointerDown.call(this,S,B),this.isMoved=!1,this.pointerDownPoint=S,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(S),this._state="creating")},v.prototype.renderText=function(){var S=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(B){S.textElement.appendChild(le.createTSpan(B.trim()===""?" ":B.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},v.prototype.getTextScale=function(){var S=this.textElement.getBBox(),B=1;if(S.width>0&&S.height>0){var q=(1*this.width-this.width*this.padding*2/100)/S.width,W=(1*this.height-this.height*this.padding*2/100)/S.height;B=Math.min(q,W)}return B},v.prototype.getTextPosition=function(S){var B=this.textElement.getBBox(),q=0,W=0;return B.width>0&&B.height>0&&(q=(this.width-B.width*S)/2,W=this.height/2-B.height*S/2),{x:q,y:W}},v.prototype.sizeText=function(){var S=this.textElement.getBBox(),B=this.getTextScale(),q=this.getTextPosition(B);q.y-=S.y*B,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+B+", "+B+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(B,B))},v.prototype.manipulate=function(S){G.prototype.manipulate.call(this,S),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(S.x-this.pointerDownPoint.x)>5||Math.abs(S.y-this.pointerDownPoint.y)>5)},v.prototype.resize=function(S){G.prototype.resize.call(this,S),this.isMoved=!0,this.setSize(),this.sizeText()},v.prototype.setSize=function(){G.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},v.prototype.pointerUp=function(S){var B=this.state;B==="creating"&&(this._suppressMarkerCreateEvent=!0),G.prototype.pointerUp.call(this,S),this.setSize(),(B==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},v.prototype.showTextEditor=function(){var S=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(B){B.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var B=Number.parseFloat(S.textEditor.style.fontSize);S.textEditor.clientWidth>=Number.parseInt(S.textEditor.style.maxWidth)&&B>.9;)B-=.1,S.textEditor.style.fontSize=Math.max(B,.9)+"em"}),this.textEditor.addEventListener("keyup",function(B){B.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(B){if(B.clipboardData){var q=B.clipboardData.getData("text"),W=window.getSelection();if(!W.rangeCount)return!1;W.deleteFromDocument(),W.getRangeAt(0).insertNode(document.createTextNode(q)),B.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){S.textEditDivClicked(S.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 S=this.getTextScale(),B=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),W={x:q.width*S,y:q.height*S};B.x-=W.x/2,B.y-=W.y/2,this.textEditor.style.top=B.y+"px",this.textEditor.style.left=B.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-B.x+"px",this.textEditor.style.fontSize=Math.max(16*S,12)+"px",this.textElement.style.display="none"}},v.prototype.textEditDivClicked=function(S){this.text=S.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},v.prototype.select=function(){G.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},v.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),G.prototype.deselect.call(this)},v.prototype.dblClick=function(S,B){G.prototype.dblClick.call(this,S,B),this.showTextEditor()},v.prototype.setColor=function(S){this.textElement&&le.setAttributes(this.textElement,[["fill",S]]),this.color=S,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(S)},v.prototype.setFont=function(S){this.textElement&&le.setAttributes(this.textElement,[["font-family",S]]),this.fontFamily=S,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 S=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},G.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){var B=S;this.color=B.color,this.fontFamily=B.fontFamily,this.padding=B.padding,this.text=B.text,this.createVisual(),G.prototype.restoreState.call(this,S),this.setSize()},v.prototype.scale=function(S,B){G.prototype.scale.call(this,S,B),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}(Ct),Ae=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.color="transparent",W.lineWidth=3,W.drawing=!1,W.pixelRatio=1,W.color=q.defaultColor,W.lineWidth=q.defaultStrokeWidth,W.pixelRatio=q.freehandPixelRatio,W.setColor=W.setColor.bind(W),W.addCanvas=W.addCanvas.bind(W),W.finishCreation=W.finishCreation.bind(W),W.setLineWidth=W.setLineWidth.bind(W),W.colorPanel=new st("Color",q.defaultColorSet,q.defaultColor),W.colorPanel.onColorChanged=W.setColor,W.lineWidthPanel=new Vt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),W.lineWidthPanel.onWidthChanged=W.setLineWidth,W}return De(v,G),v.prototype.ownsTarget=function(S){return!(!G.prototype.ownsTarget.call(this,S)&&S!==this.visual&&S!==this.drawingImage)},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.drawingImage=le.createImage(),this.visual.appendChild(this.drawingImage);var S=le.createTransform();this.visual.transform.baseVal.appendItem(S),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(S,B){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(S.x,S.y),this.drawing=!0):G.prototype.pointerDown.call(this,S,B)},v.prototype.manipulate=function(S){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(S.x,S.y),this.canvasContext.stroke()):G.prototype.manipulate.call(this,S)},v.prototype.resize=function(S){G.prototype.resize.call(this,S),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(S){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):G.prototype.pointerUp.call(this,S)},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(),G.prototype.select.call(this)},v.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),G.prototype.deselect.call(this)},v.prototype.finishCreation=function(){for(var S=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),B=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=B[0],W=B[1],ue=B[2],We=B[3],Ye=!1,Lt=0;Lt<this.canvasElement.height;Lt++)for(var Ke=0;Ke<this.canvasElement.width;Ke++)S.data[Lt*this.canvasElement.width*4+4*Ke+3]>0&&(Ye=!0,Lt<W&&(W=Lt),Ke<q&&(q=Ke),Lt>We&&(We=Lt),Ke>ue&&(ue=Ke));if(Ye){this.left=q/this.pixelRatio,this.top=W/this.pixelRatio,this.width=(ue-q)/this.pixelRatio,this.height=(We-W)/this.pixelRatio;var gt=document.createElement("canvas");gt.width=ue-q,gt.height=We-W,gt.getContext("2d").putImageData(this.canvasContext.getImageData(q,W,ue-q,We-W),0,0),this.drawingImgUrl=gt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},v.prototype.setDrawingImage=function(){le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},v.prototype.setColor=function(S){this.color=S,this.colorChanged(S)},v.prototype.setLineWidth=function(S){this.lineWidth=S},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 S=Object.assign({drawingImgUrl:this.drawingImgUrl},G.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){this.createVisual(),G.prototype.restoreState.call(this,S),this.drawingImgUrl=S.drawingImgUrl,this.setDrawingImage()},v.prototype.scale=function(S,B){G.prototype.scale.call(this,S,B),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}(Ct),_e=function(G){function v(S,B,q){var W=G.call(this,S,q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return W.typeBoxes=[],W.currentType=B,W.setCurrentType=W.setCurrentType.bind(W),W}return De(v,G),v.prototype.getUi=function(){var S=this,B=document.createElement("div");B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2";for(var q=function(We){var Ye="both";switch(We){case 0:Ye="both";break;case 1:Ye="start";break;case 2:Ye="end";break;case 3:Ye="none"}var Lt=document.createElement("div");if(Lt.style.display="flex",Lt.style.flexGrow="2",Lt.style.alignItems="center",Lt.style.justifyContent="space-between",Lt.style.padding="5px",Lt.style.borderWidth="2px",Lt.style.borderStyle="solid",Lt.style.borderColor=Ye===W.currentType?W.uiStyleSettings.toolboxAccentColor:"transparent",Lt.addEventListener("click",function(){S.setCurrentType(Ye,Lt)}),B.appendChild(Lt),Ye==="both"||Ye==="start"){var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.alignItems="center",Ke.style.minHeight="20px",Ke.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="`+(W.uiStyleSettings!==void 0?W.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ke.style.marginLeft="5px",Lt.appendChild(Ke)}var gt=document.createElement("div");gt.style.display="flex",gt.style.alignItems="center",gt.style.minHeight="20px",gt.style.flexGrow="2";var an=document.createElement("hr");if(an.style.minWidth="20px",an.style.border="0px",an.style.borderTop="3px solid "+(W.uiStyleSettings!==void 0?W.uiStyleSettings.toolboxColor:"#eeeeee"),an.style.flexGrow="2",gt.appendChild(an),Lt.appendChild(gt),Ye==="both"||Ye==="end"){var Hn=document.createElement("div");Hn.style.display="flex",Hn.style.alignItems="center",Hn.style.minHeight="20px",Hn.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="`+(W.uiStyleSettings!==void 0?W.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Hn.style.marginRight="5px",Lt.appendChild(Hn)}W.typeBoxes.push(Lt)},W=this,ue=0;ue<4;ue++)q(ue);return B},v.prototype.setCurrentType=function(S,B){var q=this;this.currentType=S,this.typeBoxes.forEach(function(W){W.style.borderColor=W===B?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},v}(vt),xe=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.arrowType="end",W.arrowBaseHeight=10,W.arrowBaseWidth=10,W.getArrowPoints=W.getArrowPoints.bind(W),W.setArrowType=W.setArrowType.bind(W),W.arrowTypePanel=new _e("Arrow type","end"),W.arrowTypePanel.onArrowTypeChanged=W.setArrowType,W}return De(v,G),v.prototype.ownsTarget=function(S){return!(!G.prototype.ownsTarget.call(this,S)&&S!==this.arrow1&&S!==this.arrow2)},v.prototype.getArrowPoints=function(S,B){var q=this.arrowBaseWidth+2*this.strokeWidth,W=this.arrowBaseHeight+2*this.strokeWidth;return S-q/2+","+(B+W/2)+" "+S+","+(B-W/2)+" "+(S+q/2)+","+(B+W/2)},v.prototype.createTips=function(){this.arrow1=le.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=le.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow2)},v.prototype.pointerDown=function(S,B){G.prototype.pointerDown.call(this,S,B),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(G.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",le.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),le.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var S=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),B=this.arrow1.transform.baseVal.getItem(0);B.setRotate(S,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(B,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(S+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},v.prototype.setArrowType=function(S){this.arrowType=S,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 S=Object.assign({arrowType:this.arrowType},G.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){G.prototype.restoreState.call(this,S);var B=S;this.arrowType=B.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}(At),re=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.fillColor=q.defaultFillColor,W.strokeWidth=0,W.fillPanel=new st("Color",q.defaultColorSet,q.defaultFillColor),W.fillPanel.onColorChanged=W.setFillColor,W}return De(v,G),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=G.prototype.getState.call(this);return S.typeName=v.typeName,S},v.typeName="CoverMarker",v.title="Cover marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',v}(_t),ae=function(G){function v(S,B,q,W){var ue=G.call(this,S,W||'<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 ue.opacities=[],ue.opacityBoxes=[],ue.opacities=B,ue.currentOpacity=q,ue.setCurrentOpacity=ue.setCurrentOpacity.bind(ue),ue}return De(v,G),v.prototype.getUi=function(){var S=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",B.style.justifyContent="space-between",this.opacities.forEach(function(q){var W=document.createElement("div");W.style.display="flex",W.style.alignItems="center",W.style.justifyContent="center",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.borderColor=q===S.currentOpacity?S.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){S.setCurrentOpacity(q,W)}),B.appendChild(W);var ue=document.createElement("div");ue.innerText=100*q+"%",W.appendChild(ue),S.opacityBoxes.push(W)}),B},v.prototype.setCurrentOpacity=function(S,B){var q=this;this.currentOpacity=S,this.opacityBoxes.forEach(function(W){W.style.borderColor=W===B?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},v}(vt),he=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.setOpacity=W.setOpacity.bind(W),W.fillColor=q.defaultHighlightColor,W.strokeWidth=0,W.opacity=q.defaultHighlightOpacity,W.fillPanel=new st("Color",q.defaultColorSet,W.fillColor),W.fillPanel.onColorChanged=W.setFillColor,W.opacityPanel=new ae("Opacity",q.defaultOpacitySteps,W.opacity),W.opacityPanel.onOpacityChanged=W.setOpacity,W}return De(v,G),v.prototype.setOpacity=function(S){this.opacity=S,this.visual&&le.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 S=G.prototype.getState.call(this);return S.typeName=v.typeName,S},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}(re),be='<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>',Te=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.bgColor="transparent",W.tipPosition={x:0,y:0},W.tipBase1Position={x:0,y:0},W.tipBase2Position={x:0,y:0},W.tipMoving=!1,W.color=q.defaultStrokeColor,W.bgColor=q.defaultFillColor,W.fontFamily=q.defaultFontFamily,W.defaultSize={x:100,y:30},W.setBgColor=W.setBgColor.bind(W),W.getTipPoints=W.getTipPoints.bind(W),W.positionTip=W.positionTip.bind(W),W.setTipPoints=W.setTipPoints.bind(W),W.colorPanel=new st("Text color",q.defaultColorSet,W.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>'),W.colorPanel.onColorChanged=W.setColor,W.bgColorPanel=new st("Fill color",q.defaultColorSet,W.bgColor,be),W.bgColorPanel.onColorChanged=W.setBgColor,W.fontFamilyPanel=new ze("Font",q.defaultFontFamilies,q.defaultFontFamily),W.fontFamilyPanel.onFontChanged=W.setFont,W.tipGrip=new Bt,W.tipGrip.visual.transform.baseVal.appendItem(le.createTransform()),W.controlBox.appendChild(W.tipGrip.visual),W}return De(v,G),v.prototype.ownsTarget=function(S){return G.prototype.ownsTarget.call(this,S)||this.tipGrip.ownsTarget(S)||this.tip===S},v.prototype.createTip=function(){le.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=le.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},v.prototype.pointerDown=function(S,B){this.state==="new"&&G.prototype.pointerDown.call(this,S,B),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(B)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):G.prototype.pointerDown.call(this,S,B)},v.prototype.pointerUp=function(S){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,G.prototype.pointerUp.call(this,S);else{var B=this.state==="creating";G.prototype.pointerUp.call(this,S),this.setTipPoints(B),this.positionTip()}},v.prototype.manipulate=function(S){if(this.tipMoving){var B=this.unrotatePoint(S);this.tipPosition={x:B.x-this.manipulationStartLeft,y:B.y-this.manipulationStartTop},this.positionTip()}else G.prototype.manipulate.call(this,S)},v.prototype.setBgColor=function(S){this.bgRectangle&&this.tip&&(le.setAttributes(this.bgRectangle,[["fill",S]]),le.setAttributes(this.tip,[["fill",S]])),this.bgColor=S,this.fillColorChanged(S)},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(S){S===void 0&&(S=!1);var B=Math.min(this.height/2,15),q=this.height/5;S&&(this.tipPosition={x:B+q/2,y:this.height+20});var W=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?W<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(q=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:0},this.tipBase2Position={x:B+q,y:0}):(this.tipBase1Position={x:0,y:B},this.tipBase2Position={x:0,y:B+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?W<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(q=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-q,y:0},this.tipBase2Position={x:this.width-B,y:0}):(this.tipBase1Position={x:this.width,y:B},this.tipBase2Position={x:this.width,y:B+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?W<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(q=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-q,y:this.height},this.tipBase2Position={x:this.width-B,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-B-q},this.tipBase2Position={x:this.width,y:this.height-B}):W<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:this.height},this.tipBase2Position={x:B+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-B},this.tipBase2Position={x:0,y:this.height-B-q})},v.prototype.resize=function(S){G.prototype.resize.call(this,S),this.positionTip()},v.prototype.positionTip=function(){le.setAttributes(this.tip,[["points",this.getTipPoints()]]);var S=this.tipGrip.visual.transform.baseVal.getItem(0);S.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(S,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(),G.prototype.select.call(this)},v.prototype.getState=function(){var S=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},G.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){var B=S;this.bgColor=B.bgColor,this.tipPosition=B.tipPosition,G.prototype.restoreState.call(this,S),this.createTip(),this.setTipPoints()},v.prototype.scale=function(S,B){G.prototype.scale.call(this,S,B),this.tipPosition={x:this.tipPosition.x*S,y:this.tipPosition.y*B},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}(at),ke=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.fillColor="transparent",W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.opacity=1,W.strokeColor=q.defaultColor,W.strokeWidth=q.defaultStrokeWidth,W.strokeDasharray=q.defaultStrokeDasharray,W.fillColor=q.defaultFillColor,W.setStrokeColor=W.setStrokeColor.bind(W),W.setFillColor=W.setFillColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.setOpacity=W.setOpacity.bind(W),W.createVisual=W.createVisual.bind(W),W.strokePanel=new st("Line color",ye(q.defaultColorSet,["transparent"]),q.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.fillPanel=new st("Fill color",ye(q.defaultColorSet,["transparent"]),W.fillColor,be),W.fillPanel.onColorChanged=W.setFillColor,W.strokeWidthPanel=new Vt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new Ot("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W.opacityPanel=new ae("Opacity",q.defaultOpacitySteps,W.opacity),W.opacityPanel.onOpacityChanged=W.setOpacity,W}return De(v,G),v.prototype.ownsTarget=function(S){return!(!G.prototype.ownsTarget.call(this,S)&&S!==this.visual)},v.prototype.createVisual=function(){this.visual=le.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(S,B){G.prototype.pointerDown.call(this,S,B),this.state==="new"&&(this.createVisual(),this.moveVisual(S),this._state="creating")},v.prototype.manipulate=function(S){G.prototype.manipulate.call(this,S)},v.prototype.resize=function(S){G.prototype.resize.call(this,S),this.setSize()},v.prototype.setSize=function(){G.prototype.setSize.call(this),le.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(S){G.prototype.pointerUp.call(this,S),this.setSize()},v.prototype.setStrokeColor=function(S){this.strokeColor=S,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(S),this.stateChanged()},v.prototype.setFillColor=function(S){this.fillColor=S,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(S),this.stateChanged()},v.prototype.setStrokeWidth=function(S){this.strokeWidth=S,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(S){this.strokeDasharray=S,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.setOpacity=function(S){this.opacity=S,this.visual&&le.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 S=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){var B=S;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),G.prototype.restoreState.call(this,S),this.setSize()},v.prototype.scale=function(S,B){G.prototype.scale.call(this,S,B),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}(Ct),Ne=function(G){function v(S,B,q){return G.call(this,S,B,q)||this}return De(v,G),Object.defineProperty(v.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(S){return!(!G.prototype.ownsTarget.call(this,S)&&S!==this.tip1&&S!==this.tip2)},v.prototype.createTips=function(){this.tip1=le.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(le.createTransform()),this.visual.appendChild(this.tip1),this.tip2=le.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(le.createTransform()),this.visual.appendChild(this.tip2)},v.prototype.pointerDown=function(S,B){G.prototype.pointerDown.call(this,S,B),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(G.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(le.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()]]),le.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 S=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),B=this.tip1.transform.baseVal.getItem(0);B.setRotate(S,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(B,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(S+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=G.prototype.getState.call(this);return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){G.prototype.restoreState.call(this,S),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}(At),lt=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.strokePanel.colors=q.defaultColorSet,W.fillColor="transparent",W}return De(v,G),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=G.prototype.getState.call(this);return S.typeName=v.typeName,S},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}(ke),ft=function(){function G(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),G.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))},G.prototype.replaceLastUndoStep=function(v){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=v)},G.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},G.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}},G.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},G}(),Ge=function(G){function v(S,B,q){var W=G.call(this,S,B,q)||this;return W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.curveX=0,W.curveY=0,W.manipulationStartCurveX=0,W.manipulationStartCurveY=0,W.setStrokeColor=W.setStrokeColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.positionGrips=W.positionGrips.bind(W),W.addControlGrips=W.addControlGrips.bind(W),W.adjustVisual=W.adjustVisual.bind(W),W.setupControlBox=W.setupControlBox.bind(W),W.resize=W.resize.bind(W),W.strokeColor=q.defaultColor,W.strokeWidth=q.defaultStrokeWidth,W.strokeDasharray=q.defaultStrokeDasharray,W.strokePanel=new st("Line color",q.defaultColorSet,q.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.strokeWidthPanel=new Vt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new Ot("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W}return De(v,G),v.prototype.ownsTarget=function(S){return!(!G.prototype.ownsTarget.call(this,S)&&S!==this.visual&&S!==this.selectorCurve&&S!==this.visibleCurve&&!this.curveGrip.ownsTarget(S))},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=le.createGroup(),this.selectorCurve=le.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=le.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(S,B){G.prototype.pointerDown.call(this,S,B),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=S.x,this.curveY=S.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(B)&&(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()),le.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setupControlBox=function(){G.prototype.setupControlBox.call(this),this.curveControlLine1=le.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=le.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,G.prototype.addControlGrips.call(this)},v.prototype.positionGrips=function(){G.prototype.positionGrips.call(this);var S=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-S/2,this.curveY-S/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(S){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+S.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+S.y-this.manipulationStartY),G.prototype.manipulate.call(this,S)},v.prototype.resize=function(S){this.activeGrip===this.curveGrip&&(this.curveX=S.x,this.curveY=S.y),G.prototype.resize.call(this,S),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(S){this.strokeColor=S,this.adjustVisual(),this.colorChanged(S)},v.prototype.setStrokeWidth=function(S){this.strokeWidth=S,this.adjustVisual()},v.prototype.setStrokeDasharray=function(S){this.strokeDasharray=S,this.adjustVisual()},v.prototype.scale=function(S,B){this.curveX=this.curveX*S,this.curveY=this.curveY*B,G.prototype.scale.call(this,S,B)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var S=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},G.prototype.getState.call(this));return S.typeName=v.typeName,S},v.prototype.restoreState=function(S){G.prototype.restoreState.call(this,S);var B=S;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.curveX=B.curveX,this.curveY=B.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}(Xt),bt=function(){function G(v,S){S===void 0&&(S=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=v,this.cancelable=S}return Object.defineProperty(G.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),G.prototype.preventDefault=function(){this._defaultPrevented=!0},G}(),nt=function(G){function v(S,B,q){var W=G.call(this,S,!1)||this;return W.dataUrl=B,W.state=q,W}return De(v,G),v}(bt),je=function(G){function v(S,B,q){q===void 0&&(q=!1);var W=G.call(this,S,q)||this;return W.marker=B,W}return De(v,G),v}(bt),Ft=function(){function G(){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 G.prototype.addEventListener=function(v,S){this[v].push(S)},G.prototype.removeEventListener=function(v,S){var B=this[v].indexOf(S);B>-1&&this[v].splice(B,1)},G}(),Ie=function(){function G(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 Ve,this._isOpen=!1,this.undoRedoManager=new ft,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 Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=G.instanceCounter++,this.styles=new ct(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(G.prototype,"ALL_MARKER_TYPES",{get:function(){return[Rt,Ae,xe,at,lt,ke,he,Te,Ne,re,At,Ge]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Rt,Ae,xe,at,ke,he,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Rt,Ae,xe,at,he]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(v){var S=this;this._availableMarkerTypes.splice(0),v.forEach(function(B){if(typeof B=="string"){var q=S.ALL_MARKER_TYPES.find(function(W){return W.typeName===B});q!==void 0&&S._availableMarkerTypes.push(q)}else S._availableMarkerTypes.push(B)})},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),G.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Se.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},G.prototype.show=function(){var v=this;this.styles.styleSheetRoot===void 0&&it.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=it.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(S){return S(new bt(v))})},G.prototype.render=function(){return Fe(this,void 0,void 0,function(){var v;return Me(this,function(S){switch(S.label){case 0:return this.setCurrentMarker(),(v=new ot).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 S.sent(),[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,S.sent()]}})})},G.prototype.close=function(v){var S=this;if(v===void 0&&(v=!1),this.isOpen){var B=!1;v||this.eventListeners.beforeclose.forEach(function(q){var W=new bt(S,!0);q(W),W.defaultPrevented&&(B=!0)}),B||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(q){return q(new bt(S))}),this.detachEvents(),this._isOpen=!1)}},G.prototype.addMarkersToToolbar=function(){for(var v,S=[],B=0;B<arguments.length;B++)S[B]=arguments[B];(v=this._availableMarkerTypes).push.apply(v,S)},G.prototype.addRenderEventListener=function(v){this.addEventListener("render",function(S){v(S.dataUrl,S.state)})},G.prototype.removeRenderEventListener=function(v){},G.prototype.addCloseEventListener=function(v){this.addEventListener("close",function(){v()})},G.prototype.removeCloseEventListener=function(v){},G.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))},G.prototype.onPopupTargetResize=function(){var v=1*this.target.clientWidth/this.target.clientHeight,S=this.editorCanvas.clientWidth/v>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*v:this.editorCanvas.clientWidth,B=S<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/v;this.resize(S,B)},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.prototype.resize=function(v,S){this._isResizing=!0;var B=v/this.imageWidth,q=S/this.imageHeight;this.imageWidth=Math.round(v),this.imageHeight=Math.round(S),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(B,q),this._isResizing=!1},G.prototype.scaleMarkers=function(v,S){var B,q=this;this._currentMarker&&this._currentMarker instanceof at?this._currentMarker.scale(v,S):(B=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(W){W!==q._currentMarker&&W.scale(v,S)}),B!==void 0&&this.setCurrentMarker(B)},G.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"},G.prototype.setTopLeft=function(){var v=this.editingTarget.getBoundingClientRect(),S=this.editorCanvas.getBoundingClientRect();this.left=v.left-S.left,this.top=v.top-S.top},G.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)},G.prototype.addDefs=function(){for(var v,S=[],B=0;B<arguments.length;B++)S[B]=arguments[B];this.defs=le.createDefs(),this.addDefsToImage(),(v=this.defs).append.apply(v,S)},G.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},G.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)},G.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},G.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},G.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)},G.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},G.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)},G.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()},G.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")},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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 qe(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 dt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},G.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.removeMarker=function(v){this.markerImage.removeChild(v.container),this.markers.indexOf(v)>-1&&this.markers.splice(this.markers.indexOf(v),1),v.dispose()},G.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())},G.prototype.toolbarButtonClicked=function(v,S){if(v==="marker"&&S!==void 0)this.createNewMarker(S);else if(v==="action")switch(S){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()}},G.prototype.deleteSelectedMarker=function(){var v=this;if(this._currentMarker!==void 0){var S=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var W=new je(v,v._currentMarker,!0);q(W),W.defaultPrevented&&(S=!0)}),!S){var B=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(q){return q(new je(v,B))})}}},G.prototype.clear=function(){var v=this,S=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ue){var We=new je(v,void 0,!0);ue(We),We.defaultPrevented&&(S=!0)}),!S)){this.setCurrentMarker();for(var B=function(ue){var We=q.markers[ue];q.setCurrentMarker(q.markers[ue]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(Ye){return Ye(new je(v,We))})},q=this,W=this.markers.length-1;W>=0;W--)B(W);this.addUndoStep()}},Object.defineProperty(G.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),G.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))},G.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)},G.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},G.prototype.addUndoStep=function(){var v=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var S=this.getState(),B=this.undoRedoManager.getLastUndoStep();if(!B||B.width===S.width&&B.height===S.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(S),q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(W){return W(new bt(v))})}else this.undoRedoManager.replaceLastUndoStep(S),this.eventListeners.statechange.forEach(function(W){return W(new bt(v))})}},G.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},G.prototype.undoStep=function(){var v=this,S=this.undoRedoManager.undo();S!==void 0&&(this.restoreState(S),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new bt(v))}))},G.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},G.prototype.redoStep=function(){var v=this,S=this.undoRedoManager.redo();S!==void 0&&(this.restoreState(S),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new bt(v))}))},G.prototype.stepZoom=function(){var v=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=v<this.zoomSteps.length-1?this.zoomSteps[v+1]:this.zoomSteps[0]},G.prototype.panTo=function(v){this.contentDiv.scrollBy({left:this.prevPanPoint.x-v.x,top:this.prevPanPoint.y-v.y}),this.prevPanPoint=v},G.prototype.startRenderAndClose=function(){return Fe(this,void 0,void 0,function(){var v,S,B=this;return Me(this,function(q){switch(q.label){case 0:return[4,this.render()];case 1:return v=q.sent(),S=this.getState(),this.eventListeners.render.forEach(function(W){return W(new nt(B,v,S))}),this.close(!0),[2]}})})},G.prototype.getState=function(v){v===!0&&this.setCurrentMarker();var S={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(B){return S.markers.push(B.getState())}),S},G.prototype.restoreState=function(v){var S=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);v.markers.forEach(function(B){var q=S._availableMarkerTypes.find(function(ue){return ue.typeName===B.typeName});if(q!==void 0){var W=S.addNewMarker(q);W.restoreState(B),S.markers.push(W)}}),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(B){return B(new bt(S))})},G.prototype.addNewMarker=function(v){var S=le.createGroup();return this.markerImage.appendChild(S),new v(S,this.overlayContainer,this.settings)},G.prototype.createNewMarker=function(v){var S,B=this;(S=typeof v=="string"?this._availableMarkerTypes.find(function(q){return q.typeName===v}):v)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(S),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(S.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(q){return q(new je(B,B._currentMarker))}))},G.prototype.markerCreated=function(v){var S=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(v),this.setCurrentMarker(v),v instanceof Ae&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ae):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(B){return B(new je(S,S._currentMarker))})},G.prototype.colorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=v,this.settings.defaultStrokeColor=v)},G.prototype.fillColorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=v)},G.prototype.markerStateChanged=function(v){var S=this;this.eventListeners.markerchange.forEach(function(B){return B(new je(S,v))})},G.prototype.setCurrentMarker=function(v){var S=this;this._currentMarker!==v&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(B){return B(new je(S,S._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(B){return B(new je(S,S._currentMarker))}))},G.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 S=this.markers.find(function(B){return B.ownsTarget(v.target)});S!==void 0?(this.setCurrentMarker(S),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))},G.prototype.onDblClick=function(v){if(this._isFocused||this.focus(),this.mode==="select"){var S=this.markers.find(function(B){return B.ownsTarget(v.target)});S!==void 0&&S!==this._currentMarker&&this.setCurrentMarker(S),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(v.clientX,v.clientY),v.target):this.setCurrentMarker()}},G.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}))},G.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()},G.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},G.prototype.onKeyUp=function(v){this._currentMarker===void 0||this.notesArea!==void 0||v.key!=="Delete"&&v.key!=="Backspace"||this.deleteSelectedMarker()},G.prototype.clientToLocalCoordinates=function(v,S){var B=this.markerImage.getBoundingClientRect();return{x:(v-B.left)/this.zoomLevel,y:(S-B.top)/this.zoomLevel}},G.prototype.onWindowResize=function(){this.positionUI()},G.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()},G.prototype.addLicenseKey=function(v){Se.addKey(v)},G.prototype.addEventListener=function(v,S){this.eventListeners.addEventListener(v,S)},G.prototype.removeEventListener=function(v,S){this.eventListeners.removeEventListener(v,S)},G.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(G.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),G.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(S){return S(new bt(v))}))},G.prototype.blur=function(){var v=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(S){return S(new bt(v))}))},G.instanceCounter=0,G}();/* **********************************
|
|
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 Zt=function(G,v){return(Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,B){S.__proto__=B}||function(S,B){for(var q in B)Object.prototype.hasOwnProperty.call(B,q)&&(S[q]=B[q])})(G,v)};function Gt(G,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function S(){this.constructor=G}Zt(G,v),G.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}function wt(G,v,S,B){return new(S||(S=Promise))(function(q,W){function ue(Lt){try{Ye(B.next(Lt))}catch(Ke){W(Ke)}}function We(Lt){try{Ye(B.throw(Lt))}catch(Ke){W(Ke)}}function Ye(Lt){var Ke;Lt.done?q(Lt.value):(Ke=Lt.value,Ke instanceof S?Ke:new S(function(gt){gt(Ke)})).then(ue,We)}Ye((B=B.apply(G,v||[])).next())})}function St(G,v){var S,B,q,W,ue={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return W={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(W[Symbol.iterator]=function(){return this}),W;function We(Ye){return function(Lt){return function(Ke){if(S)throw new TypeError("Generator is already executing.");for(;ue;)try{if(S=1,B&&(q=2&Ke[0]?B.return:Ke[0]?B.throw||((q=B.return)&&q.call(B),0):B.next)&&!(q=q.call(B,Ke[1])).done)return q;switch(B=0,q&&(Ke=[2&Ke[0],q.value]),Ke[0]){case 0:case 1:q=Ke;break;case 4:return ue.label++,{value:Ke[1],done:!1};case 5:ue.label++,B=Ke[1],Ke=[0];continue;case 7:Ke=ue.ops.pop(),ue.trys.pop();continue;default:if(!(q=ue.trys,(q=q.length>0&&q[q.length-1])||Ke[0]!==6&&Ke[0]!==2)){ue=0;continue}if(Ke[0]===3&&(!q||Ke[1]>q[0]&&Ke[1]<q[3])){ue.label=Ke[1];break}if(Ke[0]===6&&ue.label<q[1]){ue.label=q[1],q=Ke;break}if(q&&ue.label<q[2]){ue.label=q[2],ue.ops.push(Ke);break}q[2]&&ue.ops.pop(),ue.trys.pop();continue}Ke=v.call(G,ue)}catch(gt){Ke=[6,gt],B=0}finally{S=q=0}if(5&Ke[0])throw Ke[1];return{value:Ke[0]?Ke[1]:void 0,done:!0}}([Ye,Lt])}}}var en=function(){function G(){}return G.addKey=function(v){G.key=v},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),Qe=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(v,S){for(var B=0,q=S;B<q.length;B++){var W=q[B],ue=W[0],We=W[1];v.setAttribute(ue,We)}},G.createRect=function(v,S,B){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",v.toString()),q.setAttribute("height",S.toString()),B&&G.setAttributes(q,B),q},G.createLine=function(v,S,B,q,W){var ue=document.createElementNS("http://www.w3.org/2000/svg","line");return ue.setAttribute("x1",v.toString()),ue.setAttribute("y1",S.toString()),ue.setAttribute("x2",B.toString()),ue.setAttribute("y2",q.toString()),W&&G.setAttributes(ue,W),ue},G.createPolygon=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","polygon");return B.setAttribute("points",v),S&&G.setAttributes(B,S),B},G.createCircle=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","circle");return B.setAttribute("cx",(v/2).toString()),B.setAttribute("cy",(v/2).toString()),B.setAttribute("r",v.toString()),S&&G.setAttributes(B,S),B},G.createEllipse=function(v,S,B){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(v/2).toString()),q.setAttribute("cy",(S/2).toString()),q.setAttribute("rx",(v/2).toString()),q.setAttribute("ry",(S/2).toString()),B&&G.setAttributes(q,B),q},G.createGroup=function(v){var S=document.createElementNS("http://www.w3.org/2000/svg","g");return v&&G.setAttributes(S,v),S},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(v,S,B,q,W,ue,We){var Ye=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(Ye,[["id",v],["orient",S],["markerWidth",B.toString()],["markerHeight",q.toString()],["refX",W.toString()],["refY",ue.toString()]]),Ye.appendChild(We),Ye},G.createText=function(v){var S=document.createElementNS("http://www.w3.org/2000/svg","text");return S.setAttribute("x","0"),S.setAttribute("y","0"),v&&G.setAttributes(S,v),S},G.createTSpan=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","tspan");return B.textContent=v,S&&G.setAttributes(B,S),B},G.createImage=function(v){var S=document.createElementNS("http://www.w3.org/2000/svg","image");return v&&G.setAttributes(S,v),S},G.createPoint=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return B.x=v,B.y=S,B},G.createPath=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg","path");return B.setAttribute("d",v),S&&G.setAttributes(B,S),B},G.createElement=function(v,S){var B=document.createElementNS("http://www.w3.org/2000/svg",v);return S&&G.setAttributes(B,S),B},G.getHollowRectanglePath=function(v,S,B,q,W,ue,We,Ye){return"M"+v+","+S+"V"+(S+q)+"H"+(v+B)+"V"+S+"H"+W+"V"+ue+"H"+(W+We)+"V"+(ue+Ye)+"H"+W+"V"+S+"Z"},G}(),It=function(){function G(v){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+v+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),G.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},G.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)},G.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 Wt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Wt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Wt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Jt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Jt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},G.prototype.removeStyleSheet=function(){var v;this.styleSheet&&(((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),Wt=function(G,v){this.selector=G,this.style=v},Jt=function(G,v){this.localName=G,this.style=v},tn=function(){function G(){this.blocks=[],this.display=""}return G.prototype.addButtonBlock=function(v){v.className=this.blockClassName,v.buttonClassName=this.buttonClassName,v.buttonColorsClassName=this.buttonColorsClassName,v.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(v)},G.prototype.addElementBlock=function(v){v.className===void 0&&(v.className=this.blockClassName),this.blocks.push(v)},G.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(S){return v.appendChild(S.getUI())}),v},G}(),Tt=function(){function G(){}return G.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},G}(),ln=function(G){function v(){var S=G!==null&&G.apply(this,arguments)||this;return S.buttons=[],S}return Gt(v,G),v.prototype.addButton=function(S){S.className=this.buttonClassName,S.colorsClassName=this.buttonColorsClassName,S.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(S)},v.prototype.getUI=function(){var S=G.prototype.getUI.call(this);return this.buttons.forEach(function(B){return S.appendChild(B.getUI())}),S},v}(Tt),Ht=function(){function G(v,S){this._isActive=!1,this._isHidden=!1,this._icon=v,this.title=S,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(G.prototype,"icon",{get:function(){return this._icon},set:function(v){this._icon=v,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isActive",{get:function(){return this._isActive},set:function(v){this._isActive=v,this.adjustClassName()},enumerable:!1,configurable:!0}),G.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},G.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,"")))},G.prototype.hide=function(){this._isHidden=!0},G}(),Et=function(G){function v(){var S=G!==null&&G.apply(this,arguments)||this;return S.elements=[],S}return Gt(v,G),v.prototype.addElement=function(S){this.elements.push(S)},v.prototype.getUI=function(){var S=G.prototype.getUI.call(this);return this.elements.forEach(function(B){return S.appendChild(B)}),S},v}(Tt),fn=function(){function G(v,S){this.horizontal=v,this.vertical=S}return Object.defineProperty(G.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),G.prototype.getVerticalLength=function(v){return v/this.ratio},G.prototype.getHorizontalLength=function(v){return v*this.ratio},G}(),nn=function(){function G(){}return G.getIcon=function(v,S){if(v>0&&S>0){var B=new fn(v,S),q=B.ratio>=1?20:B.getHorizontalLength(20),W=B.ratio<1?20:B.getVerticalLength(20),ue=document.createElementNS("http://www.w3.org/2000/svg","svg");ue.setAttribute("xmlns","http://www.w3.org/2000/svg"),ue.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ue);var We=Qe.createDefs();ue.appendChild(We);var Ye=Qe.createElement("clipPath",[["id","text-bg-clip"]]);We.appendChild(Ye);var Lt=Qe.createPath(Qe.getHollowRectanglePath((24-q)/2,(24-W)/2,q,W,(24-q)/2+2,(24-W)/2+2,q-4,W-4));ue.appendChild(Lt);var Ke=Qe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ke.appendChild(Qe.createTSpan(v+":"+S)),ue.appendChild(Ke);var gt=Ke.getBBox();Qe.setAttributes(Ke,[["x",((24-gt.width)/2).toString()],["y",((24-gt.height)/2-gt.y).toString()]]);var an=Qe.createPath(Qe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(gt.width))/2,(24-Math.ceil(gt.height))/2,Math.ceil(gt.width),Math.ceil(gt.height)));return Ye.appendChild(an),Qe.setAttributes(Lt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ue),ue.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>'},G}(),rn=function(G){function v(S,B,q){var W=G.call(this,S,B)||this;return W.isDropdownOpen=!1,W.onClick=W.dropdownButtonClicked,W.dropdownButtons=q,W}return Gt(v,G),v.prototype.setupDropdown=function(){var S=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(B){B.className=S.className,B.colorsClassName=S.colorsClassName,S.dropdownBlock.appendChild(B.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}(Ht),Yt=function(){function G(v,S){this.GRIP_SIZE=10,this.color=v,this.fillColor=S,this.visual=Qe.createGroup(),this.visual.appendChild(Qe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Qe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},G.prototype.setCenter=function(v,S){this.visual.childNodes.forEach(function(B){return Qe.setAttributes(B,[["cx",v.toString()],["cy",S.toString()]])})},G}(),Ln=function(){function G(v,S,B,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=v,this.canvasHeight=S,this.margin=B,this.container=q,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(G.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(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.gridContainer&&Qe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(v){this._zoomFactor=v,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),G.prototype.open=function(){var v=this;this.cropShadeElement=Qe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Qe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var S=0;S<this.numberOfGridLines;S++)this.horizontalGridLines.push(Qe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Qe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(B){return v.gridContainer.appendChild(B)}),this.verticalGridLines.forEach(function(B){return v.gridContainer.appendChild(B)}),this.cropRectElement=Qe.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Yt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Yt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Yt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Yt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},G.prototype.setCropRectangle=function(v){this.cropRect=v;var S=Object.assign({},this.cropRect);this.zoomFactor!==1&&(S.width=this.cropRect.width*this.zoomFactor,S.height=this.cropRect.height*this.zoomFactor,S.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-S.width/2,S.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-S.height/2),Qe.setAttributes(this.cropRectElement,[["x",S.x.toString()],["y",S.y.toString()],["width",S.width.toString()],["height",S.height.toString()]]);var B=S.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(W,ue){var We=S.y+B*(ue+1);Qe.setAttributes(W,[["x1",""+S.x],["y1",""+We],["x2",""+(S.x+S.width)],["y2",""+We]])});var q=S.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(W,ue){var We=S.x+q*(ue+1);Qe.setAttributes(W,[["x1",""+We],["y1",""+S.y],["x2",""+We],["y2",""+(S.y+S.height)]])}),Qe.setAttributes(this.cropShadeElement,[["d",Qe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,S.x,S.y,S.width,S.height)]]),this.topLeftGrip.setCenter(S.x,S.y),this.topRightGrip.setCenter(S.x+S.width,S.y),this.bottomLeftGrip.setCenter(S.x,S.y+S.height),this.bottomRightGrip.setCenter(S.x+S.width,S.y+S.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},G.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)},G.prototype.clientToLocalCoordinates=function(v,S){var B=this.container.getBoundingClientRect();return{x:v-B.left+this.margin,y:S-B.top+this.margin}},G.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)},G.prototype.onPointerMove=function(v){if(this.isMoving)this.move(this.clientToLocalCoordinates(v.clientX,v.clientY));else if(this.activeGrip){var S=this.clientToLocalCoordinates(v.clientX,v.clientY);this.resize(S)}v.preventDefault()},G.prototype.onPointerUp=function(v){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(v.pointerId)},G.prototype.move=function(v){var S=v.x-this.previousPoint.x,B=v.y-this.previousPoint.y;this.zoomFactor!==1&&(S=-S/this.zoomFactor,B=-B/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+S),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+B),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=v},G.prototype.resize=function(v){var S=Object.assign({},this.cropRect),B=v.x-this.previousPoint.x,q=v.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:S.x+B<this.margin&&(B=this.margin-S.x),S.x+=B,S.width=this.cropRect.x+this.cropRect.width-S.x;break;case this.bottomRightGrip:case this.topRightGrip:S.width+B>this.canvasWidth*this.zoomFactor&&(B=this.canvasWidth*this.zoomFactor-S.width),S.width+=B}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(S.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(B),S.height=this.aspectRatio.getVerticalLength(S.width)):(S.y+=q,S.height=this.cropRect.y+this.cropRect.height-S.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?S.height=this.aspectRatio.getVerticalLength(S.width):S.height+=q}S.width<10&&(S.x=this.cropRect.x,S.width=10),S.height<10&&(S.y=this.cropRect.y,S.height=10),this.previousPoint=v,S.x>=this.margin&&S.y>=this.margin&&S.x-this.margin+S.width<=this.canvasWidth&&S.y-this.margin+S.height<=this.canvasHeight&&(this.cropRect=S,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},G.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,S=this.cropRect.y+this.cropRect.height/2,B=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);B/this.canvasWidth<q/this.canvasHeight?this.cropRect.width=B:this.cropRect.height=q,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=v-this.cropRect.width/2,this.cropRect.y=S-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)}},G.prototype.getRescaledRect=function(v,S,B,q,W,ue){var We=B/v,Ye=q/S;return{x:(W.x-ue)*We+ue,y:(W.y-ue)*Ye+ue,width:W.width*We,height:W.height*Ye}},G.prototype.scaleCanvas=function(v,S){var B=this.getRescaledRect(this.canvasWidth,this.canvasHeight,v,S,this.cropRect,this.margin);this.canvasWidth=v,this.canvasHeight=S,this.onCropChange&&this.onCropChange(B),this.setCropRectangle(B)},G}(),Xn=function(){function G(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(G.prototype,"angle",{get:function(){return this._angle},set:function(v){this._angle=v,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),G.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},G.prototype.onPointerDown=function(v){this.controlContainer.setPointerCapture(v.pointerId),this.isDragging=!0,this.previousPoint={x:v.clientX,y:v.clientY}},G.prototype.onPointerMove=function(v){this.isDragging&&(this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.previousPoint.x=v.clientX)},G.prototype.onPointerUp=function(v){this.isDragging&&this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(v.pointerId)},G.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var v=this.angleLabelText.getBBox();Qe.setAttributes(this.angleLabelElement,[["x",((this.width-v.width)/2).toString()],["y",(this.height/2).toString()]])}},G.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)}},G.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 S="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,B=1;B<=this.width/5+10;B++){var q=B%5==0?this.height/3:this.height/6;S+="h4v"+-q+"h1v"+q}S+="v1H0Z",this.scaleShape=Qe.createPath(S);var W=Qe.createTransform();this.scaleShape.transform.baseVal.appendItem(W),v.appendChild(this.scaleShape),this.angleLabelElement=Qe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Qe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ue=Qe.createTSpan("");return ue.innerHTML="°",this.angleLabelElement.appendChild(ue),v.appendChild(this.angleLabelElement),document.body.removeChild(v),v},G}(),Kn=function(){function G(){this.naturalSize=!1,this.imageType="image/png"}return G.prototype.rasterize=function(v,S,B,q,W,ue,We){var Ye=this;return new Promise(function(Lt){var Ke=document.createElement("canvas");Ke.width=v.width.baseVal.value-2*q,Ke.height=v.height.baseVal.value-2*q;var gt=1,an=1;Ye.naturalSize===!0?(gt=S.naturalWidth/(v.width.baseVal.value-2*q)/ue,an=S.naturalHeight/(v.height.baseVal.value-2*q)/We,Ke.width=S.naturalWidth/ue,Ke.height=S.naturalHeight/We):Ye.width!==void 0&&Ye.height!==void 0&&(gt=Ye.width/B.width,an=Ye.height/B.height,Ke.width*=gt,Ke.height*=an);var Hn=Ke.getContext("2d");Hn.translate(Ke.width/2,Ke.height/2),Hn.rotate(W*Math.PI/180),Hn.scale(ue,We),Hn.translate(-Ke.width/2,-Ke.height/2),Hn.drawImage(S,0,0,Ke.width,Ke.height);var qn=document.createElement("canvas");qn.width=B.width*gt,qn.height=B.height*an,qn.getContext("2d").putImageData(Hn.getImageData((B.x-q)*gt,(B.y-q)*an,B.width*gt,B.height*an),0,0),Lt(qn.toDataURL(Ye.imageType,Ye.imageQuality))})},G}(),$e=function(){function G(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=G.instanceCounter++,this.styles=new It(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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(v){this._zoomToCropEnabled=v,v?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.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(G.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(G.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.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}),G.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},G.prototype.show=function(){this.showUI(),this.open()},G.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(S){return S()}),this._isOpen=!1)},G.prototype.addRenderEventListener=function(v){this.renderEventListeners.push(v)},G.prototype.removeRenderEventListener=function(v){this.renderEventListeners.indexOf(v)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(v),1)},G.prototype.addCloseEventListener=function(v){this.closeEventListeners.push(v)},G.prototype.removeCloseEventListener=function(v){this.closeEventListeners.indexOf(v)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(v),1)},G.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))},G.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var v=1*this.target.clientWidth/this.target.clientHeight,S=this.contentDiv.clientWidth/v>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*v:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,B=S+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/v;this.resize(S,B)}},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.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",Qe.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},G.prototype.resize=function(v,S){this.imageWidth=Math.round(v),this.imageHeight=Math.round(S),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()},G.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 S=v.toDataURL();Qe.setAttributes(this.editingTarget,[["href",S]]),this.setEditingTargetSize()},G.prototype.setTopLeft=function(){var v=this.target.getBoundingClientRect(),S=this.editorCanvas.getBoundingClientRect();this.left=v.left-S.left-this.CANVAS_MARGIN,this.top=v.top-S.top-this.CANVAS_MARGIN},G.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=Qe.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Qe.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Qe.createGroup(),this.editingTargetRotationScaleContainer=Qe.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var v=Qe.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(v);var S=Qe.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(S),this.editingTargetContainer=Qe.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)},G.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},G.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Qe.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ln(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()},G.prototype.zoomToCrop=function(){if(this.cropRect){var v=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,S=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 "+S+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-v+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-S+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},G.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)},G.prototype.cropRectChanged=function(v){this.cropRect=v,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},G.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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,S=this.target.offsetTop>v+this.CANVAS_MARGIN?this.target.offsetTop-(v+this.CANVAS_MARGIN):0;this.coverDiv.style.top=S+"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},G.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},G.prototype.addTopToolbar=function(){var v=this;this.topToolbar=new tn,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 S=new ln;S.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(S);var B=[];this.aspectRatios.forEach(function(an){var Hn=new Ht(nn.getIcon(an.horizontal,an.vertical),an.horizontal===0&&an.vertical===0?"FREE":an.horizontal+":"+an.vertical);Hn.onClick=function(){return v.ratioButtonClicked(an)},B.push(Hn)}),this.aspectRatioButton=new rn(nn.getIcon(0,0),"Aspect ratio",B),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,S.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new Ht('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");q.isActive=this.isGridVisible,q.onClick=function(){v.isGridVisible=!v.isGridVisible,q.isActive=v.isGridVisible},S.addButton(q);var W=new Ht('<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(W.isActive=this.zoomToCropEnabled,W.onClick=function(){v.zoomToCropEnabled=!v.zoomToCropEnabled,W.isActive=v.zoomToCropEnabled},S.addButton(W),!en.isLicensed){var ue=new Et;this.topToolbar.addElementBlock(ue);var We=document.createElement("div");We.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ye=document.createElement("a");Ye.style.color="currentColor",Ye.href="https://markerjs.com/products/cropro",Ye.target="_blank",Ye.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>',We.appendChild(Ye),ue.addElement(We)}var Lt=new ln;Lt.minWidth=3*this.toolbarHeight+"px",Lt.contentAlign="end",this.topToolbar.addButtonBlock(Lt);var Ke=new Ht('<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");Ke.onClick=this.startRenderAndClose,Lt.addButton(Ke),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ke.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var gt=new Ht('<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");gt.onClick=this.close,Lt.addButton(gt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(gt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},G.prototype.addBottomToolbar=function(){var v=this;this.bottomToolbar=new tn,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 S=new ln;S.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(S);var B=new Ht('<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");B.onClick=this.rotateLeftButtonClicked,S.addButton(B);var q=new Ht('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");q.onClick=this.rotateRightButtonClicked,S.addButton(q);var W=new Et;W.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(W),this.straightener=new Xn("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(Lt){v.rotateBy(Lt),v.straightener.angle=v.rotationAngle},W.addElement(this.straightener.getUI());var ue=new ln;ue.minWidth=2*this.toolbarHeight+"px",ue.contentAlign="end",this.bottomToolbar.addButtonBlock(ue);var We=new Ht('<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");We.onClick=this.flipHorizontallyButtonClicked,ue.addButton(We);var Ye=new Ht('<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");Ye.onClick=this.flipVerticallyButtonClicked,ue.addButton(Ye)},G.prototype.ratioButtonClicked=function(v){this.aspectRatio=v,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},G.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=nn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},G.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new fn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},G.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},G.prototype.restoreState=function(v){if(v){var S=this.cropLayer.getRescaledRect(v.width,v.height,this.imageWidth,this.imageHeight,v.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(S),this.cropRectChanged(S),this.flippedHorizontally=v.flippedHorizontally,this.flippedVertically=v.flippedVertically,this.applyFlip(),this.rotationAngle=v.rotationAngle,this.applyRotation()}},G.prototype.clientToLocalCoordinates=function(v,S){var B=this.cropImage.getBoundingClientRect();return{x:v-B.left,y:S-B.top}},G.prototype.onWindowResize=function(){this.positionUI()},G.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()},G.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)},G.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)},G.prototype.rotateTo=function(v){v=(v=v>180?v-360:v)<=-180?v+360:v,this.rotationAngle=v,this.applyRotation()},G.prototype.rotateBy=function(v){this.rotateTo((this.rotationAngle+v)%360)},G.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 S=this.editingTargetRotationContainer.transform.baseVal.getItem(0);S.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(S,0);var B=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/B.width,this.imageHeight/B.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=v},G.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},G.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},G.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},G.prototype.startRenderAndClose=function(){return wt(this,void 0,void 0,function(){var v,S;return St(this,function(B){switch(B.label){case 0:return[4,this.render()];case 1:return v=B.sent(),S=this.getState(),this.renderEventListeners.forEach(function(q){return q(v,S)}),this.close(!0),[2]}})})},G.prototype.render=function(){return wt(this,void 0,void 0,function(){var v;return St(this,function(S){switch(S.label){case 0:return(v=new Kn).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.width=this.renderWidth,v.height=this.renderHeight,this.unzoomFromCrop(),Qe.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 S.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,S.sent()]}})})},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Jt("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 Jt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Jt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var v=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Jt("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 Jt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Jt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new Wt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Wt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Jt("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 Jt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Jt("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 Jt("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 Jt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},G.instanceCounter=0,G}(),Kt=Z("8hTe"),zn=Z.n(Kt),bn=/<pre[^>]*>/g;function pn(G){var v=document.createElement("div");return v.innerHTML=G,v.childNodes.length===0?"":v.childNodes[0].nodeValue}var Mn=et.a=function(G){var v=G.value,S=v===void 0?"":v,B=G.edit,q=B===void 0?!1:B,W=G.className,ue=G.showTextOnly,We=G.showLines,Ye=G.replaces,Lt=G.zoomImg,Ke=G.hasMask,gt=G.style,an=gt===void 0?{}:gt,Hn=G.stylesPrev,qn=Hn===void 0?{}:Hn,yn=String(S),Nt=Object(I.useRef)(),jt=Object(I.useRef)(),un=Object(I.useState)(""),cn=Object(K.a)(un,2),xn=cn[0],$n=cn[1],mn=Object(I.useState)("office"),ci=Object(K.a)(mn,2),cr=ci[0],gr=ci[1],_r=function(){var Un=new $e(jt.current);Un.displayMode="popup",Un.addRenderEventListener(function(){var pi=Object(F.a)(P.a.mark(function _n(mi){var Jn;return P.a.wrap(function(Si){for(;;)switch(Si.prev=Si.next){case 0:return Nt.current.style.display="none",Si.next=3,Object(Ue.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mi}});case 3:Jn=Si.sent,Jn!=null&&Jn.id&&Ye(jt.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(Jn==null?void 0:Jn.id,"?type=").concat(Jn.content_type));case 5:case"end":return Si.stop()}},_n)}));return function(_n){return pi.apply(this,arguments)}}()),Un.show()},Wr=function(){var Un=new Ie(jt.current);Un.settings.displayMode="popup",Un.addEventListener("render",function(){var pi=Object(F.a)(P.a.mark(function _n(mi){var Jn;return P.a.wrap(function(Si){for(;;)switch(Si.prev=Si.next){case 0:if(Nt.current.style.display="none",!jt.current){Si.next=6;break}return Si.next=4,Object(Ue.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mi.dataUrl}});case 4:Jn=Si.sent,Jn!=null&&Jn.id&&Ye(jt.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(Jn==null?void 0:Jn.id,"?type=").concat(Jn.content_type));case 6:case"end":return Si.stop()}},_n)}));return function(_n){return pi.apply(this,arguments)}}()),Un.show(),window.markerArea=Un},fi=Object(I.useMemo)(function(){Nt.current&&(Nt.current.style.zIndex=-1);try{var ai=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Un=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;yn=yn.replace(ai,"("+te.a.API_SERVER+"/api/attachments/").replace(Un,'"'+te.a.API_SERVER+"/api/attachments/").replace(pi,'"'+te.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(nr){}var _n=Y(yn),mi=_();if(yn.match(/\[TOC\]/)&&(_n=_n.replace("<p>[TOC]</p>",R()),L()),_n=_n.replace(/(__special_katext_id_\d+__)/g,function(nr,Si){var Pi=mi[Si],Kr=Pi.type,Qi=Pi.expression;return Object(se.renderToString)(pn(Qi)||"",{displayMode:Kr==="block",throwOnError:!1,output:"html"})}),_n=_n.replace(/▁/g,"\u2581\u2581\u2581"),h(),ue){var Jn=document.createElement("div");return Jn.innerHTML=_n,Jn.innerText}return setTimeout(function(){return Gr()},500),_n},[yn]),Di=Object(I.useRef)();C.WebkitLineClamp=We,We&&(an=Object(D.a)(Object(D.a)({},an),C));function dr(ai){var Un=ai.target;if(Un.tagName.toUpperCase()==="IMG"){if(Lt){var pi=Un.getAttribute("src");$n(pi),gr("image")}}else if(Un.tagName.toUpperCase()==="A"){var _n=Un.getAttribute("href");if(_n.indexOf("office")>-1)ai.preventDefault(),$n(_n),gr("office");else if(_n.indexOf("application/pdf")>-1)ai.preventDefault(),$n(_n),gr("pdf");else if(_n.indexOf("text/html")>-1)ai.preventDefault(),$n(_n),gr("html");else if(_n.startsWith("#")){ai.preventDefault();var mi=document.getElementById(_n.replace("#",""));mi&&mi.scrollIntoView(!0)}}}var Gr=function(){var Un,pi=(Un=Di.current)===null||Un===void 0?void 0:Un.querySelectorAll("video");pi==null||pi.forEach(function(_n){if(_n.oncontextmenu=function(){return!1},_n.src.indexOf(".m3u8")>-1&&!_n.canPlayType("application/vnd.apple.mpegurl")){if(J.a.isSupported()){var mi=new J.a;mi.loadSource(_n.src),mi.attachMedia(_n)}}})};Object(I.useEffect)(function(){if(Di.current&&fi&&(fi.match(bn)&&window.PR.prettyPrint()),Di.current)return Di.current.addEventListener("click",dr),function(){Di.current.removeEventListener("click",dr),h(),L()}},[fi,Di.current,dr]);var Ar=function(Un){if(!q)return;Un.target.nodeName==="IMG"?(Nt.current.style.zIndex=1,Nt.current.style.display="flex",Nt.current.style.width=Un.target.clientWidth+"px",Nt.current.style.height=Un.target.clientHeight+"px",Nt.current.style.top=Un.target.offsetTop+"px",Nt.current.style.left=Un.target.offsetLeft+"px",jt.current.src=Un.target.getAttribute("src")):Nt.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Di,style:Object(D.a)({},an),className:"".concat(W||""," markdown-body ").concat(zn.a.mdBody),onMouseOver:Ar,dangerouslySetInnerHTML:{__html:fi}}),y.a.createElement("div",{ref:Nt,className:zn.a.button},y.a.createElement(j.a,null,y.a.createElement(X.a,{onClick:function(){return _r()}},"\u88C1\u526A"),y.a.createElement(X.a,{onClick:function(){return Wr()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:jt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(fe.a,{close:!0,data:xn,type:xn!=null&&xn.length?cr:"",style:Object(D.a)({},qn),onClose:function(){return $n("")}}))}},"9JIy":function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___Hq8-r",flex_space_between:"flex_space_between___3Nl1U",flex_box_vertical_center:"flex_box_vertical_center___1hgum",flex_box_center_end:"flex_box_center_end___i5ldC",flex_box_column:"flex_box_column____1u-K",table:"table___2yPMl"}},"9VGf":function(ht,et,Z){"use strict";Z.d(et,"a",function(){return M});var oe=Z("cDcd"),j=Z.n(oe);function M(X,D){var F=Object(oe.useRef)();Object(oe.useEffect)(function(){F.current=X}),Object(oe.useEffect)(function(){function K(){F.current()}if(D!==null){var H=setInterval(K,D);return function(){return clearInterval(H)}}},[D])}},BU3w:function(ht,et,Z){"use strict";Z.d(et,"a",function(){return F});var oe=Z("MNnm"),j="rc-util-key";function M(K){if(K.attachTo)return K.attachTo;var H=document.querySelector("head");return H||document.body}function X(K){var H,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(oe.a)())return null;var I=document.createElement("style");if((H=P.csp)===null||H===void 0?void 0:H.nonce){var y;I.nonce=(y=P.csp)===null||y===void 0?void 0:y.nonce}I.innerHTML=K;var m=M(P),p=m.firstChild;return P.prepend&&m.prepend?m.prepend(I):P.prepend&&p?m.insertBefore(I,p):m.appendChild(I),I}var D=new Map;function F(K,H){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=M(P);if(!D.has(I)){var y=X("",P),m=y.parentNode;D.set(I,m),m.removeChild(y)}var p=Array.from(D.get(I).children).find(function(r){return r.tagName==="STYLE"&&r[j]===H});if(p){var c,u;if(((c=P.csp)===null||c===void 0?void 0:c.nonce)&&p.nonce!==((u=P.csp)===null||u===void 0?void 0:u.nonce)){var f;p.nonce=(f=P.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==K&&(p.innerHTML=K),p}var s=X(K,P);return s[j]=H,s}},Bd2K:function(ht,et,Z){(function(oe){oe(Z("VrN/"),Z("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(P,I,y){if(y!=oe.Init&&y&&P.removeKeyMap("autoCloseTags"),!I)return;var m={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(m["'/'"]=function(p){return F(p)}),(typeof I!="object"||I.whenOpening!==!1)&&(m["'>'"]=function(p){return X(p)}),P.addKeyMap(m)});var j=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(P){if(P.getOption("disableInput"))return oe.Pass;for(var I=P.listSelections(),y=[],m=P.getOption("autoCloseTags"),p=0;p<I.length;p++){if(!I[p].empty())return oe.Pass;var c=I[p].head,u=P.getTokenAt(c),f=oe.innerMode(P.getMode(),u.state),s=f.state,r=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(s),a=r&&r.name;if(!a)return oe.Pass;var d=f.mode.configuration=="html",L=typeof m=="object"&&m.dontCloseTags||d&&j,C=typeof m=="object"&&m.indentTags||d&&M;u.end>c.ch&&(a=a.slice(0,a.length-u.end+c.ch));var x=a.toLowerCase();if(!a||u.type=="string"&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||u.string.length==1)||u.type=="tag"&&r.close||u.string.indexOf("/")==c.ch-u.start-1||L&&K(L,x)>-1||H(P,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(s)||[],a,c,!0))return oe.Pass;var R=typeof m=="object"&&m.emptyTags;if(R&&K(R,a)>-1){y[p]={text:"/>",newPos:oe.Pos(c.line,c.ch+2)};continue}var O=C&&K(C,x)>-1;y[p]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+a+">",newPos:O?oe.Pos(c.line+1,0):oe.Pos(c.line,c.ch+1)}}for(var w=typeof m=="object"&&m.dontIndentOnAutoClose,p=I.length-1;p>=0;p--){var E=y[p];P.replaceRange(E.text,I[p].head,I[p].anchor,"+insert");var b=P.listSelections().slice(0);b[p]={head:E.newPos,anchor:E.newPos},P.setSelections(b),!w&&E.indent&&(P.indentLine(E.newPos.line,null,!0),P.indentLine(E.newPos.line+1,null,!0))}}function D(P,I){for(var y=P.listSelections(),m=[],p=I?"/":"</",c=P.getOption("autoCloseTags"),u=typeof c=="object"&&c.dontIndentOnSlash,f=0;f<y.length;f++){if(!y[f].empty())return oe.Pass;var s=y[f].head,r=P.getTokenAt(s),a=oe.innerMode(P.getMode(),r.state),d=a.state;if(I&&(r.type=="string"||r.string.charAt(0)!="<"||r.start!=s.ch-1))return oe.Pass;var L,C=a.mode.name!="xml"&&P.getMode().name=="htmlmixed";if(C&&a.mode.name=="javascript")L=p+"script";else if(C&&a.mode.name=="css")L=p+"style";else{var x=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(d);if(!x||x.length&&H(P,x,x[x.length-1],s))return oe.Pass;L=p+x[x.length-1]}P.getLine(s.line).charAt(r.end)!=">"&&(L+=">"),m[f]=L}if(P.replaceSelections(m),y=P.listSelections(),!u)for(var f=0;f<y.length;f++)(f==y.length-1||y[f].head.line<y[f+1].head.line)&&P.indentLine(y[f].head.line)}function F(P){return P.getOption("disableInput")?oe.Pass:D(P,!0)}oe.commands.closeTag=function(P){return D(P)};function K(P,I){if(P.indexOf)return P.indexOf(I);for(var y=0,m=P.length;y<m;++y)if(P[y]==I)return y;return-1}function H(P,I,y,m,p){if(!oe.scanForClosingTag)return!1;var c=Math.min(P.lastLine()+1,m.line+500),u=oe.scanForClosingTag(P,m,null,c);if(!u||u.tag!=y)return!1;for(var f=p?1:0,s=I.length-1;s>=0&&I[s]==y;s--)++f;m=u.to;for(var s=1;s<f;s++){var r=oe.scanForClosingTag(P,m,null,c);if(!r||r.tag!=y)return!1;m=r.to}return!0}})},BdwD:function(ht,et,Z){"use strict";var oe=Z("+L6B"),j=Z("2/Rp"),M=Z("0Owb"),X=Z("k1fw"),D=Z("cDcd"),F=Z.n(D),K=Z("FOrL"),H=Z.n(K),P=function(y){var m=y.buttonProps,p=m===void 0?{}:m,c=y.styles,u=c===void 0?{}:c,f=y.customText,s=y.ButtonText,r=y.ButtonClick,a=y.Buttonclass,d=y.ButtonTwo;return F.a.createElement("section",{className:"tc animated fadeIn",style:Object(X.a)(Object(X.a)({},{color:"#999",margin:"200px auto"}),u)},F.a.createElement("img",{src:H.a}),F.a.createElement("p",{className:"mt20 font14"},f||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),s&&F.a.createElement(j.a,Object(M.a)({className:a,onClick:r},p),s),d&&d)};et.a=P},BjJ7:function(ht,et,Z){"use strict";Z.d(et,"d",function(){return j}),Z.d(et,"c",function(){return M}),Z.d(et,"e",function(){return X}),Z.d(et,"b",function(){return D}),Z.d(et,"a",function(){return K});var oe=Z("m3rI");function j(H){var P=!0;if(H.length>0){for(var I=0;I<H.length;I++)if(H[I].compile_success==0||!H[I].compile_success){P=!1;break}}else P=!1;return P}function M(H){for(var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],y=0;y<H.length;y++){var m=H[y],p=P?"".concat(P,"/").concat(m.name):"".concat(m.name);I.push({title:m.name,isLeaf:!(m.type==="tree"),key:p})}return I}function X(H,P,I){for(var y=0;y<H.length;y++){var m=H[y];if(m.key===P){m.children=I;break}m.children&&X(m.children,P,I)}return H}function D(H,P,I){var y;return function(){var m=this,p=arguments,c=function(){y=null,I||H.apply(m,p)},u=I&&!y;clearTimeout(y),y=setTimeout(c,P),u&&H.apply(m,p)}}var F=!0,K=oe.a.API_SERVER},Bq7L:function(ht,et){ht.exports="data:image/png;base64,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"},"C+DQ":function(ht,et,Z){},DlQD:function(ht,et,Z){(function(oe,j){ht.exports=j()})(this,function(){"use strict";function oe(Ae,_e){for(var xe=0;xe<_e.length;xe++){var re=_e[xe];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(Ae,re.key,re)}}function j(Ae,_e,xe){return _e&&oe(Ae.prototype,_e),xe&&oe(Ae,xe),Ae}function M(Ae,_e){if(!Ae)return;if(typeof Ae=="string")return X(Ae,_e);var xe=Object.prototype.toString.call(Ae).slice(8,-1);if(xe==="Object"&&Ae.constructor&&(xe=Ae.constructor.name),xe==="Map"||xe==="Set")return Array.from(Ae);if(xe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(xe))return X(Ae,_e)}function X(Ae,_e){(_e==null||_e>Ae.length)&&(_e=Ae.length);for(var xe=0,re=new Array(_e);xe<_e;xe++)re[xe]=Ae[xe];return re}function D(Ae,_e){var xe;if(typeof Symbol=="undefined"||Ae[Symbol.iterator]==null){if(Array.isArray(Ae)||(xe=M(Ae))||_e&&Ae&&typeof Ae.length=="number"){xe&&(Ae=xe);var re=0;return function(){return re>=Ae.length?{done:!0}:{done:!1,value:Ae[re++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return xe=Ae[Symbol.iterator](),xe.next.bind(xe)}function F(Ae,_e){return _e={exports:{}},Ae(_e,_e.exports),_e.exports}var K=F(function(Ae){function _e(){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 xe(re){Ae.exports.defaults=re}Ae.exports={defaults:_e(),getDefaults:_e,changeDefaults:xe}}),H=K.defaults,P=K.getDefaults,I=K.changeDefaults,y=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,u={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(_e){return u[_e]};function s(Ae,_e){if(_e){if(y.test(Ae))return Ae.replace(m,f)}else if(p.test(Ae))return Ae.replace(c,f);return Ae}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(Ae){return Ae.replace(r,function(_e,xe){return xe=xe.toLowerCase(),xe==="colon"?":":xe.charAt(0)==="#"?xe.charAt(1)==="x"?String.fromCharCode(parseInt(xe.substring(2),16)):String.fromCharCode(+xe.substring(1)):""})}var d=/(^|[^\[])\^/g;function L(Ae,_e){Ae=Ae.source||Ae,_e=_e||"";var xe={replace:function(ae,he){return he=he.source||he,he=he.replace(d,"$1"),Ae=Ae.replace(ae,he),xe},getRegex:function(){return new RegExp(Ae,_e)}};return xe}var C=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ae,_e,xe){if(Ae){var re;try{re=decodeURIComponent(a(xe)).replace(C,"").toLowerCase()}catch(ae){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}_e&&!x.test(xe)&&(xe=l(_e,xe));try{xe=encodeURI(xe).replace(/%25/g,"%")}catch(ae){return null}return xe}var O={},w=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,b=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(Ae,_e){O[" "+Ae]||(w.test(Ae)?O[" "+Ae]=Ae+"/":O[" "+Ae]=T(Ae,"/",!0)),Ae=O[" "+Ae];var xe=Ae.indexOf(":")===-1;return _e.substring(0,2)==="//"?xe?_e:Ae.replace(E,"$1")+_e:_e.charAt(0)==="/"?xe?_e:Ae.replace(b,"$1")+_e:Ae+_e}var _={exec:function(){}};function h(Ae){for(var _e=1,xe,re;_e<arguments.length;_e++){xe=arguments[_e];for(re in xe)Object.prototype.hasOwnProperty.call(xe,re)&&(Ae[re]=xe[re])}return Ae}function g(Ae,_e){var xe=Ae.replace(/\|/g,function(he,be,Te){for(var ke=!1,Ne=be;--Ne>=0&&Te[Ne]==="\\";)ke=!ke;return ke?"|":" |"}),re=xe.split(/ \|/),ae=0;if(re.length>_e)re.splice(_e);else for(;re.length<_e;)re.push("");for(;ae<re.length;ae++)re[ae]=re[ae].trim().replace(/\\\|/g,"|");return re}function T(Ae,_e,xe){var re=Ae.length;if(re===0)return"";for(var ae=0;ae<re;){var he=Ae.charAt(re-ae-1);if(he===_e&&!xe)ae++;else if(he!==_e&&xe)ae++;else break}return Ae.substr(0,re-ae)}function N(Ae,_e){if(Ae.indexOf(_e[1])===-1)return-1;for(var xe=Ae.length,re=0,ae=0;ae<xe;ae++)if(Ae[ae]==="\\")ae++;else if(Ae[ae]===_e[0])re++;else if(Ae[ae]===_e[1]&&(re--,re<0))return ae;return-1}function V(Ae){Ae&&Ae.sanitize&&!Ae.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 Y={escape:s,unescape:a,edit:L,cleanUrl:R,resolveUrl:l,noopTest:_,merge:h,splitCells:g,rtrim:T,findClosingBracket:N,checkSanitizeDeprecation:V},U=K.defaults,A=Y.rtrim,J=Y.splitCells,te=Y.escape,se=Y.findClosingBracket;function fe(Ae,_e,xe){var re=_e.href,ae=_e.title?te(_e.title):null,he=Ae[1].replace(/\\([\[\]])/g,"$1");return Ae[0].charAt(0)!=="!"?{type:"link",raw:xe,href:re,title:ae,text:he}:{type:"image",raw:xe,href:re,title:ae,text:te(he)}}function Ue(Ae,_e){var xe=Ae.match(/^(\s+)(?:```)/);if(xe===null)return _e;var re=xe[1];return _e.split(`
|
|
`).map(function(ae){var he=ae.match(/^\s+/);if(he===null)return ae;var be=he[0];return be.length>=re.length?ae.slice(re.length):ae}).join(`
|
|
`)}var Re=function(){function Ae(xe){this.options=xe||U}var _e=Ae.prototype;return _e.space=function(re){var ae=this.rules.block.newline.exec(re);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
|
|
`}},_e.code=function(re,ae){var he=this.rules.block.code.exec(re);if(he){var be=ae[ae.length-1];if(be&&be.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var Te=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?Te:A(Te,`
|
|
`)}}},_e.fences=function(re){var ae=this.rules.block.fences.exec(re);if(ae){var he=ae[0],be=Ue(he,ae[3]||"");return{type:"code",raw:he,lang:ae[2]?ae[2].trim():ae[2],text:be}}},_e.heading=function(re){var ae=this.rules.block.heading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},_e.nptable=function(re){var ae=this.rules.block.nptable.exec(re);if(ae){var he={type:"table",header:J(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ae[0]};if(he.header.length===he.align.length){var be=he.align.length,Te;for(Te=0;Te<be;Te++)/^ *-+: *$/.test(he.align[Te])?he.align[Te]="right":/^ *:-+: *$/.test(he.align[Te])?he.align[Te]="center":/^ *:-+ *$/.test(he.align[Te])?he.align[Te]="left":he.align[Te]=null;for(be=he.cells.length,Te=0;Te<be;Te++)he.cells[Te]=J(he.cells[Te],he.header.length);return he}}},_e.hr=function(re){var ae=this.rules.block.hr.exec(re);if(ae)return{type:"hr",raw:ae[0]}},_e.blockquote=function(re){var ae=this.rules.block.blockquote.exec(re);if(ae){var he=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:he}}},_e.list=function(re){var ae=this.rules.block.list.exec(re);if(ae){for(var he=ae[0],be=ae[2],Te=be.length>1,ke=be[be.length-1]===")",Ne={type:"list",raw:he,ordered:Te,start:Te?+be.slice(0,-1):"",loose:!1,items:[]},lt=ae[0].match(this.rules.block.item),ft=!1,Ge,bt,nt,je,Ft,Ie,Zt,Gt=lt.length,wt=0;wt<Gt;wt++)Ge=lt[wt],he=Ge,bt=Ge.length,Ge=Ge.replace(/^ *([*+-]|\d+[.)]) */,""),~Ge.indexOf(`
|
|
`)&&(bt-=Ge.length,Ge=this.options.pedantic?Ge.replace(/^ {1,4}/gm,""):Ge.replace(new RegExp("^ {1,"+bt+"}","gm"),"")),wt!==Gt-1&&(nt=this.rules.block.bullet.exec(lt[wt+1])[0],(Te?nt.length===1||!ke&&nt[nt.length-1]===")":nt.length>1||this.options.smartLists&&nt!==be)&&(je=lt.slice(wt+1).join(`
|
|
`),Ne.raw=Ne.raw.substring(0,Ne.raw.length-je.length),wt=Gt-1)),Ft=ft||/\n\n(?!\s*$)/.test(Ge),wt!==Gt-1&&(ft=Ge.charAt(Ge.length-1)===`
|
|
`,Ft||(Ft=ft)),Ft&&(Ne.loose=!0),Ie=/^\[[ xX]\] /.test(Ge),Zt=void 0,Ie&&(Zt=Ge[1]!==" ",Ge=Ge.replace(/^\[[ xX]\] +/,"")),Ne.items.push({type:"list_item",raw:he,task:Ie,checked:Zt,loose:Ft,text:Ge});return Ne}},_e.html=function(re){var ae=this.rules.block.html.exec(re);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):te(ae[0]):ae[0]}},_e.def=function(re){var ae=this.rules.block.def.exec(re);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var he=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:ae[0],href:ae[2],title:ae[3]}}},_e.table=function(re){var ae=this.rules.block.table.exec(re);if(ae){var he={type:"table",header:J(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[]};if(he.header.length===he.align.length){he.raw=ae[0];var be=he.align.length,Te;for(Te=0;Te<be;Te++)/^ *-+: *$/.test(he.align[Te])?he.align[Te]="right":/^ *:-+: *$/.test(he.align[Te])?he.align[Te]="center":/^ *:-+ *$/.test(he.align[Te])?he.align[Te]="left":he.align[Te]=null;for(be=he.cells.length,Te=0;Te<be;Te++)he.cells[Te]=J(he.cells[Te].replace(/^ *\| *| *\| *$/g,""),he.header.length);return he}}},_e.lheading=function(re){var ae=this.rules.block.lheading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},_e.paragraph=function(re){var ae=this.rules.block.paragraph.exec(re);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
|
|
`?ae[1].slice(0,-1):ae[1]}},_e.text=function(re,ae){var he=this.rules.block.text.exec(re);if(he){var be=ae[ae.length-1];return be&&be.type==="text"?{raw:he[0],text:he[0]}:{type:"text",raw:he[0],text:he[0]}}},_e.escape=function(re){var ae=this.rules.inline.escape.exec(re);if(ae)return{type:"escape",raw:ae[0],text:te(ae[1])}},_e.tag=function(re,ae,he){var be=this.rules.inline.tag.exec(re);if(be)return!ae&&/^<a /i.test(be[0])?ae=!0:ae&&/^<\/a>/i.test(be[0])&&(ae=!1),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(be[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(be[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:be[0],inLink:ae,inRawBlock:he,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(be[0]):te(be[0]):be[0]}},_e.link=function(re){var ae=this.rules.inline.link.exec(re);if(ae){var he=se(ae[2],"()");if(he>-1){var be=ae[0].indexOf("!")===0?5:4,Te=be+ae[1].length+he;ae[2]=ae[2].substring(0,he),ae[0]=ae[0].substring(0,Te).trim(),ae[3]=""}var ke=ae[2],Ne="";if(this.options.pedantic){var lt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ke);lt?(ke=lt[1],Ne=lt[3]):Ne=""}else Ne=ae[3]?ae[3].slice(1,-1):"";ke=ke.trim().replace(/^<([\s\S]*)>$/,"$1");var ft=fe(ae,{href:ke&&ke.replace(this.rules.inline._escapes,"$1"),title:Ne&&Ne.replace(this.rules.inline._escapes,"$1")},ae[0]);return ft}},_e.reflink=function(re,ae){var he;if((he=this.rules.inline.reflink.exec(re))||(he=this.rules.inline.nolink.exec(re))){var be=(he[2]||he[1]).replace(/\s+/g," ");if(be=ae[be.toLowerCase()],!be||!be.href){var Te=he[0].charAt(0);return{type:"text",raw:Te,text:Te}}var ke=fe(he,be,he[0]);return ke}},_e.strong=function(re,ae,he){he===void 0&&(he="");var be=this.rules.inline.strong.start.exec(re);if(be&&(!be[1]||be[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ae=ae.slice(-1*re.length);var Te=be[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Te.lastIndex=0;for(var ke;(be=Te.exec(ae))!=null;)if(ke=this.rules.inline.strong.middle.exec(ae.slice(0,be.index+3)),ke)return{type:"strong",raw:re.slice(0,ke[0].length),text:re.slice(2,ke[0].length-2)}}},_e.em=function(re,ae,he){he===void 0&&(he="");var be=this.rules.inline.em.start.exec(re);if(be&&(!be[1]||be[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ae=ae.slice(-1*re.length);var Te=be[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Te.lastIndex=0;for(var ke;(be=Te.exec(ae))!=null;)if(ke=this.rules.inline.em.middle.exec(ae.slice(0,be.index+2)),ke)return{type:"em",raw:re.slice(0,ke[0].length),text:re.slice(1,ke[0].length-1)}}},_e.codespan=function(re){var ae=this.rules.inline.code.exec(re);if(ae){var he=ae[2].replace(/\n/g," "),be=/[^ ]/.test(he),Te=he.startsWith(" ")&&he.endsWith(" ");return be&&Te&&(he=he.substring(1,he.length-1)),he=te(he,!0),{type:"codespan",raw:ae[0],text:he}}},_e.br=function(re){var ae=this.rules.inline.br.exec(re);if(ae)return{type:"br",raw:ae[0]}},_e.del=function(re){var ae=this.rules.inline.del.exec(re);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},_e.autolink=function(re,ae){var he=this.rules.inline.autolink.exec(re);if(he){var be,Te;return he[2]==="@"?(be=te(this.options.mangle?ae(he[1]):he[1]),Te="mailto:"+be):(be=te(he[1]),Te=be),{type:"link",raw:he[0],text:be,href:Te,tokens:[{type:"text",raw:be,text:be}]}}},_e.url=function(re,ae){var he;if(he=this.rules.inline.url.exec(re)){var be,Te;if(he[2]==="@")be=te(this.options.mangle?ae(he[0]):he[0]),Te="mailto:"+be;else{var ke;do ke=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(ke!==he[0]);be=te(he[0]),he[1]==="www."?Te="http://"+be:Te=be}return{type:"link",raw:he[0],text:be,href:Te,tokens:[{type:"text",raw:be,text:be}]}}},_e.inlineText=function(re,ae,he){var be=this.rules.inline.text.exec(re);if(be){var Te;return ae?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(be[0]):te(be[0]):be[0]:Te=te(this.options.smartypants?he(be[0]):be[0]),{type:"text",raw:be[0],text:Te}}},Ae}(),De=Y.noopTest,Fe=Y.edit,Me=Y.merge,ye={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:De,table:De,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ye._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ye._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ye.def=Fe(ye.def).replace("label",ye._label).replace("title",ye._title).getRegex(),ye.bullet=/(?:[*+-]|\d{1,9}[.)])/,ye.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ye.item=Fe(ye.item,"gm").replace(/bull/g,ye.bullet).getRegex(),ye.list=Fe(ye.list).replace(/bull/g,ye.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ye.def.source+")").getRegex(),ye._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",ye._comment=/<!--(?!-?>)[\s\S]*?-->/,ye.html=Fe(ye.html,"i").replace("comment",ye._comment).replace("tag",ye._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye.paragraph=Fe(ye._paragraph).replace("hr",ye.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",ye._tag).getRegex(),ye.blockquote=Fe(ye.blockquote).replace("paragraph",ye.paragraph).getRegex(),ye.normal=Me({},ye),ye.gfm=Me({},ye.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*|$)"}),ye.gfm.nptable=Fe(ye.gfm.nptable).replace("hr",ye.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",ye._tag).getRegex(),ye.gfm.table=Fe(ye.gfm.table).replace("hr",ye.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",ye._tag).getRegex(),ye.pedantic=Me({},ye.normal,{html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye._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:De,paragraph:Fe(ye.normal._paragraph).replace("hr",ye.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ye.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:De,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:De,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};le._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",le.punctuation=Fe(le.punctuation).replace(/punctuation/g,le._punctuation).getRegex(),le._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",le._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",le.em.start=Fe(le.em.start).replace(/punctuation/g,le._punctuation).getRegex(),le.em.middle=Fe(le.em.middle).replace(/punctuation/g,le._punctuation).replace(/overlapSkip/g,le._overlapSkip).getRegex(),le.em.endAst=Fe(le.em.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.em.endUnd=Fe(le.em.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.start=Fe(le.strong.start).replace(/punctuation/g,le._punctuation).getRegex(),le.strong.middle=Fe(le.strong.middle).replace(/punctuation/g,le._punctuation).replace(/blockSkip/g,le._blockSkip).getRegex(),le.strong.endAst=Fe(le.strong.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.endUnd=Fe(le.strong.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.blockSkip=Fe(le._blockSkip,"g").getRegex(),le.overlapSkip=Fe(le._overlapSkip,"g").getRegex(),le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,le._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])?)+(?![-_])/,le.autolink=Fe(le.autolink).replace("scheme",le._scheme).replace("email",le._email).getRegex(),le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,le.tag=Fe(le.tag).replace("comment",ye._comment).replace("attribute",le._attribute).getRegex(),le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,le._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,le.link=Fe(le.link).replace("label",le._label).replace("href",le._href).replace("title",le._title).getRegex(),le.reflink=Fe(le.reflink).replace("label",le._label).getRegex(),le.reflinkSearch=Fe(le.reflinkSearch,"g").replace("reflink",le.reflink).replace("nolink",le.nolink).getRegex(),le.normal=Me({},le),le.pedantic=Me({},le.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:Fe(/^!?\[(label)\]\((.*?)\)/).replace("label",le._label).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le._label).getRegex()}),le.gfm=Me({},le.normal,{escape:Fe(le.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),le.gfm.url=Fe(le.gfm.url,"i").replace("email",le.gfm._extended_email).getRegex(),le.breaks=Me({},le.gfm,{br:Fe(le.br).replace("{2,}","*").getRegex(),text:Fe(le.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Se={block:ye,inline:le},ot=K.defaults,it=Se.block,ct=Se.inline;function xt(Ae){return Ae.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 Xe(Ae){var _e="",xe,re,ae=Ae.length;for(xe=0;xe<ae;xe++)re=Ae.charCodeAt(xe),Math.random()>.5&&(re="x"+re.toString(16)),_e+="&#"+re+";";return _e}var qe=function(){function Ae(xe){this.tokens=[],this.tokens.links=Object.create(null),this.options=xe||ot,this.options.tokenizer=this.options.tokenizer||new Re,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:it.normal,inline:ct.normal};this.options.pedantic?(re.block=it.pedantic,re.inline=ct.pedantic):this.options.gfm&&(re.block=it.gfm,this.options.breaks?re.inline=ct.breaks:re.inline=ct.gfm),this.tokenizer.rules=re}Ae.lex=function(re,ae){var he=new Ae(ae);return he.lex(re)};var _e=Ae.prototype;return _e.lex=function(re){return re=re.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},_e.blockTokens=function(re,ae,he){ae===void 0&&(ae=[]),he===void 0&&(he=!0),re=re.replace(/^ +$/gm,"");for(var be,Te,ke,Ne;re;){if(be=this.tokenizer.space(re)){re=re.substring(be.raw.length),be.type&&ae.push(be);continue}if(be=this.tokenizer.code(re,ae)){re=re.substring(be.raw.length),be.type?ae.push(be):(Ne=ae[ae.length-1],Ne.raw+=`
|
|
`+be.raw,Ne.text+=`
|
|
`+be.text);continue}if(be=this.tokenizer.fences(re)){re=re.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.heading(re)){re=re.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.nptable(re)){re=re.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.hr(re)){re=re.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.blockquote(re)){re=re.substring(be.raw.length),be.tokens=this.blockTokens(be.text,[],he),ae.push(be);continue}if(be=this.tokenizer.list(re)){for(re=re.substring(be.raw.length),ke=be.items.length,Te=0;Te<ke;Te++)be.items[Te].tokens=this.blockTokens(be.items[Te].text,[],!1);ae.push(be);continue}if(be=this.tokenizer.html(re)){re=re.substring(be.raw.length),ae.push(be);continue}if(he&&(be=this.tokenizer.def(re))){re=re.substring(be.raw.length),this.tokens.links[be.tag]||(this.tokens.links[be.tag]={href:be.href,title:be.title});continue}if(be=this.tokenizer.table(re)){re=re.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.lheading(re)){re=re.substring(be.raw.length),ae.push(be);continue}if(he&&(be=this.tokenizer.paragraph(re))){re=re.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.text(re,ae)){re=re.substring(be.raw.length),be.type?ae.push(be):(Ne=ae[ae.length-1],Ne.raw+=`
|
|
`+be.raw,Ne.text+=`
|
|
`+be.text);continue}if(re){var lt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(lt);break}else throw new Error(lt)}}return ae},_e.inline=function(re){var ae,he,be,Te,ke,Ne,lt=re.length;for(ae=0;ae<lt;ae++){Ne=re[ae];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:[]},Te=Ne.header.length,he=0;he<Te;he++)Ne.tokens.header[he]=[],this.inlineTokens(Ne.header[he],Ne.tokens.header[he]);for(Te=Ne.cells.length,he=0;he<Te;he++)for(ke=Ne.cells[he],Ne.tokens.cells[he]=[],be=0;be<ke.length;be++)Ne.tokens.cells[he][be]=[],this.inlineTokens(ke[be],Ne.tokens.cells[he][be]);break}case"blockquote":{this.inline(Ne.tokens);break}case"list":{for(Te=Ne.items.length,he=0;he<Te;he++)this.inline(Ne.items[he].tokens);break}}}return re},_e.inlineTokens=function(re,ae,he,be,Te){ae===void 0&&(ae=[]),he===void 0&&(he=!1),be===void 0&&(be=!1),Te===void 0&&(Te="");var ke,Ne=re,lt;if(this.tokens.links){var ft=Object.keys(this.tokens.links);if(ft.length>0)for(;(lt=this.tokenizer.rules.inline.reflinkSearch.exec(Ne))!=null;)ft.includes(lt[0].slice(lt[0].lastIndexOf("[")+1,-1))&&(Ne=Ne.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(lt=this.tokenizer.rules.inline.blockSkip.exec(Ne))!=null;)Ne=Ne.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(ke=this.tokenizer.escape(re)){re=re.substring(ke.raw.length),ae.push(ke);continue}if(ke=this.tokenizer.tag(re,he,be)){re=re.substring(ke.raw.length),he=ke.inLink,be=ke.inRawBlock,ae.push(ke);continue}if(ke=this.tokenizer.link(re)){re=re.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,be)),ae.push(ke);continue}if(ke=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,be)),ae.push(ke);continue}if(ke=this.tokenizer.strong(re,Ne,Te)){re=re.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],he,be),ae.push(ke);continue}if(ke=this.tokenizer.em(re,Ne,Te)){re=re.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],he,be),ae.push(ke);continue}if(ke=this.tokenizer.codespan(re)){re=re.substring(ke.raw.length),ae.push(ke);continue}if(ke=this.tokenizer.br(re)){re=re.substring(ke.raw.length),ae.push(ke);continue}if(ke=this.tokenizer.del(re)){re=re.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],he,be),ae.push(ke);continue}if(ke=this.tokenizer.autolink(re,Xe)){re=re.substring(ke.raw.length),ae.push(ke);continue}if(!he&&(ke=this.tokenizer.url(re,Xe))){re=re.substring(ke.raw.length),ae.push(ke);continue}if(ke=this.tokenizer.inlineText(re,be,xt)){re=re.substring(ke.raw.length),Te=ke.raw.slice(-1),ae.push(ke);continue}if(re){var Ge="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(Ge);break}else throw new Error(Ge)}}return ae},j(Ae,null,[{key:"rules",get:function(){return{block:it,inline:ct}}}]),Ae}(),dt=K.defaults,vt=Y.cleanUrl,st=Y.escape,tt=function(){function Ae(xe){this.options=xe||dt}var _e=Ae.prototype;return _e.code=function(re,ae,he){var be=(ae||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(re,be);Te!=null&&Te!==re&&(he=!0,re=Te)}return be?'<pre><code class="'+this.options.langPrefix+st(be,!0)+'">'+(he?re:st(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(he?re:st(re,!0))+`</code></pre>
|
|
`},_e.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},_e.html=function(re){return re},_e.heading=function(re,ae,he,be){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+be.slug(he)+'">'+re+"</h"+ae+`>
|
|
`:"<h"+ae+">"+re+"</h"+ae+`>
|
|
`},_e.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},_e.list=function(re,ae,he){var be=ae?"ol":"ul",Te=ae&&he!==1?' start="'+he+'"':"";return"<"+be+Te+`>
|
|
`+re+"</"+be+`>
|
|
`},_e.listitem=function(re){return"<li>"+re+`</li>
|
|
`},_e.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},_e.paragraph=function(re){return"<p>"+re+`</p>
|
|
`},_e.table=function(re,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
|
|
<thead>
|
|
`+re+`</thead>
|
|
`+ae+`</table>
|
|
`},_e.tablerow=function(re){return`<tr>
|
|
`+re+`</tr>
|
|
`},_e.tablecell=function(re,ae){var he=ae.header?"th":"td",be=ae.align?"<"+he+' align="'+ae.align+'">':"<"+he+">";return be+re+"</"+he+`>
|
|
`},_e.strong=function(re){return"<strong>"+re+"</strong>"},_e.em=function(re){return"<em>"+re+"</em>"},_e.codespan=function(re){return"<code>"+re+"</code>"},_e.br=function(){return this.options.xhtml?"<br/>":"<br>"},_e.del=function(re){return"<del>"+re+"</del>"},_e.link=function(re,ae,he){if(re=vt(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var be='<a href="'+st(re)+'"';return ae&&(be+=' title="'+ae+'"'),be+=">"+he+"</a>",be},_e.image=function(re,ae,he){if(re=vt(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var be='<img src="'+re+'" alt="'+he+'"';return ae&&(be+=' title="'+ae+'"'),be+=this.options.xhtml?"/>":">",be},_e.text=function(re){return re},Ae}(),rt=function(){function Ae(){}var _e=Ae.prototype;return _e.strong=function(re){return re},_e.em=function(re){return re},_e.codespan=function(re){return re},_e.del=function(re){return re},_e.html=function(re){return re},_e.text=function(re){return re},_e.link=function(re,ae,he){return""+he},_e.image=function(re,ae,he){return""+he},_e.br=function(){return""},Ae}(),Bt=function(){function Ae(){this.seen={}}var _e=Ae.prototype;return _e.slug=function(re){var ae=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var he=ae;do this.seen[he]++,ae=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},Ae}(),Pt=K.defaults,Ct=Y.unescape,_t=function(){function Ae(xe){this.options=xe||Pt,this.options.renderer=this.options.renderer||new tt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rt,this.slugger=new Bt}Ae.parse=function(re,ae){var he=new Ae(ae);return he.parse(re)};var _e=Ae.prototype;return _e.parse=function(re,ae){ae===void 0&&(ae=!0);var he="",be,Te,ke,Ne,lt,ft,Ge,bt,nt,je,Ft,Ie,Zt,Gt,wt,St,en,Qe,It=re.length;for(be=0;be<It;be++){je=re[be];switch(je.type){case"space":continue;case"hr":{he+=this.renderer.hr();continue}case"heading":{he+=this.renderer.heading(this.parseInline(je.tokens),je.depth,Ct(this.parseInline(je.tokens,this.textRenderer)),this.slugger);continue}case"code":{he+=this.renderer.code(je.text,je.lang,je.escaped);continue}case"table":{for(bt="",Ge="",Ne=je.header.length,Te=0;Te<Ne;Te++)Ge+=this.renderer.tablecell(this.parseInline(je.tokens.header[Te]),{header:!0,align:je.align[Te]});for(bt+=this.renderer.tablerow(Ge),nt="",Ne=je.cells.length,Te=0;Te<Ne;Te++){for(ft=je.tokens.cells[Te],Ge="",lt=ft.length,ke=0;ke<lt;ke++)Ge+=this.renderer.tablecell(this.parseInline(ft[ke]),{header:!1,align:je.align[ke]});nt+=this.renderer.tablerow(Ge)}he+=this.renderer.table(bt,nt);continue}case"blockquote":{nt=this.parse(je.tokens),he+=this.renderer.blockquote(nt);continue}case"list":{for(Ft=je.ordered,Ie=je.start,Zt=je.loose,Ne=je.items.length,nt="",Te=0;Te<Ne;Te++)wt=je.items[Te],St=wt.checked,en=wt.task,Gt="",wt.task&&(Qe=this.renderer.checkbox(St),Zt?wt.tokens.length>0&&wt.tokens[0].type==="text"?(wt.tokens[0].text=Qe+" "+wt.tokens[0].text,wt.tokens[0].tokens&&wt.tokens[0].tokens.length>0&&wt.tokens[0].tokens[0].type==="text"&&(wt.tokens[0].tokens[0].text=Qe+" "+wt.tokens[0].tokens[0].text)):wt.tokens.unshift({type:"text",text:Qe}):Gt+=Qe),Gt+=this.parse(wt.tokens,Zt),nt+=this.renderer.listitem(Gt,en,St);he+=this.renderer.list(nt,Ft,Ie);continue}case"html":{he+=this.renderer.html(je.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline(je.tokens));continue}case"text":{for(nt=je.tokens?this.parseInline(je.tokens):je.text;be+1<It&&re[be+1].type==="text";)je=re[++be],nt+=`
|
|
`+(je.tokens?this.parseInline(je.tokens):je.text);he+=ae?this.renderer.paragraph(nt):nt;continue}default:{var Wt='Token with "'+je.type+'" type was not found.';if(this.options.silent){console.error(Wt);return}else throw new Error(Wt)}}}return he},_e.parseInline=function(re,ae){ae=ae||this.renderer;var he="",be,Te,ke=re.length;for(be=0;be<ke;be++){Te=re[be];switch(Te.type){case"escape":{he+=ae.text(Te.text);break}case"html":{he+=ae.html(Te.text);break}case"link":{he+=ae.link(Te.href,Te.title,this.parseInline(Te.tokens,ae));break}case"image":{he+=ae.image(Te.href,Te.title,Te.text);break}case"strong":{he+=ae.strong(this.parseInline(Te.tokens,ae));break}case"em":{he+=ae.em(this.parseInline(Te.tokens,ae));break}case"codespan":{he+=ae.codespan(Te.text);break}case"br":{he+=ae.br();break}case"del":{he+=ae.del(this.parseInline(Te.tokens,ae));break}case"text":{he+=ae.text(Te.text);break}default:{var Ne='Token with "'+Te.type+'" type was not found.';if(this.options.silent){console.error(Ne);return}else throw new Error(Ne)}}}return he},Ae}(),Vt=Y.merge,Ot=Y.checkSanitizeDeprecation,Rt=Y.escape,Ve=K.getDefaults,Xt=K.changeDefaults,At=K.defaults;function ze(Ae,_e,xe){if(typeof Ae=="undefined"||Ae===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ae!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ae)+", string expected");if(typeof _e=="function"&&(xe=_e,_e=null),_e=Vt({},ze.defaults,_e||{}),Ot(_e),xe){var re=_e.highlight,ae;try{ae=qe.lex(Ae,_e)}catch(ke){return xe(ke)}var he=function(Ne){var lt;if(!Ne)try{lt=_t.parse(ae,_e)}catch(ft){Ne=ft}return _e.highlight=re,Ne?xe(Ne):xe(null,lt)};if(!re||re.length<3)return he();if(delete _e.highlight,!ae.length)return he();var be=0;ze.walkTokens(ae,function(ke){ke.type==="code"&&(be++,setTimeout(function(){re(ke.text,ke.lang,function(Ne,lt){if(Ne)return he(Ne);lt!=null&<!==ke.text&&(ke.text=lt,ke.escaped=!0),be--,be===0&&he()})},0))}),be===0&&he();return}try{var Te=qe.lex(Ae,_e);return _e.walkTokens&&ze.walkTokens(Te,_e.walkTokens),_t.parse(Te,_e)}catch(ke){if(ke.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,_e.silent)return"<p>An error occurred:</p><pre>"+Rt(ke.message+"",!0)+"</pre>";throw ke}}ze.options=ze.setOptions=function(Ae){return Vt(ze.defaults,Ae),Xt(ze.defaults),ze},ze.getDefaults=Ve,ze.defaults=At,ze.use=function(Ae){var _e=Vt({},Ae);if(Ae.renderer&&function(){var re=ze.defaults.renderer||new tt,ae=function(Te){var ke=re[Te];re[Te]=function(){for(var Ne=arguments.length,lt=new Array(Ne),ft=0;ft<Ne;ft++)lt[ft]=arguments[ft];var Ge=Ae.renderer[Te].apply(re,lt);return Ge===!1&&(Ge=ke.apply(re,lt)),Ge}};for(var he in Ae.renderer)ae(he);_e.renderer=re}(),Ae.tokenizer&&function(){var re=ze.defaults.tokenizer||new Re,ae=function(Te){var ke=re[Te];re[Te]=function(){for(var Ne=arguments.length,lt=new Array(Ne),ft=0;ft<Ne;ft++)lt[ft]=arguments[ft];var Ge=Ae.tokenizer[Te].apply(re,lt);return Ge===!1&&(Ge=ke.apply(re,lt)),Ge}};for(var he in Ae.tokenizer)ae(he);_e.tokenizer=re}(),Ae.walkTokens){var xe=ze.defaults.walkTokens;_e.walkTokens=function(re){Ae.walkTokens(re),xe&&xe(re)}}ze.setOptions(_e)},ze.walkTokens=function(Ae,_e){for(var xe=D(Ae),re;!(re=xe()).done;){var ae=re.value;_e(ae);switch(ae.type){case"table":{for(var he=D(ae.tokens.header),be;!(be=he()).done;){var Te=be.value;ze.walkTokens(Te,_e)}for(var ke=D(ae.tokens.cells),Ne;!(Ne=ke()).done;)for(var lt=Ne.value,ft=D(lt),Ge;!(Ge=ft()).done;){var bt=Ge.value;ze.walkTokens(bt,_e)}break}case"list":{ze.walkTokens(ae.items,_e);break}default:ae.tokens&&ze.walkTokens(ae.tokens,_e)}}},ze.Parser=_t,ze.parser=_t.parse,ze.Renderer=tt,ze.TextRenderer=rt,ze.Lexer=qe,ze.lexer=qe.lex,ze.Tokenizer=Re,ze.Slugger=Bt,ze.parse=ze;var at=ze;return at})},ELLl:function(ht,et,Z){(function(oe){oe(Z("VrN/"))})(function(oe){var j={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(u,f,s){s&&s!=oe.Init&&(u.removeKeyMap(D),u.state.closeBrackets=null),f&&(F(X(f,"pairs")),u.state.closeBrackets=f,u.addKeyMap(D))});function X(u,f){return f=="pairs"&&typeof u=="string"?u:typeof u=="object"&&u[f]!=null?u[f]:j[f]}var D={Backspace:P,Enter:I};function F(u){for(var f=0;f<u.length;f++){var s=u.charAt(f),r="'"+s+"'";D[r]||(D[r]=K(s))}}F(j.pairs+"`");function K(u){return function(f){return m(f,u)}}function H(u){var f=u.state.closeBrackets;if(!f||f.override)return f;var s=u.getModeAt(u.getCursor());return s.closeBrackets||f}function P(u){var f=H(u);if(!f||u.getOption("disableInput"))return oe.Pass;for(var s=X(f,"pairs"),r=u.listSelections(),a=0;a<r.length;a++){if(!r[a].empty())return oe.Pass;var d=p(u,r[a].head);if(!d||s.indexOf(d)%2!=0)return oe.Pass}for(var a=r.length-1;a>=0;a--){var L=r[a].head;u.replaceRange("",M(L.line,L.ch-1),M(L.line,L.ch+1),"+delete")}}function I(u){var f=H(u),s=f&&X(f,"explode");if(!s||u.getOption("disableInput"))return oe.Pass;for(var r=u.listSelections(),a=0;a<r.length;a++){if(!r[a].empty())return oe.Pass;var d=p(u,r[a].head);if(!d||s.indexOf(d)%2!=0)return oe.Pass}u.operation(function(){var L=u.lineSeparator()||`
|
|
`;u.replaceSelection(L+L,null),u.execCommand("goCharLeft"),r=u.listSelections();for(var C=0;C<r.length;C++){var x=r[C].head.line;u.indentLine(x,null,!0),u.indentLine(x+1,null,!0)}})}function y(u){var f=oe.cmpPos(u.anchor,u.head)>0;return{anchor:new M(u.anchor.line,u.anchor.ch+(f?-1:1)),head:new M(u.head.line,u.head.ch+(f?1:-1))}}function m(u,f){var s=H(u);if(!s||u.getOption("disableInput"))return oe.Pass;var r=X(s,"pairs"),a=r.indexOf(f);if(a==-1)return oe.Pass;for(var d=X(s,"closeBefore"),L=X(s,"triples"),C=r.charAt(a+1)==f,x=u.listSelections(),R=a%2==0,O,w=0;w<x.length;w++){var E=x[w],b=E.head,l,_=u.getRange(b,M(b.line,b.ch+1));if(R&&!E.empty())l="surround";else if((C||!R)&&_==f)C&&c(u,b)?l="both":L.indexOf(f)>=0&&u.getRange(b,M(b.line,b.ch+3))==f+f+f?l="skipThree":l="skip";else if(C&&b.ch>1&&L.indexOf(f)>=0&&u.getRange(M(b.line,b.ch-2),b)==f+f){if(b.ch>2&&/\bstring/.test(u.getTokenTypeAt(M(b.line,b.ch-2))))return oe.Pass;l="addFour"}else if(C){var h=b.ch==0?" ":u.getRange(M(b.line,b.ch-1),b);if(!oe.isWordChar(_)&&h!=f&&!oe.isWordChar(h))l="both";else return oe.Pass}else if(R&&(_.length===0||/\s/.test(_)||d.indexOf(_)>-1))l="both";else return oe.Pass;if(!O)O=l;else if(O!=l)return oe.Pass}var g=a%2?r.charAt(a-1):f,T=a%2?f:r.charAt(a+1);u.operation(function(){if(O=="skip")u.execCommand("goCharRight");else if(O=="skipThree")for(var N=0;N<3;N++)u.execCommand("goCharRight");else if(O=="surround"){for(var V=u.getSelections(),N=0;N<V.length;N++)V[N]=g+V[N]+T;u.replaceSelections(V,"around"),V=u.listSelections().slice();for(var N=0;N<V.length;N++)V[N]=y(V[N]);u.setSelections(V)}else O=="both"?(u.replaceSelection(g+T,null),u.triggerElectric(g+T),u.execCommand("goCharLeft")):O=="addFour"&&(u.replaceSelection(g+g+g+g,"before"),u.execCommand("goCharRight"))})}function p(u,f){var s=u.getRange(M(f.line,f.ch-1),M(f.line,f.ch+1));return s.length==2?s:null}function c(u,f){var s=u.getTokenAt(M(f.line,f.ch+1));return/\bstring/.test(s.type)&&s.start==f.ch&&(f.ch==0||!/\bstring/.test(u.getTokenTypeAt(f)))}})},FOrL:function(ht,et,Z){ht.exports=Z.p+"static/nodata.a6b3f948.png"},Fhpe:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___1W7Bl",flex_space_between:"flex_space_between___3S4Sp",flex_box_vertical_center:"flex_box_vertical_center___5mGEA",flex_box_center_end:"flex_box_center_end___1blqp",flex_box_column:"flex_box_column___4i1E0",CustomCss:"CustomCss___3thFA",CustomTipsModalCss:"CustomTipsModalCss___2aNwC",dropdownmenus:"dropdownmenus___19dGk",popupClassNames:"popupClassNames___3LOFQ",selectdown:"selectdown___1_utH"}},HmJG:function(ht,et,Z){},JAbv:function(ht,et){ht.exports="data:image/png;base64,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"},KOXS:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___4BHX-",flex_space_between:"flex_space_between___fH2oM",flex_box_vertical_center:"flex_box_vertical_center___TgSS9",flex_box_center_end:"flex_box_center_end___1vKaD",flex_box_column:"flex_box_column___1kCgI",input:"input___2mV-b",dropdown:"dropdown___1QKW2",menu:"menu___37CBn",text:"text___159fF",b1:"b1___2uGyF",b2:"b2___2DXw1"}},LdHM:function(ht,et,Z){"use strict";Z.d(et,"b",function(){return d}),Z.d(et,"a",function(){return C});var oe=Z("1OyB"),j=Z("vuIU"),M=Z("Ji7U"),X=Z("LK+K"),D=Z("cDcd"),F=Z("rePB"),K=Z("Ff2n"),H=Z("ODXe"),P=Z("4IlW"),I=Z("bX4T"),y=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),c=Z("+nKL"),u=Z("8OUc"),f=function(J,te){var se=J.prefixCls,fe=J.id,Ue=J.flattenOptions,Re=J.childrenAsData,De=J.values,Fe=J.searchValue,Me=J.multiple,ye=J.defaultActiveFirstOption,le=J.height,Se=J.itemHeight,ot=J.notFoundContent,it=J.open,ct=J.menuItemSelectedIcon,xt=J.virtual,Xe=J.onSelect,qe=J.onToggleOpen,dt=J.onActiveValue,vt=J.onScroll,st=J.onMouseEnter,tt="".concat(se,"-item"),rt=Object(y.a)(function(){return Ue},[it,Ue],function(at,Ae){return Ae[0]&&at[1]!==Ae[1]}),Bt=D.useRef(null),Pt=function(Ae){Ae.preventDefault()},Ct=function(Ae){Bt.current&&Bt.current.scrollTo({index:Ae})},_t=function(Ae){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,xe=rt.length,re=0;re<xe;re+=1){var ae=(Ae+re*_e+xe)%xe,he=rt[ae],be=he.group,Te=he.data;if(!be&&!Te.disabled)return ae}return-1},Vt=D.useState(function(){return _t(0)}),Ot=Object(H.a)(Vt,2),Rt=Ot[0],Ve=Ot[1],Xt=function(Ae){Ve(Ae);var _e=rt[Ae];if(!_e){dt(null,-1);return}dt(_e.data.value,Ae)};D.useEffect(function(){Xt(ye!==!1?_t(0):-1)},[rt.length,Fe]),D.useEffect(function(){var at=setTimeout(function(){if(!Me&&it&&De.size===1){var Ae=Array.from(De)[0],_e=rt.findIndex(function(xe){var re=xe.data;return re.value===Ae});Xt(_e),Ct(_e)}});return function(){return clearTimeout(at)}},[it]);var At=function(Ae){Ae!==void 0&&Xe(Ae,{selected:!De.has(Ae)}),Me||qe(!1)};if(D.useImperativeHandle(te,function(){return{onKeyDown:function(Ae){var _e=Ae.which;switch(_e){case P.a.UP:case P.a.DOWN:{var xe=0;if(_e===P.a.UP?xe=-1:_e===P.a.DOWN&&(xe=1),xe!==0){var re=_t(Rt+xe,xe);Ct(re),Xt(re)}break}case P.a.ENTER:{var ae=rt[Rt];ae&&!ae.data.disabled?At(ae.data.value):At(void 0),it&&Ae.preventDefault();break}case P.a.ESC:qe(!1)}},onKeyUp:function(){},scrollTo:function(Ae){Ct(Ae)}}}),rt.length===0)return D.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(tt,"-empty"),onMouseDown:Pt},ot);function ze(at){var Ae=rt[at];if(!Ae)return null;var _e=Ae.data||{},xe=_e.value,re=_e.label,ae=_e.children,he=Object(I.a)(_e,!0),be=Re?ae:re;return Ae?D.createElement("div",Object.assign({"aria-label":typeof be=="string"?be:null},he,{key:at,role:"option",id:"".concat(fe,"_list_").concat(at),"aria-selected":De.has(xe)}),xe):null}return D.createElement(D.Fragment,null,D.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},ze(Rt-1),ze(Rt),ze(Rt+1)),D.createElement(c.a,{itemKey:"key",ref:Bt,data:rt,height:le,itemHeight:Se,fullHeight:!1,onMouseDown:Pt,onScroll:vt,virtual:xt,onMouseEnter:st},function(at,Ae){var _e,xe=at.group,re=at.groupOption,ae=at.data,he=ae.label,be=ae.key;if(xe)return D.createElement("div",{className:p()(tt,"".concat(tt,"-group"))},he!==void 0?he:be);var Te=ae.disabled,ke=ae.value,Ne=ae.title,lt=ae.children,ft=ae.style,Ge=ae.className,bt=Object(K.a)(ae,["disabled","value","title","children","style","className"]),nt=De.has(ke),je="".concat(tt,"-option"),Ft=p()(tt,je,Ge,(_e={},Object(F.a)(_e,"".concat(je,"-grouped"),re),Object(F.a)(_e,"".concat(je,"-active"),Rt===Ae&&!Te),Object(F.a)(_e,"".concat(je,"-disabled"),Te),Object(F.a)(_e,"".concat(je,"-selected"),nt),_e)),Ie=Re?lt:he,Zt=!ct||typeof ct=="function"||nt;return D.createElement("div",Object.assign({},bt,{"aria-selected":nt,className:Ft,title:Ne,onMouseMove:function(){if(Rt===Ae||Te)return;Xt(Ae)},onClick:function(){Te||At(ke)},style:ft}),D.createElement("div",{className:"".concat(je,"-content")},Ie||ke),D.isValidElement(ct)||nt,Zt&&D.createElement(u.a,{className:"".concat(tt,"-option-state"),customizeIcon:ct,customizeIconProps:{isSelected:nt}},nt?"\u2713":null))}))},s=D.forwardRef(f);s.displayName="OptionList";var r=s,a=function(){return null};a.isSelectOption=!0;var d=a,L=function(){return null};L.isSelectOptGroup=!0;var C=L,x=Z("VTBJ"),R=Z("Zm9Q");function O(A){var J=A.key,te=A.props,se=te.children,fe=te.value,Ue=Object(K.a)(te,["children","value"]);return Object(x.a)({key:J,value:fe!==void 0?fe:J,children:se},Ue)}function w(A){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(A).map(function(te,se){if(!D.isValidElement(te)||!te.type)return null;var fe=te.type.isSelectOptGroup,Ue=te.key,Re=te.props,De=Re.children,Fe=Object(K.a)(Re,["children"]);return J||!fe?O(te):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(Ue===null?se:Ue,"__"),label:Ue},Fe),{},{options:w(De)})}).filter(function(te){return te})}var E=Z("2Qr1"),b=Z("qNPg"),l=Z("U8pU"),_=Z("Kwbf"),h=Z("WKfj");function g(A){var J=A.mode,te=A.options,se=A.children,fe=A.backfill,Ue=A.allowClear,Re=A.placeholder,De=A.getInputElement,Fe=A.showSearch,Me=A.onSearch,ye=A.defaultOpen,le=A.autoFocus,Se=A.labelInValue,ot=A.value,it=A.inputValue,ct=A.optionLabelProp,xt=J==="multiple"||J==="tags",Xe=Fe!==void 0?Fe:xt||J==="combobox",qe=te||w(se);if(Object(_.a)(J!=="tags"||qe.every(function(tt){return!tt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),J==="tags"||J==="combobox"){var dt=qe.some(function(tt){return tt.options?tt.options.some(function(rt){return typeof("value"in rt?rt.value:rt.key)=="number"}):typeof("value"in tt?tt.value:tt.key)=="number"});Object(_.a)(!dt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)(J!=="combobox"||!ct,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)(J==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(_.a)(J==="combobox"||!De,"`getInputElement` only work with `combobox` mode."),Object(_.b)(J!=="combobox"||!De||!Ue||!Re,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Me&&!Xe&&J!=="combobox"&&J!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!ye||le,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ot!=null){var vt=Object(h.d)(ot);Object(_.a)(!Se||vt.every(function(tt){return Object(l.a)(tt)==="object"&&("key"in tt||"value"in tt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!xt||Array.isArray(ot),"`value` should be array when `mode` is `multiple` or `tags`")}if(se){var st=null;Object(R.a)(se).some(function(tt){if(!D.isValidElement(tt)||!tt.type)return!1;var rt=tt.type;if(rt.isSelectOption)return!1;if(rt.isSelectOptGroup){var Bt=Object(R.a)(tt.props.children).every(function(Pt){return!D.isValidElement(Pt)||!tt.type||Pt.type.isSelectOption?!0:(st=Pt.type,!1)});return!Bt}return st=rt,!0}),st&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(st.displayName||st.name||st,"`.")),Object(_.a)(it===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var T=g,N=Object(b.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:w,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:T,fillOptionsWithMissingValue:E.a}),V=function(A){Object(M.a)(te,A);var J=Object(X.a)(te);function te(){var se;return Object(oe.a)(this,te),se=J.apply(this,arguments),se.selectRef=D.createRef(),se.focus=function(){se.selectRef.current.focus()},se.blur=function(){se.selectRef.current.blur()},se}return Object(j.a)(te,[{key:"render",value:function(){return D.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),te}(D.Component);V.Option=d,V.OptGroup=C;var Y=V,U=et.c=Y},M8RZ:function(ht,et,Z){"use strict";Z.d(et,"a",function(){return P});var oe=Z("fWQN"),j=Z("mtLc"),M=Z("yKVA"),X=Z("879j"),D=Z("cDcd"),F=Z.n(D),K=Z("faye"),H=Z.n(K),P=function(I){Object(M.a)(m,I);var y=Object(X.a)(m);function m(p){var c;Object(oe.a)(this,m),c=y.call(this,p);var u=window.document;return c.node=u.createElement("div"),u.body.appendChild(c.node),c}return Object(j.a)(m,[{key:"render",value:function(){var c=this.props.children;return Object(K.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(F.a.Component)},MEgm:function(ht,et){ht.exports="data:image/png;base64,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"},NQs2:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___3K14R",flex_space_between:"flex_space_between___1KE7t",flex_box_vertical_center:"flex_box_vertical_center___3Yslx",flex_box_center_end:"flex_box_center_end___2RmV-",flex_box_column:"flex_box_column___3k3IQ",banner:"banner___3caau",content:"content___fxe_p",btns:"btns___Vv-WB"}},NcEG:function(ht,et,Z){"use strict";Z.r(et);var oe=Z("+L6B"),j=Z("2/Rp"),M=Z("5NDa"),X=Z("5rEg"),D=Z("Znn+"),F=Z("ZTPi"),K=Z("2qtc"),H=Z("kLXV"),P=Z("14J3"),I=Z("BMrR"),y=Z("jCWc"),m=Z("kPKH"),p=Z("sPJy"),c=Z("bE4q"),u=Z("/zsF"),f=Z("PArb"),s=Z("miYZ"),r=Z("tsqr"),a=Z("9og8"),d=Z("k1fw"),L=Z("oBTY"),C=Z("y8nQ"),x=Z("Vl3Y"),R=Z("tJVT"),O=Z("PpiC"),w=Z("B9cy"),E=Z("Ol7k"),b=Z("lUTK"),l=Z("BvKs"),_=Z("WmNS"),h=Z.n(_),g=Z("cDcd"),T=Z.n(g),N=Z("Ty5D"),V=Z("55Ip"),Y=Z("9kvl"),U=Z("tgas"),A=Z("jb+D"),J=Z("BdwD"),te=Z("giR+"),se=Z("fyUT"),fe=Z("sRBo"),Ue=Z("kaz8"),Re=Z("5Dmo"),De=Z("3S7+"),Fe=Z("V0Rq"),Me=Z("Ot1p"),ye=Z("9Bee"),le=Z("xvzu"),Se=Z.n(le),ot=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],it=function(Ne,lt){var ft=Ne.problemset,Ge=Ne.globalSetting,bt=Ne.loading,nt=Ne.dispatch,je=Ne.onRef,Ft=je===void 0?function(){}:je,Ie=Ne.editData,Zt=Object(O.a)(Ne,["problemset","globalSetting","loading","dispatch","onRef","editData"]),Gt=Object(g.useState)([]),wt=Object(R.a)(Gt,2),St=wt[0],en=wt[1],Qe=Object(g.useState)(),It=Object(R.a)(Qe,2),Wt=It[0],Jt=It[1],tn=Object(g.useState)([]),Tt=Object(R.a)(tn,2),ln=Tt[0],Ht=Tt[1],Et=Object(g.useState)(""),fn=Object(R.a)(Et,2),nn=fn[0],rn=fn[1],Yt=Object(g.useState)(5),Ln=Object(R.a)(Yt,2),Xn=Ln[0],Kn=Ln[1],$e=Object(g.useState)(!1),Kt=Object(R.a)($e,2),zn=Kt[0],bn=Kt[1],pn=Object(N.i)();Object(g.useEffect)(function(){en(["","","",""])},[]),Object(g.useEffect)(function(){if(!(Ie!=null&&Ie.question_choices)){bn(!0);return}rn(Ie==null?void 0:Ie.question_title),Kn(parseInt(Ie==null?void 0:Ie.question_score)),en(Ie==null?void 0:Ie.question_choices.map(function(W){return W.choice_text}));var q=[];Ie==null||Ie.standard_answer.map(function(W,ue){q.push(W-1)}),Ht(q)},[Ie]),Object(g.useImperativeHandle)(lt,function(){return{onSave:Mn,isEdit:zn}});var Mn=function(){var q=Object(a.a)(h.a.mark(function W(){var ue,We,Ye;return h.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:if(nn){Ke.next=3;break}return r.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ke.abrupt("return",!1);case 3:if(ue=St.findIndex(function(gt){return!gt}),!(ue>-1)){Ke.next=7;break}return r.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ot[ue]," \u9009\u9879\u7684\u5185\u5BB9")),Ke.abrupt("return",!1);case 7:if(ln.length){Ke.next=10;break}return r.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ke.abrupt("return",!1);case 10:if(!(ln.length<1)){Ke.next=13;break}return r.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ke.abrupt("return",!1);case 13:if(We=St.map(function(gt,an){return{choice_text:gt,is_answer:ln.includes(an)?an+1:0}}),!Ie.question_id){Ke.next=20;break}return Ke.next=17,nt({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:nn,question_type:1,question_score:"5.0",question_choices:We.map(function(gt){return gt.choice_text}),standard_answers:We.filter(function(gt){return gt.is_answer}).map(function(gt){return gt.is_answer})}});case 17:Ye=Ke.sent,Ke.next=23;break;case 20:return Ke.next=22,nt({type:"exercise/addExerciseQuestion",payload:{categoryId:pn.categoryId,question_title:nn,question_type:1,question_score:"5.0",question_choices:We.map(function(gt){return gt.choice_text}),standard_answers:We.filter(function(gt){return gt.is_answer}).map(function(gt){return gt.is_answer})}});case 22:Ye=Ke.sent;case 23:Ye.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),bn(!1),nt({type:"exercise/editExercise",payload:Object(d.a)({},pn)}));case 24:case"end":return Ke.stop()}},W)}));return function(){return q.apply(this,arguments)}}(),G=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],v=function(){var q=Object(a.a)(h.a.mark(function W(ue){return h.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:Ye.t0=ue.id,Ye.next=Ye.t0==="del"?3:Ye.t0==="up"||Ye.t0==="down"?5:Ye.t0==="edit"?9:11;break;case 3:return H.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function Ke(){return h.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Object(Fe.n)({id:Ie.question_id});case 2:nt({type:"exercise/editExercise",payload:Object(d.a)({},pn)});case 3:case"end":return an.stop()}},Ke)}))()}}),Ye.abrupt("break",11);case 5:return Ye.next=7,nt({type:"exercise/exeriseMoveUpDown",payload:{id:Ie.question_id,opr:ue.id}});case 7:return nt({type:"exercise/editExercise",payload:Object(d.a)({},pn)}),Ye.abrupt("break",11);case 9:return bn(!0),Ye.abrupt("break",11);case 11:case"end":return Ye.stop()}},W)}));return function(ue){return q.apply(this,arguments)}}(),S=function(){var W;return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u591A\u9009\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09"),!Ie.hideAction&&G.map(function(ue,We){return ue.id==="up"&&Ie.key===1||ue.id==="down"&&Ie.key===Ie.len?null:T.a.createElement(De.a,{key:We,placement:"bottom",title:ue.name},T.a.createElement("span",{onClick:function(){return v(ue)},className:ue.icon}))})),T.a.createElement("div",{className:"mt5"},T.a.createElement(ye.a,{value:Ie.question_title})),T.a.createElement("div",{className:Se.a.questionChoices},Ie==null||((W=Ie.question_choices)===null||W===void 0)?void 0:W.map(function(ue,We){return T.a.createElement(I.a,null,T.a.createElement(m.a,null,T.a.createElement(Ue.a,{key:We,checked:Ie.standard_answer.includes(We+1),disabled:!0},ot[We],".")),T.a.createElement(m.a,{flex:"1"},T.a.createElement("span",{className:"c-black font14"},T.a.createElement(ye.a,{value:ue.choice_text}))))})))},B=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),T.a.createElement("p",{className:Se.a.titleWrap},T.a.createElement("span",{className:Se.a.required},"*"),T.a.createElement("span",{className:Se.a.title},"\u9898\u5E72\uFF1A")),T.a.createElement(Me.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:nn,onChange:function(ue){return rn(ue)}}),T.a.createElement("p",{className:Se.a.titleWrap},T.a.createElement("span",{className:Se.a.required},"*"),T.a.createElement("span",{className:Se.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",T.a.createElement("span",{className:Se.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),St.map(function(W,ue){return T.a.createElement("div",{className:Se.a.choiceWrap,key:ue},T.a.createElement(De.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},T.a.createElement("div",{className:"".concat(Se.a.answer," ").concat(ln.includes(ue)?Se.a.activeAnswer:""),onClick:function(){ln.includes(ue)?Ht(ln.filter(function(Ye){return Ye!==ue})):Ht([].concat(Object(L.a)(ln),[ue]))}},ot[ue])),T.a.createElement("div",{className:Se.a.editorWrap},Wt===ue?T.a.createElement(Me.a,{id:"single-question-option-".concat(ue),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:W,onChange:function(Ye){St[ue]=Ye,en(St)}}):T.a.createElement("div",{className:Se.a.htmlWrap,onClick:function(){return Jt(ue)}},T.a.createElement(ye.a,{value:W}))),ue>1&&T.a.createElement(De.a,{title:"\u5220\u9664"},T.a.createElement("i",{className:"".concat(Se.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return en(St.filter(function(Ye,Lt){return Lt!==ue}))}})),ue<7&&ue===St.length-1&&T.a.createElement(De.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},T.a.createElement("i",{className:"".concat(Se.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return en([].concat(Object(L.a)(St),[""]))}})))}),T.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(se.a,{value:Xn,max:1e4,min:-1,onChange:function(ue){Kn(ue)}})," \u5206"),T.a.createElement("aside",{className:"tr"},Ie.question_id&&T.a.createElement(j.a,{type:"default",onClick:function(){return bn(!1)}},"\u53D6\u6D88"),T.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return Mn()}},"\u4FDD\u5B58")))};return T.a.createElement("section",{className:Se.a.wrap},!zn&&S(),zn&&B())},ct=Object(Y.a)(function(ke){var Ne=ke.problemset,lt=ke.loading,ft=ke.globalSetting;return{problemset:Ne,globalSetting:ft,loading:lt.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(it)),xt=Z("7Kak"),Xe=Z("9yH6"),qe=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],dt=function(Ne,lt){var ft=Ne.problemset,Ge=Ne.globalSetting,bt=Ne.loading,nt=Ne.dispatch,je=Ne.onRef,Ft=je===void 0?function(){}:je,Ie=Ne.editData,Zt=Object(O.a)(Ne,["problemset","globalSetting","loading","dispatch","onRef","editData"]),Gt=Object(g.useState)([]),wt=Object(R.a)(Gt,2),St=wt[0],en=wt[1],Qe=Object(g.useState)(),It=Object(R.a)(Qe,2),Wt=It[0],Jt=It[1],tn=Object(g.useState)([]),Tt=Object(R.a)(tn,2),ln=Tt[0],Ht=Tt[1],Et=Object(g.useState)(""),fn=Object(R.a)(Et,2),nn=fn[0],rn=fn[1],Yt=Object(g.useState)(0),Ln=Object(R.a)(Yt,2),Xn=Ln[0],Kn=Ln[1],$e=Object(g.useState)(!1),Kt=Object(R.a)($e,2),zn=Kt[0],bn=Kt[1],pn=Object(N.i)();Object(g.useEffect)(function(){en(["","","",""])},[]),Object(g.useEffect)(function(){if(!(Ie!=null&&Ie.question_choices)){bn(!0);return}rn(Ie==null?void 0:Ie.question_title),Kn(parseInt(Ie==null?void 0:Ie.question_score)),en(Ie==null?void 0:Ie.question_choices.map(function(W){return W.choice_text}));var q=[];Ie==null||Ie.standard_answer.map(function(W,ue){q.push(W-1)}),Ht(q)},[Ie]),Object(g.useImperativeHandle)(lt,function(){return{onSave:Mn,isEdit:zn}});var Mn=function(){var q=Object(a.a)(h.a.mark(function W(){var ue,We,Ye;return h.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:if(nn){Ke.next=3;break}return r.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ke.abrupt("return",!1);case 3:if(ue=St.findIndex(function(gt){return!gt}),!(ue>-1)){Ke.next=7;break}return r.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(qe[ue]," \u9009\u9879\u7684\u5185\u5BB9")),Ke.abrupt("return",!1);case 7:if(ln.length){Ke.next=10;break}return r.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ke.abrupt("return",!1);case 10:if(!(ln.length<1)){Ke.next=13;break}return r.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ke.abrupt("return",!1);case 13:if(We=St.map(function(gt,an){return{choice_text:gt,is_answer:ln.includes(an)?an+1:0}}),!Ie.question_id){Ke.next=20;break}return Ke.next=17,Object(U.u)({id:Ie.question_id,question_title:nn,question_type:1,question_score:Xn,question_choices:We.map(function(gt){return gt.choice_text}),standard_answers:We.filter(function(gt){return gt.is_answer}).map(function(gt){return gt.is_answer})});case 17:Ye=Ke.sent,Ke.next=23;break;case 20:return Ke.next=22,Object(U.a)({exercise_bank_id:pn.topicId,question_title:nn,question_type:1,question_score:"5.0",question_choices:We.map(function(gt){return gt.choice_text}),standard_answers:We.filter(function(gt){return gt.is_answer}).map(function(gt){return gt.is_answer})});case 22:Ye=Ke.sent;case 23:return Ye.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),bn(!1)),Ke.next=26,nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},pn)});case 26:case"end":return Ke.stop()}},W)}));return function(){return q.apply(this,arguments)}}(),G=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],v=function(){var q=Object(a.a)(h.a.mark(function W(ue){return h.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:Ye.t0=ue.id,Ye.next=Ye.t0==="del"?3:Ye.t0==="up"||Ye.t0==="down"?5:Ye.t0==="edit"?9:11;break;case 3:return H.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function Ke(){return h.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Object(U.e)({pollsId:Ie.question_id});case 2:nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},pn)});case 3:case"end":return an.stop()}},Ke)}))()}}),Ye.abrupt("break",11);case 5:return Ye.next=7,Object(U.j)({exerciseId:Ie==null?void 0:Ie.question_id,opr:ue.id});case 7:return nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},pn)}),Ye.abrupt("break",11);case 9:return bn(!0),Ye.abrupt("break",11);case 11:case"end":return Ye.stop()}},W)}));return function(ue){return q.apply(this,arguments)}}(),S=function(){var W;return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u5355\u9009\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09"),!Ie.hideAction&&G.map(function(ue,We){return ue.id==="up"&&Ie.key===1||ue.id==="down"&&Ie.key===Ie.len?null:T.a.createElement(De.a,{key:We,placement:"bottom",title:ue.name},T.a.createElement("span",{onClick:function(){return v(ue)},className:ue.icon}))})),T.a.createElement("div",{className:"mt5"},T.a.createElement(ye.a,{value:Ie.question_title})),T.a.createElement("div",{className:Se.a.questionChoices},Ie==null||((W=Ie.question_choices)===null||W===void 0)?void 0:W.map(function(ue,We){return T.a.createElement(I.a,null,T.a.createElement(m.a,null,T.a.createElement(Xe.a,{key:We,checked:Ie.standard_answer.includes(We+1),disabled:!0},qe[We],".")),T.a.createElement(m.a,{flex:"1"},T.a.createElement("span",{className:"c-black font14"},T.a.createElement(ye.a,{value:ue.choice_text}))))})))},B=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),T.a.createElement("p",{className:Se.a.titleWrap},T.a.createElement("span",{className:Se.a.required},"*"),T.a.createElement("span",{className:Se.a.title},"\u9898\u5E72\uFF1A")),T.a.createElement(Me.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:nn,onChange:function(ue){return rn(ue)}}),T.a.createElement("p",{className:Se.a.titleWrap},T.a.createElement("span",{className:Se.a.required},"*"),T.a.createElement("span",{className:Se.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",T.a.createElement("span",{className:Se.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),St.map(function(W,ue){return T.a.createElement("div",{className:Se.a.choiceWrap,key:ue},T.a.createElement(De.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},T.a.createElement("div",{className:"".concat(Se.a.answer," ").concat(ln.includes(ue)?Se.a.activeAnswer:""),onClick:function(){ln.includes(ue)?Ht(ln.filter(function(Ye){return Ye!==ue})):Ht([].concat(Object(L.a)(ln),[ue]))}},qe[ue])),T.a.createElement("div",{className:Se.a.editorWrap},Wt===ue?T.a.createElement(Me.a,{id:"single-question-option-".concat(ue),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:W,onChange:function(Ye){St[ue]=Ye,en(St)}}):T.a.createElement("div",{className:Se.a.htmlWrap,onClick:function(){return Jt(ue)}},T.a.createElement(ye.a,{value:W}))),ue>1&&T.a.createElement(De.a,{title:"\u5220\u9664"},T.a.createElement("i",{className:"".concat(Se.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return en(St.filter(function(Ye,Lt){return Lt!==ue}))}})),ue<7&&ue===St.length-1&&T.a.createElement(De.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},T.a.createElement("i",{className:"".concat(Se.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return en([].concat(Object(L.a)(St),[""]))}})))}),T.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(se.a,{value:Xn,max:1e4,min:-1,onChange:function(ue){Kn(ue)}})," \u5206"),T.a.createElement("aside",{className:"tr"},Ie.question_id&&T.a.createElement(j.a,{type:"default",onClick:function(){return bn(!1)}},"\u53D6\u6D88"),T.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return Mn()}},"\u4FDD\u5B58")))};return T.a.createElement("section",{className:Se.a.wrap},!zn&&S(),zn&&B())},vt=Object(Y.a)(function(ke){var Ne=ke.problemset,lt=ke.loading,ft=ke.globalSetting;return{problemset:Ne,globalSetting:ft,loading:lt.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(dt)),st=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],tt=function(Ne,lt){var ft=Ne.problemset,Ge=Ne.globalSetting,bt=Ne.loading,nt=Ne.dispatch,je=Ne.onRef,Ft=je===void 0?function(){}:je,Ie=Ne.editData,Zt=Object(O.a)(Ne,["problemset","globalSetting","loading","dispatch","onRef","editData"]),Gt=Object(g.useState)(),wt=Object(R.a)(Gt,2),St=wt[0],en=wt[1],Qe=Object(g.useState)(""),It=Object(R.a)(Qe,2),Wt=It[0],Jt=It[1],tn=Object(g.useState)(!1),Tt=Object(R.a)(tn,2),ln=Tt[0],Ht=Tt[1],Et=Object(g.useState)(5),fn=Object(R.a)(Et,2),nn=fn[0],rn=fn[1],Yt=Object(N.i)();Object(g.useEffect)(function(){if(!(Ie!=null&&Ie.question_choices)){Ht(!0);return}Jt(Ie==null?void 0:Ie.question_title),rn(Ie==null?void 0:Ie.question_score),en(Ie.standard_answer[0]+"")},[Ie]),Object(g.useImperativeHandle)(lt,function(){return{onSave:Ln,isEdit:ln}});var Ln=function(){var zn=Object(a.a)(h.a.mark(function bn(){var pn,Mn;return h.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(Wt){v.next=3;break}return r.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),v.abrupt("return",!1);case 3:if(St){v.next=6;break}return r.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),v.abrupt("return",!1);case 6:if(pn=[{choice_text:"\u6B63\u786E",is_answer:St==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:St==="2"?2:0}],!Ie.question_id){v.next=13;break}return v.next=10,Object(U.u)({id:Ie.question_id,question_title:Wt,question_type:2,question_score:nn,question_choices:pn.map(function(S){return S.choice_text}),standard_answers:pn.filter(function(S){return S.is_answer}).map(function(S){return S.is_answer})});case 10:Mn=v.sent,v.next=16;break;case 13:return v.next=15,Object(U.a)({exercise_bank_id:Yt.topicId,question_title:Wt,question_type:2,question_score:nn,question_choices:pn.map(function(S){return S.choice_text}),standard_answers:pn.filter(function(S){return S.is_answer}).map(function(S){return S.is_answer})});case 15:Mn=v.sent;case 16:return Mn.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),Ht(!1)),nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Yt)}),v.abrupt("return",{name:Wt,choices:pn});case 19:case"end":return v.stop()}},bn)}));return function(){return zn.apply(this,arguments)}}(),Xn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Kn=function(){var zn=Object(a.a)(h.a.mark(function bn(pn){return h.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:G.t0=pn.id,G.next=G.t0==="del"?3:G.t0==="up"||G.t0==="down"?5:G.t0==="edit"?9:11;break;case 3:return H.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function S(){return h.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(U.e)({pollsId:Ie.question_id});case 2:nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Yt)});case 3:case"end":return q.stop()}},S)}))()}}),G.abrupt("break",11);case 5:return G.next=7,Object(U.j)({exerciseId:Ie==null?void 0:Ie.question_id,opr:pn.id});case 7:return nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Yt)}),G.abrupt("break",11);case 9:return Ht(!0),G.abrupt("break",11);case 11:case"end":return G.stop()}},bn)}));return function(pn){return zn.apply(this,arguments)}}(),$e=function(){var bn;return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09"),!Ie.hideAction&&Xn.map(function(pn,Mn){return pn.id==="up"&&Ie.key===1||pn.id==="down"&&Ie.key===Ie.len?null:T.a.createElement(De.a,{key:Mn,placement:"bottom",title:pn.name},T.a.createElement("span",{onClick:function(){return Kn(pn)},className:pn.icon}))})),T.a.createElement("div",{className:"mt5"},Ie.question_title),T.a.createElement("div",{className:Se.a.questionChoices},Ie==null||((bn=Ie.question_choices)===null||bn===void 0)?void 0:bn.map(function(pn,Mn){return T.a.createElement(Xe.a,{key:Mn,checked:Ie.standard_answer.includes(Mn+1),disabled:!0},st[Mn],". ",T.a.createElement("span",{className:"c-black font14"},pn.choice_text))})))},Kt=function(){return T.a.createElement("aside",null,T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),T.a.createElement("p",{className:Se.a.titleWrap},T.a.createElement("span",{className:Se.a.required},"*"),T.a.createElement("span",{className:Se.a.title},"\u9898\u5E72\uFF1A")),T.a.createElement(Me.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Wt,onChange:function(pn){return Jt(pn)}}),T.a.createElement("p",{className:Se.a.titleWrap},T.a.createElement("span",{className:Se.a.required},"*"),T.a.createElement("span",{className:Se.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",T.a.createElement("span",{className:Se.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),T.a.createElement(Xe.a.Group,{buttonStyle:"solid",value:St,onChange:function(pn){return en(pn.target.value)}},T.a.createElement(Xe.a.Button,{value:"1",className:"".concat(Se.a.radio," mr40")},"\u6B63\u786E"),T.a.createElement(Xe.a.Button,{value:"2",className:Se.a.radio},"\u9519\u8BEF")),T.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(se.a,{value:nn,max:1e4,min:-1,onChange:function(pn){rn(pn)}})," \u5206"),T.a.createElement("aside",{className:"tr"},Ie.question_id&&T.a.createElement(j.a,{type:"default",onClick:function(){return Ht(!1)}},"\u53D6\u6D88"),T.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return Ln()}},"\u4FDD\u5B58")))};return T.a.createElement("section",{className:Se.a.wrap},!ln&&$e(),ln&&Kt())},rt=Object(Y.a)(function(ke){var Ne=ke.problemset,lt=ke.loading,ft=ke.globalSetting;return{problemset:Ne,globalSetting:ft,loading:lt.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(tt)),Bt=Z("kqOp"),Pt=Z("7qnI"),Ct=Z("1vsH"),_t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Vt=function(Ne,lt){var ft=Ne.problemset,Ge=Ne.globalSetting,bt=Ne.loading,nt=Ne.dispatch,je=Ne.editData,Ft=Object(O.a)(Ne,["problemset","globalSetting","loading","dispatch","editData"]),Ie=Object(g.useState)(""),Zt=Object(R.a)(Ie,2),Gt=Zt[0],wt=Zt[1],St=Object(g.useState)(""),en=Object(R.a)(St,2),Qe=en[0],It=en[1],Wt=Object(g.useState)([]),Jt=Object(R.a)(Wt,2),tn=Jt[0],Tt=Jt[1],ln=Object(g.useState)(""),Ht=Object(R.a)(ln,2),Et=Ht[0],fn=Ht[1],nn=Object(g.useState)(),rn=Object(R.a)(nn,2),Yt=rn[0],Ln=rn[1],Xn=Object(g.useState)(!1),Kn=Object(R.a)(Xn,2),$e=Kn[0],Kt=Kn[1],zn=Object(g.useState)(5),bn=Object(R.a)(zn,2),pn=bn[0],Mn=bn[1],G=Object(g.useState)(!1),v=Object(R.a)(G,2),S=v[0],B=v[1],q=Object(N.i)();Object(g.useEffect)(function(){if(!(je!=null&&je.question_title)){B(!0);return}wt(je==null?void 0:je.question_title),Ln(je==null?void 0:je.is_ordered),Mn(je==null?void 0:je.question_score);var yn=je==null?void 0:je.standard_answer.map(function(Nt){return Nt.answer_text});Tt(yn)},[ft.editData]),Object(g.useEffect)(function(){Kt(!1)},[S]),Object(g.useImperativeHandle)(lt,function(){return{onSave:W,isEdit:S}});var W=function(){var yn=Object(a.a)(h.a.mark(function Nt(){var jt,un,cn;return h.a.wrap(function($n){for(;;)switch($n.prev=$n.next){case 0:if(jt=[],un=!1,tn.forEach(function(mn,ci){jt.push({choice_id:ci+1,answer_text:[]}),mn.forEach(function(cr,gr){jt[ci].answer_text.push(cr),(!cr||!Object(Ct.fb)(cr,1e4))&&(fn("".concat(ci,"-").concat(gr)),r.b.info(cr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),un=!0)})}),!un){$n.next=5;break}return $n.abrupt("return",!1);case 5:if(!je.question_id){$n.next=11;break}return $n.next=8,Object(U.u)({id:je.question_id,question_title:Gt,question_type:3,question_score:pn,is_ordered:Yt,standard_answers:jt});case 8:cn=$n.sent,$n.next=14;break;case 11:return $n.next=13,Object(U.a)({exercise_bank_id:q.topicId,question_title:Gt,question_type:3,question_score:pn,is_ordered:Yt,standard_answers:jt});case 13:cn=$n.sent;case 14:return cn.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),B(!1)),nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},q)}),$n.abrupt("return",{name:Gt,analysis:Qe,standard_answers:jt,is_ordered:Yt});case 17:case"end":return $n.stop()}},Nt)}));return function(){return yn.apply(this,arguments)}}(),ue=function(Nt,jt,un){var cn=tn.slice();if(jt&&cn.splice(Nt,jt),un&&$e)for(var xn=0;xn<un;xn++)cn.splice(Nt+xn,0,[""]);Kt(!0),Tt(cn)},We=function(Nt,jt,un){fn("");var cn=tn.slice();cn[Nt][jt]=un,Tt(cn)},Ye=function(Nt){var jt=tn.slice();jt[Nt]=[].concat(Object(L.a)(jt[Nt]),[""]),Tt(jt)},Lt=function(Nt,jt){var un=tn.slice();if(!un[Nt][jt]){un[Nt]=un[Nt].filter(function(cn,xn){return xn!==jt}),Tt(un);return}H.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Se.a.modal,onOk:function(){un[Nt]=un[Nt].filter(function(xn,$n){return $n!==jt}),Tt(un)}})},Ke=function(Nt){H.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Se.a.modal,onOk:function(){var un=tn.slice();un=tn.filter(function(cn,xn){return Nt!==xn}),Tt(un)}})},gt=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),T.a.createElement("div",null,T.a.createElement(Bt.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:Gt,onChange:function(jt){return wt(jt)},showNullButton:!0,onPlaceholderChange:ue})),T.a.createElement("div",{className:"mt20"},tn.map(function(Nt,jt){return T.a.createElement(Pt.a,{key:jt,answers:Nt,index:jt,is_md:!0,activeOptionErrorIndex:Et,onAnswerChange:We,addChildAnswer:Ye,deleteChildAnswer:Lt,deleteChildAnswermain:Ke})})),T.a.createElement("div",{className:"mt20"},tn.length>1&&T.a.createElement("span",null,T.a.createElement(Ue.a,{checked:Yt,onChange:function(jt){return Ln(jt.target.checked)},className:"".concat(Se.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),T.a.createElement("span",{className:"".concat(Se.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(se.a,{value:pn,max:1e4,min:-1,onChange:function(jt){Mn(jt)}})," \u5206"),T.a.createElement("aside",{className:"tr"},je.question_id&&T.a.createElement(j.a,{type:"default",onClick:function(){return B(!1)}},"\u53D6\u6D88"),T.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return W()}},"\u4FDD\u5B58")))},an=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Hn=function(){var yn=Object(a.a)(h.a.mark(function Nt(jt){return h.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:cn.t0=jt.id,cn.next=cn.t0==="del"?3:cn.t0==="up"||cn.t0==="down"?5:cn.t0==="edit"?9:11;break;case 3:return H.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function $n(){return h.a.wrap(function(ci){for(;;)switch(ci.prev=ci.next){case 0:return ci.next=2,Object(U.e)({pollsId:je.question_id});case 2:nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},q)});case 3:case"end":return ci.stop()}},$n)}))()}}),cn.abrupt("break",11);case 5:return cn.next=7,Object(U.j)({exerciseId:je==null?void 0:je.question_id,opr:jt.id});case 7:return nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},q)}),cn.abrupt("break",11);case 9:return B(!0),cn.abrupt("break",11);case 11:case"end":return cn.stop()}},Nt)}));return function(jt){return yn.apply(this,arguments)}}(),qn=function(){var Nt;return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},je.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",je.question_score,"\u5206\uFF09"),!je.hideAction&&an.map(function(jt,un){return jt.id==="up"&&je.key===1||jt.id==="down"&&je.key===je.len?null:T.a.createElement(De.a,{key:un,placement:"bottom",title:jt.name},T.a.createElement("span",{onClick:function(){return Hn(jt)},className:jt.icon}))})),T.a.createElement("div",{className:"mt5"},je.question_title),T.a.createElement("div",{className:Se.a.questionChoices},je==null||((Nt=je.standard_answer)===null||Nt===void 0)?void 0:Nt.map(function(jt,un){return T.a.createElement(I.a,null,T.a.createElement(m.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",jt.choice_id,"\uFF09\uFF1A"),T.a.createElement(m.a,{flex:"1"},T.a.createElement(X.a,{key:un,checked:je.standard_answer.includes(un),disabled:!0,value:jt.answer_text})))})))};return T.a.createElement("section",{className:Se.a.wrap},!S&&qn(),S&>())},Ot=Object(Y.a)(function(ke){var Ne=ke.problemset,lt=ke.loading,ft=ke.globalSetting;return{problemset:Ne,globalSetting:ft,loading:lt.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(Vt)),Rt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ve=function(Ne,lt){var ft=Ne.problemset,Ge=Ne.globalSetting,bt=Ne.loading,nt=Ne.dispatch,je=Ne.onRef,Ft=je===void 0?function(){}:je,Ie=Ne.editData,Zt=Object(O.a)(Ne,["problemset","globalSetting","loading","dispatch","onRef","editData"]),Gt=Object(g.useState)(""),wt=Object(R.a)(Gt,2),St=wt[0],en=wt[1],Qe=Object(g.useState)(""),It=Object(R.a)(Qe,2),Wt=It[0],Jt=It[1],tn=Object(g.useState)(""),Tt=Object(R.a)(tn,2),ln=Tt[0],Ht=Tt[1],Et=Object(g.useState)(5),fn=Object(R.a)(Et,2),nn=fn[0],rn=fn[1],Yt=Object(g.useState)(!1),Ln=Object(R.a)(Yt,2),Xn=Ln[0],Kn=Ln[1],$e=Object(N.i)();Object(g.useEffect)(function(){var G;if(!(Ie!=null&&Ie.question_title)){Kn(!0);return}en(Ie==null?void 0:Ie.question_title),Ht(Ie==null||((G=Ie.standard_answer)===null||G===void 0)?void 0:G[0]),rn(Ie==null?void 0:Ie.question_score)},[ft.editData]),Object(g.useImperativeHandle)(lt,function(){return{onSave:Kt,isEdit:Xn}});var Kt=function(){var G=Object(a.a)(h.a.mark(function v(){var S;return h.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:if(St){q.next=3;break}return r.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),q.abrupt("return",!1);case 3:if(!Ie.question_id){q.next=9;break}return q.next=6,Object(U.u)({id:Ie.question_id,question_title:St,question_type:4,question_score:nn,standard_answers:[ln]});case 6:S=q.sent,q.next=12;break;case 9:return q.next=11,Object(U.a)({exercise_bank_id:$e.topicId,question_title:St,question_type:4,question_score:nn,standard_answers:[ln]});case 11:S=q.sent;case 12:return S.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),Kn(!1),nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},$e)})),q.abrupt("return",{name:St,answer_texts:[ln],analysis:Wt});case 14:case"end":return q.stop()}},v)}));return function(){return G.apply(this,arguments)}}(),zn=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u7B80\u7B54\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),T.a.createElement(Me.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:St,onChange:function(S){return en(S)}}),T.a.createElement("p",{className:Se.a.titleWrap},T.a.createElement("span",{className:Se.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),T.a.createElement(Me.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:ln,onChange:function(S){return Ht(S)}}),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(se.a,{value:nn,max:1e4,min:-1,onChange:function(S){rn(S)}})," \u5206"),T.a.createElement("aside",{className:"tr"},Ie.question_id&&T.a.createElement(j.a,{type:"default",onClick:function(){return Kn(!1)}},"\u53D6\u6D88"),T.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return Kt()}},"\u4FDD\u5B58")))},bn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],pn=function(){var G=Object(a.a)(h.a.mark(function v(S){return h.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:q.t0=S.id,q.next=q.t0==="del"?3:q.t0==="up"||q.t0==="down"?5:q.t0==="edit"?9:11;break;case 3:return H.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function ue(){return h.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return Ye.next=2,Object(U.e)({pollsId:Ie.question_id});case 2:nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},$e)});case 3:case"end":return Ye.stop()}},ue)}))()}}),q.abrupt("break",11);case 5:return q.next=7,Object(U.j)({exerciseId:Ie==null?void 0:Ie.question_id,opr:S.id});case 7:return nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},$e)}),q.abrupt("break",11);case 9:return Kn(!0),q.abrupt("break",11);case 11:case"end":return q.stop()}},v)}));return function(S){return G.apply(this,arguments)}}(),Mn=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09"),!Ie.hideAction&&bn.map(function(v,S){return v.id==="up"&&Ie.key===1||v.id==="down"&&Ie.key===Ie.len?null:T.a.createElement(De.a,{key:S,placement:"bottom",title:v.name},T.a.createElement("span",{onClick:function(){return pn(v)},className:v.icon}))})),T.a.createElement("div",{className:"mt5"},Ie.question_title),T.a.createElement("div",{className:Se.a.questionChoices},T.a.createElement("p",null,T.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),T.a.createElement(ye.a,{value:ln})))};return T.a.createElement("section",{className:Se.a.wrap},!Xn&&Mn(),Xn&&zn())},Xt=Object(Y.a)(function(ke){var Ne=ke.problemset,lt=ke.loading,ft=ke.globalSetting;return{problemset:Ne,globalSetting:ft,loading:lt.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(Ve)),At=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ze=function(Ne,lt){var ft=Ne.problemset,Ge=Ne.globalSetting,bt=Ne.loading,nt=Ne.dispatch,je=Ne.editData,Ft=Object(O.a)(Ne,["problemset","globalSetting","loading","dispatch","editData"]),Ie=Object(g.useState)(""),Zt=Object(R.a)(Ie,2),Gt=Zt[0],wt=Zt[1],St=Object(g.useState)(""),en=Object(R.a)(St,2),Qe=en[0],It=en[1],Wt=Object(g.useState)(""),Jt=Object(R.a)(Wt,2),tn=Jt[0],Tt=Jt[1],ln=Object(g.useState)([]),Ht=Object(R.a)(ln,2),Et=Ht[0],fn=Ht[1],nn=Object(g.useState)(""),rn=Object(R.a)(nn,2),Yt=rn[0],Ln=rn[1],Xn=Object(g.useState)(),Kn=Object(R.a)(Xn,2),$e=Kn[0],Kt=Kn[1],zn=Object(g.useState)(!1),bn=Object(R.a)(zn,2),pn=bn[0],Mn=bn[1],G=Object(g.useState)([]),v=Object(R.a)(G,2),S=v[0],B=v[1],q=Object(g.useState)(!1),W=Object(R.a)(q,2),ue=W[0],We=W[1],Ye=Object(N.i)();Object(g.useEffect)(function(){var qn;je.edit&&We(!0),wt(je.shixun_name),It(je.question_title);var yn=[];(qn=je.shixun)===null||qn===void 0||qn.map(function(Nt){yn.push(Nt.challenge_score)}),B(yn)},[je]),Object(g.useEffect)(function(){Mn(!1)},[ue]),Object(g.useImperativeHandle)(lt,function(){return{onSave:Lt,isEdit:ue}});var Lt=function(){var qn=Object(a.a)(h.a.mark(function yn(){var Nt,jt,un;return h.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:if(Nt=[],jt=!1,!jt){xn.next=4;break}return xn.abrupt("return",!1);case 4:if(!je.question_id){xn.next=10;break}return xn.next=7,Object(U.u)({id:je.question_id,question_title:Qe,shixun_name:Gt,shixun_id:je.shixun_id,question_type:5,question_scores:S});case 7:un=xn.sent,xn.next=13;break;case 10:return xn.next=12,Object(U.a)({exercise_bank_id:Ye.topicId,question_title:Qe,shixun_name:Gt,shixun_id:je.shixun_id,question_type:5,question_scores:S});case 12:un=xn.sent;case 13:return un.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),We(!1)),xn.next=16,nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Ye)});case 16:return xn.abrupt("return",{name:Qe,analysis:tn,standard_answers:Nt,is_ordered:$e});case 17:case"end":return xn.stop()}},yn)}));return function(){return qn.apply(this,arguments)}}(),Ke=function(){var yn;return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),T.a.createElement("div",{className:"mt10"},T.a.createElement(X.a,{defaultValue:Gt,onChange:function(jt){wt(jt.target.value)}})),T.a.createElement("div",{className:"mt10"},T.a.createElement(Me.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:Qe,onChange:function(jt){It(jt)}})),T.a.createElement("div",{className:"mt20"},(yn=je.shixun)===null||yn===void 0?void 0:yn.map(function(Nt,jt){return T.a.createElement(I.a,{gutter:[20,20]},T.a.createElement(m.a,{flex:"1"},jt+1,".",Nt.challenge_name),T.a.createElement(m.a,null,T.a.createElement(se.a,{defaultValue:S[jt],onChange:function(cn){S[jt]=cn,B(S),console.log("srore:L",S[jt])}})))})),T.a.createElement("div",{className:"mt20"},Et.length>1&&T.a.createElement("span",null,T.a.createElement(Ue.a,{checked:$e,onChange:function(jt){return Kt(jt.target.checked)},className:"".concat(Se.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),T.a.createElement("span",{className:"".concat(Se.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),T.a.createElement("aside",{className:"tr"},!(je!=null&&je.edit)&&T.a.createElement(j.a,{type:"default",onClick:function(){return We(!1)}},"\u53D6\u6D88"),T.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return Lt()}},"\u4FDD\u5B58")))},gt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],an=function(){var qn=Object(a.a)(h.a.mark(function yn(Nt){return h.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:un.t0=Nt.id,un.next=un.t0==="del"?3:un.t0==="up"||un.t0==="down"?5:un.t0==="edit"?9:11;break;case 3:return H.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function xn(){return h.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Object(U.e)({pollsId:je.question_id});case 2:nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Ye)});case 3:case"end":return mn.stop()}},xn)}))()}}),un.abrupt("break",11);case 5:return un.next=7,Object(U.j)({exerciseId:je==null?void 0:je.question_id,opr:Nt.id});case 7:return nt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Ye)}),un.abrupt("break",11);case 9:return We(!0),un.abrupt("break",11);case 11:case"end":return un.stop()}},yn)}));return function(Nt){return qn.apply(this,arguments)}}(),Hn=function(){var yn;return T.a.createElement("aside",null,T.a.createElement("div",{className:Se.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},je.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",je.question_score,"\u5206\uFF09"),T.a.createElement("div",{className:"tr"},T.a.createElement(V.a,{target:"_blank",to:"/shixuns/".concat(je.shixun_identifier,"/challenges")},"\u5B9E\u8BAD\u8BE6\u60C5"),!je.hideAction&>.map(function(Nt,jt){return Nt.id==="up"&&je.key===1||Nt.id==="down"&&je.key===je.len?null:T.a.createElement(De.a,{key:jt,placement:"bottom",title:Nt.name},T.a.createElement("span",{onClick:function(){return an(Nt)},className:Nt.icon}))}))),T.a.createElement("div",{className:"font16"},je.shixun_name),T.a.createElement("div",{className:"mt30"}),(yn=je.shixun)===null||yn===void 0?void 0:yn.map(function(Nt,jt){return T.a.createElement("div",{key:jt},"\u7B2C",jt+1,"\u5173 ",T.a.createElement("span",{className:"ml10"},Nt.challenge_name)," ",T.a.createElement("span",{className:"ml10"},Nt.challenge_score))}))};return T.a.createElement("section",{className:Se.a.wrap},!ue&&Hn(),ue&&Ke())},at=Object(Y.a)(function(ke){var Ne=ke.problemset,lt=ke.loading,ft=ke.globalSetting;return{problemset:Ne,globalSetting:ft,loading:lt.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(ze)),Ae=Z("UU91"),_e=Z.n(Ae),xe=Z("fJjg"),re=l.a.SubMenu,ae=E.a.Content,he=E.a.Sider,be=function(Ne){var lt,ft,Ge,bt,nt,je,Ft,Ie,Zt,Gt,wt,St,en,Qe,It,Wt,Jt,tn,Tt,ln,Ht,Et,fn,nn,rn,Yt,Ln,Xn,Kn,$e,Kt,zn,bn,pn,Mn,G,v,S,B,q,W,ue,We,Ye,Lt,Ke,gt,an,Hn,qn,yn,Nt,jt,un,cn,xn,$n,mn=Ne.polls,ci=Ne.globalSetting,cr=Ne.loading,gr=Ne.user,_r=Ne.dispatch,Wr=Object(O.a)(Ne,["polls","globalSetting","loading","user","dispatch"]),fi=Object(N.i)(),Di=Object(N.h)(),dr=gr.userInfo,Gr=x.a.useForm(),Ar=Object(R.a)(Gr,1),ai=Ar[0],Un=Object(g.useState)([]),pi=Object(R.a)(Un,2),_n=pi[0],mi=pi[1],Jn=Object(g.useState)(!1),nr=Object(R.a)(Jn,2),Si=nr[0],Pi=nr[1],Kr=[{name:"\u9009\u62E9\u9898",id:0},{name:"\u5224\u65AD\u9898",id:2},{name:"\u586B\u7A7A\u9898",id:3},{name:"\u7B80\u7B54\u9898",id:4},{name:"\u5B9E\u8BAD\u9898",id:5}],Qi=Object(g.useRef)();Object(g.useEffect)(function(){var gi;if((gi=mn.exerciseBanks)!==null&&gi!==void 0&&gi.exercise_questions){var Vn,Ci,Ti,qi,Ut;mi(Object(L.a)((Vn=mn.exerciseBanks)===null||Vn===void 0?void 0:Vn.exercise_questions)),ai.setFieldsValue({exercise_name:(Ci=mn.exerciseBanks)===null||Ci===void 0||((Ti=Ci.exercise)===null||Ti===void 0)?void 0:Ti.exercise_name,exercise_description:(qi=mn.exerciseBanks)===null||qi===void 0||((Ut=qi.exercise)===null||Ut===void 0)?void 0:Ut.exercise_description})}},[mn.exerciseBanks]),Object(g.useEffect)(function(){_r({type:"polls/getExerciseBanks",payload:Object(d.a)({},fi)})},[fi.categoryId]);var Sr=function(){var gi=Object(a.a)(h.a.mark(function Vn(){var Ci,Ti,qi;return h.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:return dn.next=2,ai.validateFields();case 2:return qi=ai.getFieldValue(),qi.is_md=!0,qi.topicId=(Ci=mn.exerciseBanks)===null||Ci===void 0||((Ti=Ci.exercise)===null||Ti===void 0)?void 0:Ti.id,Pi(!1),dn.next=8,Object(U.v)(Object(d.a)({},qi));case 8:_r({type:"polls/getExerciseBanks",payload:Object(d.a)({},fi)});case 9:case"end":return dn.stop()}},Vn)}));return function(){return gi.apply(this,arguments)}}(),ir=function(){var gi=Object(a.a)(h.a.mark(function Vn(Ci){var Ti;return h.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Qi==null?void 0:Qi.current;case 2:if(Ti=Ut.sent,!(Ti!=null&&Ti.isEdit)){Ut.next=6;break}return r.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),Ut.abrupt("return");case 6:Ci===5?_r({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}):mi([].concat(Object(L.a)(_n),[{question_type:Ci}]));case 7:case"end":return Ut.stop()}},Vn)}));return function(Ci){return gi.apply(this,arguments)}}(),Zi=function(){_r({type:"userDetail/setActionTabs",payload:{key:"UserDetail-SendToClass",params:{object_id:[fi.topicId],object_type:"exercise"}}})},zr=function(){return _n==null?void 0:_n.map(function(Vn,Ci){if(Vn.key=Ci+1,Vn.len=_n.length,Vn.question_type===0)return T.a.createElement("aside",null,T.a.createElement(vt,{ref:Qi,editData:Vn}),T.a.createElement(f.a,null));if(Vn.question_type===1)return T.a.createElement("aside",null,T.a.createElement(ct,{ref:Qi,editData:Vn}),T.a.createElement(f.a,null));if(Vn.question_type===2)return T.a.createElement("aside",null,T.a.createElement(rt,{ref:Qi,editData:Vn}),T.a.createElement(f.a,null));if(Vn.question_type===3)return T.a.createElement("aside",null,T.a.createElement(Ot,{editData:Vn}),T.a.createElement(f.a,null));if(Vn.question_type===4)return T.a.createElement("aside",null,T.a.createElement(Xt,{editData:Vn}),T.a.createElement(f.a,null));if(Vn.question_type===5)return T.a.createElement("aside",null,T.a.createElement(at,{editData:Vn}),T.a.createElement(f.a,null))})};return T.a.createElement("section",{className:"edu-container"},T.a.createElement("section",{className:"animated fadeIn"},T.a.createElement("aside",{className:"mt10"},dr&&T.a.createElement(c.a,{separator:">"},T.a.createElement(c.a.Item,null,T.a.createElement(V.a,{to:"/users/".concat(fi.username,"/").concat(fi.topictype==="personal"?"topics":"topicbank","/").concat(fi.topictype)},fi.topictype==="personal"?"\u6211\u7684\u9898\u5E93":"\u516C\u5171\u9898\u5E93")),T.a.createElement(c.a.Item,null,"\u8BE6\u60C5"))),T.a.createElement("aside",{className:[_e.a.title,"mt20"].join(" ")},T.a.createElement(I.a,{style:{width:"100%"},align:"middle"},T.a.createElement(m.a,{flex:"1"},T.a.createElement("strong",{className:"font20 ml5"},(lt=mn.exerciseBanks)===null||lt===void 0||((ft=lt.exercise)===null||ft===void 0)?void 0:ft.exercise_name),T.a.createElement(Ct.m,{status:[(Ge=mn.exerciseBanks)!==null&&Ge!==void 0&&(bt=Ge.exercise)!==null&&bt!==void 0&&bt.is_public?"\u516C\u5F00":"\u79C1\u6709"]})),T.a.createElement(m.a,null,T.a.createElement(V.a,{className:"font16 c-light-black",to:"/users/".concat(dr.login,"/topics/").concat(fi.topictype)},"\u8FD4\u56DE"))))),T.a.createElement("section",{className:[_e.a.bg,"pl30","pr30","pb30","mt20 relative"].join(" ")},T.a.createElement("div",{className:_e.a.export},((nt=mn.exerciseBanks)===null||nt===void 0?void 0:nt.authorize)&&T.a.createElement(T.a.Fragment,null,T.a.createElement("a",{onClick:function(Vn){Vn.preventDefault(),H.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var Ci=Object(a.a)(h.a.mark(function qi(){var Ut;return h.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(A.g)({object_type:"normal",object_id:[fi.topicId]});case 2:Ut=$t.sent,Ut.status===0&&Y.d.push("/users/".concat(fi.username,"/topics/personal"));case 4:case"end":return $t.stop()}},qi)}));function Ti(){return Ci.apply(this,arguments)}return Ti}()})}},"\u5220\u9664"),T.a.createElement(V.a,{to:"/users/".concat(dr.login,"/topics/").concat(fi.topicId,"/").concat(fi.topictype,"/exercise/edit")},"\u7F16\u8F91")),T.a.createElement("a",{onClick:function(Vn){Vn.preventDefault(),Zi()}},"\u53D1\u9001")),T.a.createElement(F.a,{className:_e.a.tabs},T.a.createElement(F.a.TabPane,{tab:T.a.createElement("span",{className:"font16 pt10 pb12"},"\u5185\u5BB9\u8BE6\u60C5"),key:"1"},T.a.createElement("div",{className:"c-light-black"},(je=mn.exerciseBanks)===null||je===void 0||((Ft=je.exercise)===null||Ft===void 0)?void 0:Ft.exercise_description))),Si&&T.a.createElement(x.a,{layout:"vertical",form:ai},T.a.createElement(x.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},T.a.createElement(X.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),T.a.createElement(x.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},T.a.createElement(X.a.TextArea,{rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26"})),T.a.createElement(x.a.Item,{className:"tr"},T.a.createElement(j.a,{type:"primary",onClick:function(){Sr()}},"\u4FDD\u5B58")))),T.a.createElement("p",{className:"mt10",style:{display:"flex"}},T.a.createElement("span",{className:"fl",style:{flex:"1"}},!!((Ie=mn.exerciseBanks)!==null&&Ie!==void 0&&(Zt=Ie.exercise_types)!==null&&Zt!==void 0&&Zt.q_singles)&&T.a.createElement("span",{className:"ml20"},"\u5355\u9009\u9898",(Gt=mn.exerciseBanks)===null||Gt===void 0||((wt=Gt.exercise_types)===null||wt===void 0)?void 0:wt.q_singles,"\u9898\uFF0C\u5171",(St=mn.exerciseBanks)===null||St===void 0||((en=St.exercise_types)===null||en===void 0)?void 0:en.q_singles_scores,"\u5206"),!!((Qe=mn.exerciseBanks)!==null&&Qe!==void 0&&(It=Qe.exercise_types)!==null&&It!==void 0&&It.q_doubles)&&T.a.createElement("span",{className:"ml20"},"\u591A\u9009\u9898",(Wt=mn.exerciseBanks)===null||Wt===void 0||((Jt=Wt.exercise_types)===null||Jt===void 0)?void 0:Jt.q_doubles,"\u9898\uFF0C\u5171",(tn=mn.exerciseBanks)===null||tn===void 0||((Tt=tn.exercise_types)===null||Tt===void 0)?void 0:Tt.q_doubles_scores,"\u5206"),!!((ln=mn.exerciseBanks)!==null&&ln!==void 0&&(Ht=ln.exercise_types)!==null&&Ht!==void 0&&Ht.q_judges)&&T.a.createElement("span",{className:"ml20"},"\u5224\u65AD\u9898",(Et=mn.exerciseBanks)===null||Et===void 0||((fn=Et.exercise_types)===null||fn===void 0)?void 0:fn.q_judges,"\u9898\uFF0C\u5171",(nn=mn.exerciseBanks)===null||nn===void 0||((rn=nn.exercise_types)===null||rn===void 0)?void 0:rn.q_judges_scores,"\u5206"),!!((Yt=mn.exerciseBanks)!==null&&Yt!==void 0&&(Ln=Yt.exercise_types)!==null&&Ln!==void 0&&Ln.q_nulls)&&T.a.createElement("span",{className:"ml20"},"\u586B\u7A7A\u9898",(Xn=mn.exerciseBanks)===null||Xn===void 0||((Kn=Xn.exercise_types)===null||Kn===void 0)?void 0:Kn.q_nulls,"\u9898\uFF0C\u5171",($e=mn.exerciseBanks)===null||$e===void 0||((Kt=$e.exercise_types)===null||Kt===void 0)?void 0:Kt.q_nulls_scores,"\u5206"),!!((zn=mn.exerciseBanks)!==null&&zn!==void 0&&(bn=zn.exercise_types)!==null&&bn!==void 0&&bn.q_mains)&&T.a.createElement("span",{className:"ml20"},"\u7B80\u7B54\u9898",(pn=mn.exerciseBanks)===null||pn===void 0||((Mn=pn.exercise_types)===null||Mn===void 0)?void 0:Mn.q_mains,"\u9898\uFF0C\u5171",(G=mn.exerciseBanks)===null||G===void 0||((v=G.exercise_types)===null||v===void 0)?void 0:v.q_mains_scores,"\u5206"),!!((S=mn.exerciseBanks)!==null&&S!==void 0&&(B=S.exercise_types)!==null&&B!==void 0&&B.q_shixuns)&&T.a.createElement("span",{className:"ml20"},"\u5B9E\u8BAD\u9898",(q=mn.exerciseBanks)===null||q===void 0||((W=q.exercise_types)===null||W===void 0)?void 0:W.q_shixuns,"\u9898\uFF0C\u5171",(ue=mn.exerciseBanks)===null||ue===void 0||((We=ue.exercise_types)===null||We===void 0)?void 0:We.q_shixuns_scores,"\u5206"),!!((Ye=mn.exerciseBanks)!==null&&Ye!==void 0&&(Lt=Ye.exercise_types)!==null&&Lt!==void 0&&Lt.q_pros)&&T.a.createElement("span",{className:"ml20"},"\u7F16\u7A0B\u9898",(Ke=mn.exerciseBanks)===null||Ke===void 0||((gt=Ke.exercise_types)===null||gt===void 0)?void 0:gt.q_pros,"\u9898\uFF0C\u5171",(an=mn.exerciseBanks)===null||an===void 0||((Hn=an.exercise_types)===null||Hn===void 0)?void 0:Hn.q_pros_scores,"\u5206")),T.a.createElement("span",{className:"fr"},!!((qn=mn.exerciseBanks)!==null&&qn!==void 0&&(yn=qn.exercise_types)!==null&&yn!==void 0&&yn.q_counts)&&T.a.createElement("span",null,"\u5408\u8BA1 ",T.a.createElement("span",{className:"color-blue"},(Nt=mn.exerciseBanks)===null||Nt===void 0||((jt=Nt.exercise_types)===null||jt===void 0)?void 0:jt.q_counts)," \u9898\uFF0C \u5171 ",T.a.createElement("span",{className:"".concat(((un=mn.exerciseBanks)===null||un===void 0||((cn=un.exercise_types)===null||cn===void 0)?void 0:cn.q_scores)>100?"color-red font-bd":"color-orange")},(xn=mn.exerciseBanks)===null||xn===void 0||(($n=xn.exercise_types)===null||$n===void 0)?void 0:$n.q_scores)," \u5206"))),T.a.createElement("section",{className:[_e.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},_n!=""&&zr(),_n==""&&T.a.createElement(J.a,null)),T.a.createElement(xe.a,null))},Te=et.default=Object(Y.a)(function(ke){var Ne=ke.polls,lt=ke.loading,ft=ke.user,Ge=ke.globalSetting;return{polls:Ne,globalSetting:Ge,user:ft,loading:lt.effects}})(be)},Nf5h:function(ht,et,Z){"use strict";Z.d(et,"a",function(){return H}),Z.d(et,"h",function(){return u}),Z.d(et,"l",function(){return a}),Z.d(et,"e",function(){return O}),Z.d(et,"i",function(){return l}),Z.d(et,"j",function(){return ye}),Z.d(et,"c",function(){return vt}),Z.d(et,"b",function(){return Pt}),Z.d(et,"g",function(){return Ot}),Z.d(et,"f",function(){return At}),Z.d(et,"k",function(){return be}),Z.d(et,"d",function(){return lt});var oe=Z("cDcd"),j=Z.n(oe),M=Z("NQs2"),X=Z.n(M),D=Z("ygoZ"),F=Z.n(D),K=function(Ge){var bt=Ge.dataSource,nt=bt===void 0?[]:bt,je=Ge.img,Ft=Ge.imgWidth,Ie=Ft===void 0?346:Ft,Zt=Ge.title,Gt=Ge.sunTitle,wt=Ge.bannerExtraContent;return j.a.createElement("div",{className:X.a.banner},j.a.createElement("div",{className:X.a.content},j.a.createElement("aside",null,j.a.createElement("p",null,j.a.createElement("b",null,Zt),j.a.createElement("span",null,Gt)),nt.length>0&&j.a.createElement("div",{className:X.a.btns},nt.map(function(St,en){return j.a.createElement("div",{key:en,onClick:St.click},St.name,St.sign?j.a.createElement("img",{src:F.a,width:39}):null)})),wt),j.a.createElement("img",{style:{marginTop:33,marginRight:38},src:je,width:Ie})))},H=K,P=Z("tJVT"),I=Z("6nfa"),y=Z.n(I),m=Z("TSYQ"),p=Z.n(m),c=function(Ge){var bt=Ge.dataSource,nt=bt===void 0?[]:bt,je=Ge.value,Ft=Ge.onChange,Ie=Ge.className,Zt=Ge.title,Gt=Ge.titleWidth,wt=Gt===void 0?41:Gt,St=Ge.style,en=St===void 0?{}:St,Qe=Ge.fontColor,It=Qe===void 0?"#6A7283":Qe,Wt=Object(oe.useState)(0),Jt=Object(P.a)(Wt,2),tn=Jt[0],Tt=Jt[1],ln=Object(oe.useState)(!1),Ht=Object(P.a)(ln,2),Et=Ht[0],fn=Ht[1],nn=Object(oe.useRef)(null);return Object(oe.useEffect)(function(){if(nt.length!==0){var rn;(nn==null||((rn=nn.current)===null||rn===void 0)?void 0:rn.clientHeight)>92?Tt(1):Tt(0)}nt.length===0&&Tt(0)},[nt]),j.a.createElement("div",{className:p()(y.a.row,Ie),style:en},j.a.createElement("div",{style:{width:wt,marginTop:Et?12:4},className:y.a.title},Zt),j.a.createElement("div",{className:Et?"".concat(y.a.tagsWrap," ").concat(y.a.tagsBorderWrap):y.a.tagsWrap},j.a.createElement("div",{className:y.a.bar,style:tn>0?{height:tn===1?92:"auto",overflow:tn===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},j.a.createElement("div",{className:y.a.name,ref:nn},nt==null?void 0:nt.map(function(rn){return j.a.createElement("span",{onClick:function(){return Ft(rn.id)},key:rn.id,title:rn.name,style:{color:It},className:je===rn.id?y.a.active:""},rn.name)}))),!!tn&&j.a.createElement(oe.Fragment,null,tn===1?j.a.createElement("div",{onClick:function(){var Yt;Tt(2),(nn==null||((Yt=nn.current)===null||Yt===void 0)?void 0:Yt.clientHeight)>205?fn(!0):fn(!1)},className:y.a.action},"\u5C55\u5F00",j.a.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):j.a.createElement("div",{onClick:function(){Tt(1),fn(!1)},className:y.a.action},"\u6536\u8D77",j.a.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},u=c,f=Z("cz0n"),s=Z.n(f),r=function(Ge){var bt=Ge.dataSource,nt=bt===void 0?[]:bt,je=Ge.value,Ft=Ge.onChange,Ie=Ge.className;return j.a.createElement("div",{className:p()(s.a.tabs,Ie)},nt.map(function(Zt){return j.a.createElement("span",{onClick:function(){return Ft(Zt.id)},className:je===Zt.id?s.a.active:"",key:Zt.id},Zt.name)}))},a=r,d=Z("5NDa"),L=Z("5rEg"),C=Z("KOXS"),x=Z.n(C),R=function(Ge){var bt,nt=Ge.dataSource,je=nt===void 0?[]:nt,Ft=Ge.value,Ie=Ge.onChange,Zt=Ge.className,Gt=Ge.style,wt=Gt===void 0?{}:Gt,St=Ge.placeholder,en=Object(oe.useState)(""),Qe=Object(P.a)(en,2),It=Qe[0],Wt=Qe[1],Jt=Object(oe.useState)(""),tn=Object(P.a)(Jt,2),Tt=tn[0],ln=tn[1];Object(oe.useEffect)(function(){var fn;(fn=JSON.stringify(Ft))!==null&&fn!==void 0&&fn.includes("{")?(Wt(Ft.id),ln(Ft.value)):ln(Ft)},[Ft]);var Ht=function(){Ie(Tt,It||null)},Et=function(nn){if(nn===It)return;Wt(nn),Ie(Tt,nn)};return j.a.createElement("div",{className:p()(x.a.input,Zt),style:wt},!!je.length&&j.a.createElement("div",{className:x.a.dropdown},j.a.createElement("div",{className:x.a.text},(bt=je.find(function(fn){return fn.id===It}))===null||bt===void 0?void 0:bt.name,j.a.createElement("i",{className:"iconfont icon-zhankai4"}),j.a.createElement("b",{className:x.a.b1}),j.a.createElement("b",{className:x.a.b2})),j.a.createElement("div",{className:x.a.menu},je.map(function(fn,nn){return j.a.createElement("div",{key:nn,onClick:function(){return Et(fn.id)}},fn.name)}))),j.a.createElement(L.a,{onPressEnter:Ht,value:Tt,onChange:function(nn){return ln(nn.target.value)},bordered:!1,placeholder:St}),j.a.createElement("i",{onClick:Ht,className:"iconfont icon-sousuo9 font14 pl10 current"}))},O=R,w=Z("f9pc"),E=Z.n(w),b=function(Ge){var bt=Ge.value,nt=Ge.onChange,je=Ge.className,Ft=Ge.total,Ie=Ge.pageSize,Zt=Ge.style,Gt=Zt===void 0?{}:Zt,wt=bt<2,St=bt>=Math.ceil(Ft/Ie);return Ft<=Ie?j.a.createElement(j.a.Fragment,null):j.a.createElement("div",{className:p()(E.a.quickPager,je),style:Gt},j.a.createElement("div",{onClick:function(){wt||nt(bt-1,"prev")},className:wt?E.a.disabled:""},"\u4E0A\u4E00\u9875"),j.a.createElement("div",{onClick:function(){St||nt(bt+1,"next")},className:St?E.a.disabled:""},"\u4E0B\u4E00\u9875"))},l=b,_=Z("T2oS"),h=Z("W9HT"),g=Z("pC0b"),T=Z("GzdX"),N=Z("5Dmo"),V=Z("3S7+"),Y=Z("Oe0F"),U=Z.n(Y),A=Z("m3rI"),J=Z("1vsH"),te=Z("JAbv"),se=Z.n(te),fe=Z("Bq7L"),Ue=Z.n(fe),Re=Z("MEgm"),De=Z.n(Re),Fe=Z("BdwD"),Me=function(Ge){var bt=Ge.className,nt=Ge.dataSource,je=nt===void 0?[]:nt,Ft=Ge.col,Ie=Ft===void 0?4:Ft,Zt=Ge.right,Gt=Ge.bottom,wt=Gt===void 0?23:Gt,St=Ge.precision,en=St===void 0?0:St,Qe=Ge.wrapWidth,It=Qe===void 0?1200:Qe,Wt=Ge.trackEventItems,Jt=Ge.loading,tn=Math.floor((It-(Ie-1)*Zt)/Ie);return j.a.createElement(h.a,{spinning:Jt},j.a.createElement("div",{className:p()(U.a.list,bt)},!!je.length&&je.map(function(Tt,ln){var Ht=Tt.name,Et=Tt.id,fn=Tt.identifier,nn=Tt.power,rn=Tt.cover_image_id,Yt=Tt.pic;return j.a.createElement("div",{className:U.a.wrap,key:Et,style:{width:tn,marginRight:(1+ln)%Ie===0?0:Zt+en,marginBottom:wt}},j.a.createElement("a",{target:"_blank",href:"/shixuns/".concat(fn,"/challenges"),className:U.a.li,onClick:function(Xn){Xn.preventDefault(),Wt&&Object(J.eb)([Wt]),nn&&Object(J.U)("/shixuns/".concat(fn,"/challenges"))}},j.a.createElement("div",{className:U.a.img},j.a.createElement("img",{className:U.a.cover,src:rn?"".concat(A.a.API_SERVER,"/api/attachments/").concat(rn):"".concat(A.a.IMG_SERVER,"/").concat(Yt)}),Tt.is_jupyter&&j.a.createElement("img",{className:U.a.sign,src:se.a}),Tt.is_jupyter_lab&&j.a.createElement("img",{className:U.a.sign,src:Ue.a}),Tt.is_unity_3d&&j.a.createElement("img",{className:U.a.sign,src:De.a})),j.a.createElement("div",{className:U.a.name},j.a.createElement(V.a,{title:Ht||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},j.a.createElement("span",{className:U.a.e},Ht||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),j.a.createElement("div",{className:U.a.tags},j.a.createElement(V.a,{placement:"bottom",title:"\u5173\u5361\u6570"},j.a.createElement("span",null,j.a.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr3"}),j.a.createElement("span",null,Tt.challenges_count))),!!Tt.myshixuns_count&&j.a.createElement(V.a,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},j.a.createElement("span",null,j.a.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),j.a.createElement("span",null,Tt.myshixuns_count))),j.a.createElement(V.a,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},j.a.createElement("span",null,j.a.createElement("span",null,Tt.level))),j.a.createElement("div",{className:U.a.rate},j.a.createElement(T.a,{allowHalf:!0,disabled:!0,defaultValue:Tt.score_info}),j.a.createElement("span",null,"\xA0",Tt.score_info?"".concat(Tt.score_info,"\u5206"):"5\u5206")))),!nn&&j.a.createElement("div",{className:U.a.lockWrap},j.a.createElement("img",{src:"".concat(A.a.IMG_SERVER,"/images/educoder/icon/lockclose.svg")}),j.a.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!je.length&&j.a.createElement(Fe.a,null)))},ye=Me,le=Z("ZJlW"),Se=Z.n(le),ot=Z("z4EP"),it=Z.n(ot),ct=Z("+GGh"),xt=Z.n(ct),Xe=Z("cFMs"),qe=Z.n(Xe),dt=function(Ge){var bt=Ge.className,nt=Ge.dataSource,je=nt===void 0?[]:nt,Ft=Ge.col,Ie=Ft===void 0?4:Ft,Zt=Ge.right,Gt=Ge.bottom,wt=Gt===void 0?23:Gt,St=Ge.precision,en=St===void 0?0:St,Qe=Ge.wrapWidth,It=Qe===void 0?1200:Qe,Wt=Ge.trackEventItems,Jt=Ge.loading,tn=Math.floor((It-(Ie-1)*Zt)/Ie);return j.a.createElement(h.a,{spinning:Jt},j.a.createElement("div",{className:p()(Se.a.list,bt)},!!je.length&&je.map(function(Tt,ln){var Ht=Tt.name,Et=Tt.id,fn=Tt.identifier,nn=Tt.featured,rn=Tt.school_name,Yt=Tt.image_url,Ln=Tt.excellent;return j.a.createElement("div",{key:Et,className:Se.a.wrap,style:{width:tn,marginRight:(1+ln)%Ie===0?0:Zt+en,marginBottom:wt}},j.a.createElement("a",{target:"_blank",href:"/paths/".concat(fn),className:Se.a.li,onClick:function(Kn){Kn.preventDefault(),Wt&&Object(J.eb)([Wt]),Object(J.U)("/paths/".concat(fn))}},j.a.createElement("div",{className:Se.a.img},j.a.createElement("img",{className:Se.a.cover,src:"".concat(A.a.IMG_SERVER,"/").concat(Yt)}),nn===1&&j.a.createElement("img",{className:Se.a.sign,src:it.a}),nn===2&&j.a.createElement("img",{className:Se.a.sign,src:""}),nn===3&&j.a.createElement("img",{className:Se.a.sign,src:xt.a}),nn===4&&j.a.createElement("img",{className:Se.a.sign,src:""}),nn===5&&j.a.createElement("img",{className:Se.a.sign,src:qe.a})),j.a.createElement("div",{className:Se.a.name},j.a.createElement(V.a,{title:Ht},j.a.createElement("span",{className:Se.a.e},Ht))),j.a.createElement(V.a,{title:"\u53D1\u5E03\u5355\u4F4D\uFF1A".concat(rn)},j.a.createElement("div",{className:Se.a.unit},j.a.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),rn)),j.a.createElement("div",{className:Se.a.tags},j.a.createElement(V.a,{placement:"bottom",title:"\u7AE0\u8282\u6570"},j.a.createElement("span",null,j.a.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),j.a.createElement("span",null,Tt.stages_count))),j.a.createElement(V.a,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},j.a.createElement("span",null,j.a.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),j.a.createElement("span",null,Tt.members_count))),Ln&&j.a.createElement("div",{className:Se.a.tag},"\u5F00\u653E\u8BFE\u7A0B"))))}),!je.length&&j.a.createElement(Fe.a,null)))},vt=dt,st=Z("iL++"),tt=Z.n(st),rt=Z("xiVL"),Bt=function(Ge){var bt=Ge.className,nt=Ge.dataSource,je=nt===void 0?[]:nt,Ft=Ge.col,Ie=Ft===void 0?4:Ft,Zt=Ge.right,Gt=Ge.bottom,wt=Gt===void 0?23:Gt,St=Ge.precision,en=St===void 0?0:St,Qe=Ge.wrapWidth,It=Qe===void 0?1200:Qe,Wt=Ge.trackEventItems,Jt=Ge.loading,tn=Math.floor((It-(Ie-1)*Zt)/Ie);return j.a.createElement(h.a,{spinning:Jt},j.a.createElement("div",{className:p()(tt.a.list,bt)},!!je.length&&je.map(function(Tt,ln){var Ht=Tt.subject_identifier,Et=Tt.id,fn=Tt.identifier,nn=Tt.power,rn=Tt.is_public!=0&&Tt.is_public;return j.a.createElement("div",{className:tt.a.wrap,key:Et,style:{width:tn,marginRight:(1+ln)%Ie===0?0:Zt+en,marginBottom:wt}},j.a.createElement("a",{className:tt.a.li,onClick:function(Ln){Ln.preventDefault()}},j.a.createElement("div",{className:tt.a.top},j.a.createElement(V.a,{title:Tt.name},j.a.createElement("div",{className:tt.a.name},Tt.name)),j.a.createElement("img",{className:tt.a.img,src:A.a.IMG_SERVER+"/images/"+Tt.avatar_url}),j.a.createElement("div",{className:tt.a.text},Tt.creator),Ht&&j.a.createElement("div",{className:tt.a.btns},j.a.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),j.a.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),rn&&j.a.createElement("div",{className:tt.a.sign},"\u516C\u5F00")),j.a.createElement("div",{className:tt.a.bottom},Tt.visits>0&&j.a.createElement(V.a,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},j.a.createElement("span",null,j.a.createElement("i",{className:"iconfont icon-liulanyan"}),j.a.createElement("span",null,Tt.visits))),Tt.course_members_count>0&&j.a.createElement(V.a,{title:"\u6210\u5458",placement:"bottom"},j.a.createElement("span",null,j.a.createElement("i",{className:"iconfont icon-chengyuan"}),Tt.course_members_count)),Tt.tasks_count>0&&j.a.createElement(V.a,{title:"\u4F5C\u4E1A",placement:"bottom"},j.a.createElement("span",null,j.a.createElement("i",{className:"iconfont icon-zuoye"}),Tt.tasks_count)),Tt.is_end?j.a.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):j.a.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),j.a.createElement("div",{className:tt.a.lockWrap},Tt.is_accessible?j.a.createElement(j.a.Fragment,null,Ht&&j.a.createElement("div",{onClick:function(){return Object(J.U)("/paths/".concat(Ht))}},"\u8FDB\u5165\u5B9E\u8DF5\u8BFE\u7A0B"),j.a.createElement("div",{onClick:function(Ln){Wt&&Object(J.eb)([Wt]),Object(J.U)(Tt.first_category_url)}},"\u8FDB\u5165\u6559\u5B66\u8BFE\u5802")):j.a.createElement(j.a.Fragment,null,j.a.createElement("img",{src:"".concat(A.a.IMG_SERVER,"/images/educoder/icon/lockclose.svg")}),j.a.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165"))))}),!je.length&&j.a.createElement(Fe.a,null)))},Pt=Bt,Ct=Z("f0W+"),_t=Z.n(Ct),Vt=function(Ge){var bt=Ge.dataSource,nt=bt===void 0?[]:bt,je=Ge.value,Ft=Ge.onChange,Ie=Ge.className,Zt=Ge.style,Gt=Zt===void 0?{}:Zt,wt=Ge.tabBarExtraContent;return j.a.createElement("div",{className:p()(_t.a.tabs,Ie),style:Gt},j.a.createElement("div",{className:_t.a.tabsWrap},nt.map(function(St,en){return j.a.createElement("div",{onClick:function(){return Ft(St.id)},className:je===St.id?_t.a.active:"",key:en},St.name)})),j.a.createElement("div",{className:_t.a.tabBar},wt))},Ot=Vt,Rt=Z("9JIy"),Ve=Z.n(Rt),Xt=function(Ge){var bt=Ge.className,nt=Ge.style,je=nt===void 0?{}:nt,Ft=Ge.children;return j.a.createElement("div",{className:p()(Ve.a.table,bt),style:je},Ft)},At=Xt,ze=Z("qVdP"),at=Z("jsC+"),Ae=Z("lUTK"),_e=Z("BvKs"),xe=Z("8WcF"),re=Z.n(xe),ae=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}],he=function(Ge){var bt,nt=Ge.sortValue,je=Ge.dropValue,Ft=Ge.className,Ie=Ge.onSort,Zt=Ge.onDrop,Gt=Ge.dataSource,wt=Gt===void 0?ae:Gt;return j.a.createElement("div",{className:p()(re.a.orderWrap,Ft)},j.a.createElement(at.a,{overlay:j.a.createElement(_e.a,null,wt.map(function(St,en){return j.a.createElement(_e.a.Item,{key:en,onClick:function(){return Zt(St.id)}},St.name)}))},j.a.createElement("span",{className:re.a.orderTextWrap},(bt=wt.find(function(St){return je===St.id}))===null||bt===void 0?void 0:bt.name)),j.a.createElement("span",{className:re.a.orderIconWrap},j.a.createElement("span",{className:re.a.orderAsc},j.a.createElement("i",{className:nt==="asc"?"iconfont icon-sanjiaoxing-up font12 ".concat(re.a.cursorPointer," ").concat(re.a.active):"iconfont icon-sanjiaoxing-up font12 ".concat(re.a.cursorPointer),onClick:function(){return Ie(nt==="asc"?"desc":"asc")}})),j.a.createElement("span",{className:re.a.orderDesc},j.a.createElement("i",{className:nt==="desc"?"iconfont icon-sanjiaoxing-down font12 ".concat(re.a.cursorPointer," ").concat(re.a.active):"iconfont icon-sanjiaoxing-down font12 ".concat(re.a.cursorPointer),onClick:function(){return Ie(nt==="asc"?"desc":"asc")}}))))},be=he,Te=Z("siWv"),ke=Z.n(Te),Ne=function(Ge){var bt=Ge.className,nt=Ge.style,je=Ge.children,Ft=Ge.onClick;return j.a.createElement("div",{onClick:Ft,className:p()(ke.a.btn,bt),style:nt},je)},lt=Ne},Nska:function(ht,et,Z){ht.exports={title:"title___18s87",radioWrap:"radioWrap___3ZobS",radio:"radio___19YEl",colorFF0000:"colorFF0000___2BuLq",pagination:"pagination___18hXH"}},O2Wb:function(ht,et,Z){ht.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},Oe0F:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___1lU21",flex_space_between:"flex_space_between___3CfJd",flex_box_vertical_center:"flex_box_vertical_center___20q2h",flex_box_center_end:"flex_box_center_end___1jeZT",flex_box_column:"flex_box_column___2EyZF",list:"list___3Kz8E",wrap:"wrap___12_X7",lockWrap:"lockWrap___9zL4z",li:"li___2bcH1",cover:"cover___1j6mq",img:"img___3itdG",sign:"sign___1Bm21",name:"name___3H1zU",e:"e___1W7k4",tags:"tags___G1tID",rate:"rate___aZiJa"}},Ot1p:function(ht,et,Z){"use strict";var oe=Z("2qtc"),j=Z("kLXV"),M=Z("rAM+"),X=Z("miYZ"),D=Z("tsqr"),F=Z("9og8"),K=Z("tJVT"),H=Z("jrin"),P=Z("WmNS"),I=Z.n(P),y=Z("cDcd"),m=Z.n(y),p=Z("VrN/"),c=Z.n(p),u=Z("bdgK"),f=Z("p77/"),s=Z("Bd2K"),r=Z("ELLl"),a=Z("19Vz"),d=Z("lZu9"),L=Z("+NIl"),C=Z("kSUc"),x=Z("9Bee"),R=function(Te){var ke=Te.value,Ne=ke===void 0?"":ke,lt=Te.className,ft=Te.showTextOnly,Ge=Te.showLines,bt=Te.style,nt=bt===void 0?{}:bt,je=Object(y.useMemo)(function(){return""},[Ne]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:je}}))},O=Z("0Owb"),w=Z("dejd"),E=Z("C+DQ"),b=Z("1vsH"),l=Z("m3rI"),_=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function h(Te){var ke=Te.onActionCallback,Ne=Te.title,lt=Te.icon,ft=Te.actionName,Ge=Te.className,bt=Ge===void 0?"":Ge,nt=Te.children;function je(){ke(ft)}return m.a.createElement("a",{title:Ne,className:bt,onClick:je},m.a.createElement("i",{className:"md-iconfont ".concat(lt)}),nt)}var g=function(Te){var ke=Te.watch,Ne=Te.showNullButton,lt=Te.onActionCallback,ft=Te.fullScreen,Ge=Te.insertTemp,bt=Te.hidetoolBar,nt=Te.uuid,je=Te.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(b.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(b.G)("_educoder_session"),"&key=").concat(nt,"&api=").concat(encodeURIComponent(l.a.PROXY_SERVER)));var Ft=[].concat(_,[{title:"".concat(ke?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ke?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!bt&&Ft.map(function(Ie,Zt){return m.a.createElement("li",{key:Zt},Ie.actionName?m.a.createElement(h,Object(O.a)({},Ie,{onActionCallback:lt})):m.a.createElement("span",{className:"v-line"}))}),Ne?m.a.createElement("li",null,m.a.createElement(h,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:lt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ge&&m.a.createElement("li",null,m.a.createElement(h,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ge),onActionCallback:lt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(h,{icon:"".concat(ft?"icon-shrink":"icon-enlarge"),title:ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:lt})))},T=Z("M8RZ"),N=Z("+L6B"),V=Z("2/Rp"),Y=Z("y8nQ"),U=Z("Vl3Y"),A=Z("5NDa"),J=Z("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},se=function(Te){var ke=Te.callback,Ne=Te.onCancel;function lt(ft){ke(ft)}return m.a.createElement(U.a,Object(O.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:lt}),m.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(J.a,null)),m.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(J.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(V.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},fe=Z("7ahc"),Ue=Z("HmJG"),Re=Z("BjJ7"),De=U.a.useForm,Fe={width:280,marginRight:10},Me={labelCol:{span:5},wrapperCol:{span:19}},ye=function(Te){var ke=Te.callback,Ne=Te.onCancel,lt=De(),ft=Object(K.a)(lt,1),Ge=ft[0];function bt(Ft){ke(Ft)}function nt(Ft,Ie){if(Ft.status===-1){D.b.error(Ft.message);return}Ge.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:Ie.type})}function je(Ft){var Ie=Ft.target.files[0];Se(Ie,nt)}return m.a.createElement(U.a,Object(O.a)({form:Ge},Me,{className:"upload-image-panel",onFinish:bt}),m.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(J.a,{style:Fe})),m.a.createElement(le,{onFileChange:je}))),m.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(J.a,{style:{width:264}})),m.a.createElement(U.a.Item,{style:{textAlign:"right"}},m.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(V.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))};function le(Te){var ke=Te.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:ke}))}function Se(Te,ke){if(!Te)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ne=new FormData;Ne.append("editormd-image-file",Te),Ne.append("file_param_name","editormd-image-file"),Ne.append("byxhr","true");var lt=new window.XMLHttpRequest;lt.withCredentials=!0,lt.addEventListener("load",function(ft){ke(JSON.parse(ft.target.responseText),Te)},!1),lt.addEventListener("error",function(ft){console.error(ft)},!1),lt.open("POST","".concat(Re.a,"/api/attachments.json")),lt.send(Ne)}var ot=Z("giR+"),it=Z("fyUT"),ct=Z("7Kak"),xt=Z("9yH6"),Xe=xt.a.Group,qe={margin:"0 8px"},dt=function(Te){var ke=Te.callback,Ne=Te.onCancel;function lt(ft){ke(ft)}return m.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:lt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:qe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:qe},"\u884C\u6570"),m.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(it.a,null)),m.a.createElement("span",{style:qe},"\u5217\u6570"),m.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(it.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:qe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(U.a.Item,{name:"align"},m.a.createElement(Xe,null,m.a.createElement(xt.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(xt.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(xt.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(xt.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(V.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},vt=Z("ErOA"),st=Z("7Cbv"),tt="link",rt="upload-image",Bt="code-block",Pt="add-table",Ct="------------",_t={default:Ct,left:":".concat(Ct),center:":".concat(Ct,":"),right:"".concat(Ct,":")},Vt=Z("9VGf"),Ot,Rt;function Ve(){}var Xt=0,At=1e4,ze="\u2581",at=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ae(Te){return/^\d+$/.test(Te)?"".concat(Te,"px"):Te}var _e=navigator.platform.toUpperCase().indexOf("MAC")>=0,xe=_e?"Cmd":"Ctrl",re=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ae=(Ot={},Object(H.a)(Ot,xe+"-B","bold"),Object(H.a)(Ot,xe+"-I","italic"),Ot),he=(Rt={},Object(H.a)(Rt,tt,"\u6DFB\u52A0\u94FE\u63A5"),Object(H.a)(Rt,Bt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(H.a)(Rt,rt,"\u6DFB\u52A0\u6587\u4EF6"),Object(H.a)(Rt,Pt,"\u6DFB\u52A0\u8868\u683C"),Rt),be=et.a=function(Te){var ke=Te.defaultValue,Ne=ke===void 0?"":ke,lt=Te.onChange,ft=Te.width,Ge=ft===void 0?"100%":ft,bt=Te.height,nt=bt===void 0?400:bt,je=Te.miniToolbar,Ft=je===void 0?!1:je,Ie=Te.isFocus,Zt=Ie===void 0?!1:Ie,Gt=Te.watch,wt=Te.insertTemp,St=Te.mode,en=St===void 0?"markdown":St,Qe=Te.id,It=Qe===void 0?"markdown-editor-id":Qe,Wt=Te.showResizeBar,Jt=Wt===void 0?!1:Wt,tn=Te.noStorage,Tt=tn===void 0?!1:tn,ln=Te.showNullButton,Ht=ln===void 0?!1:ln,Et=Te.hidetoolBar,fn=Et===void 0?!1:Et,nn=Te.fullScreen,rn=nn===void 0?!1:nn,Yt=Te.onBlur,Ln=Te.onCMBeforeChange,Xn=Te.onFullScreen,Kn=Te.className,$e=Kn===void 0?"":Kn,Kt=Te.disablePaste,zn=Kt===void 0?!1:Kt,bn=Te.placeholder,pn=bn===void 0?"":bn,Mn=Te.values,G=Mn===void 0?"":Mn,v=Object(y.useState)(null),S=Object(K.a)(v,2),B=S[0],q=S[1],W=Object(y.useState)(Ne),ue=Object(K.a)(W,2),We=ue[0],Ye=ue[1],Lt=Object(y.useState)(Gt),Ke=Object(K.a)(Lt,2),gt=Ke[0],an=Ke[1],Hn=Object(y.useState)(rn),qn=Object(K.a)(Hn,2),yn=qn[0],Nt=qn[1],jt=Object(y.useState)(""),un=Object(K.a)(jt,2),cn=un[0],xn=un[1],$n=Object(y.useState)(0),mn=Object(K.a)($n,2),ci=mn[0],cr=mn[1],gr=Object(y.useState)(nt),_r=Object(K.a)(gr,2),Wr=_r[0],fi=_r[1],Di=Object(y.useState)(!1),dr=Object(K.a)(Di,2),Gr=dr[0],Ar=dr[1],ai=Object(y.useRef)(Object(st.a)()),Un=Object(y.useRef)(!1),pi=Object(y.useRef)(),_n=Object(y.useRef)(),mi=Object(y.useRef)(),Jn=Object(y.useRef)(),nr=Object(y.useRef)(),Si=function(){var Ut=Object(F.a)(I.a.mark(function dn(){var $t,On;return I.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.next=2,Object(vt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ai.current}});case 2:On=ti.sent,On!=null&&($t=On.attachments)!==null&&$t!==void 0&&$t.length&&(console.log("cm:",B,_n),On.attachments.map(function(Bn){Bn.content_type.indexOf("image")>-1?B.replaceSelection(".concat(Bn.content_type,")")):Bn.content_type.indexOf("video")>-1?B.replaceSelection('<video width="100%" controls src="'.concat(l.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Bn.content_type.indexOf("pdf")>-1?B.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Bn.id,"?type=").concat(Bn.content_type,'&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):B.replaceSelection("[".concat(Bn.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Bn.id,"?type=").concat(Bn.content_type,")"))}));case 4:case"end":return ti.stop()}},dn)}));return function(){return Ut.apply(this,arguments)}}();Object(y.useEffect)(function(){Ye(G),B==null||B.setValue(G)},[G]),Object(y.useEffect)(function(){Xn==null||Xn(yn)},[yn]),Object(y.useEffect)(function(){if(_n.current){var Ut=c.a.fromTextArea(_n.current,{mode:en,lineNumbers:!Ft,lineWrapping:!0,value:Ne,autoCloseTags:!0,autoCloseBrackets:!0});Zt&&Ut.focus();function dn($t,On){if(zn){On.preventDefault();return}var Wn=On.clipboardData;if(Wn){var ti=Wn.types.toString(),Bn=Wn.items;if(ti==="Files"||Wn.types.indexOf("Files")>-1){if(On.preventDefault(),en=="stex")return;try{var Ai,rr=Bn[1];((Ai=Bn[0])===null||Ai===void 0?void 0:Ai.kind)==="file"&&(rr=Bn[0]);var Dn=rr.getAsFile(),Or=Dn.name.split(".").pop();Se(Dn,function(Qn){if(Qn.id){var Xi,Ki,vr;(Dn==null||((Xi=Dn.type)===null||Xi===void 0)?void 0:Xi.indexOf("image"))>-1?Ut.replaceSelection(".concat(Qn.content_type,")")):(Dn==null||((Ki=Dn.type)===null||Ki===void 0)?void 0:Ki.indexOf("video"))>-1?Ut.replaceSelection('<video width="100%" controls src="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Qn.id,'"></video>')):(Dn==null||((vr=Dn.type)===null||vr===void 0)?void 0:vr.indexOf("pdf"))>-1?Ut.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Qn.id,"?type=").concat(Dn.type,'&disposition=inline" target="_blank">').concat(Dn.name,"</a>")):re.includes(Or)?Ut.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Qn.id,'?type=office&disposition=inline" target="_blank">').concat(Dn.name,"</a>")):Ut.replaceSelection("[".concat(Dn.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Qn.id,"?type=").concat(Qn.content_type,")"))}else(Qn==null?void 0:Qn.status)===401&&(document.location.href="/user/login")})}catch(Qn){D.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ut.on("paste",dn),Ut.on("dragleave",function($t,On){mi.current.classList.remove("mouse-hover-md")}),Ut.on("dragover",function($t,On){mi.current.classList.add("mouse-hover-md")}),Ut.on("drop",function($t,On){mi.current.classList.add("mouse-hover-md");var Wn;if(Wn=On.dataTransfer.files,Wn.length>0){On.preventDefault(),On.stopPropagation();for(var ti=function(rr){var Dn=Wn[rr],Or=Dn.name.split(".").pop();Se(Dn,function(Qn){if(Qn.id){var Xi,Ki,vr;(Dn==null||((Xi=Dn.type)===null||Xi===void 0)?void 0:Xi.indexOf("image"))>-1?Ut.replaceSelection(".concat(Qn.content_type,")")):(Dn==null||((Ki=Dn.type)===null||Ki===void 0)?void 0:Ki.indexOf("video"))>-1?Ut.replaceSelection('<video width="100%" controls src="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Qn.id,'"></video>')):(Dn==null||((vr=Dn.type)===null||vr===void 0)?void 0:vr.indexOf("pdf"))>-1?Ut.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Qn.id,"?type=").concat(Dn.type,'&disposition=inline" target="_blank">').concat(Dn.name,"</a>")):re.includes(Or)?Ut.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Qn.id,'?type=office&disposition=inline" target="_blank">').concat(Dn.name,"</a>")):Ut.replaceSelection("[".concat(Dn.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Qn.id,"?type=").concat(Qn.content_type,")"))}else(Qn==null?void 0:Qn.status)===401&&(document.location.href="/user/login")})},Bn=0;Bn<Wn.length;Bn++)ti(Bn)}}),q(Ut),function(){Ut.off("paste",dn)}}},[]);var Pi=Object(y.useCallback)(function(){if(mi.current)try{}catch(Ut){console.log(Ut,"---- to set md editor body height")}},[Wr,mi,yn]);Object(y.useEffect)(function(){function Ut(){var $t=new u.default(function(On){var Wn=Object(M.a)(On),ti;try{for(Wn.s();!(ti=Wn.n()).done;){var Bn=ti.value;(Bn.target.offsetHeight>0||Bn.target.offsetWidth>0)&&(Pi(),B.setSize("100%","100%"),B.refresh())}}catch(Ai){Wn.e(Ai)}finally{Wn.f()}});return $t.observe(_n.current.parentElement),$t}if(B){var dn=Ut();return function(){dn.unobserve(_n.current.parentElement)}}},[B,Pi]),Object(y.useEffect)(function(){if(B){for(var Ut=[],dn=function(){var Bn=On[$t];Wn=Object(K.a)(Bn,2);var Ai=Wn[0],rr=Wn[1],Dn=Object(H.a)({},Ai,function(){Kr(rr)});Ut.push(Dn),B.addKeyMap(Dn)},$t=0,On=Object.entries(ae);$t<On.length;$t++){var Wn;dn()}return pi.current=setInterval(function(){Un.current&&Si()},4e3),function(){clearInterval(pi.current);var ti=Object(M.a)(Ut),Bn;try{for(ti.s();!(Bn=ti.n()).done;){var Ai=Bn.value;B.removeKeyMap(Ai)}}catch(rr){ti.e(rr)}finally{ti.f()}}}},[B]),Object(y.useEffect)(function(){rn!==yn&&Nt(rn)},[rn]),Object(Vt.a)(function(){if(!Tt&&ci>0){var Ut=new Date().getTime(),dn=window.sessionStorage.getItem(It);Ut>=ci+At&&(!dn||dn!==We)&&(window.sessionStorage.setItem(It,We),Ar(!0))}},At),Object(y.useEffect)(function(){an(Gt)},[B,Gt]),Object(y.useEffect)(function(){B&&(Zt&&B.focus())},[B,Zt]),Object(y.useEffect)(function(){if(gt&&B){var Ut=B.getScrollerElement();function dn($t){var On=$t.target;if(nr.current){var Wn=On.scrollTop/On.scrollHeight;nr.current.scrollTop=nr.current.scrollHeight*Wn}}return Ut.addEventListener("scroll",dn),function(){Ut.removeEventListener("scroll",dn)}}},[B,gt]),Object(y.useEffect)(function(){if(B&&Ln){function Ut(dn,$t){Ln(dn,$t)}return B.on("beforeChange",Ut),function(){B.off("beforeChange",Ut)}}},[B,Ln]),Object(y.useEffect)(function(){if(B&&Yt){function Ut(){Yt(B.getValue())}return B.on("blur",Ut),function(){B.off("blur",Ut)}}},[B,Yt]),Object(y.useEffect)(function(){if(B){function Ut(dn){var $t=dn.getValue();Ye($t),cr(new Date().getTime()),dn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),lt&<($t)}return B.on("change",Ut),function(){B.off("change",Ut)}}},[B,lt]),Object(y.useEffect)(function(){B&&(Ne==null?(B.setValue(""),Ye("")):Ne!==B.getValue()&&(B.setValue(Ne),Ye(Ne),B.setCursor(B.lineCount(),0)))},[B,Ne]);var Kr=Object(y.useCallback)(function(Ut){var dn=B.getCursor(),$t=B.getSelection(),On=$t.split(`
|
|
`);switch(Ut){case"bold":return B.replaceSelection("**"+$t+"**"),$t===""&&B.setCursor(dn.line,dn.ch+2),B.focus();case"italic":return B.replaceSelection("*"+$t+"*"),$t===""&&B.setCursor(dn.line,dn.ch+1),B.focus();case"code":return B.replaceSelection("`"+$t+"`"),$t===""&&B.setCursor(dn.line,dn.ch+1),B.focus();case"inline-latex":return B.replaceSelection("`$$"+$t+"$$`"),$t===""&&B.setCursor(dn.line,dn.ch+3),B.focus();case"latex":return B.replaceSelection("```latex\n"+$t+"\n```"),B.setCursor(dn.line+1,$t.length+1),B.focus();case"line-break":return B.replaceSelection(`<br/>
|
|
`),B.focus();case"list-ul":return $t===""?B.replaceSelection("- "+$t):B.replaceSelection(On.map(function(Wn){return Wn===""?"":"- ".concat(Wn)}).join(`
|
|
`)),B.focus();case"list-ol":return $t===""?B.replaceSelection("1. "+$t):B.replaceSelection(On.map(function(Wn,ti){return Wn===""?"":"".concat(ti+1,". ").concat(Wn)}).join(`
|
|
`)),B.focus();case"add-null-ch":return $t===""&&B.setCursor(dn.line,dn.ch+1),B.replaceSelection(ze),B.focus();case"inster-template-1":return $t===""&&B.setCursor(dn.line,dn.ch),B.replaceSelection(at),B.focus();case"eraser":return B.setValue(""),B.focus();case"trigger-watch":return an(!gt),B.focus();case"trigger-full-screen":return Nt(!yn),B.focus();case tt:xn(tt);return;case Bt:xn(Bt);return;case rt:xn(rt);return;case Pt:xn(Pt);return;default:throw new Error}},[B,gt,yn]),Qi=Object(y.useCallback)(function(Ut){xn("");switch(cn){case tt:var dn=Ut.title,$t=Ut.link;return B.replaceSelection("[".concat(dn,"](").concat($t,")")),B.focus();case Bt:var On=Ut.language,Wn=Ut.content;return B.replaceSelection(["```"+On,Wn,"```"].join(`
|
|
`)),B.focus();case rt:var ti=Ut.src,Bn=Ut.alt;return Bn?B.replaceSelection(".concat(ti,' "').concat(Bn,'" )')):B.replaceSelection("")),B.focus();case Pt:for(var Ai=Ut.row,rr=Ut.col,Dn=Ut.align,Or=`
|
|
`,Qn=0;Qn<Ai;Qn++){for(var Xi=[],Ki=[],vr=0;vr<rr;vr++)Qn===1&&Ki.push(_t[Dn]),Xi.push(" ");Qn===1&&(Or+="| ".concat(Ki.join(" | "),` |
|
|
`)),Or+="| ".concat(Xi.join(rr===1?"":" | "),` |
|
|
`)}return B.replaceSelection(Or+`
|
|
`),B.focus();default:throw new Error}},[B,cn]),Sr=Object(y.useMemo)(function(){switch(cn){case tt:return m.a.createElement(se,{callback:Qi,onCancel:ir});case Bt:return m.a.createElement(fe.b,{callback:Qi,onCancel:ir});case rt:return m.a.createElement(ye,{callback:Qi,onCancel:ir});case Pt:return m.a.createElement(dt,{callback:Qi,onCancel:ir});default:return null}},[cn]);function ir(){xn("")}Object(y.useEffect)(function(){if(Jn.current){var Ut=Jn.current,dn=!1,$t=0;function On(Bn){dn=!0,$t=Bn.pageY}function Wn(){dn=!1}function ti(Bn){if(dn){var Ai=Bn.pageY-$t;Ai<0&&(Ai=0),Ai>300&&(Ai=300);var rr=nt+Ai+"px";fi(rr)}}return Ut.addEventListener("mousedown",On),document.addEventListener("mousemove",ti),document.addEventListener("mouseup",Wn),function(){Ut.removeEventListener("mousedown",On),document.removeEventListener("mousemove",ti),document.removeEventListener("mouseup",Wn)}}},[B,Jn]),Object(y.useEffect)(function(){fi(nt)},[nt]);var Zi=Ae(Ge),zr=Ae(Wr),gi={width:Zi,height:zr},Vn=Object(y.useMemo)(function(){if(ci){var Ut=new Date(ci),dn=Ut.getHours(),$t=Ut.getMinutes(),On=Ut.getSeconds();return dn=dn<10?"0"+dn:dn,$t=$t<10?"0"+$t:$t,On=On<10?"0"+On:On,"".concat(dn,":").concat($t,":").concat(On)}return 0},[ci]);function Ci(){window.sessionStorage.removeItem(It),Ar(!1),cr(0)}function Ti(){Ar(!1),cr(0),B.setValue(window.sessionStorage.getItem(It))}function qi(Ut,dn){var $t=B.getValue();$t=$t.replace(Ut,dn),Ye($t),B==null||B.setValue($t)}return m.a.createElement(y.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:mi},m.a.createElement("div",{className:"markdown-editor-container ".concat($e," ").concat(gt?"on-preview":""," ").concat(Ft?"mini":""," ").concat(yn?"full-screen":""),style:gi},m.a.createElement(g,{insertTemp:wt,watch:gt,fullScreen:yn,showNullButton:Ht,onActionCallback:Kr,hidetoolBar:fn,uuid:ai.current,setOpenPhones:function(){Un.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:_n,placeholder:pn})),gt?m.a.createElement("div",{ref:nr,className:"preview-container"},en==="stex"&&m.a.createElement(R,{value:We}),en!=="stex"&&m.a.createElement(x.a,{edit:!0,value:We,replaces:qi})):null))),Jt?m.a.createElement("a",{ref:Jn,className:"editor-resize"}):null,m.a.createElement(T.a,null,he[cn]?m.a.createElement(j.a,{centered:!0,title:he[cn],visible:!0,onCancel:ir,footer:null,className:"markdown-popup-form"},Sr):null))}},SJMd:function(ht,et){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var Z,oe,j,M=!1,X,D;window.PR_SHOULD_USE_CONTINUATION=!0;var F,K;(function(){var H=window,P=["break,continue,do,else,for,if,return,while"],I=[P,"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"],y=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[y,"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"],p=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[y,"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"],u="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[y,"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=[P,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],a=[P,"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"],d=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],L=[m,c,p,f,s,r,a,d],C=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",R="kwd",O="com",w="typ",E="lit",b="pun",l="pln",_="tag",h="dec",g="src",T="atn",N="atv",V="nocode",Y="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(Xe){for(var qe=0,dt=!1,vt=!1,st=0,tt=Xe.length;st<tt;++st){var rt=Xe[st];if(rt.ignoreCase)vt=!0;else if(/[a-z]/i.test(rt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){dt=!0,vt=!1;break}}var Bt={b:8,t:9,n:10,v:11,f:12,r:13};function Pt(Rt){var Ve=Rt.charCodeAt(0);if(Ve!==92)return Ve;var Xt=Rt.charAt(1);return Ve=Bt[Xt],Ve||("0"<=Xt&&Xt<="7"?parseInt(Rt.substring(1),8):Xt==="u"||Xt==="x"?parseInt(Rt.substring(2),16):Rt.charCodeAt(1))}function Ct(Rt){if(Rt<32)return(Rt<16?"\\x0":"\\x")+Rt.toString(16);var Ve=String.fromCharCode(Rt);return Ve==="\\"||Ve==="-"||Ve==="]"||Ve==="^"?"\\"+Ve:Ve}function _t(Rt){var Ve=Rt.substring(1,Rt.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")),Xt=[],At=Ve[0]==="^",ze=["["];At&&ze.push("^");for(var at=At?1:0,Ae=Ve.length;at<Ae;++at){var _e=Ve[at];if(/\\[bdsw]/i.test(_e))ze.push(_e);else{var xe=Pt(_e),re;at+2<Ae&&Ve[at+1]==="-"?(re=Pt(Ve[at+2]),at+=2):re=xe,Xt.push([xe,re]),re<65||xe>122||(re<65||xe>90||Xt.push([Math.max(65,xe)|32,Math.min(re,90)|32]),re<97||xe>122||Xt.push([Math.max(97,xe)&~32,Math.min(re,122)&~32]))}}Xt.sort(function(Te,ke){return Te[0]-ke[0]||ke[1]-Te[1]});for(var ae=[],he=[],at=0;at<Xt.length;++at){var be=Xt[at];be[0]<=he[1]+1?he[1]=Math.max(he[1],be[1]):ae.push(he=be)}for(var at=0;at<ae.length;++at){var be=ae[at];ze.push(Ct(be[0])),be[1]>be[0]&&(be[1]+1>be[0]&&ze.push("-"),ze.push(Ct(be[1])))}return ze.push("]"),ze.join("")}function Vt(Rt){for(var Ve=Rt.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")),Xt=Ve.length,At=[],ze=0,at=0;ze<Xt;++ze){var Ae=Ve[ze];if(Ae==="(")++at;else if(Ae.charAt(0)==="\\"){var _e=+Ae.substring(1);_e&&(_e<=at?At[_e]=-1:Ve[ze]=Ct(_e))}}for(var ze=1;ze<At.length;++ze)At[ze]===-1&&(At[ze]=++qe);for(var ze=0,at=0;ze<Xt;++ze){var Ae=Ve[ze];if(Ae==="(")++at,At[at]||(Ve[ze]="(?:");else if(Ae.charAt(0)==="\\"){var _e=+Ae.substring(1);_e&&_e<=at&&(Ve[ze]="\\"+At[_e])}}for(var ze=0;ze<Xt;++ze)Ve[ze]==="^"&&Ve[ze+1]!=="^"&&(Ve[ze]="");if(Rt.ignoreCase&&dt)for(var ze=0;ze<Xt;++ze){var Ae=Ve[ze],xe=Ae.charAt(0);Ae.length>=2&&xe==="["?Ve[ze]=_t(Ae):xe!=="\\"&&(Ve[ze]=Ae.replace(/[a-zA-Z]/g,function(he){var be=he.charCodeAt(0);return"["+String.fromCharCode(be&~32,be|32)+"]"}))}return Ve.join("")}for(var Ot=[],st=0,tt=Xe.length;st<tt;++st){var rt=Xe[st];if(rt.global||rt.multiline)throw new Error(""+rt);Ot.push("(?:"+Vt(rt)+")")}return new RegExp(Ot.join("|"),vt?"gi":"g")}function A(Xe,qe){var dt=/(?:^|\s)nocode(?:\s|$)/,vt=[],st=0,tt=[],rt=0;function Bt(Pt){var Ct=Pt.nodeType;if(Ct==1){if(dt.test(Pt.className))return;for(var _t=Pt.firstChild;_t;_t=_t.nextSibling)Bt(_t);var Vt=Pt.nodeName.toLowerCase();(Vt==="br"||Vt==="li")&&(vt[rt]=`
|
|
`,tt[rt<<1]=st++,tt[rt++<<1|1]=Pt)}else if(Ct==3||Ct==4){var Ot=Pt.nodeValue;Ot.length&&(qe?Ot=Ot.replace(/\r\n?/g,`
|
|
`):Ot=Ot.replace(/[ \t\r\n]+/g," "),vt[rt]=Ot,tt[rt<<1]=st,st+=Ot.length,tt[rt++<<1|1]=Pt)}}return Bt(Xe),{sourceCode:vt.join("").replace(/\n$/,""),spans:tt}}function J(Xe,qe,dt,vt,st){if(!dt)return;var tt={sourceNode:Xe,pre:1,langExtension:null,numberLines:null,sourceCode:dt,spans:null,basePos:qe,decorations:null};vt(tt),st.push.apply(st,tt.decorations)}var te=/\S/;function se(Xe){for(var qe=void 0,dt=Xe.firstChild;dt;dt=dt.nextSibling){var vt=dt.nodeType;qe=vt===1?qe?Xe:dt:vt===3&&te.test(dt.nodeValue)?Xe:qe}return qe===Xe?void 0:qe}function fe(Xe,qe){var dt={},vt;(function(){for(var rt=Xe.concat(qe),Bt=[],Pt={},Ct=0,_t=rt.length;Ct<_t;++Ct){var Vt=rt[Ct],Ot=Vt[3];if(Ot)for(var Rt=Ot.length;--Rt>=0;)dt[Ot.charAt(Rt)]=Vt;var Ve=Vt[1],Xt=""+Ve;Pt.hasOwnProperty(Xt)||(Bt.push(Ve),Pt[Xt]=null)}Bt.push(/[\0-\uffff]/),vt=U(Bt)})();var st=qe.length,tt=function(rt){for(var Bt=rt.sourceCode,Pt=rt.basePos,Ct=rt.sourceNode,_t=[Pt,l],Vt=0,Ot=Bt.match(vt)||[],Rt={},Ve=0,Xt=Ot.length;Ve<Xt;++Ve){var At=Ot[Ve],ze=Rt[At],at=void 0,Ae;if(typeof ze=="string")Ae=!1;else{var _e=dt[At.charAt(0)];if(_e)at=At.match(_e[1]),ze=_e[0];else{for(var xe=0;xe<st;++xe)if(_e=qe[xe],at=At.match(_e[1]),at){ze=_e[0];break}at||(ze=l)}Ae=ze.length>=5&&ze.substring(0,5)==="lang-",Ae&&!(at&&typeof at[1]=="string")&&(Ae=!1,ze=g),Ae||(Rt[At]=ze)}var re=Vt;if(Vt+=At.length,!Ae)_t.push(Pt+re,ze);else{var ae=at[1],he=At.indexOf(ae),be=he+ae.length;at[2]&&(be=At.length-at[2].length,he=be-ae.length);var Te=ze.substring(5);J(Ct,Pt+re,At.substring(0,he),tt,_t),J(Ct,Pt+re+he,ae,le(Te,ae),_t),J(Ct,Pt+re+be,At.substring(be),tt,_t)}}rt.decorations=_t};return tt}function Ue(Xe){var qe=[],dt=[];Xe.tripleQuotedStrings?qe.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Xe.multiLineStrings?qe.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):qe.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Xe.verbatimStrings&&dt.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var vt=Xe.hashComments;vt&&(Xe.cStyleComments?(vt>1?qe.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):qe.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),dt.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):qe.push([O,/^#[^\r\n]*/,null,"#"])),Xe.cStyleComments&&(dt.push([O,/^\/\/[^\r\n]*/,null]),dt.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var st=Xe.regexLiterals;if(st){var tt=st>1?"":`
|
|
\r`,rt=tt?".":"[\\S\\s]",Bt="/(?=[^/*"+tt+"])(?:[^/\\x5B\\x5C"+tt+"]|\\x5C"+rt+"|\\x5B(?:[^\\x5C\\x5D"+tt+"]|\\x5C"+rt+")*(?:\\x5D|$))+/";dt.push(["lang-regex",RegExp("^"+Y+"("+Bt+")")])}var Pt=Xe.types;Pt&&dt.push([w,Pt]);var Ct=(""+Xe.keywords).replace(/^ | $/g,"");Ct.length&&dt.push([R,new RegExp("^(?:"+Ct.replace(/[\s,]+/g,"|")+")\\b"),null]),qe.push([l,/^\s+/,null,` \r
|
|
\xA0`]);var _t="^.[^\\s\\w.$@'\"`/\\\\]*";return Xe.regexLiterals&&(_t+="(?!s*/)"),dt.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[w,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[l,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[l,/^\\[\s\S]?/,null],[b,new RegExp(_t),null]),fe(qe,dt)}var Re=Ue({keywords:L,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function De(Xe,qe,dt){for(var vt=/(?:^|\s)nocode(?:\s|$)/,st=/\r\n?|\n/,tt=Xe.ownerDocument,rt=tt.createElement("li");Xe.firstChild;)rt.appendChild(Xe.firstChild);var Bt=[rt];function Pt(Ve){var Xt=Ve.nodeType;if(Xt==1&&!vt.test(Ve.className))if(Ve.nodeName==="br")Ct(Ve),Ve.parentNode&&Ve.parentNode.removeChild(Ve);else for(var At=Ve.firstChild;At;At=At.nextSibling)Pt(At);else if((Xt==3||Xt==4)&&dt){var ze=Ve.nodeValue,at=ze.match(st);if(at){var Ae=ze.substring(0,at.index);Ve.nodeValue=Ae;var _e=ze.substring(at.index+at[0].length);if(_e){var xe=Ve.parentNode;xe.insertBefore(tt.createTextNode(_e),Ve.nextSibling)}Ct(Ve),Ae||Ve.parentNode.removeChild(Ve)}}}function Ct(Ve){for(;!Ve.nextSibling;)if(Ve=Ve.parentNode,!Ve)return;function Xt(at,Ae){var _e=Ae?at.cloneNode(!1):at,xe=at.parentNode;if(xe){var re=Xt(xe,1),ae=at.nextSibling;re.appendChild(_e);for(var he=ae;he;he=ae)ae=he.nextSibling,re.appendChild(he)}return _e}for(var At=Xt(Ve.nextSibling,0),ze;(ze=At.parentNode)&&ze.nodeType===1;)At=ze;Bt.push(At)}for(var _t=0;_t<Bt.length;++_t)Pt(Bt[_t]);qe===(qe|0)&&Bt[0].setAttribute("value",qe);var Vt=tt.createElement("ol");Vt.className="linenums";for(var Ot=Math.max(0,qe-1|0)||0,_t=0,Rt=Bt.length;_t<Rt;++_t)rt=Bt[_t],rt.className="L"+(_t+Ot)%10,rt.firstChild||rt.appendChild(tt.createTextNode("\xA0")),Vt.appendChild(rt);Xe.appendChild(Vt)}function Fe(Xe){var qe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);qe=qe&&+qe[1]<=8;var dt=/\n/g,vt=Xe.sourceCode,st=vt.length,tt=0,rt=Xe.spans,Bt=rt.length,Pt=0,Ct=Xe.decorations,_t=Ct.length,Vt=0;Ct[_t]=st;var Ot,Rt;for(Rt=Ot=0;Rt<_t;)Ct[Rt]!==Ct[Rt+2]?(Ct[Ot++]=Ct[Rt++],Ct[Ot++]=Ct[Rt++]):Rt+=2;for(_t=Ot,Rt=Ot=0;Rt<_t;){for(var Ve=Ct[Rt],Xt=Ct[Rt+1],At=Rt+2;At+2<=_t&&Ct[At+1]===Xt;)At+=2;Ct[Ot++]=Ve,Ct[Ot++]=Xt,Rt=At}_t=Ct.length=Ot;var ze=Xe.sourceNode,at="";ze&&(at=ze.style.display,ze.style.display="none");try{for(var Ae=null;Pt<Bt;){var _e=rt[Pt],xe=rt[Pt+2]||st,re=Ct[Vt+2]||st,At=Math.min(xe,re),ae=rt[Pt+1],he;if(ae.nodeType!==1&&(he=vt.substring(tt,At))){qe&&(he=he.replace(dt,"\r")),ae.nodeValue=he;var be=ae.ownerDocument,Te=be.createElement("span");Te.className=Ct[Vt+1];var ke=ae.parentNode;ke.replaceChild(Te,ae),Te.appendChild(ae),tt<xe&&(rt[Pt+1]=ae=be.createTextNode(vt.substring(At,xe)),ke.insertBefore(ae,Te.nextSibling))}tt=At,tt>=xe&&(Pt+=2),tt>=re&&(Vt+=2)}}finally{ze&&(ze.style.display=at)}}var Me={};function ye(Xe,qe){for(var dt=qe.length;--dt>=0;){var vt=qe[dt];Me.hasOwnProperty(vt)?H.console&&console.warn("cannot override language handler %s",vt):Me[vt]=Xe}}function le(Xe,qe){return Xe&&Me.hasOwnProperty(Xe)||(Xe=/^\s*</.test(qe)?"default-markup":"default-code"),Me[Xe]}ye(Re,["default-code"]),ye(fe([],[[l,/^[^<?]+/],[h,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[b,/^(?:<[%?]|[%?]>)/],["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"]),ye(fe([[l,/^[\s]+/,null,` \r
|
|
`],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[T,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[b,/^[=<>\/]+/],["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"]),ye(fe([],[[N,/^[\s\S]+/]]),["uq.val"]),ye(Ue({keywords:m,hashComments:!0,cStyleComments:!0,types:C}),["c","cc","cpp","cxx","cyc","m"]),ye(Ue({keywords:"null,true,false"}),["json"]),ye(Ue({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:C}),["cs"]),ye(Ue({keywords:p,cStyleComments:!0}),["java"]),ye(Ue({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ye(Ue({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ye(Ue({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ye(Ue({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ye(Ue({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ye(Ue({keywords:u,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ye(fe([],[[x,/^[\s\S]+/]]),["regex"]);function Se(Xe){var qe=Xe.langExtension;try{var dt=A(Xe.sourceNode,Xe.pre),vt=dt.sourceCode;Xe.sourceCode=vt,Xe.spans=dt.spans,Xe.basePos=0,le(qe,vt)(Xe),Fe(Xe)}catch(st){H.console&&console.log(st&&st.stack||st)}}function ot(Xe,qe,dt){var vt=dt||!1,st=qe||null,tt=document.createElement("div");tt.innerHTML="<pre>"+Xe+"</pre>",tt=tt.firstChild,vt&&De(tt,vt,!0);var rt={langExtension:st,numberLines:vt,sourceNode:tt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Se(rt),tt.innerHTML}function it(Xe,qe){var dt=qe||document.body,vt=dt.ownerDocument||document;function st(_e){return dt.getElementsByTagName(_e)}for(var tt=[st("pre"),st("code"),st("xmp")],rt=[],Bt=0;Bt<tt.length;++Bt)for(var Pt=0,Ct=tt[Bt].length;Pt<Ct;++Pt)rt.push(tt[Bt][Pt]);tt=null;var _t=Date;_t.now||(_t={now:function(){return+new Date}});var Vt=0,Ot=/\blang(?:uage)?-([\w.]+)(?!\S)/,Rt=/\bprettyprint\b/,Ve=/\bprettyprinted\b/,Xt=/pre|xmp/i,At=/^code$/i,ze=/^(?:pre|code|xmp)$/i,at={};function Ae(){for(var _e=H.PR_SHOULD_USE_CONTINUATION?_t.now()+250:Infinity;Vt<rt.length&&_t.now()<_e;Vt++){for(var xe=rt[Vt],re=at,ae=xe;ae=ae.previousSibling;){var he=ae.nodeType,be=(he===7||he===8)&&ae.nodeValue;if(be?!/^\??prettify\b/.test(be):he!==3||/\S/.test(ae.nodeValue))break;if(be){re={},be.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Gt,wt,St){re[wt]=St});break}}var Te=xe.className;if((re!==at||Rt.test(Te))&&!Ve.test(Te)){for(var ke=!1,Ne=xe.parentNode;Ne;Ne=Ne.parentNode){var lt=Ne.tagName;if(ze.test(lt)&&Ne.className&&Rt.test(Ne.className)){ke=!0;break}}if(!ke){xe.className+=" prettyprinted";var ft=re.lang;if(!ft){ft=Te.match(Ot);var Ge;!ft&&(Ge=se(xe))&&At.test(Ge.tagName)&&(ft=Ge.className.match(Ot)),ft&&(ft=ft[1])}var bt;if(Xt.test(xe.tagName))bt=1;else{var nt=xe.currentStyle,je=vt.defaultView,Ft=nt?nt.whiteSpace:je&&je.getComputedStyle?je.getComputedStyle(xe,null).getPropertyValue("white-space"):0;bt=Ft&&Ft.substring(0,3)==="pre"}var Ie=re.linenums;(Ie=Ie==="true"||+Ie)||(Ie=Te.match(/\blinenums\b(?::(\d+))?/),Ie=Ie?Ie[1]&&Ie[1].length?+Ie[1]:!0:!1),Ie&&De(xe,Ie,bt);var Zt={langExtension:ft,sourceNode:xe,numberLines:Ie,pre:bt,sourceCode:null,basePos:null,spans:null,decorations:null};Se(Zt)}}}Vt<rt.length?H.setTimeout(Ae,250):typeof Xe=="function"&&Xe()}Ae()}var ct=H.PR={createSimpleLexer:fe,registerLangHandler:ye,sourceDecorator:Ue,PR_ATTRIB_NAME:T,PR_ATTRIB_VALUE:N,PR_COMMENT:O,PR_DECLARATION:h,PR_KEYWORD:R,PR_LITERAL:E,PR_NOCODE:V,PR_PLAIN:l,PR_PUNCTUATION:b,PR_SOURCE:g,PR_STRING:x,PR_TAG:_,PR_TYPE:w,prettyPrintOne:M?H.prettyPrintOne=ot:F=ot,prettyPrint:K=M?H.prettyPrint=it:K=it},xt=H.define;typeof xt=="function"&&xt.amd&&xt("google-code-prettify",[],function(){return ct})})()},TXwP:function(ht,et,Z){var oe,j;(function(){var M;(function(){"use strict";var D=[,,function(P){function I(p){this.__parent=p,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=[]}I.prototype.clone_empty=function(){var p=new I(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},I.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},I.prototype.has_match=function(p){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(p))return!0;return!1},I.prototype.set_indent=function(p,c){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.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)},I.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},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(p){this.__items.push(p);var c=p.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=p.length-c:this.__character_count+=p.length},I.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function y(p,c){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),c=c||"",p.indent_level>0&&(c=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}y.prototype.get_indent_size=function(p,c){var u=this.__base_string_length;return c=c||0,p<0&&(u=0),u+=p*this.__indent_size,u+=c,u},y.prototype.get_indent_string=function(p,c){var u=this.__base_string;return c=c||0,p<0&&(p=0,u=""),c+=p*this.__indent_size,this.__ensure_cache(c),u+=this.__cache[c],u},y.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var p=this.__cache.length,c=0,u="";this.__indent_size&&p>=this.__indent_size&&(c=Math.floor(p/this.__indent_size),p-=c*this.__indent_size,u=new Array(c+1).join(this.__indent_string)),p&&(u+=new Array(p+1).join(" ")),this.__cache.push(u)};function m(p,c){this.__indent_cache=new y(p,c),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,c){return this.__indent_cache.get_indent_string(p,c)},m.prototype.get_indent_size=function(p,c){return this.__indent_cache.get_indent_size(p,c)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(u=u.replace(/[\n]/g,p)),u},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,c){return p=p||0,c=c||0,this.next_line.set_indent(p,c),this.__lines.length>1?(this.current_line.set_indent(p,c),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var c=0;c<p.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(p){for(var c=this.__lines.length;p<c;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,c){for(var u=this.__lines.length-2;u>=0;){var f=this.__lines[u];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==c){this.__lines.splice(u+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},P.exports.Output=m},,,,function(P){function I(p,c){this.raw_options=y(p,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(p,c){var u=this.raw_options[p],f=c||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(f=u.concat()):typeof u=="string"&&(f=u.split(/[^a-zA-Z0-9_\/\-]+/)),f},I.prototype._get_boolean=function(p,c){var u=this.raw_options[p],f=u===void 0?!!c:!!u;return f},I.prototype._get_characters=function(p,c){var u=this.raw_options[p],f=c||"";return typeof u=="string"&&(f=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},I.prototype._get_number=function(p,c){var u=this.raw_options[p];c=parseInt(c,10),isNaN(c)&&(c=0);var f=parseInt(u,10);return isNaN(f)&&(f=c),f},I.prototype._get_selection=function(p,c,u){var f=this._get_selection_list(p,c,u);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f[0]},I.prototype._get_selection_list=function(p,c,u){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[c[0]],!this._is_valid_selection(u,c))throw new Error("Invalid Default Value!");var f=this._get_array(p,u);if(!this._is_valid_selection(f,c))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f},I.prototype._is_valid_selection=function(p,c){return p.length&&c.length&&!p.some(function(u){return c.indexOf(u)===-1})};function y(p,c){var u={};p=m(p);var f;for(f in p)f!==c&&(u[f]=p[f]);if(c&&p[c])for(f in p[c])u[f]=p[c][f];return u}function m(p){var c={},u;for(u in p){var f=u.replace(/-/g,"_");c[f]=p[u]}return c}P.exports.Options=I,P.exports.normalizeOpts=m,P.exports.mergeOpts=y},,function(P){var I=RegExp.prototype.hasOwnProperty("sticky");function y(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},y.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},y.prototype.__match=function(m,p){m.lastIndex=p;var c=m.exec(this.__input);return c&&!(I&&m.sticky)&&(c.index!==p&&(c=null)),c},y.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},y.prototype.testChar=function(m,p){var c=this.peek(p);return m.lastIndex=0,c!==null&&m.test(c)},y.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},y.prototype.read=function(m,p,c){var u="",f;return m&&(f=this.match(m),f&&(u+=f[0])),p&&(f||!m)&&(u+=this.readUntil(p,c)),u},y.prototype.readUntil=function(m,p){var c="",u=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(u=f.index,p&&(u+=f[0].length)):u=this.__input_length,c=this.__input.substring(this.__position,u),this.__position=u,c},y.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},y.prototype.get_regexp=function(m,p){var c=null,u="g";return p&&I&&(u="y"),typeof m=="string"&&m!==""?c=new RegExp(m,u):m&&(c=new RegExp(m.source,u)),c},y.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(m){var p=this.__position,c=this.readUntilAfter(m);return this.__position=p,c},y.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},P.exports.InputScanner=y},,,,,function(P){function I(y,m){y=typeof y=="string"?y:y.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+m,"g")}I.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(y);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(y);return m},I.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},P.exports.Directives=I},,function(P,I,y){var m=y(16).Beautifier,p=y(17).Options;function c(u,f){var s=new m(u,f);return s.beautify()}P.exports=c,P.exports.defaultOptions=function(){return new p}},function(P,I,y){var m=y(17).Options,p=y(2).Output,c=y(8).InputScanner,u=y(13).Directives,f=new u(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,a=/\s/,d=/(?:\s|\n)+/g,L=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,C=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(R,O){this._source_text=R||"",this._options=new m(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}x.prototype.eatString=function(R){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return O},x.prototype.eatWhitespace=function(R){for(var O=a.test(this._input.peek()),w=0;a.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
|
|
`&&((w===0||w<this._options.max_preserve_newlines)&&(w++,this._output.add_new_line(!0)));return O},x.prototype.foundNestedPseudoClass=function(){for(var R=0,O=1,w=this._input.peek(O);w;){if(w==="{")return!0;if(w==="(")R+=1;else if(w===")"){if(R===0)return!1;R-=1}else if(w===";"||w==="}")return!1;O++,w=this._input.peek(O)}return!1},x.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},x.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,O=this._options.eol;O==="auto"&&(O=`
|
|
`,R&&s.test(R||"")&&(O=R.match(s)[0])),R=R.replace(r,`
|
|
`);var w=R.match(/^[\t ]*/)[0];this._output=new p(this._options,w),this._input=new c(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var E=0,b=!1,l=!1,_=!1,h=!1,g=!1,T=!1,N=this._ch,V=!1,Y,U,A;Y=this._input.read(d),U=Y!=="",A=N,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),N=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var J=this._input.read(L),te=f.get_directives(J);te&&te.ignore==="start"&&(J+=f.readIgnored(this._input)),this.print_string(J),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(C)),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 se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);se.match(/[ :]$/)&&(se=this.eatString(": ").replace(/\s$/,""),this.print_string(se),this._output.space_before_token=!0),se=se.replace(/\s$/,""),se==="extend"?h=!0:se==="import"&&(g=!0),se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!b&&E===0&&se.indexOf(":")!==-1&&(l=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")l&&(l=!1,this.outdent()),_?(_=!1,b=this._indentLevel>=this._nestedLevel):b=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&b&&(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)):(A==="("?this._output.space_before_token=!1:A!==","&&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(),A==="{"&&this._output.trim(!0),g=!1,h=!1,l&&(this.outdent(),l=!1),this.print_string(this._ch),b=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var fe=0;fe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;fe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[fe])){V=!0;break}(b||_)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!h&&E===0?(this.print_string(":"),l||(l=!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 Ue=A==='"'||A==="'";this.preserveSingleSpace(Ue||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")V=!1,E===0?(l&&(this.outdent(),l=!1),h=!1,g=!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(),E++,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(")")),E&&(E--,this.outdent()));else{var Re=!1;this._input.lookBack("with")&&(Re=!0),this.preserveSingleSpace(U||Re),this.print_string(this._ch),l&&A==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),T=!0):(this.eatWhitespace(),E++,this.indent())}else if(this._ch===")")E&&(E--,this.outdent()),T&&this._input.peek()===";"&&this._options.selector_separator_newline&&(T=!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&&(!l||T)&&E===0&&!g&&!h?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!l&&E===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.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("="),a.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var De=A==='"'||A==="'";this.preserveSingleSpace(De||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&V&&this._output.add_new_line()}var Fe=this._output.get_code(O);return Fe},P.exports.Beautifier=x},function(P,I,y){var m=y(6).Options;function p(c){m.call(this,c,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var u=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||u;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<f.length;s++)f[s]!=="expand"?this.brace_style="collapse":this.brace_style=f[s]}p.prototype=new m,P.exports.Options=p}],F={};function K(P){var I=F[P];if(I!==void 0)return I.exports;var y=F[P]={exports:{}};return D[P](y,y.exports,K),y.exports}var H=K(15);M=H})();var X=M;!(oe=[],j=function(){return{css_beautify:X}}.apply(et,oe),j!==void 0&&(ht.exports=j))})()},UU91:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___W-luD",flex_space_between:"flex_space_between___MDZOl",flex_box_vertical_center:"flex_box_vertical_center___GF3w8",flex_box_center_end:"flex_box_center_end___UZLKo",flex_box_column:"flex_box_column___26ZEG",bg:"bg___Lrg3h",containerTitle:"containerTitle___36aFc",containerDesc:"containerDesc___1ITIo",listItem:"listItem___3yIgk",info:"info___1J349",title:"title___1poFp",titleLeft:"titleLeft___1G4yJ",titleRight:"titleRight___3ZAtk",acitons:"acitons___rsUze",export:"export___23Ina"}},"VrN/":function(ht,et,Z){(function(oe,j){ht.exports=j()})(this,function(){"use strict";var oe=navigator.userAgent,j=navigator.platform,M=/gecko\/\d/i.test(oe),X=/MSIE \d/.test(oe),D=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oe),F=/Edge\/(\d+)/.exec(oe),K=X||D||F,H=K&&(X?document.documentMode||6:+(F||D)[1]),P=!F&&/WebKit\//.test(oe),I=P&&/Qt\/\d+\.\d+/.test(oe),y=!F&&/Chrome\//.test(oe),m=/Opera\//.test(oe),p=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(oe),u=/PhantomJS/.test(oe),f=!F&&/AppleWebKit/.test(oe)&&/Mobile\/\w+/.test(oe),s=/Android/.test(oe),r=f||s||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(oe),a=f||/Mac/.test(j),d=/\bCrOS\b/.test(oe),L=/win/i.test(j),C=m&&oe.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(m=!1,P=!0);var x=a&&(I||m&&(C==null||C<12.11)),R=M||K&&H>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var w=function(e,t){var i=e.className,n=O(t).exec(i);if(n){var o=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(o?n[1]+o:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function b(e,t){return E(e).appendChild(t)}function l(e,t,i,n){var o=document.createElement(e);if(i&&(o.className=i),n&&(o.style.cssText=n),typeof t=="string")o.appendChild(document.createTextNode(t));else if(t)for(var k=0;k<t.length;++k)o.appendChild(t[k]);return o}function _(e,t,i,n){var o=l(e,t,i,n);return o.setAttribute("role","presentation"),o}var h;document.createRange?h=function(e,t,i,n){var o=document.createRange();return o.setEnd(n||e,i),o.setStart(e,t),o}:h=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(o){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function g(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function T(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function N(e,t){var i=e.className;O(t).test(i)||(e.className+=(i?" ":"")+t)}function V(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!O(i[n]).test(t)&&(t+=" "+i[n]);return t}var Y=function(e){e.select()};f?Y=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(Y=function(e){try{e.select()}catch(t){}});function U(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function A(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function J(e,t,i,n,o){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var k=n||0,z=o||0;;){var Q=e.indexOf(" ",k);if(Q<0||Q>=t)return z+(t-k);z+=Q-k,z+=i-z%i,k=Q+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function se(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var fe=50,Ue={toString:function(){return"CodeMirror.Pass"}},Re={scroll:!1},De={origin:"*mouse"},Fe={origin:"+move"};function Me(e,t,i){for(var n=0,o=0;;){var k=e.indexOf(" ",n);k==-1&&(k=e.length);var z=k-n;if(k==e.length||o+z>=t)return n+Math.min(z,t-o);if(o+=k-n,o+=i-o%i,n=k+1,o>=t)return n}}var ye=[""];function le(e){for(;ye.length<=e;)ye.push(Se(ye)+" ");return ye[e]}function Se(e){return e[e.length-1]}function ot(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function it(e,t,i){for(var n=0,o=i(t);n<e.length&&i(e[n])<=o;)n++;e.splice(n,0,t)}function ct(){}function xt(e,t){var i;return Object.create?i=Object.create(e):(ct.prototype=e,i=new ct),t&&A(t,i),i}var Xe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function qe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Xe.test(e))}function dt(e,t){return t?t.source.indexOf("\\w")>-1&&qe(e)?!0:t.test(e):qe(e)}function vt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var st=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function tt(e){return e.charCodeAt(0)>=768&&st.test(e)}function rt(e,t,i){for(;(i<0?t>0:t<e.length)&&tt(e.charAt(t));)t+=i;return t}function Bt(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var o=(t+i)/2,k=n<0?Math.ceil(o):Math.floor(o);if(k==t)return e(k)?t:i;e(k)?i=k:t=k+n}}function Pt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var o=!1,k=0;k<e.length;++k){var z=e[k];(z.from<i&&z.to>t||t==i&&z.to==t)&&(n(Math.max(z.from,t),Math.min(z.to,i),z.level==1?"rtl":"ltr",k),o=!0)}o||n(t,i,"ltr")}var Ct=null;function _t(e,t,i){var n;Ct=null;for(var o=0;o<e.length;++o){var k=e[o];if(k.from<t&&k.to>t)return o;k.to==t&&(k.from!=k.to&&i=="before"?n=o:Ct=o),k.from==t&&(k.from!=k.to&&i!="before"?n=o:Ct=o)}return n!=null?n:Ct}var Vt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ne){return ne<=247?e.charAt(ne):1424<=ne&&ne<=1524?"R":1536<=ne&&ne<=1785?t.charAt(ne-1536):1774<=ne&&ne<=2220?"r":8192<=ne&&ne<=8203?"w":ne==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,k=/[LRr]/,z=/[Lb1n]/,Q=/[1n]/;function $(ne,me,Ee){this.level=ne,this.from=me,this.to=Ee}return function(ne,me){var Ee=me=="ltr"?"L":"R";if(ne.length==0||me=="ltr"&&!n.test(ne))return!1;for(var He=ne.length,Pe=[],Ze=0;Ze<He;++Ze)Pe.push(i(ne.charCodeAt(Ze)));for(var ut=0,yt=Ee;ut<He;++ut){var kt=Pe[ut];kt=="m"?Pe[ut]=yt:yt=kt}for(var zt=0,Mt=Ee;zt<He;++zt){var Qt=Pe[zt];Qt=="1"&&Mt=="r"?Pe[zt]="n":k.test(Qt)&&(Mt=Qt,Qt=="r"&&(Pe[zt]="R"))}for(var vn=1,sn=Pe[0];vn<He-1;++vn){var Rn=Pe[vn];Rn=="+"&&sn=="1"&&Pe[vn+1]=="1"?Pe[vn]="1":Rn==","&&sn==Pe[vn+1]&&(sn=="1"||sn=="n")&&(Pe[vn]=sn),sn=Rn}for(var hi=0;hi<He;++hi){var zi=Pe[hi];if(zi==",")Pe[hi]="N";else if(zi=="%"){var wi=void 0;for(wi=hi+1;wi<He&&Pe[wi]=="%";++wi);for(var yr=hi&&Pe[hi-1]=="!"||wi<He&&Pe[wi]=="1"?"1":"N",fr=hi;fr<wi;++fr)Pe[fr]=yr;hi=wi-1}}for(var Ni=0,pr=Ee;Ni<He;++Ni){var Ji=Pe[Ni];pr=="L"&&Ji=="1"?Pe[Ni]="L":k.test(Ji)&&(pr=Ji)}for(var Gi=0;Gi<He;++Gi)if(o.test(Pe[Gi])){var Ui=void 0;for(Ui=Gi+1;Ui<He&&o.test(Pe[Ui]);++Ui);for(var Li=(Gi?Pe[Gi-1]:Ee)=="L",mr=(Ui<He?Pe[Ui]:Ee)=="L",Ua=Li==mr?Li?"L":"R":Ee,ca=Gi;ca<Ui;++ca)Pe[ca]=Ua;Gi=Ui-1}for(var tr=[],Hr,Vi=0;Vi<He;)if(z.test(Pe[Vi])){var ps=Vi;for(++Vi;Vi<He&&z.test(Pe[Vi]);++Vi);tr.push(new $(0,ps,Vi))}else{var qr=Vi,va=tr.length,ya=me=="rtl"?1:0;for(++Vi;Vi<He&&Pe[Vi]!="L";++Vi);for(var ur=qr;ur<Vi;)if(Q.test(Pe[ur])){qr<ur&&(tr.splice(va,0,new $(1,qr,ur)),va+=ya);var Ba=ur;for(++ur;ur<Vi&&Q.test(Pe[ur]);++ur);tr.splice(va,0,new $(2,Ba,ur)),va+=ya,qr=ur}else++ur;qr<Vi&&tr.splice(va,0,new $(1,qr,Vi))}return me=="ltr"&&(tr[0].level==1&&(Hr=ne.match(/^\s+/))&&(tr[0].from=Hr[0].length,tr.unshift(new $(0,0,Hr[0].length))),Se(tr).level==1&&(Hr=ne.match(/\s+$/))&&(Se(tr).to-=Hr[0].length,tr.push(new $(0,He-Hr[0].length,He)))),me=="rtl"?tr.reverse():tr}}();function Ot(e,t){var i=e.order;return i==null&&(i=e.order=Vt(e.text,t)),i}var Rt=[],Ve=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Rt).concat(i)}};function Xt(e,t){return e._handlers&&e._handlers[t]||Rt}function At(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,o=n&&n[t];if(o){var k=se(o,i);k>-1&&(n[t]=o.slice(0,k).concat(o.slice(k+1)))}}}function ze(e,t){var i=Xt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),o=0;o<i.length;++o)i[o].apply(null,n)}function at(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ze(e,i||t.type,e,t),he(t)||t.codemirrorIgnore}function Ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)se(i,t[n])==-1&&i.push(t[n])}function _e(e,t){return Xt(e,t).length>0}function xe(e){e.prototype.on=function(t,i){Ve(this,t,i)},e.prototype.off=function(t,i){At(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function he(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function be(e){re(e),ae(e)}function Te(e){return e.target||e.srcElement}function ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var Ne=function(){if(K&&H<9)return!1;var e=l("div");return"draggable"in e||"dragDrop"in e}(),lt;function ft(e){if(lt==null){var t=l("span","\u200B");b(e,l("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(lt=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&H<8))}var i=lt?l("span","\u200B"):l("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ge;function bt(e){if(Ge!=null)return Ge;var t=b(e,document.createTextNode("A\u062EA")),i=h(t,0,1).getBoundingClientRect(),n=h(t,1,2).getBoundingClientRect();return E(e),!i||i.left==i.right?!1:Ge=n.right-i.right<3}var nt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var o=e.indexOf(`
|
|
`,t);o==-1&&(o=e.length);var k=e.slice(t,e.charAt(o-1)=="\r"?o-1:o),z=k.indexOf("\r");z!=-1?(i.push(k.slice(0,z)),t+=z+1):(i.push(k),t=o+1)}return i}:function(e){return e.split(/\r\n?|\n/)},je=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ft=function(){var e=l("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ie=null;function Zt(e){if(Ie!=null)return Ie;var t=b(e,l("span","x")),i=t.getBoundingClientRect(),n=h(t,0,1).getBoundingClientRect();return Ie=Math.abs(i.left-n.left)>1}var Gt={},wt={};function St(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Gt[e]=t}function en(e,t){wt[e]=t}function Qe(e){if(typeof e=="string"&&wt.hasOwnProperty(e))e=wt[e];else if(e&&typeof e.name=="string"&&wt.hasOwnProperty(e.name)){var t=wt[e.name];typeof t=="string"&&(t={name:t}),e=xt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Qe("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Qe("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function It(e,t){t=Qe(t);var i=Gt[t.name];if(!i)return It(e,"text/plain");var n=i(e,t);if(Wt.hasOwnProperty(t.name)){var o=Wt[t.name];for(var k in o){if(!o.hasOwnProperty(k))continue;n.hasOwnProperty(k)&&(n["_"+k]=n[k]),n[k]=o[k]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var z in t.modeProps)n[z]=t.modeProps[z];return n}var Wt={};function Jt(e,t){var i=Wt.hasOwnProperty(e)?Wt[e]:Wt[e]={};A(t,i)}function tn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),i[n]=o}return i}function Tt(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function ln(e,t,i){return e.startState?e.startState(t,i):!0}var Ht=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Ht.prototype.eol=function(){return this.pos>=this.string.length},Ht.prototype.sol=function(){return this.pos==this.lineStart},Ht.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ht.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ht.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Ht.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ht.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ht.prototype.skipToEnd=function(){this.pos=this.string.length},Ht.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ht.prototype.backUp=function(e){this.pos-=e},Ht.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=J(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},Ht.prototype.indentation=function(){return J(this.string,null,this.tabSize)-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},Ht.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(z){return i?z.toLowerCase():z},o=this.string.substr(this.pos,e.length);if(n(o)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var k=this.string.slice(this.pos).match(e);return k&&k.index>0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},Ht.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ht.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ht.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ht.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Et(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var o=i.children[n],k=o.chunkSize();if(t<k){i=o;break}t-=k}return i.lines[t]}function fn(e,t,i){var n=[],o=t.line;return e.iter(t.line,i.line+1,function(k){var z=k.text;o==i.line&&(z=z.slice(0,i.ch)),o==t.line&&(z=z.slice(t.ch)),n.push(z),++o}),n}function nn(e,t,i){var n=[];return e.iter(t,i,function(o){n.push(o.text)}),n}function rn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Yt(e){if(e.parent==null)return null;for(var t=e.parent,i=se(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var o=0;!(n.children[o]==t);++o)i+=n.children[o].chunkSize();return i+t.first}function Ln(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var o=e.children[n],k=o.height;if(t<k){e=o;continue e}t-=k,i+=o.chunkSize()}return i}while(!e.lines);for(var z=0;z<e.lines.length;++z){var Q=e.lines[z],$=Q.height;if(t<$)break;t-=$}return i+z}function Xn(e,t){return t>=e.first&&t<e.first+e.size}function Kn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function $e(e,t,i){if(i===void 0&&(i=null),!(this instanceof $e))return new $e(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Kt(e,t){return e.line-t.line||e.ch-t.ch}function zn(e,t){return e.sticky==t.sticky&&Kt(e,t)==0}function bn(e){return $e(e.line,e.ch)}function pn(e,t){return Kt(e,t)<0?t:e}function Mn(e,t){return Kt(e,t)<0?e:t}function G(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function v(e,t){if(t.line<e.first)return $e(e.first,0);var i=e.first+e.size-1;return t.line>i?$e(i,Et(e,i).text.length):S(t,Et(e,t.line).text.length)}function S(e,t){var i=e.ch;return i==null||i>t?$e(e.line,t):i<0?$e(e.line,0):e}function B(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=v(e,t[n]);return i}var q=function(e,t){this.state=e,this.lookAhead=t},W=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};W.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},W.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},W.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},W.fromSaved=function(e,t,i){return t instanceof q?new W(e,tn(e.mode,t.state),i,t.lookAhead):new W(e,tn(e.mode,t),i)},W.prototype.save=function(e){var t=e!==!1?tn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new q(t,this.maxLookAhead):t};function ue(e,t,i,n){var o=[e.state.modeGen],k={};yn(e,t.text,e.doc.mode,i,function(ne,me){return o.push(ne,me)},k,n);for(var z=i.state,Q=function(ne){i.baseTokens=o;var me=e.state.overlays[ne],Ee=1,He=0;i.state=!0,yn(e,t.text,me.mode,i,function(Pe,Ze){for(var ut=Ee;He<Pe;){var yt=o[Ee];yt>Pe&&o.splice(Ee,1,Pe,o[Ee+1],yt),Ee+=2,He=Math.min(Pe,yt)}if(!Ze)return;if(me.opaque)o.splice(ut,Ee-ut,Pe,"overlay "+Ze),Ee=ut+2;else for(;ut<Ee;ut+=2){var kt=o[ut+1];o[ut+1]=(kt?kt+" ":"")+"overlay "+Ze}},k),i.state=z,i.baseTokens=null,i.baseTokenPos=1},$=0;$<e.state.overlays.length;++$)Q($);return{styles:o,classes:k.bgClass||k.textClass?k:null}}function We(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ye(e,Yt(t)),o=t.text.length>e.options.maxHighlightLength&&tn(e.doc.mode,n.state),k=ue(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ye(e,t,i){var n=e.doc,o=e.display;if(!n.mode.startState)return new W(n,!0,t);var k=Nt(e,t,i),z=k>n.first&&Et(n,k-1).stateAfter,Q=z?W.fromSaved(n,z,k):new W(n,ln(n.mode),k);return n.iter(k,t,function($){Lt(e,$.text,Q);var ne=Q.line;$.stateAfter=ne==t-1||ne%5==0||ne>=o.viewFrom&&ne<o.viewTo?Q.save():null,Q.nextLine()}),i&&(n.modeFrontier=Q.line),Q}function Lt(e,t,i,n){var o=e.doc.mode,k=new Ht(t,e.options.tabSize,i);for(k.start=k.pos=n||0,t==""&&Ke(o,i.state);!k.eol();)gt(o,k,i.state),k.start=k.pos}function Ke(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Tt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function gt(e,t,i,n){for(var o=0;o<10;o++){n&&(n[0]=Tt(e,i).mode);var k=e.token(t,i);if(t.pos>t.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var an=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Hn(e,t,i,n){var o=e.doc,k=o.mode,z;t=v(o,t);var Q=Et(o,t.line),$=Ye(e,t.line,i),ne=new Ht(Q.text,e.options.tabSize,$),me;for(n&&(me=[]);(n||ne.pos<t.ch)&&!ne.eol();)ne.start=ne.pos,z=gt(k,ne,$.state),n&&me.push(new an(ne,z,tn(o.mode,$.state)));return n?me:new an(ne,z,$.state)}function qn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function yn(e,t,i,n,o,k,z){var Q=i.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var $=0,ne=null,me=new Ht(t,e.options.tabSize,n),Ee,He=e.options.addModeClass&&[null];for(t==""&&qn(Ke(i,n.state),k);!me.eol();){if(me.pos>e.options.maxHighlightLength?(Q=!1,z&&Lt(e,t,n,me.pos),me.pos=t.length,Ee=null):Ee=qn(gt(i,me,n.state,He),k),He){var Pe=He[0].name;Pe&&(Ee="m-"+(Ee?Pe+" "+Ee:Pe))}if(!Q||ne!=Ee){for(;$<me.start;)$=Math.min(me.start,$+5e3),o($,ne);ne=Ee}me.start=me.pos}for(;$<me.pos;){var Ze=Math.min(me.pos,$+5e3);o(Ze,ne),$=Ze}}function Nt(e,t,i){for(var n,o,k=e.doc,z=i?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>z;--Q){if(Q<=k.first)return k.first;var $=Et(k,Q-1),ne=$.stateAfter;if(ne&&(!i||Q+(ne instanceof q?ne.lookAhead:0)<=k.modeFrontier))return Q;var me=J($.text,null,e.options.tabSize);(o==null||n>me)&&(o=Q-1,n=me)}return o}function jt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var o=Et(e,n).stateAfter;if(o&&(!(o instanceof q)||n+o.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var un=!1,cn=!1;function xn(){un=!0}function $n(){cn=!0}function mn(e,t,i){this.marker=e,this.from=t,this.to=i}function ci(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function cr(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function gr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function _r(e,t,i){var n;if(e)for(var o=0;o<e.length;++o){var k=e[o],z=k.marker,Q=k.from==null||(z.inclusiveLeft?k.from<=t:k.from<t);if(Q||k.from==t&&z.type=="bookmark"&&(!i||!k.marker.insertLeft)){var $=k.to==null||(z.inclusiveRight?k.to>=t:k.to>t);(n||(n=[])).push(new mn(z,k.from,$?null:k.to))}}return n}function Wr(e,t,i){var n;if(e)for(var o=0;o<e.length;++o){var k=e[o],z=k.marker,Q=k.to==null||(z.inclusiveRight?k.to>=t:k.to>t);if(Q||k.from==t&&z.type=="bookmark"&&(!i||k.marker.insertLeft)){var $=k.from==null||(z.inclusiveLeft?k.from<=t:k.from<t);(n||(n=[])).push(new mn(z,$?null:k.from-t,k.to==null?null:k.to-t))}}return n}function fi(e,t){if(t.full)return null;var i=Xn(e,t.from.line)&&Et(e,t.from.line).markedSpans,n=Xn(e,t.to.line)&&Et(e,t.to.line).markedSpans;if(!i&&!n)return null;var o=t.from.ch,k=t.to.ch,z=Kt(t.from,t.to)==0,Q=_r(i,o,z),$=Wr(n,k,z),ne=t.text.length==1,me=Se(t.text).length+(ne?o:0);if(Q)for(var Ee=0;Ee<Q.length;++Ee){var He=Q[Ee];if(He.to==null){var Pe=ci($,He.marker);Pe?ne&&(He.to=Pe.to==null?null:Pe.to+me):He.to=o}}if($)for(var Ze=0;Ze<$.length;++Ze){var ut=$[Ze];if(ut.to!=null&&(ut.to+=me),ut.from==null){var yt=ci(Q,ut.marker);yt||(ut.from=me,ne&&(Q||(Q=[])).push(ut))}else ut.from+=me,ne&&(Q||(Q=[])).push(ut)}Q&&(Q=Di(Q)),$&&$!=Q&&($=Di($));var kt=[Q];if(!ne){var zt=t.text.length-2,Mt;if(zt>0&&Q)for(var Qt=0;Qt<Q.length;++Qt)Q[Qt].to==null&&(Mt||(Mt=[])).push(new mn(Q[Qt].marker,null,null));for(var vn=0;vn<zt;++vn)kt.push(Mt);kt.push($)}return kt}function Di(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function dr(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(Pe){if(Pe.markedSpans)for(var Ze=0;Ze<Pe.markedSpans.length;++Ze){var ut=Pe.markedSpans[Ze].marker;ut.readOnly&&(!n||se(n,ut)==-1)&&(n||(n=[])).push(ut)}}),!n)return null;for(var o=[{from:t,to:i}],k=0;k<n.length;++k)for(var z=n[k],Q=z.find(0),$=0;$<o.length;++$){var ne=o[$];if(Kt(ne.to,Q.from)<0||Kt(ne.from,Q.to)>0)continue;var me=[$,1],Ee=Kt(ne.from,Q.from),He=Kt(ne.to,Q.to);(Ee<0||!z.inclusiveLeft&&!Ee)&&me.push({from:ne.from,to:Q.from}),(He>0||!z.inclusiveRight&&!He)&&me.push({from:Q.to,to:ne.to}),o.splice.apply(o,me),$+=me.length-3}return o}function Gr(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Ar(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function ai(e){return e.inclusiveLeft?-1:0}function Un(e){return e.inclusiveRight?1:0}function pi(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),o=t.find(),k=Kt(n.from,o.from)||ai(e)-ai(t);if(k)return-k;var z=Kt(n.to,o.to)||Un(e)-Un(t);return z||t.id-e.id}function _n(e,t){var i=cn&&e.markedSpans,n;if(i)for(var o=void 0,k=0;k<i.length;++k)o=i[k],o.marker.collapsed&&(t?o.from:o.to)==null&&(!n||pi(n,o.marker)<0)&&(n=o.marker);return n}function mi(e){return _n(e,!0)}function Jn(e){return _n(e,!1)}function nr(e,t){var i=cn&&e.markedSpans,n;if(i)for(var o=0;o<i.length;++o){var k=i[o];k.marker.collapsed&&(k.from==null||k.from<t)&&(k.to==null||k.to>t)&&(!n||pi(n,k.marker)<0)&&(n=k.marker)}return n}function Si(e,t,i,n,o){var k=Et(e,t),z=cn&&k.markedSpans;if(z)for(var Q=0;Q<z.length;++Q){var $=z[Q];if(!$.marker.collapsed)continue;var ne=$.marker.find(0),me=Kt(ne.from,i)||ai($.marker)-ai(o),Ee=Kt(ne.to,n)||Un($.marker)-Un(o);if(me>=0&&Ee<=0||me<=0&&Ee>=0)continue;if(me<=0&&($.marker.inclusiveRight&&o.inclusiveLeft?Kt(ne.to,i)>=0:Kt(ne.to,i)>0)||me>=0&&($.marker.inclusiveRight&&o.inclusiveLeft?Kt(ne.from,n)<=0:Kt(ne.from,n)<0))return!0}}function Pi(e){for(var t;t=mi(e);)e=t.find(-1,!0).line;return e}function Kr(e){for(var t;t=Jn(e);)e=t.find(1,!0).line;return e}function Qi(e){for(var t,i;t=Jn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Sr(e,t){var i=Et(e,t),n=Pi(i);return i==n?t:Yt(n)}function ir(e,t){if(t>e.lastLine())return t;var i=Et(e,t),n;if(!Zi(e,i))return t;for(;n=Jn(i);)i=n.find(1,!0).line;return Yt(i)+1}function Zi(e,t){var i=cn&&t.markedSpans;if(i)for(var n=void 0,o=0;o<i.length;++o){if(n=i[o],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&zr(e,t,n))return!0}}function zr(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return zr(e,n.line,ci(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var o=void 0,k=0;k<t.markedSpans.length;++k)if(o=t.markedSpans[k],o.marker.collapsed&&!o.marker.widgetNode&&o.from==i.to&&(o.to==null||o.to!=i.from)&&(o.marker.inclusiveLeft||i.marker.inclusiveRight)&&zr(e,t,o))return!0}function gi(e){e=Pi(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var o=i.lines[n];if(o==e)break;t+=o.height}for(var k=i.parent;k;i=k,k=i.parent)for(var z=0;z<k.children.length;++z){var Q=k.children[z];if(Q==i)break;t+=Q.height}return t}function Vn(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=mi(n);){var o=i.find(0,!0);n=o.from.line,t+=o.from.ch-o.to.ch}for(n=e;i=Jn(n);){var k=i.find(0,!0);t-=n.text.length-k.from.ch,n=k.to.line,t+=n.text.length-k.to.ch}return t}function Ci(e){var t=e.display,i=e.doc;t.maxLine=Et(i,i.first),t.maxLineLength=Vn(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var o=Vn(n);o>t.maxLineLength&&(t.maxLineLength=o,t.maxLine=n)})}var Ti=function(e,t,i){this.text=e,Ar(this,t),this.height=i?i(this):1};Ti.prototype.lineNo=function(){return Yt(this)},xe(Ti);function qi(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Gr(e),Ar(e,i);var o=n?n(e):1;o!=e.height&&rn(e,o)}function Ut(e){e.parent=null,Gr(e)}var dn={},$t={};function On(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?$t:dn;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Wn(e,t){var i=_("span",null,null,P?"padding-right: .1px":null),n={pre:_("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var k=o?t.rest[o-1]:t.line,z=void 0;n.pos=0,n.addToken=Bn,bt(e.display.measure)&&(z=Ot(k,e.doc.direction))&&(n.addToken=rr(n.addToken,z)),n.map=[];var Q=t!=e.display.externalMeasured&&Yt(k);Or(k,n,We(e,k,Q)),k.styleClasses&&(k.styleClasses.bgClass&&(n.bgClass=V(k.styleClasses.bgClass,n.bgClass||"")),k.styleClasses.textClass&&(n.textClass=V(k.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(ft(e.display.measure))),o==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(P){var $=n.content.lastChild;(/\bcm-tab\b/.test($.className)||$.querySelector&&$.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ze(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=V(n.pre.className,n.textClass||"")),n}function ti(e){var t=l("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Bn(e,t,i,n,o,k,z){if(!t)return;var Q=e.splitSpaces?Ai(t,e.trailingSpace):t,$=e.cm.state.specialChars,ne=!1,me;if(!$.test(t))e.col+=t.length,me=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,me),K&&H<9&&(ne=!0),e.pos+=t.length;else{me=document.createDocumentFragment();for(var Ee=0;;){$.lastIndex=Ee;var He=$.exec(t),Pe=He?He.index-Ee:t.length-Ee;if(Pe){var Ze=document.createTextNode(Q.slice(Ee,Ee+Pe));K&&H<9?me.appendChild(l("span",[Ze])):me.appendChild(Ze),e.map.push(e.pos,e.pos+Pe,Ze),e.col+=Pe,e.pos+=Pe}if(!He)break;Ee+=Pe+1;var ut=void 0;if(He[0]==" "){var yt=e.cm.options.tabSize,kt=yt-e.col%yt;ut=me.appendChild(l("span",le(kt),"cm-tab")),ut.setAttribute("role","presentation"),ut.setAttribute("cm-text"," "),e.col+=kt}else He[0]=="\r"||He[0]==`
|
|
`?(ut=me.appendChild(l("span",He[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ut.setAttribute("cm-text",He[0]),e.col+=1):(ut=e.cm.options.specialCharPlaceholder(He[0]),ut.setAttribute("cm-text",He[0]),K&&H<9?me.appendChild(l("span",[ut])):me.appendChild(ut),e.col+=1);e.map.push(e.pos,e.pos+1,ut),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,i||n||o||ne||k||z){var zt=i||"";n&&(zt+=n),o&&(zt+=o);var Mt=l("span",[me],zt,k);if(z)for(var Qt in z)z.hasOwnProperty(Qt)&&Qt!="style"&&Qt!="class"&&Mt.setAttribute(Qt,z[Qt]);return e.content.appendChild(Mt)}e.content.appendChild(me)}function Ai(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",o=0;o<e.length;o++){var k=e.charAt(o);k==" "&&i&&(o==e.length-1||e.charCodeAt(o+1)==32)&&(k="\xA0"),n+=k,i=k==" "}return n}function rr(e,t){return function(i,n,o,k,z,Q,$){o=o?o+" cm-force-border":"cm-force-border";for(var ne=i.pos,me=ne+n.length;;){for(var Ee=void 0,He=0;He<t.length&&!(Ee=t[He],Ee.to>ne&&Ee.from<=ne);He++);if(Ee.to>=me)return e(i,n,o,k,z,Q,$);e(i,n.slice(0,Ee.to-ne),o,k,null,Q,$),k=null,n=n.slice(Ee.to-ne),ne=Ee.to}}}function Dn(e,t,i,n){var o=!n&&i.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",i.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function Or(e,t,i){var n=e.markedSpans,o=e.text,k=0;if(!n){for(var z=1;z<i.length;z+=2)t.addToken(t,o.slice(k,k=i[z]),On(i[z+1],t.cm.options));return}for(var Q=o.length,$=0,ne=1,me="",Ee,He,Pe=0,Ze,ut,yt,kt,zt;;){if(Pe==$){Ze=ut=yt=He="",zt=null,kt=null,Pe=Infinity;for(var Mt=[],Qt=void 0,vn=0;vn<n.length;++vn){var sn=n[vn],Rn=sn.marker;if(Rn.type=="bookmark"&&sn.from==$&&Rn.widgetNode)Mt.push(Rn);else if(sn.from<=$&&(sn.to==null||sn.to>$||Rn.collapsed&&sn.to==$&&sn.from==$)){if(sn.to!=null&&sn.to!=$&&Pe>sn.to&&(Pe=sn.to,ut=""),Rn.className&&(Ze+=" "+Rn.className),Rn.css&&(He=(He?He+";":"")+Rn.css),Rn.startStyle&&sn.from==$&&(yt+=" "+Rn.startStyle),Rn.endStyle&&sn.to==Pe&&(Qt||(Qt=[])).push(Rn.endStyle,sn.to),Rn.title&&((zt||(zt={})).title=Rn.title),Rn.attributes)for(var hi in Rn.attributes)(zt||(zt={}))[hi]=Rn.attributes[hi];Rn.collapsed&&(!kt||pi(kt.marker,Rn)<0)&&(kt=sn)}else sn.from>$&&Pe>sn.from&&(Pe=sn.from)}if(Qt)for(var zi=0;zi<Qt.length;zi+=2)Qt[zi+1]==Pe&&(ut+=" "+Qt[zi]);if(!kt||kt.from==$)for(var wi=0;wi<Mt.length;++wi)Dn(t,0,Mt[wi]);if(kt&&(kt.from||0)==$){if(Dn(t,(kt.to==null?Q+1:kt.to)-$,kt.marker,kt.from==null),kt.to==null)return;kt.to==$&&(kt=!1)}}if($>=Q)break;for(var yr=Math.min(Q,Pe);;){if(me){var fr=$+me.length;if(!kt){var Ni=fr>yr?me.slice(0,yr-$):me;t.addToken(t,Ni,Ee?Ee+Ze:Ze,yt,$+Ni.length==Pe?ut:"",He,zt)}if(fr>=yr){me=me.slice(yr-$),$=yr;break}$=fr,yt=""}me=o.slice(k,k=i[ne++]),Ee=On(i[ne++],t.cm.options)}}}function Qn(e,t,i){this.line=t,this.rest=Qi(t),this.size=this.rest?Yt(Se(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Zi(e,t)}function Xi(e,t,i){for(var n=[],o,k=t;k<i;k=o){var z=new Qn(e.doc,Et(e.doc,k),k);o=k+z.size,n.push(z)}return n}var Ki=null;function vr(e){Ki?Ki.ops.push(e):e.ownsGroup=Ki={ops:[e],delayedCallbacks:[]}}function Fa(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var o=e.ops[n];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(i<t.length)}function Go(e,t){var i=e.ownsGroup;if(!i)return;try{Fa(i)}finally{Ki=null,t(i)}}var $r=null;function Oi(e,t){var i=Xt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),o;Ki?o=Ki.delayedCallbacks:$r?o=$r:(o=$r=[],setTimeout(go,0));for(var k=function(Q){o.push(function(){return i[Q].apply(null,n)})},z=0;z<i.length;++z)k(z)}function go(){var e=$r;$r=null;for(var t=0;t<e.length;++t)e[t]()}function vo(e,t,i,n){for(var o=0;o<t.changes.length;o++){var k=t.changes[o];k=="text"?yo(e,t):k=="gutter"?Wa(e,t,i,n):k=="class"?Ha(e,t):k=="widget"&&zo(e,t,n)}t.changes=null}function da(e){return e.node==e.text&&(e.node=l("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&H<8&&(e.node.style.zIndex=2)),e.node}function Ko(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=da(t);t.background=n.insertBefore(l("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function ja(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Wn(e,t)}function yo(e,t){var i=t.text.className,n=ja(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Ha(e,t)):i&&(t.text.className=i)}function Ha(e,t){Ko(e,t),t.line.wrapClass?da(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Wa(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=da(t);t.gutterBackground=l("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var k=t.line.gutterMarkers;if(e.options.lineNumbers||k){var z=da(t),Q=t.gutter=l("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),z.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!k||!k["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(l("div",Kn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),k)for(var $=0;$<e.display.gutterSpecs.length;++$){var ne=e.display.gutterSpecs[$].className,me=k.hasOwnProperty(ne)&&k[ne];me&&Q.appendChild(l("div",[me],"CodeMirror-gutter-elt","left: "+n.gutterLeft[ne]+"px; width: "+n.gutterWidth[ne]+"px"))}}}function zo(e,t,i){t.alignable&&(t.alignable=null);for(var n=O("CodeMirror-linewidget"),o=t.node.firstChild,k=void 0;o;o=k)k=o.nextSibling,n.test(o.className)&&t.node.removeChild(o);Ga(e,t,i)}function _o(e,t,i,n){var o=ja(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),Ha(e,t),Wa(e,t,i,n),Ga(e,t,n),t.node}function Ga(e,t,i){if(bo(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)bo(e,t.rest[n],t,i,!1)}function bo(e,t,i,n,o){if(!t.widgets)return;for(var k=da(i),z=0,Q=t.widgets;z<Q.length;++z){var $=Q[z],ne=l("div",[$.node],"CodeMirror-linewidget"+($.className?" "+$.className:""));$.handleMouseEvents||ne.setAttribute("cm-ignore-events","true"),Vo($,ne,i,n),e.display.input.setUneditable(ne),o&&$.above?k.insertBefore(ne,i.gutter||i.text):k.appendChild(ne),Oi($,"redraw")}}function Vo(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var o=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(o-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function ea(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!g(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),b(t.display.measure,l("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Rr(e,t){for(var i=Te(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Ka(e){return e.lineSpace.offsetTop}function de(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function we(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=b(e.measure,l("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Oe(e){return fe-e.display.nativeBarWidth}function pe(e){return e.display.scroller.clientWidth-Oe(e)-e.display.barWidth}function ee(e){return e.display.scroller.clientHeight-Oe(e)-e.display.barHeight}function ce(e,t,i){var n=e.options.lineWrapping,o=n&&pe(e);if(!t.measure.heights||n&&t.measure.width!=o){var k=t.measure.heights=[];if(n){t.measure.width=o;for(var z=t.text.firstChild.getClientRects(),Q=0;Q<z.length-1;Q++){var $=z[Q],ne=z[Q+1];Math.abs($.bottom-ne.bottom)>2&&k.push(($.bottom+ne.top)/2-i.top)}}k.push(i.bottom-i.top)}}function ie(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var o=0;o<e.rest.length;o++)if(Yt(e.rest[o])>i)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function ge(e,t){t=Pi(t);var i=Yt(t),n=e.display.externalMeasured=new Qn(e.doc,t,i);n.lineN=i;var o=n.built=Wn(e,n);return n.text=o.pre,b(e.display.lineMeasure,o.pre),n}function ve(e,t,i,n){return Be(e,Ce(e,t),i,n)}function Le(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[di(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Ce(e,t){var i=Yt(t),n=Le(e,i);n&&!n.text?n=null:n&&n.changes&&(vo(e,n,i,bi(e)),e.curOp.forceUpdate=!0),n||(n=ge(e,t));var o=ie(n,t,i);return{line:t,view:n,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Be(e,t,i,n,o){t.before&&(i=-1);var k=i+(n||""),z;return t.cache.hasOwnProperty(k)?z=t.cache[k]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ce(e,t.view,t.rect),t.hasHeights=!0),z=Dt(e,t,i,n),z.bogus||(t.cache[k]=z)),{left:z.left,right:z.right,top:o?z.rtop:z.top,bottom:o?z.rbottom:z.bottom}}var Je={left:0,right:0,top:0,bottom:0};function mt(e,t,i){for(var n,o,k,z,Q,$,ne=0;ne<e.length;ne+=3)if(Q=e[ne],$=e[ne+1],t<Q?(o=0,k=1,z="left"):t<$?(o=t-Q,k=o+1):(ne==e.length-3||t==$&&e[ne+3]>t)&&(k=$-Q,o=k-1,t>=$&&(z="right")),o!=null){if(n=e[ne+2],Q==$&&i==(n.insertLeft?"left":"right")&&(z=i),i=="left"&&o==0)for(;ne&&e[ne-2]==e[ne-3]&&e[ne-1].insertLeft;)n=e[(ne-=3)+2],z="left";if(i=="right"&&o==$-Q)for(;ne<e.length-3&&e[ne+3]==e[ne+4]&&!e[ne+5].insertLeft;)n=e[(ne+=3)+2],z="right";break}return{node:n,start:o,end:k,collapse:z,coverStart:Q,coverEnd:$}}function pt(e,t){var i=Je;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var o=e.length-1;o>=0&&!((i=e[o]).left!=i.right);o--);return i}function Dt(e,t,i,n){var o=mt(t.map,i,n),k=o.node,z=o.start,Q=o.end,$=o.collapse,ne;if(k.nodeType==3){for(var me=0;me<4;me++){for(;z&&tt(t.line.text.charAt(o.coverStart+z));)--z;for(;o.coverStart+Q<o.coverEnd&&tt(t.line.text.charAt(o.coverStart+Q));)++Q;if(K&&H<9&&z==0&&Q==o.coverEnd-o.coverStart?ne=k.parentNode.getBoundingClientRect():ne=pt(h(k,z,Q).getClientRects(),n),ne.left||ne.right||z==0)break;Q=z,z=z-1,$="right"}K&&H<11&&(ne=gn(e.display.measure,ne))}else{z>0&&($=n="right");var Ee;e.options.lineWrapping&&(Ee=k.getClientRects()).length>1?ne=Ee[n=="right"?Ee.length-1:0]:ne=k.getBoundingClientRect()}if(K&&H<9&&!z&&(!ne||!ne.left&&!ne.right)){var He=k.parentNode.getClientRects()[0];He?ne={left:He.left,right:He.left+Bi(e.display),top:He.top,bottom:He.bottom}:ne=Je}for(var Pe=ne.top-t.rect.top,Ze=ne.bottom-t.rect.top,ut=(Pe+Ze)/2,yt=t.view.measure.heights,kt=0;kt<yt.length-1&&!(ut<yt[kt]);kt++);var zt=kt?yt[kt-1]:0,Mt=yt[kt],Qt={left:($=="right"?ne.right:ne.left)-t.rect.left,right:($=="left"?ne.left:ne.right)-t.rect.left,top:zt,bottom:Mt};return!ne.left&&!ne.right&&(Qt.bogus=!0),e.options.singleCursorHeightPerLine||(Qt.rtop=Pe,Qt.rbottom=Ze),Qt}function gn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Zt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function Cn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function En(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Cn(e.display.view[t])}function Tn(e){En(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function An(){return y&&s?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Sn(){return y&&s?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function wn(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=ea(e.widgets[i]));return t}function Fn(e,t,i,n,o){if(!o){var k=wn(t);i.top+=k,i.bottom+=k}if(n=="line")return i;n||(n="local");var z=gi(t);if(n=="local"?z+=Ka(e.display):z-=e.display.viewOffset,n=="page"||n=="window"){var Q=e.display.lineSpace.getBoundingClientRect();z+=Q.top+(n=="window"?0:Sn());var $=Q.left+(n=="window"?0:An());i.left+=$,i.right+=$}return i.top+=z,i.bottom+=z,i}function In(e,t,i){if(i=="div")return t;var n=t.left,o=t.top;if(i=="page")n-=An(),o-=Sn();else if(i=="local"||!i){var k=e.display.sizer.getBoundingClientRect();n+=k.left,o+=k.top}var z=e.display.lineSpace.getBoundingClientRect();return{left:n-z.left,top:o-z.top}}function vi(e,t,i,n,o){return n||(n=Et(e.doc,t.line)),Fn(e,n,ve(e,n,t.ch,o),i)}function kn(e,t,i,n,o,k){n=n||Et(e.doc,t.line),o||(o=Ce(e,n));function z(Ze,ut){var yt=Be(e,o,Ze,ut?"right":"left",k);return ut?yt.left=yt.right:yt.right=yt.left,Fn(e,n,yt,i)}var Q=Ot(n,e.doc.direction),$=t.ch,ne=t.sticky;if($>=n.text.length?($=n.text.length,ne="before"):$<=0&&($=0,ne="after"),!Q)return z(ne=="before"?$-1:$,ne=="before");function me(Ze,ut,yt){var kt=Q[ut],zt=kt.level==1;return z(yt?Ze-1:Ze,zt!=yt)}var Ee=_t(Q,$,ne),He=Ct,Pe=me($,Ee,ne=="before");return He!=null&&(Pe.other=me($,He,ne!="before")),Pe}function hn(e,t){var i=0;t=v(e.doc,t),e.options.lineWrapping||(i=Bi(e.display)*t.ch);var n=Et(e.doc,t.line),o=gi(n)+Ka(e.display);return{left:i,right:i,top:o,bottom:o+n.height}}function on(e,t,i,n,o){var k=$e(e,t,i);return k.xRel=o,n&&(k.outside=n),k}function Pn(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return on(n.first,0,null,-1,-1);var o=Ln(n,i),k=n.first+n.size-1;if(o>k)return on(n.first+n.size-1,Et(n,k).text.length,null,1,1);t<0&&(t=0);for(var z=Et(n,o);;){var Q=yi(e,z,o,t,i),$=nr(z,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!$)return Q;var ne=$.find(1);if(ne.line==o)return ne;z=Et(n,o=ne.line)}}function jn(e,t,i,n){n-=wn(t);var o=t.text.length,k=Bt(function(z){return Be(e,i,z-1).bottom<=n},o,0);return o=Bt(function(z){return Be(e,i,z).top>n},k,o),{begin:k,end:o}}function qt(e,t,i,n){i||(i=Ce(e,t));var o=Fn(e,t,Be(e,i,n),"line").top;return jn(e,t,i,o)}function Gn(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function yi(e,t,i,n,o){o-=gi(t);var k=Ce(e,t),z=wn(t),Q=0,$=t.text.length,ne=!0,me=Ot(t,e.doc.direction);if(me){var Ee=(e.options.lineWrapping?oi:Yn)(e,t,i,k,me,n,o);ne=Ee.level!=1,Q=ne?Ee.from:Ee.to-1,$=ne?Ee.to:Ee.from-1}var He=null,Pe=null,Ze=Bt(function(vn){var sn=Be(e,k,vn);return sn.top+=z,sn.bottom+=z,Gn(sn,n,o,!1)?(sn.top<=o&&sn.left<=n&&(He=vn,Pe=sn),!0):!1},Q,$),ut,yt,kt=!1;if(Pe){var zt=n-Pe.left<Pe.right-n,Mt=zt==ne;Ze=He+(Mt?0:1),yt=Mt?"after":"before",ut=zt?Pe.left:Pe.right}else{!ne&&(Ze==$||Ze==Q)&&Ze++,yt=Ze==0?"after":Ze==t.text.length?"before":Be(e,k,Ze-(ne?1:0)).bottom+z<=o==ne?"after":"before";var Qt=kn(e,$e(i,Ze,yt),"line",t,k);ut=Qt.left,kt=o<Qt.top?-1:o>=Qt.bottom?1:0}return Ze=rt(t.text,Ze,1),on(i,Ze,yt,kt,n-ut)}function Yn(e,t,i,n,o,k,z){var Q=Bt(function(Ee){var He=o[Ee],Pe=He.level!=1;return Gn(kn(e,$e(i,Pe?He.to:He.from,Pe?"before":"after"),"line",t,n),k,z,!0)},0,o.length-1),$=o[Q];if(Q>0){var ne=$.level!=1,me=kn(e,$e(i,ne?$.from:$.to,ne?"after":"before"),"line",t,n);Gn(me,k,z,!0)&&me.top>z&&($=o[Q-1])}return $}function oi(e,t,i,n,o,k,z){var Q=jn(e,t,n,z),$=Q.begin,ne=Q.end;/\s/.test(t.text.charAt(ne-1))&&ne--;for(var me=null,Ee=null,He=0;He<o.length;He++){var Pe=o[He];if(Pe.from>=ne||Pe.to<=$)continue;var Ze=Pe.level!=1,ut=Be(e,n,Ze?Math.min(ne,Pe.to)-1:Math.max($,Pe.from)).right,yt=ut<k?k-ut+1e9:ut-k;(!me||Ee>yt)&&(me=Pe,Ee=yt)}return me||(me=o[o.length-1]),me.from<$&&(me={from:$,to:me.to,level:me.level}),me.to>ne&&(me={from:me.from,to:ne,level:me.level}),me}var ii;function Ri(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ii==null){ii=l("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ii.appendChild(document.createTextNode("x")),ii.appendChild(l("br"));ii.appendChild(document.createTextNode("x"))}b(e.measure,ii);var i=ii.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),E(e.measure),i||1}function Bi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=l("span","xxxxxxxxxx"),i=l("pre",[t],"CodeMirror-line-like");b(e.measure,i);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function bi(e){for(var t=e.display,i={},n={},o=t.gutters.clientLeft,k=t.gutters.firstChild,z=0;k;k=k.nextSibling,++z){var Q=e.display.gutterSpecs[z].className;i[Q]=k.offsetLeft+k.clientLeft+o,n[Q]=k.clientWidth}return{fixedPos:$i(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function $i(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function br(e){var t=Ri(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Bi(e.display)-3);return function(o){if(Zi(e.doc,o))return 0;var k=0;if(o.widgets)for(var z=0;z<o.widgets.length;z++)o.widgets[z].height&&(k+=o.widgets[z].height);return i?k+(Math.ceil(o.text.length/n)||1)*t:k+t}}function ar(e){var t=e.doc,i=br(e);t.iter(function(n){var o=i(n);o!=n.height&&rn(n,o)})}function Fi(e,t,i,n){var o=e.display;if(!i&&Te(t).getAttribute("cm-not-content")=="true")return null;var k,z,Q=o.lineSpace.getBoundingClientRect();try{k=t.clientX-Q.left,z=t.clientY-Q.top}catch(Ee){return null}var $=Pn(e,k,z),ne;if(n&&$.xRel>0&&(ne=Et(e.doc,$.line).text).length==$.ch){var me=J(ne,ne.length,e.options.tabSize)-ne.length;$=$e($.line,Math.max(0,Math.round((k-we(e.display).left)/Bi(e.display))-me))}return $}function di(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function si(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var o=e.display;if(n&&i<o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)cn&&Sr(e.doc,t)<o.viewTo&&_i(e);else if(i<=o.viewFrom)cn&&ir(e.doc,i+n)>o.viewFrom?_i(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&i>=o.viewTo)_i(e);else if(t<=o.viewFrom){var k=Er(e,i,i+n,1);k?(o.view=o.view.slice(k.index),o.viewFrom=k.lineN,o.viewTo+=n):_i(e)}else if(i>=o.viewTo){var z=Er(e,t,t,-1);z?(o.view=o.view.slice(0,z.index),o.viewTo=z.lineN):_i(e)}else{var Q=Er(e,t,t,-1),$=Er(e,i,i+n,1);Q&&$?(o.view=o.view.slice(0,Q.index).concat(Xi(e,Q.lineN,$.lineN)).concat(o.view.slice($.index)),o.viewTo+=n):_i(e)}var ne=o.externalMeasured;ne&&(i<ne.lineN?ne.lineN+=n:t<ne.lineN+ne.size&&(o.externalMeasured=null))}function Ei(e,t,i){e.curOp.viewChanged=!0;var n=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var k=n.view[di(e,t)];if(k.node==null)return;var z=k.changes||(k.changes=[]);se(z,i)==-1&&z.push(i)}function _i(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Er(e,t,i,n){var o=di(e,t),k,z=e.display.view;if(!cn||i==e.doc.first+e.doc.size)return{index:o,lineN:i};for(var Q=e.display.viewFrom,$=0;$<o;$++)Q+=z[$].size;if(Q!=t){if(n>0){if(o==z.length-1)return null;k=Q+z[o].size-t,o++}else k=Q-t;t+=k,i+=k}for(;Sr(e.doc,i)!=i;){if(o==(n<0?0:z.length-1))return null;i+=n*z[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:i}}function Mr(e,t,i){var n=e.display,o=n.view;o.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Xi(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Xi(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(di(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Xi(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,di(e,i)))),n.viewTo=i}function Pr(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var o=t[n];!o.hidden&&(!o.node||o.changes)&&++i}return i}function ri(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Cr(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},o=n.cursors=document.createDocumentFragment(),k=n.selection=document.createDocumentFragment(),z=0;z<i.sel.ranges.length;z++){if(!t&&z==i.sel.primIndex)continue;var Q=i.sel.ranges[z];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var $=Q.empty();($||e.options.showCursorWhenSelecting)&&Nr(e,Q.head,o),$||ni(e,Q,k)}return n}function Nr(e,t,i){var n=kn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=i.appendChild(l("div","\xA0","CodeMirror-cursor"));if(o.style.left=n.left+"px",o.style.top=n.top+"px",o.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var k=i.appendChild(l("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));k.style.display="",k.style.left=n.other.left+"px",k.style.top=n.other.top+"px",k.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function ui(e,t){return e.top-t.top||e.left-t.left}function ni(e,t,i){var n=e.display,o=e.doc,k=document.createDocumentFragment(),z=we(e.display),Q=z.left,$=Math.max(n.sizerWidth,pe(e)-n.sizer.offsetLeft)-z.right,ne=o.direction=="ltr";function me(Mt,Qt,vn,sn){Qt<0&&(Qt=0),Qt=Math.round(Qt),sn=Math.round(sn),k.appendChild(l("div",null,"CodeMirror-selected","position: absolute; left: "+Mt+`px;
|
|
top: `+Qt+"px; width: "+(vn==null?$-Mt:vn)+`px;
|
|
height: `+(sn-Qt)+"px"))}function Ee(Mt,Qt,vn){var sn=Et(o,Mt),Rn=sn.text.length,hi,zi;function wi(Ni,pr){return vi(e,$e(Mt,Ni),"div",sn,pr)}function yr(Ni,pr,Ji){var Gi=qt(e,sn,null,Ni),Ui=pr=="ltr"==(Ji=="after")?"left":"right",Li=Ji=="after"?Gi.begin:Gi.end-(/\s/.test(sn.text.charAt(Gi.end-1))?2:1);return wi(Li,Ui)[Ui]}var fr=Ot(sn,o.direction);return Pt(fr,Qt||0,vn==null?Rn:vn,function(Ni,pr,Ji,Gi){var Ui=Ji=="ltr",Li=wi(Ni,Ui?"left":"right"),mr=wi(pr-1,Ui?"right":"left"),Ua=Qt==null&&Ni==0,ca=vn==null&&pr==Rn,tr=Gi==0,Hr=!fr||Gi==fr.length-1;if(mr.top-Li.top<=3){var Vi=(ne?Ua:ca)&&tr,ps=(ne?ca:Ua)&&Hr,qr=Vi?Q:(Ui?Li:mr).left,va=ps?$:(Ui?mr:Li).right;me(qr,Li.top,va-qr,Li.bottom)}else{var ya,ur,Ba,ms;Ui?(ya=ne&&Ua&&tr?Q:Li.left,ur=ne?$:yr(Ni,Ji,"before"),Ba=ne?Q:yr(pr,Ji,"after"),ms=ne&&ca&&Hr?$:mr.right):(ya=ne?yr(Ni,Ji,"before"):Q,ur=!ne&&Ua&&tr?$:Li.right,Ba=!ne&&ca&&Hr?Q:mr.left,ms=ne?yr(pr,Ji,"after"):$),me(ya,Li.top,ur-ya,Li.bottom),Li.bottom<mr.top&&me(Q,Li.bottom,null,mr.top),me(Ba,mr.top,ms-Ba,mr.bottom)}(!hi||ui(Li,hi)<0)&&(hi=Li),ui(mr,hi)<0&&(hi=mr),(!zi||ui(Li,zi)<0)&&(zi=Li),ui(mr,zi)<0&&(zi=mr)}),{start:hi,end:zi}}var He=t.from(),Pe=t.to();if(He.line==Pe.line)Ee(He.line,He.ch,Pe.ch);else{var Ze=Et(o,He.line),ut=Et(o,Pe.line),yt=Pi(Ze)==Pi(ut),kt=Ee(He.line,He.ch,yt?Ze.text.length+1:null).end,zt=Ee(Pe.line,yt?0:null,Pe.ch).start;yt&&(kt.top<zt.top-2?(me(kt.right,kt.top,null,kt.bottom),me(Q,zt.top,zt.left,zt.bottom)):me(kt.right,kt.top,zt.left-kt.right,kt.bottom)),kt.bottom<zt.top&&me(Q,kt.bottom,null,zt.top)}i.appendChild(k)}function ji(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||ta(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Eo(e){e.state.focused||(e.display.input.focus(),Ur(e))}function za(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ta(e))},100)}function Ur(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ze(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),P&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ji(e)}function ta(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ze(e,"blur",e,t),e.state.focused=!1,w(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function _a(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var o=t.view[n],k=e.options.lineWrapping,z=void 0,Q=0;if(o.hidden)continue;if(K&&H<8){var $=o.node.offsetTop+o.node.offsetHeight;z=$-i,i=$}else{var ne=o.node.getBoundingClientRect();z=ne.bottom-ne.top,!k&&o.text.firstChild&&(Q=o.text.firstChild.getBoundingClientRect().right-ne.left-1)}var me=o.line.height-z;if((me>.005||me<-.005)&&(rn(o.line,z),Va(o.line),o.rest))for(var Ee=0;Ee<o.rest.length;Ee++)Va(o.rest[Ee]);if(Q>e.display.sizerWidth){var He=Math.ceil(Q/Bi(e.display));He>e.display.maxLineLength&&(e.display.maxLineLength=He,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}function Va(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function ba(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Ka(e));var o=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,k=Ln(t,n),z=Ln(t,o);if(i&&i.ensure){var Q=i.ensure.from.line,$=i.ensure.to.line;Q<k?(k=Q,z=Ln(t,gi(Et(t,Q))+e.wrapper.clientHeight)):Math.min($,t.lastLine())>=z&&(k=Ln(t,gi(Et(t,$))-e.wrapper.clientHeight),z=$)}return{from:k,to:Math.max(z,k+1)}}function Xo(e,t){if(at(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),o=null;if(t.top+n.top<0?o=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),o!=null&&!u){var k=l("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Ka(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Oe(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(o),e.display.lineSpace.removeChild(k)}}function Yo(e,t,i,n){n==null&&(n=0);var o;!e.options.lineWrapping&&t==i&&(t=t.ch?$e(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?$e(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var z=!1,Q=kn(e,t),$=!i||i==t?Q:kn(e,i);o={left:Math.min(Q.left,$.left),top:Math.min(Q.top,$.top)-n,right:Math.max(Q.left,$.left),bottom:Math.max(Q.bottom,$.bottom)+n};var ne=Xa(e,o),me=e.doc.scrollTop,Ee=e.doc.scrollLeft;if(ne.scrollTop!=null&&(ra(e,ne.scrollTop),Math.abs(e.doc.scrollTop-me)>1&&(z=!0)),ne.scrollLeft!=null&&(xr(e,ne.scrollLeft),Math.abs(e.doc.scrollLeft-Ee)>1&&(z=!0)),!z)break}return o}function xo(e,t){var i=Xa(e,t);i.scrollTop!=null&&ra(e,i.scrollTop),i.scrollLeft!=null&&xr(e,i.scrollLeft)}function Xa(e,t){var i=e.display,n=Ri(e.display);t.top<0&&(t.top=0);var o=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,k=ee(e),z={};t.bottom-t.top>k&&(t.bottom=t.top+k);var Q=e.doc.height+de(i),$=t.top<n,ne=t.bottom>Q-n;if(t.top<o)z.scrollTop=$?0:t.top;else if(t.bottom>o+k){var me=Math.min(t.top,(ne?Q:t.bottom)-k);me!=o&&(z.scrollTop=me)}var Ee=e.options.fixedGutter?0:i.gutters.offsetWidth,He=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Ee,Pe=pe(e)-i.gutters.offsetWidth,Ze=t.right-t.left>Pe;return Ze&&(t.right=t.left+Pe),t.left<10?z.scrollLeft=0:t.left<He?z.scrollLeft=Math.max(0,t.left+Ee-(Ze?0:10)):t.right>Pe+He-3&&(z.scrollLeft=t.right+(Ze?0:10)-Pe),z}function Ya(e,t){if(t==null)return;Ea(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function na(e){Ea(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ia(e,t,i){(t!=null||i!=null)&&Ea(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Jo(e,t){Ea(e),e.curOp.scrollToPos=t}function Ea(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=hn(e,t.from),n=hn(e,t.to);ha(e,i,n,t.margin)}}function ha(e,t,i,n){var o=Xa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});ia(e,o.scrollLeft,o.scrollTop)}function ra(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||ma(e,{top:t}),aa(e,t,!0),M&&ma(e),pa(e,100)}function aa(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function xr(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Nn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Vr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+de(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+Oe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Br=function(e,t,i){this.cm=i;var n=this.vert=l("div",[l("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=l("div",[l("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),Ve(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ve(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&H<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Br.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var e=a&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},Br.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var o=e.getBoundingClientRect(),k=i=="vert"?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Br.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var fa=function(){};fa.prototype.update=function(){return{bottom:0,right:0}},fa.prototype.setScrollLeft=function(){},fa.prototype.setScrollTop=function(){},fa.prototype.clear=function(){};function Xr(e,t){t||(t=Vr(e));var i=e.display.barWidth,n=e.display.barHeight;xa(e,t);for(var o=0;o<4&&i!=e.display.barWidth||n!=e.display.barHeight;o++)i!=e.display.barWidth&&e.options.lineWrapping&&_a(e),xa(e,Vr(e)),i=e.display.barWidth,n=e.display.barHeight}function xa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Ja={native:Br,null:fa};function Ta(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&w(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ja[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ve(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?xr(e,t):ra(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var Qa=0;function Fr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qa},vr(e.curOp)}function Yr(e){var t=e.curOp;t&&Go(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;To(i)})}function To(e){for(var t=e.ops,i=0;i<t.length;i++)Qo(t[i]);for(var n=0;n<t.length;n++)Zo(t[n]);for(var o=0;o<t.length;o++)qo(t[o]);for(var k=0;k<t.length;k++)Za(t[k]);for(var z=0;z<t.length;z++)$o(t[z])}function Qo(e){var t=e.cm,i=t.display;wo(t),e.updateMaxLine&&Ci(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Tr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Zo(e){e.updatedDisplay=e.mustUpdate&&Jr(e.cm,e.update)}function qo(e){var t=e.cm,i=t.display;e.updatedDisplay&&_a(t),e.barMeasure=Vr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ve(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Oe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-pe(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Za(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&xr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==T();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Xr(t,e.barMeasure),e.updatedDisplay&&ei(t,e.barMeasure),e.selectionChanged&&ji(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Eo(e.cm)}function $o(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&wa(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&aa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&xr(t,e.scrollLeft,!0,!0),e.scrollToPos){var o=Yo(t,v(n,e.scrollToPos.from),v(n,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,o)}var k=e.maybeHiddenMarkers,z=e.maybeUnhiddenMarkers;if(k)for(var Q=0;Q<k.length;++Q)k[Q].lines.length||ze(k[Q],"hide");if(z)for(var $=0;$<z.length;++$)z[$].lines.length&&ze(z[$],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ze(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function or(e,t){if(e.curOp)return t();Fr(e);try{return t()}finally{Yr(e)}}function Ii(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Fr(e);try{return t.apply(e,arguments)}finally{Yr(e)}}}function Yi(e){return function(){if(this.curOp)return e.apply(this,arguments);Fr(this);try{return e.apply(this,arguments)}finally{Yr(this)}}}function ki(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Fr(t);try{return e.apply(this,arguments)}finally{Yr(t)}}}function pa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,U(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Ye(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(n.line>=e.display.viewFrom){var z=k.styles,Q=k.text.length>e.options.maxHighlightLength?tn(t.mode,n.state):null,$=ue(e,k,n,!0);Q&&(n.state=Q),k.styles=$.styles;var ne=k.styleClasses,me=$.classes;me?k.styleClasses=me:ne&&(k.styleClasses=null);for(var Ee=!z||z.length!=k.styles.length||ne!=me&&(!ne||!me||ne.bgClass!=me.bgClass||ne.textClass!=me.textClass),He=0;!Ee&&He<z.length;++He)Ee=z[He]!=k.styles[He];Ee&&o.push(n.line),k.stateAfter=n.save(),n.nextLine()}else k.text.length<=e.options.maxHighlightLength&&Lt(e,k.text,n),k.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return pa(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&or(e,function(){for(var k=0;k<o.length;k++)Ei(e,o[k],"text")})}var Tr=function(e,t,i){var n=e.display;this.viewport=t,this.visible=ba(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=pe(e),this.force=i,this.dims=bi(e),this.events=[]};Tr.prototype.signal=function(e,t){_e(e,t)&&this.events.push(arguments)},Tr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ze.apply(null,this.events[e])};function wo(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Oe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Oe(e)+"px",t.scrollbarsClipped=!0)}function So(e){if(e.hasFocus())return null;var t=T();if(!t||!g(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&g(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function Co(e){if(!e||!e.activeElt||e.activeElt==T())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&g(document.body,e.anchorNode)&&g(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Jr(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return _i(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Pr(e)==0)return!1;Hi(e)&&(_i(e),t.dims=bi(e));var o=n.first+n.size,k=Math.max(t.visible.from-e.options.viewportMargin,n.first),z=Math.min(o,t.visible.to+e.options.viewportMargin);i.viewFrom<k&&k-i.viewFrom<20&&(k=Math.max(n.first,i.viewFrom)),i.viewTo>z&&i.viewTo-z<20&&(z=Math.min(o,i.viewTo)),cn&&(k=Sr(e.doc,k),z=ir(e.doc,z));var Q=k!=i.viewFrom||z!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Mr(e,k,z),i.viewOffset=gi(Et(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var $=Pr(e);if(!Q&&$==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ne=So(e);return $>4&&(i.lineDiv.style.display="none"),Ao(e,i.updateLineNumbers,t.dims),$>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Co(ne),E(i.cursorDiv),E(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Q&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,pa(e,400)),i.updateLineNumbers=null,!0}function wa(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==pe(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+de(e.display)-ee(e),i.top)}),t.visible=ba(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=ba(e.display,e.doc,i));if(!Jr(e,t))break;_a(e);var o=Vr(e);ri(e),Xr(e,o),ei(e,o),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ma(e,t){var i=new Tr(e,t);if(Jr(e,i)){_a(e),wa(e,i);var n=Vr(e);ri(e),Xr(e,n),ei(e,n),i.finish()}}function Ao(e,t,i){var n=e.display,o=e.options.lineNumbers,k=n.lineDiv,z=k.firstChild;function Q(Ze){var ut=Ze.nextSibling;return P&&a&&e.display.currentWheelTarget==Ze?Ze.style.display="none":Ze.parentNode.removeChild(Ze),ut}for(var $=n.view,ne=n.viewFrom,me=0;me<$.length;me++){var Ee=$[me];if(!Ee.hidden)if(!Ee.node||Ee.node.parentNode!=k){var He=_o(e,Ee,ne,i);k.insertBefore(He,z)}else{for(;z!=Ee.node;)z=Q(z);var Pe=o&&t!=null&&t<=ne&&Ee.lineNumber;Ee.changes&&(se(Ee.changes,"gutter")>-1&&(Pe=!1),vo(e,Ee,ne,i)),Pe&&(E(Ee.lineNumber),Ee.lineNumber.appendChild(document.createTextNode(Kn(e.options,ne)))),z=Ee.node.nextSibling}ne+=Ee.size}for(;z;)z=Q(z)}function Sa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ei(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Oe(e)+"px"}function Nn(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=$i(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,k=n+"px",z=0;z<i.length;z++)if(!i[z].hidden){e.options.fixedGutter&&(i[z].gutter&&(i[z].gutter.style.left=k),i[z].gutterBackground&&(i[z].gutterBackground.style.left=k));var Q=i[z].alignable;if(Q)for(var $=0;$<Q.length;$++)Q[$].style.left=k}e.options.fixedGutter&&(t.gutters.style.left=n+o+"px")}function Hi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Kn(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var o=n.measure.appendChild(l("div",[l("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),k=o.firstChild.offsetWidth,z=o.offsetWidth-k;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(k,n.lineGutter.offsetWidth-z)+1,n.lineNumWidth=n.lineNumInnerWidth+z,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Sa(e.display),!0}return!1}function sr(e,t){for(var i=[],n=!1,o=0;o<e.length;o++){var k=e[o],z=null;if(typeof k!="string"&&(z=k.style,k=k.className),k=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:k,style:z})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function oa(e){var t=e.gutters,i=e.gutterSpecs;E(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var o=i[n],k=o.className,z=o.style,Q=t.appendChild(l("div",null,"CodeMirror-gutter "+k));z&&(Q.style.cssText=z),k=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Sa(e)}function Lr(e){oa(e.display),si(e),Nn(e)}function ga(e,t,i,n){var o=this;this.input=i,o.scrollbarFiller=l("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=l("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=_("div",null,"CodeMirror-code"),o.selectionDiv=l("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=l("div",null,"CodeMirror-cursors"),o.measure=l("div",null,"CodeMirror-measure"),o.lineMeasure=l("div",null,"CodeMirror-measure"),o.lineSpace=_("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var k=_("div",[o.lineSpace],"CodeMirror-lines");o.mover=l("div",[k],null,"position: relative"),o.sizer=l("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=l("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),o.gutters=l("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=l("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=l("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),K&&H<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),!P&&!(M&&r)&&(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=sr(n.gutters,n.lineNumbers),oa(o),i.init(o)}var jr=0,Wi=null;K?Wi=-.53:M?Wi=15:y?Wi=-.7:p&&(Wi=-1/3);function Ca(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function qa(e){var t=Ca(e);return t.x*=Wi,t.y*=Wi,t}function $a(e,t){var i=Ca(t),n=i.x,o=i.y,k=e.display,z=k.scroller,Q=z.scrollWidth>z.clientWidth,$=z.scrollHeight>z.clientHeight;if(!(n&&Q||o&&$))return;if(o&&a&&P){e:for(var ne=t.target,me=k.view;ne!=z;ne=ne.parentNode)for(var Ee=0;Ee<me.length;Ee++)if(me[Ee].node==ne){e.display.currentWheelTarget=ne;break e}}if(n&&!M&&!m&&Wi!=null){o&&$&&ra(e,Math.max(0,z.scrollTop+o*Wi)),xr(e,Math.max(0,z.scrollLeft+n*Wi)),(!o||o&&$)&&re(t),k.wheelStartX=null;return}if(o&&Wi!=null){var He=o*Wi,Pe=e.doc.scrollTop,Ze=Pe+k.wrapper.clientHeight;He<0?Pe=Math.max(0,Pe+He-50):Ze=Math.min(e.doc.height,Ze+He+50),ma(e,{top:Pe,bottom:Ze})}jr<20&&(k.wheelStartX==null?(k.wheelStartX=z.scrollLeft,k.wheelStartY=z.scrollTop,k.wheelDX=n,k.wheelDY=o,setTimeout(function(){if(k.wheelStartX==null)return;var ut=z.scrollLeft-k.wheelStartX,yt=z.scrollTop-k.wheelStartY,kt=yt&&k.wheelDY&&yt/k.wheelDY||ut&&k.wheelDX&&ut/k.wheelDX;if(k.wheelStartX=k.wheelStartY=null,!kt)return;Wi=(Wi*jr+kt)/(jr+1),++jr},200)):(k.wheelDX+=n,k.wheelDY+=o))}var lr=function(e,t){this.ranges=e,this.primIndex=t};lr.prototype.primary=function(){return this.ranges[this.primIndex]},lr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!zn(i.anchor,n.anchor)||!zn(i.head,n.head))return!1}return!0},lr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Zn(bn(this.ranges[t].anchor),bn(this.ranges[t].head));return new lr(e,this.primIndex)},lr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},lr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Kt(t,n.from())>=0&&Kt(e,n.to())<=0)return i}return-1};var Zn=function(e,t){this.anchor=e,this.head=t};Zn.prototype.from=function(){return Mn(this.anchor,this.head)},Zn.prototype.to=function(){return pn(this.anchor,this.head)},Zn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function wr(e,t,i){var n=e&&e.options.selectionsMayTouch,o=t[i];t.sort(function(He,Pe){return Kt(He.from(),Pe.from())}),i=se(t,o);for(var k=1;k<t.length;k++){var z=t[k],Q=t[k-1],$=Kt(Q.to(),z.from());if(n&&!z.empty()?$>0:$>=0){var ne=Mn(Q.from(),z.from()),me=pn(Q.to(),z.to()),Ee=Q.empty()?z.from()==z.head:Q.from()==Q.head;k<=i&&--i,t.splice(--k,2,new Zn(Ee?me:ne,Ee?ne:me))}}return new lr(t,i)}function Dr(e,t){return new lr([new Zn(e,t||e)],0)}function Ir(e){return e.text?$e(e.from.line+e.text.length-1,Se(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function eo(e,t){if(Kt(e,t.from)<0)return e;if(Kt(e,t.to)<=0)return Ir(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ir(t).ch-t.to.ch),$e(i,n)}function Aa(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var o=e.sel.ranges[n];i.push(new Zn(eo(o.anchor,t),eo(o.head,t)))}return wr(e.cm,i,e.sel.primIndex)}function Oo(e,t,i){return e.line==t.line?$e(i.line,e.ch-t.ch+i.ch):$e(i.line+(e.line-t.line),e.ch)}function Ro(e,t,i){for(var n=[],o=$e(e.first,0),k=o,z=0;z<t.length;z++){var Q=t[z],$=Oo(Q.from,o,k),ne=Oo(Ir(Q),o,k);if(o=Q.to,k=ne,i=="around"){var me=e.sel.ranges[z],Ee=Kt(me.head,me.anchor)<0;n[z]=new Zn(Ee?ne:$,Ee?$:ne)}else n[z]=new Zn($,$)}return new lr(n,e.sel.primIndex)}function Qr(e){e.doc.mode=It(e.options,e.doc.modeOption),to(e)}function to(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,pa(e,100),e.state.modeGen++,e.curOp&&si(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&Se(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,i,n){function o(zt){return i?i[zt]:null}function k(zt,Mt,Qt){qi(zt,Mt,Qt,n),Oi(zt,"change",zt,t)}function z(zt,Mt){for(var Qt=[],vn=zt;vn<Mt;++vn)Qt.push(new Ti(ne[vn],o(vn),n));return Qt}var Q=t.from,$=t.to,ne=t.text,me=Et(e,Q.line),Ee=Et(e,$.line),He=Se(ne),Pe=o(ne.length-1),Ze=$.line-Q.line;if(t.full)e.insert(0,z(0,ne.length)),e.remove(ne.length,e.size-ne.length);else if(gs(e,t)){var ut=z(0,ne.length-1);k(Ee,Ee.text,Pe),Ze&&e.remove(Q.line,Ze),ut.length&&e.insert(Q.line,ut)}else if(me==Ee)if(ne.length==1)k(me,me.text.slice(0,Q.ch)+He+me.text.slice($.ch),Pe);else{var yt=z(1,ne.length-1);yt.push(new Ti(He+me.text.slice($.ch),Pe,n)),k(me,me.text.slice(0,Q.ch)+ne[0],o(0)),e.insert(Q.line+1,yt)}else if(ne.length==1)k(me,me.text.slice(0,Q.ch)+ne[0]+Ee.text.slice($.ch),o(0)),e.remove(Q.line+1,Ze);else{k(me,me.text.slice(0,Q.ch)+ne[0],o(0)),k(Ee,He+Ee.text.slice($.ch),Pe);var kt=z(1,ne.length-1);Ze>1&&e.remove(Q.line+1,Ze-1),e.insert(Q.line+1,kt)}Oi(e,"change",e,t)}function sa(e,t,i){function n(o,k,z){if(o.linked)for(var Q=0;Q<o.linked.length;++Q){var $=o.linked[Q];if($.doc==k)continue;var ne=z&&$.sharedHist;if(i&&!ne)continue;t($.doc,ne),n($.doc,o,ne)}}n(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ar(e),Qr(e),ys(e),e.options.lineWrapping||Ci(e),e.options.mode=t.modeOption,si(e)}function ys(e){(e.doc.direction=="rtl"?N:w)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){or(e,function(){ys(e),si(e)})}function Lo(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ns(e,t){var i={from:bn(t.from),to:Ir(t),text:fn(e,t.from,t.to)};return Es(e,i,t.from.line,t.to.line+1),sa(e,function(n){return Es(n,i,t.from.line,t.to.line+1)},!0),i}function _s(e){for(;e.length;){var t=Se(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return _s(e.done),Se(e.done);if(e.done.length&&!Se(e.done).ranges)return Se(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Se(e.done)}function bs(e,t,i,n){var o=e.history;o.undone.length=0;var k=+new Date,z,Q;if((o.lastOp==n||o.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&o.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(z=pl(o,o.lastOp==n)))Q=Se(z.changes),Kt(t.from,t.to)==0&&Kt(t.from,Q.to)==0?Q.to=Ir(t):z.changes.push(ns(e,t));else{var $=Se(o.done);for((!$||!$.ranges)&&Do(e.sel,o.done),z={changes:[ns(e,t)],generation:o.generation},o.done.push(z);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(i),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=k,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,Q||ze(e,"historyAdded")}function ml(e,t,i,n){var o=t.charAt(0);return o=="*"||o=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var o=e.history,k=n&&n.origin;i==o.lastSelOp||k&&o.lastSelOrigin==k&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==k||ml(e,k,Se(o.done),t))?o.done[o.done.length-1]=t:Do(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=k,o.lastSelOp=i,n&&n.clearRedo!==!1&&_s(o.undone)}function Do(e,t){var i=Se(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Es(e,t,i,n){var o=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(z){z.markedSpans&&((o||(o=t["spans_"+e.id]={}))[k]=z.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],o=0;o<t.text.length;++o)n.push(vl(i[o]));return n}function xs(e,t){var i=yl(e,t),n=fi(e,t);if(!i)return n;if(!n)return i;for(var o=0;o<i.length;++o){var k=i[o],z=n[o];if(k&&z){e:for(var Q=0;Q<z.length;++Q){for(var $=z[Q],ne=0;ne<k.length;++ne)if(k[ne].marker==$.marker)continue e;k.push($)}}else z&&(i[o]=z)}return i}function Oa(e,t,i){for(var n=[],o=0;o<e.length;++o){var k=e[o];if(k.ranges){n.push(i?lr.prototype.deepCopy.call(k):k);continue}var z=k.changes,Q=[];n.push({changes:Q});for(var $=0;$<z.length;++$){var ne=z[$],me=void 0;if(Q.push({from:ne.from,to:ne.to,text:ne.text}),t)for(var Ee in ne)(me=Ee.match(/^spans_(\d+)$/))&&(se(t,Number(me[1]))>-1&&(Se(Q)[Ee]=ne[Ee],delete ne[Ee]))}}return n}function is(e,t,i,n){if(n){var o=e.anchor;if(i){var k=Kt(t,o)<0;k!=Kt(i,o)<0?(o=t,t=i):k!=Kt(t,i)<0&&(t=i)}return new Zn(o,t)}else return new Zn(i||t,t)}function Io(e,t,i,n,o){o==null&&(o=e.cm&&(e.cm.display.shift||e.extend)),er(e,new lr([is(e.sel.primary(),t,i,o)],0),n)}function Ts(e,t,i){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),k=0;k<e.sel.ranges.length;k++)n[k]=is(e.sel.ranges[k],t[k],null,o);var z=wr(e.cm,n,e.sel.primIndex);er(e,z,i)}function rs(e,t,i,n){var o=e.sel.ranges.slice(0);o[t]=i,er(e,wr(e.cm,o,e.sel.primIndex),n)}function ws(e,t,i,n){er(e,Dr(t,i),n)}function _l(e,t,i){var n={ranges:t.ranges,update:function(o){this.ranges=[];for(var k=0;k<o.length;k++)this.ranges[k]=new Zn(v(e,o[k].anchor),v(e,o[k].head))},origin:i&&i.origin};return ze(e,"beforeSelectionChange",e,n),e.cm&&ze(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?wr(e.cm,n.ranges,n.ranges.length-1):t}function Ss(e,t,i){var n=e.history.done,o=Se(n);o&&o.ranges?(n[n.length-1]=t,ko(e,t,i)):er(e,t,i)}function er(e,t,i){ko(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function ko(e,t,i){(_e(e,"beforeSelectionChange")||e.cm&&_e(e.cm,"beforeSelectionChange"))&&(t=_l(e,t,i));var n=i&&i.bias||(Kt(t.primary().head,e.sel.primary().head)<0?-1:1);Cs(e,Os(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&na(e.cm)}function Cs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ae(e.cm)),Oi(e,"cursorActivity",e)}function As(e){Cs(e,Os(e,e.sel,null,!1))}function Os(e,t,i,n){for(var o,k=0;k<t.ranges.length;k++){var z=t.ranges[k],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[k],$=Mo(e,z.anchor,Q&&Q.anchor,i,n),ne=Mo(e,z.head,Q&&Q.head,i,n);(o||$!=z.anchor||ne!=z.head)&&(o||(o=t.ranges.slice(0,k)),o[k]=new Zn($,ne))}return o?wr(e.cm,o,t.primIndex):t}function Ra(e,t,i,n,o){var k=Et(e,t.line);if(k.markedSpans)for(var z=0;z<k.markedSpans.length;++z){var Q=k.markedSpans[z],$=Q.marker,ne="selectLeft"in $?!$.selectLeft:$.inclusiveLeft,me="selectRight"in $?!$.selectRight:$.inclusiveRight;if((Q.from==null||(ne?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(me?Q.to>=t.ch:Q.to>t.ch))){if(o&&(ze($,"beforeCursorEnter"),$.explicitlyCleared))if(k.markedSpans){--z;continue}else break;if(!$.atomic)continue;if(i){var Ee=$.find(n<0?1:-1),He=void 0;if((n<0?me:ne)&&(Ee=Rs(e,Ee,-n,Ee&&Ee.line==t.line?k:null)),Ee&&Ee.line==t.line&&(He=Kt(Ee,i))&&(n<0?He<0:He>0))return Ra(e,Ee,t,n,o)}var Pe=$.find(n<0?-1:1);return(n<0?ne:me)&&(Pe=Rs(e,Pe,n,Pe.line==t.line?k:null)),Pe?Ra(e,Pe,t,n,o):null}}return t}function Mo(e,t,i,n,o){var k=n||1,z=Ra(e,t,i,k,o)||!o&&Ra(e,t,i,k,!0)||Ra(e,t,i,-k,o)||!o&&Ra(e,t,i,-k,!0);return z||(e.cantEdit=!0,$e(e.first,0))}function Rs(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?v(e,$e(t.line-1)):null:i>0&&t.ch==(n||Et(e,t.line)).text.length?t.line<e.first+e.size-1?$e(t.line+1,0):null:new $e(t.line,t.ch+i)}function Ls(e){e.setSelection($e(e.firstLine(),0),$e(e.lastLine()),Re)}function Ds(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(o,k,z,Q){o&&(n.from=v(e,o)),k&&(n.to=v(e,k)),z&&(n.text=z),Q!==void 0&&(n.origin=Q)}),ze(e,"beforeChange",e,n),e.cm&&ze(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function La(e,t,i){if(e.cm){if(!e.cm.curOp)return Ii(e.cm,La)(e,t,i);if(e.cm.state.suppressEdits)return}if((_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"))&&(t=Ds(e,t,!0),!t))return;var n=un&&!i&&dr(e,t.from,t.to);if(n)for(var o=n.length-1;o>=0;--o)Is(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else Is(e,t)}function Is(e,t){if(t.text.length==1&&t.text[0]==""&&Kt(t.from,t.to)==0)return;var i=Aa(e,t);bs(e,t,i,e.cm?e.cm.curOp.id:NaN),no(e,t,i,fi(e,t));var n=[];sa(e,function(o,k){!k&&se(n,o.history)==-1&&(Ns(o.history,t),n.push(o.history)),no(o,t,null,fi(o,t))})}function Po(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var o=e.history,k,z=e.sel,Q=t=="undo"?o.done:o.undone,$=t=="undo"?o.undone:o.done,ne=0;ne<Q.length&&!(k=Q[ne],i?k.ranges&&!k.equals(e.sel):!k.ranges);ne++);if(ne==Q.length)return;for(o.lastOrigin=o.lastSelOrigin=null;;)if(k=Q.pop(),k.ranges){if(Do(k,$),i&&!k.equals(e.sel)){er(e,k,{clearRedo:!1});return}z=k}else if(n){Q.push(k);return}else break;var me=[];Do(z,$),$.push({changes:me,generation:o.generation}),o.generation=k.generation||++o.maxGeneration;for(var Ee=_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"),He=function(ut){var yt=k.changes[ut];if(yt.origin=t,Ee&&!Ds(e,yt,!1))return Q.length=0,{};me.push(ns(e,yt));var kt=ut?Aa(e,yt):Se(Q);no(e,yt,kt,xs(e,yt)),!ut&&e.cm&&e.cm.scrollIntoView({from:yt.from,to:Ir(yt)});var zt=[];sa(e,function(Mt,Qt){!Qt&&se(zt,Mt.history)==-1&&(Ns(Mt.history,yt),zt.push(Mt.history)),no(Mt,yt,null,xs(Mt,yt))})},Pe=k.changes.length-1;Pe>=0;--Pe){var Ze=He(Pe);if(Ze)return Ze.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new lr(ot(e.sel.ranges,function(o){return new Zn($e(o.anchor.line+t,o.anchor.ch),$e(o.head.line+t,o.head.ch))}),e.sel.primIndex),e.cm){si(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Ei(e.cm,n,"gutter")}}function no(e,t,i,n){if(e.cm&&!e.cm.curOp)return Ii(e.cm,no)(e,t,i,n);if(t.to.line<e.first){ks(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);ks(e,o),t={from:$e(e.first,0),to:$e(t.to.line+o,t.to.ch),text:[Se(t.text)],origin:t.origin}}var k=e.lastLine();t.to.line>k&&(t={from:t.from,to:$e(k,Et(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=fn(e,t.from,t.to),i||(i=Aa(e,t)),e.cm?bl(e.cm,t,n):ts(e,t,n),ko(e,i,Re),e.cantEdit&&Mo(e,$e(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,i){var n=e.doc,o=e.display,k=t.from,z=t.to,Q=!1,$=k.line;e.options.lineWrapping||($=Yt(Pi(Et(n,k.line))),n.iter($,z.line+1,function(Pe){if(Pe==o.maxLine)return Q=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ae(e),ts(n,t,i,br(e)),e.options.lineWrapping||(n.iter($,k.line+t.text.length,function(Pe){var Ze=Vn(Pe);Ze>o.maxLineLength&&(o.maxLine=Pe,o.maxLineLength=Ze,o.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),jt(n,k.line),pa(e,400);var ne=t.text.length-(z.line-k.line)-1;t.full?si(e):k.line==z.line&&t.text.length==1&&!gs(e.doc,t)?Ei(e,k.line,"text"):si(e,k.line,z.line+1,ne);var me=_e(e,"changes"),Ee=_e(e,"change");if(Ee||me){var He={from:k,to:z,text:t.text,removed:t.removed,origin:t.origin};Ee&&Oi(e,"change",e,He),me&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(He)}e.display.selForContextMenu=null}function Da(e,t,i,n,o){var k;n||(n=i),Kt(n,i)<0&&(k=[n,i],i=k[0],n=k[1]),typeof t=="string"&&(t=e.splitLines(t)),La(e,{from:i,to:n,text:t,origin:o})}function Ms(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ps(e,t,i,n){for(var o=0;o<e.length;++o){var k=e[o],z=!0;if(k.ranges){k.copied||(k=e[o]=k.deepCopy(),k.copied=!0);for(var Q=0;Q<k.ranges.length;Q++)Ms(k.ranges[Q].anchor,t,i,n),Ms(k.ranges[Q].head,t,i,n);continue}for(var $=0;$<k.changes.length;++$){var ne=k.changes[$];if(i<ne.from.line)ne.from=$e(ne.from.line+n,ne.from.ch),ne.to=$e(ne.to.line+n,ne.to.ch);else if(t<=ne.to.line){z=!1;break}}z||(e.splice(0,o+1),o=0)}}function Ns(e,t){var i=t.from.line,n=t.to.line,o=t.text.length-(n-i)-1;Ps(e.done,i,n,o),Ps(e.undone,i,n,o)}function io(e,t,i,n){var o=t,k=t;return typeof t=="number"?k=Et(e,G(e,t)):o=Yt(t),o==null?null:(n(k,o)&&e.cm&&Ei(e.cm,o,i),k)}function ro(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}ro.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var o=this.lines[i];this.height-=o.height,Ut(o),Oi(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function ao(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var o=e[n];t+=o.chunkSize(),i+=o.height,o.parent=this}this.size=t,this.height=i,this.parent=null}ao.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(e<o){var k=Math.min(t,o-e),z=n.height;if(n.removeInner(e,k),this.height-=z-n.height,o==k&&(this.children.splice(i--,1),n.parent=null),(t-=k)==0)break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ro))){var Q=[];this.collapse(Q),this.children=[new ro(Q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var o=this.children[n],k=o.chunkSize();if(e<=k){if(o.insertInner(e,t,i),o.lines&&o.lines.length>50){for(var z=o.lines.length%25+25,Q=z;Q<o.lines.length;){var $=new ro(o.lines.slice(Q,Q+=25));o.height-=$.height,this.children.splice(++n,0,$),$.parent=this}o.lines=o.lines.slice(0,z),this.maybeSpill()}break}e-=k}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new ao(t);if(e.parent){e.size-=i.size,e.height-=i.height;var o=se(e.parent.children,e);e.parent.children.splice(o+1,0,i)}else{var n=new ao(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var o=this.children[n],k=o.chunkSize();if(e<k){var z=Math.min(t,k-e);if(o.iterN(e,z,i))return!0;if((t-=z)==0)break;e=0}else e-=k}}};var oo=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};oo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Yt(i);if(n==null||!t)return;for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(i.widgets=null);var k=ea(this);rn(i,Math.max(0,i.height-k)),e&&(or(e,function(){Us(e,i,-k),Ei(e,n,"widget")}),Oi(e,"lineWidgetCleared",e,this,n))},oo.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var o=ea(this)-t;if(!o)return;Zi(this.doc,n)||rn(n,n.height+o),i&&or(i,function(){i.curOp.forceUpdate=!0,Us(i,n,o),Oi(i,"lineWidgetChanged",i,e,Yt(n))})},xe(oo);function Us(e,t,i){gi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ya(e,i)}function El(e,t,i,n){var o=new oo(e,i,n),k=e.cm;return k&&o.noHScroll&&(k.display.alignWidgets=!0),io(e,t,"widget",function(z){var Q=z.widgets||(z.widgets=[]);if(o.insertAt==null?Q.push(o):Q.splice(Math.min(Q.length-1,Math.max(0,o.insertAt)),0,o),o.line=z,k&&!Zi(e,z)){var $=gi(z)<e.scrollTop;rn(z,z.height+ea(o)),$&&Ya(k,o.height),k.curOp.forceUpdate=!0}return!0}),k&&Oi(k,"lineWidgetAdded",k,o,typeof t=="number"?t:Yt(t)),o}var Bs=0,la=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Bs};la.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Fr(e),_e(this,"clear")){var i=this.find();i&&Oi(this,"clear",i.from,i.to)}for(var n=null,o=null,k=0;k<this.lines.length;++k){var z=this.lines[k],Q=ci(z.markedSpans,this);e&&!this.collapsed?Ei(e,Yt(z),"text"):e&&(Q.to!=null&&(o=Yt(z)),Q.from!=null&&(n=Yt(z))),z.markedSpans=cr(z.markedSpans,Q),Q.from==null&&this.collapsed&&!Zi(this.doc,z)&&e&&rn(z,Ri(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var $=0;$<this.lines.length;++$){var ne=Pi(this.lines[$]),me=Vn(ne);me>e.display.maxLineLength&&(e.display.maxLine=ne,e.display.maxLineLength=me,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&si(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&As(e.doc)),e&&Oi(e,"markerCleared",e,this,n,o),t&&Yr(e),this.parent&&this.parent.clear()},la.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,o=0;o<this.lines.length;++o){var k=this.lines[o],z=ci(k.markedSpans,this);if(z.from!=null&&(i=$e(t?k:Yt(k),z.from),e==-1))return i;if(z.to!=null&&(n=$e(t?k:Yt(k),z.to),e==1))return n}return i&&{from:i,to:n}},la.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;or(n,function(){var o=t.line,k=Yt(t.line),z=Le(n,k);if(z&&(Cn(z),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Zi(i.doc,o)&&i.height!=null){var Q=i.height;i.height=null;var $=ea(i)-Q;$&&rn(o,o.height+$)}Oi(n,"markerChanged",n,e)})},la.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},la.prototype.detachLine=function(e){if(this.lines.splice(se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xe(la);function Ia(e,t,i,n,o){if(n&&n.shared)return xl(e,t,i,n,o);if(e.cm&&!e.cm.curOp)return Ii(e.cm,Ia)(e,t,i,n,o);var k=new la(e,o),z=Kt(t,i);if(n&&A(n,k,!1),z>0||z==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=_("span",[k.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(Si(e,t.line,t,i,k)||t.line!=i.line&&Si(e,i.line,t,i,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");$n()}k.addToHistory&&bs(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Q=t.line,$=e.cm,ne;if(e.iter(Q,i.line+1,function(Ee){$&&k.collapsed&&!$.options.lineWrapping&&Pi(Ee)==$.display.maxLine&&(ne=!0),k.collapsed&&Q!=t.line&&rn(Ee,0),gr(Ee,new mn(k,Q==t.line?t.ch:null,Q==i.line?i.ch:null)),++Q}),k.collapsed&&e.iter(t.line,i.line+1,function(Ee){Zi(e,Ee)&&rn(Ee,0)}),k.clearOnEnter&&Ve(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(xn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++Bs,k.atomic=!0),$){if(ne&&($.curOp.updateMaxLine=!0),k.collapsed)si($,t.line,i.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var me=t.line;me<=i.line;me++)Ei($,me,"text");k.atomic&&As($.doc),Oi($,"markerAdded",$,k)}return k}var so=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};so.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Oi(this,"clear")},so.prototype.find=function(e,t){return this.primary.find(e,t)},xe(so);function xl(e,t,i,n,o){n=A(n),n.shared=!1;var k=[Ia(e,t,i,n,o)],z=k[0],Q=n.widgetNode;return sa(e,function($){Q&&(n.widgetNode=Q.cloneNode(!0)),k.push(Ia($,v($,t),v($,i),n,o));for(var ne=0;ne<$.linked.length;++ne)if($.linked[ne].isParent)return;z=Se(k)}),new so(k,z)}function Fs(e){return e.findMarks($e(e.first,0),e.clipPos($e(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var n=t[i],o=n.find(),k=e.clipPos(o.from),z=e.clipPos(o.to);if(Kt(k,z)){var Q=Ia(e,k,z,n.primary,n.primary.type);n.markers.push(Q),Q.parent=n}}}function wl(e){for(var t=function(n){var o=e[n],k=[o.primary.doc];sa(o.primary.doc,function($){return k.push($)});for(var z=0;z<o.markers.length;z++){var Q=o.markers[z];se(k,Q.doc)==-1&&(Q.parent=null,o.markers.splice(z--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,hr=function(e,t,i,n,o){if(!(this instanceof hr))return new hr(e,t,i,n,o);i==null&&(i=0),ao.call(this,[new ro([new Ti("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var k=$e(i,0);this.sel=Dr(k),this.history=new Lo(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=o=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:k,to:k,text:e}),er(this,Dr(k),Re)};hr.prototype=xt(ao.prototype,{constructor:hr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=nn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ki(function(e){var t=$e(this.first,0),i=this.first+this.size-1;La(this,{from:t,to:$e(i,Et(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ia(this.cm,0,0),er(this,Dr(t),Re)}),replaceRange:function(e,t,i,n){t=v(this,t),i=i?v(this,i):t,Da(this,e,t,i,n)},getRange:function(e,t,i){var n=fn(this,v(this,e),v(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Xn(this,e))return Et(this,e)},getLineNumber:function(e){return Yt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Et(this,e)),Pi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return v(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ki(function(e,t,i){ws(this,v(this,typeof e=="number"?$e(e,t||0):e),null,i)}),setSelection:ki(function(e,t,i){ws(this,v(this,e),v(this,t||e),i)}),extendSelection:ki(function(e,t,i){Io(this,v(this,e),t&&v(this,t),i)}),extendSelections:ki(function(e,t){Ts(this,B(this,e),t)}),extendSelectionsBy:ki(function(e,t){var i=ot(this.sel.ranges,e);Ts(this,B(this,i),t)}),setSelections:ki(function(e,t,i){if(!e.length)return;for(var n=[],o=0;o<e.length;o++)n[o]=new Zn(v(this,e[o].anchor),v(this,e[o].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),er(this,wr(this.cm,n,t),i)}),addSelection:ki(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Zn(v(this,e),v(this,t||e))),er(this,wr(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var o=fn(this,t[n].from(),t[n].to());i=i?i.concat(o):o}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var o=fn(this,i[n].from(),i[n].to());e!==!1&&(o=o.join(e||this.lineSeparator())),t[n]=o}return t},replaceSelection:function(e,t,i){for(var n=[],o=0;o<this.sel.ranges.length;o++)n[o]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:ki(function(e,t,i){for(var n=[],o=this.sel,k=0;k<o.ranges.length;k++){var z=o.ranges[k];n[k]={from:z.from(),to:z.to(),text:this.splitLines(e[k]),origin:i}}for(var Q=t&&t!="end"&&Ro(this,n,t),$=n.length-1;$>=0;$--)La(this,n[$]);Q?Ss(this,Q):this.cm&&na(this.cm)}),undo:ki(function(){Po(this,"undo")}),redo:ki(function(){Po(this,"redo")}),undoSelection:ki(function(){Po(this,"undo",!0)}),redoSelection:ki(function(){Po(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Lo(this.history.maxGeneration),sa(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Oa(this.history.done),undone:Oa(this.history.undone)}},setHistory:function(e){var t=this.history=new Lo(this.history.maxGeneration);t.done=Oa(e.done.slice(0),null,!0),t.undone=Oa(e.undone.slice(0),null,!0)},setGutterMarker:ki(function(e,t,i){return io(this,e,"gutter",function(n){var o=n.gutterMarkers||(n.gutterMarkers={});return o[t]=i,!i&&vt(o)&&(n.gutterMarkers=null),!0})}),clearGutter:ki(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&io(t,i,"gutter",function(){return i.gutterMarkers[e]=null,vt(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Xn(this,e))return null;if(t=e,e=Et(this,e),!e)return null}else if(t=Yt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ki(function(e,t,i){return io(this,e,t=="gutter"?"gutter":"class",function(n){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[o])n[o]=i;else{if(O(i).test(n[o]))return!1;n[o]+=" "+i}return!0})}),removeLineClass:ki(function(e,t,i){return io(this,e,t=="gutter"?"gutter":"class",function(n){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",k=n[o];if(k)if(i==null)n[o]=null;else{var z=k.match(O(i));if(!z)return!1;var Q=z.index+z[0].length;n[o]=k.slice(0,z.index)+(!z.index||Q==k.length?"":" ")+k.slice(Q)||null}else return!1;return!0})}),addLineWidget:ki(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ia(this,v(this,e),v(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=v(this,e),Ia(this,e,e,i,"bookmark")},findMarksAt:function(e){e=v(this,e);var t=[],i=Et(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var o=i[n];(o.from==null||o.from<=e.ch)&&(o.to==null||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,i){e=v(this,e),t=v(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,function(k){var z=k.markedSpans;if(z)for(var Q=0;Q<z.length;Q++){var $=z[Q];!($.to!=null&&o==e.line&&e.ch>=$.to||$.from==null&&o!=e.line||$.from!=null&&o==t.line&&$.from>=t.ch)&&(!i||i($.marker))&&n.push($.marker.parent||$.marker)}++o}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(o){var k=o.text.length+n;if(k>e)return t=e,!0;e-=k,++i}),v(this,$e(i,t))},indexFromPos:function(e){e=v(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new hr(nn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new hr(nn(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,Fs(this)),n},unlinkDoc:function(e){if(e instanceof xi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(Fs(this));break}if(e.history==this.history){var n=[e.id];sa(e,function(o){return n.push(o.id)},!0),e.history=new Lo(null),e.history.done=Oa(this.history.done,n),e.history.undone=Oa(this.history.undone,n)}},iterLinkedDocs:function(e){sa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):nt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:ki(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),hr.prototype.eachLine=hr.prototype.iter;var js=0;function Cl(e){var t=this;if(Hs(t),at(t,e)||Rr(t.display,e))return;re(e),K&&(js=+new Date);var i=Fi(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var o=n.length,k=Array(o),z=0,Q=function(){++z==o&&Ii(t,function(){i=v(t.doc,i);var Pe={from:i,to:i,text:t.doc.splitLines(k.filter(function(Ze){return Ze!=null}).join(t.doc.lineSeparator())),origin:"paste"};La(t.doc,Pe),Ss(t.doc,Dr(v(t.doc,i),v(t.doc,Ir(Pe))))})()},$=function(Pe,Ze){if(t.options.allowDropFileTypes&&se(t.options.allowDropFileTypes,Pe.type)==-1){Q();return}var ut=new FileReader;ut.onerror=function(){return Q()},ut.onload=function(){var yt=ut.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(yt)){Q();return}k[Ze]=yt,Q()},ut.readAsText(Pe)},ne=0;ne<n.length;ne++)$(n[ne],ne);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var me=e.dataTransfer.getData("Text");if(me){var Ee;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ee=t.listSelections()),ko(t.doc,Dr(i,i)),Ee)for(var He=0;He<Ee.length;++He)Da(t.doc,"",Ee[He].anchor,Ee[He].head,"drag");t.replaceSelection(me,"around","paste"),t.display.input.focus()}}catch(Pe){}}}function Al(e,t){if(K&&(!e.state.draggingText||+new Date-js<100)){be(t);return}if(at(e,t)||Rr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var i=l("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),m&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Fi(e,t);if(!i)return;var n=document.createDocumentFragment();Nr(e,i,n),e.display.dragCursor||(e.display.dragCursor=l("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),b(e.display.dragCursor,n)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var o=t[n].CodeMirror;o&&i.push(o)}i.length&&i[0].operation(function(){for(var k=0;k<i.length;k++)e(i[k])})}var Gs=!1;function Rl(){if(Gs)return;Ll(),Gs=!0}function Ll(){var e;Ve(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Dl)},100))}),Ve(window,"blur",function(){return Ws(ta)})}function Dl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ua={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},lo=0;lo<10;lo++)ua[lo+48]=ua[lo+96]=String(lo);for(var No=65;No<=90;No++)ua[No]=String.fromCharCode(No);for(var uo=1;uo<=12;uo++)ua[uo+111]=ua[uo+63235]="F"+uo;var Zr={};Zr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Zr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Zr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Zr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Zr.default=a?Zr.macDefault:Zr.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,o,k,z=0;z<t.length-1;z++){var Q=t[z];if(/^(cmd|meta|m)$/i.test(Q))k=!0;else if(/^a(lt)?$/i.test(Q))i=!0;else if(/^(c|ctrl|control)$/i.test(Q))n=!0;else if(/^s(hift)?$/i.test(Q))o=!0;else throw new Error("Unrecognized modifier name: "+Q)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),k&&(e="Cmd-"+e),o&&(e="Shift-"+e),e}function kl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var o=ot(i.split(" "),Il),k=0;k<o.length;k++){var z=void 0,Q=void 0;k==o.length-1?(Q=o.join(" "),z=n):(Q=o.slice(0,k+1).join(" "),z="...");var $=t[Q];if(!$)t[Q]=z;else if($!=z)throw new Error("Inconsistent bindings for "+Q)}delete e[i]}for(var ne in t)e[ne]=t[ne];return e}function ka(e,t,i,n){t=Uo(t);var o=t.call?t.call(e,n):t[e];if(o===!1)return"nothing";if(o==="...")return"multi";if(o!=null&&i(o))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ka(e,t.fallthrough,i,n);for(var k=0;k<t.fallthrough.length;k++){var z=ka(e,t.fallthrough[k],i,n);if(z)return z}}}function Ks(e){var t=typeof e=="string"?e:ua[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function zs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(m&&e.keyCode==34&&e.char)return!1;var i=ua[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),zs(i,e,t))}function Uo(e){return typeof e=="string"?Zr[e]:e}function Ma(e,t){for(var i=e.doc.sel.ranges,n=[],o=0;o<i.length;o++){for(var k=t(i[o]);n.length&&Kt(k.from,Se(n).to)<=0;){var z=n.pop();if(Kt(z.from,k.from)<0){k.from=z.from;break}}n.push(k)}or(e,function(){for(var Q=n.length-1;Q>=0;Q--)Da(e.doc,"",n[Q].from,n[Q].to,"+delete");na(e)})}function as(e,t,i){var n=rt(e.text,t+i,i);return n<0||n>e.text.length?null:n}function os(e,t,i){var n=as(e,t.ch,i);return n==null?null:new $e(t.line,n,i<0?"after":"before")}function ss(e,t,i,n,o){if(e){t.doc.direction=="rtl"&&(o=-o);var k=Ot(i,t.doc.direction);if(k){var z=o<0?Se(k):k[0],Q=o<0==(z.level==1),$=Q?"after":"before",ne;if(z.level>0||t.doc.direction=="rtl"){var me=Ce(t,i);ne=o<0?i.text.length-1:0;var Ee=Be(t,me,ne).top;ne=Bt(function(He){return Be(t,me,He).top==Ee},o<0==(z.level==1)?z.from:z.to-1,ne),$=="before"&&(ne=as(i,ne,1))}else ne=o<0?z.to:z.from;return new $e(n,ne,$)}}return new $e(n,o<0?i.text.length:0,o<0?"before":"after")}function Ml(e,t,i,n){var o=Ot(t,e.doc.direction);if(!o)return os(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var k=_t(o,i.ch,i.sticky),z=o[k];if(e.doc.direction=="ltr"&&z.level%2==0&&(n>0?z.to>i.ch:z.from<i.ch))return os(t,i,n);var Q=function(kt,zt){return as(t,kt instanceof $e?kt.ch:kt,zt)},$,ne=function(kt){return e.options.lineWrapping?($=$||Ce(e,t),qt(e,t,$,kt)):{begin:0,end:t.text.length}},me=ne(i.sticky=="before"?Q(i,-1):i.ch);if(e.doc.direction=="rtl"||z.level==1){var Ee=z.level==1==n<0,He=Q(i,Ee?1:-1);if(He!=null&&(Ee?He<=z.to&&He<=me.end:He>=z.from&&He>=me.begin)){var Pe=Ee?"before":"after";return new $e(i.line,He,Pe)}}var Ze=function(kt,zt,Mt){for(var Qt=function(hi,zi){return zi?new $e(i.line,Q(hi,1),"before"):new $e(i.line,hi,"after")};kt>=0&&kt<o.length;kt+=zt){var vn=o[kt],sn=zt>0==(vn.level!=1),Rn=sn?Mt.begin:Q(Mt.end,-1);if(vn.from<=Rn&&Rn<vn.to)return Qt(Rn,sn);if(Rn=sn?vn.from:Q(vn.to,-1),Mt.begin<=Rn&&Rn<Mt.end)return Qt(Rn,sn)}},ut=Ze(k+n,n,me);if(ut)return ut;var yt=n>0?me.end:Q(me.begin,-1);return yt!=null&&!(n>0&&yt==t.text.length)&&(ut=Ze(n>0?0:o.length-1,n,ne(yt)),ut)?ut:null}var co={selectAll:Ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Re)},killLine:function(e){return Ma(e,function(t){if(t.empty()){var i=Et(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:$e(t.head.line+1,0)}:{from:t.head,to:$e(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ma(e,function(t){return{from:$e(t.from().line,0),to:v(e.doc,$e(t.to().line+1,0))}})},delLineLeft:function(e){return Ma(e,function(t){return{from:$e(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ma(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Ma(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection($e(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection($e(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Fe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?Ys(e,t.head):n},Fe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,o=0;o<i.length;o++){var k=i[o].from(),z=J(e.getLine(k.line),k.ch,n);t.push(le(n-z%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return or(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var o=t[n].head,k=Et(e.doc,o.line).text;if(k){if(o.ch==k.length&&(o=new $e(o.line,o.ch-1)),o.ch>0)o=new $e(o.line,o.ch+1),e.replaceRange(k.charAt(o.ch-1)+k.charAt(o.ch-2),$e(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var z=Et(e.doc,o.line-1).text;z&&(o=new $e(o.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+z.charAt(z.length-1),$e(o.line-1,z.length-1),o,"+transpose"))}}i.push(new Zn(o,o))}e.setSelections(i)})},newlineAndIndent:function(e){return or(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);na(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,t){var i=Et(e.doc,t),n=Pi(i);return n!=i&&(t=Yt(n)),ss(!0,e,n,t,1)}function Pl(e,t){var i=Et(e.doc,t),n=Kr(i);return n!=i&&(t=Yt(n)),ss(!0,e,i,t,-1)}function Ys(e,t){var i=Xs(e,t.line),n=Et(e.doc,i.line),o=Ot(n,e.doc.direction);if(!o||o[0].level==0){var k=Math.max(i.ch,n.text.search(/\S/)),z=t.line==i.line&&t.ch<=k&&t.ch;return $e(i.line,z?0:k,i.sticky)}return i}function Bo(e,t,i){if(typeof t=="string"&&(t=co[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),o=t(e)!=Ue}finally{e.display.shift=n,e.state.suppressEdits=!1}return o}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var o=ka(t,e.state.keyMaps[n],i,e);if(o)return o}return e.options.extraKeys&&ka(t,e.options.extraKeys,i,e)||ka(t,e.options.keyMap,i,e)}var Ul=new te;function ho(e,t,i,n){var o=e.state.keySeq;if(o){if(Ks(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())}),Js(e,o+" "+t,i,n))return!0}return Js(e,t,i,n)}function Js(e,t,i,n){var o=Nl(e,t,n);return o=="multi"&&(e.state.keySeq=t),o=="handled"&&Oi(e,"keyHandled",e,t,i),(o=="handled"||o=="multi")&&(re(i),ji(e)),!!o}function Qs(e,t){var i=Vs(t,!0);return i?t.shiftKey&&!e.state.keySeq?ho(e,"Shift-"+i,t,function(n){return Bo(e,n,!0)})||ho(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Bo(e,n)}):ho(e,i,t,function(n){return Bo(e,n)}):!1}function Bl(e,t,i){return ho(e,"'"+i+"'",t,function(n){return Bo(e,n,!0)})}var ls=null;function Zs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=T(),at(t,e))return;K&&H<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Qs(t,e);m&&(ls=n?i:null,!n&&i==88&&!Ft&&(a?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),M&&!a&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;N(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(w(t,"CodeMirror-crosshair"),At(document,"keyup",i),At(document,"mouseover",i))}Ve(document,"keyup",i),Ve(document,"mouseover",i)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),at(this,e)}function $s(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Rr(t.display,e)||at(t,e)||e.ctrlKey&&!e.altKey||a&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(m&&i==ls){ls=null,re(e);return}if(m&&(!e.which||e.which<10)&&Qs(t,e))return;var o=String.fromCharCode(n==null?i:n);if(o=="\b")return;if(Bl(t,e,o))return;t.display.input.onKeyPress(e)}var jl=400,us=function(e,t,i){this.time=e,this.pos=t,this.button=i};us.prototype.compare=function(e,t,i){return this.time+jl>e&&Kt(t,this.pos)==0&&i==this.button};var fo,po;function Hl(e,t){var i=+new Date;return po&&po.compare(i,e,t)?(fo=po=null,"triple"):fo&&fo.compare(i,e,t)?(po=new us(i,e,t),fo=null,"double"):(fo=new us(i,e,t),po=null,"single")}function el(e){var t=this,i=t.display;if(at(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Rr(i,e)){P||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(cs(t,e))return;var n=Fi(t,e),o=ke(e),k=n?Hl(n,o):"single";if(window.focus(),o==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,o,n,k,e))return;o==1?n?Kl(t,n,k,e):Te(e)==i.scroller&&re(e):o==2?(n&&Io(t.doc,n),setTimeout(function(){return i.input.focus()},20)):o==3&&(R?t.display.input.onContextMenu(e):za(t))}function Wl(e,t,i,n,o){var k="Click";return n=="double"?k="Double"+k:n=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,ho(e,zs(k,o),o,function(z){if(typeof z=="string"&&(z=co[z]),!z)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=z(e,i)!=Ue}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,i){var n=e.getOption("configureMouse"),o=n?n(e,t,i):{};if(o.unit==null){var k=d?i.shiftKey&&i.metaKey:i.altKey;o.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(o.extend==null||e.doc.extend)&&(o.extend=e.doc.extend||i.shiftKey),o.addNew==null&&(o.addNew=a?i.metaKey:i.ctrlKey),o.moveOnDrag==null&&(o.moveOnDrag=!(a?i.altKey:i.ctrlKey)),o}function Kl(e,t,i,n){K?setTimeout(U(Eo,e),0):e.curOp.focus=T();var o=Gl(e,i,n),k=e.doc.sel,z;e.options.dragDrop&&Ne&&!e.isReadOnly()&&i=="single"&&(z=k.contains(t))>-1&&(Kt((z=k.ranges[z]).from(),t)<0||t.xRel>0)&&(Kt(z.to(),t)>0||t.xRel<0)?zl(e,n,t,o):Vl(e,n,t,o)}function zl(e,t,i,n){var o=e.display,k=!1,z=Ii(e,function(ne){P&&(o.scroller.draggable=!1),e.state.draggingText=!1,At(o.wrapper.ownerDocument,"mouseup",z),At(o.wrapper.ownerDocument,"mousemove",Q),At(o.scroller,"dragstart",$),At(o.scroller,"drop",z),k||(re(ne),n.addNew||Io(e.doc,i,null,null,n.extend),P&&!p||K&&H==9?setTimeout(function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()},20):o.input.focus())}),Q=function(ne){k=k||Math.abs(t.clientX-ne.clientX)+Math.abs(t.clientY-ne.clientY)>=10},$=function(){return k=!0};P&&(o.scroller.draggable=!0),e.state.draggingText=z,z.copy=!n.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),Ve(o.wrapper.ownerDocument,"mouseup",z),Ve(o.wrapper.ownerDocument,"mousemove",Q),Ve(o.scroller,"dragstart",$),Ve(o.scroller,"drop",z),za(e),setTimeout(function(){return o.input.focus()},20)}function tl(e,t,i){if(i=="char")return new Zn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Zn($e(t.line,0),v(e.doc,$e(t.line+1,0)));var n=i(e,t);return new Zn(n.from,n.to)}function Vl(e,t,i,n){var o=e.display,k=e.doc;re(t);var z,Q,$=k.sel,ne=$.ranges;if(n.addNew&&!n.extend?(Q=k.sel.contains(i),Q>-1?z=ne[Q]:z=new Zn(i,i)):(z=k.sel.primary(),Q=k.sel.primIndex),n.unit=="rectangle")n.addNew||(z=new Zn(i,i)),i=Fi(e,t,!0,!0),Q=-1;else{var me=tl(e,i,n.unit);n.extend?z=is(z,me.anchor,me.head,n.extend):z=me}n.addNew?Q==-1?(Q=ne.length,er(k,wr(e,ne.concat([z]),Q),{scroll:!1,origin:"*mouse"})):ne.length>1&&ne[Q].empty()&&n.unit=="char"&&!n.extend?(er(k,wr(e,ne.slice(0,Q).concat(ne.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),$=k.sel):rs(k,Q,z,De):(Q=0,er(k,new lr([z],0),De),$=k.sel);var Ee=i;function He(Mt){if(Kt(Ee,Mt)==0)return;if(Ee=Mt,n.unit=="rectangle"){for(var Qt=[],vn=e.options.tabSize,sn=J(Et(k,i.line).text,i.ch,vn),Rn=J(Et(k,Mt.line).text,Mt.ch,vn),hi=Math.min(sn,Rn),zi=Math.max(sn,Rn),wi=Math.min(i.line,Mt.line),yr=Math.min(e.lastLine(),Math.max(i.line,Mt.line));wi<=yr;wi++){var fr=Et(k,wi).text,Ni=Me(fr,hi,vn);hi==zi?Qt.push(new Zn($e(wi,Ni),$e(wi,Ni))):fr.length>Ni&&Qt.push(new Zn($e(wi,Ni),$e(wi,Me(fr,zi,vn))))}Qt.length||Qt.push(new Zn(i,i)),er(k,wr(e,$.ranges.slice(0,Q).concat(Qt),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Mt)}else{var pr=z,Ji=tl(e,Mt,n.unit),Gi=pr.anchor,Ui;Kt(Ji.anchor,Gi)>0?(Ui=Ji.head,Gi=Mn(pr.from(),Ji.anchor)):(Ui=Ji.anchor,Gi=pn(pr.to(),Ji.head));var Li=$.ranges.slice(0);Li[Q]=Xl(e,new Zn(v(k,Gi),Ui)),er(k,wr(e,Li,Q),De)}}var Pe=o.wrapper.getBoundingClientRect(),Ze=0;function ut(Mt){var Qt=++Ze,vn=Fi(e,Mt,!0,n.unit=="rectangle");if(!vn)return;if(Kt(vn,Ee)!=0){e.curOp.focus=T(),He(vn);var sn=ba(o,k);(vn.line>=sn.to||vn.line<sn.from)&&setTimeout(Ii(e,function(){Ze==Qt&&ut(Mt)}),150)}else{var Rn=Mt.clientY<Pe.top?-20:Mt.clientY>Pe.bottom?20:0;Rn&&setTimeout(Ii(e,function(){if(Ze!=Qt)return;o.scroller.scrollTop+=Rn,ut(Mt)}),50)}}function yt(Mt){e.state.selectingText=!1,Ze=Infinity,Mt&&(re(Mt),o.input.focus()),At(o.wrapper.ownerDocument,"mousemove",kt),At(o.wrapper.ownerDocument,"mouseup",zt),k.history.lastSelOrigin=null}var kt=Ii(e,function(Mt){Mt.buttons===0||!ke(Mt)?yt(Mt):ut(Mt)}),zt=Ii(e,yt);e.state.selectingText=zt,Ve(o.wrapper.ownerDocument,"mousemove",kt),Ve(o.wrapper.ownerDocument,"mouseup",zt)}function Xl(e,t){var i=t.anchor,n=t.head,o=Et(e.doc,i.line);if(Kt(i,n)==0&&i.sticky==n.sticky)return t;var k=Ot(o);if(!k)return t;var z=_t(k,i.ch,i.sticky),Q=k[z];if(Q.from!=i.ch&&Q.to!=i.ch)return t;var $=z+(Q.from==i.ch==(Q.level!=1)?0:1);if($==0||$==k.length)return t;var ne;if(n.line!=i.line)ne=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var me=_t(k,n.ch,n.sticky),Ee=me-z||(n.ch-i.ch)*(Q.level==1?-1:1);me==$-1||me==$?ne=Ee<0:ne=Ee>0}var He=k[$+(ne?-1:0)],Pe=ne==(He.level==1),Ze=Pe?He.from:He.to,ut=Pe?"after":"before";return i.ch==Ze&&i.sticky==ut?t:new Zn(new $e(i.line,Ze,ut),n)}function nl(e,t,i,n){var o,k;if(t.touches)o=t.touches[0].clientX,k=t.touches[0].clientY;else try{o=t.clientX,k=t.clientY}catch(He){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&re(t);var z=e.display,Q=z.lineDiv.getBoundingClientRect();if(k>Q.bottom||!_e(e,i))return he(t);k-=Q.top-z.viewOffset;for(var $=0;$<e.display.gutterSpecs.length;++$){var ne=z.gutters.childNodes[$];if(ne&&ne.getBoundingClientRect().right>=o){var me=Ln(e.doc,k),Ee=e.display.gutterSpecs[$];return ze(e,i,e,me,Ee.className,t),he(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if(Rr(e.display,t)||Yl(e,t))return;if(at(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return _e(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Tn(e)}var Pa={toString:function(){return"CodeMirror.Init"}},al={},Fo={};function Jl(e){var t=e.optionHandlers;function i(n,o,k,z){e.defaults[n]=o,k&&(t[n]=z?function(Q,$,ne){ne!=Pa&&k(Q,$,ne)}:k)}e.defineOption=i,e.Init=Pa,i("value","",function(n,o){return n.setValue(o)},!0),i("mode",null,function(n,o){n.doc.modeOption=o,Qr(n)},!0),i("indentUnit",2,Qr,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){to(n),Tn(n),si(n)},!0),i("lineSeparator",null,function(n,o){if(n.doc.lineSep=o,!o)return;var k=[],z=n.doc.first;n.doc.iter(function($){for(var ne=0;;){var me=$.text.indexOf(o,ne);if(me==-1)break;ne=me+o.length,k.push($e(z,me))}z++});for(var Q=k.length-1;Q>=0;Q--)Da(n.doc,o,k[Q],$e(k[Q].line,k[Q].ch+o.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,o,k){n.state.specialChars=new RegExp(o.source+(o.test(" ")?"":"| "),"g"),k!=Pa&&n.refresh()}),i("specialCharPlaceholder",ti,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",r?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,o){return n.getInputField().spellcheck=o},!0),i("autocorrect",!1,function(n,o){return n.getInputField().autocorrect=o},!0),i("autocapitalize",!1,function(n,o){return n.getInputField().autocapitalize=o},!0),i("rtlMoveVisually",!L),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){rl(n),Lr(n)},!0),i("keyMap","default",function(n,o,k){var z=Uo(o),Q=k!=Pa&&Uo(k);Q&&Q.detach&&Q.detach(n,z),z.attach&&z.attach(n,Q||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,o){n.display.gutterSpecs=sr(o,n.options.lineNumbers),Lr(n)},!0),i("fixedGutter",!0,function(n,o){n.display.gutters.style.left=o?$i(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Xr(n)},!0),i("scrollbarStyle","native",function(n){Ta(n),Xr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,o){n.display.gutterSpecs=sr(n.options.gutters,o),Lr(n)},!0),i("firstLineNumber",1,Lr,!0),i("lineNumberFormatter",function(n){return n},Lr,!0),i("showCursorWhenSelecting",!1,ri,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,o){o=="nocursor"&&(ta(n),n.display.input.blur()),n.display.input.readOnlyChanged(o)}),i("screenReaderLabel",null,function(n,o){o=o===""?null:o,n.display.input.screenReaderLabelChanged(o)}),i("disableInput",!1,function(n,o){o||n.display.input.reset()},!0),i("dragDrop",!0,Ql),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,ri,!0),i("singleCursorHeightPerLine",!0,ri,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,to,!0),i("addModeClass",!1,to,!0),i("pollInterval",100),i("undoDepth",200,function(n,o){return n.doc.history.undoDepth=o}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,to,!0),i("moveInputWithCursor",!0,function(n,o){o||n.display.input.resetPosition()}),i("tabindex",null,function(n,o){return n.display.input.getField().tabIndex=o||""}),i("autofocus",null),i("direction","ltr",function(n,o){return n.doc.setDirection(o)},!0),i("phrases",null)}function Ql(e,t,i){var n=i&&i!=Pa;if(!t!=!n){var o=e.display.dragFunctions,k=t?Ve:At;k(e.display.scroller,"dragstart",o.start),k(e.display.scroller,"dragenter",o.enter),k(e.display.scroller,"dragover",o.over),k(e.display.scroller,"dragleave",o.leave),k(e.display.scroller,"drop",o.drop)}}function Zl(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(w(e.display.wrapper,"CodeMirror-wrap"),Ci(e)),ar(e),si(e),Tn(e),setTimeout(function(){return Xr(e)},100)}function xi(e,t){var i=this;if(!(this instanceof xi))return new xi(e,t);this.options=t=t?A(t):{},A(al,t,!1);var n=t.value;typeof n=="string"?n=new hr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new xi.inputStyles[t.inputStyle](this),k=this.display=new ga(e,n,o,t);k.wrapper.CodeMirror=this,rl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ta(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new te,keySeq:null,specialChars:null},t.autofocus&&!r&&k.input.focus(),K&&H<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Rl(),Fr(this),this.curOp.forceUpdate=!0,vs(this,n),t.autofocus&&!r||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ur(i)},20):ta(this);for(var z in Fo)Fo.hasOwnProperty(z)&&Fo[z](this,t[z],Pa);Hi(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<ds.length;++Q)ds[Q](this);Yr(this),P&&t.lineWrapping&&getComputedStyle(k.lineDiv).textRendering=="optimizelegibility"&&(k.lineDiv.style.textRendering="auto")}xi.defaults=al,xi.optionHandlers=Fo;function ql(e){var t=e.display;Ve(t.scroller,"mousedown",Ii(e,el)),K&&H<11?Ve(t.scroller,"dblclick",Ii(e,function($){if(at(e,$))return;var ne=Fi(e,$);if(!ne||cs(e,$)||Rr(e.display,$))return;re($);var me=e.findWordAt(ne);Io(e.doc,me.anchor,me.head)})):Ve(t.scroller,"dblclick",function($){return at(e,$)||re($)}),Ve(t.scroller,"contextmenu",function($){return il(e,$)}),Ve(t.input.getField(),"contextmenu",function($){t.scroller.contains($.target)||il(e,$)});var i,n={end:0};function o(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function k($){if($.touches.length!=1)return!1;var ne=$.touches[0];return ne.radiusX<=1&&ne.radiusY<=1}function z($,ne){if(ne.left==null)return!0;var me=ne.left-$.left,Ee=ne.top-$.top;return me*me+Ee*Ee>20*20}Ve(t.scroller,"touchstart",function($){if(!at(e,$)&&!k($)&&!cs(e,$)){t.input.ensurePolled(),clearTimeout(i);var ne=+new Date;t.activeTouch={start:ne,moved:!1,prev:ne-n.end<=300?n:null},$.touches.length==1&&(t.activeTouch.left=$.touches[0].pageX,t.activeTouch.top=$.touches[0].pageY)}}),Ve(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ve(t.scroller,"touchend",function($){var ne=t.activeTouch;if(ne&&!Rr(t,$)&&ne.left!=null&&!ne.moved&&new Date-ne.start<300){var me=e.coordsChar(t.activeTouch,"page"),Ee;!ne.prev||z(ne,ne.prev)?Ee=new Zn(me,me):!ne.prev.prev||z(ne,ne.prev.prev)?Ee=e.findWordAt(me):Ee=new Zn($e(me.line,0),v(e.doc,$e(me.line+1,0))),e.setSelection(Ee.anchor,Ee.head),e.focus(),re($)}o()}),Ve(t.scroller,"touchcancel",o),Ve(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ra(e,t.scroller.scrollTop),xr(e,t.scroller.scrollLeft,!0),ze(e,"scroll",e))}),Ve(t.scroller,"mousewheel",function($){return $a(e,$)}),Ve(t.scroller,"DOMMouseScroll",function($){return $a(e,$)}),Ve(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function($){at(e,$)||be($)},over:function($){at(e,$)||(Ol(e,$),be($))},start:function($){return Al(e,$)},drop:Ii(e,Cl),leave:function($){at(e,$)||Hs(e)}};var Q=t.input.getField();Ve(Q,"keyup",function($){return qs.call(e,$)}),Ve(Q,"keydown",Ii(e,Zs)),Ve(Q,"keypress",Ii(e,$s)),Ve(Q,"focus",function($){return Ur(e,$)}),Ve(Q,"blur",function($){return ta(e,$)})}var ds=[];xi.defineInitHook=function(e){return ds.push(e)};function mo(e,t,i,n){var o=e.doc,k;i==null&&(i="add"),i=="smart"&&(o.mode.indent?k=Ye(e,t).state:i="prev");var z=e.options.tabSize,Q=Et(o,t),$=J(Q.text,null,z);Q.stateAfter&&(Q.stateAfter=null);var ne=Q.text.match(/^\s*/)[0],me;if(!n&&!/\S/.test(Q.text))me=0,i="not";else if(i=="smart"&&(me=o.mode.indent(k,Q.text.slice(ne.length),Q.text),me==Ue||me>150)){if(!n)return;i="prev"}i=="prev"?t>o.first?me=J(Et(o,t-1).text,null,z):me=0:i=="add"?me=$+e.options.indentUnit:i=="subtract"?me=$-e.options.indentUnit:typeof i=="number"&&(me=$+i),me=Math.max(0,me);var Ee="",He=0;if(e.options.indentWithTabs)for(var Pe=Math.floor(me/z);Pe;--Pe)He+=z,Ee+=" ";if(He<me&&(Ee+=le(me-He)),Ee!=ne)return Da(o,Ee,$e(t,0),$e(t,ne.length),"+input"),Q.stateAfter=null,!0;for(var Ze=0;Ze<o.sel.ranges.length;Ze++){var ut=o.sel.ranges[Ze];if(ut.head.line==t&&ut.head.ch<ne.length){var yt=$e(t,ne.length);rs(o,Ze,new Zn(yt,yt));break}}}var kr=null;function jo(e){kr=e}function hs(e,t,i,n,o){var k=e.doc;e.display.shift=!1,n||(n=k.sel);var z=+new Date-200,Q=o=="paste"||e.state.pasteIncoming>z,$=nt(t),ne=null;if(Q&&n.ranges.length>1)if(kr&&kr.text.join(`
|
|
`)==t){if(n.ranges.length%kr.text.length==0){ne=[];for(var me=0;me<kr.text.length;me++)ne.push(k.splitLines(kr.text[me]))}}else $.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(ne=ot($,function(kt){return[kt]}));for(var Ee=e.curOp.updateInput,He=n.ranges.length-1;He>=0;He--){var Pe=n.ranges[He],Ze=Pe.from(),ut=Pe.to();Pe.empty()&&(i&&i>0?Ze=$e(Ze.line,Ze.ch-i):e.state.overwrite&&!Q?ut=$e(ut.line,Math.min(Et(k,ut.line).text.length,ut.ch+Se($).length)):Q&&kr&&kr.lineWise&&kr.text.join(`
|
|
`)==$.join(`
|
|
`)&&(Ze=ut=$e(Ze.line,0)));var yt={from:Ze,to:ut,text:ne?ne[He%ne.length]:$,origin:o||(Q?"paste":e.state.cutIncoming>z?"cut":"+input")};La(e.doc,yt),Oi(e,"inputRead",e,yt)}t&&!Q&&sl(e,t),na(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ee),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&or(t,function(){return hs(t,i,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var o=i.ranges[n];if(o.head.ch>100||n&&i.ranges[n-1].head.line==o.head.line)continue;var k=e.getModeAt(o.head),z=!1;if(k.electricChars){for(var Q=0;Q<k.electricChars.length;Q++)if(t.indexOf(k.electricChars.charAt(Q))>-1){z=mo(e,o.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(Et(e.doc,o.head.line).text.slice(0,o.head.ch))&&(z=mo(e,o.head.line,"smart")));z&&Oi(e,"electricInput",e,o.head.line)}}function ll(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var o=e.doc.sel.ranges[n].head.line,k={anchor:$e(o,0),head:$e(o+1,0)};i.push(k),t.push(e.getRange(k.anchor,k.head))}return{text:t,ranges:i}}function ul(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=l("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=l("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return P?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),ul(e),t}function $l(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,o){var k=this.options,z=k[n];if(k[n]==o&&n!="mode")return;k[n]=o,t.hasOwnProperty(n)&&Ii(this,t[n])(this,o,z),ze(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,o){this.state.keyMaps[o?"push":"unshift"](Uo(n))},removeKeyMap:function(n){for(var o=this.state.keyMaps,k=0;k<o.length;++k)if(o[k]==n||o[k].name==n)return o.splice(k,1),!0},addOverlay:Yi(function(n,o){var k=n.token?n:e.getMode(this.options,n);if(k.startState)throw new Error("Overlays may not be stateful.");it(this.state.overlays,{mode:k,modeSpec:n,opaque:o&&o.opaque,priority:o&&o.priority||0},function(z){return z.priority}),this.state.modeGen++,si(this)}),removeOverlay:Yi(function(n){for(var o=this.state.overlays,k=0;k<o.length;++k){var z=o[k].modeSpec;if(z==n||typeof n=="string"&&z.name==n){o.splice(k,1),this.state.modeGen++,si(this);return}}}),indentLine:Yi(function(n,o,k){typeof o!="string"&&typeof o!="number"&&(o==null?o=this.options.smartIndent?"smart":"prev":o=o?"add":"subtract"),Xn(this.doc,n)&&mo(this,n,o,k)}),indentSelection:Yi(function(n){for(var o=this.doc.sel.ranges,k=-1,z=0;z<o.length;z++){var Q=o[z];if(Q.empty())Q.head.line>k&&(mo(this,Q.head.line,n,!0),k=Q.head.line,z==this.doc.sel.primIndex&&na(this));else{var $=Q.from(),ne=Q.to(),me=Math.max(k,$.line);k=Math.min(this.lastLine(),ne.line-(ne.ch?0:1))+1;for(var Ee=me;Ee<k;++Ee)mo(this,Ee,n);var He=this.doc.sel.ranges;$.ch==0&&o.length==He.length&&He[z].from().ch>0&&rs(this.doc,z,new Zn($,He[z].to()),Re)}}}),getTokenAt:function(n,o){return Hn(this,n,o)},getLineTokens:function(n,o){return Hn(this,$e(n),o,!0)},getTokenTypeAt:function(n){n=v(this.doc,n);var o=We(this,Et(this.doc,n.line)),k=0,z=(o.length-1)/2,Q=n.ch,$;if(Q==0)$=o[2];else for(;;){var ne=k+z>>1;if((ne?o[ne*2-1]:0)>=Q)z=ne;else if(o[ne*2+1]<Q)k=ne+1;else{$=o[ne*2+2];break}}var me=$?$.indexOf("overlay "):-1;return me<0?$:me==0?null:$.slice(0,me-1)},getModeAt:function(n){var o=this.doc.mode;return o.innerMode?e.innerMode(o,this.getTokenAt(n).state).mode:o},getHelper:function(n,o){return this.getHelpers(n,o)[0]},getHelpers:function(n,o){var k=[];if(!i.hasOwnProperty(o))return k;var z=i[o],Q=this.getModeAt(n);if(typeof Q[o]=="string")z[Q[o]]&&k.push(z[Q[o]]);else if(Q[o])for(var $=0;$<Q[o].length;$++){var ne=z[Q[o][$]];ne&&k.push(ne)}else Q.helperType&&z[Q.helperType]?k.push(z[Q.helperType]):z[Q.name]&&k.push(z[Q.name]);for(var me=0;me<z._global.length;me++){var Ee=z._global[me];Ee.pred(Q,this)&&se(k,Ee.val)==-1&&k.push(Ee.val)}return k},getStateAfter:function(n,o){var k=this.doc;return n=G(k,n==null?k.first+k.size-1:n),Ye(this,n+1,o).state},cursorCoords:function(n,o){var k,z=this.doc.sel.primary();return n==null?k=z.head:typeof n=="object"?k=v(this.doc,n):k=n?z.from():z.to(),kn(this,k,o||"page")},charCoords:function(n,o){return vi(this,v(this.doc,n),o||"page")},coordsChar:function(n,o){return n=In(this,n,o||"page"),Pn(this,n.left,n.top)},lineAtHeight:function(n,o){return n=In(this,{top:n,left:0},o||"page").top,Ln(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,o,k){var z=!1,Q;if(typeof n=="number"){var $=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>$&&(n=$,z=!0),Q=Et(this.doc,n)}else Q=n;return Fn(this,Q,{top:0,left:0},o||"page",k||z).top+(z?this.doc.height-gi(Q):0)},defaultTextHeight:function(){return Ri(this.display)},defaultCharWidth:function(){return Bi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,o,k,z,Q){var $=this.display;n=kn(this,v(this.doc,n));var ne=n.bottom,me=n.left;if(o.style.position="absolute",o.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(o),$.sizer.appendChild(o),z=="over")ne=n.top;else if(z=="above"||z=="near"){var Ee=Math.max($.wrapper.clientHeight,this.doc.height),He=Math.max($.sizer.clientWidth,$.lineSpace.clientWidth);(z=="above"||n.bottom+o.offsetHeight>Ee)&&n.top>o.offsetHeight?ne=n.top-o.offsetHeight:n.bottom+o.offsetHeight<=Ee&&(ne=n.bottom),me+o.offsetWidth>He&&(me=He-o.offsetWidth)}o.style.top=ne+"px",o.style.left=o.style.right="",Q=="right"?(me=$.sizer.clientWidth-o.offsetWidth,o.style.right="0px"):(Q=="left"?me=0:Q=="middle"&&(me=($.sizer.clientWidth-o.offsetWidth)/2),o.style.left=me+"px"),k&&xo(this,{left:me,top:ne,right:me+o.offsetWidth,bottom:ne+o.offsetHeight})},triggerOnKeyDown:Yi(Zs),triggerOnKeyPress:Yi($s),triggerOnKeyUp:qs,triggerOnMouseDown:Yi(el),execCommand:function(n){if(co.hasOwnProperty(n))return co[n].call(null,this)},triggerElectric:Yi(function(n){sl(this,n)}),findPosH:function(n,o,k,z){var Q=1;o<0&&(Q=-1,o=-o);for(var $=v(this.doc,n),ne=0;ne<o&&!($=fs(this.doc,$,Q,k,z),$.hitSide);++ne);return $},moveH:Yi(function(n,o){var k=this;this.extendSelectionsBy(function(z){return k.display.shift||k.doc.extend||z.empty()?fs(k.doc,z.head,n,o,k.options.rtlMoveVisually):n<0?z.from():z.to()},Fe)}),deleteH:Yi(function(n,o){var k=this.doc.sel,z=this.doc;k.somethingSelected()?z.replaceSelection("",null,"+delete"):Ma(this,function(Q){var $=fs(z,Q.head,n,o,!1);return n<0?{from:$,to:Q.head}:{from:Q.head,to:$}})}),findPosV:function(n,o,k,z){var Q=1,$=z;o<0&&(Q=-1,o=-o);for(var ne=v(this.doc,n),me=0;me<o;++me){var Ee=kn(this,ne,"div");if($==null?$=Ee.left:Ee.left=$,ne=dl(this,Ee,Q,k),ne.hitSide)break}return ne},moveV:Yi(function(n,o){var k=this,z=this.doc,Q=[],$=!this.display.shift&&!z.extend&&z.sel.somethingSelected();if(z.extendSelectionsBy(function(me){if($)return n<0?me.from():me.to();var Ee=kn(k,me.head,"div");me.goalColumn!=null&&(Ee.left=me.goalColumn),Q.push(Ee.left);var He=dl(k,Ee,n,o);return o=="page"&&me==z.sel.primary()&&Ya(k,vi(k,He,"div").top-Ee.top),He},Fe),Q.length)for(var ne=0;ne<z.sel.ranges.length;ne++)z.sel.ranges[ne].goalColumn=Q[ne]}),findWordAt:function(n){var o=this.doc,k=Et(o,n.line).text,z=n.ch,Q=n.ch;if(k){var $=this.getHelper(n,"wordChars");(n.sticky=="before"||Q==k.length)&&z?--z:++Q;for(var ne=k.charAt(z),me=dt(ne,$)?function(Ee){return dt(Ee,$)}:/\s/.test(ne)?function(Ee){return/\s/.test(Ee)}:function(Ee){return!/\s/.test(Ee)&&!dt(Ee)};z>0&&me(k.charAt(z-1));)--z;for(;Q<k.length&&me(k.charAt(Q));)++Q}return new Zn($e(n.line,z),$e(n.line,Q))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):w(this.display.cursorDiv,"CodeMirror-overwrite"),ze(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==T()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Yi(function(n,o){ia(this,n,o)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Oe(this)-this.display.barHeight,width:n.scrollWidth-Oe(this)-this.display.barWidth,clientHeight:ee(this),clientWidth:pe(this)}},scrollIntoView:Yi(function(n,o){n==null?(n={from:this.doc.sel.primary().head,to:null},o==null&&(o=this.options.cursorScrollMargin)):typeof n=="number"?n={from:$e(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=o||0,n.from.line!=null?Jo(this,n):ha(this,n.from,n.to,n.margin)}),setSize:Yi(function(n,o){var k=this,z=function($){return typeof $=="number"||/^\d+$/.test(String($))?$+"px":$};n!=null&&(this.display.wrapper.style.width=z(n)),o!=null&&(this.display.wrapper.style.height=z(o)),this.options.lineWrapping&&En(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function($){if($.widgets){for(var ne=0;ne<$.widgets.length;ne++)if($.widgets[ne].noHScroll){Ei(k,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,ze(this,"refresh",this)}),operation:function(n){return or(this,n)},startOperation:function(){return Fr(this)},endOperation:function(){return Yr(this)},refresh:Yi(function(){var n=this.display.cachedTextHeight;si(this),this.curOp.forceUpdate=!0,Tn(this),ia(this,this.doc.scrollLeft,this.doc.scrollTop),Sa(this.display),(n==null||Math.abs(n-Ri(this.display))>.5||this.options.lineWrapping)&&ar(this),ze(this,"refresh",this)}),swapDoc:Yi(function(n){var o=this.doc;return o.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,n),Tn(this),this.display.input.reset(),ia(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Oi(this,"swapDoc",this,o),o}),phrase:function(n){var o=this.options.phrases;return o&&Object.prototype.hasOwnProperty.call(o,n)?o[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xe(e),e.registerHelper=function(n,o,k){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][o]=k},e.registerGlobalHelper=function(n,o,k,z){e.registerHelper(n,o,z),i[n]._global.push({pred:k,val:z})}}function fs(e,t,i,n,o){var k=t,z=i,Q=Et(e,t.line),$=o&&e.direction=="rtl"?-i:i;function ne(){var zt=t.line+$;return zt<e.first||zt>=e.first+e.size?!1:(t=new $e(zt,t.ch,t.sticky),Q=Et(e,zt))}function me(zt){var Mt;if(n=="codepoint"){var Qt=Q.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Qt)?Mt=null:Mt=new $e(t.line,Math.max(0,Math.min(Q.text.length,t.ch+i*(Qt>=55296&&Qt<56320?2:1))),-i)}else o?Mt=Ml(e.cm,Q,t,i):Mt=os(Q,t,i);if(Mt==null)if(!zt&&ne())t=ss(o,e.cm,Q,t.line,$);else return!1;else t=Mt;return!0}if(n=="char"||n=="codepoint")me();else if(n=="column")me(!0);else if(n=="word"||n=="group")for(var Ee=null,He=n=="group",Pe=e.cm&&e.cm.getHelper(t,"wordChars"),Ze=!0;!(i<0&&!me(!Ze));Ze=!1){var ut=Q.text.charAt(t.ch)||`
|
|
`,yt=dt(ut,Pe)?"w":He&&ut==`
|
|
`?"n":!He||/\s/.test(ut)?null:"p";if(He&&!Ze&&!yt&&(yt="s"),Ee&&Ee!=yt){i<0&&(i=1,me(),t.sticky="after");break}if(yt&&(Ee=yt),i>0&&!me(!Ze))break}var kt=Mo(e,t,k,z,!0);return zn(k,kt)&&(kt.hitSide=!0),kt}function dl(e,t,i,n){var o=e.doc,k=t.left,z;if(n=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),$=Math.max(Q-.5*Ri(e.display),3);z=(i>0?t.bottom:t.top)+i*$}else n=="line"&&(z=i>0?t.bottom+3:t.top-3);for(var ne;!(ne=Pn(e,k,z),!ne.outside);){if(i<0?z<=0:z>=o.height){ne.hitSide=!0;break}z+=i*5}return ne}var li=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};li.prototype.init=function(e){var t=this,i=this,n=i.cm,o=i.div=e.lineDiv;ul(o,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function k(Q){for(var $=Q.target;$;$=$.parentNode){if($==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test($.className))break}return!1}Ve(o,"paste",function(Q){if(!k(Q)||at(n,Q)||ol(Q,n))return;H<=11&&setTimeout(Ii(n,function(){return t.updateFromDOM()}),20)}),Ve(o,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Ve(o,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Ve(o,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ve(o,"touchstart",function(){return i.forceCompositionEnd()}),Ve(o,"input",function(){t.composing||t.readFromDOMSoon()});function z(Q){if(!k(Q)||at(n,Q))return;if(n.somethingSelected())jo({lineWise:!1,text:n.getSelections()}),Q.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var $=ll(n);jo({lineWise:!0,text:$.text}),Q.type=="cut"&&n.operation(function(){n.setSelections($.ranges,0,Re),n.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var ne=kr.text.join(`
|
|
`);if(Q.clipboardData.setData("Text",ne),Q.clipboardData.getData("Text")==ne){Q.preventDefault();return}}var me=cl(),Ee=me.firstChild;n.display.lineSpace.insertBefore(me,n.display.lineSpace.firstChild),Ee.value=kr.text.join(`
|
|
`);var He=document.activeElement;Y(Ee),setTimeout(function(){n.display.lineSpace.removeChild(me),He.focus(),He==o&&i.showPrimarySelection()},50)}Ve(o,"copy",z),Ve(o,"cut",z)},li.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},li.prototype.prepareSelection=function(){var e=Cr(this.cm,!1);return e.focus=document.activeElement==this.div,e},li.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},li.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},li.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom){e.removeAllRanges();return}var k=Ho(t,e.anchorNode,e.anchorOffset),z=Ho(t,e.focusNode,e.focusOffset);if(k&&!k.bad&&z&&!z.bad&&Kt(Mn(k,z),n)==0&&Kt(pn(k,z),o)==0)return;var Q=t.display.view,$=n.line>=t.display.viewFrom&&hl(t,n)||{node:Q[0].measure.map[2],offset:0},ne=o.line<t.display.viewTo&&hl(t,o);if(!ne){var me=Q[Q.length-1].measure,Ee=me.maps?me.maps[me.maps.length-1]:me.map;ne={node:Ee[Ee.length-1],offset:Ee[Ee.length-2]-Ee[Ee.length-3]}}if(!$||!ne){e.removeAllRanges();return}var He=e.rangeCount&&e.getRangeAt(0),Pe;try{Pe=h($.node,$.offset,ne.offset,ne.node)}catch(Ze){}Pe&&(!M&&t.state.focused?(e.collapse($.node,$.offset),Pe.collapsed||(e.removeAllRanges(),e.addRange(Pe))):(e.removeAllRanges(),e.addRange(Pe)),He&&e.anchorNode==null?e.addRange(He):M&&this.startGracePeriod()),this.rememberSelection()},li.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},li.prototype.showMultipleSelections=function(e){b(this.cm.display.cursorDiv,e.cursors),b(this.cm.display.selectionDiv,e.selection)},li.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},li.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return g(this.div,t)},li.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},li.prototype.blur=function(){this.div.blur()},li.prototype.getField=function(){return this.div},li.prototype.supportsTouch=function(){return!0},li.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():or(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},li.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},li.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(s&&y&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=Ho(t,e.anchorNode,e.anchorOffset),n=Ho(t,e.focusNode,e.focusOffset);i&&n&&or(t,function(){er(t.doc,Dr(i,n),Re),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},li.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),o=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=$e(n.line-1,Et(e.doc,n.line-1).length)),o.ch==Et(e.doc,o.line).text.length&&o.line<e.lastLine()&&(o=$e(o.line+1,0)),n.line<t.viewFrom||o.line>t.viewTo-1)return!1;var k,z,Q;n.line==t.viewFrom||(k=di(e,n.line))==0?(z=Yt(t.view[0].line),Q=t.view[0].node):(z=Yt(t.view[k].line),Q=t.view[k-1].node.nextSibling);var $=di(e,o.line),ne,me;if($==t.view.length-1?(ne=t.viewTo-1,me=t.lineDiv.lastChild):(ne=Yt(t.view[$+1].line)-1,me=t.view[$+1].node.previousSibling),!Q)return!1;for(var Ee=e.doc.splitLines(tu(e,Q,me,z,ne)),He=fn(e.doc,$e(z,0),$e(ne,Et(e.doc,ne).text.length));Ee.length>1&&He.length>1;)if(Se(Ee)==Se(He))Ee.pop(),He.pop(),ne--;else if(Ee[0]==He[0])Ee.shift(),He.shift(),z++;else break;for(var Pe=0,Ze=0,ut=Ee[0],yt=He[0],kt=Math.min(ut.length,yt.length);Pe<kt&&ut.charCodeAt(Pe)==yt.charCodeAt(Pe);)++Pe;for(var zt=Se(Ee),Mt=Se(He),Qt=Math.min(zt.length-(Ee.length==1?Pe:0),Mt.length-(He.length==1?Pe:0));Ze<Qt&&zt.charCodeAt(zt.length-Ze-1)==Mt.charCodeAt(Mt.length-Ze-1);)++Ze;if(Ee.length==1&&He.length==1&&z==n.line)for(;Pe&&Pe>n.ch&&zt.charCodeAt(zt.length-Ze-1)==Mt.charCodeAt(Mt.length-Ze-1);)Pe--,Ze++;Ee[Ee.length-1]=zt.slice(0,zt.length-Ze).replace(/^\u200b+/,""),Ee[0]=Ee[0].slice(Pe).replace(/\u200b+$/,"");var vn=$e(z,Pe),sn=$e(ne,He.length?Se(He).length-Ze:0);if(Ee.length>1||Ee[0]||Kt(vn,sn))return Da(e.doc,Ee,vn,sn,"+input"),!0},li.prototype.ensurePolled=function(){this.forceCompositionEnd()},li.prototype.reset=function(){this.forceCompositionEnd()},li.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},li.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},li.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&or(this.cm,function(){return si(e.cm)})},li.prototype.setUneditable=function(e){e.contentEditable="false"},li.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Ii(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},li.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},li.prototype.onContextMenu=function(){},li.prototype.resetPosition=function(){},li.prototype.needsContentAttribute=!0;function hl(e,t){var i=Le(e,t.line);if(!i||i.hidden)return null;var n=Et(e.doc,t.line),o=ie(i,n,t.line),k=Ot(n,e.doc.direction),z="left";if(k){var Q=_t(k,t.ch);z=Q%2?"right":"left"}var $=mt(o.map,t.ch,z);return $.offset=$.collapse=="right"?$.end:$.start,$}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Na(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,o){var k="",z=!1,Q=e.doc.lineSeparator(),$=!1;function ne(Pe){return function(Ze){return Ze.id==Pe}}function me(){z&&(k+=Q,$&&(k+=Q),z=$=!1)}function Ee(Pe){Pe&&(me(),k+=Pe)}function He(Pe){if(Pe.nodeType==1){var Ze=Pe.getAttribute("cm-text");if(Ze){Ee(Ze);return}var ut=Pe.getAttribute("cm-marker"),yt;if(ut){var kt=e.findMarks($e(n,0),$e(o+1,0),ne(+ut));kt.length&&(yt=kt[0].find(0))&&Ee(fn(e.doc,yt.from,yt.to).join(Q));return}if(Pe.getAttribute("contenteditable")=="false")return;var zt=/^(pre|div|p|li|table|br)$/i.test(Pe.nodeName);if(!/^br$/i.test(Pe.nodeName)&&Pe.textContent.length==0)return;zt&&me();for(var Mt=0;Mt<Pe.childNodes.length;Mt++)He(Pe.childNodes[Mt]);/^(pre|p)$/i.test(Pe.nodeName)&&($=!0),zt&&(z=!0)}else Pe.nodeType==3&&Ee(Pe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(He(t),t==i);)t=t.nextSibling,$=!1;return k}function Ho(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return Na(e.clipPos($e(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var k=e.display.view[o];if(k.node==n)return nu(k,t,i)}}function nu(e,t,i){var n=e.text.firstChild,o=!1;if(!t||!g(n,t))return Na($e(Yt(e.line),0),!0);if(t==n&&(o=!0,t=n.childNodes[i],i=0,!t)){var k=e.rest?Se(e.rest):e.line;return Na($e(Yt(k),k.text.length),o)}var z=t.nodeType==3?t:null,Q=t;for(!z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(z=t.firstChild,i&&(i=z.nodeValue.length));Q.parentNode!=n;)Q=Q.parentNode;var $=e.measure,ne=$.maps;function me(yt,kt,zt){for(var Mt=-1;Mt<(ne?ne.length:0);Mt++)for(var Qt=Mt<0?$.map:ne[Mt],vn=0;vn<Qt.length;vn+=3){var sn=Qt[vn+2];if(sn==yt||sn==kt){var Rn=Yt(Mt<0?e.line:e.rest[Mt]),hi=Qt[vn]+zt;return(zt<0||sn!=yt)&&(hi=Qt[vn+(zt?1:0)]),$e(Rn,hi)}}}var Ee=me(z,Q,i);if(Ee)return Na(Ee,o);for(var He=Q.nextSibling,Pe=z?z.nodeValue.length-i:0;He;He=He.nextSibling){if(Ee=me(He,He.firstChild,0),Ee)return Na($e(Ee.line,Ee.ch-Pe),o);Pe+=He.textContent.length}for(var Ze=Q.previousSibling,ut=i;Ze;Ze=Ze.previousSibling){if(Ee=me(Ze,Ze.firstChild,-1),Ee)return Na($e(Ee.line,Ee.ch+ut),o);ut+=Ze.textContent.length}}var Mi=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new te,this.hasSelection=!1,this.composing=null};Mi.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var o=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(o.style.width="0px"),Ve(o,"input",function(){K&&H>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ve(o,"paste",function(z){if(at(n,z)||ol(z,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function k(z){if(at(n,z))return;if(n.somethingSelected())jo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Q=ll(n);jo({lineWise:!0,text:Q.text}),z.type=="cut"?n.setSelections(Q.ranges,null,Re):(i.prevInput="",o.value=Q.text.join(`
|
|
`),Y(o))}else return;z.type=="cut"&&(n.state.cutIncoming=+new Date)}Ve(o,"cut",k),Ve(o,"copy",k),Ve(e.scroller,"paste",function(z){if(Rr(e,z)||at(n,z))return;if(!o.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var Q=new Event("paste");Q.clipboardData=z.clipboardData,o.dispatchEvent(Q)}),Ve(e.lineSpace,"selectstart",function(z){Rr(e,z)||re(z)}),Ve(o,"compositionstart",function(){var z=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:z,range:n.markText(z,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ve(o,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Mi.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},Mi.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Mi.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Cr(e);if(e.options.moveInputWithCursor){var o=kn(e,i.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),z=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+z.top-k.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+z.left-k.left))}return n},Mi.prototype.showSelection=function(e){var t=this.cm,i=t.display;b(i.cursorDiv,e.cursors),b(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Mi.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Y(this.textarea),K&&H>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&H>=9&&(this.hasSelection=null))},Mi.prototype.getField=function(){return this.textarea},Mi.prototype.supportsTouch=function(){return!1},Mi.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!r||T()!=this.textarea))try{this.textarea.focus()}catch(e){}},Mi.prototype.blur=function(){this.textarea.blur()},Mi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Mi.prototype.receivedFocus=function(){this.slowPoll()},Mi.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Mi.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Mi.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||je(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=i.value;if(o==n&&!t.somethingSelected())return!1;if(K&&H>=9&&this.hasSelection===o||a&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=o.charCodeAt(0);if(k==8203&&!n&&(n="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,Q=Math.min(n.length,o.length);z<Q&&n.charCodeAt(z)==o.charCodeAt(z);)++z;return or(t,function(){hs(t,o.slice(z),n.length-z,null,e.composing?"*compose":null),o.length>1e3||o.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Mi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Mi.prototype.onKeyPress=function(){K&&H>=9&&(this.hasSelection=null),this.fastPoll()},Mi.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=Fi(i,e),z=n.scroller.scrollTop;if(!k||m)return;var Q=i.options.resetSelectionOnContextMenu;Q&&i.doc.sel.contains(k)==-1&&Ii(i,er)(i.doc,Dr(k),Re);var $=o.style.cssText,ne=t.wrapper.style.cssText,me=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",o.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-me.top-5)+"px; left: "+(e.clientX-me.left-5)+`px;
|
|
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ee;P&&(Ee=window.scrollY),n.input.focus(),P&&window.scrollTo(null,Ee),n.input.reset(),i.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=Pe,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function He(){if(o.selectionStart!=null){var ut=i.somethingSelected(),yt="\u200B"+(ut?o.value:"");o.value="\u21DA",o.value=yt,t.prevInput=ut?"":"\u200B",o.selectionStart=1,o.selectionEnd=yt.length,n.selForContextMenu=i.doc.sel}}function Pe(){if(t.contextMenuPending!=Pe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ne,o.style.cssText=$,K&&H<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=z),o.selectionStart!=null){(!K||K&&H<9)&&He();var ut=0,yt=function(){n.selForContextMenu==i.doc.sel&&o.selectionStart==0&&o.selectionEnd>0&&t.prevInput=="\u200B"?Ii(i,Ls)(i):ut++<10?n.detectingSelectAll=setTimeout(yt,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(yt,200)}}if(K&&H>=9&&He(),R){be(e);var Ze=function(){At(window,"mouseup",Ze),setTimeout(Pe,20)};Ve(window,"mouseup",Ze)}else setTimeout(Pe,50)},Mi.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Mi.prototype.setUneditable=function(){},Mi.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?A(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=T();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=Q.getValue()}var o;if(e.form&&(Ve(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var k=e.form;o=k.submit;try{var z=k.submit=function(){n(),k.submit=o,k.submit(),k.submit=z}}catch($){}}t.finishInit=function($){$.save=n,$.getTextArea=function(){return e},$.toTextArea=function(){$.toTextArea=isNaN,n(),e.parentNode.removeChild($.getWrapperElement()),e.style.display="",e.form&&(At(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=o))}},e.style.display="none";var Q=xi(function($){return e.parentNode.insertBefore($,e.nextSibling)},t);return Q}function ru(e){e.off=At,e.on=Ve,e.wheelEventPixels=qa,e.Doc=hr,e.splitLines=nt,e.countColumn=J,e.findColumn=Me,e.isWordChar=qe,e.Pass=Ue,e.signal=ze,e.Line=Ti,e.changeEnd=Ir,e.scrollbarModel=Ja,e.Pos=$e,e.cmpPos=Kt,e.modes=Gt,e.mimeModes=wt,e.resolveMode=Qe,e.getMode=It,e.modeExtensions=Wt,e.extendMode=Jt,e.copyState=tn,e.startState=ln,e.innerMode=Tt,e.commands=co,e.keyMap=Zr,e.keyName=Vs,e.isModifierKey=Ks,e.lookupKey=ka,e.normalizeKeyMap=kl,e.StringStream=Ht,e.SharedTextMarker=so,e.TextMarker=la,e.LineWidget=oo,e.e_preventDefault=re,e.e_stopPropagation=ae,e.e_stop=be,e.addClass=N,e.contains=g,e.rmClass=w,e.keyNames=ua}Jl(xi),$l(xi);var au="iter insert remove copy getEditor constructor".split(" ");for(var Wo in hr.prototype)hr.prototype.hasOwnProperty(Wo)&&se(au,Wo)<0&&(xi.prototype[Wo]=function(e){return function(){return e.apply(this.doc,arguments)}}(hr.prototype[Wo]));return xe(hr),xi.inputStyles={textarea:Mi,contenteditable:li},xi.defineMode=function(e){!xi.defaults.mode&&e!="null"&&(xi.defaults.mode=e),St.apply(this,arguments)},xi.defineMIME=en,xi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xi.defineMIME("text/plain","null"),xi.defineExtension=function(e,t){xi.prototype[e]=t},xi.defineDocExtension=function(e,t){hr.prototype[e]=t},xi.fromTextArea=iu,ru(xi),xi.version="5.58.2",xi})},Y1PL:function(ht,et,Z){"use strict";Z.r(et),Z.d(et,"ResizableTextArea",function(){return se});var oe=Z("wx14"),j=Z("1OyB"),M=Z("vuIU"),X=Z("Ji7U"),D=Z("LK+K"),F=Z("cDcd"),K=Z("VTBJ"),H=Z("rePB"),P=Z("Zm9Q"),I=Z("Kwbf"),y=Z("c+Xe"),m=Z("m+aA"),p=Z("bdgK"),c=new Map;function u(Re){Re.forEach(function(De){var Fe,Me=De.target;(Fe=c.get(Me))===null||Fe===void 0||Fe.forEach(function(ye){return ye(Me)})})}var f=new p.default(u),s=null,r=null;function a(Re,De){c.has(Re)||(c.set(Re,new Set),f.observe(Re)),c.get(Re).add(De)}function d(Re,De){c.has(Re)&&(c.get(Re).delete(De),c.get(Re).size||(f.unobserve(Re),c.delete(Re)))}var L=function(Re){Object(X.a)(Fe,Re);var De=Object(D.a)(Fe);function Fe(){return Object(j.a)(this,Fe),De.apply(this,arguments)}return Object(M.a)(Fe,[{key:"render",value:function(){return this.props.children}}]),Fe}(F.Component),C=F.createContext(null);function x(Re){var De=Re.children,Fe=Re.onBatchResize,Me=F.useRef(0),ye=F.useRef([]),le=F.useContext(C),Se=F.useCallback(function(ot,it,ct){Me.current+=1;var xt=Me.current;ye.current.push({size:ot,element:it,data:ct}),Promise.resolve().then(function(){xt===Me.current&&(Fe==null||Fe(ye.current),ye.current=[])}),le==null||le(ot,it,ct)},[Fe,le]);return F.createElement(C.Provider,{value:Se},De)}function R(Re){var De=Re.children,Fe=Re.disabled,Me=F.useRef(null),ye=F.useRef(null),le=F.useContext(C),Se=F.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ot=F.isValidElement(De)&&Object(y.c)(De),it=ot?De.ref:null,ct=F.useMemo(function(){return Object(y.a)(it,Me)},[it,Me]),xt=F.useRef(Re);xt.current=Re;var Xe=F.useCallback(function(qe){var dt=xt.current,vt=dt.onResize,st=dt.data,tt=qe.getBoundingClientRect(),rt=tt.width,Bt=tt.height,Pt=qe.offsetWidth,Ct=qe.offsetHeight,_t=Math.floor(rt),Vt=Math.floor(Bt);if(Se.current.width!==_t||Se.current.height!==Vt||Se.current.offsetWidth!==Pt||Se.current.offsetHeight!==Ct){var Ot={width:_t,height:Vt,offsetWidth:Pt,offsetHeight:Ct};Se.current=Ot;var Rt=Pt===Math.round(rt)?rt:Pt,Ve=Ct===Math.round(Bt)?Bt:Ct,Xt=Object(K.a)(Object(K.a)({},Ot),{},{offsetWidth:Rt,offsetHeight:Ve});le==null||le(Xt,qe,st),vt&&Promise.resolve().then(function(){vt(Xt,qe)})}},[]);return F.useEffect(function(){var qe=Object(m.a)(Me.current)||Object(m.a)(ye.current);return qe&&!Fe&&a(qe,Xe),function(){return d(qe,Xe)}},[Me.current,Fe]),F.createElement(L,{ref:ye},ot?F.cloneElement(De,{ref:ct}):De)}var O="rc-observer-key";function w(Re){var De=Re.children,Fe=Object(P.a)(De);return Fe.map(function(Me,ye){var le=(Me==null?void 0:Me.key)||"".concat(O,"-").concat(ye);return F.createElement(R,Object(oe.a)({},Re,{key:le}),Me)})}w.Collection=x;var E=w,b=Z("bT9E"),l=Z("TSYQ"),_=Z.n(l),h=`
|
|
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
|
|
`,g=["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"],T={},N;function V(Re){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=Re.getAttribute("id")||Re.getAttribute("data-reactid")||Re.getAttribute("name");if(De&&T[Fe])return T[Fe];var Me=window.getComputedStyle(Re),ye=Me.getPropertyValue("box-sizing")||Me.getPropertyValue("-moz-box-sizing")||Me.getPropertyValue("-webkit-box-sizing"),le=parseFloat(Me.getPropertyValue("padding-bottom"))+parseFloat(Me.getPropertyValue("padding-top")),Se=parseFloat(Me.getPropertyValue("border-bottom-width"))+parseFloat(Me.getPropertyValue("border-top-width")),ot=g.map(function(ct){return"".concat(ct,":").concat(Me.getPropertyValue(ct))}).join(";"),it={sizingStyle:ot,paddingSize:le,borderSize:Se,boxSizing:ye};return De&&Fe&&(T[Fe]=it),it}function Y(Re){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;N||(N=document.createElement("textarea"),N.setAttribute("tab-index","-1"),N.setAttribute("aria-hidden","true"),document.body.appendChild(N)),Re.getAttribute("wrap")?N.setAttribute("wrap",Re.getAttribute("wrap")):N.removeAttribute("wrap");var ye=V(Re,De),le=ye.paddingSize,Se=ye.borderSize,ot=ye.boxSizing,it=ye.sizingStyle;N.setAttribute("style","".concat(it,";").concat(h)),N.value=Re.value||Re.placeholder||"";var ct=Number.MIN_SAFE_INTEGER,xt=Number.MAX_SAFE_INTEGER,Xe=N.scrollHeight,qe;if(ot==="border-box"?Xe+=Se:ot==="content-box"&&(Xe-=le),Fe!==null||Me!==null){N.value=" ";var dt=N.scrollHeight-le;Fe!==null&&(ct=dt*Fe,ot==="border-box"&&(ct=ct+le+Se),Xe=Math.max(ct,Xe)),Me!==null&&(xt=dt*Me,ot==="border-box"&&(xt=xt+le+Se),qe=Xe>xt?"":"hidden",Xe=Math.min(xt,Xe))}return{height:Xe,minHeight:ct,maxHeight:xt,overflowY:qe,resize:"none"}}var U=Z("Gytx"),A=Z.n(U),J;(function(Re){Re[Re.NONE=0]="NONE",Re[Re.RESIZING=1]="RESIZING",Re[Re.RESIZED=2]="RESIZED"})(J||(J={}));var te=function(Re){Object(X.a)(Fe,Re);var De=Object(D.a)(Fe);function Fe(Me){var ye;return Object(j.a)(this,Fe),ye=De.call(this,Me),ye.nextFrameActionId=void 0,ye.resizeFrameId=void 0,ye.textArea=void 0,ye.saveTextArea=function(le){ye.textArea=le},ye.handleResize=function(le){var Se=ye.state.resizeStatus,ot=ye.props,it=ot.autoSize,ct=ot.onResize;if(Se!==J.NONE)return;typeof ct=="function"&&ct(le),it&&ye.resizeOnNextFrame()},ye.resizeOnNextFrame=function(){cancelAnimationFrame(ye.nextFrameActionId),ye.nextFrameActionId=requestAnimationFrame(ye.resizeTextarea)},ye.resizeTextarea=function(){var le=ye.props.autoSize;if(!le||!ye.textArea)return;var Se=le.minRows,ot=le.maxRows,it=Y(ye.textArea,!1,Se,ot);ye.setState({textareaStyles:it,resizeStatus:J.RESIZING},function(){cancelAnimationFrame(ye.resizeFrameId),ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:J.RESIZED},function(){ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:J.NONE}),ye.fixFirefoxAutoScroll()})})})})},ye.renderTextArea=function(){var le=ye.props,Se=le.prefixCls,ot=Se===void 0?"rc-textarea":Se,it=le.autoSize,ct=le.onResize,xt=le.className,Xe=le.disabled,qe=ye.state,dt=qe.textareaStyles,vt=qe.resizeStatus,st=Object(b.a)(ye.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),tt=_()(ot,xt,Object(H.a)({},"".concat(ot,"-disabled"),Xe));"value"in st&&(st.value=st.value||"");var rt=Object(K.a)(Object(K.a)(Object(K.a)({},ye.props.style),dt),vt===J.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return F.createElement(E,{onResize:ye.handleResize,disabled:!(it||ct)},F.createElement("textarea",Object(oe.a)({},st,{className:tt,style:rt,ref:ye.saveTextArea})))},ye.state={textareaStyles:{},resizeStatus:J.NONE},ye}return Object(M.a)(Fe,[{key:"componentDidUpdate",value:function(ye){(ye.value!==this.props.value||!A()(ye.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 ye=this.textArea.selectionStart,le=this.textArea.selectionEnd;this.textArea.setSelectionRange(ye,le)}}catch(Se){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Fe}(F.Component),se=te,fe=function(Re){Object(X.a)(Fe,Re);var De=Object(D.a)(Fe);function Fe(Me){var ye;Object(j.a)(this,Fe),ye=De.call(this,Me),ye.resizableTextArea=void 0,ye.focus=function(){ye.resizableTextArea.textArea.focus()},ye.saveTextArea=function(Se){ye.resizableTextArea=Se},ye.handleChange=function(Se){var ot=ye.props.onChange;ye.setValue(Se.target.value,function(){ye.resizableTextArea.resizeTextarea()}),ot&&ot(Se)},ye.handleKeyDown=function(Se){var ot=ye.props,it=ot.onPressEnter,ct=ot.onKeyDown;Se.keyCode===13&&it&&it(Se),ct&&ct(Se)};var le=typeof Me.value=="undefined"||Me.value===null?Me.defaultValue:Me.value;return ye.state={value:le},ye}return Object(M.a)(Fe,[{key:"setValue",value:function(ye,le){"value"in this.props||this.setState({value:ye},le)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return F.createElement(se,Object(oe.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ye){return"value"in ye?{value:ye.value}:null}}]),Fe}(F.Component),Ue=et.default=fe},ZJlW:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___XZ1Hd",flex_space_between:"flex_space_between___2oG4i",flex_box_vertical_center:"flex_box_vertical_center___1UWtb",flex_box_center_end:"flex_box_center_end___1o2xT",flex_box_column:"flex_box_column___SlAE0",list:"list___1HvWe",wrap:"wrap___10sri",lockWrap:"lockWrap___2djiu",li:"li___2W_zn",cover:"cover___2FS3L",img:"img___cyxrw",sign:"sign___1cxDK",name:"name___3tYlu",e:"e___1-orw",unit:"unit___ycOgg",tags:"tags___2FRpJ",tag:"tag___1e0XO"}},ZW9T:function(ht,et,Z){"use strict";Z.d(et,"a",function(){return Y});var oe=Z("k1fw"),j=Z("miYZ"),M=Z("tsqr"),X=Z("rAM+"),D=Z("tJVT"),F=Z("PpiC"),K=Z("cDcd"),H=Z.n(K),P=Z("bdgK"),I=Z("oBTY"),y=Z("9og8"),m=Z("WmNS"),p=Z.n(m),c={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"]},u={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},f={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"#include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},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=Z("5VLF"),a=Z.n(r),d={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"]}},L=function(A,J){return J.map(function(te){return{label:te,kind:A.languages.CompletionItemKind.Keyword,insertText:te}})},C=function(A){return Object.keys(d.tables).map(function(J){return{label:J,kind:A.languages.CompletionItemKind.Variable,insertText:J}})},x=function(A,J){var te=d.tables[A];return te?te.map(function(se){return{label:se,kind:J.languages.CompletionItemKind.Field,insertText:se}}):[]};function R(U,A,J,te,se){var fe=A.getWordUntilPosition(J),Ue={startLineNumber:J.lineNumber,endLineNumber:J.lineNumber,startColumn:fe.startColumn,endColumn:fe.endColumn},Re=te.map(function(De){return{label:De,kind:U.languages.CompletionItemKind.Keyword,insertText:De,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ue}});return se.map(function(De){Re.push(Object(oe.a)(Object(oe.a)({},De),{},{range:Ue}))}),Re}var O=function(U){d.languages.map(function(se){return U.languages.registerDocumentFormattingEditProvider(se,{provideDocumentFormattingEdits:function(Ue,Re,De){return Object(y.a)(p.a.mark(function Fe(){var Me;return p.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return Me=a()(Ue.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}),le.abrupt("return",[{range:Ue.getFullModelRange(),text:Me}]);case 2:case"end":return le.stop()}},Fe)}))()}}),se});var A=f.quickKey.map(function(se){return{label:se.label,kind:U.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),J=s.quickKey.map(function(se){return{label:se.label,kind:U.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=u.quickKey.map(function(se){return{label:se.label,kind:U.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}});U.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(I.a)(f.keywords),Object(I.a)(f.quickKey.map(function(se){return se.label}))),provideCompletionItems:function(fe,Ue){var Re=fe.getValueInRange({startLineNumber:Ue.lineNumber,startColumn:1,endLineNumber:Ue.lineNumber,endColumn:Ue.column}),De=Re.match(/cu/gim);console.log("match:",De,Ue,Re,fe);var Fe=[],Me=Ue.lineNumber,ye=Ue.column,le=fe.getValueInRange({startLineNumber:Me,startColumn:0,endLineNumber:Me,endColumn:ye}),Se=le.trim().split(/\s+/),ot=Se[Se.length-1];if(ot.endsWith(".")){var it=ot.slice(0,ot.length-1);Object.keys(d.tables).includes(it)&&(Fe=Object(I.a)(x(it,U)))}else ot==="."?Fe=[]:Fe=[].concat(Object(I.a)(C(U)),Object(I.a)(L(U,f.keywords)),Object(I.a)(A));return{suggestions:Fe}}}),U.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(I.a)(c.keywords)),provideCompletionItems:function(fe,Ue){var Re=fe.getValueInRange({startLineNumber:Ue.lineNumber,startColumn:1,endLineNumber:Ue.lineNumber,endColumn:Ue.column}),De=Re.match(/cu/gim);console.log("match:",De,Ue,Re,fe);var Fe=[],Me=Ue.lineNumber,ye=Ue.column,le=fe.getValueInRange({startLineNumber:Me,startColumn:0,endLineNumber:Me,endColumn:ye}),Se=le.trim().split(/\s+/),ot=Se[Se.length-1];if(ot.endsWith(".")){var it=ot.slice(0,ot.length-1);Object.keys(d.tables).includes(it)&&(Fe=Object(I.a)(x(it,U)))}else ot==="."?Fe=[]:Fe=[].concat(Object(I.a)(C(U)),Object(I.a)(L(U,c.keywords)));return{suggestions:Fe}}}),U.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(I.a)(u.keywords)),provideCompletionItems:function(fe,Ue){var Re=[],De=Ue.lineNumber,Fe=Ue.column,Me=fe.getValueInRange({startLineNumber:De,startColumn:0,endLineNumber:De,endColumn:Fe}),ye=Me.trim().split(/\s+/),le=ye[ye.length-1];if(le.endsWith(".")){var Se=le.slice(0,le.length-1);Object.keys(d.tables).includes(Se)&&(Re=Object(I.a)(x(Se,U)))}else le==="."?Re=[]:Re=[].concat(Object(I.a)(C(U)),Object(I.a)(L(U,u.keywords)),Object(I.a)(te));return{suggestions:Re}}}),U.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(I.a)(s.keywords)),provideCompletionItems:function(fe,Ue){var Re=[],De=Ue.lineNumber,Fe=Ue.column,Me=fe.getValueInRange({startLineNumber:De,startColumn:0,endLineNumber:De,endColumn:Fe}),ye=Me.trim().split(/\s+/),le=ye[ye.length-1];if(le.endsWith(".")){var Se=le.slice(0,le.length-1);Object.keys(d.tables).includes(Se)&&(Re=Object(I.a)(x(Se,U)))}else le==="."?Re=[]:Re=[].concat(Object(I.a)(C(U)),Object(I.a)(L(U,s.keywords)),Object(I.a)(J));return{suggestions:Re}}})},w="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=Z("LvDl"),b=Z("+ua5");function l(U){return/^\d+$/.test(U)?"".concat(U,"px"):U}function _(){}var h=!1,g={"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 T(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=U;if(Array.isArray(U)){for(var J=0;J<U.length;J++){var te=g[U[J]];if(te)return te}return A[0]}return g[A]||A}var N=null,V=et.b=function(U){var A=U.width,J=A===void 0?"100%":A,te=U.height,se=te===void 0?"100%":te,fe=U.value,Ue=U.language,Re=Ue===void 0?"javascript":Ue,De=U.style,Fe=De===void 0?{}:De,Me=U.options,ye=Me===void 0?{}:Me,le=U.overrideServices,Se=le===void 0?{}:le,ot=U.theme,it=ot===void 0?"vs-dark":ot,ct=U.onEditBlur,xt=U.onSave,Xe=U.autoHeight,qe=Xe===void 0?!1:Xe,dt=U.forbidCopy,vt=dt===void 0?!1:dt,st=U.onChange,tt=st===void 0?_:st,rt=U.editorDidMount,Bt=rt===void 0?_:rt,Pt=U.onFocus,Ct=Pt===void 0?_:Pt,_t=U.filename,Vt=_t===void 0?"educoder.txt":_t,Ot=U.errorLine,Rt=U.errorContent,Ve=Rt===void 0?"":Rt,Xt=Object(F.a)(U,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),At=Object(K.useRef)(),ze=Object(K.useRef)({}),at=Object(K.useRef)(),Ae=Object(K.useRef)(!1),_e=Object(K.useRef)(),xe=Object(K.useState)(!1),re=Object(D.a)(xe,2),ae=re[0],he=re[1];function be(){var Qe;return At.current&&(Qe=new P.default(function(It){var Wt=Object(X.a)(It),Jt;try{for(Wt.s();!(Jt=Wt.n()).done;){var tn=Jt.value;(tn.target.offsetHeight>0||tn.target.offsetWidth>0)&&ze.current.instance.layout()}}catch(Tt){Wt.e(Tt)}finally{Wt.f()}}),Qe.observe(At.current)),Qe}function Te(){M.b.warn(decodeURIComponent(w))}var ke=function(){var It=ze.current.instance;if(fe!=null&&It&&ae){var Wt=It.getModel();Wt&&fe!==Wt.getValue()&&(h=!0,Wt.setValue(fe),It.layout(),h=!1)}};Object(K.useEffect)(function(){at.current&&clearTimeout(at.current),at.current=setTimeout(function(){ke()},500)},[fe,ae,ze.current]),Object(K.useEffect)(function(){if(Ot&&ze.current&&ze.current.instance){var Qe=ze.current.instance;Qe.changeViewZones(function(Wt){var Jt=document.createElement("div");Jt.style.padding="10px 20px",Jt.style.width="calc(100% - 20px)",Jt.className="my-error-line-wrp",Jt.innerHTML=Ve,Wt.addZone({afterLineNumber:Ot||11,heightInLines:3,domNode:Jt})});var It={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}};Qe.addOverlayWidget(It),Qe.revealPositionInCenter({lineNumber:20,column:1})}},[Ot,ze.current,ae]);function Ne(){var Qe=ze.current.instance;if(Qe){var It=Qe.getSelection(),Wt=ze.current.pastePos||{},Jt=new N.Range(Wt.startLineNumber||It.endLineNumber,Wt.startColumn||It.endColumn,Wt.endLineNumber||It.endLineNumber,Wt.endColumn||It.endColumn);setTimeout(function(){Qe.executeEdits("",[{range:Jt,text:""}])},300)}}function lt(Qe){(window.navigator.platform.match("Mac")?Qe.metaKey:Qe.ctrlKey)&&Qe.keyCode==83&&(Qe.preventDefault(),xt())}var ft=function(){if(qe&&ze.current.instance){var It=ze.current.instance.getContentHeight();St(It<se?se:It)}else St(se)};function Ge(Qe){var It=document.createEvent("MouseEvents");It.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Qe.dispatchEvent(It)}function bt(Qe,It){var Wt=window.URL||window.webkitURL||window,Jt=new Blob([It]),tn=document.createElementNS("http://www.w3.org/1999/xhtml","a");tn.href=Wt.createObjectURL(Jt),tn.download=Qe,Ge(tn)}Object(K.useEffect)(function(){ft()},[ft]),Object(K.useEffect)(function(){At.current&&!ae&&Z.e(27).then(Z.t.bind(null,"M/lh",7)).then(function(Qe){try{N=Qe,ze.current.instance=N.editor.create(At.current,{value:fe,language:T(Re),theme:it,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},Se);var It=ze.current.instance;if(Bt(It,N),setTimeout(function(){ft(),ze.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){bt(Vt||"educoder.txt",It.getValue())}})},500),ze.current.subscription=It.onDidChangeModelContent(function(Jt){Ae.current?clearTimeout(_e.current):(ft(),tt(It.getValue(),Jt)),_e.current=setTimeout(function(){Ae.current=!1},500)}),window.Monaco||O(N),vt&&(It.addCommand(N.KeyMod.CtrlCmd|N.KeyMod.Shift|N.KeyCode.KEY_V,function(){return Te(),null}),It.addCommand(N.KeyMod.CtrlCmd|N.KeyCode.KEY_C,function(){return Te(),null})),window.Monaco=N,ct&&It.onDidBlurEditorWidget(function(){ct(It.getValue())}),Ct&&It.onDidFocusEditorText(function(){Ct(It.getValue())}),vt){It.addCommand(N.KeyMod.CtrlCmd|N.KeyCode.KEY_V,function(){return Te(),null}),It.onDidPaste(function(Jt){ze.current.pastePos=Jt});try{window.addEventListener("paste",Ne)}catch(Jt){}}var Wt=be();return he(!0),function(){var Jt=ze.current.instance;Jt.dispose();var tn=Jt.getModel();tn&&tn.dispose(),ze.current.subscription&&ze.current.subscription.dispose(),vt&&window.removeEventListener("paste",Ne),Wt.unobserve(At.current)}}catch(Jt){}})},[]),Object(K.useEffect)(function(){var Qe=ze.current.instance;if(Qe&&ae)return document.addEventListener("keydown",lt,!1),function(){document.removeEventListener("keydown",lt)}},[xt,ae]),Object(K.useEffect)(function(){var Qe=ze.current.instance;if(Qe&&ae){var It=T(Re);N.editor.setModelLanguage(Qe.getModel(),It),console.log("language:",Re,Qe.getModel(),It)}},[Re,ae]),Object(K.useEffect)(function(){var Qe=ze.current.instance;Qe&&ae&&N.editor.setTheme(it)},[it,ae]),Object(K.useEffect)(function(){var Qe=ze.current.instance;Qe&&ae&&(Qe.updateOptions(Object(oe.a)({},ye)),setTimeout(function(){Qe.getModel().updateOptions(Object(oe.a)({},ye))},200))},[JSON.stringify(ye),ae]),Object(K.useEffect)(function(){var Qe=ze.current.instance;Qe&&ae&&Qe.layout()},[J,se,ae]);var nt=Object(K.useState)(l(J)),je=Object(D.a)(nt,2),Ft=je[0],Ie=je[1],Zt=Object(K.useState)(l(se)),Gt=Object(D.a)(Zt,2),wt=Gt[0],St=Gt[1],en=Object(oe.a)(Object(oe.a)({},Fe),{},{width:Ft,height:wt});return H.a.createElement("div",{className:"my-monaco-editor",ref:At,style:en})};function Y(U){var A=U.width,J=A===void 0?"100%":A,te=U.height,se=te===void 0?"100%":te,fe=U.original,Ue=U.modified,Re=U.language,De=U.options,Fe=De===void 0?{}:De,Me=Object(K.useRef)(),ye=Object(K.useState)(null),le=Object(D.a)(ye,2),Se=le[0],ot=le[1];function it(qe){var dt;return Me.current&&(dt=new P.default(function(vt){var st=Object(X.a)(vt),tt;try{for(st.s();!(tt=st.n()).done;){var rt=tt.value;(rt.target.offsetHeight>0||rt.target.offsetWidth>0)&&qe.layout()}}catch(Bt){st.e(Bt)}finally{st.f()}}),dt.observe(Me.current)),dt}Object(K.useEffect)(function(){Me.current&&Z.e(27).then(Z.t.bind(null,"M/lh",7)).then(function(qe){N=qe;var dt=N.editor.createDiffEditor(Me.current,Object(oe.a)(Object(oe.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},Fe),{},{wordWrap:!0}));ot(dt);var vt=it(dt);return function(){dt.dispose();var st=dt.getModel();st&&st.dispose(),vt.unobserve(Me.current)}})},[]),Object(K.useEffect)(function(){Se&&Se.setModel({original:N.editor.createModel(fe,Re),modified:N.editor.createModel(Ue,Re)})},[fe,Ue,Re,Se]);var ct=l(J),xt=l(se),Xe={width:ct,height:xt};return H.a.createElement("div",{className:"my-diff-editor",ref:Me,style:Xe})}},ZpRC:function(ht,et,Z){"use strict";function oe(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function j(y,m){return(!m||y!=="hidden")&&y!=="visible"&&y!=="clip"}function M(y,m){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var p=getComputedStyle(y,null);return j(p.overflowY,m)||j(p.overflowX,m)||function(c){var u=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(s){return null}}(c);return!!u&&(u.clientHeight<c.scrollHeight||u.clientWidth<c.scrollWidth)}(y)}return!1}function X(y,m,p,c,u,f,s,r){return f<y&&s>m||f>y&&s<m?0:f<=y&&r<=p||s>=m&&r>=p?f-y-c:s>m&&r<p||f<y&&r>p?s-m+u:0}var D=function(y,m){var p=window,c=m.scrollMode,u=m.block,f=m.inline,s=m.boundary,r=m.skipOverflowHiddenElements,a=typeof s=="function"?s:function(dt){return dt!==s};if(!oe(y))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,L=[],C=y;oe(C)&&a(C);){if((C=C.parentElement)===d){L.push(C);break}C!=null&&C===document.body&&M(C)&&!M(document.documentElement)||C!=null&&M(C,r)&&L.push(C)}for(var x=p.visualViewport?p.visualViewport.width:innerWidth,R=p.visualViewport?p.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,w=window.scrollY||pageYOffset,E=y.getBoundingClientRect(),b=E.height,l=E.width,_=E.top,h=E.right,g=E.bottom,T=E.left,N=u==="start"||u==="nearest"?_:u==="end"?g:_+b/2,V=f==="center"?T+l/2:f==="end"?h:T,Y=[],U=0;U<L.length;U++){var A=L[U],J=A.getBoundingClientRect(),te=J.height,se=J.width,fe=J.top,Ue=J.right,Re=J.bottom,De=J.left;if(c==="if-needed"&&_>=0&&T>=0&&g<=R&&h<=x&&_>=fe&&g<=Re&&T>=De&&h<=Ue)return Y;var Fe=getComputedStyle(A),Me=parseInt(Fe.borderLeftWidth,10),ye=parseInt(Fe.borderTopWidth,10),le=parseInt(Fe.borderRightWidth,10),Se=parseInt(Fe.borderBottomWidth,10),ot=0,it=0,ct="offsetWidth"in A?A.offsetWidth-A.clientWidth-Me-le:0,xt="offsetHeight"in A?A.offsetHeight-A.clientHeight-ye-Se:0;if(d===A)ot=u==="start"?N:u==="end"?N-R:u==="nearest"?X(w,w+R,R,ye,Se,w+N,w+N+b,b):N-R/2,it=f==="start"?V:f==="center"?V-x/2:f==="end"?V-x:X(O,O+x,x,Me,le,O+V,O+V+l,l),ot=Math.max(0,ot+w),it=Math.max(0,it+O);else{ot=u==="start"?N-fe-ye:u==="end"?N-Re+Se+xt:u==="nearest"?X(fe,Re,te,ye,Se+xt,N,N+b,b):N-(fe+te/2)+xt/2,it=f==="start"?V-De-Me:f==="center"?V-(De+se/2)+ct/2:f==="end"?V-Ue+le+ct:X(De,Ue,se,Me,le+ct,V,V+l,l);var Xe=A.scrollLeft,qe=A.scrollTop;N+=qe-(ot=Math.max(0,Math.min(qe+ot,A.scrollHeight-te+xt))),V+=Xe-(it=Math.max(0,Math.min(Xe+it,A.scrollWidth-se+ct)))}Y.push({el:A,top:ot,left:it})}return Y};function F(y){return y===Object(y)&&Object.keys(y).length!==0}function K(y,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;y.forEach(function(c){var u=c.el,f=c.top,s=c.left;u.scroll&&p?u.scroll({top:f,left:s,behavior:m}):(u.scrollTop=f,u.scrollLeft=s)})}function H(y){return y===!1?{block:"end",inline:"nearest"}:F(y)?y:{block:"start",inline:"nearest"}}function P(y,m){var p=!y.ownerDocument.documentElement.contains(y);if(F(m)&&typeof m.behavior=="function")return m.behavior(p?[]:D(y,m));if(p)return;var c=H(m);return K(D(y,c),c.behavior)}var I=et.a=P},bT9E:function(ht,et,Z){"use strict";Z.d(et,"a",function(){return j});var oe=Z("VTBJ");function j(M,X){var D=Object(oe.a)({},M);return Array.isArray(X)&&X.forEach(function(F){delete D[F]}),D}},c5Ni:function(ht,et,Z){},cFMs:function(ht,et){ht.exports="data:image/png;base64,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"},cz0n:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___G8W6i",flex_space_between:"flex_space_between___1p_ZB",flex_box_vertical_center:"flex_box_vertical_center___2wivF",flex_box_center_end:"flex_box_center_end___y5a20",flex_box_column:"flex_box_column___6oXp3",tabs:"tabs___sKski",active:"active___10xGM"}},dejd:function(ht,et,Z){},dmUQ:function(ht,et,Z){"use strict";var oe=Z("Ff2n"),j=Z("rePB"),M=Z("1OyB"),X=Z("vuIU"),D=Z("Ji7U"),F=Z("md7G"),K=Z("foSv"),H=Z("cDcd"),P=Z.n(H),I=Z("TSYQ"),y=Z.n(I),m=Z("4IlW");function p(b,l){var _=Object.keys(b);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(b);l&&(h=h.filter(function(g){return Object.getOwnPropertyDescriptor(b,g).enumerable})),_.push.apply(_,h)}return _}function c(b){for(var l=1;l<arguments.length;l++){var _=arguments[l]!=null?arguments[l]:{};l%2?p(Object(_),!0).forEach(function(h){Object(j.a)(b,h,_[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(_)):p(Object(_)).forEach(function(h){Object.defineProperty(b,h,Object.getOwnPropertyDescriptor(_,h))})}return b}function u(b){var l=f();return function(){var h=Object(K.a)(b),g;if(l){var T=Object(K.a)(this).constructor;g=Reflect.construct(h,arguments,T)}else g=h.apply(this,arguments);return Object(F.a)(this,g)}}function f(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(b){return!1}}function s(){}function r(b){b.preventDefault()}var a=function(l){return l.replace(/[^\w.-]+/g,"")},d=200,L=600,C=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(l){return l!=null},R=function(l,_){return _===l||typeof _=="number"&&typeof l=="number"&&isNaN(_)&&isNaN(l)},O=function(b){Object(D.a)(_,b);var l=u(_);function _(h){var g;Object(M.a)(this,_),g=l.call(this,h),g.onKeyDown=function(V){var Y=g.props,U=Y.onKeyDown,A=Y.onPressEnter;if(V.keyCode===m.a.UP){var J=g.getRatio(V);g.up(V,J,null),g.stop()}else if(V.keyCode===m.a.DOWN){var te=g.getRatio(V);g.down(V,te,null),g.stop()}else V.keyCode===m.a.ENTER&&A&&A(V);if(g.recordCursorPosition(),g.lastKeyCode=V.keyCode,U){for(var se=arguments.length,fe=new Array(se>1?se-1:0),Ue=1;Ue<se;Ue++)fe[Ue-1]=arguments[Ue];U.apply(void 0,[V].concat(fe))}},g.onKeyUp=function(V){var Y=g.props.onKeyUp;if(g.stop(),g.recordCursorPosition(),Y){for(var U=arguments.length,A=new Array(U>1?U-1:0),J=1;J<U;J++)A[J-1]=arguments[J];Y.apply(void 0,[V].concat(A))}},g.onChange=function(V){var Y=g.props.onChange;g.state.focused&&(g.inputting=!0),g.rawInput=g.props.parser(g.getValueFromEvent(V)),g.setState({inputValue:g.rawInput}),Y(g.toNumber(g.rawInput))},g.onMouseUp=function(){var V=g.props.onMouseUp;g.recordCursorPosition(),V&&V.apply(void 0,arguments)},g.onFocus=function(){var V;g.setState({focused:!0}),(V=g.props).onFocus.apply(V,arguments)},g.onBlur=function(){var V=g.props.onBlur;g.inputting=!1,g.setState({focused:!1});var Y=g.getCurrentValidValue(g.state.inputValue),U=g.setValue(Y,s);if(V){var A=g.input.value,J=g.getInputDisplayValue({focus:!1,value:U});g.input.value=J&&Number(J),V.apply(void 0,arguments),g.input.value=A}},g.getRatio=function(V){var Y=1;return V.metaKey||V.ctrlKey?Y=.1:V.shiftKey&&(Y=10),Y},g.getFullNum=function(V){return isNaN(V)?V:/e/i.test(String(V))?Number(V).toFixed(18).replace(/\.?0+$/,""):V},g.getPrecision=function(V){if(x(g.props.precision))return g.props.precision;var Y=String(V);if(Y.indexOf("e-")>=0)return parseInt(Y.slice(Y.indexOf("e-")+2),10);var U=0;return Y.indexOf(".")>=0&&(U=Y.length-Y.indexOf(".")-1),U},g.getInputDisplayValue=function(V){var Y=V||g.state,U=Y.focused,A=Y.inputValue,J=Y.value,te;U?te=A:te=g.toPrecisionAsStep(J),te==null&&(te="");var se=g.formatWrapper(te);return x(g.props.decimalSeparator)&&(se=se.toString().replace(".",g.props.decimalSeparator)),se},g.recordCursorPosition=function(){try{g.cursorStart=g.input.selectionStart,g.cursorEnd=g.input.selectionEnd,g.currentValue=g.input.value,g.cursorBefore=g.input.value.substring(0,g.cursorStart),g.cursorAfter=g.input.value.substring(g.cursorEnd)}catch(V){}},g.restoreByAfter=function(V){if(V===void 0)return!1;var Y=g.input.value,U=Y.lastIndexOf(V);if(U===-1)return!1;var A=g.cursorBefore.length;return g.lastKeyCode===m.a.DELETE&&g.cursorBefore.charAt(A-1)===V[0]?(g.fixCaret(A,A),!0):U+V.length===Y.length?(g.fixCaret(U,U),!0):!1},g.partRestoreByAfter=function(V){return V===void 0?!1:Array.prototype.some.call(V,function(Y,U){var A=V.substring(U);return g.restoreByAfter(A)})},g.isNotCompleteNumber=function(V){return isNaN(V)||V===""||V===null||V&&V.toString().indexOf(".")===V.toString().length-1},g.stop=function(){g.autoStepTimer&&clearTimeout(g.autoStepTimer)},g.down=function(V,Y,U){g.pressingUpOrDown=!0,g.step("down",V,Y,U)},g.up=function(V,Y,U){g.pressingUpOrDown=!0,g.step("up",V,Y,U)},g.saveInput=function(V){g.input=V};var T=h.value;T===void 0&&(T=h.defaultValue),g.state={focused:h.autoFocus};var N=g.getValidValue(g.toNumber(T));return g.state=c(c({},g.state),{},{inputValue:g.toPrecisionAsStep(N),value:N}),g}return Object(X.a)(_,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(g){var T=this.props,N=T.value,V=T.onChange,Y=T.max,U=T.min,A=this.state.focused;if(g){if(!R(g.value,N)||!R(g.max,Y)||!R(g.min,U)){var J=A?N:this.getValidValue(N),te;this.pressingUpOrDown?te=J:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(J),this.setState({value:J,inputValue:te})}var se="value"in this.props?N:this.state.value;"max"in this.props&&g.max!==Y&&typeof se=="number"&&se>Y&&V&&V(Y),"min"in this.props&&g.min!==U&&typeof se=="number"&&se<U&&V&&V(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ue){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(g){var T=g;return T===""?T="":this.isNotCompleteNumber(parseFloat(T))?T=this.state.value:T=this.getValidValue(T),this.toNumber(T)}},{key:"getValueFromEvent",value:function(g){var T=g.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(T=T.replace(this.props.decimalSeparator,".")),T}},{key:"getValidValue",value:function(g){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,V=parseFloat(g);return isNaN(V)?g:(V<T&&(V=T),V>N&&(V=N),V)}},{key:"setValue",value:function(g,T){var N=this.props.precision,V=this.isNotCompleteNumber(parseFloat(g))?null:parseFloat(g),Y=this.state.value,U=Y===void 0?null:Y,A=this.state.inputValue,J=A===void 0?null:A,te=typeof V=="number"?V.toFixed(N):"".concat(V),se=V!==U||te!=="".concat(J);return"value"in this.props?(J=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:J},T)):this.setState({value:V,inputValue:this.toPrecisionAsStep(g)},T),se&&this.props.onChange(V),V}},{key:"getMaxPrecision",value:function(g){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,V=N.precision,Y=N.step;if(x(V))return V;var U=this.getPrecision(T),A=this.getPrecision(Y),J=this.getPrecision(g);return g?Math.max(J,U+A):U+A}},{key:"getPrecisionFactor",value:function(g){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(g,T);return Math.pow(10,N)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(g){return this.props.formatter?this.props.formatter(g):g}},{key:"toPrecisionAsStep",value:function(g){if(this.isNotCompleteNumber(g)||g==="")return g;var T=Math.abs(this.getMaxPrecision(g));return isNaN(T)?g.toString():Number(g).toFixed(T)}},{key:"toNumber",value:function(g){var T=this.props.precision,N=this.state.focused,V=g&&g.length>16&&N;return this.isNotCompleteNumber(g)||V?g:x(T)?Math.round(g*Math.pow(10,T))/Math.pow(10,T):Number(g)}},{key:"upStep",value:function(g,T){var N=this.props.step,V=this.getPrecisionFactor(g,T),Y=Math.abs(this.getMaxPrecision(g,T)),U=((V*g+V*N*T)/V).toFixed(Y);return this.toNumber(U)}},{key:"downStep",value:function(g,T){var N=this.props.step,V=this.getPrecisionFactor(g,T),Y=Math.abs(this.getMaxPrecision(g,T)),U=((V*g-V*N*T)/V).toFixed(Y);return this.toNumber(U)}},{key:"step",value:function(g,T){var N=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Y=arguments.length>3?arguments[3]:void 0;this.stop(),T&&(T.persist(),T.preventDefault());var U=this.props;if(U.disabled)return;var A=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(A))return;var J=this["".concat(g,"Step")](A,V),te=J>U.max||J<U.min;if(J>U.max?J=U.max:J<U.min&&(J=U.min),this.setValue(J,null),this.setState({focused:!0},function(){N.pressingUpOrDown=!1}),te)return;this.autoStepTimer=setTimeout(function(){N[g](T,V,!0)},Y?d:L)}},{key:"fixCaret",value:function(g,T){if(g===void 0||T===void 0||!this.input||!this.input.value)return;try{var N=this.input.selectionStart,V=this.input.selectionEnd;(g!==N||T!==V)&&this.input.setSelectionRange(g,T)}catch(Y){}}},{key:"render",value:function(){var g,T=this.props,N=T.prefixCls,V=T.disabled,Y=T.readOnly,U=T.useTouch,A=T.autoComplete,J=T.upHandler,te=T.downHandler,se=T.className,fe=T.max,Ue=T.min,Re=T.style,De=T.title,Fe=T.onMouseEnter,Me=T.onMouseLeave,ye=T.onMouseOver,le=T.onMouseOut,Se=T.required,ot=T.onClick,it=T.tabIndex,ct=T.type,xt=T.placeholder,Xe=T.id,qe=T.inputMode,dt=T.pattern,vt=T.step,st=T.maxLength,tt=T.autoFocus,rt=T.name,Bt=T.onPaste,Pt=T.onInput,Ct=Object(oe.a)(T,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),_t=this.state,Vt=_t.value,Ot=_t.focused,Rt=y()(N,(g={},Object(j.a)(g,se,!!se),Object(j.a)(g,"".concat(N,"-disabled"),V),Object(j.a)(g,"".concat(N,"-focused"),Ot),g)),Ve={};Object.keys(Ct).forEach(function(be){(be.substr(0,5)==="data-"||be.substr(0,5)==="aria-"||be==="role")&&(Ve[be]=Ct[be])});var Xt=!Y&&!V,At=this.getInputDisplayValue(null),ze=(Vt||Vt===0)&&(isNaN(Vt)||Number(Vt)>=fe),at=(Vt||Vt===0)&&(isNaN(Vt)||Number(Vt)<=Ue),Ae=ze||V||Y,_e=at||V||Y,xe=y()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object(j.a)({},"".concat(N,"-handler-up-disabled"),Ae)),re=y()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object(j.a)({},"".concat(N,"-handler-down-disabled"),_e)),ae=U?{onTouchStart:Ae?s:this.up,onTouchEnd:this.stop}:{onMouseDown:Ae?s:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},he=U?{onTouchStart:_e?s:this.down,onTouchEnd:this.stop}:{onMouseDown:_e?s:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return P.a.createElement("div",{className:Rt,style:Re,title:De,onMouseEnter:Fe,onMouseLeave:Me,onMouseOver:ye,onMouseOut:le,onFocus:function(){return null},onBlur:function(){return null}},P.a.createElement("div",{className:"".concat(N,"-handler-wrap")},P.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":Ae,className:xe}),J||P.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:r})),P.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Decrease Value","aria-disabled":_e,className:re}),te||P.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:r}))),P.a.createElement("div",{className:"".concat(N,"-input-wrap")},P.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ue,"aria-valuemax":fe,"aria-valuenow":Vt,required:Se,type:ct,placeholder:xt,onPaste:Bt,onClick:ot,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:it,autoComplete:A,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Xt?this.onKeyDown:s,onKeyUp:Xt?this.onKeyUp:s,autoFocus:tt,maxLength:st,readOnly:Y,disabled:V,max:fe,min:Ue,step:vt,name:rt,title:De,id:Xe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(At),pattern:dt,inputMode:qe,onInput:Pt},Ve))))}}]),_}(P.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:C,min:-C,step:1,style:{},onChange:s,onKeyDown:s,onPressEnter:s,onFocus:s,onBlur:s,parser:a,required:!1,autoComplete:"off"};var w=O,E=et.a=w},"f0W+":function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___2AWuG",flex_space_between:"flex_space_between___4j1zo",flex_box_vertical_center:"flex_box_vertical_center___3dWcm",flex_box_center_end:"flex_box_center_end___qvHJi",flex_box_column:"flex_box_column___3Eier",tabs:"tabs___25WKT",tabsWrap:"tabsWrap___2lPJE",active:"active___gGp9s"}},f9pc:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___fO1Sq",flex_space_between:"flex_space_between___2MANs",flex_box_vertical_center:"flex_box_vertical_center___2x-su",flex_box_center_end:"flex_box_center_end___6bZNq",flex_box_column:"flex_box_column___CGTHC",quickPager:"quickPager___2XH6F",disabled:"disabled___2gPWV"}},fJjg:function(ht,et,Z){"use strict";var oe=Z("2qtc"),j=Z("kLXV"),M=Z("7Kak"),X=Z("9yH6"),D=Z("k1fw"),F=Z("miYZ"),K=Z("tsqr"),H=Z("9og8"),P=Z("tJVT"),I=Z("PpiC"),y=Z("5NDa"),m=Z("5rEg"),p=Z("WmNS"),c=Z.n(p),u=Z("cDcd"),f=Z.n(u),s=Z("9kvl"),r=Z("Nska"),a=Z.n(r),d=Z("1vsH"),L=Z("Nf5h"),C=Z("Fhpe"),x=Z.n(C),R=m.a.Search,O=function(E){var b=E.userDetail,l=E.globalSetting,_=E.loading,h=E.dispatch,g=Object(I.a)(E,["userDetail","globalSetting","loading","dispatch"]),T=Object(u.useState)(""),N=Object(P.a)(T,2),V=N[0],Y=N[1],U=Object(u.useState)([]),A=Object(P.a)(U,2),J=A[0],te=A[1],se=Object(u.useState)(),fe=Object(P.a)(se,2),Ue=fe[0],Re=fe[1],De=Object(u.useState)(!1),Fe=Object(P.a)(De,2),Me=Fe[0],ye=Fe[1];Object(u.useEffect)(function(){le()},[]);var le=function(){var ot=Object(H.a)(c.a.mark(function it(){var ct;return c.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return Xe.next=2,h({type:"userDetail/topicGetCourseList",payload:{search:V}});case 2:ct=Xe.sent,ct&&te((ct==null?void 0:ct.courses)||[]);case 4:case"end":return Xe.stop()}},it)}));return function(){return ot.apply(this,arguments)}}(),Se=function(){var ot=Object(H.a)(c.a.mark(function it(){var ct,xt,Xe,qe,dt;return c.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:if(Ue){st.next=4;break}return K.b.info("\u60A8\u9700\u8981\u521B\u5EFA\u8BFE\u5802\uFF0C\u624D\u80FD\u53D1\u9001"),ye(!0),st.abrupt("return");case 4:return st.next=6,h({type:"userDetail/topicSendToClass",payload:Object(D.a)({course_id:Ue},(ct=b.actionTabs)===null||ct===void 0?void 0:ct.params)});case 6:xt=st.sent,h({type:"userDetail/setActionTabs",payload:{}}),xt&&xt.status===0&&(dt={normal:"common_homework",group:"group_homework",exercise:"exercise",poll:"poll"},Object(d.U)("/classrooms/".concat(Ue,"/").concat(dt[(Xe=b.actionTabs)===null||Xe===void 0||((qe=Xe.params)===null||qe===void 0)?void 0:qe.object_type])));case 9:case"end":return st.stop()}},it)}));return function(){return ot.apply(this,arguments)}}();return f.a.createElement(j.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:b.actionTabs.key==="UserDetail-SendToClass",title:"\u53D1\u9001\u81F3\u8BFE\u5802",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:_["userDetail/sendToClass"],width:600,onOk:Se,wrapClassName:x.a.CustomCss,onCancel:function(){h({type:"userDetail/setActionTabs",payload:{}})}},f.a.createElement("div",{className:a.a.wrap},f.a.createElement("div",{className:"mb10"},f.a.createElement(L.e,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:V,style:{width:500},onChange:function(it){Y(it),le()}})),f.a.createElement("div",{className:a.a.radioWrap},f.a.createElement(X.a.Group,{value:Ue,onChange:function(it){Re(it.target.value),ye(!1)}},J.map(function(ot,it){return f.a.createElement(X.a,{className:a.a.radio,value:ot.course_id,key:ot.course_id},ot.course_name)}))),f.a.createElement("div",{className:a.a.title},"\u6E29\u99A8\u63D0\u793A\uFF1A\u9009\u62E9\u7684\u9898\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802"),Me&&f.a.createElement("div",{className:a.a.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u8BFE\u5802")))};et.a=Object(s.a)(function(w){var E=w.userDetail,b=w.loading,l=w.globalSetting;return{userDetail:E,globalSetting:l,loading:b.effects}})(O)},"iL++":function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___2pHUo",flex_space_between:"flex_space_between___3Bfes",flex_box_vertical_center:"flex_box_vertical_center___1thiW",flex_box_center_end:"flex_box_center_end___3Zr7k",flex_box_column:"flex_box_column___3xe1a",list:"list___3rlGv",wrap:"wrap____oZzM",lockWrap:"lockWrap___24eY2",top:"top___3SCOc",sign:"sign____uZ_B",name:"name___2nHyM",img:"img___3Spn7",text:"text___1Pg2L",btns:"btns___Kr_Ti",bottom:"bottom___2_iOx"}},k3GJ:function(ht,et,Z){"use strict";Z.d(et,"a",function(){return _o});var oe=Z("rePB"),j=Z("ODXe"),M=Z("Ff2n"),X=Z("VTBJ"),D=Z("cDcd"),F=Z("TSYQ"),K=Z.n(F),H=Z("Zm9Q"),P=Z("6cGi"),I=Z("KQm4"),y=Z("xEkU"),m=Z.n(y),p=Z("t23M");function c(de){var we=Object(D.useRef)(),Oe=Object(D.useRef)(!1);function pe(){for(var ee=arguments.length,ce=new Array(ee),ie=0;ie<ee;ie++)ce[ie]=arguments[ie];Oe.current||(m.a.cancel(we.current),we.current=m()(function(){de.apply(void 0,ce)}))}return Object(D.useEffect)(function(){return function(){Oe.current=!0,m.a.cancel(we.current)}},[]),pe}function u(de){var we=Object(D.useRef)([]),Oe=Object(D.useState)({}),pe=Object(j.a)(Oe,2),ee=pe[1],ce=Object(D.useRef)(typeof de=="function"?de():de),ie=c(function(){var ve=ce.current;we.current.forEach(function(Le){ve=Le(ve)}),we.current=[],ce.current=ve,ee({})});function ge(ve){we.current.push(ve),ie()}return[ce.current,ge]}var f=Z("4IlW");function s(de,we){var Oe,pe=de.prefixCls,ee=de.id,ce=de.active,ie=de.rtl,ge=de.tab,ve=ge.key,Le=ge.tab,Ce=ge.disabled,Be=ge.closeIcon,Je=de.tabBarGutter,mt=de.tabPosition,pt=de.closable,Dt=de.renderWrapper,gn=de.removeAriaLabel,Cn=de.editable,En=de.onClick,Tn=de.onRemove,An=de.onFocus,Sn="".concat(pe,"-tab");D.useEffect(function(){return Tn},[]);var wn={};mt==="top"||mt==="bottom"?wn[ie?"marginLeft":"marginRight"]=Je:wn.marginBottom=Je;var Fn=Cn&&pt!==!1&&!Ce;function In(hn){if(Ce)return;En(hn)}function vi(hn){hn.preventDefault(),hn.stopPropagation(),Cn.onEdit("remove",{key:ve,event:hn})}var kn=D.createElement("div",{key:ve,ref:we,className:K()(Sn,(Oe={},Object(oe.a)(Oe,"".concat(Sn,"-with-remove"),Fn),Object(oe.a)(Oe,"".concat(Sn,"-active"),ce),Object(oe.a)(Oe,"".concat(Sn,"-disabled"),Ce),Oe)),style:wn,onClick:In},D.createElement("div",{role:"tab","aria-selected":ce,id:ee&&"".concat(ee,"-tab-").concat(ve),className:"".concat(Sn,"-btn"),"aria-controls":ee&&"".concat(ee,"-panel-").concat(ve),"aria-disabled":Ce,tabIndex:Ce?null:0,onClick:function(on){on.stopPropagation(),In(on)},onKeyDown:function(on){[f.a.SPACE,f.a.ENTER].includes(on.which)&&(on.preventDefault(),In(on))},onFocus:An},Le),Fn&&D.createElement("button",{type:"button","aria-label":gn||"remove",tabIndex:0,className:"".concat(Sn,"-remove"),onClick:function(on){on.stopPropagation(),vi(on)}},Be||Cn.removeIcon||"\xD7"));return Dt&&(kn=Dt(kn)),kn}var r=D.forwardRef(s),a={width:0,height:0,left:0,top:0};function d(de,we,Oe){return Object(D.useMemo)(function(){for(var pe,ee=new Map,ce=we.get((pe=de[0])===null||pe===void 0?void 0:pe.key)||a,ie=ce.left+ce.width,ge=0;ge<de.length;ge+=1){var ve=de[ge].key,Le=we.get(ve);if(!Le){var Ce;Le=we.get((Ce=de[ge-1])===null||Ce===void 0?void 0:Ce.key)||a}var Be=ee.get(ve)||Object(X.a)({},Le);Be.right=ie-Be.left-Be.width,ee.set(ve,Be)}return ee},[de.map(function(pe){return pe.key}).join("_"),we,Oe])}var L={width:0,height:0,left:0,top:0,right:0};function C(de,we,Oe,pe,ee){var ce=ee.tabs,ie=ee.tabPosition,ge=ee.rtl,ve,Le,Ce;["top","bottom"].includes(ie)?(ve="width",Le=ge?"right":"left",Ce=Math.abs(we.left)):(ve="height",Le="top",Ce=-we.top);var Be=we[ve],Je=Oe[ve],mt=pe[ve],pt=Be;return Je+mt>Be&&(pt=Be-mt),Object(D.useMemo)(function(){if(!ce.length)return[0,0];for(var Dt=ce.length,gn=Dt,Cn=0;Cn<Dt;Cn+=1){var En=de.get(ce[Cn].key)||L;if(En[Le]+En[ve]>Ce+pt){gn=Cn-1;break}}for(var Tn=0,An=Dt-1;An>=0;An-=1){var Sn=de.get(ce[An].key)||L;if(Sn[Le]<Ce){Tn=An+1;break}}return[Tn,gn]},[de,Ce,pt,ie,ce.map(function(Dt){return Dt.key}).join("_"),ge])}var x=Z("wx14"),R=Z("1OyB"),O=Z("vuIU"),w=Z("JX7q"),E=Z("Ji7U"),b=Z("LK+K"),l=Z("I8Z2"),_=Z("bT9E"),h=Z("2GS6"),g=Z("Gytx"),T=Z.n(g),N=Z("U8pU"),V=/iPhone/i,Y=/iPod/i,U=/iPad/i,A=/\bAndroid(?:.+)Mobile\b/i,J=/Android/i,te=/\bAndroid(?:.+)SD4930UR\b/i,se=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,fe=/Windows Phone/i,Ue=/\bWindows(?:.+)ARM\b/i,Re=/BlackBerry/i,De=/BB10/i,Fe=/Opera Mini/i,Me=/\b(CriOS|Chrome)(?:.+)Mobile/i,ye=/Mobile(?:.+)Firefox\b/i;function le(de,we){return de.test(we)}function Se(de){var we=de||(typeof navigator!="undefined"?navigator.userAgent:""),Oe=(we||"").split("[FBAN");if(typeof Oe[1]!="undefined"){var pe=Oe,ee=Object(j.a)(pe,1);we=ee[0]}if(Oe=we.split("Twitter"),typeof Oe[1]!="undefined"){var ce=Oe,ie=Object(j.a)(ce,1);we=ie[0]}var ge={apple:{phone:le(V,we)&&!le(fe,we),ipod:le(Y,we),tablet:!le(V,we)&&le(U,we)&&!le(fe,we),device:(le(V,we)||le(Y,we)||le(U,we))&&!le(fe,we)},amazon:{phone:le(te,we),tablet:!le(te,we)&&le(se,we),device:le(te,we)||le(se,we)},android:{phone:!le(fe,we)&&le(te,we)||!le(fe,we)&&le(A,we),tablet:!le(fe,we)&&!le(te,we)&&!le(A,we)&&(le(se,we)||le(J,we)),device:!le(fe,we)&&(le(te,we)||le(se,we)||le(A,we)||le(J,we))||le(/\bokhttp\b/i,we)},windows:{phone:le(fe,we),tablet:le(Ue,we),device:le(fe,we)||le(Ue,we)},other:{blackberry:le(Re,we),blackberry10:le(De,we),opera:le(Fe,we),firefox:le(ye,we),chrome:le(Me,we),device:le(Re,we)||le(De,we)||le(Fe,we)||le(ye,we)||le(Me,we)},any:null,phone:null,tablet:null};return ge.any=ge.apple.device||ge.android.device||ge.windows.device||ge.other.device,ge.phone=ge.apple.phone||ge.android.phone||ge.windows.phone,ge.tablet=ge.apple.tablet||ge.android.tablet||ge.windows.tablet,ge}var ot=Object(X.a)(Object(X.a)({},Se()),{},{isMobile:Se}),it=ot;function ct(){}function xt(de,we,Oe){var pe=we||"";return de.key||"".concat(pe,"item_").concat(Oe)}function Xe(de){return"".concat(de,"-menu-")}function qe(de,we){var Oe=-1;D.Children.forEach(de,function(pe){Oe+=1,pe&&pe.type&&pe.type.isMenuItemGroup?D.Children.forEach(pe.props.children,function(ee){Oe+=1,we(ee,Oe)}):we(pe,Oe)})}function dt(de,we,Oe){if(!de||Oe.find)return;D.Children.forEach(de,function(pe){if(pe){var ee=pe.type;if(!ee||!(ee.isSubMenu||ee.isMenuItem||ee.isMenuItemGroup))return;we.indexOf(pe.key)!==-1?Oe.find=!0:pe.props.children&&dt(pe.props.children,we,Oe)}})}var vt=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],st=function(we){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pe=we&&typeof we.getBoundingClientRect=="function"&&we.getBoundingClientRect().width;if(pe){if(Oe){var ee=getComputedStyle(we),ce=ee.marginLeft,ie=ee.marginRight;pe+=+ce.replace("px","")+ +ie.replace("px","")}pe=+pe.toFixed(6)}return pe||0},tt=function(we,Oe,pe){we&&Object(N.a)(we.style)==="object"&&(we.style[Oe]=pe)},rt=function(){return it.any},Bt=Z("bdgK"),Pt=Z("faye"),Ct=Z.n(Pt),_t=Z("wgJM"),Vt=Z("l4aY"),Ot=Z("m+aA"),Rt=Z("c+Xe"),Ve=Z("zT1h"),Xt=Z("QC+M");function At(de,we,Oe){return Oe?de[0]===we[0]:de[0]===we[0]&&de[1]===we[1]}function ze(de,we,Oe){var pe=de[we]||{};return Object(X.a)(Object(X.a)({},pe),Oe)}function at(de,we,Oe,pe){for(var ee=Oe.points,ce=Object.keys(de),ie=0;ie<ce.length;ie+=1){var ge=ce[ie];if(At(de[ge].points,ee,pe))return"".concat(we,"-placement-").concat(ge)}return""}var Ae=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var de=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(de)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(de==null?void 0:de.substr(0,4)))},_e=Z("MNnm");function xe(de,we){var Oe={};return Oe[de.toLowerCase()]=we.toLowerCase(),Oe["Webkit".concat(de)]="webkit".concat(we),Oe["Moz".concat(de)]="moz".concat(we),Oe["ms".concat(de)]="MS".concat(we),Oe["O".concat(de)]="o".concat(we.toLowerCase()),Oe}function re(de,we){var Oe={animationend:xe("Animation","AnimationEnd"),transitionend:xe("Transition","TransitionEnd")};return de&&("AnimationEvent"in we||delete Oe.animationend.animation,"TransitionEvent"in we||delete Oe.transitionend.transition),Oe}var ae=re(Object(_e.a)(),typeof window!="undefined"?window:{}),he={};if(Object(_e.a)()){var be=document.createElement("div");he=be.style}var Te={};function ke(de){if(Te[de])return Te[de];var we=ae[de];if(we)for(var Oe=Object.keys(we),pe=Oe.length,ee=0;ee<pe;ee+=1){var ce=Oe[ee];if(Object.prototype.hasOwnProperty.call(we,ce)&&ce in he)return Te[de]=we[ce],Te[de]}return""}var Ne=ke("animationend"),lt=ke("transitionend"),ft=!!(Ne&<),Ge=Ne||"animationend",bt=lt||"transitionend";function nt(de,we){if(!de)return null;if(Object(N.a)(de)==="object"){var Oe=we.replace(/-\w/g,function(pe){return pe[1].toUpperCase()});return de[Oe]}return"".concat(de,"-").concat(we)}var je="none",Ft="appear",Ie="enter",Zt="leave",Gt="none",wt="prepare",St="start",en="active",Qe="end";function It(de){var we=Object(D.useRef)(!1),Oe=Object(D.useState)(de),pe=Object(j.a)(Oe,2),ee=pe[0],ce=pe[1];function ie(ge){we.current||ce(ge)}return Object(D.useEffect)(function(){return function(){we.current=!0}},[]),[ee,ie]}var Wt=Object(_e.a)()?D.useLayoutEffect:D.useEffect,Jt=Wt,tn=function(){var de=D.useRef(null);function we(){_t.a.cancel(de.current)}function Oe(pe){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;we();var ce=Object(_t.a)(function(){ee<=1?pe({isCanceled:function(){return ce!==de.current}}):Oe(pe,ee-1)});de.current=ce}return D.useEffect(function(){return function(){we()}},[]),[Oe,we]},Tt=[wt,St,en,Qe],ln=!1,Ht=!0;function Et(de){return de===en||de===Qe}var fn=function(de,we){var Oe=D.useState(Gt),pe=Object(j.a)(Oe,2),ee=pe[0],ce=pe[1],ie=tn(),ge=Object(j.a)(ie,2),ve=ge[0],Le=ge[1];function Ce(){ce(wt)}return Jt(function(){if(ee!==Gt&&ee!==Qe){var Be=Tt.indexOf(ee),Je=Tt[Be+1],mt=we(ee);mt===ln?ce(Je):ve(function(pt){function Dt(){if(pt.isCanceled())return;ce(Je)}mt===!0?Dt():Promise.resolve(mt).then(Dt)})}},[de,ee]),D.useEffect(function(){return function(){Le()}},[]),[Ce,ee]},nn=function(de){var we=Object(D.useRef)(),Oe=Object(D.useRef)(de);Oe.current=de;var pe=D.useCallback(function(ie){Oe.current(ie)},[]);function ee(ie){ie&&(ie.removeEventListener(bt,pe),ie.removeEventListener(Ge,pe))}function ce(ie){we.current&&we.current!==ie&&ee(we.current),ie&&ie!==we.current&&(ie.addEventListener(bt,pe),ie.addEventListener(Ge,pe),we.current=ie)}return D.useEffect(function(){return function(){ee(we.current)}},[]),[ce,ee]};function rn(de,we,Oe,pe){var ee=pe.motionEnter,ce=ee===void 0?!0:ee,ie=pe.motionAppear,ge=ie===void 0?!0:ie,ve=pe.motionLeave,Le=ve===void 0?!0:ve,Ce=pe.motionDeadline,Be=pe.motionLeaveImmediately,Je=pe.onAppearPrepare,mt=pe.onEnterPrepare,pt=pe.onLeavePrepare,Dt=pe.onAppearStart,gn=pe.onEnterStart,Cn=pe.onLeaveStart,En=pe.onAppearActive,Tn=pe.onEnterActive,An=pe.onLeaveActive,Sn=pe.onAppearEnd,wn=pe.onEnterEnd,Fn=pe.onLeaveEnd,In=pe.onVisibleChanged,vi=It(),kn=Object(j.a)(vi,2),hn=kn[0],on=kn[1],Pn=It(je),jn=Object(j.a)(Pn,2),qt=jn[0],Gn=jn[1],yi=It(null),Yn=Object(j.a)(yi,2),oi=Yn[0],ii=Yn[1],Ri=Object(D.useRef)(!1),Bi=Object(D.useRef)(null),bi=Object(D.useRef)(!1),$i=Object(D.useRef)(null);function br(){var ui=Oe();return ui||$i.current}var ar=Object(D.useRef)(!1);function Fi(ui){var ni=br();if(ui&&!ui.deadline&&ui.target!==ni)return;var ji;qt===Ft&&ar.current?ji=Sn==null?void 0:Sn(ni,ui):qt===Ie&&ar.current?ji=wn==null?void 0:wn(ni,ui):qt===Zt&&ar.current&&(ji=Fn==null?void 0:Fn(ni,ui)),ji!==!1&&!bi.current&&(Gn(je),ii(null))}var di=nn(Fi),si=Object(j.a)(di,1),Ei=si[0],_i=D.useMemo(function(){var ui,ni,ji;switch(qt){case"appear":return ui={},Object(oe.a)(ui,wt,Je),Object(oe.a)(ui,St,Dt),Object(oe.a)(ui,en,En),ui;case"enter":return ni={},Object(oe.a)(ni,wt,mt),Object(oe.a)(ni,St,gn),Object(oe.a)(ni,en,Tn),ni;case"leave":return ji={},Object(oe.a)(ji,wt,pt),Object(oe.a)(ji,St,Cn),Object(oe.a)(ji,en,An),ji;default:return{}}},[qt]),Er=fn(qt,function(ui){if(ui===wt){var ni=_i[wt];return ni?ni(br()):ln}if(ri in _i){var ji;ii(((ji=_i[ri])===null||ji===void 0?void 0:ji.call(_i,br(),null))||null)}return ri===en&&(Ei(br()),Ce>0&&(clearTimeout(Bi.current),Bi.current=setTimeout(function(){Fi({deadline:!0})},Ce))),Ht}),Mr=Object(j.a)(Er,2),Pr=Mr[0],ri=Mr[1],Cr=Et(ri);ar.current=Cr,Jt(function(){on(we);var ui=Ri.current;if(Ri.current=!0,!de)return;var ni;!ui&&we&&ge&&(ni=Ft),ui&&we&&ce&&(ni=Ie),(ui&&!we&&Le||!ui&&Be&&!we&&Le)&&(ni=Zt),ni&&(Gn(ni),Pr())},[we]),Object(D.useEffect)(function(){(qt===Ft&&!ge||qt===Ie&&!ce||qt===Zt&&!Le)&&Gn(je)},[ge,ce,Le]),Object(D.useEffect)(function(){return function(){clearTimeout(Bi.current),bi.current=!0}},[]),Object(D.useEffect)(function(){hn!==void 0&&qt===je&&(In==null||In(hn))},[hn,qt]);var Nr=oi;return _i[wt]&&ri===St&&(Nr=Object(X.a)({transition:"none"},Nr)),[qt,ri,Nr,hn!=null?hn:we]}var Yt=function(de){Object(E.a)(Oe,de);var we=Object(b.a)(Oe);function Oe(){return Object(R.a)(this,Oe),we.apply(this,arguments)}return Object(O.a)(Oe,[{key:"render",value:function(){return this.props.children}}]),Oe}(D.Component),Ln=Yt;function Xn(de){var we=de;Object(N.a)(de)==="object"&&(we=de.transitionSupport);function Oe(ee){return!!(ee.motionName&&we)}var pe=D.forwardRef(function(ee,ce){var ie=ee.visible,ge=ie===void 0?!0:ie,ve=ee.removeOnLeave,Le=ve===void 0?!0:ve,Ce=ee.forceRender,Be=ee.children,Je=ee.motionName,mt=ee.leavedClassName,pt=ee.eventProps,Dt=Oe(ee),gn=Object(D.useRef)(),Cn=Object(D.useRef)();function En(){try{return Object(Ot.a)(gn.current||Cn.current)}catch(Gn){return null}}var Tn=rn(Dt,ge,En,ee),An=Object(j.a)(Tn,4),Sn=An[0],wn=An[1],Fn=An[2],In=An[3],vi=D.useRef(In);In&&(vi.current=!0);var kn=Object(D.useRef)(ce);kn.current=ce;var hn=D.useCallback(function(Gn){gn.current=Gn,Object(Rt.b)(kn.current,Gn)},[]),on,Pn=Object(X.a)(Object(X.a)({},pt),{},{visible:ge});if(!Be)on=null;else if(Sn===je||!Oe(ee))In?on=Be(Object(X.a)({},Pn),hn):!Le&&vi.current?on=Be(Object(X.a)(Object(X.a)({},Pn),{},{className:mt}),hn):Ce?on=Be(Object(X.a)(Object(X.a)({},Pn),{},{style:{display:"none"}}),hn):on=null;else{var jn,qt;wn===wt?qt="prepare":Et(wn)?qt="active":wn===St&&(qt="start"),on=Be(Object(X.a)(Object(X.a)({},Pn),{},{className:K()(nt(Je,Sn),(jn={},Object(oe.a)(jn,nt(Je,"".concat(Sn,"-").concat(qt)),qt),Object(oe.a)(jn,Je,typeof Je=="string"),jn)),style:Fn}),hn)}return D.createElement(Ln,{ref:Cn},on)});return pe.displayName="CSSMotion",pe}var Kn=Xn(ft),$e="add",Kt="keep",zn="remove",bn="removed";function pn(de){var we;return de&&Object(N.a)(de)==="object"&&"key"in de?we=de:we={key:de},Object(X.a)(Object(X.a)({},we),{},{key:String(we.key)})}function Mn(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return de.map(pn)}function G(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Oe=[],pe=0,ee=we.length,ce=Mn(de),ie=Mn(we);ce.forEach(function(Le){for(var Ce=!1,Be=pe;Be<ee;Be+=1){var Je=ie[Be];if(Je.key===Le.key){pe<Be&&(Oe=Oe.concat(ie.slice(pe,Be).map(function(mt){return Object(X.a)(Object(X.a)({},mt),{},{status:$e})})),pe=Be),Oe.push(Object(X.a)(Object(X.a)({},Je),{},{status:Kt})),pe+=1,Ce=!0;break}}Ce||Oe.push(Object(X.a)(Object(X.a)({},Le),{},{status:zn}))}),pe<ee&&(Oe=Oe.concat(ie.slice(pe).map(function(Le){return Object(X.a)(Object(X.a)({},Le),{},{status:$e})})));var ge={};Oe.forEach(function(Le){var Ce=Le.key;ge[Ce]=(ge[Ce]||0)+1});var ve=Object.keys(ge).filter(function(Le){return ge[Le]>1});return ve.forEach(function(Le){Oe=Oe.filter(function(Ce){var Be=Ce.key,Je=Ce.status;return Be!==Le||Je!==zn}),Oe.forEach(function(Ce){Ce.key===Le&&(Ce.status=Kt)})}),Oe}var v=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function S(de){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kn,Oe=function(pe){Object(E.a)(ce,pe);var ee=Object(b.a)(ce);function ce(){var ie;return Object(R.a)(this,ce),ie=ee.apply(this,arguments),ie.state={keyEntities:[]},ie.removeKey=function(ge){ie.setState(function(ve){var Le=ve.keyEntities;return{keyEntities:Le.map(function(Ce){return Ce.key!==ge?Ce:Object(X.a)(Object(X.a)({},Ce),{},{status:bn})})}})},ie}return Object(O.a)(ce,[{key:"render",value:function(){var ge=this,ve=this.state.keyEntities,Le=this.props,Ce=Le.component,Be=Le.children,Je=Le.onVisibleChanged,mt=Object(M.a)(Le,["component","children","onVisibleChanged"]),pt=Ce||D.Fragment,Dt={};return v.forEach(function(gn){Dt[gn]=mt[gn],delete mt[gn]}),delete mt.keys,D.createElement(pt,mt,ve.map(function(gn){var Cn=gn.status,En=Object(M.a)(gn,["status"]),Tn=Cn===$e||Cn===Kt;return D.createElement(we,Object(x.a)({},Dt,{key:En.key,visible:Tn,eventProps:En,onVisibleChanged:function(Sn){Je==null||Je(Sn,{key:En.key}),Sn||ge.removeKey(En.key)}}),Be)}))}}],[{key:"getDerivedStateFromProps",value:function(ge,ve){var Le=ge.keys,Ce=ve.keyEntities,Be=Mn(Le),Je=G(Ce,Be);return{keyEntities:Je.filter(function(mt){var pt=Ce.find(function(Dt){var gn=Dt.key;return mt.key===gn});return!(pt&&pt.status===bn&&mt.status===zn)})}}}]),ce}(D.Component);return Oe.defaultProps={component:"div"},Oe}var B=S(ft),q=Kn;function W(de){var we=de.prefixCls,Oe=de.motion,pe=de.animation,ee=de.transitionName;return Oe||(pe?{motionName:"".concat(we,"-").concat(pe)}:ee?{motionName:ee}:null)}function ue(de){var we=de.prefixCls,Oe=de.visible,pe=de.zIndex,ee=de.mask,ce=de.maskMotion,ie=de.maskAnimation,ge=de.maskTransitionName;if(!ee)return null;var ve={};return(ce||ge||ie)&&(ve=Object(X.a)({motionAppear:!0},W({motion:ce,prefixCls:we,transitionName:ge,animation:ie}))),D.createElement(q,Object(x.a)({},ve,{visible:Oe,removeOnLeave:!0}),function(Le){var Ce=Le.className;return D.createElement("div",{style:{zIndex:pe},className:K()("".concat(we,"-mask"),Ce)})})}var We=Z("9mu1"),Ye=Z("o0o1"),Lt=Z.n(Ye),Ke=Z("HaE+"),gt=["measure","align",null,"motion"],an=function(de,we){var Oe=Object(D.useState)(null),pe=Object(j.a)(Oe,2),ee=pe[0],ce=pe[1],ie=Object(D.useRef)(),ge=Object(D.useRef)(!1);function ve(Be){ge.current||ce(Be)}function Le(){_t.a.cancel(ie.current)}function Ce(Be){Le(),ie.current=Object(_t.a)(function(){ve(function(Je){switch(ee){case"align":return"motion";case"motion":return"stable";default:}return Je}),Be==null||Be()})}return Object(D.useEffect)(function(){ve("measure")},[de]),Object(D.useEffect)(function(){switch(ee){case"measure":we();break;default:}ee&&(ie.current=Object(_t.a)(Object(Ke.a)(Lt.a.mark(function Be(){var Je,mt;return Lt.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:Je=gt.indexOf(ee),mt=gt[Je+1],mt&&Je!==-1&&ve(mt);case 3:case"end":return Dt.stop()}},Be)}))))},[ee]),Object(D.useEffect)(function(){return function(){ge.current=!0,Le()}},[]),[ee,Ce]},Hn=function(de){var we=D.useState({width:0,height:0}),Oe=Object(j.a)(we,2),pe=Oe[0],ee=Oe[1];function ce(ge){ee({width:ge.offsetWidth,height:ge.offsetHeight})}var ie=D.useMemo(function(){var ge={};if(de){var ve=pe.width,Le=pe.height;de.indexOf("height")!==-1&&Le?ge.height=Le:de.indexOf("minHeight")!==-1&&Le&&(ge.minHeight=Le),de.indexOf("width")!==-1&&ve?ge.width=ve:de.indexOf("minWidth")!==-1&&ve&&(ge.minWidth=ve)}return ge},[de,pe]);return[ie,ce]},qn=D.forwardRef(function(de,we){var Oe=de.visible,pe=de.prefixCls,ee=de.className,ce=de.style,ie=de.children,ge=de.zIndex,ve=de.stretch,Le=de.destroyPopupOnHide,Ce=de.forceRender,Be=de.align,Je=de.point,mt=de.getRootDomNode,pt=de.getClassNameFromAlign,Dt=de.onAlign,gn=de.onMouseEnter,Cn=de.onMouseLeave,En=de.onMouseDown,Tn=de.onTouchStart,An=Object(D.useRef)(),Sn=Object(D.useRef)(),wn=Object(D.useState)(),Fn=Object(j.a)(wn,2),In=Fn[0],vi=Fn[1],kn=Hn(ve),hn=Object(j.a)(kn,2),on=hn[0],Pn=hn[1];function jn(){ve&&Pn(mt())}var qt=an(Oe,jn),Gn=Object(j.a)(qt,2),yi=Gn[0],Yn=Gn[1],oi=Object(D.useRef)();function ii(){return Je||mt}function Ri(){var di;(di=An.current)===null||di===void 0||di.forceAlign()}function Bi(di,si){var Ei=pt(si);In!==Ei&&vi(Ei),yi==="align"&&(In!==Ei?Promise.resolve().then(function(){Ri()}):Yn(function(){var _i;(_i=oi.current)===null||_i===void 0||_i.call(oi)}),Dt==null||Dt(di,si))}var bi=Object(X.a)({},W(de));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(di){var si=bi[di];bi[di]=function(Ei,_i){return Yn(),si==null?void 0:si(Ei,_i)}});function $i(){return new Promise(function(di){oi.current=di})}D.useEffect(function(){!bi.motionName&&yi==="motion"&&Yn()},[bi.motionName,yi]),D.useImperativeHandle(we,function(){return{forceAlign:Ri,getElement:function(){return Sn.current}}});var br=Object(X.a)(Object(X.a)({},on),{},{zIndex:ge,opacity:yi==="motion"||yi==="stable"||!Oe?void 0:0,pointerEvents:yi==="stable"?void 0:"none"},ce),ar=!0;(Be==null?void 0:Be.points)&&(yi==="align"||yi==="stable")&&(ar=!1);var Fi=ie;return D.Children.count(ie)>1&&(Fi=D.createElement("div",{className:"".concat(pe,"-content")},ie)),D.createElement(q,Object(x.a)({visible:Oe,ref:Sn,leavedClassName:"".concat(pe,"-hidden")},bi,{onAppearPrepare:$i,onEnterPrepare:$i,removeOnLeave:Le,forceRender:Ce}),function(di,si){var Ei=di.className,_i=di.style,Er=K()(pe,ee,In,Ei);return D.createElement(We.a,{target:ii(),key:"popup",ref:An,monitorWindowResize:!0,disabled:ar,align:Be,onAlign:Bi},D.createElement("div",{ref:si,className:Er,onMouseEnter:gn,onMouseLeave:Cn,onMouseDownCapture:En,onTouchStartCapture:Tn,style:Object(X.a)(Object(X.a)({},_i),br)},Fi))})});qn.displayName="PopupInner";var yn=qn,Nt=D.forwardRef(function(de,we){var Oe=de.prefixCls,pe=de.visible,ee=de.zIndex,ce=de.children,ie=de.mobile;ie=ie===void 0?{}:ie;var ge=ie.popupClassName,ve=ie.popupStyle,Le=ie.popupMotion,Ce=Le===void 0?{}:Le,Be=ie.popupRender,Je=D.useRef();D.useImperativeHandle(we,function(){return{forceAlign:function(){},getElement:function(){return Je.current}}});var mt=Object(X.a)({zIndex:ee},ve),pt=ce;return D.Children.count(ce)>1&&(pt=D.createElement("div",{className:"".concat(Oe,"-content")},ce)),Be&&(pt=Be(pt)),D.createElement(q,Object(x.a)({visible:pe,ref:Je,removeOnLeave:!0},Ce),function(Dt,gn){var Cn=Dt.className,En=Dt.style,Tn=K()(Oe,ge,Cn);return D.createElement("div",{ref:gn,className:Tn,style:Object(X.a)(Object(X.a)({},En),mt)},pt)})});Nt.displayName="MobilePopupInner";var jt=Nt,un=["visible","mobile"],cn=D.forwardRef(function(de,we){var Oe=de.visible,pe=de.mobile,ee=Object(M.a)(de,un),ce=Object(D.useState)(Oe),ie=Object(j.a)(ce,2),ge=ie[0],ve=ie[1],Le=Object(D.useState)(!1),Ce=Object(j.a)(Le,2),Be=Ce[0],Je=Ce[1],mt=Object(X.a)(Object(X.a)({},ee),{},{visible:ge});Object(D.useEffect)(function(){ve(Oe),Oe&&pe&&Je(Ae())},[Oe,pe]);var pt=Be?D.createElement(jt,Object(x.a)({},mt,{mobile:pe,ref:we})):D.createElement(yn,Object(x.a)({},mt,{ref:we}));return D.createElement("div",null,D.createElement(ue,mt),pt)});cn.displayName="Popup";var xn=cn,$n=D.createContext(null),mn=$n;function ci(){}function cr(){return""}function gr(de){return de?de.ownerDocument:window.document}var _r=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Wr(de){var we=function(Oe){Object(E.a)(ee,Oe);var pe=Object(b.a)(ee);function ee(ce){var ie;Object(R.a)(this,ee),ie=pe.call(this,ce),ie.popupRef=D.createRef(),ie.triggerRef=D.createRef(),ie.attachId=void 0,ie.clickOutsideHandler=void 0,ie.touchOutsideHandler=void 0,ie.contextMenuOutsideHandler1=void 0,ie.contextMenuOutsideHandler2=void 0,ie.mouseDownTimeout=void 0,ie.focusTime=void 0,ie.preClickTime=void 0,ie.preTouchTime=void 0,ie.delayTimer=void 0,ie.hasPopupMouseDown=void 0,ie.onMouseEnter=function(ve){var Le=ie.props.mouseEnterDelay;ie.fireEvents("onMouseEnter",ve),ie.delaySetPopupVisible(!0,Le,Le?null:ve)},ie.onMouseMove=function(ve){ie.fireEvents("onMouseMove",ve),ie.setPoint(ve)},ie.onMouseLeave=function(ve){ie.fireEvents("onMouseLeave",ve),ie.delaySetPopupVisible(!1,ie.props.mouseLeaveDelay)},ie.onPopupMouseEnter=function(){ie.clearDelayTimer()},ie.onPopupMouseLeave=function(ve){var Le;if(ve.relatedTarget&&!ve.relatedTarget.setTimeout&&Object(Vt.a)((Le=ie.popupRef.current)===null||Le===void 0?void 0:Le.getElement(),ve.relatedTarget))return;ie.delaySetPopupVisible(!1,ie.props.mouseLeaveDelay)},ie.onFocus=function(ve){ie.fireEvents("onFocus",ve),ie.clearDelayTimer(),ie.isFocusToShow()&&(ie.focusTime=Date.now(),ie.delaySetPopupVisible(!0,ie.props.focusDelay))},ie.onMouseDown=function(ve){ie.fireEvents("onMouseDown",ve),ie.preClickTime=Date.now()},ie.onTouchStart=function(ve){ie.fireEvents("onTouchStart",ve),ie.preTouchTime=Date.now()},ie.onBlur=function(ve){ie.fireEvents("onBlur",ve),ie.clearDelayTimer(),ie.isBlurToHide()&&ie.delaySetPopupVisible(!1,ie.props.blurDelay)},ie.onContextMenu=function(ve){ve.preventDefault(),ie.fireEvents("onContextMenu",ve),ie.setPopupVisible(!0,ve)},ie.onContextMenuClose=function(){ie.isContextMenuToShow()&&ie.close()},ie.onClick=function(ve){if(ie.fireEvents("onClick",ve),ie.focusTime){var Le;if(ie.preClickTime&&ie.preTouchTime?Le=Math.min(ie.preClickTime,ie.preTouchTime):ie.preClickTime?Le=ie.preClickTime:ie.preTouchTime&&(Le=ie.preTouchTime),Math.abs(Le-ie.focusTime)<20)return;ie.focusTime=0}ie.preClickTime=0,ie.preTouchTime=0,ie.isClickToShow()&&(ie.isClickToHide()||ie.isBlurToHide())&&ve&&ve.preventDefault&&ve.preventDefault();var Ce=!ie.state.popupVisible;(ie.isClickToHide()&&!Ce||Ce&&ie.isClickToShow())&&ie.setPopupVisible(!ie.state.popupVisible,ve)},ie.onPopupMouseDown=function(){if(ie.hasPopupMouseDown=!0,clearTimeout(ie.mouseDownTimeout),ie.mouseDownTimeout=window.setTimeout(function(){ie.hasPopupMouseDown=!1},0),ie.context){var ve;(ve=ie.context).onPopupMouseDown.apply(ve,arguments)}},ie.onDocumentClick=function(ve){if(ie.props.mask&&!ie.props.maskClosable)return;var Le=ve.target,Ce=ie.getRootDomNode(),Be=ie.getPopupDomNode();(!Object(Vt.a)(Ce,Le)||ie.isContextMenuOnly())&&!Object(Vt.a)(Be,Le)&&!ie.hasPopupMouseDown&&ie.close()},ie.getRootDomNode=function(){var ve=ie.props.getTriggerDOMNode;if(ve)return ve(ie.triggerRef.current);try{var Le=Object(Ot.a)(ie.triggerRef.current);if(Le)return Le}catch(Ce){}return Ct.a.findDOMNode(Object(w.a)(ie))},ie.getPopupClassNameFromAlign=function(ve){var Le=[],Ce=ie.props,Be=Ce.popupPlacement,Je=Ce.builtinPlacements,mt=Ce.prefixCls,pt=Ce.alignPoint,Dt=Ce.getPopupClassNameFromAlign;return Be&&Je&&Le.push(at(Je,mt,ve,pt)),Dt&&Le.push(Dt(ve)),Le.join(" ")},ie.getComponent=function(){var ve=ie.props,Le=ve.prefixCls,Ce=ve.destroyPopupOnHide,Be=ve.popupClassName,Je=ve.onPopupAlign,mt=ve.popupMotion,pt=ve.popupAnimation,Dt=ve.popupTransitionName,gn=ve.popupStyle,Cn=ve.mask,En=ve.maskAnimation,Tn=ve.maskTransitionName,An=ve.maskMotion,Sn=ve.zIndex,wn=ve.popup,Fn=ve.stretch,In=ve.alignPoint,vi=ve.mobile,kn=ve.forceRender,hn=ie.state,on=hn.popupVisible,Pn=hn.point,jn=ie.getPopupAlign(),qt={};return ie.isMouseEnterToShow()&&(qt.onMouseEnter=ie.onPopupMouseEnter),ie.isMouseLeaveToHide()&&(qt.onMouseLeave=ie.onPopupMouseLeave),qt.onMouseDown=ie.onPopupMouseDown,qt.onTouchStart=ie.onPopupMouseDown,D.createElement(xn,Object(x.a)({prefixCls:Le,destroyPopupOnHide:Ce,visible:on,point:In&&Pn,className:Be,align:jn,onAlign:Je,animation:pt,getClassNameFromAlign:ie.getPopupClassNameFromAlign},qt,{stretch:Fn,getRootDomNode:ie.getRootDomNode,style:gn,mask:Cn,zIndex:Sn,transitionName:Dt,maskAnimation:En,maskTransitionName:Tn,maskMotion:An,ref:ie.popupRef,motion:mt,mobile:vi,forceRender:kn}),typeof wn=="function"?wn():wn)},ie.attachParent=function(ve){_t.a.cancel(ie.attachId);var Le=ie.props,Ce=Le.getPopupContainer,Be=Le.getDocument,Je=ie.getRootDomNode(),mt;Ce?(Je||Ce.length===0)&&(mt=Ce(Je)):mt=Be(ie.getRootDomNode()).body,mt?mt.appendChild(ve):ie.attachId=Object(_t.a)(function(){ie.attachParent(ve)})},ie.getContainer=function(){var ve=ie.props.getDocument,Le=ve(ie.getRootDomNode()).createElement("div");return Le.style.position="absolute",Le.style.top="0",Le.style.left="0",Le.style.width="100%",ie.attachParent(Le),Le},ie.setPoint=function(ve){var Le=ie.props.alignPoint;if(!Le||!ve)return;ie.setState({point:{pageX:ve.pageX,pageY:ve.pageY}})},ie.handlePortalUpdate=function(){ie.state.prevPopupVisible!==ie.state.popupVisible&&ie.props.afterPopupVisibleChange(ie.state.popupVisible)},ie.triggerContextValue={onPopupMouseDown:ie.onPopupMouseDown};var ge;return"popupVisible"in ce?ge=!!ce.popupVisible:ge=!!ce.defaultPopupVisible,ie.state={prevPopupVisible:ge,popupVisible:ge},_r.forEach(function(ve){ie["fire".concat(ve)]=function(Le){ie.fireEvents(ve,Le)}}),ie}return Object(O.a)(ee,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ie=this.props,ge=this.state;if(ge.popupVisible){var ve;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ve=ie.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ve.a)(ve,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ve=ve||ie.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ve.a)(ve,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ve=ve||ie.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ve.a)(ve,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ve.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),_t.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var ie;return((ie=this.popupRef.current)===null||ie===void 0?void 0:ie.getElement())||null}},{key:"getPopupAlign",value:function(){var ie=this.props,ge=ie.popupPlacement,ve=ie.popupAlign,Le=ie.builtinPlacements;return ge&&Le?ze(Le,ge,ve):ve}},{key:"setPopupVisible",value:function(ie,ge){var ve=this.props.alignPoint,Le=this.state.popupVisible;this.clearDelayTimer(),Le!==ie&&("popupVisible"in this.props||this.setState({popupVisible:ie,prevPopupVisible:Le}),this.props.onPopupVisibleChange(ie)),ve&&ge&&ie&&this.setPoint(ge)}},{key:"delaySetPopupVisible",value:function(ie,ge,ve){var Le=this,Ce=ge*1e3;if(this.clearDelayTimer(),Ce){var Be=ve?{pageX:ve.pageX,pageY:ve.pageY}:null;this.delayTimer=window.setTimeout(function(){Le.setPopupVisible(ie,Be),Le.clearDelayTimer()},Ce)}else this.setPopupVisible(ie,ve)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(ie){var ge=this.props.children.props,ve=this.props;return ge[ie]&&ve[ie]?this["fire".concat(ie)]:ge[ie]||ve[ie]}},{key:"isClickToShow",value:function(){var ie=this.props,ge=ie.action,ve=ie.showAction;return ge.indexOf("click")!==-1||ve.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var ie=this.props.action;return ie==="contextMenu"||ie.length===1&&ie[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var ie=this.props,ge=ie.action,ve=ie.showAction;return ge.indexOf("contextMenu")!==-1||ve.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var ie=this.props,ge=ie.action,ve=ie.hideAction;return ge.indexOf("click")!==-1||ve.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var ie=this.props,ge=ie.action,ve=ie.showAction;return ge.indexOf("hover")!==-1||ve.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var ie=this.props,ge=ie.action,ve=ie.hideAction;return ge.indexOf("hover")!==-1||ve.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var ie=this.props,ge=ie.action,ve=ie.showAction;return ge.indexOf("focus")!==-1||ve.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var ie=this.props,ge=ie.action,ve=ie.hideAction;return ge.indexOf("focus")!==-1||ve.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var ie;(ie=this.popupRef.current)===null||ie===void 0||ie.forceAlign()}}},{key:"fireEvents",value:function(ie,ge){var ve=this.props.children.props[ie];ve&&ve(ge);var Le=this.props[ie];Le&&Le(ge)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var ie=this.state.popupVisible,ge=this.props,ve=ge.children,Le=ge.forceRender,Ce=ge.alignPoint,Be=ge.className,Je=ge.autoDestroy,mt=D.Children.only(ve),pt={key:"trigger"};this.isContextMenuToShow()?pt.onContextMenu=this.onContextMenu:pt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(pt.onClick=this.onClick,pt.onMouseDown=this.onMouseDown,pt.onTouchStart=this.onTouchStart):(pt.onClick=this.createTwoChains("onClick"),pt.onMouseDown=this.createTwoChains("onMouseDown"),pt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(pt.onMouseEnter=this.onMouseEnter,Ce&&(pt.onMouseMove=this.onMouseMove)):pt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?pt.onMouseLeave=this.onMouseLeave:pt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(pt.onFocus=this.onFocus,pt.onBlur=this.onBlur):(pt.onFocus=this.createTwoChains("onFocus"),pt.onBlur=this.createTwoChains("onBlur"));var Dt=K()(mt&&mt.props&&mt.props.className,Be);Dt&&(pt.className=Dt);var gn=Object(X.a)({},pt);Object(Rt.c)(mt)&&(gn.ref=Object(Rt.a)(this.triggerRef,mt.ref));var Cn=D.cloneElement(mt,gn),En;return(ie||this.popupRef.current||Le)&&(En=D.createElement(de,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!ie&&Je&&(En=null),D.createElement(mn.Provider,{value:this.triggerContextValue},Cn,En)}}],[{key:"getDerivedStateFromProps",value:function(ie,ge){var ve=ie.popupVisible,Le={};return ve!==void 0&&ge.popupVisible!==ve&&(Le.popupVisible=ve,Le.prevPopupVisible=ge.popupVisible),Le}}]),ee}(D.Component);return we.contextType=mn,we.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:cr,getDocument:gr,onPopupVisibleChange:ci,afterPopupVisibleChange:ci,onPopupAlign:ci,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},we}var fi=Wr(Xt.a),Di={adjustX:1,adjustY:1},dr={topLeft:{points:["bl","tl"],overflow:Di,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Di,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Di,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Di,offset:[4,0]}},Gr={topLeft:{points:["bl","tl"],overflow:Di,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Di,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Di,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Di,offset:[4,0]}},Ar=dr,ai=0,Un={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},pi=function(we,Oe,pe){var ee=Xe(Oe),ce=we.getState();we.setState({defaultActiveFirst:Object(X.a)(Object(X.a)({},ce.defaultActiveFirst),{},Object(oe.a)({},ee,pe))})},_n=function(de){Object(E.a)(Oe,de);var we=Object(b.a)(Oe);function Oe(pe){var ee;Object(R.a)(this,Oe),ee=we.call(this,pe),ee.onDestroy=function(Ce){ee.props.onDestroy(Ce)},ee.onKeyDown=function(Ce){var Be=Ce.keyCode,Je=ee.menuInstance,mt=ee.props.store,pt=ee.getVisible();if(Be===f.a.ENTER)return ee.onTitleClick(Ce),pi(mt,ee.props.eventKey,!0),!0;if(Be===f.a.RIGHT)return pt?Je.onKeyDown(Ce):(ee.triggerOpenChange(!0),pi(mt,ee.props.eventKey,!0)),!0;if(Be===f.a.LEFT){var Dt;if(pt)Dt=Je.onKeyDown(Ce);else return;return Dt||(ee.triggerOpenChange(!1),Dt=!0),Dt}return pt&&(Be===f.a.UP||Be===f.a.DOWN)?Je.onKeyDown(Ce):void 0},ee.onOpenChange=function(Ce){ee.props.onOpenChange(Ce)},ee.onPopupVisibleChange=function(Ce){ee.triggerOpenChange(Ce,Ce?"mouseenter":"mouseleave")},ee.onMouseEnter=function(Ce){var Be=ee.props,Je=Be.eventKey,mt=Be.onMouseEnter,pt=Be.store;pi(pt,ee.props.eventKey,!1),mt({key:Je,domEvent:Ce})},ee.onMouseLeave=function(Ce){var Be=ee.props,Je=Be.parentMenu,mt=Be.eventKey,pt=Be.onMouseLeave;Je.subMenuInstance=Object(w.a)(ee),pt({key:mt,domEvent:Ce})},ee.onTitleMouseEnter=function(Ce){var Be=ee.props,Je=Be.eventKey,mt=Be.onItemHover,pt=Be.onTitleMouseEnter;mt({key:Je,hover:!0}),pt({key:Je,domEvent:Ce})},ee.onTitleMouseLeave=function(Ce){var Be=ee.props,Je=Be.parentMenu,mt=Be.eventKey,pt=Be.onItemHover,Dt=Be.onTitleMouseLeave;Je.subMenuInstance=Object(w.a)(ee),pt({key:mt,hover:!1}),Dt({key:mt,domEvent:Ce})},ee.onTitleClick=function(Ce){var Be=Object(w.a)(ee),Je=Be.props;if(Je.onTitleClick({key:Je.eventKey,domEvent:Ce}),Je.triggerSubMenuAction==="hover")return;ee.triggerOpenChange(!ee.getVisible(),"click"),pi(Je.store,ee.props.eventKey,!1)},ee.onSubMenuClick=function(Ce){typeof ee.props.onClick=="function"&&ee.props.onClick(ee.addKeyPath(Ce))},ee.onSelect=function(Ce){ee.props.onSelect(Ce)},ee.onDeselect=function(Ce){ee.props.onDeselect(Ce)},ee.getPrefixCls=function(){return"".concat(ee.props.rootPrefixCls,"-submenu")},ee.getActiveClassName=function(){return"".concat(ee.getPrefixCls(),"-active")},ee.getDisabledClassName=function(){return"".concat(ee.getPrefixCls(),"-disabled")},ee.getSelectedClassName=function(){return"".concat(ee.getPrefixCls(),"-selected")},ee.getOpenClassName=function(){return"".concat(ee.props.rootPrefixCls,"-submenu-open")},ee.getVisible=function(){return ee.state.isOpen},ee.getMode=function(){return ee.state.mode},ee.saveMenuInstance=function(Ce){ee.menuInstance=Ce},ee.addKeyPath=function(Ce){return Object(X.a)(Object(X.a)({},Ce),{},{keyPath:(Ce.keyPath||[]).concat(ee.props.eventKey)})},ee.triggerOpenChange=function(Ce,Be){var Je=ee.props.eventKey,mt=function(){ee.onOpenChange({key:Je,item:Object(w.a)(ee),trigger:Be,open:Ce})};Be==="mouseenter"?ee.mouseenterTimeout=setTimeout(function(){mt()},0):mt()},ee.isChildrenSelected=function(){var Ce={find:!1};return dt(ee.props.children,ee.props.selectedKeys,Ce),Ce.find},ee.isInlineMode=function(){return ee.getMode()==="inline"},ee.adjustWidth=function(){if(!ee.subMenuTitle||!ee.menuInstance)return;var Ce=Pt.findDOMNode(ee.menuInstance);if(Ce.offsetWidth>=ee.subMenuTitle.offsetWidth)return;Ce.style.minWidth="".concat(ee.subMenuTitle.offsetWidth,"px")},ee.saveSubMenuTitle=function(Ce){ee.subMenuTitle=Ce},ee.getBaseProps=function(){var Ce=Object(w.a)(ee),Be=Ce.props,Je=ee.getMode();return{mode:Je==="horizontal"?"vertical":Je,visible:ee.getVisible(),level:Be.level+1,inlineIndent:Be.inlineIndent,focusable:!1,onClick:ee.onSubMenuClick,onSelect:ee.onSelect,onDeselect:ee.onDeselect,onDestroy:ee.onDestroy,selectedKeys:Be.selectedKeys,eventKey:"".concat(Be.eventKey,"-menu-"),openKeys:Be.openKeys,motion:Be.motion,onOpenChange:ee.onOpenChange,subMenuOpenDelay:Be.subMenuOpenDelay,parentMenu:Object(w.a)(ee),subMenuCloseDelay:Be.subMenuCloseDelay,forceSubMenuRender:Be.forceSubMenuRender,triggerSubMenuAction:Be.triggerSubMenuAction,builtinPlacements:Be.builtinPlacements,defaultActiveFirst:Be.store.getState().defaultActiveFirst[Xe(Be.eventKey)],multiple:Be.multiple,prefixCls:Be.rootPrefixCls,id:ee.internalMenuId,manualRef:ee.saveMenuInstance,itemIcon:Be.itemIcon,expandIcon:Be.expandIcon,direction:Be.direction}},ee.getMotion=function(Ce,Be){var Je=Object(w.a)(ee),mt=Je.haveRendered,pt=ee.props,Dt=pt.motion,gn=pt.rootPrefixCls,Cn=Object(X.a)(Object(X.a)({},Dt),{},{leavedClassName:"".concat(gn,"-hidden"),removeOnLeave:!1,motionAppear:mt||!Be||Ce!=="inline"});return Cn};var ce=pe.store,ie=pe.eventKey,ge=ce.getState(),ve=ge.defaultActiveFirst;ee.isRootMenu=!1;var Le=!1;return ve&&(Le=ve[ie]),pi(ce,ie,Le),ee.state={mode:pe.mode,isOpen:pe.isOpen},ee}return Object(O.a)(Oe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ee=this,ce=this.props,ie=ce.mode,ge=ce.parentMenu,ve=ce.manualRef,Le=ce.isOpen,Ce=function(){ee.setState({mode:ie,isOpen:Le})},Be=Le!==this.state.isOpen,Je=ie!==this.state.mode;if((Je||Be)&&(_t.a.cancel(this.updateStateRaf),Je?this.updateStateRaf=Object(_t.a)(Ce):Ce()),ve&&ve(this),ie!=="horizontal"||!(ge==null?void 0:ge.isRootMenu)||!Le)return;this.minWidthTimeout=setTimeout(function(){return ee.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ee=this.props,ce=ee.onDestroy,ie=ee.eventKey;ce&&ce(ie),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),_t.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ee,ce){var ie=this.getBaseProps();return D.createElement(Ci,Object(x.a)({},ie,{id:this.internalMenuId,className:ee,style:ce}),this.props.children)}},{key:"renderChildren",value:function(){var ee=this,ce=this.getBaseProps(),ie=ce.mode,ge=ce.visible,ve=ce.forceSubMenuRender,Le=ce.direction,Ce=this.getMotion(ie,ge);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ge||ve,!this.haveOpened)return D.createElement("div",null);var Be=K()("".concat(ce.prefixCls,"-sub"),Object(oe.a)({},"".concat(ce.prefixCls,"-rtl"),Le==="rtl"));return this.isInlineMode()?D.createElement(q,Object(x.a)({visible:ce.visible,forceRender:ve},Ce),function(Je){var mt=Je.className,pt=Je.style,Dt=K()(Be,mt);return ee.renderPopupMenu(Dt,pt)}):this.renderPopupMenu(Be)}},{key:"render",value:function(){var ee,ce,ie,ge=Object(X.a)({},this.props),ve=this.getVisible(),Le=this.getPrefixCls(),Ce=this.isInlineMode(),Be=this.getMode(),Je=K()(Le,"".concat(Le,"-").concat(Be),(ee={},Object(oe.a)(ee,ge.className,!!ge.className),Object(oe.a)(ee,this.getOpenClassName(),ve),Object(oe.a)(ee,this.getActiveClassName(),ge.active||ve&&!Ce),Object(oe.a)(ee,this.getDisabledClassName(),ge.disabled),Object(oe.a)(ee,this.getSelectedClassName(),this.isChildrenSelected()),ee));this.internalMenuId||(ge.eventKey?this.internalMenuId="".concat(ge.eventKey,"$Menu"):(ai+=1,this.internalMenuId="$__$".concat(ai,"$Menu")));var mt={},pt={},Dt={};ge.disabled||(mt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},pt={onClick:this.onTitleClick},Dt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var gn={},Cn=ge.direction,En=Cn==="rtl";Ce&&(En?gn.paddingRight=ge.inlineIndent*ge.level:gn.paddingLeft=ge.inlineIndent*ge.level);var Tn={};this.getVisible()&&(Tn={"aria-owns":this.internalMenuId});var An=null;Be!=="horizontal"&&(An=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(An=D.createElement(this.props.expandIcon,Object(X.a)({},this.props))));var Sn=D.createElement("div",Object(x.a)({ref:this.saveSubMenuTitle,style:gn,className:"".concat(Le,"-title"),role:"button"},Dt,pt,{"aria-expanded":ve},Tn,{"aria-haspopup":"true",title:typeof ge.title=="string"?ge.title:void 0}),ge.title,An||D.createElement("i",{className:"".concat(Le,"-arrow")})),wn=this.renderChildren(),Fn=((ce=ge.parentMenu)===null||ce===void 0?void 0:ce.isRootMenu)?ge.parentMenu.props.getPopupContainer:function(ii){return ii.parentNode},In=Un[Be],vi=ge.popupOffset?{offset:ge.popupOffset}:{},kn=K()((ie={},Object(oe.a)(ie,ge.popupClassName,ge.popupClassName&&!Ce),Object(oe.a)(ie,"".concat(Le,"-rtl"),En),ie)),hn=ge.disabled,on=ge.triggerSubMenuAction,Pn=ge.subMenuOpenDelay,jn=ge.forceSubMenuRender,qt=ge.subMenuCloseDelay,Gn=ge.builtinPlacements;vt.forEach(function(ii){return delete ge[ii]}),delete ge.onClick;var yi=En?Object(X.a)(Object(X.a)({},Gr),Gn):Object(X.a)(Object(X.a)({},dr),Gn);delete ge.direction;var Yn=this.getBaseProps(),oi=Ce?null:this.getMotion(Yn.mode,Yn.visible);return D.createElement("li",Object(x.a)({},ge,mt,{className:Je,role:"menuitem"}),D.createElement(fi,{prefixCls:Le,popupClassName:K()("".concat(Le,"-popup"),kn),getPopupContainer:Fn,builtinPlacements:yi,popupPlacement:In,popupVisible:Ce?!1:ve,popupAlign:vi,popup:Ce?null:wn,action:hn||Ce?[]:[on],mouseEnterDelay:Pn,mouseLeaveDelay:qt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:jn,popupMotion:oi},Sn),Ce?wn:null)}}]),Oe}(D.Component);_n.defaultProps={onMouseEnter:ct,onMouseLeave:ct,onTitleMouseEnter:ct,onTitleMouseLeave:ct,onTitleClick:ct,manualRef:ct,mode:"vertical",title:""};var mi=Object(l.b)(function(de,we){var Oe=de.openKeys,pe=de.activeKey,ee=de.selectedKeys,ce=we.eventKey,ie=we.subMenuKey;return{isOpen:Oe.indexOf(ce)>-1,active:pe[ie]===ce,selectedKeys:ee}})(_n);mi.isSubMenu=!0;var Jn=mi,nr="menuitem-overflowed",Si=.5,Pi=function(de){Object(E.a)(Oe,de);var we=Object(b.a)(Oe);function Oe(){var pe;return Object(R.a)(this,Oe),pe=we.apply(this,arguments),pe.resizeObserver=null,pe.mutationObserver=null,pe.originalTotalWidth=0,pe.overflowedItems=[],pe.menuItemSizes=[],pe.cancelFrameId=null,pe.state={lastVisibleIndex:void 0},pe.childRef=D.createRef(),pe.getMenuItemNodes=function(){var ee=pe.props.prefixCls,ce=pe.childRef.current;return ce?[].slice.call(ce.children).filter(function(ie){return ie.className.split(" ").indexOf("".concat(ee,"-overflowed-submenu"))<0}):[]},pe.getOverflowedSubMenuItem=function(ee,ce,ie){var ge=pe.props,ve=ge.overflowedIndicator,Le=ge.level,Ce=ge.mode,Be=ge.prefixCls,Je=ge.theme;if(Le!==1||Ce!=="horizontal")return null;var mt=pe.props.children[0],pt=mt.props,Dt=pt.children,gn=pt.title,Cn=pt.style,En=Object(M.a)(pt,["children","title","style"]),Tn=Object(X.a)({},Cn),An="".concat(ee,"-overflowed-indicator"),Sn="".concat(ee,"-overflowed-indicator");ce.length===0&&ie!==!0?Tn=Object(X.a)(Object(X.a)({},Tn),{},{display:"none"}):ie&&(Tn=Object(X.a)(Object(X.a)({},Tn),{},{visibility:"hidden",position:"absolute"}),An="".concat(An,"-placeholder"),Sn="".concat(Sn,"-placeholder"));var wn=Je?"".concat(Be,"-").concat(Je):"",Fn={};return vt.forEach(function(In){En[In]!==void 0&&(Fn[In]=En[In])}),D.createElement(Jn,Object(x.a)({title:ve,className:"".concat(Be,"-overflowed-submenu"),popupClassName:wn},Fn,{key:An,eventKey:Sn,disabled:!1,style:Tn}),ce)},pe.setChildrenWidthAndResize=function(){if(pe.props.mode!=="horizontal")return;var ee=pe.childRef.current;if(!ee)return;var ce=ee.children;if(!ce||ce.length===0)return;var ie=ee.children[ce.length-1];tt(ie,"display","inline-block");var ge=pe.getMenuItemNodes(),ve=ge.filter(function(Le){return Le.className.split(" ").indexOf(nr)>=0});ve.forEach(function(Le){tt(Le,"display","inline-block")}),pe.menuItemSizes=ge.map(function(Le){return st(Le,!0)}),ve.forEach(function(Le){tt(Le,"display","none")}),pe.overflowedIndicatorWidth=st(ee.children[ee.children.length-1],!0),pe.originalTotalWidth=pe.menuItemSizes.reduce(function(Le,Ce){return Le+Ce},0),pe.handleResize(),tt(ie,"display","none")},pe.handleResize=function(){if(pe.props.mode!=="horizontal")return;var ee=pe.childRef.current;if(!ee)return;var ce=st(ee);pe.overflowedItems=[];var ie=0,ge;pe.originalTotalWidth>ce+Si&&(ge=-1,pe.menuItemSizes.forEach(function(ve){ie+=ve,ie+pe.overflowedIndicatorWidth<=ce&&(ge+=1)})),pe.setState({lastVisibleIndex:ge})},pe}return Object(O.a)(Oe,[{key:"componentDidMount",value:function(){var ee=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ce=this.childRef.current;if(!ce)return;this.resizeObserver=new Bt.default(function(ie){ie.forEach(function(){var ge=ee.cancelFrameId;cancelAnimationFrame(ge),ee.cancelFrameId=requestAnimationFrame(ee.setChildrenWidthAndResize)})}),[].slice.call(ce.children).concat(ce).forEach(function(ie){ee.resizeObserver.observe(ie)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ee.resizeObserver.disconnect(),[].slice.call(ce.children).concat(ce).forEach(function(ie){ee.resizeObserver.observe(ie)}),ee.setChildrenWidthAndResize()}),this.mutationObserver.observe(ce,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(ee){var ce=this,ie=this.state.lastVisibleIndex;return(ee||[]).reduce(function(ge,ve,Le){var Ce=ve;if(ce.props.mode==="horizontal"){var Be=ce.getOverflowedSubMenuItem(ve.props.eventKey,[]);ie!==void 0&&ce.props.className.indexOf("".concat(ce.props.prefixCls,"-root"))!==-1&&(Le>ie&&(Ce=D.cloneElement(ve,{style:{display:"none"},eventKey:"".concat(ve.props.eventKey,"-hidden"),className:"".concat(nr)})),Le===ie+1&&(ce.overflowedItems=ee.slice(ie+1).map(function(mt){return D.cloneElement(mt,{key:mt.props.eventKey,mode:"vertical-left"})}),Be=ce.getOverflowedSubMenuItem(ve.props.eventKey,ce.overflowedItems)));var Je=[].concat(Object(I.a)(ge),[Be,Ce]);return Le===ee.length-1&&Je.push(ce.getOverflowedSubMenuItem(ve.props.eventKey,[],!0)),Je}return[].concat(Object(I.a)(ge),[Ce])},[])}},{key:"render",value:function(){var ee=this.props,ce=ee.visible,ie=ee.prefixCls,ge=ee.overflowedIndicator,ve=ee.mode,Le=ee.level,Ce=ee.tag,Be=ee.children,Je=ee.theme,mt=Object(M.a)(ee,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),pt=Ce;return D.createElement(pt,Object(x.a)({ref:this.childRef},mt),this.renderChildren(Be))}}]),Oe}(D.Component);Pi.defaultProps={tag:"div",className:""};var Kr=Pi;function Qi(de){return de.length?de.every(function(we){return!!we.props.disabled}):!0}function Sr(de,we,Oe){var pe=de.getState();de.setState({activeKey:Object(X.a)(Object(X.a)({},pe.activeKey),{},Object(oe.a)({},we,Oe))})}function ir(de){return de.eventKey||"0-menu-"}function Zi(de,we){var Oe=we,pe=de.children,ee=de.eventKey;if(Oe){var ce;if(qe(pe,function(ie,ge){ie&&ie.props&&!ie.props.disabled&&Oe===xt(ie,ee,ge)&&(ce=!0)}),ce)return Oe}return Oe=null,de.defaultActiveFirst&&qe(pe,function(ie,ge){!Oe&&ie&&!ie.props.disabled&&(Oe=xt(ie,ee,ge))}),Oe}function zr(de){if(!de)return;var we=this.instanceArray.indexOf(de);we!==-1?this.instanceArray[we]=de:this.instanceArray.push(de)}var gi=function(de){Object(E.a)(Oe,de);var we=Object(b.a)(Oe);function Oe(pe){var ee;return Object(R.a)(this,Oe),ee=we.call(this,pe),ee.onKeyDown=function(ce,ie){var ge=ce.keyCode,ve;if(ee.getFlatInstanceArray().forEach(function(Ce){Ce&&Ce.props.active&&Ce.onKeyDown&&(ve=Ce.onKeyDown(ce))}),ve)return 1;var Le=null;return(ge===f.a.UP||ge===f.a.DOWN)&&(Le=ee.step(ge===f.a.UP?-1:1)),Le?(ce.preventDefault(),Sr(ee.props.store,ir(ee.props),Le.props.eventKey),typeof ie=="function"&&ie(Le),1):void 0},ee.onItemHover=function(ce){var ie=ce.key,ge=ce.hover;Sr(ee.props.store,ir(ee.props),ge?ie:null)},ee.onDeselect=function(ce){ee.props.onDeselect(ce)},ee.onSelect=function(ce){ee.props.onSelect(ce)},ee.onClick=function(ce){ee.props.onClick(ce)},ee.onOpenChange=function(ce){ee.props.onOpenChange(ce)},ee.onDestroy=function(ce){ee.props.onDestroy(ce)},ee.getFlatInstanceArray=function(){return ee.instanceArray},ee.step=function(ce){var ie=ee.getFlatInstanceArray(),ge=ee.props.store.getState().activeKey[ir(ee.props)],ve=ie.length;if(!ve)return null;ce<0&&(ie=ie.concat().reverse());var Le=-1;if(ie.every(function(mt,pt){return mt&&mt.props.eventKey===ge?(Le=pt,!1):!0}),!ee.props.defaultActiveFirst&&Le!==-1&&Qi(ie.slice(Le,ve-1)))return;var Ce=(Le+1)%ve,Be=Ce;do{var Je=ie[Be];if(!Je||Je.props.disabled)Be=(Be+1)%ve;else return Je}while(Be!==Ce);return null},ee.renderCommonMenuItem=function(ce,ie,ge){var ve=ee.props.store.getState(),Le=Object(w.a)(ee),Ce=Le.props,Be=xt(ce,Ce.eventKey,ie),Je=ce.props;if(!Je||typeof ce.type=="string")return ce;var mt=Be===ve.activeKey,pt=Object(X.a)(Object(X.a)({mode:Je.mode||Ce.mode,level:Ce.level,inlineIndent:Ce.inlineIndent,renderMenuItem:ee.renderMenuItem,rootPrefixCls:Ce.prefixCls,index:ie,parentMenu:Ce.parentMenu,manualRef:Je.disabled?void 0:Object(h.a)(ce.ref,zr.bind(Object(w.a)(ee))),eventKey:Be,active:!Je.disabled&&mt,multiple:Ce.multiple,onClick:function(gn){(Je.onClick||ct)(gn),ee.onClick(gn)},onItemHover:ee.onItemHover,motion:Ce.motion,subMenuOpenDelay:Ce.subMenuOpenDelay,subMenuCloseDelay:Ce.subMenuCloseDelay,forceSubMenuRender:Ce.forceSubMenuRender,onOpenChange:ee.onOpenChange,onDeselect:ee.onDeselect,onSelect:ee.onSelect,builtinPlacements:Ce.builtinPlacements,itemIcon:Je.itemIcon||ee.props.itemIcon,expandIcon:Je.expandIcon||ee.props.expandIcon},ge),{},{direction:Ce.direction});return(Ce.mode==="inline"||rt())&&(pt.triggerSubMenuAction="click"),D.cloneElement(ce,Object(X.a)(Object(X.a)({},pt),{},{key:Be||ie}))},ee.renderMenuItem=function(ce,ie,ge){if(!ce)return null;var ve=ee.props.store.getState(),Le={openKeys:ve.openKeys,selectedKeys:ve.selectedKeys,triggerSubMenuAction:ee.props.triggerSubMenuAction,subMenuKey:ge};return ee.renderCommonMenuItem(ce,ie,Le)},pe.store.setState({activeKey:Object(X.a)(Object(X.a)({},pe.store.getState().activeKey),{},Object(oe.a)({},pe.eventKey,Zi(pe,pe.activeKey)))}),ee.instanceArray=[],ee}return Object(O.a)(Oe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ee){return this.props.visible||ee.visible||this.props.className!==ee.className||!T()(this.props.style,ee.style)}},{key:"componentDidUpdate",value:function(ee){var ce=this.props,ie="activeKey"in ce?ce.activeKey:ce.store.getState().activeKey[ir(ce)],ge=Zi(ce,ie);if(ge!==ie)Sr(ce.store,ir(ce),ge);else if("activeKey"in ee){var ve=Zi(ee,ee.activeKey);ge!==ve&&Sr(ce.store,ir(ce),ge)}}},{key:"render",value:function(){var ee=this,ce=Object(x.a)({},this.props);this.instanceArray=[];var ie=K()(ce.prefixCls,ce.className,"".concat(ce.prefixCls,"-").concat(ce.mode)),ge={className:ie,role:ce.role||"menu"};ce.id&&(ge.id=ce.id),ce.focusable&&(ge.tabIndex=0,ge.onKeyDown=this.onKeyDown);var ve=ce.prefixCls,Le=ce.eventKey,Ce=ce.visible,Be=ce.level,Je=ce.mode,mt=ce.overflowedIndicator,pt=ce.theme;return vt.forEach(function(Dt){return delete ce[Dt]}),delete ce.onClick,D.createElement(Kr,Object(x.a)({},ce,{prefixCls:ve,mode:Je,tag:"ul",level:Be,theme:pt,visible:Ce,overflowedIndicator:mt},ge),Object(H.a)(ce.children).map(function(Dt,gn){return ee.renderMenuItem(Dt,gn,Le||"0-menu-")}))}}]),Oe}(D.Component);gi.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:ct};var Vn=Object(l.b)()(gi),Ci=Vn,Ti=Z("Kwbf");function qi(de,we,Oe){var pe=de.prefixCls,ee=de.motion,ce=de.defaultMotions,ie=ce===void 0?{}:ce,ge=de.openAnimation,ve=de.openTransitionName,Le=we.switchingModeFromInline;if(ee)return ee;if(Object(N.a)(ge)==="object"&&ge)Object(Ti.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ge=="string")return{motionName:"".concat(pe,"-open-").concat(ge)};if(ve)return{motionName:ve};var Ce=ie[Oe];return Ce||(Le?null:ie.other)}var Ut=function(de){Object(E.a)(Oe,de);var we=Object(b.a)(Oe);function Oe(pe){var ee;Object(R.a)(this,Oe),ee=we.call(this,pe),ee.onSelect=function(ge){var ve=Object(w.a)(ee),Le=ve.props;if(Le.selectable){var Ce=ee.store.getState(),Be=Ce.selectedKeys,Je=ge.key;Le.multiple?Be=Be.concat([Je]):Be=[Je],"selectedKeys"in Le||ee.store.setState({selectedKeys:Be}),Le.onSelect(Object(X.a)(Object(X.a)({},ge),{},{selectedKeys:Be}))}},ee.onClick=function(ge){var ve=ee.getRealMenuMode(),Le=Object(w.a)(ee),Ce=Le.store,Be=Le.props.onOpenChange;ve!=="inline"&&!("openKeys"in ee.props)&&(Ce.setState({openKeys:[]}),Be([])),ee.props.onClick(ge)},ee.onKeyDown=function(ge,ve){ee.innerMenu.getWrappedInstance().onKeyDown(ge,ve)},ee.onOpenChange=function(ge){var ve=Object(w.a)(ee),Le=ve.props,Ce=ee.store.getState().openKeys.concat(),Be=!1,Je=function(pt){var Dt=!1;if(pt.open)Dt=Ce.indexOf(pt.key)===-1,Dt&&Ce.push(pt.key);else{var gn=Ce.indexOf(pt.key);Dt=gn!==-1,Dt&&Ce.splice(gn,1)}Be=Be||Dt};Array.isArray(ge)?ge.forEach(Je):Je(ge),Be&&("openKeys"in ee.props||ee.store.setState({openKeys:Ce}),Le.onOpenChange(Ce))},ee.onDeselect=function(ge){var ve=Object(w.a)(ee),Le=ve.props;if(Le.selectable){var Ce=ee.store.getState().selectedKeys.concat(),Be=ge.key,Je=Ce.indexOf(Be);Je!==-1&&Ce.splice(Je,1),"selectedKeys"in Le||ee.store.setState({selectedKeys:Ce}),Le.onDeselect(Object(X.a)(Object(X.a)({},ge),{},{selectedKeys:Ce}))}},ee.onMouseEnter=function(ge){ee.restoreModeVerticalFromInline();var ve=ee.props.onMouseEnter;ve&&ve(ge)},ee.onTransitionEnd=function(ge){var ve=ge.propertyName==="width"&&ge.target===ge.currentTarget,Le=ge.target.className,Ce=Object.prototype.toString.call(Le)==="[object SVGAnimatedString]"?Le.animVal:Le,Be=ge.propertyName==="font-size"&&Ce.indexOf("anticon")>=0;(ve||Be)&&ee.restoreModeVerticalFromInline()},ee.setInnerMenu=function(ge){ee.innerMenu=ge},ee.isRootMenu=!0;var ce=pe.defaultSelectedKeys,ie=pe.defaultOpenKeys;return"selectedKeys"in pe&&(ce=pe.selectedKeys||[]),"openKeys"in pe&&(ie=pe.openKeys||[]),ee.store=Object(l.c)({selectedKeys:ce,openKeys:ie,activeKey:{"0-menu-":Zi(pe,pe.activeKey)}}),ee.state={switchingModeFromInline:!1,prevProps:pe,inlineOpenKeys:[],store:ee.store},ee}return Object(O.a)(Oe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ee){var ce=this.props,ie=ce.siderCollapsed,ge=ce.inlineCollapsed,ve=ce.onOpenChange;(!ee.inlineCollapsed&&ge||!ee.siderCollapsed&&ie)&&ve([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ee=this.props.collapsedWidth,ce=this.store,ie=this.prevOpenKeys,ge=this.getInlineCollapsed()&&(ee===0||ee==="0"||ee==="0px");ge?(this.prevOpenKeys=ce.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ie&&(this.store.setState({openKeys:ie}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ee=this.props.mode,ce=this.state.switchingModeFromInline,ie=this.getInlineCollapsed();return ce&&ie?"inline":ie?"vertical":ee}},{key:"getInlineCollapsed",value:function(){var ee=this.props,ce=ee.inlineCollapsed,ie=ee.siderCollapsed;return ie!==void 0?ie:ce}},{key:"restoreModeVerticalFromInline",value:function(){var ee=this.state.switchingModeFromInline;ee&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var ee=Object(X.a)({},Object(_.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ce=this.getRealMenuMode();return ee.className+=" ".concat(ee.prefixCls,"-root"),ee.direction==="rtl"&&(ee.className+=" ".concat(ee.prefixCls,"-rtl")),ee=Object(X.a)(Object(X.a)({},ee),{},{mode:ce,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:qi(this.props,this.state,ce)}),delete ee.openAnimation,delete ee.openTransitionName,D.createElement(l.a,{store:this.store},D.createElement(Ci,Object(x.a)({},ee,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ee,ce){var ie=ce.prevProps,ge=ce.store,ve=ge.getState(),Le={},Ce={prevProps:ee};return ie.mode==="inline"&&ee.mode!=="inline"&&(Ce.switchingModeFromInline=!0),"openKeys"in ee?Le.openKeys=ee.openKeys||[]:((ee.inlineCollapsed&&!ie.inlineCollapsed||ee.siderCollapsed&&!ie.siderCollapsed)&&(Ce.switchingModeFromInline=!0,Ce.inlineOpenKeys=ve.openKeys,Le.openKeys=[]),(!ee.inlineCollapsed&&ie.inlineCollapsed||!ee.siderCollapsed&&ie.siderCollapsed)&&(Le.openKeys=ce.inlineOpenKeys,Ce.inlineOpenKeys=[])),Object.keys(Le).length&&ge.setState(Le),Ce}}]),Oe}(D.Component);Ut.defaultProps={selectable:!0,onClick:ct,onSelect:ct,onOpenChange:ct,onDeselect:ct,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:D.createElement("span",null,"\xB7\xB7\xB7")};var dn=Ut,$t=function(de){Object(E.a)(Oe,de);var we=Object(b.a)(Oe);function Oe(){var pe;return Object(R.a)(this,Oe),pe=we.apply(this,arguments),pe.onKeyDown=function(ee){var ce=ee.keyCode;return ce===f.a.ENTER?(pe.onClick(ee),!0):void 0},pe.onMouseLeave=function(ee){var ce=pe.props,ie=ce.eventKey,ge=ce.onItemHover,ve=ce.onMouseLeave;ge({key:ie,hover:!1}),ve({key:ie,domEvent:ee})},pe.onMouseEnter=function(ee){var ce=pe.props,ie=ce.eventKey,ge=ce.onItemHover,ve=ce.onMouseEnter;ge({key:ie,hover:!0}),ve({key:ie,domEvent:ee})},pe.onClick=function(ee){var ce=pe.props,ie=ce.eventKey,ge=ce.multiple,ve=ce.onClick,Le=ce.onSelect,Ce=ce.onDeselect,Be=ce.isSelected,Je={key:ie,keyPath:[ie],item:Object(w.a)(pe),domEvent:ee};ve(Je),ge?Be?Ce(Je):Le(Je):Be||Le(Je)},pe.saveNode=function(ee){pe.node=ee},pe}return Object(O.a)(Oe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ee=this.props;ee.onDestroy&&ee.onDestroy(ee.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var ee,ce=Object(X.a)({},this.props),ie=K()(this.getPrefixCls(),ce.className,(ee={},Object(oe.a)(ee,this.getActiveClassName(),!ce.disabled&&ce.active),Object(oe.a)(ee,this.getSelectedClassName(),ce.isSelected),Object(oe.a)(ee,this.getDisabledClassName(),ce.disabled),ee)),ge=Object(X.a)(Object(X.a)({},ce.attribute),{},{title:typeof ce.title=="string"?ce.title:void 0,className:ie,role:ce.role||"menuitem","aria-disabled":ce.disabled});ce.role==="option"?ge=Object(X.a)(Object(X.a)({},ge),{},{role:"option","aria-selected":ce.isSelected}):(ce.role===null||ce.role==="none")&&(ge.role="none");var ve={onClick:ce.disabled?null:this.onClick,onMouseLeave:ce.disabled?null:this.onMouseLeave,onMouseEnter:ce.disabled?null:this.onMouseEnter},Le=Object(X.a)({},ce.style);ce.mode==="inline"&&(ce.direction==="rtl"?Le.paddingRight=ce.inlineIndent*ce.level:Le.paddingLeft=ce.inlineIndent*ce.level),vt.forEach(function(Be){return delete ce[Be]}),delete ce.direction;var Ce=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ce=D.createElement(this.props.itemIcon,this.props)),D.createElement("li",Object(x.a)({},Object(_.a)(ce,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ge,ve,{style:Le,ref:this.saveNode}),ce.children,Ce)}}]),Oe}(D.Component);$t.isMenuItem=!0,$t.defaultProps={onSelect:ct,onMouseEnter:ct,onMouseLeave:ct,manualRef:ct};var On=Object(l.b)(function(de,we){var Oe=de.activeKey,pe=de.selectedKeys,ee=we.eventKey,ce=we.subMenuKey;return{active:Oe[ce]===ee,isSelected:Array.isArray(pe)?pe.indexOf(ee)!==-1:pe===ee}})($t),Wn=On,ti=function(de){Object(E.a)(Oe,de);var we=Object(b.a)(Oe);function Oe(){var pe;return Object(R.a)(this,Oe),pe=we.apply(this,arguments),pe.renderInnerMenuItem=function(ee){var ce=pe.props,ie=ce.renderMenuItem,ge=ce.index;return ie(ee,ge,pe.props.subMenuKey)},pe}return Object(O.a)(Oe,[{key:"render",value:function(){var ee=Object(x.a)({},this.props),ce=ee.className,ie=ce===void 0?"":ce,ge=ee.rootPrefixCls,ve="".concat(ge,"-item-group-title"),Le="".concat(ge,"-item-group-list"),Ce=ee.title,Be=ee.children;return vt.forEach(function(Je){return delete ee[Je]}),delete ee.direction,D.createElement("li",Object(x.a)({},ee,{onClick:function(mt){return mt.stopPropagation()},className:"".concat(ie," ").concat(ge,"-item-group")}),D.createElement("div",{className:ve,title:typeof Ce=="string"?Ce:void 0},Ce),D.createElement("ul",{className:Le},D.Children.map(Be,this.renderInnerMenuItem)))}}]),Oe}(D.Component);ti.isMenuItemGroup=!0,ti.defaultProps={disabled:!0};var Bn=ti,Ai=function(we){var Oe=we.className,pe=we.rootPrefixCls,ee=we.style;return D.createElement("li",{className:"".concat(Oe," ").concat(pe,"-item-divider"),style:ee})};Ai.defaultProps={disabled:!0,className:"",style:{}};var rr=Ai,Dn=dn,Or=Z("eDIo");function Qn(de,we){var Oe=de.prefixCls,pe=de.editable,ee=de.locale,ce=de.style;return!pe||pe.showAdd===!1?null:D.createElement("button",{ref:we,type:"button",className:"".concat(Oe,"-nav-add"),style:ce,"aria-label":(ee==null?void 0:ee.addAriaLabel)||"Add tab",onClick:function(ge){pe.onEdit("add",{event:ge})}},pe.addIcon||"+")}var Xi=D.forwardRef(Qn);function Ki(de,we){var Oe=de.prefixCls,pe=de.id,ee=de.tabs,ce=de.locale,ie=de.mobile,ge=de.moreIcon,ve=ge===void 0?"More":ge,Le=de.moreTransitionName,Ce=de.style,Be=de.className,Je=de.editable,mt=de.tabBarGutter,pt=de.rtl,Dt=de.onTabClick,gn=Object(D.useState)(!1),Cn=Object(j.a)(gn,2),En=Cn[0],Tn=Cn[1],An=Object(D.useState)(null),Sn=Object(j.a)(An,2),wn=Sn[0],Fn=Sn[1],In="".concat(pe,"-more-popup"),vi="".concat(Oe,"-dropdown"),kn=wn!==null?"".concat(In,"-").concat(wn):null,hn=ce==null?void 0:ce.dropdownAriaLabel,on=D.createElement(Dn,{onClick:function(oi){var ii=oi.key,Ri=oi.domEvent;Dt(ii,Ri),Tn(!1)},id:In,tabIndex:-1,role:"listbox","aria-activedescendant":kn,selectedKeys:[wn],"aria-label":hn!==void 0?hn:"expanded dropdown"},ee.map(function(Yn){return D.createElement(Wn,{key:Yn.key,id:"".concat(In,"-").concat(Yn.key),role:"option","aria-controls":pe&&"".concat(pe,"-panel-").concat(Yn.key),disabled:Yn.disabled},Yn.tab)}));function Pn(Yn){for(var oi=ee.filter(function($i){return!$i.disabled}),ii=oi.findIndex(function($i){return $i.key===wn})||0,Ri=oi.length,Bi=0;Bi<Ri;Bi+=1){ii=(ii+Yn+Ri)%Ri;var bi=oi[ii];if(!bi.disabled){Fn(bi.key);return}}}function jn(Yn){var oi=Yn.which;if(!En){[f.a.DOWN,f.a.SPACE,f.a.ENTER].includes(oi)&&(Tn(!0),Yn.preventDefault());return}switch(oi){case f.a.UP:Pn(-1),Yn.preventDefault();break;case f.a.DOWN:Pn(1),Yn.preventDefault();break;case f.a.ESC:Tn(!1);break;case f.a.SPACE:case f.a.ENTER:wn!==null&&Dt(wn,Yn);break}}Object(D.useEffect)(function(){var Yn=document.getElementById(kn);Yn&&Yn.scrollIntoView&&Yn.scrollIntoView(!1)},[wn]),Object(D.useEffect)(function(){En||Fn(null)},[En]);var qt=Object(oe.a)({},pt?"marginLeft":"marginRight",mt);ee.length||(qt.visibility="hidden",qt.order=1);var Gn=K()(Object(oe.a)({},"".concat(vi,"-rtl"),pt)),yi=ie?null:D.createElement(Or.a,{prefixCls:vi,overlay:on,trigger:["hover"],visible:En,transitionName:Le,onVisibleChange:Tn,overlayClassName:Gn,mouseEnterDelay:.1,mouseLeaveDelay:.1},D.createElement("button",{type:"button",className:"".concat(Oe,"-nav-more"),style:qt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":In,id:"".concat(pe,"-more"),"aria-expanded":En,onKeyDown:jn},ve));return D.createElement("div",{className:K()("".concat(Oe,"-nav-operations"),Be),style:Ce,ref:we},yi,D.createElement(Xi,{prefixCls:Oe,locale:ce,editable:Je}))}var vr=D.forwardRef(Ki),Fa=Object(D.createContext)(null),Go=.1,$r=.01,Oi=20,go=Math.pow(.995,Oi);function vo(){var de=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(de)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(de.substr(0,4)))}function da(de,we){var Oe=Object(D.useState)(),pe=Object(j.a)(Oe,2),ee=pe[0],ce=pe[1],ie=Object(D.useState)(0),ge=Object(j.a)(ie,2),ve=ge[0],Le=ge[1],Ce=Object(D.useState)(0),Be=Object(j.a)(Ce,2),Je=Be[0],mt=Be[1],pt=Object(D.useState)(),Dt=Object(j.a)(pt,2),gn=Dt[0],Cn=Dt[1],En=Object(D.useRef)();function Tn(hn){var on=hn.touches[0],Pn=on.screenX,jn=on.screenY;ce({x:Pn,y:jn}),window.clearInterval(En.current)}function An(hn){if(!ee)return;hn.preventDefault();var on=hn.touches[0],Pn=on.screenX,jn=on.screenY;ce({x:Pn,y:jn});var qt=Pn-ee.x,Gn=jn-ee.y;we(qt,Gn);var yi=Date.now();Le(yi),mt(yi-ve),Cn({x:qt,y:Gn})}function Sn(){if(!ee)return;if(ce(null),Cn(null),gn){var hn=gn.x/Je,on=gn.y/Je,Pn=Math.abs(hn),jn=Math.abs(on);if(Math.max(Pn,jn)<Go)return;var qt=hn,Gn=on;En.current=window.setInterval(function(){if(Math.abs(qt)<$r&&Math.abs(Gn)<$r){window.clearInterval(En.current);return}qt*=go,Gn*=go,we(qt*Oi,Gn*Oi)},Oi)}}var wn=Object(D.useRef)(0),Fn=Object(D.useRef)(!1),In=Object(D.useRef)();function vi(hn){var on=hn.deltaX,Pn=hn.deltaY,jn=0,qt=Math.abs(on),Gn=Math.abs(Pn);qt===Gn?jn=In.current==="x"?on:Pn:qt>Gn?(jn=on,In.current="x"):(jn=Pn,In.current="y");var yi=Date.now();yi-wn.current>100&&(Fn.current=!1),(we(-jn,-jn)||Fn.current)&&(hn.preventDefault(),Fn.current=!0),wn.current=yi}var kn=Object(D.useRef)(null);kn.current={onTouchStart:Tn,onTouchMove:An,onTouchEnd:Sn,onWheel:vi},D.useEffect(function(){function hn(qt){kn.current.onTouchStart(qt)}function on(qt){kn.current.onTouchMove(qt)}function Pn(qt){kn.current.onTouchEnd(qt)}function jn(qt){kn.current.onWheel(qt)}return document.addEventListener("touchmove",on,{passive:!1}),document.addEventListener("touchend",Pn,{passive:!1}),de.current.addEventListener("touchstart",hn,{passive:!1}),de.current.addEventListener("wheel",jn),function(){document.removeEventListener("touchmove",on),document.removeEventListener("touchend",Pn)}},[])}function Ko(){var de=Object(D.useRef)(new Map);function we(pe){return de.current.has(pe)||de.current.set(pe,D.createRef()),de.current.get(pe)}function Oe(pe){de.current.delete(pe)}return[we,Oe]}function ja(de,we){var Oe=D.useRef(de),pe=D.useState({}),ee=Object(j.a)(pe,2),ce=ee[1];function ie(ge){var ve=typeof ge=="function"?ge(Oe.current):ge;ve!==Oe.current&&we(ve,Oe.current),Oe.current=ve,ce({})}return[Oe.current,ie]}var yo=function(we){var Oe=we.position,pe=we.prefixCls,ee=we.extra;if(!ee)return null;var ce,ie=ee;return Oe==="right"&&(ce=ie.right||!ie.left&&ie||null),Oe==="left"&&(ce=ie.left||null),ce?D.createElement("div",{className:"".concat(pe,"-extra-content")},ce):null};function Ha(de,we){var Oe,pe=D.useContext(Fa),ee=pe.prefixCls,ce=pe.tabs,ie=de.className,ge=de.style,ve=de.id,Le=de.animated,Ce=de.activeKey,Be=de.rtl,Je=de.extra,mt=de.editable,pt=de.locale,Dt=de.tabPosition,gn=de.tabBarGutter,Cn=de.children,En=de.onTabClick,Tn=de.onTabScroll,An=Object(D.useRef)(),Sn=Object(D.useRef)(),wn=Object(D.useRef)(),Fn=Object(D.useRef)(),In=Ko(),vi=Object(j.a)(In,2),kn=vi[0],hn=vi[1],on=Dt==="top"||Dt==="bottom",Pn=ja(0,function(ei,Nn){on&&Tn&&Tn({direction:ei>Nn?"left":"right"})}),jn=Object(j.a)(Pn,2),qt=jn[0],Gn=jn[1],yi=ja(0,function(ei,Nn){!on&&Tn&&Tn({direction:ei>Nn?"top":"bottom"})}),Yn=Object(j.a)(yi,2),oi=Yn[0],ii=Yn[1],Ri=Object(D.useState)(0),Bi=Object(j.a)(Ri,2),bi=Bi[0],$i=Bi[1],br=Object(D.useState)(0),ar=Object(j.a)(br,2),Fi=ar[0],di=ar[1],si=Object(D.useState)(0),Ei=Object(j.a)(si,2),_i=Ei[0],Er=Ei[1],Mr=Object(D.useState)(0),Pr=Object(j.a)(Mr,2),ri=Pr[0],Cr=Pr[1],Nr=Object(D.useState)(null),ui=Object(j.a)(Nr,2),ni=ui[0],ji=ui[1],Eo=Object(D.useState)(null),za=Object(j.a)(Eo,2),Ur=za[0],ta=za[1],_a=Object(D.useState)(0),Va=Object(j.a)(_a,2),ba=Va[0],Xo=Va[1],Yo=Object(D.useState)(0),xo=Object(j.a)(Yo,2),Xa=xo[0],Ya=xo[1],na=u(new Map),ia=Object(j.a)(na,2),Jo=ia[0],Ea=ia[1],ha=d(ce,Jo,bi),ra="".concat(ee,"-nav-operations-hidden"),aa=0,xr=0;on?Be?(aa=0,xr=Math.max(0,bi-ni)):(aa=Math.min(0,ni-bi),xr=0):(aa=Math.min(0,Ur-Fi),xr=0);function Vr(ei){return ei<aa?[aa,!1]:ei>xr?[xr,!1]:[ei,!0]}var Br=Object(D.useRef)(),fa=Object(D.useState)(),Xr=Object(j.a)(fa,2),xa=Xr[0],Ja=Xr[1];function Ta(){Ja(Date.now())}function Qa(){window.clearTimeout(Br.current)}da(An,function(ei,Nn){var Hi=!1;function sr(oa,Lr){oa(function(ga){var jr=Vr(ga+Lr),Wi=Object(j.a)(jr,2),Ca=Wi[0],qa=Wi[1];return Hi=qa,Ca})}if(on){if(ni>=bi)return Hi;sr(Gn,ei)}else{if(Ur>=Fi)return Hi;sr(ii,Nn)}return Qa(),Ta(),Hi}),Object(D.useEffect)(function(){return Qa(),xa&&(Br.current=window.setTimeout(function(){Ja(0)},100)),Qa},[xa]);function Fr(){var ei=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ce,Nn=ha.get(ei);if(!Nn)return;if(on){var Hi=qt;Be?Nn.right<qt?Hi=Nn.right:Nn.right+Nn.width>qt+ni&&(Hi=Nn.right+Nn.width-ni):Nn.left<-qt?Hi=-Nn.left:Nn.left+Nn.width>-qt+ni&&(Hi=-(Nn.left+Nn.width-ni)),ii(0),Gn(Vr(Hi)[0])}else{var sr=oi;Nn.top<-oi?sr=-Nn.top:Nn.top+Nn.height>-oi+Ur&&(sr=-(Nn.top+Nn.height-Ur)),Gn(0),ii(Vr(sr)[0])}}var Yr=C(ha,{width:ni,height:Ur,left:qt,top:oi},{width:_i,height:ri},{width:ba,height:Xa},Object(X.a)(Object(X.a)({},de),{},{tabs:ce})),To=Object(j.a)(Yr,2),Qo=To[0],Zo=To[1],qo=ce.map(function(ei){var Nn=ei.key;return D.createElement(r,{id:ve,prefixCls:ee,key:Nn,rtl:Be,tab:ei,closable:ei.closable,editable:mt,active:Nn===Ce,tabPosition:Dt,tabBarGutter:gn,renderWrapper:Cn,removeAriaLabel:pt==null?void 0:pt.removeAriaLabel,ref:kn(Nn),onClick:function(sr){En(Nn,sr)},onRemove:function(){hn(Nn)},onFocus:function(){Fr(Nn),Ta(),Be||(An.current.scrollLeft=0),An.current.scrollTop=0}})}),Za=c(function(){var ei,Nn,Hi,sr,oa,Lr,ga,jr,Wi,Ca=((ei=An.current)===null||ei===void 0?void 0:ei.offsetWidth)||0,qa=((Nn=An.current)===null||Nn===void 0?void 0:Nn.offsetHeight)||0,$a=((Hi=Fn.current)===null||Hi===void 0?void 0:Hi.offsetWidth)||0,lr=((sr=Fn.current)===null||sr===void 0?void 0:sr.offsetHeight)||0,Zn=((oa=wn.current)===null||oa===void 0?void 0:oa.offsetWidth)||0,wr=((Lr=wn.current)===null||Lr===void 0?void 0:Lr.offsetHeight)||0;ji(Ca),ta(qa),Xo($a),Ya(lr);var Dr=(((ga=Sn.current)===null||ga===void 0?void 0:ga.offsetWidth)||0)-$a,Ir=(((jr=Sn.current)===null||jr===void 0?void 0:jr.offsetHeight)||0)-lr;$i(Dr),di(Ir);var eo=(Wi=wn.current)===null||Wi===void 0?void 0:Wi.className.includes(ra);Er(Dr-(eo?0:Zn)),Cr(Ir-(eo?0:wr)),Ea(function(){var Aa=new Map;return ce.forEach(function(Oo){var Ro=Oo.key,Qr=kn(Ro).current;Qr&&Aa.set(Ro,{width:Qr.offsetWidth,height:Qr.offsetHeight,left:Qr.offsetLeft,top:Qr.offsetTop})}),Aa})}),$o=ce.slice(0,Qo),or=ce.slice(Zo+1),Ii=[].concat(Object(I.a)($o),Object(I.a)(or)),Yi=Object(D.useState)(),ki=Object(j.a)(Yi,2),pa=ki[0],es=ki[1],Tr=ha.get(Ce),wo=Object(D.useRef)();function So(){m.a.cancel(wo.current)}Object(D.useEffect)(function(){var ei={};return Tr&&(on?(Be?ei.right=Tr.right:ei.left=Tr.left,ei.width=Tr.width):(ei.top=Tr.top,ei.height=Tr.height)),So(),wo.current=m()(function(){es(ei)}),So},[Tr,on,Be]),Object(D.useEffect)(function(){Fr()},[Ce,Tr,ha,on]),Object(D.useEffect)(function(){Za()},[Be,gn,Ce,ce.map(function(ei){return ei.key}).join("_")]);var Co=!!Ii.length,Jr="".concat(ee,"-nav-wrap"),wa,ma,Ao,Sa;return on?Be?(ma=qt>0,wa=qt+ni<bi):(wa=qt<0,ma=-qt+ni<bi):(Ao=oi<0,Sa=-oi+Ur<Fi),D.createElement("div",{ref:we,role:"tablist",className:K()("".concat(ee,"-nav"),ie),style:ge,onKeyDown:function(){Ta()}},D.createElement(yo,{position:"left",extra:Je,prefixCls:ee}),D.createElement(p.a,{onResize:Za},D.createElement("div",{className:K()(Jr,(Oe={},Object(oe.a)(Oe,"".concat(Jr,"-ping-left"),wa),Object(oe.a)(Oe,"".concat(Jr,"-ping-right"),ma),Object(oe.a)(Oe,"".concat(Jr,"-ping-top"),Ao),Object(oe.a)(Oe,"".concat(Jr,"-ping-bottom"),Sa),Oe)),ref:An},D.createElement(p.a,{onResize:Za},D.createElement("div",{ref:Sn,className:"".concat(ee,"-nav-list"),style:{transform:"translate(".concat(qt,"px, ").concat(oi,"px)"),transition:xa?"none":void 0}},qo,D.createElement(Xi,{ref:Fn,prefixCls:ee,locale:pt,editable:mt,style:{visibility:Co?"hidden":null}}),D.createElement("div",{className:K()("".concat(ee,"-ink-bar"),Object(oe.a)({},"".concat(ee,"-ink-bar-animated"),Le.inkBar)),style:pa}))))),D.createElement(vr,Object.assign({},de,{ref:wn,prefixCls:ee,tabs:Ii,className:!Co&&ra})),D.createElement(yo,{position:"right",extra:Je,prefixCls:ee}))}var Wa=D.forwardRef(Ha);function zo(de){var we=de.id,Oe=de.activeKey,pe=de.animated,ee=de.tabPosition,ce=de.rtl,ie=de.destroyInactiveTabPane,ge=D.useContext(Fa),ve=ge.prefixCls,Le=ge.tabs,Ce=pe.tabPane,Be=Le.findIndex(function(Je){return Je.key===Oe});return D.createElement("div",{className:K()("".concat(ve,"-content-holder"))},D.createElement("div",{className:K()("".concat(ve,"-content"),"".concat(ve,"-content-").concat(ee),Object(oe.a)({},"".concat(ve,"-content-animated"),Ce)),style:Be&&Ce?Object(oe.a)({},ce?"marginRight":"marginLeft","-".concat(Be,"00%")):null},Le.map(function(Je){return D.cloneElement(Je.node,{key:Je.key,prefixCls:ve,tabKey:Je.key,id:we,animated:Ce,active:Je.key===Oe,destroyInactiveTabPane:ie})})))}function _o(de){var we=de.prefixCls,Oe=de.forceRender,pe=de.className,ee=de.style,ce=de.id,ie=de.active,ge=de.animated,ve=de.destroyInactiveTabPane,Le=de.tabKey,Ce=de.children,Be=D.useState(Oe),Je=Object(j.a)(Be,2),mt=Je[0],pt=Je[1];D.useEffect(function(){ie?pt(!0):ve&&pt(!1)},[ie,ve]);var Dt={};return ie||(ge?(Dt.visibility="hidden",Dt.height=0,Dt.overflowY="hidden"):Dt.display="none"),D.createElement("div",{id:ce&&"".concat(ce,"-panel-").concat(Le),role:"tabpanel",tabIndex:ie?0:-1,"aria-labelledby":ce&&"".concat(ce,"-tab-").concat(Le),"aria-hidden":!ie,style:Object(X.a)(Object(X.a)({},Dt),ee),className:K()("".concat(we,"-tabpane"),ie&&"".concat(we,"-tabpane-active"),pe)},(ie||mt||Oe)&&Ce)}var Ga=0;function bo(de){return Object(H.a)(de).map(function(we){if(D.isValidElement(we)){var Oe=we.key!==void 0?String(we.key):void 0;return Object(X.a)(Object(X.a)({key:Oe},we.props),{},{node:we})}return null}).filter(function(we){return we})}function Vo(de,we){var Oe,pe=de.id,ee=de.prefixCls,ce=ee===void 0?"rc-tabs":ee,ie=de.className,ge=de.children,ve=de.direction,Le=de.activeKey,Ce=de.defaultActiveKey,Be=de.editable,Je=de.animated,mt=de.tabPosition,pt=mt===void 0?"top":mt,Dt=de.tabBarGutter,gn=de.tabBarStyle,Cn=de.tabBarExtraContent,En=de.locale,Tn=de.moreIcon,An=de.moreTransitionName,Sn=de.destroyInactiveTabPane,wn=de.renderTabBar,Fn=de.onChange,In=de.onTabClick,vi=de.onTabScroll,kn=Object(M.a)(de,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),hn=bo(ge),on=ve==="rtl",Pn;Je===!1?Pn={inkBar:!1,tabPane:!1}:Pn=Object(X.a)({inkBar:!0,tabPane:!1},Je!==!0?Je:null);var jn=Object(D.useState)(!1),qt=Object(j.a)(jn,2),Gn=qt[0],yi=qt[1];Object(D.useEffect)(function(){yi(vo())},[]);var Yn=Object(P.a)(function(){var ri;return(ri=hn[0])===null||ri===void 0?void 0:ri.key},{value:Le,defaultValue:Ce}),oi=Object(j.a)(Yn,2),ii=oi[0],Ri=oi[1],Bi=Object(D.useState)(function(){return hn.findIndex(function(ri){return ri.key===ii})}),bi=Object(j.a)(Bi,2),$i=bi[0],br=bi[1];Object(D.useEffect)(function(){var ri=hn.findIndex(function(Nr){return Nr.key===ii});if(ri===-1){var Cr;ri=Math.max(0,Math.min($i,hn.length-1)),Ri((Cr=hn[ri])===null||Cr===void 0?void 0:Cr.key)}br(ri)},[hn.map(function(ri){return ri.key}).join("_"),ii,$i]);var ar=Object(P.a)(null,{value:pe}),Fi=Object(j.a)(ar,2),di=Fi[0],si=Fi[1],Ei=pt;Gn&&!["left","right"].includes(pt)&&(Ei="top"),Object(D.useEffect)(function(){pe||(si("rc-tabs-".concat(Ga)),Ga+=1)},[]);function _i(ri,Cr){In==null||In(ri,Cr),Ri(ri),Fn==null||Fn(ri)}var Er={id:di,activeKey:ii,animated:Pn,tabPosition:Ei,rtl:on,mobile:Gn},Mr,Pr=Object(X.a)(Object(X.a)({},Er),{},{editable:Be,locale:En,moreIcon:Tn,moreTransitionName:An,tabBarGutter:Dt,onTabClick:_i,onTabScroll:vi,extra:Cn,style:gn,panes:ge});return wn?Mr=wn(Pr,Wa):Mr=D.createElement(Wa,Object.assign({},Pr)),D.createElement(Fa.Provider,{value:{tabs:hn,prefixCls:ce}},D.createElement("div",Object.assign({ref:we,id:pe,className:K()(ce,"".concat(ce,"-").concat(Ei),(Oe={},Object(oe.a)(Oe,"".concat(ce,"-mobile"),Gn),Object(oe.a)(Oe,"".concat(ce,"-editable"),Be),Object(oe.a)(Oe,"".concat(ce,"-rtl"),on),Oe),ie)},kn),Mr,D.createElement(zo,Object.assign({destroyInactiveTabPane:Sn},Er,{animated:Pn}))))}var ea=D.forwardRef(Vo);ea.TabPane=_o;var Rr=ea,Ka=et.b=Rr},kSUc:function(ht,et,Z){},kqOp:function(ht,et,Z){"use strict";Z.d(et,"a",function(){return I});var oe=Z("0Owb"),j=Z("fWQN"),M=Z("mtLc"),X=Z("yKVA"),D=Z("879j"),F=Z("cDcd"),K=Z.n(F),H=Z("Ot1p"),P="\u2581",I=function(y){Object(X.a)(p,y);var m=Object(D.a)(p);function p(){var c;Object(j.a)(this,p);for(var u=arguments.length,f=new Array(u),s=0;s<u;s++)f[s]=arguments[s];return c=m.call.apply(m,[this].concat(f)),c.getChCountBeforeCursor=function(r,a){for(var d=a.line,L=0,C=0;C<d;C++)L+=r.getLine(C).split(P).length-1;var x=r.getLine(d).substring(0,a.ch);return L+=x.split(P).length-1,L},c.onCMBeforeChange=function(r,a){var d=r.getRange(a.from,a.to),L=0;if(a.text.forEach(function(O){L+=O.split(P).length-1}),d&&d.indexOf(P)!=-1){var C=d.split(P).length-1,x=c.getChCountBeforeCursor(r,a.from);console.log("\u5220\u9664".concat(C,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(x,"\u4E2A\uFF0C\u65B0\u589E").concat(L,"\u4E2A")),c.props.deleteEmptyDisabled?a.cancel():c.props.onPlaceholderChange&&c.props.onPlaceholderChange(x,C,L)}else if(L){var R=c.getChCountBeforeCursor(r,a.from);console.log("\u65B0\u589E".concat(L,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(R,"\u4E2A")),c.props.onPlaceholderChange&&c.props.onPlaceholderChange(R,0,L)}},c}return Object(M.a)(p,[{key:"render",value:function(){return K.a.createElement(H.a,Object(oe.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),p}(F.Component)},lZu9:function(ht,et,Z){(function(oe){oe(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(oe){"use strict";oe.defineMode("markdown",function(j,M){var X=oe.getMode(j,"text/html"),D=X.name=="null";function F(U){if(oe.findModeByName){var A=oe.findModeByName(U);A&&(U=A.mime||A.mimes[0])}var J=oe.getMode(j,U);return J.name=="null"?null:J}M.highlightFormatting===void 0&&(M.highlightFormatting=!1),M.maxBlockquoteDepth===void 0&&(M.maxBlockquoteDepth=0),M.taskLists===void 0&&(M.taskLists=!1),M.strikethrough===void 0&&(M.strikethrough=!1),M.emoji===void 0&&(M.emoji=!1),M.fencedCodeBlockHighlighting===void 0&&(M.fencedCodeBlockHighlighting=!0),M.fencedCodeBlockDefaultMode===void 0&&(M.fencedCodeBlockDefaultMode="text/plain"),M.xml===void 0&&(M.xml=!0),M.tokenTypeOverrides===void 0&&(M.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var H in K)K.hasOwnProperty(H)&&M.tokenTypeOverrides[H]&&(K[H]=M.tokenTypeOverrides[H]);var P=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,m=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,u=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,s=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,r=" ";function a(U,A,J){return A.f=A.inline=J,J(U,A)}function d(U,A,J){return A.f=A.block=J,J(U,A)}function L(U){return!U||!/\S/.test(U.string)}function C(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==R){var A=D;if(!A){var J=oe.innerMode(X,U.htmlState);A=J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText}A&&(U.f=b,U.block=x,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function x(U,A){var J=U.column()===A.indentation,te=L(A.prevLine.stream),se=A.indentedCode,fe=A.prevLine.hr,Ue=A.list!==!1,Re=(A.listStack[A.listStack.length-1]||0)+3;A.indentedCode=!1;var De=A.indentation;if(A.indentationDiff===null&&(A.indentationDiff=A.indentation,Ue)){for(A.list=null;De<A.listStack[A.listStack.length-1];)A.listStack.pop(),A.listStack.length?A.indentation=A.listStack[A.listStack.length-1]:A.list=!1;A.list!==!1&&(A.indentationDiff=De-A.listStack[A.listStack.length-1])}var Fe=!te&&!fe&&!A.prevLine.header&&(!Ue||!se)&&!A.prevLine.fencedCodeEnd,Me=(A.list===!1||fe||te)&&A.indentation<=Re&&U.match(P),ye=null;if(A.indentationDiff>=4&&(se||A.prevLine.fencedCodeEnd||A.prevLine.header||te))return U.skipToEnd(),A.indentedCode=!0,K.code;if(U.eatSpace())return null;if(J&&A.indentation<=Re&&(ye=U.match(m))&&ye[1].length<=6)return A.quote=0,A.header=ye[1].length,A.thisLine.header=!0,M.highlightFormatting&&(A.formatting="header"),A.f=A.inline,w(A);if(A.indentation<=Re&&U.eat(">"))return A.quote=J?1:A.quote+1,M.highlightFormatting&&(A.formatting="quote"),U.eatSpace(),w(A);if(!Me&&!A.setext&&J&&A.indentation<=Re&&(ye=U.match(I))){var le=ye[1]?"ol":"ul";return A.indentation=De+U.current().length,A.list=!0,A.quote=0,A.listStack.push(A.indentation),A.em=!1,A.strong=!1,A.code=!1,A.strikethrough=!1,M.taskLists&&U.match(y,!1)&&(A.taskList=!0),A.f=A.inline,M.highlightFormatting&&(A.formatting=["list","list-"+le]),w(A)}else{if(J&&A.indentation<=Re&&(ye=U.match(u,!0)))return A.quote=0,A.fencedEndRE=new RegExp(ye[1]+"+ *$"),A.localMode=M.fencedCodeBlockHighlighting&&F(ye[2]||M.fencedCodeBlockDefaultMode),A.localMode&&(A.localState=oe.startState(A.localMode)),A.f=A.block=O,M.highlightFormatting&&(A.formatting="code-block"),A.code=-1,w(A);if(A.setext||(!Fe||!Ue)&&!A.quote&&A.list===!1&&!A.code&&!Me&&!f.test(U.string)&&(ye=U.lookAhead(1))&&(ye=ye.match(p)))return A.setext?(A.header=A.setext,A.setext=0,U.skipToEnd(),M.highlightFormatting&&(A.formatting="header")):(A.header=ye[0].charAt(0)=="="?1:2,A.setext=A.header),A.thisLine.header=!0,A.f=A.inline,w(A);if(Me)return U.skipToEnd(),A.hr=!0,A.thisLine.hr=!0,K.hr;if(U.peek()==="[")return a(U,A,T)}return a(U,A,A.inline)}function R(U,A){var J=X.token(U,A.htmlState);if(!D){var te=oe.innerMode(X,A.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||A.md_inside&&U.current().indexOf(">")>-1)&&(A.f=b,A.block=x,A.htmlState=null)}return J}function O(U,A){var J=A.listStack[A.listStack.length-1]||0,te=A.indentation<J,se=J+3;if(A.fencedEndRE&&A.indentation<=se&&(te||U.match(A.fencedEndRE))){M.highlightFormatting&&(A.formatting="code-block");var fe;return te||(fe=w(A)),A.localMode=A.localState=null,A.block=x,A.f=b,A.fencedEndRE=null,A.code=0,A.thisLine.fencedCodeEnd=!0,te?d(U,A,A.block):fe}else return A.localMode?A.localMode.token(U,A.localState):(U.skipToEnd(),K.code)}function w(U){var A=[];if(U.formatting){A.push(K.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var J=0;J<U.formatting.length;J++)A.push(K.formatting+"-"+U.formatting[J]),U.formatting[J]==="header"&&A.push(K.formatting+"-"+U.formatting[J]+"-"+U.header),U.formatting[J]==="quote"&&(!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=U.quote?A.push(K.formatting+"-"+U.formatting[J]+"-"+U.quote):A.push("error"))}if(U.taskOpen)return A.push("meta"),A.length?A.join(" "):null;if(U.taskClosed)return A.push("property"),A.length?A.join(" "):null;if(U.linkHref?A.push(K.linkHref,"url"):(U.strong&&A.push(K.strong),U.em&&A.push(K.em),U.strikethrough&&A.push(K.strikethrough),U.emoji&&A.push(K.emoji),U.linkText&&A.push(K.linkText),U.code&&A.push(K.code),U.image&&A.push(K.image),U.imageAltText&&A.push(K.imageAltText,"link"),U.imageMarker&&A.push(K.imageMarker)),U.header&&A.push(K.header,K.header+"-"+U.header),U.quote&&(A.push(K.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=U.quote?A.push(K.quote+"-"+U.quote):A.push(K.quote+"-"+M.maxBlockquoteDepth)),U.list!==!1){var te=(U.listStack.length-1)%3;te?te===1?A.push(K.list2):A.push(K.list3):A.push(K.list1)}return U.trailingSpaceNewLine?A.push("trailing-space-new-line"):U.trailingSpace&&A.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),A.length?A.join(" "):null}function E(U,A){return U.match(c,!0)?w(A):void 0}function b(U,A){var J=A.text(U,A);if(typeof J!="undefined")return J;if(A.list)return A.list=null,w(A);if(A.taskList){var te=U.match(y,!0)[1]===" ";return te?A.taskOpen=!0:A.taskClosed=!0,M.highlightFormatting&&(A.formatting="task"),A.taskList=!1,w(A)}if(A.taskOpen=!1,A.taskClosed=!1,A.header&&U.match(/^#+$/,!0))return M.highlightFormatting&&(A.formatting="header"),w(A);var se=U.next();if(A.linkTitle){A.linkTitle=!1;var fe=se;se==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ue="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(U.match(new RegExp(Ue),!0))return K.linkHref}if(se==="`"){var Re=A.formatting;M.highlightFormatting&&(A.formatting="code"),U.eatWhile("`");var De=U.current().length;if(A.code==0&&(!A.quote||De==1))return A.code=De,w(A);if(De==A.code){var Fe=w(A);return A.code=0,Fe}else return A.formatting=Re,w(A)}else if(A.code)return w(A);if(se==="\\"&&(U.next(),M.highlightFormatting)){var Me=w(A),ye=K.formatting+"-escape";return Me?Me+" "+ye:ye}if(se==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return A.imageMarker=!0,A.image=!0,M.highlightFormatting&&(A.formatting="image"),w(A);if(se==="["&&A.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return A.imageMarker=!1,A.imageAltText=!0,M.highlightFormatting&&(A.formatting="image"),w(A);if(se==="]"&&A.imageAltText){M.highlightFormatting&&(A.formatting="image");var Me=w(A);return A.imageAltText=!1,A.image=!1,A.inline=A.f=_,Me}if(se==="["&&!A.image)return A.linkText&&U.match(/^.*?\]/)||(A.linkText=!0,M.highlightFormatting&&(A.formatting="link")),w(A);if(se==="]"&&A.linkText){M.highlightFormatting&&(A.formatting="link");var Me=w(A);return A.linkText=!1,A.inline=A.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?_:b,Me}if(se==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=l,M.highlightFormatting&&(A.formatting="link");var Me=w(A);return Me?Me+=" ":Me="",Me+K.linkInline}if(se==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=l,M.highlightFormatting&&(A.formatting="link");var Me=w(A);return Me?Me+=" ":Me="",Me+K.linkEmail}if(M.xml&&se==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var le=U.string.indexOf(">",U.pos);if(le!=-1){var Se=U.string.substring(U.start,le);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Se)&&(A.md_inside=!0)}return U.backUp(1),A.htmlState=oe.startState(X),d(U,A,R)}if(M.xml&&se==="<"&&U.match(/^\/\w*?>/))return A.md_inside=!1,"tag";if(se==="*"||se==="_"){for(var ot=1,it=U.pos==1?" ":U.string.charAt(U.pos-2);ot<3&&U.eat(se);)ot++;var ct=U.peek()||" ",xt=!/\s/.test(ct)&&(!s.test(ct)||/\s/.test(it)||s.test(it)),Xe=!/\s/.test(it)&&(!s.test(it)||/\s/.test(ct)||s.test(ct)),qe=null,dt=null;if(ot%2&&(!A.em&&xt&&(se==="*"||!Xe||s.test(it))?qe=!0:A.em==se&&Xe&&(se==="*"||!xt||s.test(ct))&&(qe=!1)),ot>1&&(!A.strong&&xt&&(se==="*"||!Xe||s.test(it))?dt=!0:A.strong==se&&Xe&&(se==="*"||!xt||s.test(ct))&&(dt=!1)),dt!=null||qe!=null){M.highlightFormatting&&(A.formatting=qe==null?"strong":dt==null?"em":"strong em"),qe===!0&&(A.em=se),dt===!0&&(A.strong=se);var Fe=w(A);return qe===!1&&(A.em=!1),dt===!1&&(A.strong=!1),Fe}}else if(se===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return w(A);U.backUp(1)}if(M.strikethrough){if(se==="~"&&U.eatWhile(se)){if(A.strikethrough){M.highlightFormatting&&(A.formatting="strikethrough");var Fe=w(A);return A.strikethrough=!1,Fe}else if(U.match(/^[^\s]/,!1))return A.strikethrough=!0,M.highlightFormatting&&(A.formatting="strikethrough"),w(A)}else if(se===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return w(A);U.backUp(2)}}if(M.emoji&&se===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){A.emoji=!0,M.highlightFormatting&&(A.formatting="emoji");var vt=w(A);return A.emoji=!1,vt}return se===" "&&(U.match(/^ +$/,!1)?A.trailingSpace++:A.trailingSpace&&(A.trailingSpaceNewLine=!0)),w(A)}function l(U,A){var J=U.next();if(J===">"){A.f=A.inline=b,M.highlightFormatting&&(A.formatting="link");var te=w(A);return te?te+=" ":te="",te+K.linkInline}return U.match(/^[^>]+/,!0),K.linkInline}function _(U,A){if(U.eatSpace())return null;var J=U.next();return J==="("||J==="["?(A.f=A.inline=g(J==="("?")":"]"),M.highlightFormatting&&(A.formatting="link-string"),A.linkHref=!0,w(A)):"error"}var h={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function g(U){return function(A,J){var te=A.next();if(te===U){J.f=J.inline=b,M.highlightFormatting&&(J.formatting="link-string");var se=w(J);return J.linkHref=!1,se}return A.match(h[U]),J.linkHref=!0,w(J)}}function T(U,A){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(A.f=N,U.next(),M.highlightFormatting&&(A.formatting="link"),A.linkText=!0,w(A)):a(U,A,b)}function N(U,A){if(U.match(/^\]:/,!0)){A.f=A.inline=V,M.highlightFormatting&&(A.formatting="link");var J=w(A);return A.linkText=!1,J}return U.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function V(U,A){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?A.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),A.f=A.inline=b,K.linkHref+" url")}var Y={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:b,text:E,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&oe.copyState(X,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?oe.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,A){if(A.formatting=!1,U!=A.thisLine.stream){if(A.header=0,A.hr=!1,U.match(/^\s*$/,!0))return C(A),null;if(A.prevLine=A.thisLine,A.thisLine={stream:U},A.taskList=!1,A.trailingSpace=0,A.trailingSpaceNewLine=!1,!A.localState&&(A.f=A.block,A.f!=R)){var J=U.match(/^\s*/,!0)[0].replace(/\t/g,r).length;if(A.indentation=J,A.indentationDiff=null,J>0)return null}}return A.f(U,A)},innerMode:function(U){return U.block==R?{state:U.htmlState,mode:X}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:Y}},indent:function(U,A,J){return U.block==R&&X.indent?X.indent(U.htmlState,A,J):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,A,J):oe.Pass},blankLine:C,getType:w,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Y},"xml"),oe.defineMIME("text/markdown","markdown"),oe.defineMIME("text/x-markdown","markdown")})},osHv:function(ht,et,Z){(function(oe){oe(Z("VrN/"))})(function(oe){"use strict";var j=oe.Pos;function M(s,r){return s.line-r.line||s.ch-r.ch}var X="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",D=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",F=new RegExp("<(/?)(["+X+"]["+D+"]*)","g");function K(s,r,a,d){this.line=r,this.ch=a,this.cm=s,this.text=s.getLine(r),this.min=d?Math.max(d.from,s.firstLine()):s.firstLine(),this.max=d?Math.min(d.to-1,s.lastLine()):s.lastLine()}function H(s,r){var a=s.cm.getTokenTypeAt(j(s.line,r));return a&&/\btag\b/.test(a)}function P(s){return s.line>=s.max?void 0:(s.ch=0,s.text=s.cm.getLine(++s.line),!0)}function I(s){return s.line<=s.min?void 0:(s.text=s.cm.getLine(--s.line),s.ch=s.text.length,!0)}function y(s){for(;;){var r=s.text.indexOf(">",s.ch);if(r==-1){if(P(s))continue;return}if(!H(s,r+1)){s.ch=r+1;continue}var a=s.text.lastIndexOf("/",r),d=a>-1&&!/\S/.test(s.text.slice(a+1,r));return s.ch=r+1,d?"selfClose":"regular"}}function m(s){for(;;){var r=s.ch?s.text.lastIndexOf("<",s.ch-1):-1;if(r==-1){if(I(s))continue;return}if(!H(s,r+1)){s.ch=r;continue}F.lastIndex=r,s.ch=r;var a=F.exec(s.text);if(a&&a.index==r)return a}}function p(s){for(;;){F.lastIndex=s.ch;var r=F.exec(s.text);if(!r){if(P(s))continue;return}if(!H(s,r.index+1)){s.ch=r.index+1;continue}return s.ch=r.index+r[0].length,r}}function c(s){for(;;){var r=s.ch?s.text.lastIndexOf(">",s.ch-1):-1;if(r==-1){if(I(s))continue;return}if(!H(s,r+1)){s.ch=r;continue}var a=s.text.lastIndexOf("/",r),d=a>-1&&!/\S/.test(s.text.slice(a+1,r));return s.ch=r+1,d?"selfClose":"regular"}}function u(s,r){for(var a=[];;){var d=p(s),L,C=s.line,x=s.ch-(d?d[0].length:0);if(!d||!(L=y(s)))return;if(L=="selfClose")continue;if(d[1]){for(var R=a.length-1;R>=0;--R)if(a[R]==d[2]){a.length=R;break}if(R<0&&(!r||r==d[2]))return{tag:d[2],from:j(C,x),to:j(s.line,s.ch)}}else a.push(d[2])}}function f(s,r){for(var a=[];;){var d=c(s);if(!d)return;if(d=="selfClose"){m(s);continue}var L=s.line,C=s.ch,x=m(s);if(!x)return;if(x[1])a.push(x[2]);else{for(var R=a.length-1;R>=0;--R)if(a[R]==x[2]){a.length=R;break}if(R<0&&(!r||r==x[2]))return{tag:x[2],from:j(s.line,s.ch),to:j(L,C)}}}}oe.registerHelper("fold","xml",function(s,r){for(var a=new K(s,r.line,0);;){var d=p(a);if(!d||a.line!=r.line)return;var L=y(a);if(!L)return;if(!d[1]&&L!="selfClose"){var C=j(a.line,a.ch),x=u(a,d[2]);return x&&M(x.from,C)>0?{from:C,to:x.from}:null}}}),oe.findMatchingTag=function(s,r,a){var d=new K(s,r.line,r.ch,a);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var L=y(d),C=L&&j(d.line,d.ch),x=L&&m(d);if(!L||!x||M(d,r)>0)return;var R={from:j(d.line,d.ch),to:C,tag:x[2]};return L=="selfClose"?{open:R,close:null,at:"open"}:x[1]?{open:f(d,x[2]),close:R,at:"close"}:(d=new K(s,C.line,C.ch,a),{open:R,close:u(d,x[2]),at:"open"})},oe.findEnclosingTag=function(s,r,a,d){for(var L=new K(s,r.line,r.ch,a);;){var C=f(L,d);if(!C)break;var x=new K(s,r.line,r.ch,a),R=u(x,C.tag);if(R)return{open:C,close:R}}},oe.scanForClosingTag=function(s,r,a,d){var L=new K(s,r.line,r.ch,d?{from:0,to:d}:null);return u(L,a)}})},p5ED:function(ht,et,Z){"use strict";var oe=Z("+L6B"),j=Z("2/Rp"),M=Z("5Dmo"),X=Z("3S7+"),D=Z("k1fw"),F=Z("tJVT"),K=Z("cDcd"),H=Z.n(K),P=Z("vHTk"),I=Z.n(P),y=Z("yEEn"),m=Z("ZW9T"),p=Z("1vsH");et.a=function(c){var u=c.name,f=c.data,s=c.theme,r=c.type,a=c.filename,d=c.monacoEditor,L=c.className,C=c.style,x=c.close,R=c.onClose,O=c.hasMask,w=Object(K.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),E=Object(F.a)(w,2),b=E[0],l=E[1],_=Object(K.useState)(""),h=Object(F.a)(_,2),g=h[0],T=h[1],N,V=1024*1024,Y=10*V,U=Object(K.useRef)();r==="office"&&(N=Object(p.V)(f).filesize,N>Y&&(r="other")),a&&(d.filename=a),Object(K.useEffect)(function(){var te,se,fe=(te=document.cookie)===null||te===void 0||((se=te.replace(/\s/g,""))===null||se===void 0)?void 0:se.split(";");fe==null||fe.map(function(Ue){var Re=Ue.split("=");Re[0]==="_educoder_session"&&T(Re[1])})},[]);var A=function(){if(f.startsWith("http")||f.startsWith("/")){J();return}Object(p.z)(a||"educoder",f,a)},J=function(){Object(p.x)(a||u,f)};return console.log("data:",f,"fileanme:",a," name:",u),H.a.createElement("div",{style:Object(D.a)({},C||{}),className:"".concat(O&&I.a.bgBlack," ").concat(r?I.a.wrp:"hide")},x&&H.a.createElement("div",{className:I.a.close,ref:U},H.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},H.a.createElement("span",{onClick:J},H.a.createElement("i",{className:"icon-quxiaozhiding"}))),H.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},H.a.createElement("span",{className:"",onClick:R},H.a.createElement("i",{className:"icon-guanbi1"})))),H.a.createElement("div",{className:"".concat(I.a[L]," ").concat(L," ").concat(I.a.monaco," ").concat(r==="txt"?"show":"hide")},r==="txt"&&H.a.createElement(m.b,d)),r==="audio"&&H.a.createElement("audio",{src:"".concat(f!=null&&f.startsWith("/")||(f==null?void 0:f.indexOf("https://"))>-1?f:"data:audio/mp3;base64,").concat(f),autoPlay:!0}),r==="video"&&H.a.createElement(H.a.Fragment,null,f!=null&&f.startsWith("/")?H.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):H.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),r==="html"&&H.a.createElement("iframe",{src:f+"&disposition=inline"}),r==="pdf"&&H.a.createElement("embed",{className:I.a.embed,src:f}),r==="image"&&H.a.createElement(H.a.Fragment,null,H.a.createElement("img",{src:"".concat(f!=null&&f.startsWith("/")||(f==null?void 0:f.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(f)})),r==="other"&&H.a.createElement("div",null,H.a.createElement(j.a,{type:"primary",size:"large",onClick:A},H.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(r==="download"||r==="office")&&H.a.createElement(j.a,{type:"primary",size:"large",onClick:A},H.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ht,et,Z){},psGv:function(ht,et,Z){var oe,j;(function(){var M;(function(){"use strict";var K=[,,function(y){function m(u){this.__parent=u,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=[]}m.prototype.clone_empty=function(){var u=new m(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},m.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},m.prototype.has_match=function(u){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(u))return!0;return!1},m.prototype.set_indent=function(u,f){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.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)},m.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},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(u){this.__items.push(u);var f=u.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=u.length-f:this.__character_count+=u.length},m.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function p(u,f){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),f=f||"",u.indent_level>0&&(f=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}p.prototype.get_indent_size=function(u,f){var s=this.__base_string_length;return f=f||0,u<0&&(s=0),s+=u*this.__indent_size,s+=f,s},p.prototype.get_indent_string=function(u,f){var s=this.__base_string;return f=f||0,u<0&&(u=0,s=""),f+=u*this.__indent_size,this.__ensure_cache(f),s+=this.__cache[f],s},p.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var u=this.__cache.length,f=0,s="";this.__indent_size&&u>=this.__indent_size&&(f=Math.floor(u/this.__indent_size),u-=f*this.__indent_size,s=new Array(f+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function c(u,f){this.__indent_cache=new p(u,f),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(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(u,f){return this.__indent_cache.get_indent_string(u,f)},c.prototype.get_indent_size=function(u,f){return this.__indent_cache.get_indent_size(u,f)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(u){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
|
|
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return u!==`
|
|
`&&(s=s.replace(/[\n]/g,u)),s},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(u,f){return u=u||0,f=f||0,this.next_line.set_indent(u,f),this.__lines.length>1?(this.current_line.set_indent(u,f),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(u){for(var f=0;f<u.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),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(u){for(var f=this.__lines.length;u<f;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&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(u,f){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(u)!==0&&r.item(-1)!==f){this.__lines.splice(s+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},y.exports.Output=c},function(y){function m(p,c,u,f){this.type=p,this.text=c,this.comments_before=null,this.newlines=u||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}y.exports.Token=m},,,function(y){function m(u,f){this.raw_options=p(u,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(u,f){var s=this.raw_options[u],r=f||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},m.prototype._get_boolean=function(u,f){var s=this.raw_options[u],r=s===void 0?!!f:!!s;return r},m.prototype._get_characters=function(u,f){var s=this.raw_options[u],r=f||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),r},m.prototype._get_number=function(u,f){var s=this.raw_options[u];f=parseInt(f,10),isNaN(f)&&(f=0);var r=parseInt(s,10);return isNaN(r)&&(r=f),r},m.prototype._get_selection=function(u,f,s){var r=this._get_selection_list(u,f,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return r[0]},m.prototype._get_selection_list=function(u,f,s){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[f[0]],!this._is_valid_selection(s,f))throw new Error("Invalid Default Value!");var r=this._get_array(u,s);if(!this._is_valid_selection(r,f))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return r},m.prototype._is_valid_selection=function(u,f){return u.length&&f.length&&!u.some(function(s){return f.indexOf(s)===-1})};function p(u,f){var s={};u=c(u);var r;for(r in u)r!==f&&(s[r]=u[r]);if(f&&u[f])for(r in u[f])s[r]=u[f][r];return s}function c(u){var f={},s;for(s in u){var r=s.replace(/-/g,"_");f[r]=u[s]}return f}y.exports.Options=m,y.exports.normalizeOpts=c,y.exports.mergeOpts=p},,function(y){var m=RegExp.prototype.hasOwnProperty("sticky");function p(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},p.prototype.peek=function(c){var u=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(u=this.__input.charAt(c)),u},p.prototype.__match=function(c,u){c.lastIndex=u;var f=c.exec(this.__input);return f&&!(m&&c.sticky)&&(f.index!==u&&(f=null)),f},p.prototype.test=function(c,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(c,u):!1},p.prototype.testChar=function(c,u){var f=this.peek(u);return c.lastIndex=0,f!==null&&c.test(f)},p.prototype.match=function(c){var u=this.__match(c,this.__position);return u?this.__position+=u[0].length:u=null,u},p.prototype.read=function(c,u,f){var s="",r;return c&&(r=this.match(c),r&&(s+=r[0])),u&&(r||!c)&&(s+=this.readUntil(u,f)),s},p.prototype.readUntil=function(c,u){var f="",s=this.__position;c.lastIndex=this.__position;var r=c.exec(this.__input);return r?(s=r.index,u&&(s+=r[0].length)):s=this.__input_length,f=this.__input.substring(this.__position,s),this.__position=s,f},p.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},p.prototype.get_regexp=function(c,u){var f=null,s="g";return u&&m&&(s="y"),typeof c=="string"&&c!==""?f=new RegExp(c,s):c&&(f=new RegExp(c.source,s)),f},p.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(c){var u=this.__position,f=this.readUntilAfter(c);return this.__position=u,f},p.prototype.lookBack=function(c){var u=this.__position-1;return u>=c.length&&this.__input.substring(u-c.length,u).toLowerCase()===c},y.exports.InputScanner=p},function(y,m,p){var c=p(8).InputScanner,u=p(3).Token,f=p(10).TokenStream,s=p(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(d,L){this._input=new c(d),this._options=L||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var d,L=new u(r.START,""),C=null,x=[],R=new f;L.type!==r.EOF;){for(d=this._get_next_token(L,C);this._is_comment(d);)R.add(d),d=this._get_next_token(L,C);R.isEmpty()||(d.comments_before=R,R=new f),d.parent=C,this._is_opening(d)?(x.push(C),C=d):C&&this._is_closing(d,C)&&(d.opened=C,C.closed=d,C=x.pop(),d.parent=C),d.previous=L,L.next=d,this.__tokens.add(d),L=d}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(d,L){this._readWhitespace();var C=this._input.read(/.+/g);return C?this._create_token(r.RAW,C):this._create_token(r.EOF,"")},a.prototype._is_comment=function(d){return!1},a.prototype._is_opening=function(d){return!1},a.prototype._is_closing=function(d,L){return!1},a.prototype._create_token=function(d,L){var C=new u(d,L,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return C},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},y.exports.Tokenizer=a,y.exports.TOKEN=r},function(y){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},m.prototype.peek=function(p){var c=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(c=this.__tokens[p]),c},m.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},y.exports.TokenStream=m},function(y,m,p){var c=p(12).Pattern;function u(f,s){c.call(this,f,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new c,u.prototype.__set_whitespace_patterns=function(f,s){f+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},u.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var s=this.__split(this._newline_regexp,f);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return f},u.prototype.matching=function(f,s){var r=this._create();return r.__set_whitespace_patterns(f,s),r._update(),r},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(f,s){f.lastIndex=0;for(var r=0,a=[],d=f.exec(s);d;)a.push(s.substring(r,d.index)),r=d.index+d[0].length,d=f.exec(s);return r<s.length?a.push(s.substring(r,s.length)):a.push(""),a},y.exports.WhitespacePattern=u},function(y){function m(p,c){this._input=p,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)}m.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(p){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(p),c._update(),c},m.prototype.until=function(p){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(p),c._update(),c},m.prototype.starting_with=function(p){var c=this._create();return c._starting_pattern=this._input.get_regexp(p,!0),c._update(),c},m.prototype.matching=function(p){var c=this._create();return c._match_pattern=this._input.get_regexp(p,!0),c._update(),c},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},y.exports.Pattern=m},function(y){function m(p,c){p=typeof p=="string"?p:p.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+c,"g")}m.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(p);u;)c[u[1]]=u[2],u=this.__directive_pattern.exec(p);return c},m.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},y.exports.Directives=m},function(y,m,p){var c=p(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(s,r){c.call(this,s,r),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),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 a=new c(s);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new c,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},f.prototype.read_options=function(s){var r=this._create();for(var a in u)r._disabled[a]=s.templating.indexOf(a)===-1;return r._update(),r},f.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},f.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},f.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("|")+")")},f.prototype._read_template=function(){var s="",r=this._input.peek();if(r==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(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},y.exports.TemplatablePattern=f},,,,function(y,m,p){var c=p(19).Beautifier,u=p(20).Options;function f(s,r,a,d){var L=new c(s,r,a,d);return L.beautify()}y.exports=f,y.exports.defaultOptions=function(){return new u}},function(y,m,p){var c=p(20).Options,u=p(2).Output,f=p(21).Tokenizer,s=p(21).TOKEN,r=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,d=function(_,h){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=_.max_preserve_newlines,this.preserve_newlines=_.preserve_newlines,this._output=new u(_,h)};d.prototype.current_line_has_match=function(_){return this._output.current_line.has_match(_)},d.prototype.set_space_before_token=function(_,h){this._output.space_before_token=_,this._output.non_breaking_space=h},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(_){this._output.add_raw_token(_)},d.prototype.print_preserved_newlines=function(_){var h=0;_.type!==s.TEXT&&_.previous.type!==s.TEXT&&(h=_.newlines?1:0),this.preserve_newlines&&(h=_.newlines<this.max_preserve_newlines+1?_.newlines:this.max_preserve_newlines+1);for(var g=0;g<h;g++)this.print_newline(g>0);return h!==0},d.prototype.traverse_whitespace=function(_){return _.whitespace_before||_.newlines?(this.print_preserved_newlines(_)||(this._output.space_before_token=!0),!0):!1},d.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},d.prototype.print_newline=function(_){this._output.add_new_line(_)},d.prototype.print_token=function(_){_.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(_.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(_){return _=this.indent_level+(_||0),_<1?"":this._output.get_indent_string(_)};var L=function(_){for(var h=null,g=_.next;g.type!==s.EOF&&_.closed!==g;){if(g.type===s.ATTRIBUTE&&g.text==="type"){g.next&&g.next.type===s.EQUALS&&g.next.next&&g.next.next.type===s.VALUE&&(h=g.next.next.text);break}g=g.next}return h},C=function(_,h){var g=null,T=null;return h.closed?(_==="script"?g="text/javascript":_==="style"&&(g="text/css"),g=L(h)||g,g.search("text/css")>-1?T="css":g.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?T="javascript":g.search(/(text|application|dojo)\/(x-)?(html)/)>-1?T="html":g.search(/test\/null/)>-1&&(T="null"),T):null};function x(_,h){return h.indexOf(_)!==-1}function R(_,h,g){this.parent=_||null,this.tag=h?h.tag_name:"",this.indent_level=g||0,this.parser_token=h||null}function O(_){this._printer=_,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(_){var h=new R(this._current_frame,_,this._printer.indent_level);this._current_frame=h},O.prototype._try_pop_frame=function(_){var h=null;return _&&(h=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),h},O.prototype._get_frame=function(_,h){for(var g=this._current_frame;g&&!(_.indexOf(g.tag)!==-1);){if(h&&h.indexOf(g.tag)!==-1){g=null;break}g=g.parent}return g},O.prototype.try_pop=function(_,h){var g=this._get_frame([_],h);return this._try_pop_frame(g)},O.prototype.indent_to_tag=function(_){var h=this._get_frame(_);h&&(this._printer.indent_level=h.indent_level)};function w(_,h,g,T){this._source_text=_||"",h=h||{},this._js_beautify=g,this._css_beautify=T,this._tag_stack=null;var N=new c(h,"html");this._options=N,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"}w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,h=this._options.eol;this._options.eol==="auto"&&(h=`
|
|
`,_&&r.test(_)&&(h=_.match(r)[0])),_=_.replace(a,`
|
|
`);var g=_.match(/^[\t ]*/)[0],T={text:"",type:""},N=new E,V=new d(this._options,g),Y=new f(_,this._options).tokenize();this._tag_stack=new O(V);for(var U=null,A=Y.next();A.type!==s.EOF;)A.type===s.TAG_OPEN||A.type===s.COMMENT?(U=this._handle_tag_open(V,A,N,T),N=U):A.type===s.ATTRIBUTE||A.type===s.EQUALS||A.type===s.VALUE||A.type===s.TEXT&&!N.tag_complete?U=this._handle_inside_tag(V,A,N,Y):A.type===s.TAG_CLOSE?U=this._handle_tag_close(V,A,N):A.type===s.TEXT?U=this._handle_text(V,A,N):V.add_raw_token(A),T=U,A=Y.next();var J=V._output.get_code(h);return J},w.prototype._handle_tag_close=function(_,h,g){var T={text:h.text,type:h.type};return _.alignment_size=0,g.tag_complete=!0,_.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),g.is_unformatted?_.add_raw_token(h):(g.tag_start_char==="<"&&(_.set_space_before_token(h.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&g.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(h)),g.indent_content&&!(g.is_unformatted||g.is_content_unformatted)&&(_.indent(),g.indent_content=!1),!g.is_inline_element&&!(g.is_unformatted||g.is_content_unformatted)&&_.set_wrap_point(),T},w.prototype._handle_inside_tag=function(_,h,g,T){var N=g.has_wrapped_attrs,V={text:h.text,type:h.type};if(_.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),g.is_unformatted)_.add_raw_token(h);else if(g.tag_start_char==="{"&&h.type===s.TEXT)_.print_preserved_newlines(h)?(h.newlines=0,_.add_raw_token(h)):_.print_token(h);else{if(h.type===s.ATTRIBUTE?(_.set_space_before_token(!0),g.attr_count+=1):(h.type===s.EQUALS||h.type===s.VALUE&&h.previous.type===s.EQUALS)&&_.set_space_before_token(!1),h.type===s.ATTRIBUTE&&g.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(h),N=N||h.newlines!==0),this._is_wrap_attributes_force)){var Y=g.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&g.attr_count===1){var U=!0,A=0,J;do{if(J=T.peek(A),J.type===s.ATTRIBUTE){U=!1;break}A+=1}while(A<4&&J.type!==s.EOF&&J.type!==s.TAG_CLOSE);Y=!U}Y&&(_.print_newline(!1),N=!0)}_.print_token(h),N=N||_.previous_token_wrapped(),g.has_wrapped_attrs=N}return V},w.prototype._handle_text=function(_,h,g){var T={text:h.text,type:"TK_CONTENT"};return g.custom_beautifier_name?this._print_custom_beatifier_text(_,h,g):g.is_unformatted||g.is_content_unformatted?_.add_raw_token(h):(_.traverse_whitespace(h),_.print_token(h)),T},w.prototype._print_custom_beatifier_text=function(_,h,g){var T=this;if(h.text!==""){var N=h.text,V,Y=1,U="",A="";g.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?V=this._js_beautify:g.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?V=this._css_beautify:g.custom_beautifier_name==="html"&&(V=function(Re,De){var Fe=new w(Re,De,T._js_beautify,T._css_beautify);return Fe.beautify()}),this._options.indent_scripts==="keep"?Y=0:this._options.indent_scripts==="separate"&&(Y=-_.indent_level);var J=_.get_full_indent(Y);if(N=N.replace(/\n[ \t]*$/,""),g.custom_beautifier_name!=="html"&&N[0]==="<"&&N.match(/^(<!--|<!\[CDATA\[)/)){var te=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(N);if(!te){_.add_raw_token(h);return}U=J+te[1]+`
|
|
`,N=te[4],te[5]&&(A=J+te[5]),N=N.replace(/\n[ \t]*$/,""),(te[2]||te[3].indexOf(`
|
|
`)!==-1)&&(te=te[3].match(/[ \t]+$/),te&&(h.whitespace_before=te[0]))}if(N)if(V){var se=function(){this.eol=`
|
|
`};se.prototype=this._options.raw_options;var fe=new se;N=V(J+N,fe)}else{var Ue=h.whitespace_before;Ue&&(N=N.replace(new RegExp(`
|
|
(`+Ue+")?","g"),`
|
|
`)),N=J+N.replace(/\n/g,`
|
|
`+J)}U&&(N?N=U+N+`
|
|
`+A:N=U+A),_.print_newline(!1),N&&(h.text=N,h.whitespace_before="",h.newlines=0,_.add_raw_token(h),_.print_newline(!0))}},w.prototype._handle_tag_open=function(_,h,g,T){var N=this._get_tag_open_token(h);return(g.is_unformatted||g.is_content_unformatted)&&!g.is_empty_element&&h.type===s.TAG_OPEN&&h.text.indexOf("</")===0?(_.add_raw_token(h),N.start_tag_token=this._tag_stack.try_pop(N.tag_name)):(_.traverse_whitespace(h),this._set_tag_position(_,h,N,g,T),N.is_inline_element||_.set_wrap_point(),_.print_token(h)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(N.alignment_size=h.text.length+1),!N.tag_complete&&!N.is_unformatted&&(_.alignment_size=N.alignment_size),N};var E=function(_,h){if(this.parent=_||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!h)this.tag_complete=!0;else{var g;this.tag_start_char=h.text[0],this.text=h.text,this.tag_start_char==="<"?(g=h.text.match(/^<([^\s>]*)/),this.tag_check=g?g[1]:""):(g=h.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=g?g[1]:"",(h.text.startsWith("{{#>")||h.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&h.next!==null?this.tag_check=h.next.text.split(" ")[0]:this.tag_check=h.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),h.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||h.closed&&h.closed.text==="/>";var T=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(T=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(T)))}};w.prototype._get_tag_open_token=function(_){var h=new E(this._tag_stack.get_parser_token(),_);return h.alignment_size=this._options.wrap_attributes_indent_size,h.is_end_tag=h.is_end_tag||x(h.tag_check,this._options.void_elements),h.is_empty_element=h.tag_complete||h.is_start_tag&&h.is_end_tag,h.is_unformatted=!h.tag_complete&&x(h.tag_check,this._options.unformatted),h.is_content_unformatted=!h.is_empty_element&&x(h.tag_check,this._options.content_unformatted),h.is_inline_element=x(h.tag_name,this._options.inline)||h.tag_name.includes("-")||h.tag_start_char==="{",h},w.prototype._set_tag_position=function(_,h,g,T,N){if(g.is_empty_element||(g.is_end_tag?g.start_tag_token=this._tag_stack.try_pop(g.tag_name):(this._do_optional_end_element(g)&&(g.is_inline_element||_.print_newline(!1)),this._tag_stack.record_tag(g),(g.tag_name==="script"||g.tag_name==="style")&&!(g.is_unformatted||g.is_content_unformatted)&&(g.custom_beautifier_name=C(g.tag_check,h)))),x(g.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.print_newline(!0)),g.is_empty_element){if(g.tag_start_char==="{"&&g.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),g.indent_content=!0;var V=_.current_line_has_match(/{{#if/);V||_.print_newline(!1)}g.tag_name==="!--"&&N.type===s.TAG_CLOSE&&T.is_end_tag&&g.text.indexOf(`
|
|
`)===-1||(g.is_inline_element||g.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,g))}else if(g.is_end_tag){var Y=!1;Y=g.start_tag_token&&g.start_tag_token.multiline_content,Y=Y||!g.is_inline_element&&!(T.is_inline_element||T.is_unformatted)&&!(N.type===s.TAG_CLOSE&&g.start_tag_token===T)&&N.type!=="TK_CONTENT",(g.is_content_unformatted||g.is_unformatted)&&(Y=!1),Y&&_.print_newline(!1)}else g.indent_content=!g.custom_beautifier_name,g.tag_start_char==="<"&&(g.tag_name==="html"?g.indent_content=this._options.indent_inner_html:g.tag_name==="head"?g.indent_content=this._options.indent_head_inner_html:g.tag_name==="body"&&(g.indent_content=this._options.indent_body_inner_html)),!(g.is_inline_element||g.is_unformatted)&&(N.type!=="TK_CONTENT"||g.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,g)},w.prototype._calcluate_parent_multiline=function(_,h){h.parent&&_._output.just_added_newline()&&!((h.is_inline_element||h.is_unformatted)&&h.parent.is_inline_element)&&(h.parent.multiline_content=!0)};var b=["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"],l=["a","audio","del","ins","map","noscript","video"];w.prototype._do_optional_end_element=function(_){var h=null;if(_.is_empty_element||!_.is_start_tag||!_.parent)return;if(_.tag_name==="body")h=h||this._tag_stack.try_pop("head");else if(_.tag_name==="li")h=h||this._tag_stack.try_pop("li",["ol","ul"]);else if(_.tag_name==="dd"||_.tag_name==="dt")h=h||this._tag_stack.try_pop("dt",["dl"]),h=h||this._tag_stack.try_pop("dd",["dl"]);else if(_.parent.tag_name==="p"&&b.indexOf(_.tag_name)!==-1){var g=_.parent.parent;(!g||l.indexOf(g.tag_name)===-1)&&(h=h||this._tag_stack.try_pop("p"))}else _.tag_name==="rp"||_.tag_name==="rt"?(h=h||this._tag_stack.try_pop("rt",["ruby","rtc"]),h=h||this._tag_stack.try_pop("rp",["ruby","rtc"])):_.tag_name==="optgroup"?h=h||this._tag_stack.try_pop("optgroup",["select"]):_.tag_name==="option"?h=h||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):_.tag_name==="colgroup"?h=h||this._tag_stack.try_pop("caption",["table"]):_.tag_name==="thead"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"])):_.tag_name==="tbody"||_.tag_name==="tfoot"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("thead",["table"]),h=h||this._tag_stack.try_pop("tbody",["table"])):_.tag_name==="tr"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(_.tag_name==="th"||_.tag_name==="td")&&(h=h||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),h=h||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return _.parent=this._tag_stack.get_parser_token(),h},y.exports.Beautifier=w},function(y,m,p){var c=p(6).Options;function u(f){c.call(this,f,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}u.prototype=new c,y.exports.Options=u},function(y,m,p){var c=p(9).Tokenizer,u=p(9).TOKEN,f=p(13).Directives,s=p(14).TemplatablePattern,r=p(12).Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:u.START,RAW:u.RAW,EOF:u.EOF},d=new f(/<\!--/,/-->/),L=function(C,x){c.call(this,C,x),this._current_tag_name="";var R=new s(this._input).read_options(this._options),O=new r(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var w=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(w).until_after(w)}};L.prototype=new c,L.prototype._is_comment=function(C){return!1},L.prototype._is_opening=function(C){return C.type===a.TAG_OPEN},L.prototype._is_closing=function(C,x){return C.type===a.TAG_CLOSE&&x&&((C.text===">"||C.text==="/>")&&x.text[0]==="<"||C.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},L.prototype._reset=function(){this._current_tag_name=""},L.prototype._get_next_token=function(C,x){var R=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(a.EOF,""):(R=R||this._read_open_handlebars(O,x),R=R||this._read_attribute(O,C,x),R=R||this._read_close(O,x),R=R||this._read_raw_content(O,C,x),R=R||this._read_content_word(O),R=R||this._read_comment_or_cdata(O),R=R||this._read_processing(O),R=R||this._read_open(O,x),R=R||this._create_token(a.UNKNOWN,this._input.next()),R)},L.prototype._read_comment_or_cdata=function(C){var x=null,R=null,O=null;if(C==="<"){var w=this._input.peek(1);w==="!"&&(R=this.__patterns.comment.read(),R?(O=d.get_directives(R),O&&O.ignore==="start"&&(R+=d.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(x=this._create_token(a.COMMENT,R),x.directives=O)}return x},L.prototype._read_processing=function(C){var x=null,R=null,O=null;if(C==="<"){var w=this._input.peek(1);(w==="!"||w==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(x=this._create_token(a.COMMENT,R),x.directives=O)}return x},L.prototype._read_open=function(C,x){var R=null,O=null;return x||C==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),O=this._create_token(a.TAG_OPEN,R)),O},L.prototype._read_open_handlebars=function(C,x){var R=null,O=null;return x||this._options.indent_handlebars&&C==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),O=this._create_token(a.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),O=this._create_token(a.TAG_OPEN,R))),O},L.prototype._read_close=function(C,x){var R=null,O=null;return x&&(x.text[0]==="<"&&(C===">"||C==="/"&&this._input.peek(1)===">")?(R=this._input.next(),C==="/"&&(R+=this._input.next()),O=this._create_token(a.TAG_CLOSE,R)):x.text[0]==="{"&&C==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(a.TAG_CLOSE,"}}"))),O},L.prototype._read_attribute=function(C,x,R){var O=null,w="";if(R&&R.text[0]==="<")if(C==="=")O=this._create_token(a.EQUALS,this._input.next());else if(C==='"'||C==="'"){var E=this._input.next();C==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),O=this._create_token(a.VALUE,E)}else w=this.__patterns.attribute.read(),w&&(x.type===a.EQUALS?O=this._create_token(a.VALUE,w):O=this._create_token(a.ATTRIBUTE,w));return O},L.prototype._is_content_unformatted=function(C){return this._options.void_elements.indexOf(C)===-1&&(this._options.content_unformatted.indexOf(C)!==-1||this._options.unformatted.indexOf(C)!==-1)},L.prototype._read_raw_content=function(C,x,R){var O="";if(R&&R.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(x.type===a.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var w=x.opened.text.substr(1).toLowerCase();if(w==="script"||w==="style"){var E=this._read_comment_or_cdata(C);if(E)return E.type=a.TEXT,E;O=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(w)&&(O=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(a.TEXT,O):null},L.prototype._read_content_word=function(C){var x="";if(this._options.unformatted_content_delimiter&&(C===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(a.TEXT,x)},y.exports.Tokenizer=L,y.exports.TOKEN=a}],H={};function P(y){var m=H[y];if(m!==void 0)return m.exports;var p=H[y]={exports:{}};return K[y](p,p.exports,P),p.exports}var I=P(18);M=I})();var X=M;if(!0)!(oe=[Z,Z("6UM0"),Z("TXwP")],j=function(K){var H=Z("6UM0"),P=Z("TXwP");return{html_beautify:function(I,y){return X(I,y,H.js_beautify,P.css_beautify)}}}.apply(et,oe),j!==void 0&&(ht.exports=j));else var D,F})()},"rAM+":function(ht,et,Z){"use strict";Z.d(et,"a",function(){return j});var oe=Z("Qw5x");function j(M,X){var D;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(D=Object(oe.a)(M))||X&&M&&typeof M.length=="number"){D&&(M=D);var F=0,K=function(){};return{s:K,n:function(){return F>=M.length?{done:!0}:{done:!1,value:M[F++]}},e:function(m){throw m},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H=!0,P=!1,I;return{s:function(){D=M[Symbol.iterator]()},n:function(){var m=D.next();return H=m.done,m},e:function(m){P=!0,I=m},f:function(){try{!H&&D.return!=null&&D.return()}finally{if(P)throw I}}}}},rUJ1:function(ht,et){const Z=/[&<>"']/,oe=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},D=O=>X[O];function F(O,w){if(w){if(Z.test(O))return O.replace(oe,D)}else if(j.test(O))return O.replace(M,D);return O}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function H(O){return O.replace(K,(w,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const P=/(^|[^\[])\^/g;function I(O,w){O=O.source||O,w=w||"";const E={replace:(b,l)=>(l=l.source||l,l=l.replace(P,"$1"),O=O.replace(b,l),E),getRegex:()=>new RegExp(O,w)};return E}const y=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(O,w,E){if(O){let b;try{b=decodeURIComponent(H(E)).replace(y,"").toLowerCase()}catch(l){return null}if(b.indexOf("javascript:")===0||b.indexOf("vbscript:")===0||b.indexOf("data:")===0)return null}w&&!m.test(E)&&(E=r(w,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(b){return null}return E}const c={},u=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(O,w){c[" "+O]||(u.test(O)?c[" "+O]=O+"/":c[" "+O]=C(O,"/",!0)),O=c[" "+O];const E=O.indexOf(":")===-1;return w.substring(0,2)==="//"?E?w:O.replace(f,"$1")+w:w.charAt(0)==="/"?E?w:O.replace(s,"$1")+w:O+w}const a={exec:function(){}};function d(O){let w=1,E,b;for(;w<arguments.length;w++){E=arguments[w];for(b in E)Object.prototype.hasOwnProperty.call(E,b)&&(O[b]=E[b])}return O}function L(O,w){const E=O.replace(/\|/g,(_,h,g)=>{let T=!1,N=h;for(;--N>=0&&g[N]==="\\";)T=!T;return T?"|":" |"}),b=E.split(/ \|/);let l=0;if(b.length>w)b.splice(w);else for(;b.length<w;)b.push("");for(;l<b.length;l++)b[l]=b[l].trim().replace(/\\\|/g,"|");return b}function C(O,w,E){const b=O.length;if(b===0)return"";let l=0;for(;l<b;){const _=O.charAt(b-l-1);if(_===w&&!E)l++;else if(_!==w&&E)l++;else break}return O.substr(0,b-l)}function x(O,w){if(O.indexOf(w[1])===-1)return-1;const E=O.length;let b=0,l=0;for(;l<E;l++)if(O[l]==="\\")l++;else if(O[l]===w[0])b++;else if(O[l]===w[1]&&(b--,b<0))return l;return-1}function R(O){O&&O.sanitize&&!O.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ht.exports={escape:F,unescape:H,edit:I,cleanUrl:p,resolveUrl:r,noopTest:a,merge:d,splitCells:L,rtrim:C,findClosingBracket:x,checkSanitizeDeprecation:R}},siWv:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___3IH6S",flex_space_between:"flex_space_between___3AU-S",flex_box_vertical_center:"flex_box_vertical_center___1ykIO",flex_box_center_end:"flex_box_center_end___1aIQB",flex_box_column:"flex_box_column___2A_ra",btn:"btn___23gjd"}},t23M:function(ht,et,Z){"use strict";var oe=Z("VTBJ"),j=Z("1OyB"),M=Z("vuIU"),X=Z("Ji7U"),D=Z("LK+K"),F=Z("cDcd"),K=Z.n(F),H=Z("m+aA"),P=Z("Zm9Q"),I=Z("Kwbf"),y=Z("c+Xe"),m=Z("bdgK"),p="rc-observer-key",c=function(u){Object(X.a)(s,u);var f=Object(D.a)(s);function s(){var r;return Object(j.a)(this,s),r=f.apply(this,arguments),r.resizeObserver=null,r.childNode=null,r.currentElement=null,r.state={width:0,height:0,offsetHeight:0,offsetWidth:0},r.onResize=function(a){var d=r.props.onResize,L=a[0].target,C=L.getBoundingClientRect(),x=C.width,R=C.height,O=L.offsetWidth,w=L.offsetHeight,E=Math.floor(x),b=Math.floor(R);if(r.state.width!==E||r.state.height!==b||r.state.offsetWidth!==O||r.state.offsetHeight!==w){var l={width:E,height:b,offsetWidth:O,offsetHeight:w};r.setState(l),d&&Promise.resolve().then(function(){d(Object(oe.a)(Object(oe.a)({},l),{},{offsetWidth:O,offsetHeight:w}))})}},r.setChildNode=function(a){r.childNode=a},r}return Object(M.a)(s,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var a=this.props.disabled;if(a){this.destroyObserver();return}var d=Object(H.a)(this.childNode||this),L=d!==this.currentElement;L&&(this.destroyObserver(),this.currentElement=d),!this.resizeObserver&&d&&(this.resizeObserver=new m.default(this.onResize),this.resizeObserver.observe(d))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var a=this.props.children,d=Object(P.a)(a);if(d.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var L=d[0];if(F.isValidElement(L)&&Object(y.c)(L)){var C=L.ref;d[0]=F.cloneElement(L,{ref:Object(y.a)(C,this.setChildNode)})}return d.length===1?d[0]:d.map(function(x,R){return!F.isValidElement(x)||"key"in x&&x.key!==null?x:F.cloneElement(x,{key:"".concat(p,"-").concat(R)})})}}]),s}(F.Component);c.displayName="ResizeObserver",et.a=c},ulZh:function(ht,et,Z){typeof window!="undefined"&&function(j,M){ht.exports=M()}(this,function(){return function(oe){var j={};function M(X){if(j[X])return j[X].exports;var D=j[X]={i:X,l:!1,exports:{}};return oe[X].call(D.exports,D,D.exports,M),D.l=!0,D.exports}return M.m=oe,M.c=j,M.d=function(X,D,F){M.o(X,D)||Object.defineProperty(X,D,{enumerable:!0,get:F})},M.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},M.t=function(X,D){if(D&1&&(X=M(X)),D&8)return X;if(D&4&&typeof X=="object"&&X&&X.__esModule)return X;var F=Object.create(null);if(M.r(F),Object.defineProperty(F,"default",{enumerable:!0,value:X}),D&2&&typeof X!="string")for(var K in X)M.d(F,K,function(H){return X[H]}.bind(null,K));return F},M.n=function(X){var D=X&&X.__esModule?function(){return X.default}:function(){return X};return M.d(D,"a",D),D},M.o=function(X,D){return Object.prototype.hasOwnProperty.call(X,D)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(oe,j,M){"use strict";var X=Object.prototype.hasOwnProperty,D="~";function F(){}Object.create&&(F.prototype=Object.create(null),new F().__proto__||(D=!1));function K(y,m,p){this.fn=y,this.context=m,this.once=p||!1}function H(y,m,p,c,u){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new K(p,c||y,u),s=D?D+m:m;return y._events[s]?y._events[s].fn?y._events[s]=[y._events[s],f]:y._events[s].push(f):(y._events[s]=f,y._eventsCount++),y}function P(y,m){--y._eventsCount===0?y._events=new F:delete y._events[m]}function I(){this._events=new F,this._eventsCount=0}I.prototype.eventNames=function(){var m=[],p,c;if(this._eventsCount===0)return m;for(c in p=this._events)X.call(p,c)&&m.push(D?c.slice(1):c);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},I.prototype.listeners=function(m){var p=D?D+m:m,c=this._events[p];if(!c)return[];if(c.fn)return[c.fn];for(var u=0,f=c.length,s=new Array(f);u<f;u++)s[u]=c[u].fn;return s},I.prototype.listenerCount=function(m){var p=D?D+m:m,c=this._events[p];return c?c.fn?1:c.length:0},I.prototype.emit=function(m,p,c,u,f,s){var r=D?D+m:m;if(!this._events[r])return!1;var a=this._events[r],d=arguments.length,L,C;if(a.fn){a.once&&this.removeListener(m,a.fn,void 0,!0);switch(d){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,p),!0;case 3:return a.fn.call(a.context,p,c),!0;case 4:return a.fn.call(a.context,p,c,u),!0;case 5:return a.fn.call(a.context,p,c,u,f),!0;case 6:return a.fn.call(a.context,p,c,u,f,s),!0}for(C=1,L=new Array(d-1);C<d;C++)L[C-1]=arguments[C];a.fn.apply(a.context,L)}else{var x=a.length,R;for(C=0;C<x;C++){a[C].once&&this.removeListener(m,a[C].fn,void 0,!0);switch(d){case 1:a[C].fn.call(a[C].context);break;case 2:a[C].fn.call(a[C].context,p);break;case 3:a[C].fn.call(a[C].context,p,c);break;case 4:a[C].fn.call(a[C].context,p,c,u);break;default:if(!L)for(R=1,L=new Array(d-1);R<d;R++)L[R-1]=arguments[R];a[C].fn.apply(a[C].context,L)}}}return!0},I.prototype.on=function(m,p,c){return H(this,m,p,c,!1)},I.prototype.once=function(m,p,c){return H(this,m,p,c,!0)},I.prototype.removeListener=function(m,p,c,u){var f=D?D+m:m;if(!this._events[f])return this;if(!p)return P(this,f),this;var s=this._events[f];if(s.fn)s.fn===p&&(!u||s.once)&&(!c||s.context===c)&&P(this,f);else{for(var r=0,a=[],d=s.length;r<d;r++)(s[r].fn!==p||u&&!s[r].once||c&&s[r].context!==c)&&a.push(s[r]);a.length?this._events[f]=a.length===1?a[0]:a:P(this,f)}return this},I.prototype.removeAllListeners=function(m){var p;return m?(p=D?D+m:m,this._events[p]&&P(this,p)):(this._events=new F,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=D,I.EventEmitter=I,oe.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(oe,j,M){(function(X){var D=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,F=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,H=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,P={buildAbsoluteURL:function(I,y,m){if(m=m||{},I=I.trim(),y=y.trim(),!y){if(!m.alwaysNormalize)return I;var p=P.parseURL(I);if(!p)throw new Error("Error trying to parse base URL.");return p.path=P.normalizePath(p.path),P.buildURLFromParts(p)}var c=P.parseURL(y);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return m.alwaysNormalize?(c.path=P.normalizePath(c.path),P.buildURLFromParts(c)):y;var u=P.parseURL(I);if(!u)throw new Error("Error trying to parse base URL.");if(!u.netLoc&&u.path&&u.path[0]!=="/"){var f=F.exec(u.path);u.netLoc=f[1],u.path=f[2]}u.netLoc&&!u.path&&(u.path="/");var s={scheme:u.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(s.netLoc=u.netLoc,c.path[0]!=="/"))if(!c.path)s.path=u.path,c.params||(s.params=u.params,c.query||(s.query=u.query));else{var r=u.path,a=r.substring(0,r.lastIndexOf("/")+1)+c.path;s.path=P.normalizePath(a)}return s.path===null&&(s.path=m.alwaysNormalize?P.normalizePath(c.path):c.path),P.buildURLFromParts(s)},parseURL:function(I){var y=D.exec(I);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(K,"");I.length!==(I=I.replace(H,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};oe.exports=P})(this)},"./node_modules/webworkify-webpack/index.js":function(oe,j,M){function X(m){var p={};function c(f){if(p[f])return p[f].exports;var s=p[f]={i:f,l:!1,exports:{}};return m[f].call(s.exports,s,s.exports,c),s.l=!0,s.exports}c.m=m,c.c=p,c.i=function(f){return f},c.d=function(f,s,r){c.o(f,s)||Object.defineProperty(f,s,{configurable:!1,enumerable:!0,get:r})},c.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},c.n=function(f){var s=f&&f.__esModule?function(){return f.default}:function(){return f};return c.d(s,"a",s),s},c.o=function(f,s){return Object.prototype.hasOwnProperty.call(f,s)},c.p="/",c.oe=function(f){throw console.error(f),f};var u=c(c.s=ENTRY_MODULE);return u.default||u}var D="[\\.|\\-|\\+|\\w|/|@]+",F="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+D+").*?\\)";function K(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function H(m){return!isNaN(1*m)}function P(m,p,c){var u={};u[c]=[];var f=p.toString(),s=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return u;for(var r=s[1],a=new RegExp("(\\\\n|\\W)"+K(r)+F,"g"),d;d=a.exec(f);){if(d[3]==="dll-reference")continue;u[c].push(d[3])}for(a=new RegExp("\\("+K(r)+'\\("(dll-reference\\s('+D+'))"\\)\\)'+F,"g");d=a.exec(f);)m[d[2]]||(u[c].push(d[1]),m[d[2]]=M(d[1]).m),u[d[2]]=u[d[2]]||[],u[d[2]].push(d[4]);for(var L=Object.keys(u),C=0;C<L.length;C++)for(var x=0;x<u[L[C]].length;x++)H(u[L[C]][x])&&(u[L[C]][x]=1*u[L[C]][x]);return u}function I(m){var p=Object.keys(m);return p.reduce(function(c,u){return c||m[u].length>0},!1)}function y(m,p){for(var c={main:[p]},u={main:[]},f={main:{}};I(c);)for(var s=Object.keys(c),r=0;r<s.length;r++){var a=s[r],d=c[a],L=d.pop();if(f[a]=f[a]||{},f[a][L]||!m[a][L])continue;f[a][L]=!0,u[a]=u[a]||[],u[a].push(L);for(var C=P(m,m[a][L],a),x=Object.keys(C),R=0;R<x.length;R++)c[x[R]]=c[x[R]]||[],c[x[R]]=c[x[R]].concat(C[x[R]])}return u}oe.exports=function(m,p){p=p||{};var c={main:M.m},u=p.all?{main:Object.keys(c.main)}:y(c,m),f="";Object.keys(u).filter(function(L){return L!=="main"}).forEach(function(L){for(var C=0;u[L][C];)C++;u[L].push(C),c[L][C]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+L+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+u[L].map(function(x){return""+JSON.stringify(x)+": "+c[L][x].toString()}).join(",")+`});
|
|
`}),f=f+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+u.main.map(function(L){return""+JSON.stringify(L)+": "+c.main[L].toString()}).join(",")+"}))(self);";var s=new window.Blob([f],{type:"text/javascript"});if(p.bare)return s;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,a=r.createObjectURL(s),d=new window.Worker(a);return d.objectURL=a,d}},"./src/config.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"hlsDefaultConfig",function(){return R}),M.d(j,"mergeConfig",function(){return w}),M.d(j,"enableStreamingMode",function(){return E});var X=M("./src/controller/abr-controller.ts"),D=M("./src/controller/audio-stream-controller.ts"),F=M("./src/controller/audio-track-controller.ts"),K=M("./src/controller/subtitle-stream-controller.ts"),H=M("./src/controller/subtitle-track-controller.ts"),P=M("./src/controller/buffer-controller.ts"),I=M("./src/controller/timeline-controller.ts"),y=M("./src/controller/cap-level-controller.ts"),m=M("./src/controller/fps-controller.ts"),p=M("./src/controller/eme-controller.ts"),c=M("./src/controller/cmcd-controller.ts"),u=M("./src/utils/xhr-loader.ts"),f=M("./src/utils/fetch-loader.ts"),s=M("./src/utils/cues.ts"),r=M("./src/utils/mediakeys-helper.ts"),a=M("./src/utils/logger.ts");function d(){return d=Object.assign||function(b){for(var l=1;l<arguments.length;l++){var _=arguments[l];for(var h in _)Object.prototype.hasOwnProperty.call(_,h)&&(b[h]=_[h])}return b},d.apply(this,arguments)}function L(b,l){var _=Object.keys(b);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(b);l&&(h=h.filter(function(g){return Object.getOwnPropertyDescriptor(b,g).enumerable})),_.push.apply(_,h)}return _}function C(b){for(var l=1;l<arguments.length;l++){var _=arguments[l]!=null?arguments[l]:{};l%2?L(Object(_),!0).forEach(function(h){x(b,h,_[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(_)):L(Object(_)).forEach(function(h){Object.defineProperty(b,h,Object.getOwnPropertyDescriptor(_,h))})}return b}function x(b,l,_){return l in b?Object.defineProperty(b,l,{value:_,enumerable:!0,configurable:!0,writable:!0}):b[l]=_,b}var R=C(C({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:u.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:X.default,bufferController:P.default,capLevelController:y.default,fpsController:m.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},O()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:H.default,timelineController:I.TimelineController,audioStreamController:D.default,audioTrackController:F.default,emeController:p.default,cmcdController:c.default});function O(){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 w(b,l){if((l.liveSyncDurationCount||l.liveMaxLatencyDurationCount)&&(l.liveSyncDuration||l.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(l.liveMaxLatencyDurationCount!==void 0&&(l.liveSyncDurationCount===void 0||l.liveMaxLatencyDurationCount<=l.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(l.liveMaxLatencyDuration!==void 0&&(l.liveSyncDuration===void 0||l.liveMaxLatencyDuration<=l.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},b,l)}function E(b){var l=b.loader;if(l!==f.default&&l!==u.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),b.progressive=!1;else{var _=Object(f.fetchSupported)();_&&(b.loader=f.default,b.progressive=!0,b.enableSoftwareAES=!0,a.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/polyfills/number.ts"),D=M("./src/utils/ewma-bandwidth-estimator.ts"),F=M("./src/events.ts"),K=M("./src/utils/buffer-helper.ts"),H=M("./src/errors.ts"),P=M("./src/types/loader.ts"),I=M("./src/utils/logger.ts");function y(c,u){for(var f=0;f<u.length;f++){var s=u[f];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function m(c,u,f){return u&&y(c.prototype,u),f&&y(c,f),c}var p=function(){function c(f){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=f;var s=f.config;this.bwEstimator=new D.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var u=c.prototype;return u.registerListeners=function(){var s=this.hls;s.on(F.Events.FRAG_LOADING,this.onFragLoading,this),s.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(F.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var s=this.hls;s.off(F.Events.FRAG_LOADING,this.onFragLoading,this),s.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(F.Events.ERROR,this.onError,this)},u.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},u.onFragLoading=function(s,r){var a=r.frag;if(a.type===P.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=a,this.partCurrent=(d=r.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},u.onLevelLoaded=function(s,r){var a=this.hls.config;r.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},u._abandonRulesCheck=function(){var s=this.fragCurrent,r=this.partCurrent,a=this.hls,d=a.autoLevelEnabled,L=a.config,C=a.media;if(!s||!C)return;var x=r?r.stats:s.stats,R=r?r.duration:s.duration;if(x.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||C.paused||!C.playbackRate||!C.readyState)return;var O=performance.now()-x.loading.start,w=Math.abs(C.playbackRate);if(O<=500*R/w)return;var E=a.levels,b=a.minAutoLevel,l=E[s.level],_=x.total||Math.max(x.loaded,Math.round(R*l.maxBitrate/8)),h=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/O),g=(_-x.loaded)/h,T=C.currentTime,N=(K.BufferHelper.bufferInfo(C,T,L.maxBufferHole).end-T)/w;if(N>=2*R/w||g<=N)return;var V=Number.POSITIVE_INFINITY,Y;for(Y=s.level-1;Y>b;Y--){var U=E[Y].maxBitrate;if(V=R*U/(8*.8*h),V<N)break}if(V>=g)return;var A=this.bwEstimator.getEstimate();I.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 "+Y+`
|
|
Current BW estimate: `+(Object(X.isFiniteNumber)(A)?(A/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+g.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+V.toFixed(3)+` s
|
|
Time to underbuffer: `+N.toFixed(3)+" s"),a.nextLoadLevel=Y,this.bwEstimator.sample(O,x.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),a.trigger(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:r,stats:x})},u.onFragLoaded=function(s,r){var a=r.frag,d=r.part;if(a.type===P.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(a.sn)){var L=d?d.stats:a.stats,C=d?d.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[a.level],R=(x.loaded?x.loaded.bytes:0)+L.loaded,O=(x.loaded?x.loaded.duration:0)+C;x.loaded={bytes:R,duration:O},x.realBitrate=Math.round(8*R/O)}if(a.bitrateTest){var w={stats:L,frag:a,part:d,id:a.type};this.onFragBuffered(F.Events.FRAG_BUFFERED,w),a.bitrateTest=!1}}},u.onFragBuffered=function(s,r){var a=r.frag,d=r.part,L=d?d.stats:a.stats;if(L.aborted)return;if(a.type!==P.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var C=L.parsing.end-L.loading.start;this.bwEstimator.sample(C,L.loaded),L.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=C/1e3:this.bitrateTestDelay=0},u.onError=function(s,r){switch(r.details){case H.ErrorDetails.FRAG_LOAD_ERROR:case H.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},u.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},u.getNextABRAutoLevel=function(){var s=this.fragCurrent,r=this.partCurrent,a=this.hls,d=a.maxAutoLevel,L=a.config,C=a.minAutoLevel,x=a.media,R=r?r.duration:s?s.duration:0,O=x?x.currentTime:0,w=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():L.abrEwmaDefaultEstimate,b=(K.BufferHelper.bufferInfo(x,O,L.maxBufferHole).end-O)/w,l=this.findBestLevel(E,C,d,b,L.abrBandWidthFactor,L.abrBandWidthUpFactor);if(l>=0)return l;I.logger.trace((b?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=R?Math.min(R,L.maxStarvationDelay):L.maxStarvationDelay,h=L.abrBandWidthFactor,g=L.abrBandWidthUpFactor;if(!b){var T=this.bitrateTestDelay;if(T){var N=R?Math.min(R,L.maxLoadingDelay):L.maxLoadingDelay;_=N-T,I.logger.trace("bitrate test took "+Math.round(1e3*T)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),h=g=1}}return l=this.findBestLevel(E,C,d,b+_,h,g),Math.max(l,0)},u.findBestLevel=function(s,r,a,d,L,C){for(var x,R=this.fragCurrent,O=this.partCurrent,w=this.lastLoadedFragLevel,E=this.hls.levels,b=E[w],l=!!(b!=null&&(x=b.details)!==null&&x!==void 0&&x.live),_=b==null?void 0:b.codecSet,h=O?O.duration:R?R.duration:0,g=a;g>=r;g--){var T=E[g];if(!T||_&&T.codecSet!==_)continue;var N=T.details,V=(O?N==null?void 0:N.partTarget:N==null?void 0:N.averagetargetduration)||h,Y=void 0;g<=w?Y=L*s:Y=C*s;var U=E[g].maxBitrate,A=U*V/Y;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+g+"/"+Math.round(Y)+"/"+U+"/"+V+"/"+d+"/"+A),Y>U&&(!A||l&&!this.bitrateTestDelay||A<d))return g}return-1},m(c,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,r=this.bwEstimator;if(s!==-1&&(!r||!r.canEstimate()))return s;var a=this.getNextABRAutoLevel();return s!==-1&&(a=Math.min(s,a)),a},set:function(s){this._nextAutoLevel=s}}]),c}();j.default=p},"./src/controller/audio-stream-controller.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/polyfills/number.ts"),D=M("./src/controller/base-stream-controller.ts"),F=M("./src/events.ts"),K=M("./src/utils/buffer-helper.ts"),H=M("./src/controller/fragment-tracker.ts"),P=M("./src/types/level.ts"),I=M("./src/types/loader.ts"),y=M("./src/loader/fragment.ts"),m=M("./src/demux/chunk-cache.ts"),p=M("./src/demux/transmuxer-interface.ts"),c=M("./src/types/transmuxer.ts"),u=M("./src/controller/fragment-finders.ts"),f=M("./src/utils/discontinuities.ts"),s=M("./src/errors.ts"),r=M("./src/utils/logger.ts");function a(){return a=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var w=arguments[O];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(R[E]=w[E])}return R},a.apply(this,arguments)}function d(R,O){R.prototype=Object.create(O.prototype),R.prototype.constructor=R,L(R,O)}function L(R,O){return L=Object.setPrototypeOf||function(E,b){return E.__proto__=b,E},L(R,O)}var C=100,x=function(R){d(O,R);function O(E,b){var l;return l=R.call(this,E,b,"[audio-stream-controller]")||this,l.videoBuffer=null,l.videoTrackCC=-1,l.waitingVideoCC=-1,l.audioSwitch=!1,l.trackId=-1,l.waitingData=null,l.mainDetails=null,l.bufferFlushed=!1,l._registerListeners(),l}var w=O.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var b=this.hls;b.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),b.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),b.on(F.Events.ERROR,this.onError,this),b.on(F.Events.BUFFER_RESET,this.onBufferReset,this),b.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),b.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var b=this.hls;b.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),b.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),b.off(F.Events.ERROR,this.onError,this),b.off(F.Events.BUFFER_RESET,this.onBufferReset,this),b.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),b.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onInitPtsFound=function(b,l){var _=l.frag,h=l.id,g=l.initPTS;if(h==="main"){var T=_.cc;this.initPTS[_.cc]=g,this.log("InitPTS for cc: "+T+" found from main: "+g),this.videoTrackCC=T,this.state===D.State.WAITING_INIT_PTS&&this.tick()}},w.startLoad=function(b){if(!this.levels){this.startPosition=b,this.state=D.State.STOPPED;return}var l=this.lastCurrentTime;this.stopLoad(),this.setInterval(C),this.fragLoadError=0,l>0&&b===-1?(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),this.state=D.State.IDLE):(this.loadedmetadata=!1,this.state=D.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()},w.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_TRACK:{var b,l=this.levels,_=this.trackId,h=l==null||((b=l[_])===null||b===void 0)?void 0:b.details;if(h){if(this.waitForCdnTuneIn(h))break;this.state=D.State.WAITING_INIT_PTS}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var g,T=performance.now(),N=this.retryDate;(!N||T>=N||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=D.State.IDLE);break}case D.State.WAITING_INIT_PTS:{var V=this.waitingData;if(V){var Y=V.frag,U=V.part,A=V.cache,J=V.complete;if(this.initPTS[Y.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.FRAG_LOADING;var te=A.flush(),se={frag:Y,part:U,payload:te,networkDetails:null};this._handleFragmentLoadProgress(se),J&&R.prototype._handleFragmentLoadComplete.call(this,se)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+Y.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),Ue=K.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Re=Object(u.fragmentWithinToleranceTest)(Ue.end,this.config.maxFragLookUpTolerance,Y);Re<0&&(r.logger.log("Waiting fragment cc ("+Y.cc+") @ "+Y.start+" cancelled because another fragment at "+Ue.end+" is needed"),this.clearWaitingFragment())}}else this.state=D.State.IDLE}}this.onTickEnd()},w.clearWaitingFragment=function(){var b=this.waitingData;b&&(this.fragmentTracker.removeFragment(b.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.IDLE)},w.onTickEnd=function(){var b=this.media;if(!b||!b.readyState)return;var l=this.mediaBuffer?this.mediaBuffer:b,_=l.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=b.currentTime},w.doTickIdle=function(){var b,l,_=this.hls,h=this.levels,g=this.media,T=this.trackId,N=_.config;if(!h||!h[T])return;if(!g&&(this.startFragRequested||!N.startFragPrefetch))return;var V=h[T],Y=V.details;if(!Y||Y.live&&this.levelLastLoaded!==T||this.waitForCdnTuneIn(Y)){this.state=D.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(U===null)return;var A=U.len,J=this.getMaxBufferLength(),te=this.audioSwitch;if(A>=J&&!te)return;if(!te&&this._streamEnded(U,Y)){_.trigger(F.Events.BUFFER_EOS,{type:"audio"}),this.state=D.State.ENDED;return}var se=Y.fragments,fe=se[0].start,Ue=U.end;if(te){var Re=this.getLoadPosition();Ue=Re,Y.PTSKnown&&Re<fe&&((U.end>fe||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),g.currentTime=fe+.05))}var De=this.getNextFragment(Ue,Y);if(!De){this.bufferFlushed=!0;return}((b=De.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((l=De.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(De,Y):this.loadFragment(De,Y,Ue)},w.getMaxBufferLength=function(){var b=R.prototype.getMaxBufferLength.call(this),l=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return l===null?b:Math.max(b,l.len)},w.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},w.onAudioTracksUpdated=function(b,l){var _=l.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(h){return new P.Level(h)})},w.onAudioTrackSwitching=function(b,l){var _=!!l.url;this.trackId=l.id;var h=this.fragCurrent;h!=null&&h.loader&&h.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(C):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=D.State.IDLE):this.state=D.State.STOPPED,this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},w.onLevelLoaded=function(b,l){this.mainDetails=l.details},w.onAudioTrackLoaded=function(b,l){var _,h=this.levels,g=l.details,T=l.id;if(!h){this.warn("Audio tracks were reset while loading level "+T);return}this.log("Track "+T+" loaded ["+g.startSN+","+g.endSN+"],duration:"+g.totalduration);var N=h[T],V=0;if(g.live||(_=N.details)!==null&&_!==void 0&&_.live){var Y=this.mainDetails;if(g.fragments[0]||(g.deltaUpdateFailed=!0),g.deltaUpdateFailed||!Y)return;!N.details&&g.hasProgramDateTime&&Y.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(g,Y),V=g.fragments[0].start):V=this.alignPlaylists(g,N.details)}N.details=g,this.levelLastLoaded=T,!this.startFragRequested&&(this.mainDetails||!g.live)&&this.setStartPosition(N.details,V),this.state===D.State.WAITING_TRACK&&!this.waitForCdnTuneIn(g)&&(this.state=D.State.IDLE),this.tick()},w._handleFragmentLoadProgress=function(b){var l,_=b.frag,h=b.part,g=b.payload,T=this.config,N=this.trackId,V=this.levels;if(!V){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var Y=V[N];console.assert(Y,"Audio track is defined on fragment load progress");var U=Y.details;console.assert(U,"Audio track details are defined on fragment load progress");var A=T.defaultAudioCodec||Y.audioCodec||"mp4a.40.2",J=this.transmuxer;J||(J=this.transmuxer=new p.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[_.cc],se=(l=_.initSegment)===null||l===void 0?void 0:l.data;if(te!==void 0){var fe=!1,Ue=h?h.index:-1,Re=Ue!==-1,De=new c.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,g.byteLength,Ue,Re);J.push(g,se,A,"",_,h,U.totalduration,fe,De,te)}else{r.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+N);var Fe=this.waitingData=this.waitingData||{frag:_,part:h,cache:new m.default,complete:!1},Me=Fe.cache;Me.push(new Uint8Array(g)),this.waitingVideoCC=this.videoTrackCC,this.state=D.State.WAITING_INIT_PTS}},w._handleFragmentLoadComplete=function(b){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,b)},w.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},w.onBufferCreated=function(b,l){var _=l.tracks.audio;_&&(this.mediaBuffer=_.buffer),l.tracks.video&&(this.videoBuffer=l.tracks.video.buffer)},w.onFragBuffered=function(b,l){var _=l.frag,h=l.part;if(_.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(h?" p: "+h.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,h)},w.onError=function(b,l){switch(l.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(I.PlaylistLevelType.AUDIO,l);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==D.State.ERROR&&this.state!==D.State.STOPPED&&(this.state=l.fatal?D.State.ERROR:D.State.IDLE,this.warn(l.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="audio"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var _=!0,h=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);h&&h.len>.5&&(_=!this.reduceMaxBufferLength(h.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},w.onBufferFlushed=function(b,l){var _=l.type;_===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},w._handleTransmuxComplete=function(b){var l,_="audio",h=this.hls,g=b.remuxResult,T=b.chunkMeta,N=this.getCurrentContext(T);if(!N){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(T.level);return}var V=N.frag,Y=N.part,U=g.audio,A=g.text,J=g.id3,te=g.initSegment;if(this.fragContextChanged(V))return;if(this.state=D.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,V,T),h.trigger(F.Events.FRAG_PARSING_INIT_SEGMENT,{frag:V,id:_,tracks:te.tracks})),U){var se=U.startPTS,fe=U.endPTS,Ue=U.startDTS,Re=U.endDTS;Y&&(Y.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:fe,startDTS:Ue,endDTS:Re}),V.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,se,fe,Ue,Re),this.bufferFragmentData(U,V,Y,T)}if(J!=null&&(l=J.samples)!==null&&l!==void 0&&l.length){var De=a({frag:V,id:_},J);h.trigger(F.Events.FRAG_PARSING_METADATA,De)}if(A){var Fe=a({frag:V,id:_},A);h.trigger(F.Events.FRAG_PARSING_USERDATA,Fe)}},w._bufferInitSegment=function(b,l,_){if(this.state!==D.State.PARSING)return;b.video&&delete b.video;var h=b.audio;if(!h)return;h.levelCodec=h.codec,h.id="audio",this.log("Init audio buffer, container:"+h.container+", codecs[parsed]=["+h.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,b);var g=h.initSegment;if(g!=null&&g.byteLength){var T={type:"audio",frag:l,part:null,chunkMeta:_,parent:l.type,data:g};this.hls.trigger(F.Events.BUFFER_APPENDING,T)}this.tick()},w.loadFragment=function(b,l,_){var h=this.fragmentTracker.getState(b);this.fragCurrent=b,(this.audioSwitch||h===H.FragmentState.NOT_LOADED||h===H.FragmentState.PARTIAL)&&(b.sn==="initSegment"?this._loadInitSegment(b):l.live&&!Object(X.isFiniteNumber)(this.initPTS[b.cc])?(this.log("Waiting for video PTS in continuity counter "+b.cc+" of live stream before loading audio fragment "+b.sn+" of level "+this.trackId),this.state=D.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,b,l,_)))},w.completeAudioSwitch=function(){var b=this.hls,l=this.media,_=this.trackId;l&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,b.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:_})},O}(D.default);j.default=x},"./src/controller/audio-track-controller.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/events.ts"),D=M("./src/errors.ts"),F=M("./src/controller/base-playlist-controller.ts"),K=M("./src/types/loader.ts");function H(p,c){for(var u=0;u<c.length;u++){var f=c[u];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function P(p,c,u){return c&&H(p.prototype,c),u&&H(p,u),p}function I(p,c){p.prototype=Object.create(c.prototype),p.prototype.constructor=p,y(p,c)}function y(p,c){return y=Object.setPrototypeOf||function(f,s){return f.__proto__=s,f},y(p,c)}var m=function(p){I(c,p);function c(f){var s;return s=p.call(this,f,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var u=c.prototype;return u.registerListeners=function(){var s=this.hls;s.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(X.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var s=this.hls;s.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(X.Events.ERROR,this.onError,this)},u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},u.onManifestParsed=function(s,r){this.tracks=r.audioTracks||[]},u.onAudioTrackLoaded=function(s,r){var a=r.id,d=r.details,L=this.tracksInGroup[a];if(!L){this.warn("Invalid audio track id "+a);return}var C=L.details;L.details=r.details,this.log("audioTrack "+a+" loaded ["+d.startSN+"-"+d.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,r,C))},u.onLevelLoading=function(s,r){this.switchLevel(r.level)},u.onLevelSwitching=function(s,r){this.switchLevel(r.level)},u.switchLevel=function(s){var r=this.hls.levels[s];if(!(r!=null&&r.audioGroupIds))return;var a=r.audioGroupIds[r.urlId];if(this.groupId!==a){this.groupId=a;var d=this.tracks.filter(function(C){return!a||C.groupId===a});this.selectDefaultTrack&&!d.some(function(C){return C.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var L={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,L),this.selectInitialTrack()}},u.onError=function(s,r){if(p.prototype.onError.call(this,s,r),r.fatal||!r.context)return;r.context.type===K.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},u.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 a=r[this.trackId];this.log("Now switching to audio-track index "+s);var d=r[s],L=d.id,C=d.groupId,x=C===void 0?"":C,R=d.name,O=d.type,w=d.url;if(this.trackId=s,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:L,groupId:x,name:R,type:O,url:w}),d.details&&!d.details.live)return;var E=this.switchParams(d.url,a==null?void 0:a.details);this.loadPlaylist(E)},u.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,a=this.findTrackId(r)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},u.findTrackId=function(s){for(var r=this.tracksInGroup,a=0;a<r.length;a++){var d=r[a];if((!this.selectDefaultTrack||d.default)&&(!s||s===d.name))return d.id}return-1},u.loadPlaylist=function(s){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var a=r.id,d=r.groupId,L=r.url;if(s)try{L=s.addDirectives(L)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("loading audio-track playlist for id: "+a),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:L,id:a,groupId:d,deliveryDirectives:s||null})}},P(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),c}(F.default);j.default=m},"./src/controller/base-playlist-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return P});var X=M("./src/polyfills/number.ts"),D=M("./src/types/level.ts"),F=M("./src/controller/level-helper.ts"),K=M("./src/utils/logger.ts"),H=M("./src/errors.ts"),P=function(){function I(m,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,p+":"),this.warn=K.logger.warn.bind(K.logger,p+":"),this.hls=m}var y=I.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(p,c){c.fatal&&c.type===H.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(p,c){var u=c==null?void 0:c.renditionReports;if(u)for(var f=0;f<u.length;f++){var s=u[f],r=""+s.URI;if(r===p.substr(-r.length)){var a=parseInt(s["LAST-MSN"]),d=parseInt(s["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var L=Math.min(c.age-c.partTarget,c.targetduration);d!==void 0&&L>c.partTarget&&(d+=1)}if(Object(X.isFiniteNumber)(a))return new D.HlsUrlParameters(a,Object(X.isFiniteNumber)(d)?d:void 0,D.HlsSkip.No)}}},y.loadPlaylist=function(p){},y.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},y.playlistLoaded=function(p,c,u){var f=this,s=c.details,r=c.stats,a=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(s.advancedDateTime=Date.now()-a,s.live||u!=null&&u.live){if(s.reloaded(u),u&&this.log("live playlist "+p+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),u&&s.fragments.length>0&&Object(F.mergeDetails)(u,s),!this.canLoad||!s.live)return;var d,L=void 0,C=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var x=this.hls.config.lowLatencyMode,R=s.lastPartSn,O=s.endSN,w=s.lastPartIndex,E=w!==-1,b=R===O,l=x?0:w;E?(L=b?O+1:R,C=b?l:w+1):L=O+1;var _=s.age,h=_+s.ageHeader,g=Math.min(h-s.partTarget,s.targetduration*1.5);if(g>0){if(u&&g>u.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+u.tuneInGoal+" to: "+g+" with playlist age: "+s.age),g=0;else{var T=Math.floor(g/s.targetduration);if(L+=T,C!==void 0){var N=Math.round(g%s.targetduration/s.partTarget);C+=N}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+g+" skip sn "+T+" to part "+C)}s.tuneInGoal=g}if(d=this.getDeliveryDirectives(s,c.deliveryDirectives,L,C),x||!b){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(s,c.deliveryDirectives,L,C);var V=Object(F.computeReloadInterval)(s,r);L!==void 0&&s.canBlockReload&&(V-=s.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(V)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(d)},V)}else this.clearTimer()},y.getDeliveryDirectives=function(p,c,u,f){var s=Object(D.getSkipValue)(p,u);return c!=null&&c.skip&&p.deltaUpdateFailed&&(u=c.msn,f=c.part,s=D.HlsSkip.No),new D.HlsUrlParameters(u,f,s)},y.retryLoadingOrFail=function(p){var c=this,u=this.hls.config,f=this.retryCount<u.levelLoadingMaxRetry;if(f){var s;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(s=p.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*u.levelLoadingRetryDelay,u.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return f},I}()},"./src/controller/base-stream-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"State",function(){return O}),M.d(j,"default",function(){return w});var X=M("./src/polyfills/number.ts"),D=M("./src/task-loop.ts"),F=M("./src/controller/fragment-tracker.ts"),K=M("./src/utils/buffer-helper.ts"),H=M("./src/utils/logger.ts"),P=M("./src/events.ts"),I=M("./src/errors.ts"),y=M("./src/types/transmuxer.ts"),m=M("./src/utils/mp4-tools.ts"),p=M("./src/utils/discontinuities.ts"),c=M("./src/controller/fragment-finders.ts"),u=M("./src/controller/level-helper.ts"),f=M("./src/loader/fragment-loader.ts"),s=M("./src/crypt/decrypter.ts"),r=M("./src/utils/time-ranges.ts"),a=M("./src/types/loader.ts");function d(E,b){for(var l=0;l<b.length;l++){var _=b[l];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(E,_.key,_)}}function L(E,b,l){return b&&d(E.prototype,b),l&&d(E,l),E}function C(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function x(E,b){E.prototype=Object.create(b.prototype),E.prototype.constructor=E,R(E,b)}function R(E,b){return R=Object.setPrototypeOf||function(_,h){return _.__proto__=h,_},R(E,b)}var O={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},w=function(E){x(b,E);function b(_,h,g){var T;return T=E.call(this)||this,T.hls=void 0,T.fragPrevious=null,T.fragCurrent=null,T.fragmentTracker=void 0,T.transmuxer=null,T._state=O.STOPPED,T.media=void 0,T.mediaBuffer=void 0,T.config=void 0,T.bitrateTest=!1,T.lastCurrentTime=0,T.nextLoadPosition=0,T.startPosition=0,T.loadedmetadata=!1,T.fragLoadError=0,T.retryDate=0,T.levels=null,T.fragmentLoader=void 0,T.levelLastLoaded=null,T.startFragRequested=!1,T.decrypter=void 0,T.initPTS=[],T.onvseeking=null,T.onvended=null,T.logPrefix="",T.log=void 0,T.warn=void 0,T.logPrefix=g,T.log=H.logger.log.bind(H.logger,g+":"),T.warn=H.logger.warn.bind(H.logger,g+":"),T.hls=_,T.fragmentLoader=new f.default(_.config),T.fragmentTracker=h,T.config=_.config,T.decrypter=new s.default(_,_.config),_.on(P.Events.KEY_LOADED,T.onKeyLoaded,C(T)),T}var l=b.prototype;return l.doTick=function(){this.onTickEnd()},l.onTickEnd=function(){},l.startLoad=function(h){},l.stopLoad=function(){this.fragmentLoader.abort();var h=this.fragCurrent;h&&this.fragmentTracker.removeFragment(h),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},l._streamEnded=function(h,g){var T=this.fragCurrent,N=this.fragmentTracker;if(!g.live&&T&&T.sn===g.endSN&&!h.nextStart){var V=N.getState(T);return V===F.FragmentState.PARTIAL||V===F.FragmentState.OK}return!1},l.onMediaAttached=function(h,g){var T=this.media=this.mediaBuffer=g.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),T.addEventListener("seeking",this.onvseeking),T.addEventListener("ended",this.onvended);var N=this.config;this.levels&&N.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(N.startPosition)},l.onMediaDetaching=function(){var h=this.media;h!=null&&h.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),h&&(h.removeEventListener("seeking",this.onvseeking),h.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},l.onMediaSeeking=function(){var h=this.config,g=this.fragCurrent,T=this.media,N=this.mediaBuffer,V=this.state,Y=T?T.currentTime:0,U=K.BufferHelper.bufferInfo(N||T,Y,h.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(Y)?Y.toFixed(3):Y)+", state: "+V),V===O.ENDED)this.resetLoadingState();else if(g&&!U.len){var A=h.maxFragLookUpTolerance,J=g.start-A,te=g.start+g.duration+A,se=Y>te;(Y<J||se)&&(se&&g.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),g.loader.abort()),this.resetLoadingState())}T&&(this.lastCurrentTime=Y),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=Y),this.tickImmediate()},l.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},l.onKeyLoaded=function(h,g){if(this.state!==O.KEY_LOADING||g.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var T=this.levels[g.frag.level].details;T&&this.loadFragment(g.frag,T,g.frag.start)},l.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},l.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(P.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,E.prototype.onHandlerDestroyed.call(this)},l.loadKey=function(h,g){this.log("Loading key for "+h.sn+" of ["+g.startSN+"-"+g.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level),this.state=O.KEY_LOADING,this.fragCurrent=h,this.hls.trigger(P.Events.KEY_LOADING,{frag:h})},l.loadFragment=function(h,g,T){this._loadFragForPlayback(h,g,T)},l._loadFragForPlayback=function(h,g,T){var N=this,V=function(U){if(N.fragContextChanged(h)){N.warn("Fragment "+h.sn+(U.part?" p: "+U.part.index:"")+" of level "+h.level+" was dropped during download."),N.fragmentTracker.removeFragment(h);return}h.stats.chunkCount++,N._handleFragmentLoadProgress(U)};this._doFragLoad(h,g,T,V).then(function(Y){if(!Y)return;N.fragLoadError=0;var U=N.state;if(N.fragContextChanged(h)){(U===O.FRAG_LOADING||U===O.BACKTRACKING||!N.fragCurrent&&U===O.PARSING)&&(N.fragmentTracker.removeFragment(h),N.state=O.IDLE);return}if("payload"in Y&&(N.log("Loaded fragment "+h.sn+" of level "+h.level),N.hls.trigger(P.Events.FRAG_LOADED,Y),N.state===O.BACKTRACKING)){N.fragmentTracker.backtrack(h,Y),N.resetFragmentLoading(h);return}N._handleFragmentLoadComplete(Y)}).catch(function(Y){N.warn(Y),N.resetFragmentLoading(h)})},l.flushMainBuffer=function(h,g,T){if(T===void 0&&(T=null),!(h-g))return;var N={startOffset:h,endOffset:g,type:T};this.fragLoadError=0,this.hls.trigger(P.Events.BUFFER_FLUSHING,N)},l._loadInitSegment=function(h){var g=this;this._doFragLoad(h).then(function(T){if(!T||g.fragContextChanged(h)||!g.levels)throw new Error("init load aborted");return T}).then(function(T){var N=g.hls,V=T.payload,Y=h.decryptdata;if(V&&V.byteLength>0&&Y&&Y.key&&Y.iv&&Y.method==="AES-128"){var U=self.performance.now();return g.decrypter.webCryptoDecrypt(new Uint8Array(V),Y.key.buffer,Y.iv.buffer).then(function(A){var J=self.performance.now();return N.trigger(P.Events.FRAG_DECRYPTED,{frag:h,payload:A,stats:{tstart:U,tdecrypt:J}}),T.payload=A,T})}return T}).then(function(T){var N=g.fragCurrent,V=g.hls,Y=g.levels;if(!Y)throw new Error("init load aborted, missing levels");var U=Y[h.level].details;console.assert(U,"Level details are defined when init segment is loaded");var A=h.stats;g.state=O.IDLE,g.fragLoadError=0,h.data=new Uint8Array(T.payload),A.parsing.start=A.buffering.start=self.performance.now(),A.parsing.end=A.buffering.end=self.performance.now(),T.frag===N&&V.trigger(P.Events.FRAG_BUFFERED,{stats:A,frag:N,part:null,id:h.type}),g.tick()}).catch(function(T){g.warn(T),g.resetFragmentLoading(h)})},l.fragContextChanged=function(h){var g=this.fragCurrent;return!h||!g||h.level!==g.level||h.sn!==g.sn||h.urlId!==g.urlId},l.fragBufferedComplete=function(h,g){var T=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+h.type+" sn: "+h.sn+(g?" part: "+g.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level+" "+r.default.toString(K.BufferHelper.getBuffered(T))),this.state=O.IDLE,this.tick()},l._handleFragmentLoadComplete=function(h){var g=this.transmuxer;if(!g)return;var T=h.frag,N=h.part,V=h.partsLoaded,Y=!V||V.length===0||V.some(function(A){return!A}),U=new y.ChunkMetadata(T.level,T.sn,T.stats.chunkCount+1,0,N?N.index:-1,!Y);g.flush(U)},l._handleFragmentLoadProgress=function(h){},l._doFragLoad=function(h,g,T,N){var V=this;if(T===void 0&&(T=null),!this.levels)throw new Error("frag load aborted, missing levels");if(T=Math.max(h.start,T||0),this.config.lowLatencyMode&&g){var Y=g.partList;if(Y&&N){T>h.end&&g.fragmentHint&&(h=g.fragmentHint);var U=this.getNextPart(Y,h,T);if(U>-1){var A=Y[U];return this.log("Loading part sn: "+h.sn+" p: "+A.index+" cc: "+h.cc+" of playlist ["+g.startSN+"-"+g.endSN+"] parts [0-"+U+"-"+(Y.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(T.toFixed(3))),this.nextLoadPosition=A.start+A.duration,this.state=O.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:h,part:Y[U],targetBufferTime:T}),this.doFragPartsLoad(h,Y,U,N).catch(function(J){return V.handleFragLoadError(J)})}else if(!h.url||this.loadedEndOfParts(Y,T))return Promise.resolve(null)}}return this.log("Loading fragment "+h.sn+" cc: "+h.cc+" "+(g?"of ["+g.startSN+"-"+g.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(T.toFixed(3))),Object(X.isFiniteNumber)(h.sn)&&!this.bitrateTest&&(this.nextLoadPosition=h.start+h.duration),this.state=O.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:h,targetBufferTime:T}),this.fragmentLoader.load(h,N).catch(function(J){return V.handleFragLoadError(J)})},l.doFragPartsLoad=function(h,g,T,N){var V=this;return new Promise(function(Y,U){var A=[],J=function te(se){var fe=g[se];V.fragmentLoader.loadPart(h,fe,N).then(function(Ue){A[fe.index]=Ue;var Re=Ue.part;V.hls.trigger(P.Events.FRAG_LOADED,Ue);var De=g[se+1];if(De&&De.fragment===h)te(se+1);else return Y({frag:h,part:Re,partsLoaded:A})}).catch(U)};J(T)})},l.handleFragLoadError=function(h){var g=h.data;return g&&g.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(g.frag,g.part):this.hls.trigger(P.Events.ERROR,g),null},l._handleTransmuxerFlush=function(h){var g=this.getCurrentContext(h);if(!g||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var T=g.frag,N=g.part,V=g.level,Y=self.performance.now();T.stats.parsing.end=Y,N&&(N.stats.parsing.end=Y),this.updateLevelTiming(T,N,V,h.partial)},l.getCurrentContext=function(h){var g=this.levels,T=h.level,N=h.sn,V=h.part;if(!g||!g[T])return this.warn("Levels object was unset while buffering fragment "+N+" of level "+T+". The current chunk will not be buffered."),null;var Y=g[T],U=V>-1?Object(u.getPartWith)(Y,N,V):null,A=U?U.fragment:Object(u.getFragmentWithSN)(Y,N,this.fragCurrent);return A?{frag:A,part:U,level:Y}:null},l.bufferFragmentData=function(h,g,T,N){if(!h||this.state!==O.PARSING)return;var V=h.data1,Y=h.data2,U=V;if(V&&Y&&(U=Object(m.appendUint8Array)(V,Y)),!U||!U.length)return;var A={type:h.type,frag:g,part:T,chunkMeta:N,parent:g.type,data:U};this.hls.trigger(P.Events.BUFFER_APPENDING,A),h.dropped&&h.independent&&!T&&this.flushBufferGap(g)},l.flushBufferGap=function(h){var g=this.media;if(!g)return;if(!K.BufferHelper.isBuffered(g,g.currentTime)){this.flushMainBuffer(0,h.start);return}var T=g.currentTime,N=K.BufferHelper.bufferInfo(g,T,0),V=h.duration,Y=Math.min(this.config.maxFragLookUpTolerance*2,V*.25),U=Math.max(Math.min(h.start-Y,N.end-Y),T+Y);h.start-U>Y&&this.flushMainBuffer(U,h.start)},l.getFwdBufferInfo=function(h,g){var T=this.config,N=this.getLoadPosition();if(!Object(X.isFiniteNumber)(N))return null;var V=K.BufferHelper.bufferInfo(h,N,T.maxBufferHole);if(V.len===0&&V.nextStart!==void 0){var Y=this.fragmentTracker.getBufferedFrag(N,g);if(Y&&V.nextStart<Y.end)return K.BufferHelper.bufferInfo(h,N,Math.max(V.nextStart,T.maxBufferHole))}return V},l.getMaxBufferLength=function(h){var g=this.config,T;return h?T=Math.max(8*g.maxBufferSize/h,g.maxBufferLength):T=g.maxBufferLength,Math.min(T,g.maxMaxBufferLength)},l.reduceMaxBufferLength=function(h){var g=this.config,T=h||g.maxBufferLength;return g.maxMaxBufferLength>=T?(g.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+g.maxMaxBufferLength+"s"),!0):!1},l.getNextFragment=function(h,g){var T,N,V=g.fragments,Y=V.length;if(!Y)return null;var U=this.config,A=V[0].start,J;if(g.live){var te=U.initialLiveManifestSize;if(Y<te)return this.warn("Not enough fragments to start playback (have: "+Y+", need: "+te+")"),null;!g.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(J=this.getInitialLiveFragment(g,V),this.startPosition=J?this.hls.liveSyncPosition||J.start:h)}else h<=A&&(J=V[0]);if(!J){var se=U.lowLatencyMode?g.partEnd:g.fragmentEnd;J=this.getFragmentAtPosition(h,se,g)}return(T=J)!==null&&T!==void 0&&T.initSegment&&!((N=J)!==null&&N!==void 0&&N.initSegment.data)&&!this.bitrateTest&&(J=J.initSegment),J},l.getNextPart=function(h,g,T){for(var N=-1,V=!1,Y=!0,U=0,A=h.length;U<A;U++){var J=h[U];if(Y=Y&&!J.independent,N>-1&&T<J.start)break;var te=J.loaded;!te&&(V||J.independent||Y)&&J.fragment===g&&(N=U),V=te}return N},l.loadedEndOfParts=function(h,g){var T=h[h.length-1];return T&&g>T.start&&T.loaded},l.getInitialLiveFragment=function(h,g){var T=this.fragPrevious,N=null;if(T){if(h.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+T.programDateTime),N=Object(c.findFragmentByPDT)(g,T.endProgramDateTime,this.config.maxFragLookUpTolerance)),!N){var V=T.sn+1;if(V>=h.startSN&&V<=h.endSN){var Y=g[V-h.startSN];T.cc===Y.cc&&(N=Y,this.log("Live playlist, switching playlist, load frag with next SN: "+N.sn))}N||(N=Object(c.findFragWithCC)(g,T.cc),N&&this.log("Live playlist, switching playlist, load frag with same CC: "+N.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(N=this.getFragmentAtPosition(U,this.bitrateTest?h.fragmentEnd:h.edge,h))}return N},l.getFragmentAtPosition=function(h,g,T){var N=this.config,V=this.fragPrevious,Y=T.fragments,U=T.endSN,A=T.fragmentHint,J=N.maxFragLookUpTolerance,te=!!(N.lowLatencyMode&&T.partList&&A);te&&A&&!this.bitrateTest&&(Y=Y.concat(A),U=A.sn);var se;if(h<g){var fe=h>g-J?0:J;se=Object(c.findFragmentByPTS)(V,Y,h,fe)}else se=Y[Y.length-1];if(se){var Ue=se.sn-T.startSN,Re=V&&se.level===V.level,De=Y[Ue+1],Fe=this.fragmentTracker.getState(se);if(Fe===F.FragmentState.BACKTRACKED){se=null;for(var Me=Ue;Y[Me]&&this.fragmentTracker.getState(Y[Me])===F.FragmentState.BACKTRACKED;)V?se=Y[Me--]:se=Y[--Me];se||(se=De)}else V&&se.sn===V.sn&&!te&&(Re&&(se.sn<U&&this.fragmentTracker.getState(De)!==F.FragmentState.OK?(this.log("SN "+se.sn+" just loaded, load next one: "+De.sn),se=De):se=null))}return se},l.synchronizeToLiveEdge=function(h){var g=this.config,T=this.media;if(!T)return;var N=this.hls.liveSyncPosition,V=T.currentTime,Y=h.fragments[0].start,U=h.edge,A=V>=Y-g.maxFragLookUpTolerance&&V<=U;if(N!==null&&T.duration>N&&(V<N||!A)){var J=g.liveMaxLatencyDuration!==void 0?g.liveMaxLatencyDuration:g.liveMaxLatencyDurationCount*h.targetduration;(!A&&T.readyState<4||V<U-J)&&(this.loadedmetadata||(this.nextLoadPosition=N),T.readyState&&(this.warn("Playback: "+V.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+N.toFixed(3)),T.currentTime=N))}},l.alignPlaylists=function(h,g){var T=this.levels,N=this.levelLastLoaded,V=this.fragPrevious,Y=N!==null?T[N]:null,U=h.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var A=h.fragments[0].start,J=!g,te=h.alignedSliding&&Object(X.isFiniteNumber)(A);if(J||!te&&!A){Object(p.alignStream)(V,Y,h);var se=h.fragments[0].start;return this.log("Live playlist sliding: "+se.toFixed(2)+" start-sn: "+(g?g.startSN:"na")+"->"+h.startSN+" prev-sn: "+(V?V.sn:"na")+" fragments: "+U),se}return A},l.waitForCdnTuneIn=function(h){var g=3;return h.live&&h.canBlockReload&&h.tuneInGoal>Math.max(h.partHoldBack,h.partTarget*g)},l.setStartPosition=function(h,g){var T=this.startPosition;if(T<g&&(T=-1),T===-1||this.lastCurrentTime===-1){var N=h.startTimeOffset;Object(X.isFiniteNumber)(N)?(T=g+N,N<0&&(T+=h.totalduration),T=Math.min(Math.max(g,T),g+h.totalduration),this.log("Start time offset "+N+" found in playlist, adjust startPosition to "+T),this.startPosition=T):h.live?T=this.hls.liveSyncPosition||g:this.startPosition=T=0,this.lastCurrentTime=T}this.nextLoadPosition=T},l.getLoadPosition=function(){var h=this.media,g=0;return this.loadedmetadata&&h?g=h.currentTime:this.nextLoadPosition&&(g=this.nextLoadPosition),g},l.handleFragLoadAborted=function(h,g){this.transmuxer&&h.sn!=="initSegment"&&h.stats.aborted&&(this.warn("Fragment "+h.sn+(g?" part"+g.index:"")+" of level "+h.level+" was aborted"),this.resetFragmentLoading(h))},l.resetFragmentLoading=function(h){(!this.fragCurrent||!this.fragContextChanged(h))&&(this.state=O.IDLE)},l.onFragmentOrKeyLoadError=function(h,g){if(g.fatal)return;var T=g.frag;if(!T||T.type!==h)return;var N=this.fragCurrent;console.assert(N&&T.sn===N.sn&&T.level===N.level&&T.urlId===N.urlId,"Frag load error must match current frag to retry");var V=this.config;if(this.fragLoadError+1<=V.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(T.level))return;var Y=Math.min(Math.pow(2,this.fragLoadError)*V.fragLoadingRetryDelay,V.fragLoadingMaxRetryTimeout);this.warn("Fragment "+T.sn+" of "+h+" "+T.level+" failed to load, retrying in "+Y+"ms"),this.retryDate=self.performance.now()+Y,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else g.levelRetry?(h===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(H.logger.error(g.details+" reaches max retry, redispatch as fatal ..."),g.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},l.afterBufferFlushed=function(h,g,T){if(!h)return;var N=K.BufferHelper.getBuffered(h);this.fragmentTracker.detectEvictedFragments(g,N,T),this.state===O.ENDED&&this.resetLoadingState()},l.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},l.resetLiveStartWhenNotLoaded=function(h){if(!this.loadedmetadata){this.startFragRequested=!1;var g=this.levels?this.levels[h].details:null;if(g!=null&&g.live)return this.startPosition=-1,this.setStartPosition(g,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},l.updateLevelTiming=function(h,g,T,N){var V=this,Y=T.details;console.assert(!!Y,"level.details must be defined");var U=Object.keys(h.elementaryStreams).reduce(function(A,J){var te=h.elementaryStreams[J];if(te){var se=te.endPTS-te.startPTS;if(se<=0)return V.warn("Could not parse fragment "+h.sn+" "+J+" duration reliably ("+se+") resetting transmuxer to fallback to playlist timing"),V.resetTransmuxer(),A||!1;var fe=N?0:Object(u.updateFragPTSDTS)(Y,h,te.startPTS,te.endPTS,te.startDTS,te.endDTS);return V.hls.trigger(P.Events.LEVEL_PTS_UPDATED,{details:Y,level:T,drift:fe,type:J,frag:h,start:te.startPTS,end:te.endPTS}),!0}return A},!1);U?(this.state=O.PARSED,this.hls.trigger(P.Events.FRAG_PARSED,{frag:h,part:g})):this.resetLoadingState()},l.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},L(b,[{key:"state",get:function(){return this._state},set:function(h){var g=this._state;g!==h&&(this._state=h,this.log(g+"->"+h))}}]),b}(D.default)},"./src/controller/buffer-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return c});var X=M("./src/polyfills/number.ts"),D=M("./src/events.ts"),F=M("./src/utils/logger.ts"),K=M("./src/errors.ts"),H=M("./src/utils/buffer-helper.ts"),P=M("./src/utils/mediasource-helper.ts"),I=M("./src/loader/fragment.ts"),y=M("./src/controller/buffer-operation-queue.ts"),m=Object(P.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function u(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 a=r.hls,d=r.media,L=r.mediaSource;F.logger.log("[buffer-controller]: Media source opened"),d&&(r.updateMediaElementDuration(),a.trigger(D.Events.MEDIA_ATTACHED,{media:d})),L&&L.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){F.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){F.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var f=u.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var r=this.hls;r.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(D.Events.BUFFER_RESET,this.onBufferReset,this),r.on(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(D.Events.BUFFER_EOS,this.onBufferEos,this),r.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(D.Events.FRAG_PARSED,this.onFragParsed,this),r.on(D.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var r=this.hls;r.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(D.Events.BUFFER_RESET,this.onBufferReset,this),r.off(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(D.Events.BUFFER_EOS,this.onBufferEos,this),r.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(D.Events.FRAG_PARSED,this.onFragParsed,this),r.off(D.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(r,a){var d=2;(a.audio&&!a.video||!a.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,F.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(r,a){var d=this.media=a.media;if(d&&m){var L=this.mediaSource=new m;L.addEventListener("sourceopen",this._onMediaSourceOpen),L.addEventListener("sourceended",this._onMediaSourceEnded),L.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(L),this._objectUrl=d.src}},f.onMediaDetaching=function(){var r=this.media,a=this.mediaSource,d=this._objectUrl;if(a){if(F.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(L){F.logger.warn("[buffer-controller]: onMediaDetaching: "+L.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(d&&self.URL.revokeObjectURL(d),r.src===d?(r.removeAttribute("src"),r.load()):F.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(D.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(a){var d=r.sourceBuffer[a];try{d&&(r.removeBufferListeners(a),r.mediaSource&&r.mediaSource.removeSourceBuffer(d),r.sourceBuffer[a]=void 0)}catch(L){F.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",L)}}),this._initSourceBuffer()},f.onBufferCodecs=function(r,a){var d=this,L=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(C){if(L){var x=d.tracks[C];if(x&&typeof x.buffer.changeType=="function"){var R=a[C],O=R.codec,w=R.levelCodec,E=R.container,b=(x.levelCodec||x.codec).replace(p,"$1"),l=(w||O).replace(p,"$1");if(b!==l){var _=E+";codecs="+(w||O);d.appendChangeType(C,_)}}}else d.pendingTracks[C]=a[C]}),L)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(r,a){var d=this,L=this.operationQueue,C={execute:function(){var R=d.sourceBuffer[r];R&&(F.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+a),R.changeType(a)),L.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(R){F.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",R)}};L.append(C,r)},f.onBufferAppending=function(r,a){var d=this,L=this.hls,C=this.operationQueue,x=this.tracks,R=a.data,O=a.type,w=a.frag,E=a.part,b=a.chunkMeta,l=b.buffering[O],_=self.performance.now();l.start=_;var h=w.stats.buffering,g=E?E.stats.buffering:null;h.start===0&&(h.start=_),g&&g.start===0&&(g.start=_);var T=x.audio,N=O==="audio"&&b.id===1&&(T==null?void 0:T.container)==="audio/mpeg",V={execute:function(){if(l.executeStart=self.performance.now(),N){var U=d.sourceBuffer[O];if(U){var A=w.start-U.timestampOffset;Math.abs(A)>=.1&&(F.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+w.start+" (delta: "+A+") sn: "+w.sn+")"),U.timestampOffset=w.start)}}d.appendExecutor(R,O)},onStart:function(){},onComplete:function(){var U=self.performance.now();l.executeEnd=l.end=U,h.first===0&&(h.first=U),g&&g.first===0&&(g.first=U);var A=d.sourceBuffer,J={};for(var te in A)J[te]=H.BufferHelper.getBuffered(A[te]);d.appendError=0,d.hls.trigger(D.Events.BUFFER_APPENDED,{type:O,frag:w,part:E,chunkMeta:b,parent:w.type,timeRanges:J})},onError:function(U){F.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",U);var A={type:K.ErrorTypes.MEDIA_ERROR,parent:w.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?A.details=K.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,A.details=K.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>L.config.appendErrorMaxRetry&&(F.logger.error("[buffer-controller]: Failed "+L.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),A.fatal=!0)),L.trigger(D.Events.ERROR,A)}};C.append(V,O)},f.onBufferFlushing=function(r,a){var d=this,L=this.operationQueue,C=function(R){return{execute:d.removeExecutor.bind(d,R,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(D.Events.BUFFER_FLUSHED,{type:R})},onError:function(w){F.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",w)}}};a.type?L.append(C(a.type),a.type):this.getSourceBufferTypes().forEach(function(x){L.append(C(x),x)})},f.onFragParsed=function(r,a){var d=this,L=a.frag,C=a.part,x=[],R=C?C.elementaryStreams:L.elementaryStreams;R[I.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(R[I.ElementaryStreamTypes.AUDIO]&&x.push("audio"),R[I.ElementaryStreamTypes.VIDEO]&&x.push("video"));var O=function(){var E=self.performance.now();L.stats.buffering.end=E,C&&(C.stats.buffering.end=E);var b=C?C.stats:L.stats;d.hls.trigger(D.Events.FRAG_BUFFERED,{frag:L,part:C,stats:b,id:L.type})};x.length===0&&F.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+L.type+" level: "+L.level+" sn: "+L.sn),this.blockBuffers(O,x)},f.onFragChanged=function(r,a){this.flushBackBuffer()},f.onBufferEos=function(r,a){var d=this,L=this.getSourceBufferTypes().reduce(function(C,x){var R=d.sourceBuffer[x];return(!a.type||a.type===x)&&(R&&!R.ended&&(R.ended=!0,F.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),C&&!!(!R||R.ended)},!0);L&&this.blockBuffers(function(){var C=d.mediaSource;if(!C||C.readyState!=="open")return;C.endOfStream()})},f.onLevelUpdated=function(r,a){var d=a.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var r=this.hls,a=this.details,d=this.media,L=this.sourceBuffer;if(!d||a===null)return;var C=this.getSourceBufferTypes();if(!C.length)return;var x=a.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(X.isFiniteNumber)(x)||x<0)return;var R=d.currentTime,O=a.levelTargetDuration,w=Math.max(x,O),E=Math.floor(R/O)*O-w;C.forEach(function(b){var l=L[b];if(l){var _=H.BufferHelper.getBuffered(l);_.length>0&&E>_.start(0)&&(r.trigger(D.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),a.live&&r.trigger(D.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),r.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:b}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,a=this.hls,d=this.media,L=this.mediaSource,C=r.fragments[0].start+r.totalduration,x=d.duration,R=Object(X.isFiniteNumber)(L.duration)?L.duration:0;r.live&&a.config.liveDurationInfinity?(F.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),L.duration=Infinity,this.updateSeekableRange(r)):(C>R&&C>x||!Object(X.isFiniteNumber)(x))&&(F.logger.log("[buffer-controller]: Updating Media Source duration to "+C.toFixed(3)),L.duration=C)},f.updateSeekableRange=function(r){var a=this.mediaSource,d=r.fragments,L=d.length;if(L&&r.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var C=Math.max(0,d[0].start),x=Math.max(C,C+r.totalduration);a.setLiveSeekableRange(C,x)}},f.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,a=this.operationQueue,d=this.pendingTracks,L=Object.keys(d).length;if(L&&!r||L===2){this.createSourceBuffers(d),this.pendingTracks={};var C=this.getSourceBufferTypes();if(C.length===0){this.hls.trigger(D.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}C.forEach(function(x){a.executeNext(x)})}},f.createSourceBuffers=function(r){var a=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var L=0;for(var C in r)if(!a[C]){var x=r[C];if(!x)throw Error("source buffer exists for track "+C+", however track does not");var R=x.levelCodec||x.codec,O=x.container+";codecs="+R;F.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var w=a[C]=d.addSourceBuffer(O),E=C;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[C]={buffer:w,codec:R,container:x.container,levelCodec:x.levelCodec,id:x.id},L++}catch(b){F.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+b.message),this.hls.trigger(D.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:b,mimeType:O})}}L&&this.hls.trigger(D.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(r){var a=this.operationQueue,d=a.current(r);d.onStart()},f._onSBUpdateEnd=function(r){var a=this.operationQueue,d=a.current(r);d.onComplete(),a.shiftAndExecuteNext(r)},f._onSBUpdateError=function(r,a){F.logger.error("[buffer-controller]: "+r+" SourceBuffer error",a),this.hls.trigger(D.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(r);d&&d.onError(a)},f.removeExecutor=function(r,a,d){var L=this.media,C=this.mediaSource,x=this.operationQueue,R=this.sourceBuffer,O=R[r];if(!L||!C||!O){F.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(r);return}var w=Object(X.isFiniteNumber)(L.duration)?L.duration:Infinity,E=Object(X.isFiniteNumber)(C.duration)?C.duration:Infinity,b=Math.max(0,a),l=Math.min(d,w,E);l>b?(F.logger.log("[buffer-controller]: Removing ["+b+","+l+"] from the "+r+" SourceBuffer"),console.assert(!O.updating,r+" sourceBuffer must not be updating"),O.remove(b,l)):x.shiftAndExecuteNext(r)},f.appendExecutor=function(r,a){var d=this.operationQueue,L=this.sourceBuffer,C=L[a];if(!C){F.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(a);return}C.ended=!1,console.assert(!C.updating,a+" sourceBuffer must not be updating"),C.appendBuffer(r)},f.blockBuffers=function(r,a){var d=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){F.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var L=this.operationQueue,C=a.map(function(x){return L.appendBlocker(x)});Promise.all(C).then(function(){r(),a.forEach(function(x){var R=d.sourceBuffer[x];(!R||!R.updating)&&L.shiftAndExecuteNext(x)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(r,a,d){var L=this.sourceBuffer[r];if(!L)return;var C=d.bind(this,r);this.listeners[r].push({event:a,listener:C}),L.addEventListener(a,C)},f.removeBufferListeners=function(r){var a=this.sourceBuffer[r];if(!a)return;this.listeners[r].forEach(function(d){a.removeEventListener(d.event,d.listener)})},u}()},"./src/controller/buffer-operation-queue.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return D});var X=M("./src/utils/logger.ts"),D=function(){function F(H){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=H}var K=F.prototype;return K.append=function(P,I){var y=this.queues[I];y.push(P),y.length===1&&this.buffers[I]&&this.executeNext(I)},K.insertAbort=function(P,I){var y=this.queues[I];y.unshift(P),this.executeNext(I)},K.appendBlocker=function(P){var I,y=new Promise(function(p){I=p}),m={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,P),y},K.executeNext=function(P){var I=this.buffers,y=this.queues,m=I[P],p=y[P];if(p.length){var c=p[0];try{c.execute()}catch(u){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(u),(!m||!m.updating)&&(p.shift(),this.executeNext(P))}}},K.shiftAndExecuteNext=function(P){this.queues[P].shift(),this.executeNext(P)},K.current=function(P){return this.queues[P][0]},F}()},"./src/controller/cap-level-controller.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/events.ts");function D(H,P){for(var I=0;I<P.length;I++){var y=P[I];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(H,y.key,y)}}function F(H,P,I){return P&&D(H.prototype,P),I&&D(H,I),H}var K=function(){function H(I){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=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var P=H.prototype;return P.setStreamController=function(y){this.streamController=y},P.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},P.registerListeners=function(){var y=this.hls;y.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.unregisterListener=function(){var y=this.hls;y.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.onFpsDropLevelCapping=function(y,m){H.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},P.onMediaAttaching=function(y,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},P.onManifestParsed=function(y,m){var p=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},P.onBufferCodecs=function(y,m){var p=this.hls;p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},P.onMediaDetaching=function(){this.stopCapping()},P.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(y.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},P.getMaxLevel=function(y){var m=this,p=this.hls.levels;if(!p.length)return-1;var c=p.filter(function(u,f){return H.isLevelAllowed(f,m.restrictedLevels)&&f<=y});return this.clientRect=null,H.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},P.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()},P.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},P.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,m={width:0,height:0};if(y){var p=y.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||y.width||0,m.height=p.bottom-p.top||y.height||0)}return this.clientRect=m,m},H.isLevelAllowed=function(y,m){return m===void 0&&(m=[]),m.indexOf(y)===-1},H.getMaxLevelByMediaSize=function(y,m,p){if(!y||!y.length)return-1;for(var c=function(a,d){return d?a.width!==d.width||a.height!==d.height:!0},u=y.length-1,f=0;f<y.length;f+=1){var s=y[f];if((s.width>=m||s.height>=p)&&c(s,y[f+1])){u=f;break}}return u},F(H,[{key:"mediaWidth",get:function(){return this.getDimensions().width*H.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*H.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(m){}return y}}]),H}();j.default=K},"./src/controller/cmcd-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return c});var X=M("./src/events.ts"),D=M("./src/types/cmcd.ts"),F=M("./src/utils/buffer-helper.ts"),K=M("./src/utils/logger.ts");function H(u,f){for(var s=0;s<f.length;s++){var r=f[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(u,r.key,r)}}function P(u,f,s){return f&&H(u.prototype,f),s&&H(u,s),u}function I(u,f){var s=typeof Symbol!="undefined"&&u[Symbol.iterator]||u["@@iterator"];if(s)return(s=s.call(u)).next.bind(s);if(Array.isArray(u)||(s=y(u))||f&&u&&typeof u.length=="number"){s&&(u=s);var r=0;return function(){return r>=u.length?{done:!0}:{done:!1,value:u[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 y(u,f){if(!u)return;if(typeof u=="string")return m(u,f);var s=Object.prototype.toString.call(u).slice(8,-1);if(s==="Object"&&u.constructor&&(s=u.constructor.name),s==="Map"||s==="Set")return Array.from(u);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return m(u,f)}function m(u,f){(f==null||f>u.length)&&(f=u.length);for(var s=0,r=new Array(f);s<f;s++)r[s]=u[s];return r}function p(){return p=Object.assign||function(u){for(var f=1;f<arguments.length;f++){var s=arguments[f];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(u[r]=s[r])}return u},p.apply(this,arguments)}var c=function(){function u(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(L){try{r.apply(L,{ot:D.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(C){K.logger.warn("Could not generate manifest CMCD data.",C)}},this.applyFragmentData=function(L){try{var C=L.frag,x=r.hls.levels[C.level],R=r.getObjectType(C),O={d:C.duration*1e3,ot:R};(R===D.CMCDObjectType.VIDEO||R===D.CMCDObjectType.AUDIO||R==D.CMCDObjectType.MUXED)&&(O.br=x.bitrate/1e3,O.tb=r.getTopBandwidth(R),O.bl=r.getBufferLength(R)),r.apply(L,O)}catch(w){K.logger.warn("Could not generate segment CMCD data.",w)}},this.hls=s;var a=this.config=s.config,d=a.cmcd;d!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||u.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var f=u.prototype;return f.registerListeners=function(){var r=this.hls;r.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var r=this.hls;r.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(r,a){this.media=a.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(r,a){var d,L;this.audioBuffer=(d=a.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(L=a.tracks.video)===null||L===void 0?void 0:L.buffer},f.createData=function(){var r;return{v:D.CMCDVersion,sf:D.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}},f.apply=function(r,a){a===void 0&&(a={}),p(a,this.createData());var d=a.ot===D.CMCDObjectType.INIT||a.ot===D.CMCDObjectType.VIDEO||a.ot===D.CMCDObjectType.MUXED;if(this.starved&&d&&(a.bs=!0,a.su=!0,this.starved=!1),a.su==null&&(a.su=this.buffering),this.useHeaders){var L=u.toHeaders(a);if(!Object.keys(L).length)return;r.headers||(r.headers={}),p(r.headers,L)}else{var C=u.toQuery(a);if(!C)return;r.url=u.appendQueryToUri(r.url,C)}},f.getObjectType=function(r){var a=r.type;return a==="subtitle"?D.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?D.CMCDObjectType.INIT:a==="audio"?D.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?D.CMCDObjectType.VIDEO:D.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(r){for(var a=0,d=r===D.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,L=I(d),C;!(C=L()).done;){var x=C.value;x.bitrate>a&&(a=x.bitrate)}return a>0?a:NaN},f.getBufferLength=function(r){var a=this.hls.media,d=r===D.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!a)return NaN;var L=F.BufferHelper.bufferInfo(d,a.currentTime,this.config.maxBufferHole);return L.len*1e3},f.createPlaylistLoader=function(){var r=this.config.pLoader,a=this.applyPlaylistData,d=r||this.config.loader;return function(){function L(x){this.loader=void 0,this.loader=new d(x)}var C=L.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(R,O,w){a(R),this.loader.load(R,O,w)},P(L,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),L}()},f.createFragmentLoader=function(){var r=this.config.fLoader,a=this.applyFragmentData,d=r||this.config.loader;return function(){function L(x){this.loader=void 0,this.loader=new d(x)}var C=L.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(R,O,w){a(R),this.loader.load(R,O,w)},P(L,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),L}()},u.uuid=function(){var r=URL.createObjectURL(new Blob),a=r.toString();return URL.revokeObjectURL(r),a.substr(a.lastIndexOf("/")+1)},u.serialize=function(r){for(var a=[],d=function(N){return!Number.isNaN(N)&&N!=null&&N!==""&&N!==!1},L=function(N){return Math.round(N)},C=function(N){return L(N/100)*100},x=function(N){return encodeURIComponent(N)},R={br:L,d:L,bl:C,dl:C,mtp:C,nor:x,rtp:C,tb:L},O=Object.keys(r||{}).sort(),w=I(O),E;!(E=w()).done;){var b=E.value,l=r[b];if(!d(l))continue;if(b==="v"&&l===1)continue;if(b=="pr"&&l===1)continue;var _=R[b];_&&(l=_(l));var h=typeof l,g=void 0;b==="ot"||b==="sf"||b==="st"?g=b+"="+l:h==="boolean"?g=b:h==="number"?g=b+"="+l:g=b+"="+JSON.stringify(l),a.push(g)}return a.join(",")},u.toHeaders=function(r){for(var a=Object.keys(r),d={},L=["Object","Request","Session","Status"],C=[{},{},{},{}],x={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},R=0,O=a;R<O.length;R++){var w=O[R],E=x[w]!=null?x[w]:1;C[E][w]=r[w]}for(var b=0;b<C.length;b++){var l=u.serialize(C[b]);l&&(d["CMCD-"+L[b]]=l)}return d},u.toQuery=function(r){return"CMCD="+encodeURIComponent(u.serialize(r))},u.appendQueryToUri=function(r,a){if(!a)return r;var d=r.includes("?")?"&":"?";return""+r+d+a},u}()},"./src/controller/eme-controller.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/events.ts"),D=M("./src/errors.ts"),F=M("./src/utils/logger.ts"),K=M("./src/utils/mediakeys-helper.ts");function H(c,u){for(var f=0;f<u.length;f++){var s=u[f];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function P(c,u,f){return u&&H(c.prototype,u),f&&H(c,f),c}var I=3,y=function(u,f,s){var r={audioCapabilities:[],videoCapabilities:[]};return u.forEach(function(a){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:s.audioRobustness||""})}),f.forEach(function(a){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:s.videoRobustness||""})}),[r]},m=function(u,f,s,r){switch(u){case K.KeySystems.WIDEVINE:return y(f,s,r);default:throw new Error("Unknown key-system: "+u)}},p=function(){function c(f){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=f,this._config=f.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var u=c.prototype;return u.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},u._registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},u._unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},u.getLicenseServerUrl=function(s){switch(s){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},u._attemptKeySystemAccess=function(s,r,a){var d=this,L=m(s,r,a,this._drmSystemOptions);F.logger.log("Requesting encrypted media key-system access");var C=this.requestMediaKeySystemAccess(s,L);this.mediaKeysPromise=C.then(function(x){return d._onMediaKeySystemAccessObtained(s,x)}),C.catch(function(x){F.logger.error('Failed to obtain key-system "'+s+'" access:',x)})},u._onMediaKeySystemAccessObtained=function(s,r){var a=this;F.logger.log('Access for key-system "'+s+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:s};this._mediaKeysList.push(d);var L=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(C){return d.mediaKeys=C,F.logger.log('Media-keys created for key-system "'+s+'"'),a._onMediaKeysCreated(),C});return L.catch(function(C){F.logger.error("Failed to create media-keys:",C)}),L},u._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),s._onNewMediaKeySession(r.mediaKeysSession))})},u._onNewMediaKeySession=function(s){var r=this;F.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(a){r._onKeySessionMessage(s,a.message)},!1)},u._onKeySessionMessage=function(s,r){F.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(a){F.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),s.update(a)})},u.onMediaEncrypted=function(s){var r=this;if(F.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){F.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var a=function(L){if(!r._media)return;r._attemptSetMediaKeys(L),r._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(a).catch(a)},u._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){F.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}F.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},u._generateRequestWithPreferredKeySession=function(s,r){var a=this,d=this._mediaKeysList[0];if(!d){F.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){F.logger.warn("Key-Session already initialized but requested again");return}var L=d.mediaKeysSession;if(!L){F.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){F.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}F.logger.log('Generating key-session request for "'+s+'" init data type'),d.mediaKeysSessionInitialized=!0,L.generateRequest(s,r).then(function(){F.logger.debug("Key-session generation succeeded")}).catch(function(C){F.logger.error("Error generating key-session request:",C),a.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},u._createLicenseXhr=function(s,r,a){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,s,r,a);var L=this._licenseXhrSetup;if(L)try{L.call(this.hls,d,s),L=void 0}catch(C){F.logger.error(C)}try{d.readyState||d.open("POST",s,!0),L&&L.call(this.hls,d,s)}catch(C){throw new Error("issue setting up KeySystem license XHR "+C)}return d},u._onLicenseRequestReadyStageChange=function(s,r,a,d){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,F.logger.log("License request succeeded");var L=s.response,C=this._licenseResponseCallback;if(C)try{L=C.call(this.hls,s,r)}catch(R){F.logger.error(R)}d(L)}else{if(F.logger.error("License Request XHR failed ("+r+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=I-this._requestLicenseFailureCount+1;F.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(a,d)}break}},u._generateLicenseRequestChallenge=function(s,r){switch(s.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},u._requestLicense=function(s,r){F.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){F.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(a.mediaKeySystemDomain),L=this._createLicenseXhr(d,s,r);F.logger.log("Sending license request to URL: "+d);var C=this._generateLicenseRequestChallenge(a,s);L.send(C)}catch(x){F.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},u.onMediaAttached=function(s,r){if(!this._emeEnabled)return;var a=r.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},u.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(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},u.onManifestParsed=function(s,r){if(!this._emeEnabled)return;var a=r.levels.map(function(L){return L.audioCodec}).filter(function(L){return!!L}),d=r.levels.map(function(L){return L.videoCodec}).filter(function(L){return!!L});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,a,d)},P(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();j.default=p},"./src/controller/fps-controller.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/events.ts"),D=M("./src/utils/logger.ts"),F=function(){function K(P){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=P,this.registerListeners()}var H=K.prototype;return H.setStreamController=function(I){this.streamController=I},H.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},H.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},H.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},H.onMediaAttaching=function(I,y){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},H.checkFPS=function(I,y,m){var p=performance.now();if(y){if(this.lastTime){var c=p-this.lastTime,u=m-this.lastDroppedFrames,f=y-this.lastDecodedFrames,s=1e3*u/c,r=this.hls;if(r.trigger(X.Events.FPS_DROP,{currentDropped:u,currentDecoded:f,totalDroppedFrames:m}),s>0&&u>r.config.fpsDroppedMonitoringThreshold*f){var a=r.currentLevel;D.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=a)&&(a=a-1,r.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:r.currentLevel}),r.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=y}},H.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var y=I.getVideoPlaybackQuality();this.checkFPS(I,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},K}();j.default=F},"./src/controller/fragment-finders.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"findFragmentByPDT",function(){return F}),M.d(j,"findFragmentByPTS",function(){return K}),M.d(j,"fragmentWithinToleranceTest",function(){return H}),M.d(j,"pdtWithinToleranceTest",function(){return P}),M.d(j,"findFragWithCC",function(){return I});var X=M("./src/polyfills/number.ts"),D=M("./src/utils/binary-search.ts");function F(y,m,p){if(m===null||!Array.isArray(y)||!y.length||!Object(X.isFiniteNumber)(m))return null;var c=y[0].programDateTime;if(m<(c||0))return null;var u=y[y.length-1].endProgramDateTime;if(m>=(u||0))return null;p=p||0;for(var f=0;f<y.length;++f){var s=y[f];if(P(m,p,s))return s}return null}function K(y,m,p,c){p===void 0&&(p=0),c===void 0&&(c=0);var u=null;if(y?u=m[y.sn-m[0].sn+1]||null:p===0&&m[0].start===0&&(u=m[0]),u&&H(p,c,u)===0)return u;var f=D.default.search(m,H.bind(null,p,c));return f||u}function H(y,m,p){y===void 0&&(y=0),m===void 0&&(m=0);var c=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-c<=y?1:p.start-c>y&&p.start?-1:0}function P(y,m,p){var c=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,u=p.endProgramDateTime||0;return u-c>y}function I(y,m){return D.default.search(y,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"FragmentState",function(){return F}),M.d(j,"FragmentTracker",function(){return K});var X=M("./src/events.ts"),D=M("./src/types/loader.ts"),F;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(F||(F={}));var K=function(){function I(m){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=m,this._registerListeners()}var y=I.prototype;return y._registerListeners=function(){var p=this.hls;p.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var p=this.hls;p.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(p,c){if(c===D.PlaylistLevelType.MAIN){var u=this.activeFragment,f=this.activeParts;if(!u)return null;if(f)for(var s=f.length;s--;){var r=f[s],a=r?r.end:u.appendedPTS;if(r.start<=p&&a!==void 0&&p<=a)return s>9&&(this.activeParts=f.slice(s-9)),r}else if(u.start<=p&&u.appendedPTS!==void 0&&p<=u.appendedPTS)return u}return this.getBufferedFrag(p,c)},y.getBufferedFrag=function(p,c){for(var u=this.fragments,f=Object.keys(u),s=f.length;s--;){var r=u[f[s]];if((r==null?void 0:r.body.type)===c&&r.buffered){var a=r.body;if(a.start<=p&&p<=a.end)return a}}return null},y.detectEvictedFragments=function(p,c,u){var f=this;Object.keys(this.fragments).forEach(function(s){var r=f.fragments[s];if(!r)return;if(!r.buffered){r.body.type===u&&f.removeFragment(r.body);return}var a=r.range[p];if(!a)return;a.time.some(function(d){var L=!f.isTimeBuffered(d.startPTS,d.endPTS,c);return L&&f.removeFragment(r.body),L})})},y.detectPartialFragments=function(p){var c=this,u=this.timeRanges,f=p.frag,s=p.part;if(!u||f.sn==="initSegment")return;var r=P(f),a=this.fragments[r];if(!a)return;Object.keys(u).forEach(function(d){var L=f.elementaryStreams[d];if(!L)return;var C=u[d],x=s!==null||L.partial===!0;a.range[d]=c.getBufferedTimes(f,s,x,C)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},y.fragBuffered=function(p){var c=P(p),u=this.fragments[c];u&&(u.backtrack=u.loaded=null,u.buffered=!0)},y.getBufferedTimes=function(p,c,u,f){for(var s={time:[],partial:u},r=c?c.start:p.start,a=c?c.end:p.end,d=p.minEndPTS||a,L=p.maxStartPTS||r,C=0;C<f.length;C++){var x=f.start(C)-this.bufferPadding,R=f.end(C)+this.bufferPadding;if(L>=x&&d<=R){s.time.push({startPTS:Math.max(r,f.start(C)),endPTS:Math.min(a,f.end(C))});break}else if(r<R&&a>x)s.partial=!0,s.time.push({startPTS:Math.max(r,f.start(C)),endPTS:Math.min(a,f.end(C))});else if(a<=x)break}return s},y.getPartialFragment=function(p){var c=null,u,f,s,r=0,a=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(L){var C=d[L];if(!C)return;H(C)&&(f=C.body.start-a,s=C.body.end+a,p>=f&&p<=s&&(u=Math.min(p-f,s-p),r<=u&&(c=C.body,r=u)))}),c},y.getState=function(p){var c=P(p),u=this.fragments[c];return u?u.buffered?H(u)?F.PARTIAL:F.OK:u.backtrack?F.BACKTRACKED:F.APPENDING:F.NOT_LOADED},y.backtrack=function(p,c){var u=P(p),f=this.fragments[u];if(!f||f.backtrack)return null;var s=f.backtrack=c||f.loaded;return f.loaded=null,s},y.getBacktrackData=function(p){var c=P(p),u=this.fragments[c];if(u){var f,s=u.backtrack;if(s!=null&&(f=s.payload)!==null&&f!==void 0&&f.byteLength)return s;this.removeFragment(p)}return null},y.isTimeBuffered=function(p,c,u){for(var f,s,r=0;r<u.length;r++){if(f=u.start(r)-this.bufferPadding,s=u.end(r)+this.bufferPadding,p>=f&&c<=s)return!0;if(c<=f)return!1}return!1},y.onFragLoaded=function(p,c){var u=c.frag,f=c.part;if(u.sn==="initSegment"||u.bitrateTest||f)return;var s=P(u);this.fragments[s]={body:u,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(p,c){var u=this,f=c.frag,s=c.part,r=c.timeRanges;if(f.type===D.PlaylistLevelType.MAIN)if(this.activeFragment=f,s){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(s)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(d){var L=r[d];if(u.detectEvictedFragments(d,L),!s)for(var C=0;C<L.length;C++)f.appendedPTS=Math.max(L.end(C),f.appendedPTS||0)})},y.onFragBuffered=function(p,c){this.detectPartialFragments(c)},y.hasFragment=function(p){var c=P(p);return!!this.fragments[c]},y.removeFragmentsInRange=function(p,c,u){var f=this;Object.keys(this.fragments).forEach(function(s){var r=f.fragments[s];if(!r)return;if(r.buffered){var a=r.body;a.type===u&&a.start<c&&a.end>p&&f.removeFragment(a)}})},y.removeFragment=function(p){var c=P(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[c]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function H(I){var y,m;return I.buffered&&(((y=I.range.video)===null||y===void 0?void 0:y.partial)||((m=I.range.audio)===null||m===void 0?void 0:m.partial))}function P(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"STALL_MINIMUM_DURATION_MS",function(){return H}),M.d(j,"MAX_START_GAP_JUMP",function(){return P}),M.d(j,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),M.d(j,"SKIP_BUFFER_RANGE_START",function(){return y}),M.d(j,"default",function(){return m});var X=M("./src/utils/buffer-helper.ts"),D=M("./src/errors.ts"),F=M("./src/events.ts"),K=M("./src/utils/logger.ts"),H=250,P=2,I=.1,y=.05,m=function(){function p(u,f,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=u,this.media=f,this.fragmentTracker=s,this.hls=r}var c=p.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(f){var s=this.config,r=this.media,a=this.stalled,d=r.currentTime,L=r.seeking,C=this.seeking&&!L,x=!this.seeking&&L;if(this.seeking=L,d!==f){if(this.moved=!0,a!==null){if(this.stallReported){var R=self.performance.now()-a;K.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||C)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!X.BufferHelper.getBuffered(r).length)return;var O=X.BufferHelper.bufferInfo(r,d,0),w=O.len>0,E=O.nextStart||0;if(!w&&!E)return;if(L){var b=O.len>P,l=!E||E-d>P&&!this.fragmentTracker.getPartialFragment(d);if(b||l)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,h=Math.max(E,O.start||0)-d,g=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,T=g==null||((_=g.details)===null||_===void 0)?void 0:_.live,N=T?g.details.targetduration*2:P;if(h>0&&h<=N){this._trySkipBufferHole(null);return}}var V=self.performance.now();if(a===null){this.stalled=V;return}var Y=V-a;!L&&Y>=H&&this._reportStall(O.len);var U=X.BufferHelper.bufferInfo(r,d,s.maxBufferHole);this._tryFixBufferStall(U,Y)},c._tryFixBufferStall=function(f,s){var r=this.config,a=this.fragmentTracker,d=this.media,L=d.currentTime,C=a.getPartialFragment(L);if(C){var x=this._trySkipBufferHole(C);if(x)return}f.len>r.maxBufferHole&&s>r.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(f){var s=this.hls,r=this.media,a=this.stallReported;a||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+f+")"),s.trigger(F.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},c._trySkipBufferHole=function(f){for(var s=this.config,r=this.hls,a=this.media,d=a.currentTime,L=0,C=X.BufferHelper.getBuffered(a),x=0;x<C.length;x++){var R=C.start(x);if(d+s.maxBufferHole>=L&&d<R){var O=Math.max(R+y,a.currentTime+I);return K.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+O),this.moved=!0,this.stalled=null,a.currentTime=O,f&&r.trigger(F.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+O,frag:f}),O}L=C.end(x)}return 0},c._tryNudgeBuffer=function(){var f=this.config,s=this.hls,r=this.media,a=r.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<f.nudgeMaxRetry){var L=a+d*f.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+a+" to "+L),r.currentTime=L,s.trigger(F.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+a+" after "+f.nudgeMaxRetry+" nudges"),s.trigger(F.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/events.ts"),D=M("./src/utils/texttrack-utils.ts"),F=M("./src/demux/id3.ts"),K=.25,H=function(){function P(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var I=P.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var m=this.hls;m.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var m=this.hls;m.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(m,p){this.media=p.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(D.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(m){if(!this.media)return;for(var p=0;p<m.length;p++){var c=m[p];if(c.kind==="metadata"&&c.label==="id3")return Object(D.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(m,p){if(!this.media)return;var c=p.frag,u=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<u.length;s++){var r=F.getID3Frames(u[s].data);if(r){var a=u[s].pts,d=s<u.length-1?u[s+1].pts:c.end,L=d-a;L<=0&&(d=a+K);for(var C=0;C<r.length;C++){var x=r[C];if(!F.isTimeStampFrame(x)){var R=new f(a,d,"");R.value=x,this.id3Track.addCue(R)}}}}},I.onBufferFlushing=function(m,p){var c=p.startOffset,u=p.endOffset,f=p.type;if(!f||f==="audio"){var s=this.id3Track;s&&Object(D.removeCuesInRange)(s,c,u)}},P}();j.default=H},"./src/controller/latency-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return P});var X=M("./src/errors.ts"),D=M("./src/events.ts"),F=M("./src/utils/logger.ts");function K(I,y){for(var m=0;m<y.length;m++){var p=y[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(I,p.key,p)}}function H(I,y,m){return y&&K(I.prototype,y),m&&K(I,m),I}var P=function(){function I(m){var p=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 p.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var y=I.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.registerListeners=function(){this.hls.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(D.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(D.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(D.Events.ERROR,this.onError)},y.onMediaAttached=function(p,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(p,c){var u=c.details;this.levelDetails=u,u.advanced&&this.timeupdate(),!u.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(p,c){if(c.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,F.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var p=this.media,c=this.levelDetails;if(!p||!c)return;this.currentTime=p.currentTime;var u=this.computeLatency();if(u===null)return;this._latency=u;var f=this.config,s=f.lowLatencyMode,r=f.maxLiveSyncPlaybackRate;if(!s||r===1)return;var a=this.targetLatency;if(a===null)return;var d=u-a,L=Math.min(this.maxLatency,a+c.targetduration),C=d<L;if(c.live&&C&&d>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,r)),R=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;p.playbackRate=Math.min(x,Math.max(1,R))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},y.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},y.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},H(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,c=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:c?p.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var c=p.holdBack,u=p.partHoldBack,f=p.targetduration,s=this.config,r=s.liveSyncDuration,a=s.liveSyncDurationCount,d=s.lowLatencyMode,L=this.hls.userConfig,C=d&&u||c;(L.liveSyncDuration||L.liveSyncDurationCount||C===0)&&(C=r!==void 0?r:a*f);var x=f,R=1;return C+Math.min(this.stallCount*R,x)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),c=this.targetLatency,u=this.levelDetails;if(p===null||c===null||u===null)return null;var f=u.edge,s=p-c-this.edgeStalled,r=f-u.totalduration,a=f-(this.config.lowLatencyMode&&u.partTarget||u.targetduration);return Math.min(Math.max(r,s),a)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var c=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-c,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,c=this.levelDetails;if(!p||!c)return 0;var u=p.buffered.length;return u?p.buffered.end(u-1):c.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return s});var X=M("./src/types/level.ts"),D=M("./src/events.ts"),F=M("./src/errors.ts"),K=M("./src/utils/codecs.ts"),H=M("./src/controller/level-helper.ts"),P=M("./src/controller/base-playlist-controller.ts"),I=M("./src/types/loader.ts");function y(){return y=Object.assign||function(r){for(var a=1;a<arguments.length;a++){var d=arguments[a];for(var L in d)Object.prototype.hasOwnProperty.call(d,L)&&(r[L]=d[L])}return r},y.apply(this,arguments)}function m(r,a){for(var d=0;d<a.length;d++){var L=a[d];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(r,L.key,L)}}function p(r,a,d){return a&&m(r.prototype,a),d&&m(r,d),r}function c(r,a){r.prototype=Object.create(a.prototype),r.prototype.constructor=r,u(r,a)}function u(r,a){return u=Object.setPrototypeOf||function(L,C){return L.__proto__=C,L},u(r,a)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(r){c(a,r);function a(L){var C;return C=r.call(this,L,"[level-controller]")||this,C._levels=[],C._firstLevel=-1,C._startLevel=void 0,C.currentLevelIndex=-1,C.manualLevelIndex=-1,C.onParsedComplete=void 0,C._registerListeners(),C}var d=a.prototype;return d._registerListeners=function(){var C=this.hls;C.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),C.on(D.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var C=this.hls;C.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),C.off(D.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},d.startLoad=function(){var C=this._levels;C.forEach(function(x){x.loadError=0}),r.prototype.startLoad.call(this)},d.onManifestLoaded=function(C,x){var R=[],O=[],w=[],E,b={},l,_=!1,h=!1,g=!1;if(x.levels.forEach(function(Y){var U=Y.attrs;_=_||!!(Y.width&&Y.height),h=h||!!Y.videoCodec,g=g||!!Y.audioCodec,f&&Y.audioCodec&&Y.audioCodec.indexOf("mp4a.40.34")!==-1&&(Y.audioCodec=void 0);var A=Y.bitrate+"-"+Y.attrs.RESOLUTION+"-"+Y.attrs.CODECS;l=b[A],l?l.url.push(Y.url):(l=new X.Level(Y),b[A]=l,R.push(l)),U&&(U.AUDIO&&Object(H.addGroupId)(l,"audio",U.AUDIO),U.SUBTITLES&&Object(H.addGroupId)(l,"text",U.SUBTITLES))}),(_||h)&&g&&(R=R.filter(function(Y){var U=Y.videoCodec,A=Y.width,J=Y.height;return!!U||!!(A&&J)})),R=R.filter(function(Y){var U=Y.audioCodec,A=Y.videoCodec;return(!U||Object(K.isCodecSupportedInMp4)(U,"audio"))&&(!A||Object(K.isCodecSupportedInMp4)(A,"video"))}),x.audioTracks&&(O=x.audioTracks.filter(function(Y){return!Y.audioCodec||Object(K.isCodecSupportedInMp4)(Y.audioCodec,"audio")}),Object(H.assignTrackIdsByGroup)(O)),x.subtitles&&(w=x.subtitles,Object(H.assignTrackIdsByGroup)(w)),R.length>0){E=R[0].bitrate,R.sort(function(Y,U){return Y.bitrate-U.bitrate}),this._levels=R;for(var T=0;T<R.length;T++)if(R[T].bitrate===E){this._firstLevel=T,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+E);break}var N=g&&!h,V={levels:R,audioTracks:O,subtitleTracks:w,firstLevel:this._firstLevel,stats:x.stats,audio:g,video:h,altAudio:!N&&O.some(function(Y){return!!Y.url})};this.hls.trigger(D.Events.MANIFEST_PARSED,V),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(D.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(C,x){if(r.prototype.onError.call(this,C,x),x.fatal)return;var R=x.context,O=this._levels[this.currentLevelIndex];if(R&&(R.type===I.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&R.groupId===O.audioGroupIds[O.urlId]||R.type===I.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&R.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var w=!1,E=!0,b;switch(x.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:case F.ErrorDetails.KEY_LOAD_ERROR:case F.ErrorDetails.KEY_LOAD_TIMEOUT:if(x.frag){var l=this._levels[x.frag.level];l?(l.fragmentError++,l.fragmentError>this.hls.config.fragLoadingMaxRetry&&(b=x.frag.level)):b=x.frag.level}break;case F.ErrorDetails.LEVEL_LOAD_ERROR:case F.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(E=!1),b=R.level),w=!0;break;case F.ErrorDetails.REMUX_ALLOC_ERROR:b=x.level,w=!0;break}b!==void 0&&this.recoverLevel(x,b,w,E)},d.recoverLevel=function(C,x,R,O){var w=C.details,E=this._levels[x];if(E.loadError++,R){var b=this.retryLoadingOrFail(C);if(b)C.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var l=E.url.length;if(l>1&&E.loadError<l)C.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var _=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(w+": switch to "+_),C.levelRetry=!0,this.hls.nextAutoLevel=_)}}},d.redundantFailover=function(C){var x=this._levels[C],R=x.url.length;if(R>1){var O=(x.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(w){w.urlId=O}),this.level=C}},d.onFragLoaded=function(C,x){var R=x.frag;if(R!==void 0&&R.type===I.PlaylistLevelType.MAIN){var O=this._levels[R.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},d.onLevelLoaded=function(C,x){var R,O=x.level,w=x.details,E=this._levels[O];if(!E){var b;this.warn("Invalid level index "+O),(b=x.deliveryDirectives)!==null&&b!==void 0&&b.skip&&(w.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(O,x,E.details)):(R=x.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(w.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(C,x){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var O=-1,w=this.hls.audioTracks[x.id].groupId,E=0;E<R.audioGroupIds.length;E++)if(R.audioGroupIds[E]===w){O=E;break}O!==R.urlId&&(R.urlId=O,this.startLoad())}},d.loadPlaylist=function(C){var x=this.currentLevelIndex,R=this._levels[x];if(this.canLoad&&R&&R.url.length>0){var O=R.urlId,w=R.url[O];if(C)try{w=C.addDirectives(w)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+x+(C?" at sn "+C.msn+" part "+C.part:"")+" with URL-id "+O+" "+w),this.clearTimer(),this.hls.trigger(D.Events.LEVEL_LOADING,{url:w,level:x,id:O,deliveryDirectives:C||null})}},d.removeLevel=function(C,x){var R=function(E,b){return b!==x},O=this._levels.filter(function(w,E){return E!==C?!0:w.url.length>1&&x!==void 0?(w.url=w.url.filter(R),w.audioGroupIds&&(w.audioGroupIds=w.audioGroupIds.filter(R)),w.textGroupIds&&(w.textGroupIds=w.textGroupIds.filter(R)),w.urlId=0,!0):!1}).map(function(w,E){var b=w.details;return b!=null&&b.fragments&&b.fragments.forEach(function(l){l.level=E}),w});this._levels=O,this.hls.trigger(D.Events.LEVELS_UPDATED,{levels:O})},p(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(C){var x,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===C&&(x=R[C])!==null&&x!==void 0&&x.details)return;if(C<0||C>=R.length){var O=C<0;if(this.hls.trigger(D.Events.ERROR,{type:F.ErrorTypes.OTHER_ERROR,details:F.ErrorDetails.LEVEL_SWITCH_ERROR,level:C,fatal:O,reason:"invalid level idx"}),O)return;C=Math.min(C,R.length-1)}this.clearTimer();var w=this.currentLevelIndex,E=R[w],b=R[C];this.log("switching to level "+C+" from "+w),this.currentLevelIndex=C;var l=y({},b,{level:C,maxBitrate:b.maxBitrate,uri:b.uri,urlId:b.urlId});delete l._urlId,this.hls.trigger(D.Events.LEVEL_SWITCHING,l);var _=b.details;if(!_||_.live){var h=this.switchParams(b.uri,E==null?void 0:E.details);this.loadPlaylist(h)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(C){this.manualLevelIndex=C,this._startLevel===void 0&&(this._startLevel=C),C!==-1&&(this.level=C)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(C){this._firstLevel=C}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var C=this.hls.config.startLevel;return C!==void 0?C:this._firstLevel}else return this._startLevel},set:function(C){this._startLevel=C}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(C){this.level=C,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=C)}}]),a}(P.default)},"./src/controller/level-helper.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"addGroupId",function(){return F}),M.d(j,"assignTrackIdsByGroup",function(){return K}),M.d(j,"updatePTS",function(){return H}),M.d(j,"updateFragPTSDTS",function(){return I}),M.d(j,"mergeDetails",function(){return y}),M.d(j,"mapPartIntersection",function(){return m}),M.d(j,"mapFragmentIntersection",function(){return p}),M.d(j,"adjustSliding",function(){return c}),M.d(j,"addSliding",function(){return u}),M.d(j,"computeReloadInterval",function(){return f}),M.d(j,"getFragmentWithSN",function(){return s}),M.d(j,"getPartWith",function(){return r});var X=M("./src/polyfills/number.ts"),D=M("./src/utils/logger.ts");function F(a,d,L){switch(d){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(L);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(L);break}}function K(a){var d={};a.forEach(function(L){var C=L.groupId||"";L.id=d[C]=d[C]||0,d[C]++})}function H(a,d,L){var C=a[d],x=a[L];P(C,x)}function P(a,d){var L=d.startPTS;if(Object(X.isFiniteNumber)(L)){var C=0,x;d.sn>a.sn?(C=L-a.start,x=a):(C=a.start-L,x=d),x.duration!==C&&(x.duration=C)}else if(d.sn>a.sn){var R=a.cc===d.cc;R&&a.minEndPTS?d.start=a.start+(a.minEndPTS-a.start):d.start=a.start+a.duration}else d.start=Math.max(a.start-d.duration,0)}function I(a,d,L,C,x,R){var O=C-L;O<=0&&(D.logger.warn("Fragment should have a positive duration",d),C=L+d.duration,R=x+d.duration);var w=L,E=C,b=d.startPTS,l=d.endPTS;if(Object(X.isFiniteNumber)(b)){var _=Math.abs(b-L);Object(X.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(_,d.deltaPTS):d.deltaPTS=_,w=Math.max(L,b),L=Math.min(L,b),x=Math.min(x,d.startDTS),E=Math.min(C,l),C=Math.max(C,l),R=Math.max(R,d.endDTS)}d.duration=C-L;var h=L-d.start;d.appendedPTS=C,d.start=d.startPTS=L,d.maxStartPTS=w,d.startDTS=x,d.endPTS=C,d.minEndPTS=E,d.endDTS=R;var g=d.sn;if(!a||g<a.startSN||g>a.endSN)return 0;var T,N=g-a.startSN,V=a.fragments;for(V[N]=d,T=N;T>0;T--)P(V[T],V[T-1]);for(T=N;T<V.length-1;T++)P(V[T],V[T+1]);return a.fragmentHint&&P(V[V.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,h}function y(a,d){for(var L=null,C=a.fragments,x=C.length-1;x>=0;x--){var R=C[x].initSegment;if(R){L=R;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var O=0,w;if(p(a,d,function(T,N){T.relurl&&(O=T.cc-N.cc),Object(X.isFiniteNumber)(T.startPTS)&&Object(X.isFiniteNumber)(T.endPTS)&&(N.start=N.startPTS=T.startPTS,N.startDTS=T.startDTS,N.appendedPTS=T.appendedPTS,N.maxStartPTS=T.maxStartPTS,N.endPTS=T.endPTS,N.endDTS=T.endDTS,N.minEndPTS=T.minEndPTS,N.duration=T.endPTS-T.startPTS,N.duration&&(w=N),d.PTSKnown=d.alignedSliding=!0),N.elementaryStreams=T.elementaryStreams,N.loader=T.loader,N.stats=T.stats,N.urlId=T.urlId,T.initSegment&&(N.initSegment=T.initSegment,L=T.initSegment)}),L){var E=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;E.forEach(function(T){var N;(!T.initSegment||T.initSegment.relurl===((N=L)===null||N===void 0?void 0:N.relurl))&&(T.initSegment=L)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(T){return!T}),d.deltaUpdateFailed)){D.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var b=d.skippedSegments;b--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var l=d.fragments;if(O){D.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<l.length;_++)l[_].cc+=O}d.skippedSegments&&(d.startCC=d.fragments[0].cc),m(a.partList,d.partList,function(T,N){N.elementaryStreams=T.elementaryStreams,N.stats=T.stats}),w?I(d,w,w.startPTS,w.endPTS,w.startDTS,w.endDTS):c(a,d),l.length&&(d.totalduration=d.edge-l[0].start),d.driftStartTime=a.driftStartTime,d.driftStart=a.driftStart;var h=d.advancedDateTime;if(d.advanced&&h){var g=d.edge;d.driftStart||(d.driftStartTime=h,d.driftStart=g),d.driftEndTime=h,d.driftEnd=g}else d.driftEndTime=a.driftEndTime,d.driftEnd=a.driftEnd,d.advancedDateTime=a.advancedDateTime}function m(a,d,L){if(a&&d)for(var C=0,x=0,R=a.length;x<=R;x++){var O=a[x],w=d[x+C];O&&w&&O.index===w.index&&O.fragment.sn===w.fragment.sn?L(O,w):C--}}function p(a,d,L){for(var C=d.skippedSegments,x=Math.max(a.startSN,d.startSN)-d.startSN,R=(a.fragmentHint?1:0)+(C?d.endSN:Math.min(a.endSN,d.endSN))-d.startSN,O=d.startSN-a.startSN,w=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,E=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,b=x;b<=R;b++){var l=E[O+b],_=w[b];C&&!_&&b<C&&(_=d.fragments[b]=l),l&&_&&L(l,_)}}function c(a,d){var L=d.startSN+d.skippedSegments-a.startSN,C=a.fragments;if(L<0||L>=C.length)return;u(d,C[L].start)}function u(a,d){if(d){for(var L=a.fragments,C=a.skippedSegments;C<L.length;C++)L[C].start+=d;a.fragmentHint&&(a.fragmentHint.start+=d)}}function f(a,d){var L=1e3*a.levelTargetDuration,C=L/2,x=a.age,R=x>0&&x<L*3,O=d.loading.end-d.loading.start,w,E=a.availabilityDelay;if(a.updated===!1)if(R){var b=333*a.misses;w=Math.max(Math.min(C,O*2),b),a.availabilityDelay=(a.availabilityDelay||0)+w}else w=C;else R?(E=Math.min(E||L/2,x),a.availabilityDelay=E,w=E+L-x):w=L-O;return Math.round(w)}function s(a,d,L){if(!a||!a.details)return null;var C=a.details,x=C.fragments[d-C.startSN];return x||(x=C.fragmentHint,x&&x.sn===d?x:d<C.startSN&&L&&L.sn===d?L:null)}function r(a,d,L){if(!a||!a.details)return null;var C=a.details.partList;if(C)for(var x=C.length;x--;){var R=C[x];if(R.index===L&&R.fragment.sn===d)return R}return null}},"./src/controller/stream-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return C});var X=M("./src/polyfills/number.ts"),D=M("./src/controller/base-stream-controller.ts"),F=M("./src/is-supported.ts"),K=M("./src/events.ts"),H=M("./src/utils/buffer-helper.ts"),P=M("./src/controller/fragment-tracker.ts"),I=M("./src/types/loader.ts"),y=M("./src/loader/fragment.ts"),m=M("./src/demux/transmuxer-interface.ts"),p=M("./src/types/transmuxer.ts"),c=M("./src/controller/gap-controller.ts"),u=M("./src/errors.ts"),f=M("./src/utils/logger.ts");function s(x,R){for(var O=0;O<R.length;O++){var w=R[O];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(x,w.key,w)}}function r(x,R,O){return R&&s(x.prototype,R),O&&s(x,O),x}function a(x,R){x.prototype=Object.create(R.prototype),x.prototype.constructor=x,d(x,R)}function d(x,R){return d=Object.setPrototypeOf||function(w,E){return w.__proto__=E,w},d(x,R)}var L=100,C=function(x){a(R,x);function R(w,E){var b;return b=x.call(this,w,E,"[stream-controller]")||this,b.audioCodecSwap=!1,b.gapController=null,b.level=-1,b._forceStartLoad=!1,b.altAudio=!1,b.audioOnly=!1,b.fragPlaying=null,b.onvplaying=null,b.onvseeked=null,b.fragLastKbps=0,b.stalled=!1,b.couldBacktrack=!1,b.audioCodecSwitch=!1,b.videoBuffer=null,b._registerListeners(),b}var O=R.prototype;return O._registerListeners=function(){var E=this.hls;E.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(K.Events.ERROR,this.onError,this),E.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var E=this.hls;E.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(K.Events.ERROR,this.onError,this),E.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(E){if(this.levels){var b=this.lastCurrentTime,l=this.hls;if(this.stopLoad(),this.setInterval(L),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=l.startLevel;_===-1&&(l.config.testBandwidth?(_=0,this.bitrateTest=!0):_=l.nextAutoLevel),this.level=l.nextLoadLevel=_,this.loadedmetadata=!1}b>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+b.toFixed(3)),E=b),this.state=D.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=D.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_LEVEL:{var E,b=this.levels,l=this.level,_=b==null||((E=b[l])===null||E===void 0)?void 0:E.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=D.State.IDLE;break}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var h,g=self.performance.now(),T=this.retryDate;(!T||g>=T||(h=this.media)!==null&&h!==void 0&&h.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=D.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var E,b,l=this.hls,_=this.levelLastLoaded,h=this.levels,g=this.media,T=l.config,N=l.nextLoadLevel;if(_===null||!g&&(this.startFragRequested||!T.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!h||!h[N])return;var V=h[N];this.level=l.nextLoadLevel=N;var Y=V.details;if(!Y||this.state===D.State.WAITING_LEVEL||Y.live&&this.levelLastLoaded!==N){this.state=D.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:g,I.PlaylistLevelType.MAIN);if(U===null)return;var A=U.len,J=this.getMaxBufferLength(V.maxBitrate);if(A>=J)return;if(this._streamEnded(U,Y)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,te),this.state=D.State.ENDED;return}var se=U.end,fe=this.getNextFragment(se,Y);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var Ue=fe.sn-Y.startSN;Ue>1&&(fe=Y.fragments[Ue-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===P.FragmentState.OK&&this.nextLoadPosition>se){var Re=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(g,Re,I.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,Y)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((E=fe.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((b=fe.decryptdata)!==null&&b!==void 0&&b.key)?this.loadKey(fe,Y):this.loadFragment(fe,Y,se)},O.loadFragment=function(E,b,l){var _,h=this.fragmentTracker.getState(E);if(this.fragCurrent=E,h===P.FragmentState.BACKTRACKED){var g=this.fragmentTracker.getBacktrackData(E);if(g){this._handleFragmentLoadProgress(g),this._handleFragmentLoadComplete(g);return}else h=P.FragmentState.NOT_LOADED}h===P.FragmentState.NOT_LOADED||h===P.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,E,b,l)):h===P.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(E){var b=this.fragmentTracker.getAppendedFrag(E,I.PlaylistLevelType.MAIN);return b&&"fragment"in b?b.fragment:b},O.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,I.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var E=this.levels,b=this.media;if(b!=null&&b.readyState){var l,_=this.getAppendedFrag(b.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!b.paused&&E){var h=this.hls.nextLoadLevel,g=E[h],T=this.fragLastKbps;T&&this.fragCurrent?l=this.fragCurrent.duration*g.maxBitrate/(1e3*T)+1:l=0}else l=0;var N=this.getBufferedFrag(b.currentTime+l);if(N){var V=this.followingBufferedFrag(N);if(V){this.abortCurrentFrag();var Y=V.maxStartPTS?V.maxStartPTS:V.start,U=V.duration,A=Math.max(N.end,Y+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(A,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===D.State.KEY_LOADING&&(this.state=D.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(E,b){x.prototype.flushMainBuffer.call(this,E,b,this.altAudio?"video":null)},O.onMediaAttached=function(E,b){x.prototype.onMediaAttached.call(this,E,b);var l=b.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),l.addEventListener("playing",this.onvplaying),l.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,l,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var E=this.media,b=E?E.currentTime:null;Object(X.isFiniteNumber)(b)&&this.log("Media seeked to "+b.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(E,b){var l=!1,_=!1,h;b.levels.forEach(function(g){h=g.audioCodec,h&&(h.indexOf("mp4a.40.2")!==-1&&(l=!0),h.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=l&&_&&!Object(F.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=b.levels,this.startFragRequested=!1},O.onLevelLoading=function(E,b){var l=this.levels;if(!l||this.state!==D.State.IDLE)return;var _=l[b.level];(!_.details||_.details.live&&this.levelLastLoaded!==b.level||this.waitForCdnTuneIn(_.details))&&(this.state=D.State.WAITING_LEVEL)},O.onLevelLoaded=function(E,b){var l,_=this.levels,h=b.level,g=b.details,T=g.totalduration;if(!_){this.warn("Levels were reset while loading level "+h);return}this.log("Level "+h+" loaded ["+g.startSN+","+g.endSN+"], cc ["+g.startCC+", "+g.endCC+"] duration:"+T);var N=this.fragCurrent;N&&(this.state===D.State.FRAG_LOADING||this.state===D.State.FRAG_LOADING_WAITING_RETRY)&&(N.level!==b.level&&N.loader&&(this.state=D.State.IDLE,N.loader.abort()));var V=_[h],Y=0;if(g.live||(l=V.details)!==null&&l!==void 0&&l.live){if(g.fragments[0]||(g.deltaUpdateFailed=!0),g.deltaUpdateFailed)return;Y=this.alignPlaylists(g,V.details)}if(V.details=g,this.levelLastLoaded=h,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:g,level:h}),this.state===D.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(g))return;this.state=D.State.IDLE}this.startFragRequested?g.live&&this.synchronizeToLiveEdge(g):this.setStartPosition(g,Y),this.tick()},O._handleFragmentLoadProgress=function(E){var b,l=E.frag,_=E.part,h=E.payload,g=this.levels;if(!g){this.warn("Levels were reset while fragment load was in progress. Fragment "+l.sn+" of level "+l.level+" will not be buffered");return}var T=g[l.level],N=T.details;if(!N){this.warn("Dropping fragment "+l.sn+" of level "+l.level+" after level details were reset");return}var V=T.videoCodec,Y=N.PTSKnown||!N.live,U=(b=l.initSegment)===null||b===void 0?void 0:b.data,A=this._getAudioCodec(T),J=this.transmuxer=this.transmuxer||new m.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=_?_.index:-1,se=te!==-1,fe=new p.ChunkMetadata(l.level,l.sn,l.stats.chunkCount,h.byteLength,te,se),Ue=this.initPTS[l.cc];J.push(h,U,A,V,l,_,N.totalduration,Y,fe,Ue)},O.onAudioTrackSwitching=function(E,b){var l=this.altAudio,_=!!b.url,h=b.id;if(!_){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var g=this.fragCurrent;g!=null&&g.loader&&(this.log("Switching to main audio track, cancel main fragment load"),g.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var T=this.hls;l&&T.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),T.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:h})}},O.onAudioTrackSwitched=function(E,b){var l=b.id,_=!!this.hls.audioTracks[l].url;if(_){var h=this.videoBuffer;h&&this.mediaBuffer!==h&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=h)}this.altAudio=_,this.tick()},O.onBufferCreated=function(E,b){var l=b.tracks,_,h,g=!1;for(var T in l){var N=l[T];if(N.id==="main"){if(h=T,_=N,T==="video"){var V=l[T];V&&(this.videoBuffer=V.buffer)}}else g=!0}g&&_?(this.log("Alternate track found, use "+h+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(E,b){var l=b.frag,_=b.part;if(l&&l.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(l)){this.warn("Fragment "+l.sn+(_?" p: "+_.index:"")+" of level "+l.level+" finished buffering, but was aborted. state: "+this.state),this.state===D.State.PARSED&&(this.state=D.State.IDLE);return}var h=_?_.stats:l.stats;this.fragLastKbps=Math.round(8*h.total/(h.buffering.end-h.loading.first)),l.sn!=="initSegment"&&(this.fragPrevious=l),this.fragBufferedComplete(l,_)},O.onError=function(E,b){switch(b.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.MAIN,b);break;case u.ErrorDetails.LEVEL_LOAD_ERROR:case u.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==D.State.ERROR&&(b.fatal?(this.warn(""+b.details),this.state=D.State.ERROR):!b.levelRetry&&this.state===D.State.WAITING_LEVEL&&(this.state=D.State.IDLE));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(b.parent==="main"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var l=!0,_=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);_&&_.len>.5&&(l=!this.reduceMaxBufferLength(_.len)),l&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var E=this.media,b=this.gapController;if(!E||!b||!E.readyState)return;var l=H.BufferHelper.getBuffered(E);!this.loadedmetadata&&l.length?(this.loadedmetadata=!0,this.seekToStartPos()):b.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=D.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(E,b){var l=b.type;if(l!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(l===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,l,I.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(E,b){this.levels=b.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var E=this.media,b=E.currentTime,l=this.startPosition;if(l>=0&&b<l){if(E.seeking){f.logger.log("could not seek to "+l+", already seeking at "+b);return}var _=H.BufferHelper.getBuffered(E),h=_.length?_.start(0):0,g=h-l;g>0&&(g<this.config.maxBufferHole||g<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+g+" to match buffer start"),l+=g,this.startPosition=l),this.log("seek to target start position "+l+" from current time "+b),E.currentTime=l}},O._getAudioCodec=function(E){var b=this.config.defaultAudioCodec||E.audioCodec;return this.audioCodecSwap&&b&&(this.log("Swapping audio codec"),b.indexOf("mp4a.40.5")!==-1?b="mp4a.40.2":b="mp4a.40.5"),b},O._loadBitrateTestFrag=function(E){var b=this;this._doFragLoad(E).then(function(l){var _=b.hls;if(!l||_.nextLoadLevel||b.fragContextChanged(E))return;b.fragLoadError=0,b.state=D.State.IDLE,b.startFragRequested=!1,b.bitrateTest=!1;var h=E.stats;h.parsing.start=h.parsing.end=h.buffering.start=h.buffering.end=self.performance.now(),_.trigger(K.Events.FRAG_LOADED,l)})},O._handleTransmuxComplete=function(E){var b,l="main",_=this.hls,h=E.remuxResult,g=E.chunkMeta,T=this.getCurrentContext(g);if(!T){this.warn("The loading context changed while buffering fragment "+g.sn+" of level "+g.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(g.level);return}var N=T.frag,V=T.part,Y=T.level,U=h.video,A=h.text,J=h.id3,te=h.initSegment,se=this.altAudio?void 0:h.audio;if(this.fragContextChanged(N))return;if(this.state=D.State.PARSING,te){te.tracks&&(this._bufferInitSegment(Y,te.tracks,N,g),_.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:N,id:l,tracks:te.tracks}));var fe=te.initPTS,Ue=te.timescale;Object(X.isFiniteNumber)(fe)&&(this.initPTS[N.cc]=fe,_.trigger(K.Events.INIT_PTS_FOUND,{frag:N,id:l,initPTS:fe,timescale:Ue}))}if(U&&h.independent!==!1){if(Y.details){var Re=U.startPTS,De=U.endPTS,Fe=U.startDTS,Me=U.endDTS;if(V)V.elementaryStreams[U.type]={startPTS:Re,endPTS:De,startDTS:Fe,endDTS:Me};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var ye=this.getLoadPosition()+this.config.maxBufferHole;if(ye<Re){this.backtrack(N);return}N.setElementaryStreamInfo(U.type,N.start,De,N.start,Me,!0)}N.setElementaryStreamInfo(U.type,Re,De,Fe,Me),this.bufferFragmentData(U,N,V,g)}}else if(h.independent===!1){this.backtrack(N);return}if(se){var le=se.startPTS,Se=se.endPTS,ot=se.startDTS,it=se.endDTS;V&&(V.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:Se,startDTS:ot,endDTS:it}),N.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,le,Se,ot,it),this.bufferFragmentData(se,N,V,g)}if(J!=null&&(b=J.samples)!==null&&b!==void 0&&b.length){var ct={frag:N,id:l,samples:J.samples};_.trigger(K.Events.FRAG_PARSING_METADATA,ct)}if(A){var xt={frag:N,id:l,samples:A.samples};_.trigger(K.Events.FRAG_PARSING_USERDATA,xt)}},O._bufferInitSegment=function(E,b,l,_){var h=this;if(this.state!==D.State.PARSING)return;this.audioOnly=!!b.audio&&!b.video,this.altAudio&&!this.audioOnly&&delete b.audio;var g=b.audio,T=b.video,N=b.audiovideo;if(g){var V=E.audioCodec,Y=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(V&&(V.indexOf("mp4a.40.5")!==-1?V="mp4a.40.2":V="mp4a.40.5"),g.metadata.channelCount!==1&&Y.indexOf("firefox")===-1&&(V="mp4a.40.5")),Y.indexOf("android")!==-1&&g.container!=="audio/mpeg"&&(V="mp4a.40.2",this.log("Android: force audio codec to "+V)),E.audioCodec&&E.audioCodec!==V&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+V+'"'),g.levelCodec=V,g.id="main",this.log("Init audio buffer, container:"+g.container+", codecs[selected/level/parsed]=["+(V||"")+"/"+(E.audioCodec||"")+"/"+g.codec+"]")}T&&(T.levelCodec=E.videoCodec,T.id="main",this.log("Init video buffer, container:"+T.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+T.codec+"]")),N&&this.log("Init audiovideo buffer, container:"+N.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+N.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,b),Object.keys(b).forEach(function(U){var A=b[U],J=A.initSegment;J!=null&&J.byteLength&&h.hls.trigger(K.Events.BUFFER_APPENDING,{type:U,data:J,frag:l,part:null,chunkMeta:_,parent:l.type})}),this.tick()},O.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var b=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,b?this.resetFragmentLoading(E):this.state=D.State.BACKTRACKING},O.checkFragmentChanged=function(){var E=this.media,b=null;if(E&&E.readyState>1&&E.seeking===!1){var l=E.currentTime;if(H.BufferHelper.isBuffered(E,l)?b=this.getAppendedFrag(l):H.BufferHelper.isBuffered(E,l+.1)&&(b=this.getAppendedFrag(l+.1)),b){var _=this.fragPlaying,h=b.level;(!_||b.sn!==_.sn||_.level!==h||b.urlId!==_.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:b}),(!_||_.level!==h)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:h}),this.fragPlaying=b)}}},r(R,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var b=this.getAppendedFrag(E.currentTime);if(b)return b.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var b=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(b)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(D.default)},"./src/controller/subtitle-stream-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"SubtitleStreamController",function(){return a});var X=M("./src/events.ts"),D=M("./src/utils/logger.ts"),F=M("./src/utils/buffer-helper.ts"),K=M("./src/controller/fragment-finders.ts"),H=M("./src/utils/discontinuities.ts"),P=M("./src/controller/level-helper.ts"),I=M("./src/controller/fragment-tracker.ts"),y=M("./src/controller/base-stream-controller.ts"),m=M("./src/types/loader.ts"),p=M("./src/types/level.ts");function c(d,L){for(var C=0;C<L.length;C++){var x=L[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(d,x.key,x)}}function u(d,L,C){return L&&c(d.prototype,L),C&&c(d,C),d}function f(d,L){d.prototype=Object.create(L.prototype),d.prototype.constructor=d,s(d,L)}function s(d,L){return s=Object.setPrototypeOf||function(x,R){return x.__proto__=R,x},s(d,L)}var r=500,a=function(d){f(L,d);function L(x,R){var O;return O=d.call(this,x,R,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var C=L.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var R=this.hls;R.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(X.Events.ERROR,this.onError,this),R.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var R=this.hls;R.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(X.Events.ERROR,this.onError,this),R.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(r),this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},C.onLevelLoaded=function(R,O){this.mainDetails=O.details},C.onSubtitleFragProcessed=function(R,O){var w=O.frag,E=O.success;if(this.fragPrevious=w,this.state=y.State.IDLE,!E)return;var b=this.tracksBuffered[this.currentTrackId];if(!b)return;for(var l,_=w.start,h=0;h<b.length;h++)if(_>=b[h].start&&_<=b[h].end){l=b[h];break}var g=w.start+w.duration;l?l.end=g:(l={start:_,end:g},b.push(l)),this.fragmentTracker.fragBuffered(w)},C.onBufferFlushing=function(R,O){var w=O.startOffset,E=O.endOffset;if(w===0&&E!==Number.POSITIVE_INFINITY){var b=this.currentTrackId,l=this.levels;if(!l.length||!l[b]||!l[b].details)return;var _=l[b].details,h=_.targetduration,g=E-h;if(g<=0)return;O.endOffsetSubtitles=Math.max(0,g),this.tracksBuffered.forEach(function(T){for(var N=0;N<T.length;){if(T[N].end<=g){T.shift();continue}else if(T[N].start<g)T[N].start=g;else break;N++}}),this.fragmentTracker.removeFragmentsInRange(w,g,m.PlaylistLevelType.SUBTITLE)}},C.onError=function(R,O){var w,E=O.frag;if(!E||E.type!==m.PlaylistLevelType.SUBTITLE)return;(w=this.fragCurrent)!==null&&w!==void 0&&w.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},C.onSubtitleTracksUpdated=function(R,O){var w=this,E=O.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(b){return new p.Level(b)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(b){w.tracksBuffered[b.id]=[]}),this.mediaBuffer=null},C.onSubtitleTrackSwitch=function(R,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var w=this.levels[this.currentTrackId];w!=null&&w.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,w&&this.setInterval(r)},C.onSubtitleTrackLoaded=function(R,O){var w,E=O.details,b=O.id,l=this.currentTrackId,_=this.levels;if(!_.length)return;var h=_[l];if(b>=_.length||b!==l||!h)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(w=h.details)!==null&&w!==void 0&&w.live){var g=this.mainDetails;if(E.deltaUpdateFailed||!g)return;var T=g.fragments[0];if(!h.details)E.hasProgramDateTime&&g.hasProgramDateTime?Object(H.alignMediaPlaylistByPDT)(E,g):T&&Object(P.addSliding)(E,T.start);else{var N=this.alignPlaylists(E,h.details);N===0&&T&&Object(P.addSliding)(E,T.start)}}if(h.details=E,this.levelLastLoaded=b,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var V=Object(K.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);V||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0)}},C._handleFragmentLoadComplete=function(R){var O=R.frag,w=R.payload,E=O.decryptdata,b=this.hls;if(this.fragContextChanged(O))return;if(w&&w.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var l=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(w),E.key.buffer,E.iv.buffer).then(function(_){var h=performance.now();b.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:_,stats:{tstart:l,tdecrypt:h}})})}},C.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var R,O=this.currentTrackId,w=this.levels;if(!w.length||!w[O]||!w[O].details)return;var E=w[O].details,b=E.targetduration,l=this.config,_=this.media,h=F.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-b,l.maxBufferHole),g=h.end,T=h.len,N=this.getMaxBufferLength()+b;if(T>N)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var V=E.fragments,Y=V.length,U=E.edge,A,J=this.fragPrevious;if(g<U){var te=l.maxFragLookUpTolerance;J&&E.hasProgramDateTime&&(A=Object(K.findFragmentByPDT)(V,J.endProgramDateTime,te)),A||(A=Object(K.findFragmentByPTS)(J,V,g,te),!A&&J&&J.start<V[0].start&&(A=V[0]))}else A=V[Y-1];(R=A)!==null&&R!==void 0&&R.encrypted?(D.logger.log("Loading key for "+A.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:A})):A&&this.fragmentTracker.getState(A)===I.FragmentState.NOT_LOADED&&this.loadFragment(A,E,g)}},C.loadFragment=function(R,O,w){this.fragCurrent=R,d.prototype.loadFragment.call(this,R,O,w)},u(L,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),L}(y.default)},"./src/controller/subtitle-track-controller.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/events.ts"),D=M("./src/utils/texttrack-utils.ts"),F=M("./src/controller/base-playlist-controller.ts"),K=M("./src/types/loader.ts");function H(c,u){for(var f=0;f<u.length;f++){var s=u[f];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function P(c,u,f){return u&&H(c.prototype,u),f&&H(c,f),c}function I(c,u){c.prototype=Object.create(u.prototype),c.prototype.constructor=c,y(c,u)}function y(c,u){return y=Object.setPrototypeOf||function(s,r){return s.__proto__=r,s},y(c,u)}var m=function(c){I(u,c);function u(s){var r;return r=c.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 f=u.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},f.registerListeners=function(){var r=this.hls;r.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(X.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var r=this.hls;r.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(X.Events.ERROR,this.onError,this)},f.onMediaAttached=function(r,a){if(this.media=a.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},f.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},f.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var r=p(this.media.textTracks);r.forEach(function(a){Object(D.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(r,a){this.tracks=a.subtitleTracks},f.onSubtitleTrackLoaded=function(r,a){var d=a.id,L=a.details,C=this.trackId,x=this.tracksInGroup[C];if(!x){this.warn("Invalid subtitle track id "+d);return}var R=x.details;x.details=a.details,this.log("subtitle track "+d+" loaded ["+L.startSN+"-"+L.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,a,R))},f.onLevelLoading=function(r,a){this.switchLevel(a.level)},f.onLevelSwitching=function(r,a){this.switchLevel(a.level)},f.switchLevel=function(r){var a=this.hls.levels[r];if(!(a!=null&&a.textGroupIds))return;var d=a.textGroupIds[a.urlId];if(this.groupId!==d){var L=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,C=this.tracks.filter(function(O){return!d||O.groupId===d});this.tracksInGroup=C;var x=this.findTrackId(L==null?void 0:L.name)||this.findTrackId();this.groupId=d;var R={subtitleTracks:C};this.log("Updating subtitle tracks, "+C.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,R),x!==-1&&this.setSubtitleTrack(x,L)}},f.findTrackId=function(r){for(var a=this.tracksInGroup,d=0;d<a.length;d++){var L=a[d];if((!this.selectDefaultTrack||L.default)&&(!r||r===L.name))return L.id}return-1},f.onError=function(r,a){if(c.prototype.onError.call(this,r,a),a.fatal||!a.context)return;a.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},f.loadPlaylist=function(r){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var d=a.id,L=a.groupId,C=a.url;if(r)try{C=r.addDirectives(C)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:C,id:d,groupId:L,deliveryDirectives:r||null})}},f.toggleTrackModes=function(r){var a=this,d=this.media,L=this.subtitleDisplay,C=this.trackId;if(!d)return;var x=p(d.textTracks),R=x.filter(function(E){return E.groupId===a.groupId});if(r===-1)[].slice.call(x).forEach(function(E){E.mode="disabled"});else{var O=R[C];O&&(O.mode="disabled")}var w=R[r];w&&(w.mode=L?"showing":"hidden")},f.setSubtitleTrack=function(r,a){var d,L=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(d=L[r])!==null&&d!==void 0&&d.details)||r<-1||r>=L.length)return;this.clearTimer();var C=L[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,C){var x=C.id,R=C.groupId,O=R===void 0?"":R,w=C.name,E=C.type,b=C.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:O,name:w,type:E,url:b});var l=this.switchParams(C.url,a==null?void 0:a.details);this.loadPlaylist(l)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:r})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,a=p(this.media.textTracks),d=0;d<a.length;d++)if(a[d].mode==="hidden")r=d;else if(a[d].mode==="showing"){r=d;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},P(u,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,a)}}]),u}(F.default);function p(c){for(var u=[],f=0;f<c.length;f++){var s=c[f];s.kind==="subtitles"&&s.label&&u.push(c[f])}return u}j.default=m},"./src/controller/timeline-controller.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"TimelineController",function(){return p});var X=M("./src/polyfills/number.ts"),D=M("./src/events.ts"),F=M("./src/utils/cea-608-parser.ts"),K=M("./src/utils/output-filter.ts"),H=M("./src/utils/webvtt-parser.ts"),P=M("./src/utils/texttrack-utils.ts"),I=M("./src/utils/imsc1-ttml-parser.ts"),y=M("./src/types/loader.ts"),m=M("./src/utils/logger.ts"),p=function(){function s(a){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this.captionsProperties=void 0,this.hls=a,this.config=a.config,this.Cues=a.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var d=new K.default(this,"textTrack1"),L=new K.default(this,"textTrack2"),C=new K.default(this,"textTrack3"),x=new K.default(this,"textTrack4");this.cea608Parser1=new F.default(1,d,L),this.cea608Parser2=new F.default(3,C,x)}a.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(D.Events.FRAG_LOADING,this.onFragLoading,this),a.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=s.prototype;return r.destroy=function(){var d=this.hls;d.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(D.Events.FRAG_LOADING,this.onFragLoading,this),d.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(d,L,C,x,R){for(var O=!1,w=R.length;w--;){var E=R[w],b=u(E[0],E[1],L,C);if(b>=0&&(E[0]=Math.min(E[0],L),E[1]=Math.max(E[1],C),O=!0,b/(C-L)>.5))return}if(O||R.push([L,C]),this.config.renderTextTracksNatively){var l=this.captionsTracks[d];this.Cues.newCue(l,L,C,x)}else{var _=this.Cues.newCue(null,L,C,x);this.hls.trigger(D.Events.CUES_PARSED,{type:"captions",cues:_,track:d})}},r.onInitPtsFound=function(d,L){var C=this,x=L.frag,R=L.id,O=L.initPTS,w=L.timescale,E=this.unparsedVttFrags;R==="main"&&(this.initPTS[x.cc]=O,this.timescale[x.cc]=w),E.length&&(this.unparsedVttFrags=[],E.forEach(function(b){C.onFragLoaded(D.Events.FRAG_LOADED,b)}))},r.getExistingTrack=function(d){var L=this.media;if(L)for(var C=0;C<L.textTracks.length;C++){var x=L.textTracks[C];if(x[d])return x}return null},r.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},r.createNativeTrack=function(d){if(this.captionsTracks[d])return;var L=this.captionsProperties,C=this.captionsTracks,x=this.media,R=L[d],O=R.label,w=R.languageCode,E=this.getExistingTrack(d);if(E)C[d]=E,Object(P.clearCurrentCues)(C[d]),Object(P.sendAddTrackEvent)(C[d],x);else{var b=this.createTextTrack("captions",O,w);b&&(b[d]=!0,C[d]=b)}},r.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var L=this.captionsProperties[d];if(!L)return;var C=L.label,x={_id:d,label:C,kind:"captions",default:L.media?!!L.media.default:!1,closedCaptions:L.media};this.nonNativeCaptionsTracks[d]=x,this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},r.createTextTrack=function(d,L,C){var x=this.media;return x?x.addTextTrack(d,L,C):void 0},r.onMediaAttaching=function(d,L){this.media=L.media,this._cleanTracks()},r.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(L){Object(P.clearCurrentCues)(d[L]),delete d[L]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},r._cleanTracks=function(){var d=this.media;if(!d)return;var L=d.textTracks;if(L)for(var C=0;C<L.length;C++)Object(P.clearCurrentCues)(L[C])},r.onSubtitleTracksUpdated=function(d,L){var C=this;this.textTracks=[];var x=L.subtitleTracks||[],R=x.some(function(b){return b.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var O=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var w=this.media?this.media.textTracks:[];this.tracks.forEach(function(b,l){var _;if(l<w.length){for(var h=null,g=0;g<w.length;g++)if(c(w[g],b)){h=w[g];break}h&&(_=h)}_?Object(P.clearCurrentCues)(_):(_=C.createTextTrack("subtitles",b.name,b.lang),_&&(_.mode="disabled")),_&&(_.groupId=b.groupId,C.textTracks.push(_))})}else if(!O&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(b){return{label:b.name,kind:b.type.toLowerCase(),default:b.default,subtitleTrack:b}});this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},r.onManifestLoaded=function(d,L){var C=this;this.config.enableCEA708Captions&&L.captions&&L.captions.forEach(function(x){var R=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!R)return;var O="textTrack"+R[1],w=C.captionsProperties[O];if(!w)return;w.label=x.name,x.lang&&(w.languageCode=x.lang),w.media=x})},r.onFragLoading=function(d,L){var C=this.cea608Parser1,x=this.cea608Parser2,R=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(C&&x))return;if(L.frag.type===y.PlaylistLevelType.MAIN){var w,E,b=L.frag.sn,l=(w=L==null||((E=L.part)===null||E===void 0)?void 0:E.index)!=null?w:-1;b===R+1||b===R&&l===O+1||(C.reset(),x.reset()),this.lastSn=b,this.lastPartIndex=l}},r.onFragLoaded=function(d,L){var C=L.frag,x=L.payload,R=this.initPTS,O=this.unparsedVttFrags;if(C.type===y.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(X.isFiniteNumber)(R[C.cc])){O.push(L),R.length&&this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Missing initial subtitle PTS")});return}var w=C.decryptdata;if(w==null||w.key==null||w.method!=="AES-128"){var E=this.tracks[C.level],b=this.vttCCs;b[C.cc]||(b[C.cc]={start:C.start,prevCC:this.prevCC,new:!0},this.prevCC=C.cc),E&&E.textCodec===I.IMSC1_CODEC?this._parseIMSC1(C,x):this._parseVTTs(C,x,b)}}else this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(d,L){var C=this,x=this.hls;Object(I.parseIMSC1)(L,this.initPTS[d.cc],this.timescale[d.cc],function(R){C._appendCues(R,d.level),x.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(R){m.logger.log("Failed to parse IMSC1: "+R),x.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:R})})},r._parseVTTs=function(d,L,C){var x=this,R=this.hls;Object(H.parseWebVTT)(L,this.initPTS[d.cc],this.timescale[d.cc],C,d.cc,d.start,function(O){x._appendCues(O,d.level),R.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(O){x._fallbackToIMSC1(d,L),m.logger.log("Failed to parse VTT cue: "+O),R.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:O})})},r._fallbackToIMSC1=function(d,L){var C=this,x=this.tracks[d.level];x.textCodec||Object(I.parseIMSC1)(L,this.initPTS[d.cc],this.timescale[d.cc],function(){x.textCodec=I.IMSC1_CODEC,C._parseIMSC1(d,L)},function(){x.textCodec="wvtt"})},r._appendCues=function(d,L){var C=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[L];if(x.mode==="disabled")return;d.forEach(function(w){return Object(P.addCueToTrack)(x,w)})}else{var R=this.tracks[L],O=R.default?"default":"subtitles"+L;C.trigger(D.Events.CUES_PARSED,{type:"subtitles",cues:d,track:O})}},r.onFragDecrypted=function(d,L){var C=L.frag;if(C.type===y.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[C.cc])){this.unparsedVttFrags.push(L);return}this.onFragLoaded(D.Events.FRAG_LOADED,L)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(d,L){var C=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(C&&x))return;for(var R=0;R<L.samples.length;R++){var O=L.samples[R].bytes;if(O){var w=this.extractCea608Data(O);C.addData(L.samples[R].pts,w[0]),x.addData(L.samples[R].pts,w[1])}}},r.onBufferFlushing=function(d,L){var C=L.startOffset,x=L.endOffset,R=L.endOffsetSubtitles,O=L.type,w=this.media;if(!w||w.currentTime<x)return;if(!O||O==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(l){return Object(P.removeCuesInRange)(E[l],C,x)})}if(this.config.renderTextTracksNatively&&(C===0&&R!==void 0)){var b=this.textTracks;Object.keys(b).forEach(function(l){return Object(P.removeCuesInRange)(b[l],C,R)})}},r.extractCea608Data=function(d){for(var L=d[0]&31,C=2,x=[[],[]],R=0;R<L;R++){var O=d[C++],w=127&d[C++],E=127&d[C++],b=(4&O)!==0,l=3&O;if(w===0&&E===0)continue;b&&((l===0||l===1)&&(x[l].push(w),x[l].push(E)))}return x},s}();function c(s,r){return s&&s.label===r.name&&!(s.textTrack1||s.textTrack2)}function u(s,r,a,d){return Math.min(r,d)-Math.max(s,a)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return X});var X=function(){function D(K,H){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=H}var F=D.prototype;return F.decrypt=function(H,P){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},P,H)},D}()},"./src/crypt/aes-decryptor.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"removePadding",function(){return D}),M.d(j,"default",function(){return F});var X=M("./src/utils/typed-array.ts");function D(K){var H=K.byteLength,P=H&&new DataView(K.buffer).getUint8(H-1);return P?Object(X.sliceUint8)(K,0,H-P):K}var F=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var H=K.prototype;return H.uint8ArrayToUint32Array_=function(I){for(var y=new DataView(I),m=new Uint32Array(4),p=0;p<4;p++)m[p]=y.getUint32(p*4);return m},H.initTable=function(){var I=this.sBox,y=this.invSBox,m=this.subMix,p=m[0],c=m[1],u=m[2],f=m[3],s=this.invSubMix,r=s[0],a=s[1],d=s[2],L=s[3],C=new Uint32Array(256),x=0,R=0,O=0;for(O=0;O<256;O++)O<128?C[O]=O<<1:C[O]=O<<1^283;for(O=0;O<256;O++){var w=R^R<<1^R<<2^R<<3^R<<4;w=w>>>8^w&255^99,I[x]=w,y[w]=x;var E=C[x],b=C[E],l=C[b],_=C[w]*257^w*16843008;p[x]=_<<24|_>>>8,c[x]=_<<16|_>>>16,u[x]=_<<8|_>>>24,f[x]=_,_=l*16843009^b*65537^E*257^x*16843008,r[w]=_<<24|_>>>8,a[w]=_<<16|_>>>16,d[w]=_<<8|_>>>24,L[w]=_,x?(x=E^C[C[C[l^E]]],R^=C[C[R]]):x=R=1}},H.expandKey=function(I){for(var y=this.uint8ArrayToUint32Array_(I),m=!0,p=0;p<y.length&&m;)m=y[p]===this.key[p],p++;if(m)return;this.key=y;var c=this.keySize=y.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var u=this.ksRows=(c+6+1)*4,f,s,r=this.keySchedule=new Uint32Array(u),a=this.invKeySchedule=new Uint32Array(u),d=this.sBox,L=this.rcon,C=this.invSubMix,x=C[0],R=C[1],O=C[2],w=C[3],E,b;for(f=0;f<u;f++){if(f<c){E=r[f]=y[f];continue}b=E,f%c===0?(b=b<<8|b>>>24,b=d[b>>>24]<<24|d[b>>>16&255]<<16|d[b>>>8&255]<<8|d[b&255],b^=L[f/c|0]<<24):c>6&&f%c===4&&(b=d[b>>>24]<<24|d[b>>>16&255]<<16|d[b>>>8&255]<<8|d[b&255]),r[f]=E=(r[f-c]^b)>>>0}for(s=0;s<u;s++)f=u-s,s&3?b=r[f]:b=r[f-4],s<4||f<=4?a[s]=b:a[s]=x[d[b>>>24]]^R[d[b>>>16&255]]^O[d[b>>>8&255]]^w[d[b&255]],a[s]=a[s]>>>0},H.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},H.decrypt=function(I,y,m){for(var p=this.keySize+6,c=this.invKeySchedule,u=this.invSBox,f=this.invSubMix,s=f[0],r=f[1],a=f[2],d=f[3],L=this.uint8ArrayToUint32Array_(m),C=L[0],x=L[1],R=L[2],O=L[3],w=new Int32Array(I),E=new Int32Array(w.length),b,l,_,h,g,T,N,V,Y,U,A,J,te,se,fe=this.networkToHostOrderSwap;y<w.length;){for(Y=fe(w[y]),U=fe(w[y+1]),A=fe(w[y+2]),J=fe(w[y+3]),g=Y^c[0],T=J^c[1],N=A^c[2],V=U^c[3],te=4,se=1;se<p;se++)b=s[g>>>24]^r[T>>16&255]^a[N>>8&255]^d[V&255]^c[te],l=s[T>>>24]^r[N>>16&255]^a[V>>8&255]^d[g&255]^c[te+1],_=s[N>>>24]^r[V>>16&255]^a[g>>8&255]^d[T&255]^c[te+2],h=s[V>>>24]^r[g>>16&255]^a[T>>8&255]^d[N&255]^c[te+3],g=b,T=l,N=_,V=h,te=te+4;b=u[g>>>24]<<24^u[T>>16&255]<<16^u[N>>8&255]<<8^u[V&255]^c[te],l=u[T>>>24]<<24^u[N>>16&255]<<16^u[V>>8&255]<<8^u[g&255]^c[te+1],_=u[N>>>24]<<24^u[V>>16&255]<<16^u[g>>8&255]<<8^u[T&255]^c[te+2],h=u[V>>>24]<<24^u[g>>16&255]<<16^u[T>>8&255]<<8^u[N&255]^c[te+3],E[y]=fe(b^C),E[y+1]=fe(h^x),E[y+2]=fe(_^R),E[y+3]=fe(l^O),C=Y,x=U,R=A,O=J,y=y+4}return E.buffer},K}()},"./src/crypt/decrypter.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return y});var X=M("./src/crypt/aes-crypto.ts"),D=M("./src/crypt/fast-aes-key.ts"),F=M("./src/crypt/aes-decryptor.ts"),K=M("./src/utils/logger.ts"),H=M("./src/utils/mp4-tools.ts"),P=M("./src/utils/typed-array.ts"),I=16,y=function(){function m(c,u,f){var s=f===void 0?{}:f,r=s.removePKCS7Padding,a=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=c,this.config=u,this.removePKCS7Padding=a,a)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(L){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=m.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var u=this.currentResult;if(!u){this.reset();return}var f=new Uint8Array(u);return this.reset(),this.removePKCS7Padding?Object(F.removePadding)(f):f},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(u,f,s,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(u),f,s);var a=this.flush();a&&r(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(u),f,s).then(r)},p.softwareDecrypt=function(u,f,s){var r=this.currentIV,a=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(u=Object(H.appendUint8Array)(d,u),this.remainderData=null);var L=this.getValidChunk(u);if(!L.length)return null;r&&(s=r);var C=this.softwareDecrypter;C||(C=this.softwareDecrypter=new F.default),C.expandKey(f);var x=a;return this.currentResult=C.decrypt(L.buffer,0,s),this.currentIV=Object(P.sliceUint8)(L,-16).buffer,x||null},p.webCryptoDecrypt=function(u,f,s){var r=this,a=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new D.default(a,f)),this.fastAesKey.expandKey().then(function(d){if(!a)return Promise.reject(new Error("web crypto not initialized"));var L=new X.default(a,s);return L.decrypt(u.buffer,d)}).catch(function(d){return r.onWebCryptoError(d,u,f,s)})},p.onWebCryptoError=function(u,f,s,r){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",u),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,s,r)},p.getValidChunk=function(u){var f=u,s=u.length-u.length%I;return s!==u.length&&(f=Object(P.sliceUint8)(u,0,s),this.remainderData=Object(P.sliceUint8)(u,s)),f},p.logOnce=function(u){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+u),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return X});var X=function(){function D(K,H){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=H}var F=D.prototype;return F.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},D}()},"./src/demux/aacdemuxer.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/demux/base-audio-demuxer.ts"),D=M("./src/demux/adts.ts"),F=M("./src/utils/logger.ts"),K=M("./src/demux/id3.ts");function H(y,m){y.prototype=Object.create(m.prototype),y.prototype.constructor=y,P(y,m)}function P(y,m){return P=Object.setPrototypeOf||function(c,u){return c.__proto__=u,c},P(y,m)}var I=function(y){H(m,y);function m(c,u){var f;return f=y.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=c,f.config=u,f}var p=m.prototype;return p.resetInitSegment=function(u,f,s){y.prototype.resetInitSegment.call(this,u,f,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:u,duration:s,inputTimeScale:9e4,dropped:0}},m.probe=function(u){if(!u)return!1;for(var f=K.getID3Data(u,0)||[],s=f.length,r=u.length;s<r;s++)if(D.probe(u,s))return F.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(u,f){return D.canParse(u,f)},p.appendFrame=function(u,f,s){D.initTrackConfig(u,this.observer,f,s,u.manifestCodec);var r=D.appendFrame(u,f,s,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},m}(X.default);I.minProbeByteLength=9,j.default=I},"./src/demux/adts.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"getAudioConfig",function(){return K}),M.d(j,"isHeaderPattern",function(){return H}),M.d(j,"getHeaderLength",function(){return P}),M.d(j,"getFullFrameLength",function(){return I}),M.d(j,"canGetFrameLength",function(){return y}),M.d(j,"isHeader",function(){return m}),M.d(j,"canParse",function(){return p}),M.d(j,"probe",function(){return c}),M.d(j,"initTrackConfig",function(){return u}),M.d(j,"getFrameDuration",function(){return f}),M.d(j,"parseFrameHeader",function(){return s}),M.d(j,"appendFrame",function(){return r});var X=M("./src/utils/logger.ts"),D=M("./src/errors.ts"),F=M("./src/events.ts");function K(a,d,L,C){var x,R,O,w,E=navigator.userAgent.toLowerCase(),b=C,l=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((d[L+2]&192)>>>6)+1;var _=(d[L+2]&60)>>>2;if(_>l.length-1){a.trigger(F.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return O=(d[L+2]&1)<<2,O|=(d[L+3]&192)>>>6,X.logger.log("manifest codec:"+C+", ADTS type:"+x+", samplingIndex:"+_),/firefox/i.test(E)?_>=6?(x=5,w=new Array(4),R=_-3):(x=2,w=new Array(2),R=_):E.indexOf("android")!==-1?(x=2,w=new Array(2),R=_):(x=5,w=new Array(4),C&&(C.indexOf("mp4a.40.29")!==-1||C.indexOf("mp4a.40.5")!==-1)||!C&&_>=6?R=_-3:((C&&C.indexOf("mp4a.40.2")!==-1&&(_>=6&&O===1||/vivaldi/i.test(E))||!C&&O===1)&&(x=2,w=new Array(2)),R=_)),w[0]=x<<3,w[0]|=(_&14)>>1,w[1]|=(_&1)<<7,w[1]|=O<<3,x===5&&(w[1]|=(R&14)>>1,w[2]=(R&1)<<7,w[2]|=2<<2,w[3]=0),{config:w,samplerate:l[_],channelCount:O,codec:"mp4a.40."+x,manifestCodec:b}}function H(a,d){return a[d]===255&&(a[d+1]&246)===240}function P(a,d){return a[d+1]&1?7:9}function I(a,d){return(a[d+3]&3)<<11|a[d+4]<<3|(a[d+5]&224)>>>5}function y(a,d){return d+5<a.length}function m(a,d){return d+1<a.length&&H(a,d)}function p(a,d){return y(a,d)&&H(a,d)&&I(a,d)<=a.length-d}function c(a,d){if(m(a,d)){var L=P(a,d);if(d+L>=a.length)return!1;var C=I(a,d);if(C<=L)return!1;var x=d+C;return x===a.length||m(a,x)}return!1}function u(a,d,L,C,x){if(!a.samplerate){var R=K(d,L,C,x);if(!R)return;a.config=R.config,a.samplerate=R.samplerate,a.channelCount=R.channelCount,a.codec=R.codec,a.manifestCodec=R.manifestCodec,X.logger.log("parsed codec:"+a.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function f(a){return 1024*9e4/a}function s(a,d,L,C,x){var R=P(a,d),O=I(a,d);if(O-=R,O>0){var w=L+C*x;return{headerLength:R,frameLength:O,stamp:w}}}function r(a,d,L,C,x){var R=f(a.samplerate),O=s(d,L,C,x,R);if(O){var w=O.frameLength,E=O.headerLength,b=O.stamp,l=E+w,_=Math.max(0,L+l-d.length),h;_?(h=new Uint8Array(l-E),h.set(d.subarray(L+E,d.length),0)):h=d.subarray(L+E,L+l);var g={unit:h,pts:b};return _||a.samples.push(g),{sample:g,length:l,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"initPTSFn",function(){return I});var X=M("./src/polyfills/number.ts"),D=M("./src/demux/id3.ts"),F=M("./src/demux/dummy-demuxed-track.ts"),K=M("./src/utils/mp4-tools.ts"),H=M("./src/utils/typed-array.ts"),P=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=y.prototype;return m.resetInitSegment=function(c,u,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(c,u){return!1},m.appendFrame=function(c,u,f){},m.demux=function(c,u){this.cachedData&&(c=Object(K.appendUint8Array)(this.cachedData,c),this.cachedData=null);var f=D.getID3Data(c,0),s=f?f.length:0,r,a,d=this._audioTrack,L=this._id3Track,C=f?D.getTimeStamp(f):void 0,x=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(C,u)),f&&f.length>0&&L.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),a=this.initPTS;s<x;){if(this.canParse(c,s)){var R=this.appendFrame(d,c,s);R?(this.frameIndex++,a=R.sample.pts,s+=R.length,r=s):s=x}else D.canParse(c,s)?(f=D.getID3Data(c,s),L.samples.push({pts:a,dts:a,data:f}),s+=f.length,r=s):s++;if(s===x&&r!==x){var O=Object(H.sliceUint8)(c,r);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:d,avcTrack:Object(F.dummyTrack)(),id3Track:L,textTrack:Object(F.dummyTrack)()}},m.demuxSampleAes=function(c,u,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(c){var u=this.cachedData;return u&&(this.cachedData=null,this.demux(u,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(F.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(F.dummyTrack)()}},m.destroy=function(){},y}(),I=function(m,p){return Object(X.isFiniteNumber)(m)?m*90:p*9e4};j.default=P},"./src/demux/chunk-cache.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return X});var X=function(){function F(){this.chunks=[],this.dataLength=0}var K=F.prototype;return K.push=function(P){this.chunks.push(P),this.dataLength+=P.length},K.flush=function(){var P=this.chunks,I=this.dataLength,y;if(P.length)P.length===1?y=P[0]:y=D(P,I);else return new Uint8Array(0);return this.reset(),y},K.reset=function(){this.chunks.length=0,this.dataLength=0},F}();function D(F,K){for(var H=new Uint8Array(K),P=0,I=0;I<F.length;I++){var y=F[I];H.set(y,P),P+=y.length}return H}},"./src/demux/dummy-demuxed-track.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"dummyTrack",function(){return X});function X(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/utils/logger.ts"),D=function(){function F(H){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=H,this.bytesAvailable=H.byteLength,this.word=0,this.bitsAvailable=0}var K=F.prototype;return K.loadWord=function(){var P=this.data,I=this.bytesAvailable,y=P.byteLength-I,m=new Uint8Array(4),p=Math.min(4,I);if(p===0)throw new Error("no bytes available");m.set(P.subarray(y,y+p)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},K.skipBits=function(P){var I;this.bitsAvailable>P?(this.word<<=P,this.bitsAvailable-=P):(P-=this.bitsAvailable,I=P>>3,P-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=P,this.bitsAvailable-=P)},K.readBits=function(P){var I=Math.min(this.bitsAvailable,P),y=this.word>>>32-I;return P>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=P-I,I>0&&this.bitsAvailable?y<<I|this.readBits(I):y},K.skipLZ=function(){var P;for(P=0;P<this.bitsAvailable;++P)if((this.word&2147483648>>>P)!==0)return this.word<<=P,this.bitsAvailable-=P,P;return this.loadWord(),P+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var P=this.skipLZ();return this.readBits(P+1)-1},K.readEG=function(){var P=this.readUEG();return 1&P?1+P>>>1:-1*(P>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(P){for(var I=8,y=8,m,p=0;p<P;p++)y!==0&&(m=this.readEG(),y=(I+m+256)%256),I=y===0?I:y},K.readSPS=function(){var P=0,I=0,y=0,m=0,p,c,u,f=this.readUByte.bind(this),s=this.readBits.bind(this),r=this.readUEG.bind(this),a=this.readBoolean.bind(this),d=this.skipBits.bind(this),L=this.skipEG.bind(this),C=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);f();var R=f();if(s(5),d(3),f(),C(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var O=r();if(O===3&&d(1),C(),C(),d(1),a())for(c=O!==3?8:12,u=0;u<c;u++)a()&&(u<6?x(16):x(64))}C();var w=r();if(w===0)r();else if(w===1)for(d(1),L(),L(),p=r(),u=0;u<p;u++)L();C(),d(1);var E=r(),b=r(),l=s(1);l===0&&d(1),d(1),a()&&(P=r(),I=r(),y=r(),m=r());var _=[1,1];if(a()&&a()){var h=f();switch(h){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((E+1)*16-P*2-I*2),height:(2-l)*(b+1)*16-(l?2:4)*(y+m),pixelRatio:_}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},F}();j.default=D},"./src/demux/id3.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"isHeader",function(){return X}),M.d(j,"isFooter",function(){return D}),M.d(j,"getID3Data",function(){return F}),M.d(j,"canParse",function(){return H}),M.d(j,"getTimeStamp",function(){return P}),M.d(j,"isTimeStampFrame",function(){return I}),M.d(j,"getID3Frames",function(){return m}),M.d(j,"decodeFrame",function(){return p}),M.d(j,"utf8ArrayToStr",function(){return r}),M.d(j,"testables",function(){return a});var X=function(x,R){return R+10<=x.length&&(x[R]===73&&x[R+1]===68&&x[R+2]===51&&(x[R+3]<255&&x[R+4]<255&&(x[R+6]<128&&x[R+7]<128&&x[R+8]<128&&x[R+9]<128)))},D=function(x,R){return R+10<=x.length&&(x[R]===51&&x[R+1]===68&&x[R+2]===73&&(x[R+3]<255&&x[R+4]<255&&(x[R+6]<128&&x[R+7]<128&&x[R+8]<128&&x[R+9]<128)))},F=function(x,R){for(var O=R,w=0;X(x,R);){w+=10;var E=K(x,R+6);w+=E,D(x,R+10)&&(w+=10),R+=w}return w>0?x.subarray(O,O+w):void 0},K=function(x,R){var O=0;return O=(x[R]&127)<<21,O|=(x[R+1]&127)<<14,O|=(x[R+2]&127)<<7,O|=x[R+3]&127,O},H=function(x,R){return X(x,R)&&K(x,R+6)+10<=x.length-R},P=function(x){for(var R=m(x),O=0;O<R.length;O++){var w=R[O];if(I(w))return s(w)}return},I=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},y=function(x){var R=String.fromCharCode(x[0],x[1],x[2],x[3]),O=K(x,4),w=10;return{type:R,size:O,data:x.subarray(w,w+O)}},m=function(x){for(var R=0,O=[];X(x,R);){var w=K(x,R+6);R+=10;for(var E=R+w;R+8<E;){var b=y(x.subarray(R)),l=p(b);l&&O.push(l),R+=b.size+10}D(x,R)&&(R+=10)}return O},p=function(x){return x.type==="PRIV"?c(x):x.type[0]==="W"?f(x):u(x)},c=function(x){if(x.size<2)return;var R=r(x.data,!0),O=new Uint8Array(x.data.subarray(R.length+1));return{key:x.type,info:R,data:O.buffer}},u=function(x){if(x.size<2)return;if(x.type==="TXXX"){var R=1,O=r(x.data.subarray(R),!0);R+=O.length+1;var w=r(x.data.subarray(R));return{key:x.type,info:O,data:w}}var E=r(x.data.subarray(1));return{key:x.type,data:E}},f=function(x){if(x.type==="WXXX"){if(x.size<2)return;var R=1,O=r(x.data.subarray(R),!0);R+=O.length+1;var w=r(x.data.subarray(R));return{key:x.type,info:O,data:w}}var E=r(x.data);return{key:x.type,data:E}},s=function(x){if(x.data.byteLength===8){var R=new Uint8Array(x.data),O=R[3]&1,w=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return w/=45,O&&(w+=4772185884e-2),Math.round(w)}return},r=function(x,R){R===void 0&&(R=!1);var O=L();if(O){var w=O.decode(x);if(R){var E=w.indexOf("\0");return E!==-1?w.substring(0,E):w}return w.replace(/\0/g,"")}for(var b=x.length,l,_,h,g="",T=0;T<b;){if(l=x[T++],l===0&&R)return g;if(l===0||l===3)continue;switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:g+=String.fromCharCode(l);break;case 12:case 13:_=x[T++],g+=String.fromCharCode((l&31)<<6|_&63);break;case 14:_=x[T++],h=x[T++],g+=String.fromCharCode((l&15)<<12|(_&63)<<6|(h&63)<<0);break;default:}}return g},a={decodeTextFrame:u},d;function L(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/demux/base-audio-demuxer.ts"),D=M("./src/demux/id3.ts"),F=M("./src/utils/logger.ts"),K=M("./src/demux/mpegaudio.ts");function H(y,m){y.prototype=Object.create(m.prototype),y.prototype.constructor=y,P(y,m)}function P(y,m){return P=Object.setPrototypeOf||function(c,u){return c.__proto__=u,c},P(y,m)}var I=function(y){H(m,y);function m(){return y.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(u,f,s){y.prototype.resetInitSegment.call(this,u,f,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:u,duration:s,inputTimeScale:9e4,dropped:0}},m.probe=function(u){if(!u)return!1;for(var f=D.getID3Data(u,0)||[],s=f.length,r=u.length;s<r;s++)if(K.probe(u,s))return F.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(u,f){return K.canParse(u,f)},p.appendFrame=function(u,f,s){return this.initPTS===null?void 0:K.appendFrame(u,f,s,this.initPTS,this.frameIndex)},m}(X.default);I.minProbeByteLength=4,j.default=I},"./src/demux/mp4demuxer.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/utils/mp4-tools.ts"),D=M("./src/demux/dummy-demuxed-track.ts"),F=function(){function K(P,I){this.remainderData=null,this.config=void 0,this.config=I}var H=K.prototype;return H.resetTimeStamp=function(){},H.resetInitSegment=function(){},H.resetContiguity=function(){},K.probe=function(I){return Object(X.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},H.demux=function(I){var y=I,m=Object(D.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(X.appendUint8Array)(this.remainderData,I));var p=Object(X.segmentValidRange)(y);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=y;return{audioTrack:Object(D.dummyTrack)(),avcTrack:m,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},H.flush=function(){var I=Object(D.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(D.dummyTrack)(),avcTrack:I,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},H.demuxSampleAes=function(I,y,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},H.destroy=function(){},K}();F.minProbeByteLength=1024,j.default=F},"./src/demux/mpegaudio.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"appendFrame",function(){return P}),M.d(j,"parseHeader",function(){return I}),M.d(j,"isHeaderPattern",function(){return y}),M.d(j,"isHeader",function(){return m}),M.d(j,"canParse",function(){return p}),M.d(j,"probe",function(){return c});var X=null,D=[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],F=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],H=[0,1,1,4];function P(u,f,s,r,a){if(s+24>f.length)return;var d=I(f,s);if(d&&s+d.frameLength<=f.length){var L=d.samplesPerFrame*9e4/d.sampleRate,C=r+a*L,x={unit:f.subarray(s,s+d.frameLength),pts:C,dts:C};return u.config=[],u.channelCount=d.channelCount,u.samplerate=d.sampleRate,u.samples.push(x),{sample:x,length:d.frameLength,missing:0}}}function I(u,f){var s=u[f+1]>>3&3,r=u[f+1]>>1&3,a=u[f+2]>>4&15,d=u[f+2]>>2&3;if(s!==1&&a!==0&&a!==15&&d!==3){var L=u[f+2]>>1&1,C=u[f+3]>>6,x=s===3?3-r:r===3?3:4,R=D[x*14+a-1]*1e3,O=s===3?0:s===2?1:2,w=F[O*3+d],E=C===3?1:2,b=K[s][r],l=H[r],_=b*8*l,h=Math.floor(b*R/w+L)*l;if(X===null){var g=navigator.userAgent||"",T=g.match(/Chrome\/(\d+)/i);X=T?parseInt(T[1]):0}var N=!!X&&X<=87;return N&&r===2&&R>=224e3&&C===0&&(u[f+3]=u[f+3]|128),{sampleRate:w,channelCount:E,frameLength:h,samplesPerFrame:_}}}function y(u,f){return u[f]===255&&(u[f+1]&224)===224&&(u[f+1]&6)!==0}function m(u,f){return f+1<u.length&&y(u,f)}function p(u,f){var s=4;return y(u,f)&&s<=u.length-f}function c(u,f){if(f+1<u.length&&y(u,f)){var s=4,r=I(u,f),a=s;r!=null&&r.frameLength&&(a=r.frameLength);var d=f+a;return d===u.length||m(u,d)}return!1}},"./src/demux/sample-aes.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/crypt/decrypter.ts"),D=M("./src/demux/tsdemuxer.ts"),F=function(){function K(P,I,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new X.default(P,I,{removePKCS7Padding:!1})}var H=K.prototype;return H.decryptBuffer=function(I,y){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,y)},H.decryptAacSample=function(I,y,m,p){var c=I[y].unit,u=c.subarray(16,c.length-c.length%16),f=u.buffer.slice(u.byteOffset,u.byteOffset+u.length),s=this;this.decryptBuffer(f,function(r){var a=new Uint8Array(r);c.set(a,16),p||s.decryptAacSamples(I,y+1,m)})},H.decryptAacSamples=function(I,y,m){for(;;y++){if(y>=I.length){m();return}if(I[y].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(I,y,m,p),!p)return}},H.getAvcEncryptedData=function(I){for(var y=Math.floor((I.length-48)/160)*16+16,m=new Int8Array(y),p=0,c=32;c<=I.length-16;c+=160,p+=16)m.set(I.subarray(c,c+16),p);return m},H.getAvcDecryptedUnit=function(I,y){for(var m=new Uint8Array(y),p=0,c=32;c<=I.length-16;c+=160,p+=16)I.set(m.subarray(p,p+16),c);return I},H.decryptAvcSample=function(I,y,m,p,c,u){var f=Object(D.discardEPB)(c.data),s=this.getAvcEncryptedData(f),r=this;this.decryptBuffer(s.buffer,function(a){c.data=r.getAvcDecryptedUnit(f,a),u||r.decryptAvcSamples(I,y,m+1,p)})},H.decryptAvcSamples=function(I,y,m,p){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,m=0){if(y>=I.length){p();return}for(var c=I[y].units;!(m>=c.length);m++){var u=c[m];if(u.data.length<=48||u.type!==1&&u.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(I,y,m,p,u,f),!f)return}}},K}();j.default=F},"./src/demux/transmuxer-interface.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return c});var X=M("./node_modules/webworkify-webpack/index.js"),D=M.n(X),F=M("./src/events.ts"),K=M("./src/demux/transmuxer.ts"),H=M("./src/utils/logger.ts"),P=M("./src/errors.ts"),I=M("./src/utils/mediasource-helper.ts"),y=M("./node_modules/eventemitter3/index.js"),m=M.n(y),p=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function u(s,r,a,d){var L=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=a,this.onFlush=d;var C=s.config,x=function(b,l){l=l||{},l.frag=L.frag,l.id=L.id,s.trigger(b,l)};this.observer=new y.EventEmitter,this.observer.on(F.Events.FRAG_DECRYPTED,x),this.observer.on(F.Events.ERROR,x);var R={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(C.enableWorker&&typeof Worker!="undefined"){H.logger.log("demuxing in webworker");var w;try{w=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),w.addEventListener("message",this.onwmsg),w.onerror=function(E){s.trigger(F.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},w.postMessage({cmd:"init",typeSupported:R,vendor:O,id:r,config:JSON.stringify(C)})}catch(E){H.logger.warn("Error in worker:",E),H.logger.error("Error while initializing DemuxerWorker, fallback to inline"),w&&self.URL.revokeObjectURL(w.objectURL),this.transmuxer=new K.default(this.observer,R,C,O,r),this.worker=null}}else this.transmuxer=new K.default(this.observer,R,C,O,r)}var f=u.prototype;return f.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},f.push=function(r,a,d,L,C,x,R,O,w,E){var b=this;w.transmuxing.start=self.performance.now();var l=this.transmuxer,_=this.worker,h=x?x.start:C.start,g=C.decryptdata,T=this.frag,N=!(T&&C.cc===T.cc),V=!(T&&w.level===T.level),Y=T?w.sn-T.sn:-1,U=this.part?w.part-this.part.index:1,A=!V&&(Y===1||Y===0&&U===1),J=self.performance.now();(V||Y||C.stats.parsing.start===0)&&(C.stats.parsing.start=J),x&&(U||!A)&&(x.stats.parsing.start=J);var te=new K.TransmuxState(N,A,O,V,h);if(!A||N){H.logger.log("[transmuxer-interface, "+C.type+"]: Starting new transmux session for sn: "+w.sn+" p: "+w.part+" level: "+w.level+" id: "+w.id+`
|
|
discontinuity: `+N+`
|
|
trackSwitch: `+V+`
|
|
contiguous: `+A+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+h);var se=new K.TransmuxConfig(d,L,a,R,E);this.configureTransmuxer(se)}if(this.frag=C,this.part=x,_)_.postMessage({cmd:"demux",data:r,decryptdata:g,chunkMeta:w,state:te},r instanceof ArrayBuffer?[r]:[]);else if(l){var fe=l.push(r,g,w,te);Object(K.isPromise)(fe)?fe.then(function(Ue){b.handleTransmuxComplete(Ue)}):this.handleTransmuxComplete(fe)}},f.flush=function(r){var a=this;r.transmuxing.start=self.performance.now();var d=this.transmuxer,L=this.worker;if(L)L.postMessage({cmd:"flush",chunkMeta:r});else if(d){var C=d.flush(r);Object(K.isPromise)(C)?C.then(function(x){a.handleFlushResult(x,r)}):this.handleFlushResult(C,r)}},f.handleFlushResult=function(r,a){var d=this;r.forEach(function(L){d.handleTransmuxComplete(L)}),this.onFlush(a)},f.onWorkerMessage=function(r){var a=r.data,d=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,d.trigger(a.event,a.data);break}}},f.configureTransmuxer=function(r){var a=this.worker,d=this.transmuxer;a?a.postMessage({cmd:"configure",config:r}):d&&d.configure(r)},f.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},u}()},"./src/demux/transmuxer-worker.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return P});var X=M("./src/demux/transmuxer.ts"),D=M("./src/events.ts"),F=M("./src/utils/logger.ts"),K=M("./node_modules/eventemitter3/index.js"),H=M.n(K);function P(c){var u=new K.EventEmitter,f=function(r,a){c.postMessage({event:r,data:a})};u.on(D.Events.FRAG_DECRYPTED,f),u.on(D.Events.ERROR,f),c.addEventListener("message",function(s){var r=s.data;switch(r.cmd){case"init":{var a=JSON.parse(r.config);c.transmuxer=new X.default(u,r.typeSupported,a,r.vendor,r.id),Object(F.enableLogs)(a.debug),f("init",null);break}case"configure":{c.transmuxer.configure(r.config);break}case"demux":{var d=c.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(X.isPromise)(d)?d.then(function(x){I(c,x)}):I(c,d);break}case"flush":{var L=r.chunkMeta,C=c.transmuxer.flush(L);Object(X.isPromise)(C)?C.then(function(x){m(c,x,L)}):m(c,C,L);break}default:break}})}function I(c,u){if(p(u.remuxResult))return;var f=[],s=u.remuxResult,r=s.audio,a=s.video;r&&y(f,r),a&&y(f,a),c.postMessage({event:"transmuxComplete",data:u},f)}function y(c,u){u.data1&&c.push(u.data1.buffer),u.data2&&c.push(u.data2.buffer)}function m(c,u,f){u.forEach(function(s){I(c,s)}),c.postMessage({event:"flush",data:f})}function p(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return a}),M.d(j,"isPromise",function(){return C}),M.d(j,"TransmuxConfig",function(){return x}),M.d(j,"TransmuxState",function(){return R});var X=M("./src/events.ts"),D=M("./src/errors.ts"),F=M("./src/crypt/decrypter.ts"),K=M("./src/demux/aacdemuxer.ts"),H=M("./src/demux/mp4demuxer.ts"),P=M("./src/demux/tsdemuxer.ts"),I=M("./src/demux/mp3demuxer.ts"),y=M("./src/remux/mp4-remuxer.ts"),m=M("./src/remux/passthrough-remuxer.ts"),p=M("./src/demux/chunk-cache.ts"),c=M("./src/utils/mp4-tools.ts"),u=M("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(O){u.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var s=[{demux:P.default,remux:y.default},{demux:H.default,remux:m.default},{demux:K.default,remux:y.default},{demux:I.default,remux:y.default}],r=1024;s.forEach(function(O){var w=O.demux;r=Math.max(r,w.minProbeByteLength)});var a=function(){function O(E,b,l,_,h){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 p.default,this.observer=E,this.typeSupported=b,this.config=l,this.vendor=_,this.id=h}var w=O.prototype;return w.configure=function(b){this.transmuxConfig=b,this.decrypter&&this.decrypter.reset()},w.push=function(b,l,_,h){var g=this,T=_.transmuxing;T.executeStart=f();var N=new Uint8Array(b),V=this.cache,Y=this.config,U=this.currentTransmuxState,A=this.transmuxConfig;h&&(this.currentTransmuxState=h);var J=d(N,l);if(J&&J.method==="AES-128"){var te=this.getDecrypter();if(Y.enableSoftwareAES){var se=te.softwareDecrypt(N,J.key.buffer,J.iv.buffer);if(!se)return T.executeEnd=f(),L(_);N=new Uint8Array(se)}else return this.decryptionPromise=te.webCryptoDecrypt(N,J.key.buffer,J.iv.buffer).then(function(qe){var dt=g.push(qe,null,_);return g.decryptionPromise=null,dt}),this.decryptionPromise}var fe=h||U,Ue=fe.contiguous,Re=fe.discontinuity,De=fe.trackSwitch,Fe=fe.accurateTimeOffset,Me=fe.timeOffset,ye=A.audioCodec,le=A.videoCodec,Se=A.defaultInitPts,ot=A.duration,it=A.initSegmentData;if((Re||De)&&this.resetInitSegment(it,ye,le,ot),Re&&this.resetInitialTimestamp(Se),Ue||this.resetContiguity(),this.needsProbing(N,Re,De)){if(V.dataLength){var ct=V.flush();N=Object(c.appendUint8Array)(ct,N)}this.configureTransmuxer(N,A)}var xt=this.transmux(N,J,Me,Fe,_),Xe=this.currentTransmuxState;return Xe.contiguous=!0,Xe.discontinuity=!1,Xe.trackSwitch=!1,T.executeEnd=f(),xt},w.flush=function(b){var l=this,_=b.transmuxing;_.executeStart=f();var h=this.decrypter,g=this.cache,T=this.currentTransmuxState,N=this.decryptionPromise;if(N)return N.then(function(){return l.flush(b)});var V=[],Y=T.timeOffset;if(h){var U=h.flush();U&&V.push(this.push(U,null,b))}var A=g.dataLength;g.reset();var J=this.demuxer,te=this.remuxer;if(!J||!te)return A>=r&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=f(),[L(b)];var se=J.flush(Y);return C(se)?se.then(function(fe){return l.flushRemux(V,fe,b),V}):(this.flushRemux(V,se,b),V)},w.flushRemux=function(b,l,_){var h=l.audioTrack,g=l.avcTrack,T=l.id3Track,N=l.textTrack,V=this.currentTransmuxState,Y=V.accurateTimeOffset,U=V.timeOffset;u.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var A=this.remuxer.remux(h,g,T,N,U,Y,!0,this.id);b.push({remuxResult:A,chunkMeta:_}),_.transmuxing.executeEnd=f()},w.resetInitialTimestamp=function(b){var l=this.demuxer,_=this.remuxer;if(!l||!_)return;l.resetTimeStamp(b),_.resetTimeStamp(b)},w.resetContiguity=function(){var b=this.demuxer,l=this.remuxer;if(!b||!l)return;b.resetContiguity(),l.resetNextTimestamp()},w.resetInitSegment=function(b,l,_,h){var g=this.demuxer,T=this.remuxer;if(!g||!T)return;g.resetInitSegment(l,_,h),T.resetInitSegment(b,l,_)},w.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},w.transmux=function(b,l,_,h,g){var T;return l&&l.method==="SAMPLE-AES"?T=this.transmuxSampleAes(b,l,_,h,g):T=this.transmuxUnencrypted(b,_,h,g),T},w.transmuxUnencrypted=function(b,l,_,h){var g=this.demuxer.demux(b,l,!1,!this.config.progressive),T=g.audioTrack,N=g.avcTrack,V=g.id3Track,Y=g.textTrack,U=this.remuxer.remux(T,N,V,Y,l,_,!1,this.id);return{remuxResult:U,chunkMeta:h}},w.transmuxSampleAes=function(b,l,_,h,g){var T=this;return this.demuxer.demuxSampleAes(b,l,_).then(function(N){var V=T.remuxer.remux(N.audioTrack,N.avcTrack,N.id3Track,N.textTrack,_,h,!1,T.id);return{remuxResult:V,chunkMeta:g}})},w.configureTransmuxer=function(b,l){for(var _=this.config,h=this.observer,g=this.typeSupported,T=this.vendor,N=l.audioCodec,V=l.defaultInitPts,Y=l.duration,U=l.initSegmentData,A=l.videoCodec,J,te=0,se=s.length;te<se;te++)if(s[te].demux.probe(b)){J=s[te];break}J||(u.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),J={demux:H.default,remux:m.default});var fe=this.demuxer,Ue=this.remuxer,Re=J.remux,De=J.demux;(!Ue||!(Ue instanceof Re))&&(this.remuxer=new Re(h,_,g,T)),(!fe||!(fe instanceof De))&&(this.demuxer=new De(h,_,g),this.probe=De.probe),this.resetInitSegment(U,N,A,Y),this.resetInitialTimestamp(V)},w.needsProbing=function(b,l,_){return!this.demuxer||!this.remuxer||l||_},w.getDecrypter=function(){var b=this.decrypter;return b||(b=this.decrypter=new F.default(this.observer,this.config)),b},O}();function d(O,w){var E=null;return O.byteLength>0&&w!=null&&w.key!=null&&w.iv!==null&&w.method!=null&&(E=w),E}var L=function(w){return{remuxResult:{},chunkMeta:w}};function C(O){return"then"in O&&O.then instanceof Function}var x=function(w,E,b,l,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=w,this.videoCodec=E,this.initSegmentData=b,this.duration=l,this.defaultInitPts=_},R=function(w,E,b,l,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=w,this.contiguous=E,this.accurateTimeOffset=b,this.trackSwitch=l,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"discardEPB",function(){return L});var X=M("./src/demux/adts.ts"),D=M("./src/demux/mpegaudio.ts"),F=M("./src/demux/exp-golomb.ts"),K=M("./src/demux/id3.ts"),H=M("./src/demux/sample-aes.ts"),P=M("./src/events.ts"),I=M("./src/utils/mp4-tools.ts"),y=M("./src/utils/logger.ts"),m=M("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},c=function(){function C(R,O,w){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=R,this.config=O,this.typeSupported=w}C.probe=function(O){var w=C.syncOffset(O);return w<0?!1:(w&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+w+", junk ahead ?"),!0)},C.syncOffset=function(O){for(var w=Math.min(1e3,O.length-3*188),E=0;E<w;){if(O[E]===71&&O[E+188]===71&&O[E+2*188]===71)return E;E++}return-1},C.createTrack=function(O,w){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:p[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?w:void 0}};var x=C.prototype;return x.resetInitSegment=function(O,w,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=C.createTrack("video",E),this._audioTrack=C.createTrack("audio",E),this._id3Track=C.createTrack("id3",E),this._txtTrack=C.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=w,this._duration=E},x.resetTimeStamp=function(){},x.resetContiguity=function(){var O=this._audioTrack,w=this._avcTrack,E=this._id3Track;O&&(O.pesData=null),w&&(w.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(O,w,E,b){E===void 0&&(E=!1),b===void 0&&(b=!1),E||(this.sampleAes=null);var l,_=this._avcTrack,h=this._audioTrack,g=this._id3Track,T=_.pid,N=_.pesData,V=h.pid,Y=g.pid,U=h.pesData,A=g.pesData,J=!1,te=this.pmtParsed,se=this._pmtId,fe=O.length;if(this.remainderData&&(O=Object(I.appendUint8Array)(this.remainderData,O),fe=O.length,this.remainderData=null),fe<188&&!b)return this.remainderData=O,{audioTrack:h,avcTrack:_,id3Track:g,textTrack:this._txtTrack};var Ue=Math.max(0,C.syncOffset(O));fe-=(fe+Ue)%188,fe<O.byteLength&&!b&&(this.remainderData=new Uint8Array(O.buffer,fe,O.buffer.byteLength-fe));for(var Re=Ue;Re<fe;Re+=188)if(O[Re]===71){var De=!!(O[Re+1]&64),Fe=((O[Re+1]&31)<<8)+O[Re+2],Me=(O[Re+3]&48)>>4,ye=void 0;if(Me>1){if(ye=Re+5+O[Re+4],ye===Re+188)continue}else ye=Re+4;switch(Fe){case T:De&&(N&&(l=r(N))&&this.parseAVCPES(l,!1),N={data:[],size:0}),N&&(N.data.push(O.subarray(ye,Re+188)),N.size+=Re+188-ye);break;case V:De&&(U&&(l=r(U))&&(h.isAAC?this.parseAACPES(l):this.parseMPEGPES(l)),U={data:[],size:0}),U&&(U.data.push(O.subarray(ye,Re+188)),U.size+=Re+188-ye);break;case Y:De&&(A&&(l=r(A))&&this.parseID3PES(l),A={data:[],size:0}),A&&(A.data.push(O.subarray(ye,Re+188)),A.size+=Re+188-ye);break;case 0:De&&(ye+=O[ye]+1),se=this._pmtId=f(O,ye);break;case se:{De&&(ye+=O[ye]+1);var le=s(O,ye,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);T=le.avc,T>0&&(_.pid=T),V=le.audio,V>0&&(h.pid=V,h.isAAC=le.isAAC),Y=le.id3,Y>0&&(g.pid=Y),J&&!te&&(y.logger.log("reparse from beginning"),J=!1,Re=Ue-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:J=!0;break}}else this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=N,h.pesData=U,g.pesData=A;var Se={audioTrack:h,avcTrack:_,id3Track:g,textTrack:this._txtTrack};return b&&this.extractRemainingSamples(Se),Se},x.flush=function(){var O=this.remainderData;this.remainderData=null;var w;return O?w=this.demux(O,-1,!1,!0):w={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(w),this.sampleAes?this.decrypt(w,this.sampleAes):w},x.extractRemainingSamples=function(O){var w=O.audioTrack,E=O.avcTrack,b=O.id3Track,l=E.pesData,_=w.pesData,h=b.pesData,g;l&&(g=r(l))?(this.parseAVCPES(g,!0),E.pesData=null):E.pesData=l,_&&(g=r(_))?(w.isAAC?this.parseAACPES(g):this.parseMPEGPES(g),w.pesData=null):(_!=null&&_.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),w.pesData=_),h&&(g=r(h))?(this.parseID3PES(g),b.pesData=null):b.pesData=h},x.demuxSampleAes=function(O,w,E){var b=this.demux(O,E,!0,!this.config.progressive),l=this.sampleAes=new H.default(this.observer,this.config,w);return this.decrypt(b,l)},x.decrypt=function(O,w){return new Promise(function(E){var b=O.audioTrack,l=O.avcTrack;b.samples&&b.isAAC?w.decryptAacSamples(b.samples,0,function(){l.samples?w.decryptAvcSamples(l.samples,0,0,function(){E(O)}):E(O)}):l.samples&&w.decryptAvcSamples(l.samples,0,0,function(){E(O)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(O,w){var E=this,b=this._avcTrack,l=this.parseAVCNALu(O.data),_=!1,h=this.avcSample,g,T=!1;O.data=null,h&&l.length&&!b.audFound&&(a(h,b),h=this.avcSample=u(!1,O.pts,O.dts,"")),l.forEach(function(N){switch(N.type){case 1:{g=!0,h||(h=E.avcSample=u(!0,O.pts,O.dts,"")),_&&(h.debug+="NDR "),h.frame=!0;var V=N.data;if(T&&V.length>4){var Y=new F.default(V).readSliceType();(Y===2||Y===4||Y===7||Y===9)&&(h.key=!0)}break}case 5:g=!0,h||(h=E.avcSample=u(!0,O.pts,O.dts,"")),_&&(h.debug+="IDR "),h.key=!0,h.frame=!0;break;case 6:{g=!0,_&&h&&(h.debug+="SEI ");var U=new F.default(L(N.data));U.readUByte();for(var A=0,J=0,te=!1,se=0;!te&&U.bytesAvailable>1;){A=0;do se=U.readUByte(),A+=se;while(se===255);J=0;do se=U.readUByte(),J+=se;while(se===255);if(A===4&&U.bytesAvailable!==0){te=!0;var fe=U.readUByte();if(fe===181){var Ue=U.readUShort();if(Ue===49){var Re=U.readUInt();if(Re===1195456820){var De=U.readUByte();if(De===3){for(var Fe=U.readUByte(),Me=U.readUByte(),ye=31&Fe,le=[Fe,Me],Se=0;Se<ye;Se++)le.push(U.readUByte()),le.push(U.readUByte()),le.push(U.readUByte());d(E._txtTrack.samples,{type:3,pts:O.pts,bytes:le})}}}}}else if(A===5&&U.bytesAvailable!==0){if(te=!0,J>16){for(var ot=[],it=0;it<16;it++)ot.push(U.readUByte().toString(16)),(it===3||it===5||it===7||it===9)&&ot.push("-");for(var ct=J-16,xt=new Uint8Array(ct),Xe=0;Xe<ct;Xe++)xt[Xe]=U.readUByte();d(E._txtTrack.samples,{pts:O.pts,payloadType:A,uuid:ot.join(""),userData:Object(K.utf8ArrayToStr)(xt),userDataBytes:xt})}}else if(J<U.bytesAvailable)for(var qe=0;qe<J;qe++)U.readUByte()}break}case 7:if(g=!0,T=!0,_&&h&&(h.debug+="SPS "),!b.sps){var dt=new F.default(N.data),vt=dt.readSPS();b.width=vt.width,b.height=vt.height,b.pixelRatio=vt.pixelRatio,b.sps=[N.data],b.duration=E._duration;for(var st=N.data.subarray(1,4),tt="avc1.",rt=0;rt<3;rt++){var Bt=st[rt].toString(16);Bt.length<2&&(Bt="0"+Bt),tt+=Bt}b.codec=tt}break;case 8:g=!0,_&&h&&(h.debug+="PPS "),b.pps||(b.pps=[N.data]);break;case 9:g=!1,b.audFound=!0,h&&a(h,b),h=E.avcSample=u(!1,O.pts,O.dts,_?"AUD ":"");break;case 12:g=!1;break;default:g=!1,h&&(h.debug+="unknown NAL "+N.type+" ");break}if(h&&g){var Pt=h.units;Pt.push(N)}}),w&&h&&(a(h,b),this.avcSample=null)},x.getLastNalUnit=function(){var O,w=this.avcSample,E;if(!w||w.units.length===0){var b=this._avcTrack.samples;w=b[b.length-1]}if((O=w)!==null&&O!==void 0&&O.units){var l=w.units;E=l[l.length-1]}return E},x.parseAVCNALu=function(O){var w=O.byteLength,E=this._avcTrack,b=E.naluState||0,l=b,_=[],h=0,g,T,N,V=-1,Y=0;for(b===-1&&(V=0,Y=O[0]&31,b=0,h=1);h<w;){if(g=O[h++],!b){b=g?0:1;continue}if(b===1){b=g?0:2;continue}if(!g)b=3;else if(g===1){if(V>=0){var U={data:O.subarray(V,h-b-1),type:Y};_.push(U)}else{var A=this.getLastNalUnit();if(A&&(l&&h<=4-l&&(A.state&&(A.data=A.data.subarray(0,A.data.byteLength-l))),T=h-b-1,T>0)){var J=new Uint8Array(A.data.byteLength+T);J.set(A.data,0),J.set(O.subarray(0,T),A.data.byteLength),A.data=J,A.state=0}}h<w?(N=O[h]&31,V=h,Y=N,b=0):b=-1}else b=0}if(V>=0&&b>=0){var te={data:O.subarray(V,w),type:Y,state:b};_.push(te)}if(_.length===0){var se=this.getLastNalUnit();if(se){var fe=new Uint8Array(se.data.byteLength+O.byteLength);fe.set(se.data,0),fe.set(O,se.data.byteLength),se.data=fe}}return E.naluState=b,_},x.parseAACPES=function(O){var w=0,E=this._audioTrack,b=this.aacOverFlow,l=O.data;if(b){this.aacOverFlow=null;var _=b.sample.unit.byteLength,h=Math.min(b.missing,_),g=_-h;b.sample.unit.set(l.subarray(0,h),g),E.samples.push(b.sample),w=b.missing}var T,N;for(T=w,N=l.length;T<N-1&&!X.isHeader(l,T);T++);if(T!==w){var V,Y;if(T<N-1?(V="AAC PES did not start with ADTS header,offset:"+T,Y=!1):(V="no ADTS header found in AAC PES",Y=!0),y.logger.warn("parsing error:"+V),this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:Y,reason:V}),Y)return}X.initTrackConfig(E,this.observer,l,T,this.audioCodec);var U;if(O.pts!==void 0)U=O.pts;else if(b){var A=X.getFrameDuration(E.samplerate);U=b.sample.pts+A}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var J=0;T<N;)if(X.isHeader(l,T)){if(T+5<N){var te=X.appendFrame(E,l,T,U,J);if(te)if(te.missing)this.aacOverFlow=te;else{T+=te.length,J++;continue}}break}else T++},x.parseMPEGPES=function(O){var w=O.data,E=w.length,b=0,l=0,_=O.pts;if(_===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;l<E;)if(D.isHeader(w,l)){var h=D.appendFrame(this._audioTrack,w,l,_,b);if(h)l+=h.length,b++;else break}else l++},x.parseID3PES=function(O){if(O.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},C}();c.minProbeByteLength=188;function u(C,x,R,O){return{key:C,frame:!1,pts:x,dts:R,units:[],debug:O,length:0}}function f(C,x){return(C[x+10]&31)<<8|C[x+11]}function s(C,x,R,O){var w={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(C[x+1]&15)<<8|C[x+2],b=x+3+E-4,l=(C[x+10]&15)<<8|C[x+11];for(x+=12+l;x<b;){var _=(C[x+1]&31)<<8|C[x+2];switch(C[x]){case 207:if(!O){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:w.audio===-1&&(w.audio=_);break;case 21:w.id3===-1&&(w.id3=_);break;case 219:if(!O){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:w.avc===-1&&(w.avc=_);break;case 3:case 4:R?w.audio===-1&&(w.audio=_,w.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((C[x+3]&15)<<8|C[x+4])+5}return w}function r(C){var x=0,R,O,w,E,b,l=C.data;if(!C||C.size===0)return null;for(;l[0].length<19&&l.length>1;){var _=new Uint8Array(l[0].length+l[1].length);_.set(l[0]),_.set(l[1],l[0].length),l[0]=_,l.splice(1,1)}R=l[0];var h=(R[0]<<16)+(R[1]<<8)+R[2];if(h===1){if(O=(R[4]<<8)+R[5],O&&O>C.size-6)return null;var g=R[7];g&192&&(E=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,g&64?(b=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,E-b>60*9e4&&(y.logger.warn(Math.round((E-b)/9e4)+"s delta between PTS and DTS, align them"),E=b)):b=E),w=R[8];var T=w+9;if(C.size<=T)return null;C.size-=T;for(var N=new Uint8Array(C.size),V=0,Y=l.length;V<Y;V++){R=l[V];var U=R.byteLength;if(T)if(T>U){T-=U;continue}else R=R.subarray(T),U-=T,T=0;N.set(R,x),x+=U}return O&&(O-=w+3),{data:N,pts:E,dts:b,len:O}}return null}function a(C,x){if(C.units.length&&C.frame){if(C.pts===void 0){var R=x.samples,O=R.length;if(O){var w=R[O-1];C.pts=w.pts,C.dts=w.dts}else{x.dropped++;return}}x.samples.push(C)}C.debug.length&&y.logger.log(C.pts+"/"+C.dts+":"+C.debug)}function d(C,x){var R=C.length;if(R>0){if(x.pts>=C[R-1].pts)C.push(x);else for(var O=R-1;O>=0;O--)if(x.pts<C[O].pts){C.splice(O,0,x);break}}else C.push(x)}function L(C){for(var x=C.byteLength,R=[],O=1;O<x-2;)C[O]===0&&C[O+1]===0&&C[O+2]===3?(R.push(O+2),O+=2):O++;if(R.length===0)return C;var w=x-R.length,E=new Uint8Array(w),b=0;for(O=0;O<w;b++,O++)b===R[0]&&(b++,R.shift()),E[O]=C[b];return E}j.default=c},"./src/errors.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"ErrorTypes",function(){return X}),M.d(j,"ErrorDetails",function(){return D});var X;(function(F){F.NETWORK_ERROR="networkError",F.MEDIA_ERROR="mediaError",F.KEY_SYSTEM_ERROR="keySystemError",F.MUX_ERROR="muxError",F.OTHER_ERROR="otherError"})(X||(X={}));var D;(function(F){F.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",F.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",F.KEY_SYSTEM_NO_SESSION="keySystemNoSession",F.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",F.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",F.MANIFEST_LOAD_ERROR="manifestLoadError",F.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",F.MANIFEST_PARSING_ERROR="manifestParsingError",F.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",F.LEVEL_EMPTY_ERROR="levelEmptyError",F.LEVEL_LOAD_ERROR="levelLoadError",F.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",F.LEVEL_SWITCH_ERROR="levelSwitchError",F.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",F.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",F.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",F.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",F.FRAG_LOAD_ERROR="fragLoadError",F.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",F.FRAG_DECRYPT_ERROR="fragDecryptError",F.FRAG_PARSING_ERROR="fragParsingError",F.REMUX_ALLOC_ERROR="remuxAllocError",F.KEY_LOAD_ERROR="keyLoadError",F.KEY_LOAD_TIMEOUT="keyLoadTimeOut",F.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",F.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",F.BUFFER_APPEND_ERROR="bufferAppendError",F.BUFFER_APPENDING_ERROR="bufferAppendingError",F.BUFFER_STALLED_ERROR="bufferStalledError",F.BUFFER_FULL_ERROR="bufferFullError",F.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",F.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",F.INTERNAL_EXCEPTION="internalException",F.INTERNAL_ABORTED="aborted",F.UNKNOWN="unknown"})(D||(D={}))},"./src/events.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"Events",function(){return X});var X;(function(D){D.MEDIA_ATTACHING="hlsMediaAttaching",D.MEDIA_ATTACHED="hlsMediaAttached",D.MEDIA_DETACHING="hlsMediaDetaching",D.MEDIA_DETACHED="hlsMediaDetached",D.BUFFER_RESET="hlsBufferReset",D.BUFFER_CODECS="hlsBufferCodecs",D.BUFFER_CREATED="hlsBufferCreated",D.BUFFER_APPENDING="hlsBufferAppending",D.BUFFER_APPENDED="hlsBufferAppended",D.BUFFER_EOS="hlsBufferEos",D.BUFFER_FLUSHING="hlsBufferFlushing",D.BUFFER_FLUSHED="hlsBufferFlushed",D.MANIFEST_LOADING="hlsManifestLoading",D.MANIFEST_LOADED="hlsManifestLoaded",D.MANIFEST_PARSED="hlsManifestParsed",D.LEVEL_SWITCHING="hlsLevelSwitching",D.LEVEL_SWITCHED="hlsLevelSwitched",D.LEVEL_LOADING="hlsLevelLoading",D.LEVEL_LOADED="hlsLevelLoaded",D.LEVEL_UPDATED="hlsLevelUpdated",D.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",D.LEVELS_UPDATED="hlsLevelsUpdated",D.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",D.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",D.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",D.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",D.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",D.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",D.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",D.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",D.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",D.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",D.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",D.CUES_PARSED="hlsCuesParsed",D.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",D.INIT_PTS_FOUND="hlsInitPtsFound",D.FRAG_LOADING="hlsFragLoading",D.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",D.FRAG_LOADED="hlsFragLoaded",D.FRAG_DECRYPTED="hlsFragDecrypted",D.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",D.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",D.FRAG_PARSING_METADATA="hlsFragParsingMetadata",D.FRAG_PARSED="hlsFragParsed",D.FRAG_BUFFERED="hlsFragBuffered",D.FRAG_CHANGED="hlsFragChanged",D.FPS_DROP="hlsFpsDrop",D.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",D.ERROR="hlsError",D.DESTROYING="hlsDestroying",D.KEY_LOADING="hlsKeyLoading",D.KEY_LOADED="hlsKeyLoaded",D.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",D.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return C});var X=M("./node_modules/url-toolkit/src/url-toolkit.js"),D=M.n(X),F=M("./src/loader/playlist-loader.ts"),K=M("./src/loader/key-loader.ts"),H=M("./src/controller/id3-track-controller.ts"),P=M("./src/controller/latency-controller.ts"),I=M("./src/controller/level-controller.ts"),y=M("./src/controller/fragment-tracker.ts"),m=M("./src/controller/stream-controller.ts"),p=M("./src/is-supported.ts"),c=M("./src/utils/logger.ts"),u=M("./src/config.ts"),f=M("./node_modules/eventemitter3/index.js"),s=M.n(f),r=M("./src/events.ts"),a=M("./src/errors.ts");function d(x,R){for(var O=0;O<R.length;O++){var w=R[O];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(x,w.key,w)}}function L(x,R,O){return R&&d(x.prototype,R),O&&d(x,O),x}var C=function(){x.isSupported=function(){return Object(p.isSupported)()};function x(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new f.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var w=this.config=Object(u.mergeConfig)(x.DefaultConfig,O);this.userConfig=O,Object(c.enableLogs)(w.debug),this._autoLevelCapping=-1,w.progressive&&Object(u.enableStreamingMode)(w);var E=w.abrController,b=w.bufferController,l=w.capLevelController,_=w.fpsController,h=this.abrController=new E(this),g=this.bufferController=new b(this),T=this.capLevelController=new l(this),N=new _(this),V=new F.default(this),Y=new K.default(this),U=new H.default(this),A=this.levelController=new I.default(this),J=new y.FragmentTracker(this),te=this.streamController=new m.default(this,J);T.setStreamController(te),N.setStreamController(te);var se=[A,te];this.networkControllers=se;var fe=[V,Y,h,g,T,N,U,J];this.audioTrackController=this.createController(w.audioTrackController,null,se),this.createController(w.audioStreamController,J,se),this.subtitleTrackController=this.createController(w.subtitleTrackController,null,se),this.createController(w.subtitleStreamController,J,se),this.createController(w.timelineController,null,fe),this.emeController=this.createController(w.emeController,null,fe),this.cmcdController=this.createController(w.cmcdController,null,fe),this.latencyController=this.createController(P.default,null,fe),this.coreComponents=fe}var R=x.prototype;return R.createController=function(w,E,b){if(w){var l=E?new w(this,E):new w(this);return b&&b.push(l),l}return null},R.on=function(w,E,b){b===void 0&&(b=this),this._emitter.on(w,E,b)},R.once=function(w,E,b){b===void 0&&(b=this),this._emitter.once(w,E,b)},R.removeAllListeners=function(w){this._emitter.removeAllListeners(w)},R.off=function(w,E,b,l){b===void 0&&(b=this),this._emitter.off(w,E,b,l)},R.listeners=function(w){return this._emitter.listeners(w)},R.emit=function(w,E,b){return this._emitter.emit(w,E,b)},R.trigger=function(w,E){if(this.config.debug)return this.emit(w,w,E);try{return this.emit(w,w,E)}catch(b){c.logger.error("An internal error happened while handling event "+w+'. Error message: "'+b.message+'". Here is a stacktrace:',b),this.trigger(r.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:w,error:b})}return!1},R.listenerCount=function(w){return this._emitter.listenerCount(w)},R.destroy=function(){c.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(w){return w.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(w){return w.destroy()}),this.coreComponents.length=0},R.attachMedia=function(w){c.logger.log("attachMedia"),this._media=w,this.trigger(r.Events.MEDIA_ATTACHING,{media:w})},R.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(w){this.stopLoad();var E=this.media,b=this.url,l=this.url=X.buildAbsoluteURL(self.location.href,w,{alwaysNormalize:!0});c.logger.log("loadSource:"+l),E&&b&&b!==l&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(r.Events.MANIFEST_LOADING,{url:w})},R.startLoad=function(w){w===void 0&&(w=-1),c.logger.log("startLoad("+w+")"),this.networkControllers.forEach(function(E){E.startLoad(w)})},R.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(w){w.stopLoad()})},R.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){c.logger.log("recoverMediaError");var w=this._media;this.detachMedia(),w&&this.attachMedia(w)},R.removeLevel=function(w,E){E===void 0&&(E=0),this.levelController.removeLevel(w,E)},L(x,[{key:"levels",get:function(){var w=this.levelController.levels;return w||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(w){c.logger.log("set currentLevel:"+w),this.loadLevel=w,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(w){c.logger.log("set nextLevel:"+w),this.levelController.manualLevel=w,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(w){c.logger.log("set loadLevel:"+w),this.levelController.manualLevel=w}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(w){this.levelController.nextLoadLevel=w}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(w){c.logger.log("set firstLevel:"+w),this.levelController.firstLevel=w}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(w){c.logger.log("set startLevel:"+w),w!==-1&&(w=Math.max(w,this.minAutoLevel)),this.levelController.startLevel=w}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(w){var E=!!w;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(w){this._autoLevelCapping!==w&&(c.logger.log("set autoLevelCapping:"+w),this._autoLevelCapping=w)}},{key:"bandwidthEstimate",get:function(){var w=this.abrController.bwEstimator;return w?w.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var w=this.levels,E=this.config.minAutoBitrate;if(!w)return 0;for(var b=w.length,l=0;l<b;l++)if(w[l].maxBitrate>E)return l;return 0}},{key:"maxAutoLevel",get:function(){var w=this.levels,E=this.autoLevelCapping,b;return E===-1&&w&&w.length?b=w.length-1:b=E,b}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(w){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,w)}},{key:"audioTracks",get:function(){var w=this.audioTrackController;return w?w.audioTracks:[]}},{key:"audioTrack",get:function(){var w=this.audioTrackController;return w?w.audioTrack:-1},set:function(w){var E=this.audioTrackController;E&&(E.audioTrack=w)}},{key:"subtitleTracks",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTrack:-1},set:function(w){var E=this.subtitleTrackController;E&&(E.subtitleTrack=w)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var w=this.subtitleTrackController;return w?w.subtitleDisplay:!1},set:function(w){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=w)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(w){this.config.lowLatencyMode=w}},{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 a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:u.hlsDefaultConfig},set:function(w){x.defaultConfig=w}}]),x}();C.defaultConfig=void 0},"./src/is-supported.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"isSupported",function(){return F}),M.d(j,"changeTypeSupported",function(){return K});var X=M("./src/utils/mediasource-helper.ts");function D(){return self.SourceBuffer||self.WebKitSourceBuffer}function F(){var H=Object(X.getMediaSource)();if(!H)return!1;var P=D(),I=H&&typeof H.isTypeSupported=="function"&&H.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!P||P.prototype&&typeof P.prototype.appendBuffer=="function"&&typeof P.prototype.remove=="function";return!!I&&!!y}function K(){var H,P=D();return typeof(P==null||((H=P.prototype)===null||H===void 0)?void 0:H.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return c}),M.d(j,"LoadError",function(){return f});var X=M("./src/polyfills/number.ts"),D=M("./src/errors.ts");function F(s,r){s.prototype=Object.create(r.prototype),s.prototype.constructor=s,y(s,r)}function K(s){var r=typeof Map=="function"?new Map:void 0;return K=function(d){if(d===null||!I(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(d))return r.get(d);r.set(d,L)}function L(){return H(d,arguments,m(this).constructor)}return L.prototype=Object.create(d.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),y(L,d)},K(s)}function H(s,r,a){return P()?H=Reflect.construct:H=function(L,C,x){var R=[null];R.push.apply(R,C);var O=Function.bind.apply(L,R),w=new O;return x&&y(w,x.prototype),w},H.apply(null,arguments)}function P(){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 I(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function y(s,r){return y=Object.setPrototypeOf||function(d,L){return d.__proto__=L,d},y(s,r)}function m(s){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},m(s)}var p=Math.pow(2,17),c=function(){function s(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}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(d,L){var C=this,x=d.url;if(!x)return Promise.reject(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var R=this.config,O=R.fLoader,w=R.loader;return new Promise(function(E,b){C.loader&&C.loader.destroy();var l=C.loader=d.loader=O?new O(R):new w(R),_=u(d),h={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:p};d.stats=l.stats,l.load(_,h,{onSuccess:function(T,N,V,Y){C.resetLoader(d,l),E({frag:d,part:null,payload:T.data,networkDetails:Y})},onError:function(T,N,V){C.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:T,networkDetails:V}))},onAbort:function(T,N,V){C.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:V}))},onTimeout:function(T,N,V){C.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:V}))},onProgress:function(T,N,V,Y){L&&L({frag:d,part:null,payload:V,networkDetails:Y})}})})},r.loadPart=function(d,L,C){var x=this;this.abort();var R=this.config,O=R.fLoader,w=R.loader;return new Promise(function(E,b){x.loader&&x.loader.destroy();var l=x.loader=d.loader=O?new O(R):new w(R),_=u(d,L),h={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:p};L.stats=l.stats,l.load(_,h,{onSuccess:function(T,N,V,Y){x.resetLoader(d,l),x.updateStatsFromPart(d,L);var U={frag:d,part:L,payload:T.data,networkDetails:Y};C(U),E(U)},onError:function(T,N,V){x.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:L,response:T,networkDetails:V}))},onAbort:function(T,N,V){d.stats.aborted=L.stats.aborted,x.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:L,networkDetails:V}))},onTimeout:function(T,N,V){x.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:L,networkDetails:V}))}})})},r.updateStatsFromPart=function(d,L){var C=d.stats,x=L.stats,R=x.total;if(C.loaded+=x.loaded,R){var O=Math.round(d.duration/L.duration),w=Math.min(Math.round(C.loaded/R),O),E=O-w,b=E*Math.round(C.loaded/w);C.total=C.loaded+b}else C.total=Math.max(C.loaded,C.total);var l=C.loading,_=x.loading;l.start?l.first+=_.first-_.start:(l.start=_.start,l.first=_.first),l.end=_.end},r.resetLoader=function(d,L){d.loader=null,this.loader===L&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),L.destroy()},s}();function u(s,r){r===void 0&&(r=null);var a=r||s,d={frag:s,part:r,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},L=a.byteRangeStartOffset,C=a.byteRangeEndOffset;return Object(X.isFiniteNumber)(L)&&Object(X.isFiniteNumber)(C)&&(d.rangeStart=L,d.rangeEnd=C),d}var f=function(s){F(r,s);function r(a){for(var d,L=arguments.length,C=new Array(L>1?L-1:0),x=1;x<L;x++)C[x-1]=arguments[x];return d=s.call.apply(s,[this].concat(C))||this,d.data=void 0,d.data=a,d}return r}(K(Error))},"./src/loader/fragment.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"ElementaryStreamTypes",function(){return c}),M.d(j,"BaseSegment",function(){return u}),M.d(j,"Fragment",function(){return f}),M.d(j,"Part",function(){return s});var X=M("./src/polyfills/number.ts"),D=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(D),K=M("./src/utils/logger.ts"),H=M("./src/loader/level-key.ts"),P=M("./src/loader/load-stats.ts");function I(r,a){r.prototype=Object.create(a.prototype),r.prototype.constructor=r,y(r,a)}function y(r,a){return y=Object.setPrototypeOf||function(L,C){return L.__proto__=C,L},y(r,a)}function m(r,a){for(var d=0;d<a.length;d++){var L=a[d];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(r,L.key,L)}}function p(r,a,d){return a&&m(r.prototype,a),d&&m(r,d),r}var c;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(c||(c={}));var u=function(){function r(d){var L;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(L={},L[c.AUDIO]=null,L[c.VIDEO]=null,L[c.AUDIOVIDEO]=null,L),this.baseurl=d}var a=r.prototype;return a.setByteRange=function(L,C){var x=L.split("@",2),R=[];x.length===1?R[0]=C?C.byteRangeEndOffset:0:R[0]=parseInt(x[1]),R[1]=parseInt(x[0])+R[0],this._byteRange=R},p(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(D.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(L){this._url=L}}]),r}(),f=function(r){I(a,r);function a(L,C){var x;return x=r.call(this,C)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new P.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=L,x}var d=a.prototype;return d.createInitializationVector=function(C){for(var x=new Uint8Array(16),R=12;R<16;R++)x[R]=C>>8*(15-R)&255;return x},d.setDecryptDataFromLevelKey=function(C,x){var R=C;return(C==null?void 0:C.method)==="AES-128"&&C.uri&&!C.iv&&(R=H.LevelKey.fromURI(C.uri),R.method=C.method,R.iv=this.createInitializationVector(x),R.keyFormat="identity"),R},d.setElementaryStreamInfo=function(C,x,R,O,w,E){E===void 0&&(E=!1);var b=this.elementaryStreams,l=b[C];if(!l){b[C]={startPTS:x,endPTS:R,startDTS:O,endDTS:w,partial:E};return}l.startPTS=Math.min(l.startPTS,x),l.endPTS=Math.max(l.endPTS,R),l.startDTS=Math.min(l.startDTS,O),l.endDTS=Math.max(l.endDTS,w)},d.clearElementaryStreamInfo=function(){var C=this.elementaryStreams;C[c.AUDIO]=null,C[c.VIDEO]=null,C[c.AUDIOVIDEO]=null},p(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var C=this.sn;typeof C!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),C=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,C)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var C=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+C*1e3}},{key:"encrypted",get:function(){var C;return!!((C=this.decryptdata)!==null&&C!==void 0&&C.keyFormat&&this.decryptdata.uri)}}]),a}(u),s=function(r){I(a,r);function a(d,L,C,x,R){var O;O=r.call(this,C)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new P.LoadStats,O.duration=d.decimalFloatingPoint("DURATION"),O.gap=d.bool("GAP"),O.independent=d.bool("INDEPENDENT"),O.relurl=d.enumeratedString("URI"),O.fragment=L,O.index=x;var w=d.enumeratedString("BYTERANGE");return w&&O.setByteRange(w,R),R&&(O.fragOffset=R.fragOffset+R.duration),O}return p(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var L=this.elementaryStreams;return!!(L.audio||L.video||L.audiovideo)}}]),a}(u)},"./src/loader/key-loader.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return K});var X=M("./src/events.ts"),D=M("./src/errors.ts"),F=M("./src/utils/logger.ts"),K=function(){function H(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var P=H.prototype;return P._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},P._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},P.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var m=this.loaders[y];m&&m.destroy()}this.loaders={}},P.onKeyLoading=function(y,m){var p=m.frag,c=p.type,u=this.loaders[c];if(!p.decryptdata){F.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=p.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(u&&(F.logger.warn("abort previous key loader for type:"+c),u.abort()),!f){F.logger.warn("key uri is falsy");return}var r=s.loader,a=p.loader=this.loaders[c]=new r(s);this.decrypturl=f,this.decryptkey=null;var d={url:f,frag:p,responseType:"arraybuffer"},L={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},C={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(d,L,C)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:p}))},P.loadsuccess=function(y,m,p){var c=p.frag;if(!c.decryptdata){F.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(y.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:c})},P.loaderror=function(y,m){var p=m.frag,c=p.loader;c&&c.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:y})},P.loadtimeout=function(y,m){var p=m.frag,c=p.loader;c&&c.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},H}()},"./src/loader/level-details.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"LevelDetails",function(){return H});var X=M("./src/polyfills/number.ts");function D(P,I){for(var y=0;y<I.length;y++){var m=I[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function F(P,I,y){return I&&D(P.prototype,I),y&&D(P,y),P}var K=10,H=function(){function P(y){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=y}var I=P.prototype;return I.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-m.lastPartSn,c=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!c||!!p,this.advanced=this.endSN>m.endSN||p>0||p===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},F(P,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.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 m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),P}()},"./src/loader/level-key.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"LevelKey",function(){return H});var X=M("./node_modules/url-toolkit/src/url-toolkit.js"),D=M.n(X);function F(P,I){for(var y=0;y<I.length;y++){var m=I[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function K(P,I,y){return I&&F(P.prototype,I),y&&F(P,y),P}var H=function(){P.fromURL=function(y,m){return new P(y,m)},P.fromURI=function(y){return new P(y)};function P(I,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object(X.buildAbsoluteURL)(I,y,{alwaysNormalize:!0}):this._uri=I}return K(P,[{key:"uri",get:function(){return this._uri}}]),P}()},"./src/loader/load-stats.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"LoadStats",function(){return X});var X=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return a});var X=M("./src/polyfills/number.ts"),D=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(D),K=M("./src/loader/fragment.ts"),H=M("./src/loader/level-details.ts"),P=M("./src/loader/level-key.ts"),I=M("./src/utils/attr-list.ts"),y=M("./src/utils/logger.ts"),m=M("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,c=/#EXT-X-MEDIA:(.*)/g,u=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),f=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function r(R){var O,w;return s.test((O=(w=D.parseURL(R))===null||w===void 0?void 0:w.path)!=null?O:"")}var a=function(){function R(){}return R.findGroup=function(w,E){for(var b=0;b<w.length;b++){var l=w[b];if(l.id===E)return l}},R.convertAVC1ToAVCOTI=function(w){var E=w.split(".");if(E.length>2){var b=E.shift()+".";return b+=parseInt(E.shift()).toString(16),b+=("000"+parseInt(E.shift()).toString(16)).substr(-4),b}return w},R.resolve=function(w,E){return D.buildAbsoluteURL(E,w,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(w,E){var b=[],l={},_=!1;p.lastIndex=0;for(var h;(h=p.exec(w))!=null;)if(h[1]){var g=new I.AttrList(h[1]),T={attrs:g,bitrate:g.decimalInteger("AVERAGE-BANDWIDTH")||g.decimalInteger("BANDWIDTH"),name:g.NAME,url:R.resolve(h[2],E)},N=g.decimalResolution("RESOLUTION");N&&(T.width=N.width,T.height=N.height),d((g.CODECS||"").split(/[ ,]+/).filter(function(Y){return Y}),T),T.videoCodec&&T.videoCodec.indexOf("avc1")!==-1&&(T.videoCodec=R.convertAVC1ToAVCOTI(T.videoCodec)),b.push(T)}else if(h[3]){var V=new I.AttrList(h[3]);V["DATA-ID"]&&(_=!0,l[V["DATA-ID"]]=V)}return{levels:b,sessionData:_?l:null}},R.parseMasterPlaylistMedia=function(w,E,b,l){l===void 0&&(l=[]);var _,h=[],g=0;for(c.lastIndex=0;(_=c.exec(w))!==null;){var T=new I.AttrList(_[1]);if(T.TYPE===b){var N={attrs:T,bitrate:0,id:g++,groupId:T["GROUP-ID"],instreamId:T["INSTREAM-ID"],name:T.NAME||T.LANGUAGE||"",type:b,default:T.bool("DEFAULT"),autoselect:T.bool("AUTOSELECT"),forced:T.bool("FORCED"),lang:T.LANGUAGE,url:T.URI?R.resolve(T.URI,E):""};if(l.length){var V=R.findGroup(l,N.groupId)||l[0];L(N,V,"audioCodec"),L(N,V,"textCodec")}h.push(N)}}return h},R.parseLevelPlaylist=function(w,E,b,l,_){var h=new H.LevelDetails(E),g=h.fragments,T=null,N=0,V=0,Y=0,U=0,A=null,J=new K.Fragment(l,E),te,se,fe,Ue=-1,Re=!1;for(u.lastIndex=0,h.m3u8=w;(te=u.exec(w))!==null;){Re&&(Re=!1,J=new K.Fragment(l,E),J.start=Y,J.sn=N,J.cc=U,J.level=b,T&&(J.initSegment=T,J.rawProgramDateTime=T.rawProgramDateTime));var De=te[1];if(De){J.duration=parseFloat(De);var Fe=(" "+te[2]).slice(1);J.title=Fe||null,J.tagList.push(Fe?["INF",De,Fe]:["INF",De])}else if(te[3])Object(X.isFiniteNumber)(J.duration)&&(J.start=Y,fe&&(J.levelkey=fe),J.sn=N,J.level=b,J.cc=U,J.urlId=_,g.push(J),J.relurl=(" "+te[3]).slice(1),x(J,A),A=J,Y+=J.duration,N++,V=0,Re=!0);else if(te[4]){var Me=(" "+te[4]).slice(1);A?J.setByteRange(Me,A):J.setByteRange(Me)}else if(te[5])J.rawProgramDateTime=(" "+te[5]).slice(1),J.tagList.push(["PROGRAM-DATE-TIME",J.rawProgramDateTime]),Ue===-1&&(Ue=g.length);else{if(te=te[0].match(f),!te){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(se=1;se<te.length&&!(typeof te[se]!="undefined");se++);var ye=(" "+te[se]).slice(1),le=(" "+te[se+1]).slice(1),Se=te[se+2]?(" "+te[se+2]).slice(1):"";switch(ye){case"PLAYLIST-TYPE":h.type=le.toUpperCase();break;case"MEDIA-SEQUENCE":N=h.startSN=parseInt(le);break;case"SKIP":{var ot=new I.AttrList(le),it=ot.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(it)){h.skippedSegments=it;for(var ct=it;ct--;)g.unshift(null);N+=it}var xt=ot.enumeratedString("RECENTLY-REMOVED-DATERANGES");xt&&(h.recentlyRemovedDateranges=xt.split(" "));break}case"TARGETDURATION":h.targetduration=parseFloat(le);break;case"VERSION":h.version=parseInt(le);break;case"EXTM3U":break;case"ENDLIST":h.live=!1;break;case"#":(le||Se)&&J.tagList.push(Se?[le,Se]:[le]);break;case"DIS":U++;case"GAP":J.tagList.push([ye]);break;case"BITRATE":J.tagList.push([ye,le]);break;case"DISCONTINUITY-SEQ":U=parseInt(le);break;case"KEY":{var Xe,qe=new I.AttrList(le),dt=qe.enumeratedString("METHOD"),vt=qe.URI,st=qe.hexadecimalInteger("IV"),tt=qe.enumeratedString("KEYFORMATVERSIONS"),rt=qe.enumeratedString("KEYID"),Bt=(Xe=qe.enumeratedString("KEYFORMAT"))!=null?Xe:"identity",Pt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Pt.indexOf(Bt)>-1){y.logger.warn("Keyformat "+Bt+" is not supported from the manifest");continue}else if(Bt!=="identity")continue;dt&&(fe=P.LevelKey.fromURL(E,vt),vt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(dt)>=0&&(fe.method=dt,fe.keyFormat=Bt,rt&&(fe.keyID=rt),tt&&(fe.keyFormatVersions=tt),fe.iv=st));break}case"START":{var Ct=new I.AttrList(le),_t=Ct.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(_t)&&(h.startTimeOffset=_t);break}case"MAP":{var Vt=new I.AttrList(le);J.relurl=Vt.URI,Vt.BYTERANGE&&J.setByteRange(Vt.BYTERANGE),J.level=b,J.sn="initSegment",fe&&(J.levelkey=fe),J.initSegment=null,T=J,Re=!0;break}case"SERVER-CONTROL":{var Ot=new I.AttrList(le);h.canBlockReload=Ot.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=Ot.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&Ot.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=Ot.optionalFloat("PART-HOLD-BACK",0),h.holdBack=Ot.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Rt=new I.AttrList(le);h.partTarget=Rt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ve=h.partList;Ve||(Ve=h.partList=[]);var Xt=V>0?Ve[Ve.length-1]:void 0,At=V++,ze=new K.Part(new I.AttrList(le),J,E,At,Xt);Ve.push(ze),J.duration+=ze.duration;break}case"PRELOAD-HINT":{var at=new I.AttrList(le);h.preloadHint=at;break}case"RENDITION-REPORT":{var Ae=new I.AttrList(le);h.renditionReports=h.renditionReports||[],h.renditionReports.push(Ae);break}default:y.logger.warn("line parsed but not handled: "+te);break}}}A&&!A.relurl?(g.pop(),Y-=A.duration,h.partList&&(h.fragmentHint=A)):h.partList&&(x(J,A),J.cc=U,h.fragmentHint=J);var _e=g.length,xe=g[0],re=g[_e-1];if(Y+=h.skippedSegments*h.targetduration,Y>0&&_e&&re){h.averagetargetduration=Y/_e;var ae=re.sn;h.endSN=ae!=="initSegment"?ae:0,xe&&(h.startCC=xe.cc,xe.initSegment||h.fragments.every(function(he){return he.relurl&&r(he.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),J=new K.Fragment(l,E),J.relurl=re.relurl,J.level=b,J.sn="initSegment",xe.initSegment=J,h.needSidxRanges=!0))}else h.endSN=0,h.startCC=0;return h.fragmentHint&&(Y+=h.fragmentHint.duration),h.totalduration=Y,h.endCC=U,Ue>0&&C(g,Ue),h},R}();function d(R,O){["video","audio","text"].forEach(function(w){var E=R.filter(function(l){return Object(m.isCodecType)(l,w)});if(E.length){var b=E.filter(function(l){return l.lastIndexOf("avc1",0)===0||l.lastIndexOf("mp4a",0)===0});O[w+"Codec"]=b.length>0?b[0]:E[0],R=R.filter(function(l){return E.indexOf(l)===-1})}}),O.unknownCodecs=R}function L(R,O,w){var E=O[w];E&&(R[w]=E)}function C(R,O){for(var w=R[O],E=O;E--;){var b=R[E];if(!b)return;b.programDateTime=w.programDateTime-b.duration*1e3,w=b}}function x(R,O){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):O!=null&&O.programDateTime&&(R.programDateTime=O.endProgramDateTime),Object(X.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/polyfills/number.ts"),D=M("./src/events.ts"),F=M("./src/errors.ts"),K=M("./src/utils/logger.ts"),H=M("./src/utils/mp4-tools.ts"),P=M("./src/loader/m3u8-parser.ts"),I=M("./src/types/loader.ts"),y=M("./src/utils/attr-list.ts");function m(u){var f=u.type;switch(f){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function p(u,f){var s=u.url;return(s===void 0||s.indexOf("data:")===0)&&(s=f.url),s}var c=function(){function u(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var f=u.prototype;return f.registerListeners=function(){var r=this.hls;r.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var r=this.hls;r.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(r){var a=this.hls.config,d=a.pLoader,L=a.loader,C=d||L,x=new C(a);return r.loader=x,this.loaders[r.type]=x,x},f.getInternalLoader=function(r){return this.loaders[r.type]},f.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},f.destroyInternalLoaders=function(){for(var r in this.loaders){var a=this.loaders[r];a&&a.destroy(),this.resetInternalLoader(r)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(r,a){var d=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},f.onLevelLoading=function(r,a){var d=a.id,L=a.level,C=a.url,x=a.deliveryDirectives;this.load({id:d,groupId:null,level:L,responseType:"text",type:I.PlaylistContextType.LEVEL,url:C,deliveryDirectives:x})},f.onAudioTrackLoading=function(r,a){var d=a.id,L=a.groupId,C=a.url,x=a.deliveryDirectives;this.load({id:d,groupId:L,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:C,deliveryDirectives:x})},f.onSubtitleTrackLoading=function(r,a){var d=a.id,L=a.groupId,C=a.url,x=a.deliveryDirectives;this.load({id:d,groupId:L,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:C,deliveryDirectives:x})},f.load=function(r){var a,d=this.hls.config,L=this.getInternalLoader(r);if(L){var C=L.context;if(C&&C.url===r.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),L.abort()}var x,R,O,w;switch(r.type){case I.PlaylistContextType.MANIFEST:x=d.manifestLoadingMaxRetry,R=d.manifestLoadingTimeOut,O=d.manifestLoadingRetryDelay,w=d.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:x=0,R=d.levelLoadingTimeOut;break;default:x=d.levelLoadingMaxRetry,R=d.levelLoadingTimeOut,O=d.levelLoadingRetryDelay,w=d.levelLoadingMaxRetryTimeout;break}if(L=this.createInternalLoader(r),(a=r.deliveryDirectives)!==null&&a!==void 0&&a.part){var E;if(r.type===I.PlaylistContextType.LEVEL&&r.level!==null?E=this.hls.levels[r.level].details:r.type===I.PlaylistContextType.AUDIO_TRACK&&r.id!==null?E=this.hls.audioTracks[r.id].details:r.type===I.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(E=this.hls.subtitleTracks[r.id].details),E){var b=E.partTarget,l=E.targetduration;b&&l&&(R=Math.min(Math.max(b*3,l*.8)*1e3,R))}}var _={timeout:R,maxRetry:x,retryDelay:O,maxRetryDelay:w,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};L.load(r,_,h)},f.loadsuccess=function(r,a,d,L){if(L===void 0&&(L=null),d.isSidxRequest){this.handleSidxRequest(r,d),this.handlePlaylistLoaded(r,a,d,L);return}this.resetInternalLoader(d.type);var C=r.data;if(C.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,d,"no EXTM3U delimiter",L);return}a.parsing.start=performance.now(),C.indexOf("#EXTINF:")>0||C.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,a,d,L):this.handleMasterPlaylist(r,a,d,L)},f.loaderror=function(r,a,d){d===void 0&&(d=null),this.handleNetworkError(a,d,!1,r)},f.loadtimeout=function(r,a,d){d===void 0&&(d=null),this.handleNetworkError(a,d,!0)},f.handleMasterPlaylist=function(r,a,d,L){var C=this.hls,x=r.data,R=p(r,d),O=P.default.parseMasterPlaylist(x,R),w=O.levels,E=O.sessionData;if(!w.length){this.handleManifestParsingError(r,d,"no level found in manifest",L);return}var b=w.map(function(N){return{id:N.attrs.AUDIO,audioCodec:N.audioCodec}}),l=w.map(function(N){return{id:N.attrs.SUBTITLES,textCodec:N.textCodec}}),_=P.default.parseMasterPlaylistMedia(x,R,"AUDIO",b),h=P.default.parseMasterPlaylistMedia(x,R,"SUBTITLES",l),g=P.default.parseMasterPlaylistMedia(x,R,"CLOSED-CAPTIONS");if(_.length){var T=_.some(function(N){return!N.url});!T&&w[0].audioCodec&&!w[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}C.trigger(D.Events.MANIFEST_LOADED,{levels:w,audioTracks:_,subtitles:h,captions:g,url:R,stats:a,networkDetails:L,sessionData:E})},f.handleTrackOrLevelPlaylist=function(r,a,d,L){var C=this.hls,x=d.id,R=d.level,O=d.type,w=p(r,d),E=Object(X.isFiniteNumber)(x)?x:0,b=Object(X.isFiniteNumber)(R)?R:E,l=m(d),_=P.default.parseLevelPlaylist(r.data,w,b,l,E);if(!_.fragments.length){C.trigger(D.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:w,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(O===I.PlaylistContextType.MANIFEST){var h={attrs:new y.AttrList({}),bitrate:0,details:_,name:"",url:w};C.trigger(D.Events.MANIFEST_LOADED,{levels:[h],audioTracks:[],url:w,stats:a,networkDetails:L,sessionData:null})}if(a.parsing.end=performance.now(),_.needSidxRanges){var g,T=(g=_.fragments[0].initSegment)===null||g===void 0?void 0:g.url;this.load({url:T,isSidxRequest:!0,type:O,level:R,levelDetails:_,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=_,this.handlePlaylistLoaded(r,a,d,L)},f.handleSidxRequest=function(r,a){var d=Object(H.parseSegmentIndex)(new Uint8Array(r.data));if(!d)return;var L=d.references,C=a.levelDetails;L.forEach(function(x,R){var O=x.info,w=C.fragments[R];w.byteRange.length===0&&w.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),w.initSegment&&w.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(r,a,d,L){this.hls.trigger(D.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===I.PlaylistContextType.MANIFEST,url:r.url,reason:d,response:r,context:a,networkDetails:L})},f.handleNetworkError=function(r,a,d,L){d===void 0&&(d=!1),K.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var C=F.ErrorDetails.UNKNOWN,x=!1,R=this.getInternalLoader(r);switch(r.type){case I.PlaylistContextType.MANIFEST:C=d?F.ErrorDetails.MANIFEST_LOAD_TIMEOUT:F.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case I.PlaylistContextType.LEVEL:C=d?F.ErrorDetails.LEVEL_LOAD_TIMEOUT:F.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.AUDIO_TRACK:C=d?F.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:C=d?F.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:F.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}R&&this.resetInternalLoader(r.type);var O={type:F.ErrorTypes.NETWORK_ERROR,details:C,fatal:x,url:r.url,loader:R,context:r,networkDetails:a};L&&(O.response=L),this.hls.trigger(D.Events.ERROR,O)},f.handlePlaylistLoaded=function(r,a,d,L){var C=d.type,x=d.level,R=d.id,O=d.groupId,w=d.loader,E=d.levelDetails,b=d.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(r,d,"invalid target duration",L);return}if(!w)return;E.live&&(w.getCacheAge&&(E.ageHeader=w.getCacheAge()||0),(!w.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(C){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(D.Events.LEVEL_LOADED,{details:E,level:x||0,id:R||0,stats:a,networkDetails:L,deliveryDirectives:b});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(D.Events.AUDIO_TRACK_LOADED,{details:E,id:R||0,groupId:O||"",stats:a,networkDetails:L,deliveryDirectives:b});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(D.Events.SUBTITLE_TRACK_LOADED,{details:E,id:R||0,groupId:O||"",stats:a,networkDetails:L,deliveryDirectives:b});break}},u}();j.default=c},"./src/polyfills/number.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"isFiniteNumber",function(){return X}),M.d(j,"MAX_SAFE_INTEGER",function(){return D});var X=Number.isFinite||function(F){return typeof F=="number"&&isFinite(F)},D=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(oe,j,M){"use strict";M.r(j);var X=function(){function D(){}return D.getSilentFrame=function(K,H){switch(K){case"mp4a.40.2":if(H===1)return new Uint8Array([0,200,0,128,35,128]);if(H===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(H===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(H===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(H===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(H===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(H===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(H===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(H===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},D}();j.default=X},"./src/remux/mp4-generator.ts":function(oe,j,M){"use strict";M.r(j);var X=Math.pow(2,32)-1,D=function(){function F(){}return F.init=function(){F.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 H;for(H in F.types)F.types.hasOwnProperty(H)&&(F.types[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.charCodeAt(3)]);var P=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]),I=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]);F.HDLR_TYPES={video:P,audio:I};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);F.STTS=F.STSC=F.STCO=m,F.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),F.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),F.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),F.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);F.FTYP=F.box(F.types.ftyp,p,u,p,c),F.DINF=F.box(F.types.dinf,F.box(F.types.dref,y))},F.box=function(H){for(var P=8,I=arguments.length,y=new Array(I>1?I-1:0),m=1;m<I;m++)y[m-1]=arguments[m];for(var p=y.length,c=p;p--;)P+=y[p].byteLength;var u=new Uint8Array(P);for(u[0]=P>>24&255,u[1]=P>>16&255,u[2]=P>>8&255,u[3]=P&255,u.set(H,4),p=0,P=8;p<c;p++)u.set(y[p],P),P+=y[p].byteLength;return u},F.hdlr=function(H){return F.box(F.types.hdlr,F.HDLR_TYPES[H])},F.mdat=function(H){return F.box(F.types.mdat,H)},F.mdhd=function(H,P){P*=H;var I=Math.floor(P/(X+1)),y=Math.floor(P%(X+1));return F.box(F.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,I>>24,I>>16&255,I>>8&255,I&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},F.mdia=function(H){return F.box(F.types.mdia,F.mdhd(H.timescale,H.duration),F.hdlr(H.type),F.minf(H))},F.mfhd=function(H){return F.box(F.types.mfhd,new Uint8Array([0,0,0,0,H>>24,H>>16&255,H>>8&255,H&255]))},F.minf=function(H){return H.type==="audio"?F.box(F.types.minf,F.box(F.types.smhd,F.SMHD),F.DINF,F.stbl(H)):F.box(F.types.minf,F.box(F.types.vmhd,F.VMHD),F.DINF,F.stbl(H))},F.moof=function(H,P,I){return F.box(F.types.moof,F.mfhd(H),F.traf(I,P))},F.moov=function(H){for(var P=H.length,I=[];P--;)I[P]=F.trak(H[P]);return F.box.apply(null,[F.types.moov,F.mvhd(H[0].timescale,H[0].duration)].concat(I).concat(F.mvex(H)))},F.mvex=function(H){for(var P=H.length,I=[];P--;)I[P]=F.trex(H[P]);return F.box.apply(null,[F.types.mvex].concat(I))},F.mvhd=function(H,P){P*=H;var I=Math.floor(P/(X+1)),y=Math.floor(P%(X+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,I>>24,I>>16&255,I>>8&255,I&255,y>>24,y>>16&255,y>>8&255,y&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 F.box(F.types.mvhd,m)},F.sdtp=function(H){var P=H.samples||[],I=new Uint8Array(4+P.length),y,m;for(y=0;y<P.length;y++)m=P[y].flags,I[y+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return F.box(F.types.sdtp,I)},F.stbl=function(H){return F.box(F.types.stbl,F.stsd(H),F.box(F.types.stts,F.STTS),F.box(F.types.stsc,F.STSC),F.box(F.types.stsz,F.STSZ),F.box(F.types.stco,F.STCO))},F.avc1=function(H){var P=[],I=[],y,m,p;for(y=0;y<H.sps.length;y++)m=H.sps[y],p=m.byteLength,P.push(p>>>8&255),P.push(p&255),P=P.concat(Array.prototype.slice.call(m));for(y=0;y<H.pps.length;y++)m=H.pps[y],p=m.byteLength,I.push(p>>>8&255),I.push(p&255),I=I.concat(Array.prototype.slice.call(m));var c=F.box(F.types.avcC,new Uint8Array([1,P[3],P[4],P[5],252|3,224|H.sps.length].concat(P).concat([H.pps.length]).concat(I))),u=H.width,f=H.height,s=H.pixelRatio[0],r=H.pixelRatio[1];return F.box(F.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,u>>8&255,u&255,f>>8&255,f&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,F.box(F.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),F.box(F.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,r>>24,r>>16&255,r>>8&255,r&255])))},F.esds=function(H){var P=H.config.length;return new Uint8Array([0,0,0,0,3,23+P,0,1,0,4,15+P,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([P]).concat(H.config).concat([6,1,2]))},F.mp4a=function(H){var P=H.samplerate;return F.box(F.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]),F.box(F.types.esds,F.esds(H)))},F.mp3=function(H){var P=H.samplerate;return F.box(F.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]))},F.stsd=function(H){return H.type==="audio"?!H.isAAC&&H.codec==="mp3"?F.box(F.types.stsd,F.STSD,F.mp3(H)):F.box(F.types.stsd,F.STSD,F.mp4a(H)):F.box(F.types.stsd,F.STSD,F.avc1(H))},F.tkhd=function(H){var P=H.id,I=H.duration*H.timescale,y=H.width,m=H.height,p=Math.floor(I/(X+1)),c=Math.floor(I%(X+1));return F.box(F.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&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,y>>8&255,y&255,0,0,m>>8&255,m&255,0,0]))},F.traf=function(H,P){var I=F.sdtp(H),y=H.id,m=Math.floor(P/(X+1)),p=Math.floor(P%(X+1));return F.box(F.types.traf,F.box(F.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),F.box(F.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])),F.trun(H,I.length+16+20+8+16+8+8),I)},F.trak=function(H){return H.duration=H.duration||4294967295,F.box(F.types.trak,F.tkhd(H),F.mdia(H))},F.trex=function(H){var P=H.id;return F.box(F.types.trex,new Uint8Array([0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},F.trun=function(H,P){var I=H.samples||[],y=I.length,m=12+16*y,p=new Uint8Array(m),c,u,f,s,r,a;for(P+=8+m,p.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255],0),c=0;c<y;c++)u=I[c],f=u.duration,s=u.size,r=u.flags,a=u.cts,p.set([f>>>24&255,f>>>16&255,f>>>8&255,f&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,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*c);return F.box(F.types.trun,p)},F.initSegment=function(H){F.types||F.init();var P=F.moov(H),I=new Uint8Array(F.FTYP.byteLength+P.byteLength);return I.set(F.FTYP),I.set(P,F.FTYP.byteLength),I},F}();D.types=void 0,D.HDLR_TYPES=void 0,D.STTS=void 0,D.STSC=void 0,D.STCO=void 0,D.STSZ=void 0,D.VMHD=void 0,D.SMHD=void 0,D.STSD=void 0,D.FTYP=void 0,D.DINF=void 0,j.default=D},"./src/remux/mp4-remuxer.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return a}),M.d(j,"normalizePts",function(){return d});var X=M("./src/polyfills/number.ts"),D=M("./src/remux/aac-helper.ts"),F=M("./src/remux/mp4-generator.ts"),K=M("./src/events.ts"),H=M("./src/errors.ts"),P=M("./src/utils/logger.ts"),I=M("./src/types/loader.ts"),y=M("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var w=arguments[O];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(R[E]=w[E])}return R},m.apply(this,arguments)}var p=10*1e3,c=1024,u=1152,f=null,s=null,r=!1,a=function(){function R(w,E,b,l){if(l===void 0&&(l=""),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=w,this.config=E,this.typeSupported=b,this.ISGenerated=!1,f===null){var _=navigator.userAgent||"",h=_.match(/Chrome\/(\d+)/i);f=h?parseInt(h[1]):0}if(s===null){var g=navigator.userAgent.match(/Safari\/(\d+)/i);s=g?parseInt(g[1]):0}r=!!f&&f<75||!!s&&s<600}var O=R.prototype;return O.destroy=function(){},O.resetTimeStamp=function(E){P.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},O.resetNextTimestamp=function(){P.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){P.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(E){var b=!1,l=E.reduce(function(_,h){var g=h.pts-_;return g<-4294967296?(b=!0,d(_,h.pts)):g>0?_:h.pts},E[0].pts);return b&&P.logger.debug("PTS rollover detected"),l},O.remux=function(E,b,l,_,h,g,T,N){var V,Y,U,A,J,te,se=h,fe=h,Ue=E.pid>-1,Re=b.pid>-1,De=b.samples.length,Fe=E.samples.length>0,Me=De>1,ye=(!Ue||Fe)&&(!Re||Me)||this.ISGenerated||T;if(ye){this.ISGenerated||(U=this.generateIS(E,b,h));var le=this.isVideoContiguous,Se=-1;if(Me&&(Se=L(b.samples),!le&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,Se>0){P.logger.warn("[mp4-remuxer]: Dropped "+Se+" out of "+De+" video samples due to a missing keyframe");var ot=this.getVideoStartPts(b.samples);b.samples=b.samples.slice(Se),b.dropped+=Se,fe+=(b.samples[0].pts-ot)/(b.timescale||9e4)}else Se===-1&&(P.logger.warn("[mp4-remuxer]: No keyframe found out of "+De+" video samples"),te=!1);if(this.ISGenerated){if(Fe&&Me){var it=this.getVideoStartPts(b.samples),ct=d(E.samples[0].pts,it)-it,xt=ct/b.inputTimeScale;se+=Math.max(0,xt),fe+=Math.max(0,-xt)}if(Fe){if(E.samplerate||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(E,b,h)),Y=this.remuxAudio(E,se,this.isAudioContiguous,g,Re||Me||N===I.PlaylistLevelType.AUDIO?fe:void 0),Me){var Xe=Y?Y.endPTS-Y.startPTS:0;b.inputTimeScale||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(E,b,h)),V=this.remuxVideo(b,fe,le,Xe)}}else Me&&(V=this.remuxVideo(b,fe,le,0));V&&(V.firstKeyFrame=Se,V.independent=Se!==-1)}}return this.ISGenerated&&(l.samples.length&&(J=this.remuxID3(l,h)),_.samples.length&&(A=this.remuxText(_,h))),{audio:Y,video:V,initSegment:U,independent:te,text:A,id3:J}},O.generateIS=function(E,b,l){var _=E.samples,h=b.samples,g=this.typeSupported,T={},N=!Object(X.isFiniteNumber)(this._initPTS),V="audio/mp4",Y,U,A;if(N&&(Y=U=Infinity),E.config&&_.length&&(E.timescale=E.samplerate,E.isAAC||(g.mpeg?(V="audio/mpeg",E.codec=""):g.mp3&&(E.codec="mp3")),T.audio={id:"audio",container:V,codec:E.codec,initSegment:!E.isAAC&&g.mpeg?new Uint8Array(0):F.default.initSegment([E]),metadata:{channelCount:E.channelCount}},N&&(A=E.inputTimeScale,Y=U=_[0].pts-Math.round(A*l))),b.sps&&b.pps&&h.length&&(b.timescale=b.inputTimeScale,T.video={id:"main",container:"video/mp4",codec:b.codec,initSegment:F.default.initSegment([b]),metadata:{width:b.width,height:b.height}},N)){A=b.inputTimeScale;var J=this.getVideoStartPts(h),te=Math.round(A*l);U=Math.min(U,d(h[0].dts,J)-te),Y=Math.min(Y,J-te)}if(Object.keys(T).length)return this.ISGenerated=!0,N&&(this._initPTS=Y,this._initDTS=U),{tracks:T,initPTS:Y,timescale:A}},O.remuxVideo=function(E,b,l,_){var h=E.inputTimeScale,g=E.samples,T=[],N=g.length,V=this._initPTS,Y=this.nextAvcDts,U=8,A,J,te,se=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,Ue=0,Re=!1;if(!l||Y===null){var De=b*h,Fe=g[0].pts-d(g[0].dts,g[0].pts);Y=De-Fe}for(var Me=0;Me<N;Me++){var ye=g[Me];if(ye.pts=d(ye.pts-V,Y),ye.dts=d(ye.dts-V,Y),ye.dts>ye.pts){var le=9e4*.2;Ue=Math.max(Math.min(Ue,ye.pts-ye.dts),-1*le)}ye.dts<g[Me>0?Me-1:Me].dts&&(Re=!0)}Re&&g.sort(function(bt,nt){var je=bt.dts-nt.dts,Ft=bt.pts-nt.pts;return je||Ft}),J=g[0].dts,te=g[g.length-1].dts;var Se=Math.round((te-J)/(N-1));if(Ue<0){if(Ue<Se*-2){P.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-Se,!0)+" ms");for(var ot=Ue,it=0;it<N;it++)g[it].dts=ot=Math.max(ot,g[it].pts-Se),g[it].pts=Math.max(ot,g[it].pts)}else{P.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(Ue,!0)+" ms to overcome this issue");for(var ct=0;ct<N;ct++)g[ct].dts=g[ct].dts+Ue}J=g[0].dts}if(l){var xt=J-Y,Xe=xt>Se,qe=xt<-1;if(Xe||qe){Xe?P.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(xt,!0)+" ms ("+xt+"dts) hole between fragments detected, filling it"):P.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-xt,!0)+" ms ("+xt+"dts) overlapping between fragments detected"),J=Y;var dt=g[0].pts-xt;g[0].dts=J,g[0].pts=dt,P.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(dt,!0)+"/"+Object(y.toMsFromMpegTsClock)(J,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(xt,!0)+" ms")}}r&&(J=Math.max(0,J));for(var vt=0,st=0,tt=0;tt<N;tt++){for(var rt=g[tt],Bt=rt.units,Pt=Bt.length,Ct=0,_t=0;_t<Pt;_t++)Ct+=Bt[_t].data.length;st+=Ct,vt+=Pt,rt.length=Ct,rt.dts=Math.max(rt.dts,J),rt.pts=Math.max(rt.pts,rt.dts,0),se=Math.min(rt.pts,se),fe=Math.max(rt.pts,fe)}te=g[N-1].dts;var Vt=st+4*vt+8,Ot;try{Ot=new Uint8Array(Vt)}catch(bt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Vt,reason:"fail allocating video mdat "+Vt});return}var Rt=new DataView(Ot.buffer);Rt.setUint32(0,Vt),Ot.set(F.default.types.mdat,4);for(var Ve=0;Ve<N;Ve++){for(var Xt=g[Ve],At=Xt.units,ze=0,at=0,Ae=At.length;at<Ae;at++){var _e=At[at],xe=_e.data,re=_e.data.byteLength;Rt.setUint32(U,re),U+=4,Ot.set(xe,U),U+=re,ze+=4+re}if(Ve<N-1)A=g[Ve+1].dts-Xt.dts;else{var ae=this.config,he=Xt.dts-g[Ve>0?Ve-1:Ve].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var be=Math.floor(ae.maxBufferHole*h),Te=(_?se+_*h:this.nextAudioPts)-Xt.pts;Te>be?(A=Te-he,A<0&&(A=he),P.logger.log("[mp4-remuxer]: It is approximately "+Te/90+" ms to the next segment; using duration "+A/90+" ms for the last video frame.")):A=he}else A=he}var ke=Math.round(Xt.pts-Xt.dts);T.push(new C(Xt.key,A,ze,ke))}if(T.length&&f&&f<70){var Ne=T[0].flags;Ne.dependsOn=2,Ne.isNonSync=0}console.assert(A!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=Y=te+A,this.isVideoContiguous=!0;var lt=F.default.moof(E.sequenceNumber++,J,m({},E,{samples:T})),ft="video",Ge={data1:lt,data2:Ot,startPTS:se/h,endPTS:(fe+A)/h,startDTS:J/h,endDTS:Y/h,type:ft,hasAudio:!1,hasVideo:!0,nb:T.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(Ot.length,"MDAT length must not be zero"),Ge},O.remuxAudio=function(E,b,l,_,h){var g=E.inputTimeScale,T=E.samplerate?E.samplerate:g,N=g/T,V=E.isAAC?c:u,Y=V*N,U=this._initPTS,A=!E.isAAC&&this.typeSupported.mpeg,J=[],te=E.samples,se=A?0:8,fe=this.nextAudioPts||-1,Ue=b*g;if(this.isAudioContiguous=l=l||te.length&&fe>0&&(_&&Math.abs(Ue-fe)<9e3||Math.abs(d(te[0].pts-U,Ue)-fe)<20*Y),te.forEach(function(xe){xe.pts=d(xe.pts-U,Ue)}),!l||fe<0){if(te=te.filter(function(xe){return xe.pts>=0}),!te.length)return;h===0?fe=0:_?fe=Math.max(0,Ue):fe=te[0].pts}if(E.isAAC)for(var Re=h!==void 0,De=this.config.maxAudioFramesDrift,Fe=0,Me=fe;Fe<te.length;Fe++){var ye=te[Fe],le=ye.pts,Se=le-Me,ot=Math.abs(1e3*Se/g);if(Se<=-De*Y&&Re)Fe===0&&(P.logger.warn("Audio frame @ "+(le/g).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Se/g)+" ms."),this.nextAudioPts=fe=Me=le);else if(Se>=De*Y&&ot<p&&Re){var it=Math.round(Se/Y);Me=le-it*Y,Me<0&&(it--,Me+=Y),Fe===0&&(this.nextAudioPts=fe=Me),P.logger.warn("[mp4-remuxer]: Injecting "+it+" audio frame @ "+(Me/g).toFixed(3)+"s due to "+Math.round(1e3*Se/g)+" ms gap.");for(var ct=0;ct<it;ct++){var xt=Math.max(Me,0),Xe=D.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);Xe||(P.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Xe=ye.unit.subarray()),te.splice(Fe,0,{unit:Xe,pts:xt}),Me+=Y,Fe++}}ye.pts=Me,Me+=Y}for(var qe=null,dt=null,vt,st=0,tt=te.length;tt--;)st+=te[tt].unit.byteLength;for(var rt=0,Bt=te.length;rt<Bt;rt++){var Pt=te[rt],Ct=Pt.unit,_t=Pt.pts;if(dt!==null){var Vt=J[rt-1];Vt.duration=Math.round((_t-dt)/N)}else if(l&&E.isAAC&&(_t=fe),qe=_t,st>0){st+=se;try{vt=new Uint8Array(st)}catch(xe){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:st,reason:"fail allocating audio mdat "+st});return}if(!A){var Ot=new DataView(vt.buffer);Ot.setUint32(0,st),vt.set(F.default.types.mdat,4)}}else return;vt.set(Ct,se);var Rt=Ct.byteLength;se+=Rt,J.push(new C(!0,V,Rt,0)),dt=_t}var Ve=J.length;if(!Ve)return;var Xt=J[J.length-1];this.nextAudioPts=fe=dt+N*Xt.duration;var At=A?new Uint8Array(0):F.default.moof(E.sequenceNumber++,qe/N,m({},E,{samples:J}));E.samples=[];var ze=qe/g,at=fe/g,Ae="audio",_e={data1:At,data2:vt,startPTS:ze,endPTS:at,startDTS:ze,endDTS:at,type:Ae,hasAudio:!0,hasVideo:!1,nb:Ve};return this.isAudioContiguous=!0,console.assert(vt.length,"MDAT length must not be zero"),_e},O.remuxEmptyAudio=function(E,b,l,_){var h=E.inputTimeScale,g=E.samplerate?E.samplerate:h,T=h/g,N=this.nextAudioPts,V=(N!==null?N:_.startDTS*h)+this._initDTS,Y=_.endDTS*h+this._initDTS,U=T*c,A=Math.ceil((Y-V)/U),J=D.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(P.logger.warn("[mp4-remuxer]: remux empty Audio"),!J){P.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],se=0;se<A;se++){var fe=V+se*U;te.push({unit:J,pts:fe,dts:fe})}return E.samples=te,this.remuxAudio(E,b,l,!1)},O.remuxID3=function(E,b){var l=E.samples.length;if(!l)return;for(var _=E.inputTimeScale,h=this._initPTS,g=this._initDTS,T=0;T<l;T++){var N=E.samples[T];N.pts=d(N.pts-h,b*_)/_,N.dts=d(N.dts-g,b*_)/_}var V=E.samples;return E.samples=[],{samples:V}},O.remuxText=function(E,b){var l=E.samples.length;if(!l)return;for(var _=E.inputTimeScale,h=this._initPTS,g=0;g<l;g++){var T=E.samples[g];T.pts=d(T.pts-h,b*_)/_}E.samples.sort(function(V,Y){return V.pts-Y.pts});var N=E.samples;return E.samples=[],{samples:N}},R}();function d(R,O){var w;if(O===null)return R;for(O<R?w=-8589934592:w=8589934592;Math.abs(R-O)>4294967296;)R+=w;return R}function L(R){for(var O=0;O<R.length;O++)if(R[O].key)return O;return-1}var C=function(O,w,E,b){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=w,this.size=E,this.cts=b,this.flags=new x(O)},x=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/polyfills/number.ts"),D=M("./src/utils/mp4-tools.ts"),F=M("./src/loader/fragment.ts"),K=M("./src/utils/logger.ts"),H=function(){function y(){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 m=y.prototype;return m.destroy=function(){},m.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(c,u,f){this.audioCodec=u,this.videoCodec=f,this.generateInitSegment(c),this.emitInitSegment=!0},m.generateInitSegment=function(c){var u=this.audioCodec,f=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(D.parseInitSegment)(c);u||(u=I(s.audio,F.ElementaryStreamTypes.AUDIO)),f||(f=I(s.video,F.ElementaryStreamTypes.VIDEO));var r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:u+","+f,initSegment:c,id:"main"}:s.audio?r.audio={container:"audio/mp4",codec:u,initSegment:c,id:"audio"}:s.video?r.video={container:"video/mp4",codec:f,initSegment:c,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},m.remux=function(c,u,f,s,r){var a=this.initPTS,d=this.lastEndDTS,L={audio:void 0,video:void 0,text:s,id3:f,initSegment:void 0};Object(X.isFiniteNumber)(d)||(d=this.lastEndDTS=r||0);var C=u.samples;if(!C||!C.length)return L;var x={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(C),R=this.initData),!R||!R.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),L;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(a)||(this.initPTS=x.initPTS=a=P(R,C,d));var O=Object(D.getDuration)(C,R),w=d,E=O+w;Object(D.offsetStartDTS)(R,C,a),O>0?this.lastEndDTS=E:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var b=!!R.audio,l=!!R.video,_="";b&&(_+="audio"),l&&(_+="video");var h={data1:C,startPTS:w,startDTS:w,endPTS:E,endDTS:E,type:_,hasAudio:b,hasVideo:l,nb:1,dropped:0};return L.audio=h.type==="audio"?h:void 0,L.video=h.type!=="audio"?h:void 0,L.text=s,L.id3=f,L.initSegment=x,L},y}(),P=function(m,p,c){return Object(D.getStartDTS)(m,p)-c};function I(y,m){var p=y==null?void 0:y.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===F.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}j.default=H},"./src/task-loop.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return X});var X=function(){function D(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var F=D.prototype;return F.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},F.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},F.onHandlerDestroyed=function(){},F.hasInterval=function(){return!!this._tickInterval},F.hasNextTick=function(){return!!this._tickTimer},F.setInterval=function(H){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,H),!0)},F.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},F.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},F.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},F.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},F.doTick=function(){},D}()},"./src/types/cmcd.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"CMCDVersion",function(){return X}),M.d(j,"CMCDObjectType",function(){return D}),M.d(j,"CMCDStreamingFormat",function(){return F}),M.d(j,"CMCDStreamType",function(){return K});var X=1,D;(function(H){H.MANIFEST="m",H.AUDIO="a",H.VIDEO="v",H.MUXED="av",H.INIT="i",H.CAPTION="c",H.TIMED_TEXT="tt",H.KEY="k",H.OTHER="o"})(D||(D={}));var F;(function(H){H.DASH="d",H.HLS="h",H.SMOOTH="s",H.OTHER="o"})(F||(F={}));var K;(function(H){H.VOD="v",H.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"HlsSkip",function(){return F}),M.d(j,"getSkipValue",function(){return K}),M.d(j,"HlsUrlParameters",function(){return H}),M.d(j,"Level",function(){return P});function X(I,y){for(var m=0;m<y.length;m++){var p=y[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(I,p.key,p)}}function D(I,y,m){return y&&X(I.prototype,y),m&&X(I,m),I}var F;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(F||(F={}));function K(I,y){var m=I.canSkipUntil,p=I.canSkipDateRanges,c=I.endSN,u=y!==void 0?y-c:0;return m&&u<m?p?F.v2:F.Yes:F.No}var H=function(){function I(m,p,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=p,this.skip=c}var y=I.prototype;return y.addDirectives=function(p){var c=new self.URL(p);return this.msn!==void 0&&c.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&c.searchParams.set("_HLS_part",this.part.toString()),this.skip&&c.searchParams.set("_HLS_skip",this.skip),c.toString()},I}(),P=function(){function I(y){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=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return D(I,[{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(m){var p=m%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),I}()},"./src/types/loader.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"PlaylistContextType",function(){return X}),M.d(j,"PlaylistLevelType",function(){return D});var X;(function(F){F.MANIFEST="manifest",F.LEVEL="level",F.AUDIO_TRACK="audioTrack",F.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var D;(function(F){F.MAIN="main",F.AUDIO="audio",F.SUBTITLE="subtitle"})(D||(D={}))},"./src/types/transmuxer.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"ChunkMetadata",function(){return X});var X=function(K,H,P,I,y,m){I===void 0&&(I=0),y===void 0&&(y=-1),m===void 0&&(m=!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=D(),this.buffering={audio:D(),video:D(),audiovideo:D()},this.level=K,this.sn=H,this.id=P,this.size=I,this.part=y,this.partial=m};function D(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"AttrList",function(){return F});var X=/^(\d+)x(\d+)$/,D=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,F=function(){function K(P){typeof P=="string"&&(P=K.parseAttrList(P));for(var I in P)P.hasOwnProperty(I)&&(this[I]=P[I])}var H=K.prototype;return H.decimalInteger=function(I){var y=parseInt(this[I],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},H.hexadecimalInteger=function(I){if(this[I]){var y=(this[I]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var m=new Uint8Array(y.length/2),p=0;p<y.length/2;p++)m[p]=parseInt(y.slice(p*2,p*2+2),16);return m}else return null},H.hexadecimalIntegerAsNumber=function(I){var y=parseInt(this[I],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},H.decimalFloatingPoint=function(I){return parseFloat(this[I])},H.optionalFloat=function(I,y){var m=this[I];return m?parseFloat(m):y},H.enumeratedString=function(I){return this[I]},H.bool=function(I){return this[I]==="YES"},H.decimalResolution=function(I){var y=X.exec(this[I]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},K.parseAttrList=function(I){var y,m={},p='"';for(D.lastIndex=0;(y=D.exec(I))!==null;){var c=y[2];c.indexOf(p)===0&&c.lastIndexOf(p)===c.length-1&&(c=c.slice(1,-1)),m[y[1]]=c}return m},K}()},"./src/utils/binary-search.ts":function(oe,j,M){"use strict";M.r(j);var X={search:function(F,K){for(var H=0,P=F.length-1,I=null,y=null;H<=P;){I=(H+P)/2|0,y=F[I];var m=K(y);if(m>0)H=I+1;else if(m<0)P=I-1;else return y}return null}};j.default=X},"./src/utils/buffer-helper.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"BufferHelper",function(){return F});var X=M("./src/utils/logger.ts"),D={length:0,start:function(){return 0},end:function(){return 0}},F=function(){function K(){}return K.isBuffered=function(P,I){try{if(P){for(var y=K.getBuffered(P),m=0;m<y.length;m++)if(I>=y.start(m)&&I<=y.end(m))return!0}}catch(p){}return!1},K.bufferInfo=function(P,I,y){try{if(P){var m=K.getBuffered(P),p=[],c;for(c=0;c<m.length;c++)p.push({start:m.start(c),end:m.end(c)});return this.bufferedInfo(p,I,y)}}catch(u){}return{len:0,start:I,end:I,nextStart:void 0}},K.bufferedInfo=function(P,I,y){I=Math.max(0,I),P.sort(function(x,R){var O=x.start-R.start;return O||R.end-x.end});var m=[];if(y)for(var p=0;p<P.length;p++){var c=m.length;if(c){var u=m[c-1].end;P[p].start-u<y?P[p].end>u&&(m[c-1].end=P[p].end):m.push(P[p])}else m.push(P[p])}else m=P;for(var f=0,s,r=I,a=I,d=0;d<m.length;d++){var L=m[d].start,C=m[d].end;if(I+y>=L&&I<C)r=L,a=C,f=a-I;else if(I+y<L){s=L;break}}return{len:f,start:r||0,end:a||0,nextStart:s}},K.getBuffered=function(P){try{return P.buffered}catch(I){return X.logger.log("failed to get media.buffered",I),D}},K}()},"./src/utils/cea-608-parser.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"Row",function(){return a}),M.d(j,"CaptionScreen",function(){return d});var X=M("./src/utils/logger.ts"),D={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},F=function(E){var b=E;return D.hasOwnProperty(E)&&(b=D[E]),String.fromCharCode(b)},K=15,H=100,P={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(w){w[w.ERROR=0]="ERROR",w[w.TEXT=1]="TEXT",w[w.WARNING=2]="WARNING",w[w.INFO=2]="INFO",w[w.DEBUG=3]="DEBUG",w[w.DATA=3]="DATA"})(c||(c={}));var u=function(){function w(){this.time=null,this.verboseLevel=c.ERROR}var E=w.prototype;return E.log=function(l,_){this.verboseLevel>=l&&X.logger.log(this.time+" ["+l+"] "+_)},w}(),f=function(E){for(var b=[],l=0;l<E.length;l++)b.push(E[l].toString(16));return b},s=function(){function w(b,l,_,h,g){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=b||"white",this.underline=l||!1,this.italics=_||!1,this.background=h||"black",this.flash=g||!1}var E=w.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(l){for(var _=["foreground","underline","italics","background","flash"],h=0;h<_.length;h++){var g=_[h];l.hasOwnProperty(g)&&(this[g]=l[g])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(l){return this.foreground===l.foreground&&this.underline===l.underline&&this.italics===l.italics&&this.background===l.background&&this.flash===l.flash},E.copy=function(l){this.foreground=l.foreground,this.underline=l.underline,this.italics=l.italics,this.background=l.background,this.flash=l.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},w}(),r=function(){function w(b,l,_,h,g,T){this.uchar=void 0,this.penState=void 0,this.uchar=b||" ",this.penState=new s(l,_,h,g,T)}var E=w.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(l,_){this.uchar=l,this.penState.copy(_)},E.setPenState=function(l){this.penState.copy(l)},E.equals=function(l){return this.uchar===l.uchar&&this.penState.equals(l.penState)},E.copy=function(l){this.uchar=l.uchar,this.penState.copy(l.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},w}(),a=function(){function w(b){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var l=0;l<H;l++)this.chars.push(new r);this.logger=b,this.pos=0,this.currPenState=new s}var E=w.prototype;return E.equals=function(l){for(var _=!0,h=0;h<H;h++)if(!this.chars[h].equals(l.chars[h])){_=!1;break}return _},E.copy=function(l){for(var _=0;_<H;_++)this.chars[_].copy(l.chars[_])},E.isEmpty=function(){for(var l=!0,_=0;_<H;_++)if(!this.chars[_].isEmpty()){l=!1;break}return l},E.setCursor=function(l){this.pos!==l&&(this.pos=l),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>H&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=H)},E.moveCursor=function(l){var _=this.pos+l;if(l>1)for(var h=this.pos+1;h<_+1;h++)this.chars[h].setPenState(this.currPenState);this.setCursor(_)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(l){l>=144&&this.backSpace();var _=F(l);if(this.pos>=H){this.logger.log(c.ERROR,"Cannot insert "+l.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(l){var _;for(_=l;_<H;_++)this.chars[_].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var l=[],_=!0,h=0;h<H;h++){var g=this.chars[h].uchar;g!==" "&&(_=!1),l.push(g)}return _?"":l.join("")},E.setPenStyles=function(l){this.currPenState.setStyles(l);var _=this.chars[this.pos];_.setPenState(this.currPenState)},w}(),d=function(){function w(b){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var l=0;l<K;l++)this.rows.push(new a(b));this.logger=b,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=w.prototype;return E.reset=function(){for(var l=0;l<K;l++)this.rows[l].clear();this.currRow=K-1},E.equals=function(l){for(var _=!0,h=0;h<K;h++)if(!this.rows[h].equals(l.rows[h])){_=!1;break}return _},E.copy=function(l){for(var _=0;_<K;_++)this.rows[_].copy(l.rows[_])},E.isEmpty=function(){for(var l=!0,_=0;_<K;_++)if(!this.rows[_].isEmpty()){l=!1;break}return l},E.backSpace=function(){var l=this.rows[this.currRow];l.backSpace()},E.clearToEndOfRow=function(){var l=this.rows[this.currRow];l.clearToEndOfRow()},E.insertChar=function(l){var _=this.rows[this.currRow];_.insertChar(l)},E.setPen=function(l){var _=this.rows[this.currRow];_.setPenStyles(l)},E.moveCursor=function(l){var _=this.rows[this.currRow];_.moveCursor(l)},E.setCursor=function(l){this.logger.log(c.INFO,"setCursor: "+l);var _=this.rows[this.currRow];_.setCursor(l)},E.setPAC=function(l){this.logger.log(c.INFO,"pacData = "+JSON.stringify(l));var _=l.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var h=0;h<K;h++)this.rows[h].clear();var g=this.currRow+1-this.nrRollUpRows,T=this.lastOutputScreen;if(T){var N=T.rows[g].cueStartTime,V=this.logger.time;if(N&&V!==null&&N<V)for(var Y=0;Y<this.nrRollUpRows;Y++)this.rows[_-this.nrRollUpRows+Y+1].copy(T.rows[g+Y])}}this.currRow=_;var U=this.rows[this.currRow];if(l.indent!==null){var A=l.indent,J=Math.max(A-1,0);U.setCursor(l.indent),l.color=U.chars[J].penState.foreground}var te={foreground:l.color,underline:l.underline,italics:l.italics,background:"black",flash:!1};this.setPen(te)},E.setBkgData=function(l){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(l)),this.backSpace(),this.setPen(l),this.insertChar(32)},E.setRollUpRows=function(l){this.nrRollUpRows=l},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(c.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(c.TEXT,this.getDisplayText());var l=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(l,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(c.INFO,"Rolling up")},E.getDisplayText=function(l){l=l||!1;for(var _=[],h="",g=-1,T=0;T<K;T++){var N=this.rows[T].getTextString();N&&(g=T+1,l?_.push("Row "+g+": '"+N+"'"):_.push(N.trim()))}return _.length>0&&(l?h="["+_.join(" | ")+"]":h=_.join(`
|
|
`)),h},E.getTextAndFormat=function(){return this.rows},w}(),L=function(){function w(b,l,_){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=b,this.outputFilter=l,this.mode=null,this.verbose=0,this.displayedMemory=new d(_),this.nonDisplayedMemory=new d(_),this.lastOutputScreen=new d(_),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var E=w.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(l){this.outputFilter=l},E.setPAC=function(l){this.writeScreen.setPAC(l)},E.setBkgData=function(l){this.writeScreen.setBkgData(l)},E.setMode=function(l){if(l===this.mode)return;this.mode=l,this.logger.log(c.INFO,"MODE="+l),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=l},E.insertChars=function(l){for(var _=0;_<l.length;_++)this.writeScreen.insertChar(l[_]);var h=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,h+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(c.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(l){this.logger.log(c.INFO,"RU("+l+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(l)},E.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var l=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=l,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(l){this.logger.log(c.INFO,"TO("+l+") - Tab Offset"),this.writeScreen.moveCursor(l)},E.ccMIDROW=function(l){var _={flash:!1};if(_.underline=l%2===1,_.italics=l>=46,_.italics)_.foreground="white";else{var h=Math.floor(l/2)-16,g=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=g[h]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},E.outputDataUpdate=function(l){l===void 0&&(l=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),l&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(l){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,l,this.displayedMemory),this.cueStartTime=l))},w}(),C=function(){function w(b,l,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var h=new u;this.channels=[null,new L(b,l,h),new L(b+1,_,h)],this.cmdHistory=O(),this.logger=h}var E=w.prototype;return E.getHandler=function(l){return this.channels[l].getHandler()},E.setHandler=function(l,_){this.channels[l].setHandler(_)},E.addData=function(l,_){var h,g,T,N=!1;this.logger.time=l;for(var V=0;V<_.length;V+=2){if(g=_[V]&127,T=_[V+1]&127,g===0&&T===0)continue;if(this.logger.log(c.DATA,"["+f([_[V],_[V+1]])+"] -> ("+f([g,T])+")"),h=this.parseCmd(g,T),h||(h=this.parseMidrow(g,T)),h||(h=this.parsePAC(g,T)),h||(h=this.parseBackgroundAttributes(g,T)),!h&&(N=this.parseChars(g,T),N)){var Y=this.currentChannel;if(Y&&Y>0){var U=this.channels[Y];U.insertChars(N)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!h&&!N&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+f([g,T])+" orig: "+f([_[V],_[V+1]]))}},E.parseCmd=function(l,_){var h=this.cmdHistory,g=(l===20||l===28||l===21||l===29)&&_>=32&&_<=47,T=(l===23||l===31)&&_>=33&&_<=35;if(!(g||T))return!1;if(R(l,_,h))return x(null,null,h),this.logger.log(c.DEBUG,"Repeated command ("+f([l,_])+") is dropped"),!0;var N=l===20||l===21||l===23?1:2,V=this.channels[N];return l===20||l===21||l===28||l===29?_===32?V.ccRCL():_===33?V.ccBS():_===34?V.ccAOF():_===35?V.ccAON():_===36?V.ccDER():_===37?V.ccRU(2):_===38?V.ccRU(3):_===39?V.ccRU(4):_===40?V.ccFON():_===41?V.ccRDC():_===42?V.ccTR():_===43?V.ccRTD():_===44?V.ccEDM():_===45?V.ccCR():_===46?V.ccENM():_===47&&V.ccEOC():V.ccTO(_-32),x(l,_,h),this.currentChannel=N,!0},E.parseMidrow=function(l,_){var h=0;if((l===17||l===25)&&_>=32&&_<=47){if(l===17?h=1:h=2,h!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var g=this.channels[h];return g?(g.ccMIDROW(_),this.logger.log(c.DEBUG,"MIDROW ("+f([l,_])+")"),!0):!1}return!1},E.parsePAC=function(l,_){var h,g=this.cmdHistory,T=(l>=17&&l<=23||l>=25&&l<=31)&&_>=64&&_<=127,N=(l===16||l===24)&&_>=64&&_<=95;if(!(T||N))return!1;if(R(l,_,g))return x(null,null,g),!0;var V=l<=23?1:2;_>=64&&_<=95?h=V===1?P[l]:y[l]:h=V===1?I[l]:m[l];var Y=this.channels[V];return Y?(Y.setPAC(this.interpretPAC(h,_)),x(l,_,g),this.currentChannel=V,!0):!1},E.interpretPAC=function(l,_){var h,g={color:null,italics:!1,indent:null,underline:!1,row:l};return _>95?h=_-96:h=_-64,g.underline=(h&1)===1,h<=13?g.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(h/2)]:h<=15?(g.italics=!0,g.color="white"):g.indent=Math.floor((h-16)/2)*4,g},E.parseChars=function(l,_){var h,g=null,T=null;if(l>=25?(h=2,T=l-8):(h=1,T=l),T>=17&&T<=19){var N;T===17?N=_+80:T===18?N=_+112:N=_+144,this.logger.log(c.INFO,"Special char '"+F(N)+"' in channel "+h),g=[N]}else l>=32&&l<=127&&(g=_===0?[l]:[l,_]);if(g){var V=f(g);this.logger.log(c.DEBUG,"Char codes = "+V.join(",")),x(l,_,this.cmdHistory)}return g},E.parseBackgroundAttributes=function(l,_){var h=(l===16||l===24)&&_>=32&&_<=47,g=(l===23||l===31)&&_>=45&&_<=47;if(!(h||g))return!1;var T,N={};l===16||l===24?(T=Math.floor((_-32)/2),N.background=p[T],_%2===1&&(N.background=N.background+"_semi")):_===45?N.background="transparent":(N.foreground="black",_===47&&(N.underline=!0));var V=l<=23?1:2,Y=this.channels[V];return Y.setBkgData(N),x(l,_,this.cmdHistory),!0},E.reset=function(){for(var l=0;l<Object.keys(this.channels).length;l++){var _=this.channels[l];_&&_.reset()}this.cmdHistory=O()},E.cueSplitAtTime=function(l){for(var _=0;_<this.channels.length;_++){var h=this.channels[_];h&&h.cueSplitAtTime(l)}},w}();function x(w,E,b){b.a=w,b.b=E}function R(w,E,b){return b.a===w&&b.b===E}function O(){return{a:null,b:null}}j.default=C},"./src/utils/codecs.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"isCodecType",function(){return D}),M.d(j,"isCodecSupportedInMp4",function(){return F});var X={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function D(K,H){var P=X[H];return!!P&&P[K.slice(0,4)]===!0}function F(K,H){return MediaSource.isTypeSupported((H||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/utils/vttparser.ts"),D=M("./src/utils/webvtt-parser.ts"),F=M("./src/utils/texttrack-utils.ts"),K=/\s/,H={newCue:function(I,y,m,p){for(var c=[],u,f,s,r,a,d=self.VTTCue||self.TextTrackCue,L=0;L<p.rows.length;L++)if(u=p.rows[L],s=!0,r=0,a="",!u.isEmpty()){for(var C=0;C<u.chars.length;C++)K.test(u.chars[C].uchar)&&s?r++:(a+=u.chars[C].uchar,s=!1);u.cueStartTime=y,y===m&&(m+=1e-4),r>=16?r--:r++;var x=Object(X.fixLineBreaks)(a.trim()),R=Object(D.generateCueId)(y,m,x);(!I||!I.cues||!I.cues.getCueById(R))&&(f=new d(y,m,x),f.id=R,f.line=L+1,f.align="left",f.position=10+Math.min(80,Math.floor(r*8/32)*10),c.push(f))}return I&&c.length&&(c.sort(function(O,w){return O.line==="auto"||w.line==="auto"?0:O.line>8&&w.line>8?w.line-O.line:O.line-w.line}),c.forEach(function(O){return Object(F.addCueToTrack)(I,O)})),c}};j.default=H},"./src/utils/discontinuities.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"findFirstFragWithCC",function(){return K}),M.d(j,"shouldAlignOnDiscontinuities",function(){return H}),M.d(j,"findDiscontinuousReferenceFrag",function(){return P}),M.d(j,"adjustSlidingStart",function(){return y}),M.d(j,"alignStream",function(){return m}),M.d(j,"alignPDT",function(){return c}),M.d(j,"alignFragmentByPDTDelta",function(){return u}),M.d(j,"alignMediaPlaylistByPDT",function(){return f});var X=M("./src/polyfills/number.ts"),D=M("./src/utils/logger.ts"),F=M("./src/controller/level-helper.ts");function K(s,r){for(var a=null,d=0,L=s.length;d<L;d++){var C=s[d];if(C&&C.cc===r){a=C;break}}return a}function H(s,r,a){return!!(r.details&&(a.endCC>a.startCC||s&&s.cc<a.startCC))}function P(s,r){var a=s.fragments,d=r.fragments;if(!d.length||!a.length){D.logger.log("No fragments to align");return}var L=K(a,d[0].cc);if(!L||L&&!L.startPTS){D.logger.log("No frag in previous level to align on");return}return L}function I(s,r){if(s){var a=s.start+r;s.start=s.startPTS=a,s.endPTS=a+s.duration}}function y(s,r){for(var a=r.fragments,d=0,L=a.length;d<L;d++)I(a[d],s);r.fragmentHint&&I(r.fragmentHint,s),r.alignedSliding=!0}function m(s,r,a){if(!r)return;p(s,a,r),!a.alignedSliding&&r.details&&c(a,r.details),!a.alignedSliding&&r.details&&!a.skippedSegments&&Object(F.adjustSliding)(r.details,a)}function p(s,r,a){if(H(s,a,r)){var d=P(a.details,r);d&&Object(X.isFiniteNumber)(d.start)&&(D.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),y(d.start,r))}}function c(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var a=r.fragments[0].programDateTime,d=s.fragments[0].programDateTime,L=(d-a)/1e3+r.fragments[0].start;L&&Object(X.isFiniteNumber)(L)&&(D.logger.log("Adjusting PTS using programDateTime delta "+(d-a)+"ms, sliding:"+L.toFixed(3)+" "+s.url+" "),y(L,s))}function u(s,r){var a=s.programDateTime;if(!a)return;var d=(a-r)/1e3;s.start=s.startPTS=d,s.endPTS=d+s.duration}function f(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var a=r.fragments[0].programDateTime,d=r.fragments[0].start,L=a-d*1e3;s.fragments.forEach(function(C){u(C,L)}),s.fragmentHint&&u(s.fragmentHint,L),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/utils/ewma.ts"),D=function(){function F(H,P,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(H),this.fast_=new X.default(P)}var K=F.prototype;return K.update=function(P,I){var y=this.slow_,m=this.fast_;this.slow_.halfLife!==P&&(this.slow_=new X.default(P,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new X.default(I,m.getEstimate(),m.getTotalWeight()))},K.sample=function(P,I){P=Math.max(P,this.minDelayMs_);var y=8*I,m=P/1e3,p=y/m;this.fast_.sample(m,p),this.slow_.sample(m,p)},K.canEstimate=function(){var P=this.fast_;return P&&P.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},F}();j.default=D},"./src/utils/ewma.ts":function(oe,j,M){"use strict";M.r(j);var X=function(){function D(K,H,P){H===void 0&&(H=0),P===void 0&&(P=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=H,this.totalWeight_=P}var F=D.prototype;return F.sample=function(H,P){var I=Math.pow(this.alpha_,H);this.estimate_=P*(1-I)+I*this.estimate_,this.totalWeight_+=H},F.getTotalWeight=function(){return this.totalWeight_},F.getEstimate=function(){if(this.alpha_){var H=1-Math.pow(this.alpha_,this.totalWeight_);if(H)return this.estimate_/H}return this.estimate_},D}();j.default=X},"./src/utils/fetch-loader.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"fetchSupported",function(){return u});var X=M("./src/polyfills/number.ts"),D=M("./src/loader/load-stats.ts"),F=M("./src/demux/chunk-cache.ts");function K(d,L){d.prototype=Object.create(L.prototype),d.prototype.constructor=d,m(d,L)}function H(d){var L=typeof Map=="function"?new Map:void 0;return H=function(x){if(x===null||!y(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof L!="undefined"){if(L.has(x))return L.get(x);L.set(x,R)}function R(){return P(x,arguments,p(this).constructor)}return R.prototype=Object.create(x.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),m(R,x)},H(d)}function P(d,L,C){return I()?P=Reflect.construct:P=function(R,O,w){var E=[null];E.push.apply(E,O);var b=Function.bind.apply(R,E),l=new b;return w&&m(l,w.prototype),l},P.apply(null,arguments)}function I(){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(d){return!1}}function y(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function m(d,L){return m=Object.setPrototypeOf||function(x,R){return x.__proto__=R,x},m(d,L)}function p(d){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},p(d)}function c(){return c=Object.assign||function(d){for(var L=1;L<arguments.length;L++){var C=arguments[L];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(d[x]=C[x])}return d},c.apply(this,arguments)}function u(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var f=function(){function d(C){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=C.fetchSetup||r,this.controller=new self.AbortController,this.stats=new D.LoadStats}var L=d.prototype;return L.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},L.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},L.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},L.load=function(x,R,O){var w=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var b=s(x,this.controller.signal),l=O.onProgress,_=x.responseType==="arraybuffer",h=_?"byteLength":"length";this.context=x,this.config=R,this.callbacks=O,this.request=this.fetchSetup(x,b),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){w.abortInternal(),O.onTimeout(E,x,w.response)},R.timeout),self.fetch(this.request).then(function(g){if(w.response=w.loader=g,!g.ok){var T=g.status,N=g.statusText;throw new a(N||"fetch, bad network response",T,g)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(g.headers.get("Content-Length")||"0"),l&&Object(X.isFiniteNumber)(R.highWaterMark)?w.loadProgressively(g,E,x,R.highWaterMark,l):_?g.arrayBuffer():g.text()}).then(function(g){var T=w.response;self.clearTimeout(w.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=g[h];var N={url:T.url,data:g};l&&!Object(X.isFiniteNumber)(R.highWaterMark)&&l(E,x,g,T),O.onSuccess(N,E,x,T)}).catch(function(g){if(self.clearTimeout(w.requestTimeout),E.aborted)return;var T=g.code||0;O.onError({code:T,text:g.message},x,g.details)})},L.getCacheAge=function(){var x=null;if(this.response){var R=this.response.headers.get("age");x=R?parseFloat(R):null}return x},L.loadProgressively=function(x,R,O,w,E){w===void 0&&(w=0);var b=new F.default,l=x.body.getReader(),_=function h(){return l.read().then(function(g){if(g.done)return b.dataLength&&E(R,O,b.flush(),x),Promise.resolve(new ArrayBuffer(0));var T=g.value,N=T.length;return R.loaded+=N,N<w||b.dataLength?(b.push(T),b.dataLength>=w&&E(R,O,b.flush(),x)):E(R,O,T,x),h()}).catch(function(){return Promise.reject()})};return _()},d}();function s(d,L){var C={method:"GET",mode:"cors",credentials:"same-origin",signal:L,headers:new self.Headers(c({},d.headers))};return d.rangeEnd&&C.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),C}function r(d,L){return new self.Request(d.url,L)}var a=function(d){K(L,d);function L(C,x,R){var O;return O=d.call(this,C)||this,O.code=void 0,O.details=void 0,O.code=x,O.details=R,O}return L}(H(Error));j.default=f},"./src/utils/imsc1-ttml-parser.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"IMSC1_CODEC",function(){return y}),M.d(j,"parseIMSC1",function(){return u});var X=M("./src/utils/mp4-tools.ts"),D=M("./src/utils/vttparser.ts"),F=M("./src/utils/vttcue.ts"),K=M("./src/demux/id3.ts"),H=M("./src/utils/timescale-conversion.ts"),P=M("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(w){for(var E=1;E<arguments.length;E++){var b=arguments[E];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(w[l]=b[l])}return w},I.apply(this,arguments)}var y="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function u(w,E,b,l,_){var h=Object(X.findBox)(new Uint8Array(w),["mdat"]);if(h.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var g=h[0],T=Object(K.utf8ArrayToStr)(new Uint8Array(w,g.start,g.end-g.start)),N=Object(H.toTimescaleFromScale)(E,1,b);try{l(f(T,N))}catch(V){_(V)}}function f(w,E){var b=new DOMParser,l=b.parseFromString(w,"text/xml"),_=l.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var h={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},g=Object.keys(h).reduce(function(U,A){return U[A]=_.getAttribute("ttp:"+A)||h[A],U},{}),T=_.getAttribute("xml:space")!=="preserve",N=r(s(_,"styling","style")),V=r(s(_,"layout","region")),Y=s(_,"body","[begin]");return[].map.call(Y,function(U){var A=a(U,T);if(!A||!U.hasAttribute("begin"))return null;var J=x(U.getAttribute("begin"),g),te=x(U.getAttribute("dur"),g),se=x(U.getAttribute("end"),g);if(J===null)throw C(U);if(se===null){if(te===null)throw C(U);se=J+te}var fe=new F.default(J-E,se-E,A);fe.id=Object(P.generateCueId)(fe.startTime,fe.endTime,fe.text);var Ue=V[U.getAttribute("region")],Re=N[U.getAttribute("style")];fe.position=10,fe.size=80;var De=d(Ue,Re),Fe=De.textAlign;if(Fe){var Me=c[Fe];Me&&(fe.lineAlign=Me),fe.align=Fe}return I(fe,De),fe}).filter(function(U){return U!==null})}function s(w,E,b){var l=w.getElementsByTagName(E)[0];return l?[].slice.call(l.querySelectorAll(b)):[]}function r(w){return w.reduce(function(E,b){var l=b.getAttribute("xml:id");return l&&(E[l]=b),E},{})}function a(w,E){return[].slice.call(w.childNodes).reduce(function(b,l,_){var h;return l.nodeName==="br"&&_?b+`
|
|
`:(h=l.childNodes)!==null&&h!==void 0&&h.length?a(l,E):E?b+l.textContent.trim().replace(/\s+/g," "):b+l.textContent},"")}function d(w,E){var b="http://www.w3.org/ns/ttml#styling",l=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return l.reduce(function(_,h){var g=L(E,b,h)||L(w,b,h);return g&&(_[h]=g),_},{})}function L(w,E,b){return w.hasAttributeNS(E,b)?w.getAttributeNS(E,b):null}function C(w){return new Error("Could not parse ttml timestamp "+w)}function x(w,E){if(!w)return null;var b=Object(D.parseTimeStamp)(w);return b===null&&(m.test(w)?b=R(w,E):p.test(w)&&(b=O(w,E))),b}function R(w,E){var b=m.exec(w),l=(b[4]|0)+(b[5]|0)/E.subFrameRate;return(b[1]|0)*3600+(b[2]|0)*60+(b[3]|0)+l/E.frameRate}function O(w,E){var b=p.exec(w),l=Number(b[1]),_=b[2];switch(_){case"h":return l*3600;case"m":return l*60;case"ms":return l*1e3;case"f":return l/E.frameRate;case"t":return l/E.tickRate}return l}},"./src/utils/logger.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"enableLogs",function(){return P}),M.d(j,"logger",function(){return I});var X=function(){},D={trace:X,debug:X,log:X,warn:X,info:X,error:X},F=D;function K(y){var m=self.console[y];return m?m.bind(self.console,"["+y+"] >"):X}function H(y){for(var m=arguments.length,p=new Array(m>1?m-1:0),c=1;c<m;c++)p[c-1]=arguments[c];p.forEach(function(u){F[u]=y[u]?y[u].bind(y):K(u)})}function P(y){if(self.console&&y===!0||typeof y=="object"){H(y,"debug","log","info","warn","error");try{F.log()}catch(m){F=D}}else F=D}var I=F},"./src/utils/mediakeys-helper.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"KeySystems",function(){return X}),M.d(j,"requestMediaKeySystemAccess",function(){return D});var X;(function(F){F.WIDEVINE="com.widevine.alpha",F.PLAYREADY="com.microsoft.playready"})(X||(X={}));var D=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"bin2str",function(){return H}),M.d(j,"readUint16",function(){return P}),M.d(j,"readUint32",function(){return I}),M.d(j,"writeUint32",function(){return y}),M.d(j,"findBox",function(){return m}),M.d(j,"parseSegmentIndex",function(){return p}),M.d(j,"parseInitSegment",function(){return c}),M.d(j,"getStartDTS",function(){return u}),M.d(j,"getDuration",function(){return f}),M.d(j,"computeRawDurationFromSamples",function(){return s}),M.d(j,"offsetStartDTS",function(){return r}),M.d(j,"segmentValidRange",function(){return a}),M.d(j,"appendUint8Array",function(){return d});var X=M("./src/utils/typed-array.ts"),D=M("./src/loader/fragment.ts"),F=Math.pow(2,32)-1,K=[].push;function H(L){return String.fromCharCode.apply(null,L)}function P(L,C){"data"in L&&(C+=L.start,L=L.data);var x=L[C]<<8|L[C+1];return x<0?65536+x:x}function I(L,C){"data"in L&&(C+=L.start,L=L.data);var x=L[C]<<24|L[C+1]<<16|L[C+2]<<8|L[C+3];return x<0?4294967296+x:x}function y(L,C,x){"data"in L&&(C+=L.start,L=L.data),L[C]=x>>24,L[C+1]=x>>16&255,L[C+2]=x>>8&255,L[C+3]=x&255}function m(L,C){var x=[];if(!C.length)return x;var R,O,w;"data"in L?(R=L.data,O=L.start,w=L.end):(R=L,O=0,w=R.byteLength);for(var E=O;E<w;){var b=I(R,E),l=H(R.subarray(E+4,E+8)),_=b>1?E+b:w;if(l===C[0])if(C.length===1)x.push({data:R,start:E+8,end:_});else{var h=m({data:R,start:E+8,end:_},C.slice(1));h.length&&K.apply(x,h)}E=_}return x}function p(L){var C=m(L,["moov"]),x=C[0],R=x?x.end:null,O=m(L,["sidx"]);if(!O||!O[0])return null;var w=[],E=O[0],b=E.data[0],l=b===0?8:16,_=I(E,l);l+=4;var h=0,g=0;b===0?l+=8:l+=16,l+=2;var T=E.end+g,N=P(E,l);l+=2;for(var V=0;V<N;V++){var Y=l,U=I(E,Y);Y+=4;var A=U&2147483647,J=(U&2147483648)>>>31;if(J===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=I(E,Y);Y+=4,w.push({referenceSize:A,subsegmentDuration:te,info:{duration:te/_,start:T,end:T+A-1}}),T+=A,Y+=4,l=Y}return{earliestPresentationTime:h,timescale:_,version:b,referencesCount:N,references:w,moovEndOffset:R}}function c(L){for(var C=[],x=m(L,["moov","trak"]),R=0;R<x.length;R++){var O=x[R],w=m(O,["tkhd"])[0];if(w){var E=w.data[w.start],b=E===0?12:20,l=I(w,b),_=m(O,["mdia","mdhd"])[0];if(_){E=_.data[_.start],b=E===0?12:20;var h=I(_,b),g=m(O,["mdia","hdlr"])[0];if(g){var T=H(g.data.subarray(g.start+8,g.start+12)),N={soun:D.ElementaryStreamTypes.AUDIO,vide:D.ElementaryStreamTypes.VIDEO}[T];if(N){var V=m(O,["mdia","minf","stbl","stsd"])[0],Y=void 0;V&&(Y=H(V.data.subarray(V.start+12,V.start+16))),C[l]={timescale:h,type:N},C[N]={timescale:h,id:l,codec:Y}}}}}}var U=m(L,["moov","mvex","trex"]);return U.forEach(function(A){var J=I(A,4),te=C[J];te&&(te.default={duration:I(A,12),flags:I(A,20)})}),C}function u(L,C){return m(C,["moof","traf"]).reduce(function(x,R){var O=m(R,["tfdt"])[0],w=O.data[O.start],E=m(R,["tfhd"]).reduce(function(b,l){var _=I(l,4),h=L[_];if(h){var g=I(O,4);w===1&&(g*=Math.pow(2,32),g+=I(O,8));var T=h.timescale||9e4,N=g/T;if(isFinite(N)&&(b===null||N<b))return N}return b},null);return E!==null&&isFinite(E)&&(x===null||E<x)?E:x},null)||0}function f(L,C){for(var x=0,R=0,O=0,w=m(L,["moof","traf"]),E=0;E<w.length;E++){var b=w[E],l=m(b,["tfhd"])[0],_=I(l,4),h=C[_];if(!h)continue;var g=h.default,T=I(l,0)|(g==null?void 0:g.flags),N=g==null?void 0:g.duration;T&8&&(T&2?N=I(l,12):N=I(l,8));for(var V=h.timescale||9e4,Y=m(b,["trun"]),U=0;U<Y.length;U++){if(N){var A=I(Y[U],4);x=N*A}else x=s(Y[U]);h.type===D.ElementaryStreamTypes.VIDEO?R+=x/V:h.type===D.ElementaryStreamTypes.AUDIO&&(O+=x/V)}}if(R===0&&O===0){var J=p(L);if(J!=null&&J.references)return J.references.reduce(function(te,se){return te+se.info.duration||0},0)}return R||O}function s(L){var C=I(L,0),x=8;C&1&&(x+=4),C&4&&(x+=4);for(var R=0,O=I(L,4),w=0;w<O;w++){if(C&256){var E=I(L,x);R+=E,x+=4}C&512&&(x+=4),C&1024&&(x+=4),C&2048&&(x+=4)}return R}function r(L,C,x){m(C,["moof","traf"]).forEach(function(R){m(R,["tfhd"]).forEach(function(O){var w=I(O,4),E=L[w];if(!E)return;var b=E.timescale||9e4;m(R,["tfdt"]).forEach(function(l){var _=l.data[l.start],h=I(l,4);if(_===0)y(l,4,h-x*b);else{h*=Math.pow(2,32),h+=I(l,8),h-=x*b,h=Math.max(h,0);var g=Math.floor(h/(F+1)),T=Math.floor(h%(F+1));y(l,4,g),y(l,8,T)}})})})}function a(L){var C={valid:null,remainder:null},x=m(L,["moof"]);if(x){if(x.length<2)return C.remainder=L,C}else return C;var R=x[x.length-1];return C.valid=Object(X.sliceUint8)(L,0,R.start-8),C.remainder=Object(X.sliceUint8)(L,R.start-8),C}function d(L,C){var x=new Uint8Array(L.length+C.length);return x.set(L),x.set(C,L.length),x}},"./src/utils/output-filter.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"default",function(){return X});var X=function(){function D(K,H){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=H}var F=D.prototype;return F.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},F.newCue=function(H,P,I){(this.startTime===null||this.startTime>H)&&(this.startTime=H),this.endTime=P,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},F.reset=function(){this.cueRanges=[]},D}()},"./src/utils/texttrack-utils.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"sendAddTrackEvent",function(){return D}),M.d(j,"addCueToTrack",function(){return F}),M.d(j,"clearCurrentCues",function(){return K}),M.d(j,"removeCuesInRange",function(){return H}),M.d(j,"getCuesInRange",function(){return I});var X=M("./src/utils/logger.ts");function D(y,m){var p;try{p=new Event("addtrack")}catch(c){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=y,m.dispatchEvent(p)}function F(y,m){var p=y.mode;if(p==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(m.id))try{if(y.addCue(m),!y.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(u){X.logger.debug("[texttrack-utils]: "+u);var c=new self.TextTrackCue(m.startTime,m.endTime,m.text);c.id=m.id,y.addCue(c)}p==="disabled"&&(y.mode=p)}function K(y){var m=y.mode;if(m==="disabled"&&(y.mode="hidden"),y.cues)for(var p=y.cues.length;p--;)y.removeCue(y.cues[p]);m==="disabled"&&(y.mode=m)}function H(y,m,p){var c=y.mode;if(c==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var u=I(y.cues,m,p),f=0;f<u.length;f++)y.removeCue(u[f]);c==="disabled"&&(y.mode=c)}function P(y,m){if(m<y[0].startTime)return 0;var p=y.length-1;if(m>y[p].endTime)return-1;for(var c=0,u=p;c<=u;){var f=Math.floor((u+c)/2);if(m<y[f].startTime)u=f-1;else if(m>y[f].startTime&&c<p)c=f+1;else return f}return y[c].startTime-m<m-y[u].startTime?c:u}function I(y,m,p){var c=[],u=P(y,m);if(u>-1)for(var f=u,s=y.length;f<s;f++){var r=y[f];if(r.startTime>=m&&r.endTime<=p)c.push(r);else if(r.startTime>p)return c}return c}},"./src/utils/time-ranges.ts":function(oe,j,M){"use strict";M.r(j);var X={toString:function(F){for(var K="",H=F.length,P=0;P<H;P++)K+="["+F.start(P).toFixed(3)+","+F.end(P).toFixed(3)+"]";return K}};j.default=X},"./src/utils/timescale-conversion.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"toTimescaleFromBase",function(){return D}),M.d(j,"toTimescaleFromScale",function(){return F}),M.d(j,"toMsFromMpegTsClock",function(){return K}),M.d(j,"toMpegTsClockFromTimescale",function(){return H});var X=9e4;function D(P,I,y,m){y===void 0&&(y=1),m===void 0&&(m=!1);var p=P*I*y;return m?Math.round(p):p}function F(P,I,y,m){return y===void 0&&(y=1),m===void 0&&(m=!1),D(P,I,1/y,m)}function K(P,I){return I===void 0&&(I=!1),D(P,1e3,1/X,I)}function H(P,I){return I===void 0&&(I=1),D(P,X,1/I)}},"./src/utils/typed-array.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"sliceUint8",function(){return X});function X(D,F,K){return Uint8Array.prototype.slice?D.slice(F,K):new Uint8Array(Array.prototype.slice.call(D,F,K))}},"./src/utils/vttcue.ts":function(oe,j,M){"use strict";M.r(j),j.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],D=["start","middle","end","left","right"];function F(y,m){if(typeof m!="string")return!1;if(!Array.isArray(y))return!1;var p=m.toLowerCase();return~y.indexOf(p)?p:!1}function K(y){return F(X,y)}function H(y){return F(D,y)}function P(y){for(var m=arguments.length,p=new Array(m>1?m-1:0),c=1;c<m;c++)p[c-1]=arguments[c];for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var s in f)y[s]=f[s]}return y}function I(y,m,p){var c=this,u={enumerable:!0};c.hasBeenReset=!1;var f="",s=!1,r=y,a=m,d=p,L=null,C="",x=!0,R="auto",O="start",w=50,E="middle",b=50,l="middle";Object.defineProperty(c,"id",P({},u,{get:function(){return f},set:function(h){f=""+h}})),Object.defineProperty(c,"pauseOnExit",P({},u,{get:function(){return s},set:function(h){s=!!h}})),Object.defineProperty(c,"startTime",P({},u,{get:function(){return r},set:function(h){if(typeof h!="number")throw new TypeError("Start time must be set to a number.");r=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",P({},u,{get:function(){return a},set:function(h){if(typeof h!="number")throw new TypeError("End time must be set to a number.");a=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",P({},u,{get:function(){return d},set:function(h){d=""+h,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",P({},u,{get:function(){return L},set:function(h){L=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",P({},u,{get:function(){return C},set:function(h){var g=K(h);if(g===!1)throw new SyntaxError("An invalid or illegal string was specified.");C=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",P({},u,{get:function(){return x},set:function(h){x=!!h,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",P({},u,{get:function(){return R},set:function(h){if(typeof h!="number"&&h!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",P({},u,{get:function(){return O},set:function(h){var g=H(h);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");O=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",P({},u,{get:function(){return w},set:function(h){if(h<0||h>100)throw new Error("Position must be between 0 and 100.");w=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",P({},u,{get:function(){return E},set:function(h){var g=H(h);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");E=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",P({},u,{get:function(){return b},set:function(h){if(h<0||h>100)throw new Error("Size must be between 0 and 100.");b=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",P({},u,{get:function(){return l},set:function(h){var g=H(h);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");l=g,this.hasBeenReset=!0}})),c.displayState=void 0}return I.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"parseTimeStamp",function(){return F}),M.d(j,"fixLineBreaks",function(){return m}),M.d(j,"VTTParser",function(){return p});var X=M("./src/utils/vttcue.ts"),D=function(){function c(){}var u=c.prototype;return u.decode=function(s,r){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},c}();function F(c){function u(s,r,a,d){return(s|0)*3600+(r|0)*60+(a|0)+parseFloat(d||0)}var f=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?u(f[2],f[3],0,f[4]):u(f[1],f[2],f[3],f[4]):null}var K=function(){function c(){this.values=Object.create(null)}var u=c.prototype;return u.set=function(s,r){!this.get(s)&&r!==""&&(this.values[s]=r)},u.get=function(s,r,a){return a?this.has(s)?this.values[s]:r[a]:this.has(s)?this.values[s]:r},u.has=function(s){return s in this.values},u.alt=function(s,r,a){for(var d=0;d<a.length;++d)if(r===a[d]){this.set(s,r);break}},u.integer=function(s,r){/^-?\d+$/.test(r)&&this.set(s,parseInt(r,10))},u.percent=function(s,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var a=parseFloat(r);if(a>=0&&a<=100)return this.set(s,a),!0}return!1},c}();function H(c,u,f,s){var r=s?c.split(s):[c];for(var a in r){if(typeof r[a]!="string")continue;var d=r[a].split(f);if(d.length!==2)continue;var L=d[0],C=d[1];u(L,C)}}var P=new X.default(0,0,""),I=P.align==="middle"?"middle":"center";function y(c,u,f){var s=c;function r(){var L=F(c);if(L===null)throw new Error("Malformed timestamp: "+s);return c=c.replace(/^[^\sa-zA-Z-]+/,""),L}function a(L,C){var x=new K;H(L,function(w,E){var b;switch(w){case"region":for(var l=f.length-1;l>=0;l--)if(f[l].id===E){x.set(w,f[l].region);break}break;case"vertical":x.alt(w,E,["rl","lr"]);break;case"line":b=E.split(","),x.integer(w,b[0]),x.percent(w,b[0])&&x.set("snapToLines",!1),x.alt(w,b[0],["auto"]),b.length===2&&x.alt("lineAlign",b[1],["start",I,"end"]);break;case"position":b=E.split(","),x.percent(w,b[0]),b.length===2&&x.alt("positionAlign",b[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":x.percent(w,E);break;case"align":x.alt(w,E,["start",I,"end","left","right"]);break}},/:/,/\s/),C.region=x.get("region",null),C.vertical=x.get("vertical","");var R=x.get("line","auto");R==="auto"&&P.line===-1&&(R=-1),C.line=R,C.lineAlign=x.get("lineAlign","start"),C.snapToLines=x.get("snapToLines",!0),C.size=x.get("size",100),C.align=x.get("align",I);var O=x.get("position","auto");O==="auto"&&P.position===50&&(O=C.align==="start"||C.align==="left"?0:C.align==="end"||C.align==="right"?100:50),C.position=O}function d(){c=c.replace(/^\s+/,"")}if(d(),u.startTime=r(),d(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);c=c.substr(3),d(),u.endTime=r(),d(),a(c,u)}function m(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var p=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new D,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var u=c.prototype;return u.parse=function(s){var r=this;s&&(r.buffer+=r.decoder.decode(s,{stream:!0}));function a(){var O=r.buffer,w=0;for(O=m(O);w<O.length&&O[w]!=="\r"&&O[w]!==`
|
|
`;)++w;var E=O.substr(0,w);return O[w]==="\r"&&++w,O[w]===`
|
|
`&&++w,r.buffer=O.substr(w),E}function d(O){H(O,function(w,E){},/:/)}try{var L="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;L=a();var C=L.match(/^()?WEBVTT([ \t].*)?$/);if(!C||!C[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var x=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;x?x=!1:L=a();switch(r.state){case"HEADER":/:/.test(L)?d(L):L||(r.state="ID");continue;case"NOTE":L||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(L)){r.state="NOTE";break}if(!L)continue;if(r.cue=new X.default(0,0,""),r.state="CUE",L.indexOf("-->")===-1){r.cue.id=L;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{y(L,r.cue,r.regionList)}catch(O){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var R=L.indexOf("-->")!==-1;if(!L||R&&(x=!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+=L}continue;case"BADCUE":L||(r.state="ID")}}}catch(O){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},u.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},c}()},"./src/utils/webvtt-parser.ts":function(oe,j,M){"use strict";M.r(j),M.d(j,"generateCueId",function(){return p}),M.d(j,"parseWebVTT",function(){return u});var X=M("./src/polyfills/number.ts"),D=M("./src/utils/vttparser.ts"),F=M("./src/demux/id3.ts"),K=M("./src/utils/timescale-conversion.ts"),H=M("./src/remux/mp4-remuxer.ts"),P=/\r\n|\n\r|\n|\r/g,I=function(s,r,a){return a===void 0&&(a=0),s.substr(a,r.length)===r},y=function(s){var r=parseInt(s.substr(-3)),a=parseInt(s.substr(-6,2)),d=parseInt(s.substr(-9,2)),L=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(r)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(d)||!Object(X.isFiniteNumber)(L))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return r+=1e3*a,r+=60*1e3*d,r+=60*60*1e3*L,r},m=function(s){for(var r=5381,a=s.length;a;)r=r*33^s.charCodeAt(--a);return(r>>>0).toString()};function p(f,s,r){return m(f.toString())+m(s.toString())+m(r)}var c=function(s,r,a){var d=s[r],L=s[d.prevCC];if(!L||!L.new&&d.new){s.ccOffset=s.presentationOffset=d.start,d.new=!1;return}for(;(C=L)!==null&&C!==void 0&&C.new;){var C;s.ccOffset+=d.start-L.start,d.new=!1,d=L,L=s[d.prevCC]}s.presentationOffset=a};function u(f,s,r,a,d,L,C,x){var R=new D.VTTParser,O=Object(F.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(P,`
|
|
`).split(`
|
|
`),w=[],E=Object(K.toMpegTsClockFromTimescale)(s,r),b="00:00.000",l=0,_=0,h,g=!0,T=!1;R.oncue=function(N){var V=a[d],Y=a.ccOffset,U=(l-E)/9e4;if(V!=null&&V.new&&(_!==void 0?Y=a.ccOffset=V.start:c(a,d,U)),U&&(Y=U-a.presentationOffset),T){var A=N.endTime-N.startTime,J=Object(H.normalizePts)((N.startTime+Y-_)*9e4,L*9e4)/9e4;N.startTime=J,N.endTime=J+A}var te=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(te)),N.id||(N.id=p(N.startTime,N.endTime,te)),N.endTime>0&&w.push(N)},R.onparsingerror=function(N){h=N},R.onflush=function(){if(h){x(h);return}C(w)},O.forEach(function(N){if(g)if(I(N,"X-TIMESTAMP-MAP=")){g=!1,T=!0,N.substr(16).split(",").forEach(function(V){I(V,"LOCAL:")?b=V.substr(6):I(V,"MPEGTS:")&&(l=parseInt(V.substr(7)))});try{_=y(b)/1e3}catch(V){T=!1,h=V}return}else N===""&&(g=!1);R.parse(N+`
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(oe,j,M){"use strict";M.r(j);var X=M("./src/utils/logger.ts"),D=M("./src/loader/load-stats.ts"),F=/^age:\s*[\d.]+\s*$/m,K=function(){function H(I){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=I?I.xhrSetup:null,this.stats=new D.LoadStats,this.retryDelay=0}var P=H.prototype;return P.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},P.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},P.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},P.load=function(y,m,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},P.loadInternal=function(){var y=this.config,m=this.context;if(!y)return;var p=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var u=this.xhrSetup;try{if(u)try{u(p,m.url)}catch(r){p.open("GET",m.url,!0),u(p,m.url)}p.readyState||p.open("GET",m.url,!0);var f=this.context.headers;if(f)for(var s in f)p.setRequestHeader(s,f[s])}catch(r){this.callbacks.onError({code:p.status,text:r.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),p.send()},P.readystatechange=function(){var y=this.context,m=this.loader,p=this.stats;if(!y||!m)return;var c=m.readyState,u=this.config;if(p.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),c===4){m.onreadystatechange=null,m.onprogress=null;var f=m.status;if(f>=200&&f<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var s,r;if(y.responseType==="arraybuffer"?(s=m.response,r=s.byteLength):(s=m.responseText,r=s.length),p.loaded=p.total=r,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(p,y,s,m),!this.callbacks)return;var d={url:m.responseURL,data:s};this.callbacks.onSuccess(d,p,y,m)}else p.retry>=u.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+y.url),this.callbacks.onError({code:f,text:m.statusText},y,m)):(X.logger.warn(f+" while loading "+y.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,u.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.timeout)},P.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},P.loadprogress=function(y){var m=this.stats;m.loaded=y.loaded,y.lengthComputable&&(m.total=y.total)},P.getCacheAge=function(){var y=null;if(this.loader&&F.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");y=m?parseFloat(m):null}return y},H}();j.default=K}}).default})},vHTk:function(ht,et,Z){ht.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},xiVL:function(ht,et){ht.exports="data:image/png;base64,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"},xvzu:function(ht,et,Z){ht.exports={flex_box_center:"flex_box_center___11Yx1",flex_space_between:"flex_space_between___3B8wg",flex_box_vertical_center:"flex_box_vertical_center___1cm8r",flex_box_center_end:"flex_box_center_end___2h7Wz",flex_box_column:"flex_box_column___1vJbd",wrap:"wrap___30mNN",modal:"modal___39YWi",titleWrap:"titleWrap___25lJO",required:"required___2_KP9",title:"title___dFjtB",colorGray:"colorGray___3RoHj",choiceWrap:"choiceWrap___14CFD",answer:"answer___10oFr",activeAnswer:"activeAnswer___S76uT",deleteIcon:"deleteIcon___kKaJg",addIcon:"addIcon___3w3u_",editorWrap:"editorWrap___3DrnO",htmlWrap:"htmlWrap___1tGnP",radio:"radio___24YhJ",color333:"color333___1O71o",color999:"color999___xHfER",questionType:"questionType___22Z7J",questionChoices:"questionChoices____Unas"}},ygoZ:function(ht,et){ht.exports="data:image/png;base64,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"},z4EP:function(ht,et){ht.exports="data:image/png;base64,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"}}]);
|