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.
361 lines
997 KiB
361 lines
997 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[225,7,9],{"+NIl":function(Me,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(X,R){"use strict";function Q(D,w){D.cmdState.push(w)}function B(D){return D.cmdState.length>0?D.cmdState[D.cmdState.length-1]:null}function _(D){var w=D.cmdState.pop();w&&w.closeBracket()}function G(D){for(var w=D.cmdState,C=w.length-1;C>=0;C--){var h=w[C];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function j(D,w,C){return function(){this.name=D,this.bracketNo=0,this.style=w,this.styles=C,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=j("importmodule","tag",["string","builtin"]),O.documentclass=j("documentclass","tag",["","atom"]),O.usepackage=j("usepackage","tag",["atom"]),O.begin=j("begin","tag",["atom"]),O.end=j("end","tag",["atom"]),O.label=j("label","tag",["atom"]),O.ref=j("ref","tag",["atom"]),O.eqref=j("eqref","tag",["atom"]),O.cite=j("cite","tag",["atom"]),O.bibitem=j("bibitem","tag",["atom"]),O.Bibitem=j("Bibitem","tag",["atom"]),O.RBibitem=j("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function M(D,w){D.f=w}function y(D,w){var C;if(D.match(/^\\[a-zA-Z@]+/)){var h=D.current().slice(1);return C=O.hasOwnProperty(h)?O[h]:O.DEFAULT,C=new C,Q(w,C),M(w,k),C.style}if(D.match(/^\\[$&%#{}_]/))return"tag";if(D.match(/^\\[,;!\/\\]/))return"tag";if(D.match("\\["))return M(w,function(l,d){return T(l,d,"\\]")}),"keyword";if(D.match("\\("))return M(w,function(l,d){return T(l,d,"\\)")}),"keyword";if(D.match("$$"))return M(w,function(l,d){return T(l,d,"$$")}),"keyword";if(D.match("$"))return M(w,function(l,d){return T(l,d,"$")}),"keyword";var o=D.next();if(o=="%")return D.skipToEnd(),"comment";if(o=="}"||o=="]"){if(C=B(w),C)C.closeBracket(o),M(w,k);else return"error";return"bracket"}else return o=="{"||o=="["?(C=O.DEFAULT,C=new C,Q(w,C),"bracket"):/\d/.test(o)?(D.eatWhile(/[\w.%]/),"atom"):(D.eatWhile(/[\w\-_]/),C=G(w),C.name=="begin"&&(C.argument=D.current()),C.styleIdentifier())}function T(D,w,C){if(D.eatSpace())return null;if(C&&D.match(C))return M(w,y),"keyword";if(D.match(/^\\[a-zA-Z@]+/))return"tag";if(D.match(/^[a-zA-Z]+/))return"variable-2";if(D.match(/^\\[$&%#{}_]/))return"tag";if(D.match(/^\\[,;!\/]/))return"tag";if(D.match(/^[\^_&]/))return"tag";if(D.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(D.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=D.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(D.skipToEnd(),"comment"):"error"}function k(D,w){var C=D.peek(),h;return C=="{"||C=="["?(h=B(w),h.openBracket(C),D.eat(C),M(w,y),"bracket"):/[ \t\r]/.test(C)?(D.eat(C),null):(M(w,y),_(w),y(D,w))}return{startState:function(){var D=R.inMathMode?function(w,C){return T(w,C)}:y;return{cmdState:[],f:D}},copyState:function(D){return{cmdState:D.cmdState.slice(),f:D.f}},token:function(D,w){return w.f(D,w)},blankLine:function(D){D.f=y,D.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"/GNS":function(Me,Le,Z){Me.exports=Z.p+"static/search1.c4136dd4.png"},"19Vz":function(Me,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(j,O,M){var y=M&&M!=ie.Init;if(O&&!y)j.on("blur",B),j.on("change",_),j.on("swapDoc",_),ie.on(j.getInputField(),"compositionupdate",j.state.placeholderCompose=function(){Q(j)}),_(j);else if(!O&&y){j.off("blur",B),j.off("change",_),j.off("swapDoc",_),ie.off(j.getInputField(),"compositionupdate",j.state.placeholderCompose),X(j);var T=j.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}O&&!j.hasFocus()&&B(j)});function X(j){j.state.placeholder&&(j.state.placeholder.parentNode.removeChild(j.state.placeholder),j.state.placeholder=null)}function R(j){X(j);var O=j.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=j.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var M=j.getOption("placeholder");typeof M=="string"&&(M=document.createTextNode(M)),O.appendChild(M),j.display.lineSpace.insertBefore(O,j.display.lineSpace.firstChild)}function Q(j){setTimeout(function(){var O=!1,M=j.getInputField();M.nodeName=="TEXTAREA"?O=!M.value:j.lineCount()==1&&(O=!/[^\u200b]/.test(M.querySelector(".CodeMirror-line").textContent)),O?R(j):X(j)},20)}function B(j){G(j)&&R(j)}function _(j){var O=j.getWrapperElement(),M=G(j);O.className=O.className.replace(" CodeMirror-empty","")+(M?" CodeMirror-empty":""),M?R(j):X(j)}function G(j){return j.lineCount()===1&&j.getLine(0)===""}})},"1eCo":function(Me,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var X={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},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Q,B){var _=Q.indentUnit,G={},j=B.htmlMode?X:R;for(var O in j)G[O]=j[O];for(var O in B)G[O]=B[O];var M,y;function T(a,b){function v(H){return b.tokenize=H,H(a,b)}var x=a.next();if(x=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?v(w("atom","]]>")):null:a.match("--")?v(w("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),v(C(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=w("meta","?>"),"meta"):(M=a.eat("/")?"closeTag":"openTag",b.tokenize=k,"tag bracket");if(x=="&"){var P;return a.eat("#")?a.eat("x")?P=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):P=a.eatWhile(/[\d]/)&&a.eat(";"):P=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),P?"atom":"error"}else return a.eatWhile(/[^&<]/),null}T.isInText=!0;function k(a,b){var v=a.next();if(v==">"||v=="/"&&a.eat(">"))return b.tokenize=T,M=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return M="equals",null;if(v=="<"){b.tokenize=T,b.state=d,b.tagName=b.tagStart=null;var x=b.tokenize(a,b);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(v)?(b.tokenize=D(v),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function D(a){var b=function(v,x){for(;!v.eol();)if(v.next()==a){x.tokenize=k;break}return"string"};return b.isInAttribute=!0,b}function w(a,b){return function(v,x){for(;!v.eol();){if(v.match(b)){x.tokenize=T;break}v.next()}return a}}function C(a){return function(b,v){for(var x;(x=b.next())!=null;){if(x=="<")return v.tokenize=C(a+1),v.tokenize(b,v);if(x==">")if(a==1){v.tokenize=T;break}else return v.tokenize=C(a-1),v.tokenize(b,v)}return"meta"}}function h(a,b,v){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=v,(G.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function l(a,b){for(var v;;){if(!a.context)return;if(v=a.context.tagName,!G.contextGrabbers.hasOwnProperty(v)||!G.contextGrabbers[v].hasOwnProperty(b))return;o(a)}}function d(a,b,v){return a=="openTag"?(v.tagStart=b.column(),A):a=="closeTag"?f:d}function A(a,b,v){return a=="word"?(v.tagName=b.current(),y="tag",E):G.allowMissingTagName&&a=="endTag"?(y="tag bracket",E(a,b,v)):(y="error",A)}function f(a,b,v){if(a=="word"){var x=b.current();return v.context&&v.context.tagName!=x&&G.implicitlyClosed.hasOwnProperty(v.context.tagName)&&o(v),v.context&&v.context.tagName==x||G.matchClosing===!1?(y="tag",g):(y="tag error",L)}else return G.allowMissingTagName&&a=="endTag"?(y="tag bracket",g(a,b,v)):(y="error",L)}function g(a,b,v){return a!="endTag"?(y="error",g):(o(v),d)}function L(a,b,v){return y="error",g(a,b,v)}function E(a,b,v){if(a=="word")return y="attribute",m;if(a=="endTag"||a=="selfcloseTag"){var x=v.tagName,P=v.tagStart;return v.tagName=v.tagStart=null,a=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(x)?l(v,x):(l(v,x),v.context=new h(v,x,P==v.indented)),d}return y="error",E}function m(a,b,v){return a=="equals"?c:(G.allowMissing||(y="error"),E(a,b,v))}function c(a,b,v){return a=="string"?u:a=="word"&&G.allowUnquoted?(y="string",E):(y="error",E(a,b,v))}function u(a,b,v){return a=="string"?u:E(a,b,v)}return{startState:function(a){var b={tokenize:T,state:d,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(b.baseIndent=a),b},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;M=null;var v=b.tokenize(a,b);return(v||M)&&v!="comment"&&(y=null,b.state=b.state(M||v,a,b),y&&(v=y=="error"?v+" error":y)),v},indent:function(a,b,v){var x=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+_;if(x&&x.noIndent)return ie.Pass;if(a.tokenize!=k&&a.tokenize!=T)return v?v.match(/^(\s*)/)[0].length:0;if(a.tagName)return G.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+_*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(b))return 0;var P=b&&/^<(\/)?([\w_:\.-]*)/.exec(b);if(P&&P[1])for(;x;)if(x.tagName==P[2]){x=x.prev;break}else if(G.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(P)for(;x;){var H=G.contextGrabbers[x.tagName];if(H&&H.hasOwnProperty(P[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+_:a.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(a){a.state==c&&(a.state=E)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var b=[],v=a.context;v;v=v.prev)v.tagName&&b.push(v.tagName);return b.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2RCv":function(Me,Le,Z){"use strict";var ie=Z("Awhp"),X=Z("KrTs"),R=Z("+L6B"),Q=Z("2/Rp"),B=Z("5NDa"),_=Z("5rEg"),G=Z("0Owb"),j=Z("oBTY"),O=Z("tJVT"),M=Z("PpiC"),y=Z("q1tI"),T=Z.n(y),k=function(w){var C=w.InputRight,h=w.value,o=h===void 0?[]:h,l=w.onChange,d=l===void 0?function(){}:l,A=Object(M.a)(w,["InputRight","value","onChange"]),f=Object(y.useState)(),g=Object(O.a)(f,2),L=g[0],E=g[1],m=function(a){var b=o.filter(function(v,x){return x!==a});d(b)},c=function(a){if(a.preventDefault(),!L)return;d([].concat(Object(j.a)(o),[L])),E(null)};return T.a.createElement("div",null,T.a.createElement(_.a,Object(G.a)({},A,{value:L,onChange:function(a){return E(a.target.value)},onPressEnter:c,onBlur:c})),C,T.a.createElement("div",{className:"mt20"},o==null?void 0:o.map(function(u,a){return T.a.createElement(X.a,{className:"ml10 mr10",count:"x",onClick:function(){return m(a)}},T.a.createElement(Q.a,{type:"primary",ghost:!0},u))})))};Le.a=k},"4qgm":function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD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Q+A80bVUmpLhzcVSMHbDuyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(Me,Le,Z){"use strict";Z.d(Le,"a",function(){return l});var ie=Z("Ty5D"),X=Z("dI71"),R=Z("q1tI"),Q=Z.n(R),B=Z("YS25"),_=Z("17x9"),G=Z.n(_),j=Z("wx14"),O=Z("zLVn"),M=Z("9R94"),y=function(c){Object(X.a)(u,c);function u(){for(var b,v=arguments.length,x=new Array(v),P=0;P<v;P++)x[P]=arguments[P];return b=c.call.apply(c,[this].concat(x))||this,b.history=Object(B.a)(b.props),b}var a=u.prototype;return a.render=function(){return Q.a.createElement(ie.c,{history:this.history,children:this.props.children})},u}(Q.a.Component),T=function(c){Object(X.a)(u,c);function u(){for(var b,v=arguments.length,x=new Array(v),P=0;P<v;P++)x[P]=arguments[P];return b=c.call.apply(c,[this].concat(x))||this,b.history=Object(B.b)(b.props),b}var a=u.prototype;return a.render=function(){return Q.a.createElement(ie.c,{history:this.history,children:this.props.children})},u}(Q.a.Component),k=function(u,a){return typeof u=="function"?u(a):u},D=function(u,a){return typeof u=="string"?Object(B.c)(u,null,null,a):u},w=function(u){return u},C=Q.a.forwardRef;typeof C=="undefined"&&(C=w);function h(c){return!!(c.metaKey||c.altKey||c.ctrlKey||c.shiftKey)}var o=C(function(c,u){var a=c.innerRef,b=c.navigate,v=c.onClick,x=Object(O.a)(c,["innerRef","navigate","onClick"]),P=x.target,H=Object(j.a)({},x,{onClick:function($){try{v&&v($)}catch(z){throw $.preventDefault(),z}!$.defaultPrevented&&$.button===0&&(!P||P==="_self")&&!h($)&&($.preventDefault(),b())}});return w!==C?H.ref=u||a:H.ref=a,Q.a.createElement("a",H)}),l=C(function(c,u){var a=c.component,b=a===void 0?o:a,v=c.replace,x=c.to,P=c.innerRef,H=Object(O.a)(c,["component","replace","to","innerRef"]);return Q.a.createElement(ie.e.Consumer,null,function(V){V||Object(M.a)(!1);var $=V.history,z=D(k(x,V.location),V.location),F=z?$.createHref(z):"",ee=Object(j.a)({},H,{href:F,navigate:function(){var le=k(x,V.location),ve=v?$.replace:$.push;ve(le)}});return w!==C?ee.ref=u||P:ee.innerRef=P,Q.a.createElement(b,ee)})});if(!1)var d,A;var f=function(u){return u},g=Q.a.forwardRef;typeof g=="undefined"&&(g=f);function L(){for(var c=arguments.length,u=new Array(c),a=0;a<c;a++)u[a]=arguments[a];return u.filter(function(b){return b}).join(" ")}var E=g(function(c,u){var a=c["aria-current"],b=a===void 0?"page":a,v=c.activeClassName,x=v===void 0?"active":v,P=c.activeStyle,H=c.className,V=c.exact,$=c.isActive,z=c.location,F=c.sensitive,ee=c.strict,oe=c.style,le=c.to,ve=c.innerRef,Ie=Object(O.a)(c,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Q.a.createElement(ie.e.Consumer,null,function(xe){xe||Object(M.a)(!1);var Ce=z||xe.location,Te=D(k(le,Ce),Ce),Se=Te.pathname,pe=Se&&Se.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),se=pe?Object(ie.f)(Ce.pathname,{path:pe,exact:V,sensitive:F,strict:ee}):null,De=!!($?$(se,Ce):se),Ye=De?L(H,x):H,Ge=De?Object(j.a)({},oe,{},P):oe,$e=Object(j.a)({"aria-current":De&&b||null,className:Ye,style:Ge,to:Te},Ie);return f!==g?$e.ref=u||ve:$e.innerRef=ve,Q.a.createElement(l,$e)})});if(!1)var m},"5D2P":function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAFTklEQVRoQ91aS4xURRQ993UzUUZcqFEc4meh0cQFSlwgrvAHSgQWhOhCk4GZqmdw+ERUWDkrBMUBnIzzqqYjcTaaGBLFxA8MjIk/3PhZCCa6UAyKC11ARnDo6Wvu+HrS0/R7r96nWVBJpxfv3nPPrbp169aHUEAzxsxl5gcB3AdgAREtkH8AXSH87wBOMfMp+QfwFREd0Vr/k9c8ZQUwxixi5mWe5y1l5qUAyimxqkQ0XqvVxonoE631Nyn1p8VTO7B///75Fy5c2MzMWwB0ZDHaQmeSiPbMmTNnb3d39+k0mKkcMMZsBiC/W9IYSSH7K4C9Wuu9rjpODoyMjNxQq9VGADzuCpxT7gPP83p7e3v/TMJJdCAIgoVEdBDAzUlgBX8/ycwrfd//Pg431gFr7RPM/HbBxFLBEdGTSql3opQiHQiCoI+IXk9lrU3CzLzR9/3BVvAtHbDWPsrMH7aJTyZYInpMKfVRs/JFDlQqlduq1eoxIro2k6U2KTHzX+VyeXFPT8/PjSYucsBae4iZH24Tj1ywRHRYKfVIpANhnt+Ty0r7lbc0rhMzI2CMuRHAlwBubT+HXBZ+AbBEa/3HrFLCWruTmV/MBZ1N+TiAdyNUX2qZeYh2KaW2zThQqVTumZqaOlZgbePqynEiWquU+qFZwRjzBoBnIoAmS6WSTOhvp0PIGPMcgN2uVguSiyQfBIFPRMMJdrZqrV+bdsBa+x4zryqImAtMJHlr7RJmPgxgbhwQEb2vlFpNAwMDV3Z2dp7JUM+7EG0lE0l+dHS089y5c4dkkjqAVycmJq4ma+0yZv7YQaEIkUjyAh4EwTAR+a6GiGg5BUGwg4i2uyrlkEsi7xL3s8wz88syAm8x89M5iLmoxpIP4348bRYkolEyxowBkA25S1sLQJbyHhfhUCaWvMT9+fPnx5h5cQrMuugRceAEgDsdlKfTVph2rwMgC4mk37gWSz5L3DcZ+1EckAw0L44FM4/4vq+aZfr7+zu6urq2MbPMoSuavieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"7Cbv":function(Me,Le,Z){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),X=new Uint8Array(16);function R(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(X)}var Q=/^(?:[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 B(k){return typeof k=="string"&&Q.test(k)}for(var _=B,G=[],j=0;j<256;++j)G.push((j+256).toString(16).substr(1));function O(k){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,w=(G[k[D+0]]+G[k[D+1]]+G[k[D+2]]+G[k[D+3]]+"-"+G[k[D+4]]+G[k[D+5]]+"-"+G[k[D+6]]+G[k[D+7]]+"-"+G[k[D+8]]+G[k[D+9]]+"-"+G[k[D+10]]+G[k[D+11]]+G[k[D+12]]+G[k[D+13]]+G[k[D+14]]+G[k[D+15]]).toLowerCase();if(!_(w))throw TypeError("Stringified UUID is invalid");return w}var M=O;function y(k,D,w){k=k||{};var C=k.random||(k.rng||R)();if(C[6]=C[6]&15|64,C[8]=C[8]&63|128,D){w=w||0;for(var h=0;h<16;++h)D[w+h]=C[h];return D}return M(C)}var T=Le.a=y},"7ZXX":function(Me,Le,Z){Me.exports=Z.p+"static/err.6e7c5817.png"},"7ahc":function(Me,Le,Z){"use strict";Z.d(Le,"a",function(){return A});var ie=Z("k1fw"),X=Z("0Owb"),R=Z("+L6B"),Q=Z("2/Rp"),B=Z("y8nQ"),_=Z("Vl3Y"),G=Z("tJVT"),j=Z("OaEy"),O=Z("2fM7"),M=Z("q1tI"),y=Z.n(M),T=Z("VrN/"),k=Z.n(T),D=Z("p77/"),w=Z.n(D),C=Z("c5Ni"),h=Z.n(C),o=O.a.Option,l={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"]};Le.b=function(f){var g=f.callback,L=f.onCancel,E=Object(M.useState)("python"),m=Object(G.a)(E,2),c=m[0],u=m[1];function a(v){u(d[v][1])}function b(v){g(v)}return y.a.createElement(_.a,Object(X.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),y.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(O.a,{onChange:a},Object.keys(d).map(function(v){return y.a.createElement(o,{key:v,value:v},d[v][0])}))),y.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(A,{mode:c})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(Q.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function A(f){var g=f.value,L=f.onChange,E=f.mode,m=f.options,c=m===void 0?{}:m,u=Object(M.useRef)(),a=Object(M.useState)(),b=Object(G.a)(a,2),v=b[0],x=b[1];return Object(M.useEffect)(function(){if(v){function P(H){var V=H.getValue();L&&L(V)}return v.on("change",P),function(){v.off("change",P)}}},[v,L]),Object(M.useEffect)(function(){v&&v.setOption("mode",E)},[v,E]),Object(M.useEffect)(function(){v&&((g!==v.getValue()||g==="")&&setTimeout(function(){v.setValue(g||" ")},300))},[v,g]),Object(M.useEffect)(function(){if(u.current&&!v){var P=k.a.fromTextArea(u.current,Object(ie.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));x(P)}},[u.current,v]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:u}))}},"7ixt":function(Me,Le,Z){"use strict";Z.d(Le,"a",function(){return R});var ie={adjustX:1,adjustY:1},X=[0,0],R={left:{points:["cr","cl"],overflow:ie,offset:[-4,0],targetOffset:X},right:{points:["cl","cr"],overflow:ie,offset:[4,0],targetOffset:X},top:{points:["bc","tc"],overflow:ie,offset:[0,-4],targetOffset:X},bottom:{points:["tc","bc"],overflow:ie,offset:[0,4],targetOffset:X},topLeft:{points:["bl","tl"],overflow:ie,offset:[0,-4],targetOffset:X},leftTop:{points:["tr","tl"],overflow:ie,offset:[-4,0],targetOffset:X},topRight:{points:["br","tr"],overflow:ie,offset:[0,-4],targetOffset:X},rightTop:{points:["tl","tr"],overflow:ie,offset:[4,0],targetOffset:X},bottomRight:{points:["tr","br"],overflow:ie,offset:[0,4],targetOffset:X},rightBottom:{points:["bl","br"],overflow:ie,offset:[4,0],targetOffset:X},bottomLeft:{points:["tl","bl"],overflow:ie,offset:[0,4],targetOffset:X},leftBottom:{points:["br","bl"],overflow:ie,offset:[-4,0],targetOffset:X}},Q=R},"7v3h":function(Me,Le,Z){Me.exports=Z.p+"static/empty2.dd73f390.png"},"8/bI":function(Me,Le,Z){Me.exports=Z.p+"static/empty.8918e228.png"},"8EBN":function(Me,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.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 X=0;X<ie.modeInfo.length;X++){var R=ie.modeInfo[X];R.mimes&&(R.mime=R.mimes[0])}ie.findModeByMIME=function(Q){Q=Q.toLowerCase();for(var B=0;B<ie.modeInfo.length;B++){var _=ie.modeInfo[B];if(_.mime==Q)return _;if(_.mimes){for(var G=0;G<_.mimes.length;G++)if(_.mimes[G]==Q)return _}}if(/\+xml$/.test(Q))return ie.findModeByMIME("application/xml");if(/\+json$/.test(Q))return ie.findModeByMIME("application/json")},ie.findModeByExtension=function(Q){Q=Q.toLowerCase();for(var B=0;B<ie.modeInfo.length;B++){var _=ie.modeInfo[B];if(_.ext){for(var G=0;G<_.ext.length;G++)if(_.ext[G]==Q)return _}}},ie.findModeByFileName=function(Q){for(var B=0;B<ie.modeInfo.length;B++){var _=ie.modeInfo[B];if(_.file&&_.file.test(Q))return _}var G=Q.lastIndexOf("."),j=G>-1&&Q.substring(G+1,Q.length);if(j)return ie.findModeByExtension(j)},ie.findModeByName=function(Q){Q=Q.toLowerCase();for(var B=0;B<ie.modeInfo.length;B++){var _=ie.modeInfo[B];if(_.name.toLowerCase()==Q)return _;if(_.alias){for(var G=0;G<_.alias.length;G++)if(_.alias[G].toLowerCase()==Q)return _}}}})},"8hTe":function(Me,Le,Z){Me.exports={button:"button___1wy9m"}},"9Bee":function(Me,Le,Z){"use strict";var ie=Z("DYRE"),X=Z("zeV3"),R=Z("+L6B"),Q=Z("2/Rp"),B=Z("k1fw"),_=Z("9og8"),G=Z("tJVT"),j=Z("WmNS"),O=Z.n(j),M=Z("q1tI"),y=Z.n(M),T=Z("vg9a"),k=Z("DlQD"),D=Z.n(k),w=Z("rUJ1");function C(W,s){var p=W.match(/^(\s+)(?:```)/);if(p===null)return s;var I=p[1];return s.split(`
|
|
`).map(function(J){var U=J.match(/^\s+/);if(U===null)return J;var ce=Object(G.a)(U,1),Oe=ce[0];return Oe.length>=I.length?J.slice(I.length):J}).join(`
|
|
`)}var h=[],o=["<ul>"],l=new D.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){h.length=0,o=["<ul>"]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function g(W,s,p,I){if(s>=W.length||W[s].level<=p)return s;var J=W[s];I.push("<li><a href='#"+J.anchor+"'>"+J.text+"</a>"),s++;var U=[];return s=g(W,s,J.level,U),U.length>0&&(I.push("<ul>"),U.forEach(function(ce){I.push(ce)}),I.push("</ul>")),I.push("</li>"),s=g(W,s,p,I),s}function L(){return g(h,0,0,o),o.push("</ul>"),o.join("")}var E={heading:function(s){var p=d.exec(s);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},fences:function(s){var p=this.rules.block.fences.exec(s);if(p){var I=p[0],J=C(I,p[3]||""),U=p[2]?p[2].trim():p[2];if(["latex","katex","math"].indexOf(U)>=0){var ce=u(),Oe=J;J=ce,a[ce]={type:"block",expression:Oe}}return{type:"code",raw:I,lang:U,text:J}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,u=function(){return"__special_katext_id_".concat(c++,"__")},a={};function b(){return a}function v(){c=0,a={}}function x(W){return W=W.replace(m,function(s,p){var I=u();return a[I]={type:"inline",expression:p},I}),W}var P=l.listitem;l.listitem=function(W){return P(x(W))};var H=l.paragraph;l.paragraph=function(W){return H(x(W))};var V=l.tablecell;l.tablecell=function(W,s){return V(x(W),s)},l.code=function(W,s,p){var I=(s||"").match(/\S*/)[0];return I?["latex","katex","math"].indexOf(I)>=0?"<p class='editormd-tex'>".concat(W,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(s,'">').concat(p?W:Object(w.escape)(W,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(p?W:Object(w.escape)(W,!0))+"</code></pre>"},l.heading=function(W,s,p){var I=this.options.headerPrefix+p.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:I,level:s,text:W}),"<h"+s+' id="'+I+'">'+W+"</h"+s+">"},D.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),D.a.use({tokenizer:E,renderer:l});var $=D.a,z=Z("SJMd"),F=Z("ulZh"),ee=Z.n(F),oe=Z("m3rI"),le=Z("Oy/b"),ve=Z("p5ED"),Ie=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 xe=function(W,s){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,I){p.__proto__=I}||function(p,I){for(var J in I)Object.prototype.hasOwnProperty.call(I,J)&&(p[J]=I[J])})(W,s)};function Ce(W,s){function p(){this.constructor=W}xe(W,s),W.prototype=s===null?Object.create(s):(p.prototype=s.prototype,new p)}function Te(W,s,p,I){return new(p||(p=Promise))(function(J,U){function ce(ft){try{Qe(I.next(ft))}catch(Ne){U(Ne)}}function Oe(ft){try{Qe(I.throw(ft))}catch(Ne){U(Ne)}}function Qe(ft){var Ne;ft.done?J(ft.value):(Ne=ft.value,Ne instanceof p?Ne:new p(function(yt){yt(Ne)})).then(ce,Oe)}Qe((I=I.apply(W,s||[])).next())})}function Se(W,s){var p,I,J,U,ce={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return U={next:Oe(0),throw:Oe(1),return:Oe(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function Oe(Qe){return function(ft){return function(Ne){if(p)throw new TypeError("Generator is already executing.");for(;ce;)try{if(p=1,I&&(J=2&Ne[0]?I.return:Ne[0]?I.throw||((J=I.return)&&J.call(I),0):I.next)&&!(J=J.call(I,Ne[1])).done)return J;switch(I=0,J&&(Ne=[2&Ne[0],J.value]),Ne[0]){case 0:case 1:J=Ne;break;case 4:return ce.label++,{value:Ne[1],done:!1};case 5:ce.label++,I=Ne[1],Ne=[0];continue;case 7:Ne=ce.ops.pop(),ce.trys.pop();continue;default:if(!(J=ce.trys,(J=J.length>0&&J[J.length-1])||Ne[0]!==6&&Ne[0]!==2)){ce=0;continue}if(Ne[0]===3&&(!J||Ne[1]>J[0]&&Ne[1]<J[3])){ce.label=Ne[1];break}if(Ne[0]===6&&ce.label<J[1]){ce.label=J[1],J=Ne;break}if(J&&ce.label<J[2]){ce.label=J[2],ce.ops.push(Ne);break}J[2]&&ce.ops.pop(),ce.trys.pop();continue}Ne=s.call(W,ce)}catch(yt){Ne=[6,yt],I=0}finally{p=J=0}if(5&Ne[0])throw Ne[1];return{value:Ne[0]?Ne[1]:void 0,done:!0}}([Qe,ft])}}}function pe(){for(var W=0,s=0,p=arguments.length;s<p;s++)W+=arguments[s].length;var I=Array(W),J=0;for(s=0;s<p;s++)for(var U=arguments[s],ce=0,Oe=U.length;ce<Oe;ce++,J++)I[J]=U[ce];return I}var se=function(){function W(){}return W.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},W.setAttributes=function(s,p){for(var I=0,J=p;I<J.length;I++){var U=J[I],ce=U[0],Oe=U[1];s.setAttribute(ce,Oe)}},W.createRect=function(s,p,I){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",s.toString()),J.setAttribute("height",p.toString()),I&&W.setAttributes(J,I),J},W.createLine=function(s,p,I,J,U){var ce=document.createElementNS("http://www.w3.org/2000/svg","line");return ce.setAttribute("x1",s.toString()),ce.setAttribute("y1",p.toString()),ce.setAttribute("x2",I.toString()),ce.setAttribute("y2",J.toString()),U&&W.setAttributes(ce,U),ce},W.createPolygon=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","polygon");return I.setAttribute("points",s),p&&W.setAttributes(I,p),I},W.createCircle=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","circle");return I.setAttribute("cx",(s/2).toString()),I.setAttribute("cy",(s/2).toString()),I.setAttribute("r",s.toString()),p&&W.setAttributes(I,p),I},W.createEllipse=function(s,p,I){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(s/2).toString()),J.setAttribute("cy",(p/2).toString()),J.setAttribute("rx",(s/2).toString()),J.setAttribute("ry",(p/2).toString()),I&&W.setAttributes(J,I),J},W.createGroup=function(s){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return s&&W.setAttributes(p,s),p},W.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},W.createMarker=function(s,p,I,J,U,ce,Oe){var Qe=document.createElementNS("http://www.w3.org/2000/svg","marker");return W.setAttributes(Qe,[["id",s],["orient",p],["markerWidth",I.toString()],["markerHeight",J.toString()],["refX",U.toString()],["refY",ce.toString()]]),Qe.appendChild(Oe),Qe},W.createText=function(s){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),s&&W.setAttributes(p,s),p},W.createTSpan=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","tspan");return I.textContent=s,p&&W.setAttributes(I,p),I},W.createImage=function(s){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return s&&W.setAttributes(p,s),p},W.createPoint=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return I.x=s,I.y=p,I},W.createPath=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","path");return I.setAttribute("d",s),p&&W.setAttributes(I,p),I},W}(),De=function(){function W(){}return W.addKey=function(s){W.key=s},Object.defineProperty(W,"isLicensed",{get:function(){return!!W.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(W.key)},enumerable:!1,configurable:!0}),W}(),Ye=function(){function W(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return W.prototype.rasterize=function(s,p,I){var J=this;return new Promise(function(U){var ce=I!==void 0?I:document.createElement("canvas");s===null&&(J.markersOnly=!0,J.naturalSize=!1);var Oe=document.createElementNS("http://www.w3.org/2000/svg","svg");Oe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Oe.setAttribute("width",p.width.baseVal.valueAsString),Oe.setAttribute("height",p.height.baseVal.valueAsString),Oe.setAttribute("viewBox","0 0 "+p.viewBox.baseVal.width.toString()+" "+p.viewBox.baseVal.height.toString()),Oe.innerHTML=p.innerHTML,J.naturalSize===!0?(Oe.width.baseVal.value=s.naturalWidth,Oe.height.baseVal.value=s.naturalHeight):J.width!==void 0&&J.height!==void 0&&(Oe.width.baseVal.value=J.width,Oe.height.baseVal.value=J.height),ce.width=Oe.width.baseVal.value,ce.height=Oe.height.baseVal.value;var Qe=Oe.outerHTML,ft=ce.getContext("2d");J.markersOnly!==!0&&ft.drawImage(s,0,0,ce.width,ce.height);var Ne=window.URL,yt=new Image(ce.width,ce.height);yt.setAttribute("crossOrigin","anonymous");var Bt=new Blob([Qe],{type:"image/svg+xml"}),Kt=Ne.createObjectURL(Bt);yt.onload=function(){ft.drawImage(yt,0,0),Ne.revokeObjectURL(Kt);var Ir=ce.toDataURL(J.imageType,J.imageQuality);U(Ir)},yt.src=Kt})},W}(),Ge=function(){},$e=function(){function W(s){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+s+"_"}return Object.defineProperty(W.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(W.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(W.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),W.prototype.addClass=function(s){return this.styleSheet===void 0&&this.addStyleSheet(),s.name=""+this.classNamePrefix+s.localName,this.classes.push(s),this.styleSheet.sheet.insertRule("."+s.name+" {"+s.style+"}",this.styleSheet.sheet.cssRules.length),s},W.prototype.addRule=function(s){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(s),this.styleSheet.sheet.insertRule(s.selector+" {"+s.style+"}",this.styleSheet.sheet.cssRules.length)},W.prototype.addStyleSheet=function(){var s;this.styleSheet=document.createElement("style"),((s=this.styleSheetRoot)!==null&&s!==void 0?s:document.head).appendChild(this.styleSheet),this.addRule(new et("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new et("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new et("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Re("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Re("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},W.prototype.removeStyleSheet=function(){var s;this.styleSheet&&(((s=this.styleSheetRoot)!==null&&s!==void 0?s:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},W}(),et=function(W,s){this.selector=W,this.style=s},Re=function(W,s){this.localName=W,this.style=s},Be=function(){function W(s,p,I,J,U){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=s,this.displayMode=p,this.markerItems=I,this.uiStyleSettings=J,this.styles=U,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return W.prototype.show=function(s){var p=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=s,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var I=document.createElement("div");I.className=this.toolbarBlockStyleClass.name,I.style.whiteSpace="nowrap",this.uiContainer.appendChild(I),this.addActionButton(I,'<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(I,'<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(I,'<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(I,'<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(I,'<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(I,'<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(I,'<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(I,'<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(U){var ce=document.createElement("div");ce.className=""+p.toolbarButtonStyleClass.name,ce.setAttribute("data-type-name",U.typeName),ce.innerHTML=U.icon,ce.addEventListener("click",function(){p.markerToolbarButtonClicked(ce,U)}),p.buttons.push(ce),p.markerButtons.push(ce)}),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 J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'<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(J,'<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()},W.prototype.addButtonClickListener=function(s){this.buttonClickListeners.push(s)},W.prototype.removeButtonClickListener=function(s){this.buttonClickListeners.indexOf(s)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(s),1)},W.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},W.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var s=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var p=0;p<this.markerButtons.length;p++)p<s||p===s&&this.markerButtons.length-1===s?this.markerButtonBlock.appendChild(this.markerButtons[p]):(p===s&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[p]))}},W.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")},W.prototype.resetButtonStyles=function(){var s=this;this.buttons.forEach(function(p){p.className=p.className.replace(s.uiStyleSettings.toolbarButtonStyleColorsClassName?s.uiStyleSettings.toolbarButtonStyleColorsClassName:s.toolbarButtonStyleColorsClass.name,"").trim(),p.className=p.className.replace(s.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?s.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:s.toolbarActiveButtonStyleColorsClass.name,"").trim(),p.className+=" "+(s.uiStyleSettings.toolbarButtonStyleColorsClassName?s.uiStyleSettings.toolbarButtonStyleColorsClassName:s.toolbarButtonStyleColorsClass.name)})},W.prototype.addActionButton=function(s,p,I){var J=this,U=document.createElement("div");switch(U.className=""+this.toolbarButtonStyleClass.name,U.innerHTML=p,U.setAttribute("data-action",I),U.addEventListener("click",function(){J.actionToolbarButtonClicked(U,I)}),I){case"select":U.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":U.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":U.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":U.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":U.style.fill=this.uiStyleSettings.closeButtonColor}s.appendChild(U),this.buttons.push(U)},W.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Re("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 Re("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Re("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Re("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 Re("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var s=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Re("toolbar_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.toolbarButtonStyleColorsClass=this.styles.addClass(new Re("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Re("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new et("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new et("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},W.prototype.markerToolbarButtonClicked=function(s,p){this.setActiveButton(s),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(I){return I("marker",p)}),this.markerButtonOverflowBlock.style.display="none"},W.prototype.actionToolbarButtonClicked=function(s,p){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(I){return I("action",p)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},W.prototype.setActiveButton=function(s){this.resetButtonStyles(),s.className=s.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),s.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},W.prototype.setActiveMarkerButton=function(s){var p=this.markerButtons.find(function(I){return I.getAttribute("data-type-name")===s});p&&this.setActiveButton(p)},W.prototype.setCurrentMarker=function(s){var p=this;this.currentMarker=s,this.buttons.filter(function(I){return/delete|notes/.test(I.getAttribute("data-action"))}).forEach(function(I){p.currentMarker===void 0?(I.style.fillOpacity="0.4",I.style.pointerEvents="none"):(I.style.fillOpacity="1",I.style.pointerEvents="all")})},W}(),He=function(){function W(s,p,I,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=s,this.displayMode=p,this.uiStyleSettings=I,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return W.prototype.addStyles=function(){var s;this.toolboxStyleClass=this.styles.addClass(new Re("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 Re("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Re("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Re("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Re("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 Re("toolbox-panel-row_colors",`
|
|
background-color: `+((s=this.uiStyleSettings.toolboxBackgroundColor)!==null&&s!==void 0?s:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Re("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new et("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new et("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},W.prototype.show=function(s){var p;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=s,this.uiContainer.className=this.toolboxStyleClass.name+" "+((p=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},W.prototype.setPanelButtons=function(s){var p,I,J=this;this.panels=s,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((p=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(U){var ce;U.uiStyleSettings=J.uiStyleSettings;var Oe=document.createElement("div");Oe.className=J.toolboxButtonStyleClass.name+" "+((ce=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ce!==void 0?ce:J.toolboxButtonStyleColorsClass.name),Oe.innerHTML=U.icon,Oe.title=U.title,Oe.addEventListener("click",function(){J.panelButtonClick(U)}),J.panelButtons.push(Oe),J.buttonRow.appendChild(Oe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},W.prototype.panelButtonClick=function(s){var p=this,I=-1;if(s!==this.activePanel){I=this.panels.indexOf(s),this.panelRow.innerHTML="";var J=s.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),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=s}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){p.displayMode==="inline"?p.panelRow.style.display="none":p.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(U,ce){var Oe,Qe;U.className=p.toolboxButtonStyleClass.name+" "+(ce===I?""+((Oe=p.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Oe!==void 0?Oe:p.toolboxActiveButtonStyleColorsClass.name):""+((Qe=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Qe!==void 0?Qe:p.toolboxButtonStyleColorsClass.name))})},W}(),Xe=function(W,s){this.title=W,this.icon=s},Ke=function(W){function s(p,I,J,U){var ce=W.call(this,p,U||'<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 ce.colors=[],ce.addTransparent=!1,ce.colorBoxes=[],ce.colors=I,ce.currentColor=J,ce.setCurrentColor=ce.setCurrentColor.bind(ce),ce.getColorBox=ce.getColorBox.bind(ce),ce}return Ce(s,W),s.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.whiteSpace="nowrap",this.colors.forEach(function(J){var U=p.getColorBox(J);I.appendChild(U),p.colorBoxes.push(U)}),I},s.prototype.getColorBox=function(p){var I=this,J=this.uiStyleSettings.toolbarHeight/4,U=this.uiStyleSettings.toolbarHeight-J,ce=document.createElement("div");ce.style.display="inline-block",ce.style.boxSizing="content-box",ce.style.width=U-2+"px",ce.style.height=U-2+"px",ce.style.padding="1px",ce.style.marginRight="2px",ce.style.marginBottom="2px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderRadius=(U+2)/2+"px",ce.style.borderColor=p===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){I.setCurrentColor(p,ce)});var Oe=document.createElement("div");return Oe.style.display="inline-block",Oe.style.width=U-2+"px",Oe.style.height=U-2+"px",Oe.style.backgroundColor=p,Oe.style.borderRadius=U/2+"px",p==="transparent"&&(Oe.style.fill=this.uiStyleSettings.toolboxAccentColor,Oe.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>`),ce.appendChild(Oe),ce},s.prototype.setCurrentColor=function(p,I){var J=this;this.currentColor=p,this.colorBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(p)},s}(Xe),Fe=function(){function W(s,p,I){this._state="new",this._isSelected=!1,this._container=s,this._overlayContainer=p,this.globalSettings=I,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(W.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),W.prototype.ownsTarget=function(s){return!1},Object.defineProperty(W.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),W.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},W.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},W.prototype.pointerDown=function(s,p){},W.prototype.dblClick=function(s,p){},W.prototype.manipulate=function(s){},W.prototype.pointerUp=function(s){this.stateChanged()},W.prototype.dispose=function(){},W.prototype.addMarkerVisualToContainer=function(s){this.container.childNodes.length>0?this.container.insertBefore(s,this.container.childNodes[0]):this.container.appendChild(s)},W.prototype.getState=function(){return{typeName:W.typeName,state:this.state,notes:this.notes}},W.prototype.restoreState=function(s){this._state=s.state,this.notes=s.notes},W.prototype.scale=function(s,p){},W.prototype.colorChanged=function(s){this.onColorChanged&&this.onColorChanged(s),this.stateChanged()},W.prototype.fillColorChanged=function(s){this.onFillColorChanged&&this.onFillColorChanged(s),this.stateChanged()},W.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var s=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),s.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(s)&&this.onStateChanged(this)}},W.typeName="MarkerBase",W}(),Pe=function(){function W(){this.findGripByVisual=this.findGripByVisual.bind(this)}return W.prototype.findGripByVisual=function(s){return this.topLeft.ownsTarget(s)?this.topLeft:this.topCenter.ownsTarget(s)?this.topCenter:this.topRight.ownsTarget(s)?this.topRight:this.centerLeft.ownsTarget(s)?this.centerLeft:this.centerRight.ownsTarget(s)?this.centerRight:this.bottomLeft.ownsTarget(s)?this.bottomLeft:this.bottomCenter.ownsTarget(s)?this.bottomCenter:this.bottomRight.ownsTarget(s)?this.bottomRight:void 0},W}(),ot=function(){function W(){this.GRIP_SIZE=10,this.visual=se.createGroup(),this.visual.appendChild(se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return W.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},W}(),Je=function(){function W(){}return W.toITransformMatrix=function(s){return{a:s.a,b:s.b,c:s.c,d:s.d,e:s.e,f:s.f}},W.toSVGMatrix=function(s,p){return s.a=p.a,s.b=p.b,s.c=p.c,s.d=p.d,s.e=p.e,s.f=p.f,s},W}(),Ze=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.left=0,U.top=0,U.width=0,U.height=0,U.defaultSize={x:50,y:20},U.offsetX=0,U.offsetY=0,U.rotationAngle=0,U.CB_DISTANCE=10,U._suppressMarkerCreateEvent=!1,U.container.transform.baseVal.appendItem(se.createTransform()),U.setupControlBox(),U}return Ce(s,W),Object.defineProperty(s.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"visual",{get:function(){return this._visual},set:function(p){this._visual=p;var I=se.createTransform();this._visual.transform.baseVal.appendItem(I)},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(p){return!!W.prototype.ownsTarget.call(this,p)||!!(this.controlGrips.findGripByVisual(p)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(p))},s.prototype.pointerDown=function(p,I){W.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.left=p.x,this.top=p.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(p);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(I),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I)){this.activeGrip=this.rotatorGrip;var U=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=U.x-this.width/2,this.top=U.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ce=this.container.transform.baseVal.getItem(0);ce.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ce,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},s.prototype.pointerUp=function(p){var I=this.state;W.prototype.pointerUp.call(this,p),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(p),this._state="select",I==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},s.prototype.moveVisual=function(p){this.visual.style.transform="translate("+p.x+"px, "+p.y+"px)"},s.prototype.manipulate=function(p){var I=this.unrotatePoint(p);this.state==="creating"?this.resize(p):this.state==="move"?(this.left=this.manipulationStartLeft+(I.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(I.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(I):this.state==="rotate"&&this.rotate(p)},s.prototype.resize=function(p){var I=this.manipulationStartLeft,J=this.manipulationStartWidth,U=this.manipulationStartTop,ce=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:I=this.manipulationStartLeft+p.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-I;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+p.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:U=this.manipulationStartTop+p.y-this.manipulationStartY,ce=this.manipulationStartHeight+this.manipulationStartTop-U;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ce=this.manipulationStartHeight+p.y-this.manipulationStartY}J>=0?(this.left=I,this.width=J):(this.left=I+J,this.width=-J),ce>=0?(this.top=U,this.height=ce):(this.top=U+ce,this.height=-ce),this.setSize()},s.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},s.prototype.rotate=function(p){if(Math.abs(p.x-this.centerX)>.1){var I=Math.sign(p.x-this.centerX);this.rotationAngle=180*Math.atan((p.y-this.centerY)/(p.x-this.centerX))/Math.PI+90*I,this.applyRotation()}},s.prototype.applyRotation=function(){var p=this.container.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(p,0)},s.prototype.rotatePoint=function(p){if(this.rotationAngle===0)return p;var I=this.container.getCTM(),J=se.createPoint(p.x,p.y);return{x:(J=J.matrixTransform(I)).x,y:J.y}},s.prototype.unrotatePoint=function(p){if(this.rotationAngle===0)return p;var I=this.container.getCTM();I=I.inverse();var J=se.createPoint(p.x,p.y);return{x:(J=J.matrixTransform(I)).x,y:J.y}},s.prototype.select=function(){W.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){W.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var p=se.createTransform();p.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(p),this.container.appendChild(this.controlBox),this.controlRect=se.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=se.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 Pe,this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){var p=this.controlBox.transform.baseVal.getItem(0);p.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(p,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()},s.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()},s.prototype.createGrip=function(){var p=new ot;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},s.prototype.positionGrips=function(){var p=this.controlGrips.topLeft.GRIP_SIZE,I=-p/2,J=I,U=(this.width+this.CB_DISTANCE)/2-p/2,ce=(this.height+this.CB_DISTANCE)/2-p/2,Oe=this.height+this.CB_DISTANCE-p/2,Qe=this.width+this.CB_DISTANCE-p/2;this.positionGrip(this.controlGrips.topLeft.visual,I,J),this.positionGrip(this.controlGrips.topCenter.visual,U,J),this.positionGrip(this.controlGrips.topRight.visual,Qe,J),this.positionGrip(this.controlGrips.centerLeft.visual,I,ce),this.positionGrip(this.controlGrips.centerRight.visual,Qe,ce),this.positionGrip(this.controlGrips.bottomLeft.visual,I,Oe),this.positionGrip(this.controlGrips.bottomCenter.visual,U,Oe),this.positionGrip(this.controlGrips.bottomRight.visual,Qe,Oe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,U,J-3*this.CB_DISTANCE)},s.prototype.positionGrip=function(p,I,J){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,J),p.transform.baseVal.replaceItem(U,0)},s.prototype.hideControlBox=function(){this.controlBox.style.display="none"},s.prototype.showControlBox=function(){this.controlBox.style.display=""},s.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},W.prototype.getState.call(this))},s.prototype.restoreState=function(p){W.prototype.restoreState.call(this,p);var I=p;this.left=I.left,this.top=I.top,this.width=I.width,this.height=I.height,this.rotationAngle=I.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,I.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,I.containerTransformMatrix))},s.prototype.scale=function(p,I){W.prototype.scale.call(this,p,I);var J=this.rotatePoint({x:this.left,y:this.top}),U=this.unrotatePoint({x:J.x*p,y:J.y*I});this.left=U.x,this.top=U.y,this.width=this.width*p,this.height=this.height*I,this.adjustControlBox()},s}(Fe),tt=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.createVisual=U.createVisual.bind(U),U}return Ce(s,W),s.prototype.ownsTarget=function(p){return!(!W.prototype.ownsTarget.call(this,p)&&p!==this.visual)},s.prototype.createVisual=function(){this.visual=se.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)},s.prototype.pointerDown=function(p,I){W.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},s.prototype.manipulate=function(p){W.prototype.manipulate.call(this,p)},s.prototype.resize=function(p){W.prototype.resize.call(this,p),this.setSize()},s.prototype.setSize=function(){W.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(p){W.prototype.pointerUp.call(this,p),this.setSize()},s.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},s.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},s.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},W.prototype.getState.call(this))},s.prototype.restoreState=function(p){var I=p;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),W.prototype.restoreState.call(this,p),this.setSize()},s.prototype.scale=function(p,I){W.prototype.scale.call(this,p,I),this.setSize()},s.title="Rectangle marker",s}(Ze),ht=function(W){function s(p,I,J,U){var ce=W.call(this,p,U||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ce.widths=[],ce.widthBoxes=[],ce.widths=I,ce.currentWidth=J,ce.setCurrentWidth=ce.setCurrentWidth.bind(ce),ce}return Ce(s,W),s.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.widths.forEach(function(J){var U=document.createElement("div");U.style.display="flex",U.style.flexGrow="2",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=J===p.currentWidth?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentWidth(J,U)}),I.appendChild(U);var ce=document.createElement("div");ce.innerText=J.toString(),ce.style.marginRight="5px",U.appendChild(ce);var Oe=document.createElement("div");Oe.style.minHeight="20px",Oe.style.flexGrow="2",Oe.style.display="flex",Oe.style.alignItems="center";var Qe=document.createElement("hr");Qe.style.minWidth="20px",Qe.style.border="0px",Qe.style.borderTop=J+"px solid "+p.uiStyleSettings.toolboxColor,Qe.style.flexGrow="2",Oe.appendChild(Qe),U.appendChild(Oe),p.widthBoxes.push(U)}),I},s.prototype.setCurrentWidth=function(p,I){var J=this;this.currentWidth=p,this.widthBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},s}(Xe),rt=function(W){function s(p,I,J,U){var ce=W.call(this,p,U||'<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 ce.styles=[],ce.styleBoxes=[],ce.styles=I,ce.currentStyle=J,ce.setCurrentStyle=ce.setCurrentStyle.bind(ce),ce}return Ce(s,W),s.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.styles.forEach(function(J){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/p.styles.length-5+"%",U.style.borderColor=J===p.currentStyle?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentStyle(J,U)}),I.appendChild(U);var ce=document.createElement("div");ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.overflow="hidden";var Oe=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+p.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(J!==""?'stroke-dasharray="'+J+'"':"")+` />
|
|
</svg>`;ce.innerHTML=Oe,U.appendChild(ce),p.styleBoxes.push(U)}),I},s.prototype.setCurrentStyle=function(p,I){var J=this;this.currentStyle=p,this.styleBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},s}(Xe),Ve=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.strokeColor=J.defaultColor,U.strokeWidth=J.defaultStrokeWidth,U.strokeDasharray=J.defaultStrokeDasharray,U.strokePanel=new Ke("Line color",J.defaultColorSet,J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ht("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Ce(s,W),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=W.prototype.getState.call(this);return p.typeName=s.typeName,p},s.typeName="FrameMarker",s.title="Frame marker",s.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',s}(tt),Ee=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},it=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.x1=0,U.y1=0,U.x2=0,U.y2=0,U.defaultLength=50,U.manipulationStartX=0,U.manipulationStartY=0,U.manipulationStartX1=0,U.manipulationStartY1=0,U.manipulationStartX2=0,U.manipulationStartY2=0,U.setupControlBox(),U}return Ce(s,W),s.prototype.ownsTarget=function(p){return!!W.prototype.ownsTarget.call(this,p)||!(!this.grip1.ownsTarget(p)&&!this.grip2.ownsTarget(p))},s.prototype.pointerDown=function(p,I){W.prototype.pointerDown.call(this,p,I),this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.state==="new"&&(this.x1=p.x,this.y1=p.y,this.x2=p.x,this.y2=p.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(I)?this.activeGrip=this.grip1:this.grip2.ownsTarget(I)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},s.prototype.pointerUp=function(p){var I=this.state;W.prototype.pointerUp.call(this,p),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(p),this._state="select",I==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},s.prototype.adjustVisual=function(){},s.prototype.manipulate=function(p){this.state==="creating"?this.resize(p):this.state==="move"?(this.x1=this.manipulationStartX1+p.x-this.manipulationStartX,this.y1=this.manipulationStartY1+p.y-this.manipulationStartY,this.x2=this.manipulationStartX2+p.x-this.manipulationStartX,this.y2=this.manipulationStartY2+p.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(p)},s.prototype.resize=function(p){switch(this.activeGrip){case this.grip1:this.x1=p.x,this.y1=p.y;break;case this.grip2:case void 0:this.x2=p.x,this.y2=p.y}this.adjustVisual(),this.adjustControlBox()},s.prototype.select=function(){W.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){W.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){this.positionGrips()},s.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},s.prototype.createGrip=function(){var p=new ot;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},s.prototype.positionGrips=function(){var p=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-p/2,this.y1-p/2),this.positionGrip(this.grip2.visual,this.x2-p/2,this.y2-p/2)},s.prototype.positionGrip=function(p,I,J){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,J),p.transform.baseVal.replaceItem(U,0)},s.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},W.prototype.getState.call(this))},s.prototype.restoreState=function(p){W.prototype.restoreState.call(this,p);var I=p;this.x1=I.x1,this.y1=I.y1,this.x2=I.x2,this.y2=I.y2},s.prototype.scale=function(p,I){W.prototype.scale.call(this,p,I),this.x1=this.x1*p,this.y1=this.y1*I,this.x2=this.x2*p,this.y2=this.y2*I,this.adjustVisual(),this.adjustControlBox()},s}(Fe),qe=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.strokeColor=J.defaultColor,U.strokeWidth=J.defaultStrokeWidth,U.strokeDasharray=J.defaultStrokeDasharray,U.strokePanel=new Ke("Line color",J.defaultColorSet,J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ht("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Ce(s,W),s.prototype.ownsTarget=function(p){return!(!W.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorLine&&p!==this.visibleLine)},s.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=se.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)},s.prototype.pointerDown=function(p,I){W.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},s.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()),se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},s.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},s.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},W.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){W.prototype.restoreState.call(this,p);var I=p;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.createVisual(),this.adjustVisual()},s.typeName="LineMarker",s.title="Line marker",s.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',s}(it),we=function(W){function s(p,I,J,U){var ce=W.call(this,p,U||'<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 ce.fonts=[],ce.fontBoxes=[],ce.fonts=I,ce.currentFont=J,ce.setCurrentFont=ce.setCurrentFont.bind(ce),ce}return Ce(s,W),s.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.flexGrow="2",this.fonts.forEach(function(J){var U=document.createElement("div");U.style.display="inline-block",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/p.fonts.length-5+"%",U.style.borderColor=J===p.currentFont?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentFont(J,U)}),I.appendChild(U);var ce=document.createElement("div");ce.style.display="flex",ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.fontFamily=J,ce.style.overflow="hidden";var Oe=document.createElement("div");Oe.style.whiteSpace="nowrap",Oe.style.overflow="hidden",Oe.style.textOverflow="ellipsis",Oe.innerHTML="The quick brown fox jumps over the lazy dog",ce.appendChild(Oe),U.appendChild(ce),p.fontBoxes.push(U)}),I},s.prototype.setCurrentFont=function(p,I){var J=this;this.currentFont=p,this.fontBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},s}(Xe),We=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.color="transparent",U.padding=5,U.DEFAULT_TEXT="your text here",U.text=U.DEFAULT_TEXT,U.isMoved=!1,U.color=J.defaultColor,U.fontFamily=J.defaultFontFamily,U.defaultSize={x:100,y:30},U.setColor=U.setColor.bind(U),U.setFont=U.setFont.bind(U),U.renderText=U.renderText.bind(U),U.sizeText=U.sizeText.bind(U),U.textEditDivClicked=U.textEditDivClicked.bind(U),U.showTextEditor=U.showTextEditor.bind(U),U.setSize=U.setSize.bind(U),U.positionTextEditor=U.positionTextEditor.bind(U),U.colorPanel=new Ke("Color",J.defaultColorSet,J.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.fontFamilyPanel=new we("Font",J.defaultFontFamilies,J.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U}return Ce(s,W),s.prototype.ownsTarget=function(p){if(W.prototype.ownsTarget.call(this,p)||p===this.visual||p===this.textElement||p===this.bgRectangle)return!0;var I=!1;return this.textElement.childNodes.forEach(function(J){J===p&&(I=!0)}),I},s.prototype.createVisual=function(){this.visual=se.createGroup(),this.bgRectangle=se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},s.prototype.pointerDown=function(p,I){W.prototype.pointerDown.call(this,p,I),this.isMoved=!1,this.pointerDownPoint=p,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},s.prototype.renderText=function(){var p=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(I){p.textElement.appendChild(se.createTSpan(I.trim()===""?" ":I.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},s.prototype.getTextScale=function(){var p=this.textElement.getBBox(),I=1;if(p.width>0&&p.height>0){var J=(1*this.width-this.width*this.padding*2/100)/p.width,U=(1*this.height-this.height*this.padding*2/100)/p.height;I=Math.min(J,U)}return I},s.prototype.getTextPosition=function(p){var I=this.textElement.getBBox(),J=0,U=0;return I.width>0&&I.height>0&&(J=(this.width-I.width*p)/2,U=this.height/2-I.height*p/2),{x:J,y:U}},s.prototype.sizeText=function(){var p=this.textElement.getBBox(),I=this.getTextScale(),J=this.getTextPosition(I);J.y-=p.y*I,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+I+", "+I+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(I,I))},s.prototype.manipulate=function(p){W.prototype.manipulate.call(this,p),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(p.x-this.pointerDownPoint.x)>5||Math.abs(p.y-this.pointerDownPoint.y)>5)},s.prototype.resize=function(p){W.prototype.resize.call(this,p),this.isMoved=!0,this.setSize(),this.sizeText()},s.prototype.setSize=function(){W.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},s.prototype.pointerUp=function(p){var I=this.state;I==="creating"&&(this._suppressMarkerCreateEvent=!0),W.prototype.pointerUp.call(this,p),this.setSize(),(I==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},s.prototype.showTextEditor=function(){var p=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(I){I.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var I=Number.parseFloat(p.textEditor.style.fontSize);p.textEditor.clientWidth>=Number.parseInt(p.textEditor.style.maxWidth)&&I>.9;)I-=.1,p.textEditor.style.fontSize=Math.max(I,.9)+"em"}),this.textEditor.addEventListener("keyup",function(I){I.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(I){if(I.clipboardData){var J=I.clipboardData.getData("text"),U=window.getSelection();if(!U.rangeCount)return!1;U.deleteFromDocument(),U.getRangeAt(0).insertNode(document.createTextNode(J)),I.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){p.textEditDivClicked(p.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},s.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var p=this.getTextScale(),I=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),U={x:J.width*p,y:J.height*p};I.x-=U.x/2,I.y-=U.y/2,this.textEditor.style.top=I.y+"px",this.textEditor.style.left=I.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-I.x+"px",this.textEditor.style.fontSize=Math.max(16*p,12)+"px",this.textElement.style.display="none"}},s.prototype.textEditDivClicked=function(p){this.text=p.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},s.prototype.select=function(){W.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},s.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),W.prototype.deselect.call(this)},s.prototype.dblClick=function(p,I){W.prototype.dblClick.call(this,p,I),this.showTextEditor()},s.prototype.setColor=function(p){this.textElement&&se.setAttributes(this.textElement,[["fill",p]]),this.color=p,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(p)},s.prototype.setFont=function(p){this.textElement&&se.setAttributes(this.textElement,[["font-family",p]]),this.fontFamily=p,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},s.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},s.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},W.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){var I=p;this.color=I.color,this.fontFamily=I.fontFamily,this.padding=I.padding,this.text=I.text,this.createVisual(),W.prototype.restoreState.call(this,p),this.setSize()},s.prototype.scale=function(p,I){W.prototype.scale.call(this,p,I),this.setSize(),this.sizeText(),this.positionTextEditor()},s.typeName="TextMarker",s.title="Text marker",s.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>',s}(Ze),ge=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.color="transparent",U.lineWidth=3,U.drawing=!1,U.pixelRatio=1,U.color=J.defaultColor,U.lineWidth=J.defaultStrokeWidth,U.pixelRatio=J.freehandPixelRatio,U.setColor=U.setColor.bind(U),U.addCanvas=U.addCanvas.bind(U),U.finishCreation=U.finishCreation.bind(U),U.setLineWidth=U.setLineWidth.bind(U),U.colorPanel=new Ke("Color",J.defaultColorSet,J.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.lineWidthPanel=new ht("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.lineWidthPanel.onWidthChanged=U.setLineWidth,U}return Ce(s,W),s.prototype.ownsTarget=function(p){return!(!W.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.drawingImage)},s.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var p=se.createTransform();this.visual.transform.baseVal.appendItem(p),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(p,I){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(p.x,p.y),this.drawing=!0):W.prototype.pointerDown.call(this,p,I)},s.prototype.manipulate=function(p){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(p.x,p.y),this.canvasContext.stroke()):W.prototype.manipulate.call(this,p)},s.prototype.resize=function(p){W.prototype.resize.call(this,p),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(p){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):W.prototype.pointerUp.call(this,p)},s.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)},s.prototype.select=function(){this.state==="creating"&&this.finishCreation(),W.prototype.select.call(this)},s.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),W.prototype.deselect.call(this)},s.prototype.finishCreation=function(){for(var p=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),I=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=I[0],U=I[1],ce=I[2],Oe=I[3],Qe=!1,ft=0;ft<this.canvasElement.height;ft++)for(var Ne=0;Ne<this.canvasElement.width;Ne++)p.data[ft*this.canvasElement.width*4+4*Ne+3]>0&&(Qe=!0,ft<U&&(U=ft),Ne<J&&(J=Ne),ft>Oe&&(Oe=ft),Ne>ce&&(ce=Ne));if(Qe){this.left=J/this.pixelRatio,this.top=U/this.pixelRatio,this.width=(ce-J)/this.pixelRatio,this.height=(Oe-U)/this.pixelRatio;var yt=document.createElement("canvas");yt.width=ce-J,yt.height=Oe-U,yt.getContext("2d").putImageData(this.canvasContext.getImageData(J,U,ce-J,Oe-U),0,0),this.drawingImgUrl=yt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},s.prototype.setDrawingImage=function(){se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},s.prototype.setColor=function(p){this.color=p,this.colorChanged(p)},s.prototype.setLineWidth=function(p){this.lineWidth=p},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({drawingImgUrl:this.drawingImgUrl},W.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){this.createVisual(),W.prototype.restoreState.call(this,p),this.drawingImgUrl=p.drawingImgUrl,this.setDrawingImage()},s.prototype.scale=function(p,I){W.prototype.scale.call(this,p,I),this.setDrawingImage()},s.typeName="FreehandMarker",s.title="Freehand marker",s.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>',s}(Ze),de=function(W){function s(p,I,J){var U=W.call(this,p,J||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return U.typeBoxes=[],U.currentType=I,U.setCurrentType=U.setCurrentType.bind(U),U}return Ce(s,W),s.prototype.getUi=function(){var p=this,I=document.createElement("div");I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2";for(var J=function(Oe){var Qe="both";switch(Oe){case 0:Qe="both";break;case 1:Qe="start";break;case 2:Qe="end";break;case 3:Qe="none"}var ft=document.createElement("div");if(ft.style.display="flex",ft.style.flexGrow="2",ft.style.alignItems="center",ft.style.justifyContent="space-between",ft.style.padding="5px",ft.style.borderWidth="2px",ft.style.borderStyle="solid",ft.style.borderColor=Qe===U.currentType?U.uiStyleSettings.toolboxAccentColor:"transparent",ft.addEventListener("click",function(){p.setCurrentType(Qe,ft)}),I.appendChild(ft),Qe==="both"||Qe==="start"){var Ne=document.createElement("div");Ne.style.display="flex",Ne.style.alignItems="center",Ne.style.minHeight="20px",Ne.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ne.style.marginLeft="5px",ft.appendChild(Ne)}var yt=document.createElement("div");yt.style.display="flex",yt.style.alignItems="center",yt.style.minHeight="20px",yt.style.flexGrow="2";var Bt=document.createElement("hr");if(Bt.style.minWidth="20px",Bt.style.border="0px",Bt.style.borderTop="3px solid "+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee"),Bt.style.flexGrow="2",yt.appendChild(Bt),ft.appendChild(yt),Qe==="both"||Qe==="end"){var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.alignItems="center",Kt.style.minHeight="20px",Kt.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="`+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Kt.style.marginRight="5px",ft.appendChild(Kt)}U.typeBoxes.push(ft)},U=this,ce=0;ce<4;ce++)J(ce);return I},s.prototype.setCurrentType=function(p,I){var J=this;this.currentType=p,this.typeBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},s}(Xe),fe=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.arrowType="end",U.arrowBaseHeight=10,U.arrowBaseWidth=10,U.getArrowPoints=U.getArrowPoints.bind(U),U.setArrowType=U.setArrowType.bind(U),U.arrowTypePanel=new de("Arrow type","end"),U.arrowTypePanel.onArrowTypeChanged=U.setArrowType,U}return Ce(s,W),s.prototype.ownsTarget=function(p){return!(!W.prototype.ownsTarget.call(this,p)&&p!==this.arrow1&&p!==this.arrow2)},s.prototype.getArrowPoints=function(p,I){var J=this.arrowBaseWidth+2*this.strokeWidth,U=this.arrowBaseHeight+2*this.strokeWidth;return p-J/2+","+(I+U/2)+" "+p+","+(I-U/2)+" "+(p+J/2)+","+(I+U/2)},s.prototype.createTips=function(){this.arrow1=se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow2)},s.prototype.pointerDown=function(p,I){W.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(W.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",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.arrow1.transform.baseVal.getItem(0);I.setRotate(p,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(I,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(p+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},s.prototype.setArrowType=function(p){this.arrowType=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({arrowType:this.arrowType},W.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){W.prototype.restoreState.call(this,p);var I=p;this.arrowType=I.arrowType,this.createTips(),this.adjustVisual()},s.typeName="ArrowMarker",s.title="Arrow marker",s.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',s}(qe),te=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.fillColor=J.defaultFillColor,U.strokeWidth=0,U.fillPanel=new Ke("Color",J.defaultColorSet,J.defaultFillColor),U.fillPanel.onColorChanged=U.setFillColor,U}return Ce(s,W),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=W.prototype.getState.call(this);return p.typeName=s.typeName,p},s.typeName="CoverMarker",s.title="Cover marker",s.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',s}(tt),re=function(W){function s(p,I,J,U){var ce=W.call(this,p,U||'<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 ce.opacities=[],ce.opacityBoxes=[],ce.opacities=I,ce.currentOpacity=J,ce.setCurrentOpacity=ce.setCurrentOpacity.bind(ce),ce}return Ce(s,W),s.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",I.style.justifyContent="space-between",this.opacities.forEach(function(J){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="center",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=J===p.currentOpacity?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentOpacity(J,U)}),I.appendChild(U);var ce=document.createElement("div");ce.innerText=100*J+"%",U.appendChild(ce),p.opacityBoxes.push(U)}),I},s.prototype.setCurrentOpacity=function(p,I){var J=this;this.currentOpacity=p,this.opacityBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},s}(Xe),ne=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.setOpacity=U.setOpacity.bind(U),U.fillColor=J.defaultHighlightColor,U.strokeWidth=0,U.opacity=J.defaultHighlightOpacity,U.fillPanel=new Ke("Color",J.defaultColorSet,U.fillColor),U.fillPanel.onColorChanged=U.setFillColor,U.opacityPanel=new re("Opacity",J.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Ce(s,W),s.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=W.prototype.getState.call(this);return p.typeName=s.typeName,p},s.typeName="HighlightMarker",s.title="Highlight marker",s.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>',s}(te),he='<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>',me=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.bgColor="transparent",U.tipPosition={x:0,y:0},U.tipBase1Position={x:0,y:0},U.tipBase2Position={x:0,y:0},U.tipMoving=!1,U.color=J.defaultStrokeColor,U.bgColor=J.defaultFillColor,U.fontFamily=J.defaultFontFamily,U.defaultSize={x:100,y:30},U.setBgColor=U.setBgColor.bind(U),U.getTipPoints=U.getTipPoints.bind(U),U.positionTip=U.positionTip.bind(U),U.setTipPoints=U.setTipPoints.bind(U),U.colorPanel=new Ke("Text color",J.defaultColorSet,U.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>'),U.colorPanel.onColorChanged=U.setColor,U.bgColorPanel=new Ke("Fill color",J.defaultColorSet,U.bgColor,he),U.bgColorPanel.onColorChanged=U.setBgColor,U.fontFamilyPanel=new we("Font",J.defaultFontFamilies,J.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U.tipGrip=new ot,U.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),U.controlBox.appendChild(U.tipGrip.visual),U}return Ce(s,W),s.prototype.ownsTarget=function(p){return W.prototype.ownsTarget.call(this,p)||this.tipGrip.ownsTarget(p)||this.tip===p},s.prototype.createTip=function(){se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},s.prototype.pointerDown=function(p,I){this.state==="new"&&W.prototype.pointerDown.call(this,p,I),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(I)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):W.prototype.pointerDown.call(this,p,I)},s.prototype.pointerUp=function(p){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,W.prototype.pointerUp.call(this,p);else{var I=this.state==="creating";W.prototype.pointerUp.call(this,p),this.setTipPoints(I),this.positionTip()}},s.prototype.manipulate=function(p){if(this.tipMoving){var I=this.unrotatePoint(p);this.tipPosition={x:I.x-this.manipulationStartLeft,y:I.y-this.manipulationStartTop},this.positionTip()}else W.prototype.manipulate.call(this,p)},s.prototype.setBgColor=function(p){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",p]]),se.setAttributes(this.tip,[["fill",p]])),this.bgColor=p,this.fillColorChanged(p)},s.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},s.prototype.setTipPoints=function(p){p===void 0&&(p=!1);var I=Math.min(this.height/2,15),J=this.height/5;p&&(this.tipPosition={x:I+J/2,y:this.height+20});var U=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?U<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(J=this.width/5,I=Math.min(this.width/2,15),this.tipBase1Position={x:I,y:0},this.tipBase2Position={x:I+J,y:0}):(this.tipBase1Position={x:0,y:I},this.tipBase2Position={x:0,y:I+J}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?U<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(J=this.width/5,I=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-I-J,y:0},this.tipBase2Position={x:this.width-I,y:0}):(this.tipBase1Position={x:this.width,y:I},this.tipBase2Position={x:this.width,y:I+J}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?U<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(J=this.width/5,I=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-I-J,y:this.height},this.tipBase2Position={x:this.width-I,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-I-J},this.tipBase2Position={x:this.width,y:this.height-I}):U<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(J=this.width/5,I=Math.min(this.width/2,15),this.tipBase1Position={x:I,y:this.height},this.tipBase2Position={x:I+J,y:this.height}):(this.tipBase1Position={x:0,y:this.height-I},this.tipBase2Position={x:0,y:this.height-I-J})},s.prototype.resize=function(p){W.prototype.resize.call(this,p),this.positionTip()},s.prototype.positionTip=function(){se.setAttributes(this.tip,[["points",this.getTipPoints()]]);var p=this.tipGrip.visual.transform.baseVal.getItem(0);p.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(p,0)},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),s.prototype.select=function(){this.positionTip(),W.prototype.select.call(this)},s.prototype.getState=function(){var p=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},W.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){var I=p;this.bgColor=I.bgColor,this.tipPosition=I.tipPosition,W.prototype.restoreState.call(this,p),this.createTip(),this.setTipPoints()},s.prototype.scale=function(p,I){W.prototype.scale.call(this,p,I),this.tipPosition={x:this.tipPosition.x*p,y:this.tipPosition.y*I},this.positionTip()},s.typeName="CalloutMarker",s.title="Callout marker",s.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>',s}(We),Ae=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.strokeColor=J.defaultColor,U.strokeWidth=J.defaultStrokeWidth,U.strokeDasharray=J.defaultStrokeDasharray,U.fillColor=J.defaultFillColor,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.setOpacity=U.setOpacity.bind(U),U.createVisual=U.createVisual.bind(U),U.strokePanel=new Ke("Line color",pe(J.defaultColorSet,["transparent"]),J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.fillPanel=new Ke("Fill color",pe(J.defaultColorSet,["transparent"]),U.fillColor,he),U.fillPanel.onColorChanged=U.setFillColor,U.strokeWidthPanel=new ht("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U.opacityPanel=new re("Opacity",J.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Ce(s,W),s.prototype.ownsTarget=function(p){return!(!W.prototype.ownsTarget.call(this,p)&&p!==this.visual)},s.prototype.createVisual=function(){this.visual=se.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)},s.prototype.pointerDown=function(p,I){W.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},s.prototype.manipulate=function(p){W.prototype.manipulate.call(this,p)},s.prototype.resize=function(p){W.prototype.resize.call(this,p),this.setSize()},s.prototype.setSize=function(){W.prototype.setSize.call(this),se.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},s.prototype.pointerUp=function(p){W.prototype.pointerUp.call(this,p),this.setSize()},s.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},s.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(p),this.stateChanged()},s.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},W.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){var I=p;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),W.prototype.restoreState.call(this,p),this.setSize()},s.prototype.scale=function(p,I){W.prototype.scale.call(this,p,I),this.setSize()},s.typeName="EllipseMarker",s.title="Ellipse marker",s.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>',s}(Ze),_e=function(W){function s(p,I,J){return W.call(this,p,I,J)||this}return Ce(s,W),Object.defineProperty(s.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(p){return!(!W.prototype.ownsTarget.call(this,p)&&p!==this.tip1&&p!==this.tip2)},s.prototype.createTips=function(){this.tip1=se.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(se.createTransform()),this.visual.appendChild(this.tip1),this.tip2=se.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(se.createTransform()),this.visual.appendChild(this.tip2)},s.prototype.pointerDown=function(p,I){W.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(W.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(se.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()]]),se.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 p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.tip1.transform.baseVal.getItem(0);I.setRotate(p,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(I,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(p+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=W.prototype.getState.call(this);return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){W.prototype.restoreState.call(this,p),this.createTips(),this.adjustVisual()},s.typeName="MeasurementMarker",s.title="Measurement marker",s.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>',s}(qe),st=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.strokePanel.colors=J.defaultColorSet,U.fillColor="transparent",U}return Ce(s,W),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=W.prototype.getState.call(this);return p.typeName=s.typeName,p},s.typeName="EllipseFrameMarker",s.title="Ellipse frame marker",s.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>',s}(Ae),gt=function(){function W(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(W.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),W.prototype.addUndoStep=function(s){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(s)||(this.undoStack.push(s),JSON.stringify(this.lastRedoStep)!==JSON.stringify(s)&&this.redoStack.splice(0,this.redoStack.length))},W.prototype.replaceLastUndoStep=function(s){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=s)},W.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},W.prototype.undo=function(){if(this.undoStack.length>1){var s=this.undoStack.pop();return s!==void 0&&this.redoStack.push(s),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},W.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},W}(),pt=function(W){function s(p,I,J){var U=W.call(this,p,I,J)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.curveX=0,U.curveY=0,U.manipulationStartCurveX=0,U.manipulationStartCurveY=0,U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.positionGrips=U.positionGrips.bind(U),U.addControlGrips=U.addControlGrips.bind(U),U.adjustVisual=U.adjustVisual.bind(U),U.setupControlBox=U.setupControlBox.bind(U),U.resize=U.resize.bind(U),U.strokeColor=J.defaultColor,U.strokeWidth=J.defaultStrokeWidth,U.strokeDasharray=J.defaultStrokeDasharray,U.strokePanel=new Ke("Line color",J.defaultColorSet,J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ht("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Ce(s,W),s.prototype.ownsTarget=function(p){return!(!W.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorCurve&&p!==this.visibleCurve&&!this.curveGrip.ownsTarget(p))},s.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},s.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorCurve=se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=se.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)},s.prototype.pointerDown=function(p,I){W.prototype.pointerDown.call(this,p,I),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=p.x,this.curveY=p.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(I)&&(this.activeGrip=this.curveGrip,this._state="resize")},s.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setupControlBox=function(){W.prototype.setupControlBox.call(this),this.curveControlLine1=se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=se.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)},s.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,W.prototype.addControlGrips.call(this)},s.prototype.positionGrips=function(){W.prototype.positionGrips.call(this);var p=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-p/2,this.curveY-p/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()))},s.prototype.manipulate=function(p){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+p.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+p.y-this.manipulationStartY),W.prototype.manipulate.call(this,p)},s.prototype.resize=function(p){this.activeGrip===this.curveGrip&&(this.curveX=p.x,this.curveY=p.y),W.prototype.resize.call(this,p),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},s.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},s.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},s.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual()},s.prototype.scale=function(p,I){this.curveX=this.curveX*p,this.curveY=this.curveY*I,W.prototype.scale.call(this,p,I)},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},W.prototype.getState.call(this));return p.typeName=s.typeName,p},s.prototype.restoreState=function(p){W.prototype.restoreState.call(this,p);var I=p;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.curveX=I.curveX,this.curveY=I.curveY,this.createVisual(),this.adjustVisual()},s.typeName="CurveMarker",s.title="Curve marker",s.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>',s}(it),Tt=function(){function W(s,p){p===void 0&&(p=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=s,this.cancelable=p}return Object.defineProperty(W.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),W.prototype.preventDefault=function(){this._defaultPrevented=!0},W}(),St=function(W){function s(p,I,J){var U=W.call(this,p,!1)||this;return U.dataUrl=I,U.state=J,U}return Ce(s,W),s}(Tt),dt=function(W){function s(p,I,J){J===void 0&&(J=!1);var U=W.call(this,p,J)||this;return U.marker=I,U}return Ce(s,W),s}(Tt),Ut=function(){function W(){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 W.prototype.addEventListener=function(s,p){this[s].push(p)},W.prototype.removeEventListener=function(s,p){var I=this[s].indexOf(p);I>-1&&this[s].splice(I,1)},W}(),Mt=function(){function W(s){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ee,this._isOpen=!1,this.undoRedoManager=new gt,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 Ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=W.instanceCounter++,this.styles=new $e(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=s,this.targetRoot=document.body,this.width=s.clientWidth,this.height=s.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(W.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ve,ge,fe,We,st,Ae,ne,me,_e,te,qe,pt]},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ve,ge,fe,We,Ae,ne,me]},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ve,ge,fe,We,ne]},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(s){var p=this;this._availableMarkerTypes.splice(0),s.forEach(function(I){if(typeof I=="string"){var J=p.ALL_MARKER_TYPES.find(function(U){return U.typeName===I});J!==void 0&&p._availableMarkerTypes.push(J)}else p._availableMarkerTypes.push(I)})},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(s){this._zoomLevel=s,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(W.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),W.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),De.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},W.prototype.show=function(){var s=this;this.styles.styleSheetRoot===void 0&&Ge.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ge.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(p){return p(new Tt(s))})},W.prototype.render=function(){return Te(this,void 0,void 0,function(){var s;return Se(this,function(p){switch(p.label){case 0:return this.setCurrentMarker(),(s=new Ye).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.markersOnly=this.renderMarkersOnly,s.width=this.renderWidth,s.height=this.renderHeight,[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return p.sent(),[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,p.sent()]}})})},W.prototype.close=function(s){var p=this;if(s===void 0&&(s=!1),this.isOpen){var I=!1;s||this.eventListeners.beforeclose.forEach(function(J){var U=new Tt(p,!0);J(U),U.defaultPrevented&&(I=!0)}),I||(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(J){return J(new Tt(p))}),this.detachEvents(),this._isOpen=!1)}},W.prototype.addMarkersToToolbar=function(){for(var s,p=[],I=0;I<arguments.length;I++)p[I]=arguments[I];(s=this._availableMarkerTypes).push.apply(s,p)},W.prototype.addRenderEventListener=function(s){this.addEventListener("render",function(p){s(p.dataUrl,p.state)})},W.prototype.removeRenderEventListener=function(s){},W.prototype.addCloseEventListener=function(s){this.addEventListener("close",function(){s()})},W.prototype.removeCloseEventListener=function(s){},W.prototype.setupResizeObserver=function(){var s=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){s.resize(s.target.clientWidth,s.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return s.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},W.prototype.onPopupTargetResize=function(){var s=1*this.target.clientWidth/this.target.clientHeight,p=this.editorCanvas.clientWidth/s>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*s:this.editorCanvas.clientWidth,I=p<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/s;this.resize(p,I)},W.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},W.prototype.resize=function(s,p){this._isResizing=!0;var I=s/this.imageWidth,J=p/this.imageHeight;this.imageWidth=Math.round(s),this.imageHeight=Math.round(p),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(I,J),this._isResizing=!1},W.prototype.scaleMarkers=function(s,p){var I,J=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(s,p):(I=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(U){U!==J._currentMarker&&U.scale(s,p)}),I!==void 0&&this.setCurrentMarker(I)},W.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"},W.prototype.setTopLeft=function(){var s=this.editingTarget.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=s.left-p.left,this.top=s.top-p.top},W.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)},W.prototype.addDefs=function(){for(var s,p=[],I=0;I<arguments.length;I++)p[I]=arguments[I];this.defs=se.createDefs(),this.addDefsToImage(),(s=this.defs).append.apply(s,p)},W.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},W.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)},W.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},W.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},W.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)},W.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},W.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)},W.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 s=document.createElement("a");s.href="https://markerjs.com/",s.target="_blank",s.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>',s.title="Powered by marker.js",s.style.display="grid",s.style.alignItems="center",s.style.justifyItems="center",s.style.padding="3px",s.style.width="20px",s.style.height="20px",this.logoUI.appendChild(s),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},W.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")},W.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"},W.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},W.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 s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"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 Be(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 He(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},W.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},W.prototype.removeMarker=function(s){this.markerImage.removeChild(s.container),this.markers.indexOf(s)>-1&&this.markers.splice(this.markers.indexOf(s),1),s.dispose()},W.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())},W.prototype.toolbarButtonClicked=function(s,p){if(s==="marker"&&p!==void 0)this.createNewMarker(p);else if(s==="action")switch(p){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()}},W.prototype.deleteSelectedMarker=function(){var s=this;if(this._currentMarker!==void 0){var p=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var U=new dt(s,s._currentMarker,!0);J(U),U.defaultPrevented&&(p=!0)}),!p){var I=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(J){return J(new dt(s,I))})}}},W.prototype.clear=function(){var s=this,p=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ce){var Oe=new dt(s,void 0,!0);ce(Oe),Oe.defaultPrevented&&(p=!0)}),!p)){this.setCurrentMarker();for(var I=function(ce){var Oe=J.markers[ce];J.setCurrentMarker(J.markers[ce]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(Qe){return Qe(new dt(s,Oe))})},J=this,U=this.markers.length-1;U>=0;U--)I(U);this.addUndoStep()}},Object.defineProperty(W.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),W.prototype.showNotesEditor=function(){var s;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=(s=this._currentMarker.notes)!==null&&s!==void 0?s:"",this.overlayContainer.appendChild(this.notesArea))},W.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)},W.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},W.prototype.addUndoStep=function(){var s=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var p=this.getState(),I=this.undoRedoManager.getLastUndoStep();if(!I||I.width===p.width&&I.height===p.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(p),J<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(U){return U(new Tt(s))})}else this.undoRedoManager.replaceLastUndoStep(p),this.eventListeners.statechange.forEach(function(U){return U(new Tt(s))})}},W.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},W.prototype.undoStep=function(){var s=this,p=this.undoRedoManager.undo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(I){return I(new Tt(s))}))},W.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},W.prototype.redoStep=function(){var s=this,p=this.undoRedoManager.redo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(I){return I(new Tt(s))}))},W.prototype.stepZoom=function(){var s=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=s<this.zoomSteps.length-1?this.zoomSteps[s+1]:this.zoomSteps[0]},W.prototype.panTo=function(s){this.contentDiv.scrollBy({left:this.prevPanPoint.x-s.x,top:this.prevPanPoint.y-s.y}),this.prevPanPoint=s},W.prototype.startRenderAndClose=function(){return Te(this,void 0,void 0,function(){var s,p,I=this;return Se(this,function(J){switch(J.label){case 0:return[4,this.render()];case 1:return s=J.sent(),p=this.getState(),this.eventListeners.render.forEach(function(U){return U(new St(I,s,p))}),this.close(!0),[2]}})})},W.prototype.getState=function(s){s===!0&&this.setCurrentMarker();var p={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(I){return p.markers.push(I.getState())}),p},W.prototype.restoreState=function(s){var p=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);s.markers.forEach(function(I){var J=p._availableMarkerTypes.find(function(ce){return ce.typeName===I.typeName});if(J!==void 0){var U=p.addNewMarker(J);U.restoreState(I),p.markers.push(U)}}),s.width&&s.height&&(s.width!==this.imageWidth||s.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/s.width,this.imageHeight/s.height),this.eventListeners.restorestate.forEach(function(I){return I(new Tt(p))})},W.prototype.addNewMarker=function(s){var p=se.createGroup();return this.markerImage.appendChild(p),new s(p,this.overlayContainer,this.settings)},W.prototype.createNewMarker=function(s){var p,I=this;(p=typeof s=="string"?this._availableMarkerTypes.find(function(J){return J.typeName===s}):s)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(p),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(p.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(J){return J(new dt(I,I._currentMarker))}))},W.prototype.markerCreated=function(s){var p=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(s),this.setCurrentMarker(s),s instanceof ge&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ge):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(I){return I(new dt(p,p._currentMarker))})},W.prototype.colorChanged=function(s){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=s,this.settings.defaultStrokeColor=s)},W.prototype.fillColorChanged=function(s){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=s)},W.prototype.markerStateChanged=function(s){var p=this;this.eventListeners.markerchange.forEach(function(I){return I(new dt(p,s))})},W.prototype.setCurrentMarker=function(s){var p=this;this._currentMarker!==s&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(I){return I(new dt(p,p._currentMarker))})),this._currentMarker=s,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(I){return I(new dt(p,p._currentMarker))}))},W.prototype.onPointerDown=function(s){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||s.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var p=this.markers.find(function(I){return I.ownsTarget(s.target)});p!==void 0?(this.setCurrentMarker(p),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(s.clientX,s.clientY),s.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:s.clientX,y:s.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(s.clientX,s.clientY))},W.prototype.onDblClick=function(s){if(this._isFocused||this.focus(),this.mode==="select"){var p=this.markers.find(function(I){return I.ownsTarget(s.target)});p!==void 0&&p!==this._currentMarker&&this.setCurrentMarker(p),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(s.clientX,s.clientY),s.target):this.setCurrentMarker()}},W.prototype.onPointerMove=function(s){this.touchPoints!==1&&s.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||s.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(s.clientX,s.clientY)):this.zoomLevel>1&&this.panTo({x:s.clientX,y:s.clientY}))},W.prototype.onPointerUp=function(s){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(s.clientX,s.clientY)),this.isDragging=!1,this.addUndoStep()},W.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},W.prototype.onKeyUp=function(s){this._currentMarker===void 0||this.notesArea!==void 0||s.key!=="Delete"&&s.key!=="Backspace"||this.deleteSelectedMarker()},W.prototype.clientToLocalCoordinates=function(s,p){var I=this.markerImage.getBoundingClientRect();return{x:(s-I.left)/this.zoomLevel,y:(p-I.top)/this.zoomLevel}},W.prototype.onWindowResize=function(){this.positionUI()},W.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"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()},W.prototype.addLicenseKey=function(s){De.addKey(s)},W.prototype.addEventListener=function(s,p){this.eventListeners.addEventListener(s,p)},W.prototype.removeEventListener=function(s,p){this.eventListeners.removeEventListener(s,p)},W.prototype.renderState=function(s){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(s),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(W.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),W.prototype.focus=function(){var s=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(p){return p(new Tt(s))}))},W.prototype.blur=function(){var s=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(p){return p(new Tt(s))}))},W.instanceCounter=0,W}();/* **********************************
|
|
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 Jt=function(W,s){return(Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,I){p.__proto__=I}||function(p,I){for(var J in I)Object.prototype.hasOwnProperty.call(I,J)&&(p[J]=I[J])})(W,s)};function Qt(W,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function p(){this.constructor=W}Jt(W,s),W.prototype=s===null?Object.create(s):(p.prototype=s.prototype,new p)}function It(W,s,p,I){return new(p||(p=Promise))(function(J,U){function ce(ft){try{Qe(I.next(ft))}catch(Ne){U(Ne)}}function Oe(ft){try{Qe(I.throw(ft))}catch(Ne){U(Ne)}}function Qe(ft){var Ne;ft.done?J(ft.value):(Ne=ft.value,Ne instanceof p?Ne:new p(function(yt){yt(Ne)})).then(ce,Oe)}Qe((I=I.apply(W,s||[])).next())})}function _r(W,s){var p,I,J,U,ce={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return U={next:Oe(0),throw:Oe(1),return:Oe(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function Oe(Qe){return function(ft){return function(Ne){if(p)throw new TypeError("Generator is already executing.");for(;ce;)try{if(p=1,I&&(J=2&Ne[0]?I.return:Ne[0]?I.throw||((J=I.return)&&J.call(I),0):I.next)&&!(J=J.call(I,Ne[1])).done)return J;switch(I=0,J&&(Ne=[2&Ne[0],J.value]),Ne[0]){case 0:case 1:J=Ne;break;case 4:return ce.label++,{value:Ne[1],done:!1};case 5:ce.label++,I=Ne[1],Ne=[0];continue;case 7:Ne=ce.ops.pop(),ce.trys.pop();continue;default:if(!(J=ce.trys,(J=J.length>0&&J[J.length-1])||Ne[0]!==6&&Ne[0]!==2)){ce=0;continue}if(Ne[0]===3&&(!J||Ne[1]>J[0]&&Ne[1]<J[3])){ce.label=Ne[1];break}if(Ne[0]===6&&ce.label<J[1]){ce.label=J[1],J=Ne;break}if(J&&ce.label<J[2]){ce.label=J[2],ce.ops.push(Ne);break}J[2]&&ce.ops.pop(),ce.trys.pop();continue}Ne=s.call(W,ce)}catch(yt){Ne=[6,yt],I=0}finally{p=J=0}if(5&Ne[0])throw Ne[1];return{value:Ne[0]?Ne[1]:void 0,done:!0}}([Qe,ft])}}}var Kr=function(){function W(){}return W.addKey=function(s){W.key=s},Object.defineProperty(W,"isLicensed",{get:function(){return!!W.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(W.key)},enumerable:!1,configurable:!0}),W}(),Et=function(){function W(){}return W.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},W.setAttributes=function(s,p){for(var I=0,J=p;I<J.length;I++){var U=J[I],ce=U[0],Oe=U[1];s.setAttribute(ce,Oe)}},W.createRect=function(s,p,I){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",s.toString()),J.setAttribute("height",p.toString()),I&&W.setAttributes(J,I),J},W.createLine=function(s,p,I,J,U){var ce=document.createElementNS("http://www.w3.org/2000/svg","line");return ce.setAttribute("x1",s.toString()),ce.setAttribute("y1",p.toString()),ce.setAttribute("x2",I.toString()),ce.setAttribute("y2",J.toString()),U&&W.setAttributes(ce,U),ce},W.createPolygon=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","polygon");return I.setAttribute("points",s),p&&W.setAttributes(I,p),I},W.createCircle=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","circle");return I.setAttribute("cx",(s/2).toString()),I.setAttribute("cy",(s/2).toString()),I.setAttribute("r",s.toString()),p&&W.setAttributes(I,p),I},W.createEllipse=function(s,p,I){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(s/2).toString()),J.setAttribute("cy",(p/2).toString()),J.setAttribute("rx",(s/2).toString()),J.setAttribute("ry",(p/2).toString()),I&&W.setAttributes(J,I),J},W.createGroup=function(s){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return s&&W.setAttributes(p,s),p},W.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},W.createMarker=function(s,p,I,J,U,ce,Oe){var Qe=document.createElementNS("http://www.w3.org/2000/svg","marker");return W.setAttributes(Qe,[["id",s],["orient",p],["markerWidth",I.toString()],["markerHeight",J.toString()],["refX",U.toString()],["refY",ce.toString()]]),Qe.appendChild(Oe),Qe},W.createText=function(s){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),s&&W.setAttributes(p,s),p},W.createTSpan=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","tspan");return I.textContent=s,p&&W.setAttributes(I,p),I},W.createImage=function(s){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return s&&W.setAttributes(p,s),p},W.createPoint=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return I.x=s,I.y=p,I},W.createPath=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg","path");return I.setAttribute("d",s),p&&W.setAttributes(I,p),I},W.createElement=function(s,p){var I=document.createElementNS("http://www.w3.org/2000/svg",s);return p&&W.setAttributes(I,p),I},W.getHollowRectanglePath=function(s,p,I,J,U,ce,Oe,Qe){return"M"+s+","+p+"V"+(p+J)+"H"+(s+I)+"V"+p+"H"+U+"V"+ce+"H"+(U+Oe)+"V"+(ce+Qe)+"H"+U+"V"+p+"Z"},W}(),Br=function(){function W(s){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+s+"_"}return Object.defineProperty(W.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(W.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(W.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),W.prototype.addClass=function(s){return this.styleSheet===void 0&&this.addStyleSheet(),s.name=""+this.classNamePrefix+s.localName,this.classes.push(s),this.styleSheet.sheet.insertRule("."+s.name+" {"+s.style+"}",this.styleSheet.sheet.cssRules.length),s},W.prototype.addRule=function(s){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(s),this.styleSheet.sheet.insertRule(s.selector+" {"+s.style+"}",this.styleSheet.sheet.cssRules.length)},W.prototype.addStyleSheet=function(){var s;this.styleSheet=document.createElement("style"),((s=this.styleSheetRoot)!==null&&s!==void 0?s:document.head).appendChild(this.styleSheet),this.addRule(new hr("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new hr("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new hr("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new pr("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new pr("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},W.prototype.removeStyleSheet=function(){var s;this.styleSheet&&(((s=this.styleSheetRoot)!==null&&s!==void 0?s:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},W}(),hr=function(W,s){this.selector=W,this.style=s},pr=function(W,s){this.localName=W,this.style=s},Nr=function(){function W(){this.blocks=[],this.display=""}return W.prototype.addButtonBlock=function(s){s.className=this.blockClassName,s.buttonClassName=this.buttonClassName,s.buttonColorsClassName=this.buttonColorsClassName,s.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(s)},W.prototype.addElementBlock=function(s){s.className===void 0&&(s.className=this.blockClassName),this.blocks.push(s)},W.prototype.getUI=function(){var s=document.createElement("div");return s.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,s.style.display=this.display,this.blocks.forEach(function(p){return s.appendChild(p.getUI())}),s},W}(),ci=function(){function W(){}return W.prototype.getUI=function(){var s=document.createElement("div");if(s.className=this.className,this.minWidth!==void 0&&(s.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":s.style.justifyContent="flex-start";break;case"center":s.style.justifyContent="center";break;case"end":s.style.justifyContent="flex-end"}return s.style.whiteSpace="nowrap",s},W}(),$r=function(W){function s(){var p=W!==null&&W.apply(this,arguments)||this;return p.buttons=[],p}return Qt(s,W),s.prototype.addButton=function(p){p.className=this.buttonClassName,p.colorsClassName=this.buttonColorsClassName,p.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(p)},s.prototype.getUI=function(){var p=W.prototype.getUI.call(this);return this.buttons.forEach(function(I){return p.appendChild(I.getUI())}),p},s}(ci),_t=function(){function W(s,p){this._isActive=!1,this._isHidden=!1,this._icon=s,this.title=p,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(W.prototype,"icon",{get:function(){return this._icon},set:function(s){this._icon=s,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isActive",{get:function(){return this._isActive},set:function(s){this._isActive=s,this.adjustClassName()},enumerable:!1,configurable:!0}),W.prototype.getUI=function(){var s=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 s.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},W.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,"")))},W.prototype.hide=function(){this._isHidden=!0},W}(),ct=function(W){function s(){var p=W!==null&&W.apply(this,arguments)||this;return p.elements=[],p}return Qt(s,W),s.prototype.addElement=function(p){this.elements.push(p)},s.prototype.getUI=function(){var p=W.prototype.getUI.call(this);return this.elements.forEach(function(I){return p.appendChild(I)}),p},s}(ci),Hr=function(){function W(s,p){this.horizontal=s,this.vertical=p}return Object.defineProperty(W.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),W.prototype.getVerticalLength=function(s){return s/this.ratio},W.prototype.getHorizontalLength=function(s){return s*this.ratio},W}(),ei=function(){function W(){}return W.getIcon=function(s,p){if(s>0&&p>0){var I=new Hr(s,p),J=I.ratio>=1?20:I.getHorizontalLength(20),U=I.ratio<1?20:I.getVerticalLength(20),ce=document.createElementNS("http://www.w3.org/2000/svg","svg");ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),ce.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ce);var Oe=Et.createDefs();ce.appendChild(Oe);var Qe=Et.createElement("clipPath",[["id","text-bg-clip"]]);Oe.appendChild(Qe);var ft=Et.createPath(Et.getHollowRectanglePath((24-J)/2,(24-U)/2,J,U,(24-J)/2+2,(24-U)/2+2,J-4,U-4));ce.appendChild(ft);var Ne=Et.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ne.appendChild(Et.createTSpan(s+":"+p)),ce.appendChild(Ne);var yt=Ne.getBBox();Et.setAttributes(Ne,[["x",((24-yt.width)/2).toString()],["y",((24-yt.height)/2-yt.y).toString()]]);var Bt=Et.createPath(Et.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(yt.width))/2,(24-Math.ceil(yt.height))/2,Math.ceil(yt.width),Math.ceil(yt.height)));return Qe.appendChild(Bt),Et.setAttributes(ft,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ce),ce.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>'},W}(),mr=function(W){function s(p,I,J){var U=W.call(this,p,I)||this;return U.isDropdownOpen=!1,U.onClick=U.dropdownButtonClicked,U.dropdownButtons=J,U}return Qt(s,W),s.prototype.setupDropdown=function(){var p=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(I){I.className=p.className,I.colorsClassName=p.colorsClassName,p.dropdownBlock.appendChild(I.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},s.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},s.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},s.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},s.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},s.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},s}(_t),Lt=function(){function W(s,p){this.GRIP_SIZE=10,this.color=s,this.fillColor=p,this.visual=Et.createGroup(),this.visual.appendChild(Et.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Et.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return W.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},W.prototype.setCenter=function(s,p){this.visual.childNodes.forEach(function(I){return Et.setAttributes(I,[["cx",s.toString()],["cy",p.toString()]])})},W}(),Ur=function(){function W(s,p,I,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=s,this.canvasHeight=p,this.margin=I,this.container=J,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(W.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(s){this._aspectRatio=s,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.gridContainer&&Et.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(s){this._zoomFactor=s,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),W.prototype.open=function(){var s=this;this.cropShadeElement=Et.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Et.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var p=0;p<this.numberOfGridLines;p++)this.horizontalGridLines.push(Et.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Et.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(I){return s.gridContainer.appendChild(I)}),this.verticalGridLines.forEach(function(I){return s.gridContainer.appendChild(I)}),this.cropRectElement=Et.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Lt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},W.prototype.setCropRectangle=function(s){this.cropRect=s;var p=Object.assign({},this.cropRect);this.zoomFactor!==1&&(p.width=this.cropRect.width*this.zoomFactor,p.height=this.cropRect.height*this.zoomFactor,p.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-p.width/2,p.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-p.height/2),Et.setAttributes(this.cropRectElement,[["x",p.x.toString()],["y",p.y.toString()],["width",p.width.toString()],["height",p.height.toString()]]);var I=p.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(U,ce){var Oe=p.y+I*(ce+1);Et.setAttributes(U,[["x1",""+p.x],["y1",""+Oe],["x2",""+(p.x+p.width)],["y2",""+Oe]])});var J=p.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(U,ce){var Oe=p.x+J*(ce+1);Et.setAttributes(U,[["x1",""+Oe],["y1",""+p.y],["x2",""+Oe],["y2",""+(p.y+p.height)]])}),Et.setAttributes(this.cropShadeElement,[["d",Et.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,p.x,p.y,p.width,p.height)]]),this.topLeftGrip.setCenter(p.x,p.y),this.topRightGrip.setCenter(p.x+p.width,p.y),this.bottomLeftGrip.setCenter(p.x,p.y+p.height),this.bottomRightGrip.setCenter(p.x+p.width,p.y+p.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},W.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)},W.prototype.clientToLocalCoordinates=function(s,p){var I=this.container.getBoundingClientRect();return{x:s-I.left+this.margin,y:p-I.top+this.margin}},W.prototype.onPointerDown=function(s){this.container.setPointerCapture(s.pointerId),this.previousPoint=this.clientToLocalCoordinates(s.clientX,s.clientY),this.cropRectElement===s.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(s.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(s.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(s.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(s.target)&&(this.activeGrip=this.bottomRightGrip)},W.prototype.onPointerMove=function(s){if(this.isMoving)this.move(this.clientToLocalCoordinates(s.clientX,s.clientY));else if(this.activeGrip){var p=this.clientToLocalCoordinates(s.clientX,s.clientY);this.resize(p)}s.preventDefault()},W.prototype.onPointerUp=function(s){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(s.pointerId)},W.prototype.move=function(s){var p=s.x-this.previousPoint.x,I=s.y-this.previousPoint.y;this.zoomFactor!==1&&(p=-p/this.zoomFactor,I=-I/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+p),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+I),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=s},W.prototype.resize=function(s){var p=Object.assign({},this.cropRect),I=s.x-this.previousPoint.x,J=s.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:p.x+I<this.margin&&(I=this.margin-p.x),p.x+=I,p.width=this.cropRect.x+this.cropRect.width-p.x;break;case this.bottomRightGrip:case this.topRightGrip:p.width+I>this.canvasWidth*this.zoomFactor&&(I=this.canvasWidth*this.zoomFactor-p.width),p.width+=I}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(p.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(I),p.height=this.aspectRatio.getVerticalLength(p.width)):(p.y+=J,p.height=this.cropRect.y+this.cropRect.height-p.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?p.height=this.aspectRatio.getVerticalLength(p.width):p.height+=J}p.width<10&&(p.x=this.cropRect.x,p.width=10),p.height<10&&(p.y=this.cropRect.y,p.height=10),this.previousPoint=s,p.x>=this.margin&&p.y>=this.margin&&p.x-this.margin+p.width<=this.canvasWidth&&p.y-this.margin+p.height<=this.canvasHeight&&(this.cropRect=p,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},W.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var s=this.cropRect.x+this.cropRect.width/2,p=this.cropRect.y+this.cropRect.height/2,I=this.aspectRatio.getHorizontalLength(this.cropRect.height),J=this.aspectRatio.getVerticalLength(this.cropRect.width);I/this.canvasWidth<J/this.canvasHeight?this.cropRect.width=I:this.cropRect.height=J,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=s-this.cropRect.width/2,this.cropRect.y=p-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)}},W.prototype.getRescaledRect=function(s,p,I,J,U,ce){var Oe=I/s,Qe=J/p;return{x:(U.x-ce)*Oe+ce,y:(U.y-ce)*Qe+ce,width:U.width*Oe,height:U.height*Qe}},W.prototype.scaleCanvas=function(s,p){var I=this.getRescaledRect(this.canvasWidth,this.canvasHeight,s,p,this.cropRect,this.margin);this.canvasWidth=s,this.canvasHeight=p,this.onCropChange&&this.onCropChange(I),this.setCropRectangle(I)},W}(),Vr=function(){function W(s){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=s,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(W.prototype,"angle",{get:function(){return this._angle},set:function(s){this._angle=s,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),W.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},W.prototype.onPointerDown=function(s){this.controlContainer.setPointerCapture(s.pointerId),this.isDragging=!0,this.previousPoint={x:s.clientX,y:s.clientY}},W.prototype.onPointerMove=function(s){this.isDragging&&(this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.previousPoint.x=s.clientX)},W.prototype.onPointerUp=function(s){this.isDragging&&this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(s.pointerId)},W.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var s=this.angleLabelText.getBBox();Et.setAttributes(this.angleLabelElement,[["x",((this.width-s.width)/2).toString()],["y",(this.height/2).toString()]])}},W.prototype.positionScaleShape=function(){if(this.scaleShape){var s=this.scaleShape.transform.baseVal.getItem(0);s.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(s,0)}},W.prototype.getVisual=function(){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("width",this.width+"px"),s.setAttribute("height",this.height+"px"),s.setAttribute("viewBox","0 0 "+this.width+" "+this.height),s.style.flexShrink="0",document.body.appendChild(s);for(var p="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,I=1;I<=this.width/5+10;I++){var J=I%5==0?this.height/3:this.height/6;p+="h4v"+-J+"h1v"+J}p+="v1H0Z",this.scaleShape=Et.createPath(p);var U=Et.createTransform();this.scaleShape.transform.baseVal.appendItem(U),s.appendChild(this.scaleShape),this.angleLabelElement=Et.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Et.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ce=Et.createTSpan("");return ce.innerHTML="°",this.angleLabelElement.appendChild(ce),s.appendChild(this.angleLabelElement),document.body.removeChild(s),s},W}(),fi=function(){function W(){this.naturalSize=!1,this.imageType="image/png"}return W.prototype.rasterize=function(s,p,I,J,U,ce,Oe){var Qe=this;return new Promise(function(ft){var Ne=document.createElement("canvas");Ne.width=s.width.baseVal.value-2*J,Ne.height=s.height.baseVal.value-2*J;var yt=1,Bt=1;Qe.naturalSize===!0?(yt=p.naturalWidth/(s.width.baseVal.value-2*J)/ce,Bt=p.naturalHeight/(s.height.baseVal.value-2*J)/Oe,Ne.width=p.naturalWidth/ce,Ne.height=p.naturalHeight/Oe):Qe.width!==void 0&&Qe.height!==void 0&&(yt=Qe.width/I.width,Bt=Qe.height/I.height,Ne.width*=yt,Ne.height*=Bt);var Kt=Ne.getContext("2d");Kt.translate(Ne.width/2,Ne.height/2),Kt.rotate(U*Math.PI/180),Kt.scale(ce,Oe),Kt.translate(-Ne.width/2,-Ne.height/2),Kt.drawImage(p,0,0,Ne.width,Ne.height);var Ir=document.createElement("canvas");Ir.width=I.width*yt,Ir.height=I.height*Bt,Ir.getContext("2d").putImageData(Kt.getImageData((I.x-J)*yt,(I.y-J)*Bt,I.width*yt,I.height*Bt),0,0),ft(Ir.toDataURL(Qe.imageType,Qe.imageQuality))})},W}(),je=function(){function W(s){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=W.instanceCounter++,this.styles=new Br(this.instanceNo),this.target=s,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(W.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(s){this._zoomToCropEnabled=s,s?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"gridLines",{get:function(){return this._gridLines},set:function(s){this._gridLines=s,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(s){this._rotationAngle=s,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"aspectRatio",{get:function(){var s;return(s=this._aspectRatio)!==null&&s!==void 0?s:this.aspectRatios[0]},set:function(s){this._aspectRatio=s},enumerable:!1,configurable:!0}),W.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},W.prototype.show=function(){this.showUI(),this.open()},W.prototype.close=function(s){s===void 0&&(s=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),s||this.closeEventListeners.forEach(function(p){return p()}),this._isOpen=!1)},W.prototype.addRenderEventListener=function(s){this.renderEventListeners.push(s)},W.prototype.removeRenderEventListener=function(s){this.renderEventListeners.indexOf(s)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(s),1)},W.prototype.addCloseEventListener=function(s){this.closeEventListeners.push(s)},W.prototype.removeCloseEventListener=function(s){this.closeEventListeners.indexOf(s)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(s),1)},W.prototype.setupResizeObserver=function(){var s=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){s.resize(s.target.clientWidth,s.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))},W.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var s=1*this.target.clientWidth/this.target.clientHeight,p=this.contentDiv.clientWidth/s>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*s:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,I=p+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/s;this.resize(p,I)}},W.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},W.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",Et.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},W.prototype.resize=function(s,p){this.imageWidth=Math.round(s),this.imageHeight=Math.round(p),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()},W.prototype.setEditingTarget=function(){var s=document.createElement("canvas");s.width=this.target.naturalWidth,s.height=this.target.naturalHeight,s.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var p=s.toDataURL();Et.setAttributes(this.editingTarget,[["href",p]]),this.setEditingTargetSize()},W.prototype.setTopLeft=function(){var s=this.target.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=s.left-p.left-this.CANVAS_MARGIN,this.top=s.top-p.top-this.CANVAS_MARGIN},W.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=Et.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Et.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Et.createGroup(),this.editingTargetRotationScaleContainer=Et.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var s=Et.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(s);var p=Et.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(p),this.editingTargetContainer=Et.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)},W.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},W.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Et.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ur(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()},W.prototype.zoomToCrop=function(){if(this.cropRect){var s=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,p=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=s+"px "+p+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-s+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-p+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},W.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)},W.prototype.cropRectChanged=function(s){this.cropRect=s,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},W.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},W.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"},W.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},W.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 s=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,p=this.target.offsetTop>s+this.CANVAS_MARGIN?this.target.offsetTop-(s+this.CANVAS_MARGIN):0;this.coverDiv.style.top=p+"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},W.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},W.prototype.addTopToolbar=function(){var s=this;this.topToolbar=new Nr,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 p=new $r;p.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(p);var I=[];this.aspectRatios.forEach(function(Bt){var Kt=new _t(ei.getIcon(Bt.horizontal,Bt.vertical),Bt.horizontal===0&&Bt.vertical===0?"FREE":Bt.horizontal+":"+Bt.vertical);Kt.onClick=function(){return s.ratioButtonClicked(Bt)},I.push(Kt)}),this.aspectRatioButton=new mr(ei.getIcon(0,0),"Aspect ratio",I),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,p.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new _t('<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");J.isActive=this.isGridVisible,J.onClick=function(){s.isGridVisible=!s.isGridVisible,J.isActive=s.isGridVisible},p.addButton(J);var U=new _t('<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(U.isActive=this.zoomToCropEnabled,U.onClick=function(){s.zoomToCropEnabled=!s.zoomToCropEnabled,U.isActive=s.zoomToCropEnabled},p.addButton(U),!Kr.isLicensed){var ce=new ct;this.topToolbar.addElementBlock(ce);var Oe=document.createElement("div");Oe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Qe=document.createElement("a");Qe.style.color="currentColor",Qe.href="https://markerjs.com/products/cropro",Qe.target="_blank",Qe.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>',Oe.appendChild(Qe),ce.addElement(Oe)}var ft=new $r;ft.minWidth=3*this.toolbarHeight+"px",ft.contentAlign="end",this.topToolbar.addButtonBlock(ft);var Ne=new _t('<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");Ne.onClick=this.startRenderAndClose,ft.addButton(Ne),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ne.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var yt=new _t('<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");yt.onClick=this.close,ft.addButton(yt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(yt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},W.prototype.addBottomToolbar=function(){var s=this;this.bottomToolbar=new Nr,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 p=new $r;p.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(p);var I=new _t('<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");I.onClick=this.rotateLeftButtonClicked,p.addButton(I);var J=new _t('<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");J.onClick=this.rotateRightButtonClicked,p.addButton(J);var U=new ct;U.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(U),this.straightener=new Vr("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(ft){s.rotateBy(ft),s.straightener.angle=s.rotationAngle},U.addElement(this.straightener.getUI());var ce=new $r;ce.minWidth=2*this.toolbarHeight+"px",ce.contentAlign="end",this.bottomToolbar.addButtonBlock(ce);var Oe=new _t('<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");Oe.onClick=this.flipHorizontallyButtonClicked,ce.addButton(Oe);var Qe=new _t('<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");Qe.onClick=this.flipVerticallyButtonClicked,ce.addButton(Qe)},W.prototype.ratioButtonClicked=function(s){this.aspectRatio=s,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},W.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ei.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},W.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Hr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},W.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},W.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},W.prototype.restoreState=function(s){if(s){var p=this.cropLayer.getRescaledRect(s.width,s.height,this.imageWidth,this.imageHeight,s.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(p),this.cropRectChanged(p),this.flippedHorizontally=s.flippedHorizontally,this.flippedVertically=s.flippedVertically,this.applyFlip(),this.rotationAngle=s.rotationAngle,this.applyRotation()}},W.prototype.clientToLocalCoordinates=function(s,p){var I=this.cropImage.getBoundingClientRect();return{x:s-I.left,y:p-I.top}},W.prototype.onWindowResize=function(){this.positionUI()},W.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var s=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=s+"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()},W.prototype.rotateLeftButtonClicked=function(){var s=this.rotationAngle-90;this.rotationAngle%90!=0&&(s+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(s)},W.prototype.rotateRightButtonClicked=function(){var s=this.rotationAngle+90;this.rotationAngle%90!=0&&(s-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(s)},W.prototype.rotateTo=function(s){s=(s=s>180?s-360:s)<=-180?s+360:s,this.rotationAngle=s,this.applyRotation()},W.prototype.rotateBy=function(s){this.rotateTo((this.rotationAngle+s)%360)},W.prototype.applyRotation=function(){var s=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var p=this.editingTargetRotationContainer.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(p,0);var I=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/I.width,this.imageHeight/I.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=s},W.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},W.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},W.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},W.prototype.startRenderAndClose=function(){return It(this,void 0,void 0,function(){var s,p;return _r(this,function(I){switch(I.label){case 0:return[4,this.render()];case 1:return s=I.sent(),p=this.getState(),this.renderEventListeners.forEach(function(J){return J(s,p)}),this.close(!0),[2]}})})},W.prototype.render=function(){return It(this,void 0,void 0,function(){var s;return _r(this,function(p){switch(p.label){case 0:return(s=new fi).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.width=this.renderWidth,s.height=this.renderHeight,this.unzoomFromCrop(),Et.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,s.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 p.sent(),[4,s.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,p.sent()]}})})},W.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new pr("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 pr("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new pr("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var s=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pr("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*s)+`px;
|
|
height: `+(this.toolbarHeight-2*s)+`px;
|
|
padding: `+s+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new pr("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pr("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new hr("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new hr("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new pr("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 pr("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new pr("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 pr("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*s)+`px;
|
|
padding: `+s+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new pr("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},W.instanceCounter=0,W}(),Ct=Z("8hTe"),pi=Z.n(Ct),mi=/<pre[^>]*>/g;function gi(W){var s=document.createElement("div");return s.innerHTML=W,s.childNodes.length===0?"":s.childNodes[0].nodeValue}var vi=Le.a=function(W){var s=W.value,p=s===void 0?"":s,I=W.edit,J=I===void 0?!1:I,U=W.className,ce=W.showTextOnly,Oe=W.showLines,Qe=W.replaces,ft=W.zoomImg,Ne=W.hasMask,yt=W.style,Bt=yt===void 0?{}:yt,Kt=W.stylesPrev,Ir=Kt===void 0?{}:Kt,gr=String(p),vr=Object(M.useRef)(),Qr=Object(M.useRef)(),Ii=Object(M.useState)(""),nr=Object(G.a)(Ii,2),Fr=nr[0],oi=nr[1],si=Object(M.useState)("office"),Mr=Object(G.a)(si,2),Mi=Mr[0],yi=Mr[1],zi=function(){var Nt=new je(Qr.current);Nt.displayMode="popup",Nt.addRenderEventListener(function(){var dr=Object(_.a)(O.a.mark(function Rt($t){var jt;return O.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:return vr.current.style.display="none",ar.next=3,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:$t}});case 3:jt=ar.sent,jt!=null&&jt.id&&Qe(Qr.current.getAttribute("src").replace(oe.a.API_SERVER,""),"/api/attachments/".concat(jt==null?void 0:jt.id,"?type=").concat(jt.content_type));case 5:case"end":return ar.stop()}},Rt)}));return function(Rt){return dr.apply(this,arguments)}}()),Nt.show()},Ki=function(){var Nt=new Mt(Qr.current);Nt.settings.displayMode="popup",Nt.addEventListener("render",function(){var dr=Object(_.a)(O.a.mark(function Rt($t){var jt;return O.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:if(vr.current.style.display="none",!Qr.current){ar.next=6;break}return ar.next=4,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:$t.dataUrl}});case 4:jt=ar.sent,jt!=null&&jt.id&&Qe(Qr.current.getAttribute("src").replace(oe.a.API_SERVER,""),"/api/attachments/".concat(jt==null?void 0:jt.id,"?type=").concat(jt.content_type));case 6:case"end":return ar.stop()}},Rt)}));return function(Rt){return dr.apply(this,arguments)}}()),Nt.show(),window.markerArea=Nt},Yr=Object(M.useMemo)(function(){vr.current&&(vr.current.style.zIndex=-1);try{var Zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Nt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,dr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;gr=gr.replace(Zt,"("+oe.a.API_SERVER+"/api/attachments/").replace(Nt,'"'+oe.a.API_SERVER+"/api/attachments/").replace(dr,'"'+oe.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(ti){}var Rt=$(gr),$t=b();if(gr.match(/\[TOC\]/)&&(Rt=Rt.replace("<p>[TOC]</p>",L()),A()),Rt=Rt.replace(/(__special_katext_id_\d+__)/g,function(ti,ar){var xr=$t[ar],Vi=xr.type,xi=xr.expression;return Object(le.renderToString)(gi(xi)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Rt=Rt.replace(/▁/g,"\u2581\u2581\u2581"),v(),ce){var jt=document.createElement("div");return jt.innerHTML=Rt,jt.innerText}return setTimeout(function(){return dn()},500),Rt},[gr]),Gr=Object(M.useRef)();f.WebkitLineClamp=Oe,Oe&&(Bt=Object(B.a)(Object(B.a)({},Bt),f));function bi(Zt){var Nt=Zt.target;if(Nt.tagName.toUpperCase()==="IMG"){if(ft){var dr=Nt.getAttribute("src");oi(dr),yi("image")}}else if(Nt.tagName.toUpperCase()==="A"){var Rt=Nt.getAttribute("href");if(Rt.indexOf("office")>-1)Zt.preventDefault(),oi(Rt),yi("office");else if(Rt.indexOf("application/pdf")>-1)Zt.preventDefault(),oi(Rt),yi("pdf");else if(Rt.indexOf("text/html")>-1)Zt.preventDefault(),oi(Rt),yi("html");else if(Rt.startsWith("#")){Zt.preventDefault();var $t=document.getElementById(Rt.replace("#",""));$t&&$t.scrollIntoView(!0)}}}var dn=function(){var Nt,dr=(Nt=Gr.current)===null||Nt===void 0?void 0:Nt.querySelectorAll("video");dr==null||dr.forEach(function(Rt){if(Rt.oncontextmenu=function(){return!1},Rt.src.indexOf(".m3u8")>-1&&!Rt.canPlayType("application/vnd.apple.mpegurl")){if(ee.a.isSupported()){var $t=new ee.a;$t.loadSource(Rt.src),$t.attachMedia(Rt)}}})};Object(M.useEffect)(function(){if(Gr.current&&Yr&&(Yr.match(mi)&&window.PR.prettyPrint()),Gr.current)return Gr.current.addEventListener("click",bi),function(){Gr.current.removeEventListener("click",bi),v(),A()}},[Yr,Gr.current,bi]);var Ei=function(Nt){if(!J)return;Nt.target.nodeName==="IMG"?(vr.current.style.zIndex=1,vr.current.style.display="flex",vr.current.style.width=Nt.target.clientWidth+"px",vr.current.style.height=Nt.target.clientHeight+"px",vr.current.style.top=Nt.target.offsetTop+"px",vr.current.style.left=Nt.target.offsetLeft+"px",Qr.current.src=Nt.target.getAttribute("src")):vr.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Gr,style:Object(B.a)({},Bt),className:"".concat(U||""," markdown-body ").concat(pi.a.mdBody),onMouseOver:Ei,dangerouslySetInnerHTML:{__html:Yr}}),y.a.createElement("div",{ref:vr,className:pi.a.button},y.a.createElement(X.a,null,y.a.createElement(Q.a,{onClick:function(){return zi()}},"\u88C1\u526A"),y.a.createElement(Q.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(ve.a,{close:!0,data:Fr,type:Fr!=null&&Fr.length?Mi:"",style:Object(B.a)({},Ir),onClose:function(){return oi("")}}))}},"9VGf":function(Me,Le,Z){"use strict";Z.d(Le,"a",function(){return R});var ie=Z("q1tI"),X=Z.n(ie);function R(Q,B){var _=Object(ie.useRef)();Object(ie.useEffect)(function(){_.current=Q}),Object(ie.useEffect)(function(){function G(){_.current()}if(B!==null){var j=setInterval(G,B);return function(){return clearInterval(j)}}},[B])}},"9ZNV":function(Me,Le,Z){"use strict";Z.d(Le,"a",function(){return M});var ie=Z("0Owb"),X=Z("+L6B"),R=Z("2/Rp"),Q=Z("q1tI"),B=Z.n(Q),_=Z("UUDw"),G=Z.n(_),j=Z("TSYQ"),O=Z.n(j),M=function(T){var k=T.cancelText,D=k===void 0?"\u53D6\u6D88":k,w=T.okText,C=w===void 0?"\u786E\u5B9A":w,h=T.loading,o=h===void 0?!1:h,l=T.hasOkBtn,d=l===void 0?!0:l,A=T.okButtonProps,f=A===void 0?{}:A,g=T.onCancel,L=g===void 0?function(){}:g,E=T.onOk,m=E===void 0?function(){}:E,c=T.className,u=c===void 0?"":c;return B.a.createElement("div",{className:O()(G.a.buttonFixed,u)},B.a.createElement("div",{className:G.a.buttonWrap},B.a.createElement(R.a,{size:"large",className:"".concat(G.a.button," mr20"),onClick:L},D),d&&B.a.createElement(R.a,Object(ie.a)({size:"large",type:"primary",className:"".concat(G.a.button," mr20"),loading:o,onClick:m},f),C)))}},"A/g1":function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA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V3ymqwNVAFiTUe85HzLedaKNxfd/h4FvuPdoA9Hvj7ftmhMAkFbZyaxaQH1a3XwurL9tp4kN7fsUQz5fTnxbGH8GFt7DcwpecTuMFmlIaZ+bjOgvF2u7d/gnIWZR+Q1KPowcIIaAhQSarqmH/xE0TpQbb92M9uT7kdz+/HqfDB0EcF/ZRi1ggYFER/cYcMtMOO3jzlmVjXKDrkt5uv9are9ZLJ8L6UcJ+HplVotygVRlYLFwM4GWf2njl/ymq1fqrSgM3J1Sfz5Rnd15ulp/tiGtPV6h0aIwaCDxUPc/F8sfOQdqTKnbrvjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(Me,Le,Z){(function(ie){ie(Z("VrN/"),Z("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(O,M,y){if(y!=ie.Init&&y&&O.removeKeyMap("autoCloseTags"),!M)return;var T={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(T["'/'"]=function(k){return _(k)}),(typeof M!="object"||M.whenOpening!==!1)&&(T["'>'"]=function(k){return Q(k)}),O.addKeyMap(T)});var X=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["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 Q(O){if(O.getOption("disableInput"))return ie.Pass;for(var M=O.listSelections(),y=[],T=O.getOption("autoCloseTags"),k=0;k<M.length;k++){if(!M[k].empty())return ie.Pass;var D=M[k].head,w=O.getTokenAt(D),C=ie.innerMode(O.getMode(),w.state),h=C.state,o=C.mode.xmlCurrentTag&&C.mode.xmlCurrentTag(h),l=o&&o.name;if(!l)return ie.Pass;var d=C.mode.configuration=="html",A=typeof T=="object"&&T.dontCloseTags||d&&X,f=typeof T=="object"&&T.indentTags||d&&R;w.end>D.ch&&(l=l.slice(0,l.length-w.end+D.ch));var g=l.toLowerCase();if(!l||w.type=="string"&&(w.end!=D.ch||!/[\"\']/.test(w.string.charAt(w.string.length-1))||w.string.length==1)||w.type=="tag"&&o.close||w.string.indexOf("/")==D.ch-w.start-1||A&&G(A,g)>-1||j(O,C.mode.xmlCurrentContext&&C.mode.xmlCurrentContext(h)||[],l,D,!0))return ie.Pass;var L=typeof T=="object"&&T.emptyTags;if(L&&G(L,l)>-1){y[k]={text:"/>",newPos:ie.Pos(D.line,D.ch+2)};continue}var E=f&&G(f,g)>-1;y[k]={indent:E,text:">"+(E?`
|
|
|
|
`:"")+"</"+l+">",newPos:E?ie.Pos(D.line+1,0):ie.Pos(D.line,D.ch+1)}}for(var m=typeof T=="object"&&T.dontIndentOnAutoClose,k=M.length-1;k>=0;k--){var c=y[k];O.replaceRange(c.text,M[k].head,M[k].anchor,"+insert");var u=O.listSelections().slice(0);u[k]={head:c.newPos,anchor:c.newPos},O.setSelections(u),!m&&c.indent&&(O.indentLine(c.newPos.line,null,!0),O.indentLine(c.newPos.line+1,null,!0))}}function B(O,M){for(var y=O.listSelections(),T=[],k=M?"/":"</",D=O.getOption("autoCloseTags"),w=typeof D=="object"&&D.dontIndentOnSlash,C=0;C<y.length;C++){if(!y[C].empty())return ie.Pass;var h=y[C].head,o=O.getTokenAt(h),l=ie.innerMode(O.getMode(),o.state),d=l.state;if(M&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=h.ch-1))return ie.Pass;var A,f=l.mode.name!="xml"&&O.getMode().name=="htmlmixed";if(f&&l.mode.name=="javascript")A=k+"script";else if(f&&l.mode.name=="css")A=k+"style";else{var g=l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(d);if(!g||g.length&&j(O,g,g[g.length-1],h))return ie.Pass;A=k+g[g.length-1]}O.getLine(h.line).charAt(o.end)!=">"&&(A+=">"),T[C]=A}if(O.replaceSelections(T),y=O.listSelections(),!w)for(var C=0;C<y.length;C++)(C==y.length-1||y[C].head.line<y[C+1].head.line)&&O.indentLine(y[C].head.line)}function _(O){return O.getOption("disableInput")?ie.Pass:B(O,!0)}ie.commands.closeTag=function(O){return B(O)};function G(O,M){if(O.indexOf)return O.indexOf(M);for(var y=0,T=O.length;y<T;++y)if(O[y]==M)return y;return-1}function j(O,M,y,T,k){if(!ie.scanForClosingTag)return!1;var D=Math.min(O.lastLine()+1,T.line+500),w=ie.scanForClosingTag(O,T,null,D);if(!w||w.tag!=y)return!1;for(var C=k?1:0,h=M.length-1;h>=0&&M[h]==y;h--)++C;T=w.to;for(var h=1;h<C;h++){var o=ie.scanForClosingTag(O,T,null,D);if(!o||o.tag!=y)return!1;T=o.to}return!0}})},BjJ7:function(Me,Le,Z){"use strict";Z.d(Le,"d",function(){return X}),Z.d(Le,"c",function(){return R}),Z.d(Le,"e",function(){return Q}),Z.d(Le,"b",function(){return B}),Z.d(Le,"a",function(){return G});var ie=Z("m3rI");function X(j){var O=!0;if(j.length>0){for(var M=0;M<j.length;M++)if(j[M].compile_success==0||!j[M].compile_success){O=!1;break}}else O=!1;return O}function R(j){for(var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",M=[],y=0;y<j.length;y++){var T=j[y],k=O?"".concat(O,"/").concat(T.name):"".concat(T.name);M.push({title:T.name,isLeaf:!(T.type==="tree"),key:k})}return M}function Q(j,O,M){for(var y=0;y<j.length;y++){var T=j[y];if(T.key===O){T.children=M;break}T.children&&Q(T.children,O,M)}return j}function B(j,O,M){var y;return function(){var T=this,k=arguments,D=function(){y=null,M||j.apply(T,k)},w=M&&!y;clearTimeout(y),y=setTimeout(D,O),w&&j.apply(T,k)}}var _=!0,G=ie.a.API_SERVER},"C+DQ":function(Me,Le,Z){},CJF0:function(Me,Le,Z){"use strict";var ie=Z("14J3"),X=Z("BMrR"),R=Z("+L6B"),Q=Z("2/Rp"),B=Z("jCWc"),_=Z("kPKH"),G=Z("PpiC"),j=Z("q1tI"),O=Z.n(j),M=Z("Ty5D"),y=Z("9kvl"),T=Z("55Ip"),k=Z("lzim"),D=Z("nZ20"),w=Z.n(D),C=function(o){var l,d,A,f,g=o.shixunsDetail,L=o.dispatch,E=o.loading,m=o.match,c=o.data,u=c===void 0?{}:c,a=o.title,b=Object(G.a)(o,["shixunsDetail","dispatch","loading","match","data","title"]),v=Object(M.i)(),x=!(((l=g.detail)===null||l===void 0?void 0:l.identity)>4||((d=g.detail)===null||d===void 0?void 0:d.identity)===void 0||((A=g.detail)===null||A===void 0?void 0:A.shixun_status)===2||((f=g.detail)===null||f===void 0?void 0:f.shixun_status)===1);return O.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(w.a.wrap)},O.a.createElement(X.a,{gutter:[20,20],align:"middle"},O.a.createElement(_.a,{flex:1},O.a.createElement("span",{className:w.a.icons},O.a.createElement("img",{src:k.d,width:"14"})),O.a.createElement("span",{className:"font16"},"\u7B2C ",u==null?void 0:u.position," \u5173\uFF1A",a)),O.a.createElement(_.a,null,(u==null?void 0:u.prev_challenge)&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var H,V=u.prev_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(v.id,"/challenges/").concat(u==null||((H=u.prev_challenge)===null||H===void 0)?void 0:H.id).concat(V);y.d.replace($)}},"\u4E0A\u4E00\u5173"),u.next_challenge&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var H,V=u.next_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(v.id,"/challenges/").concat(u==null||((H=u.next_challenge)===null||H===void 0)?void 0:H.id).concat(V);y.d.replace($)}},"\u4E0B\u4E00\u5173"),x&&O.a.createElement(Q.a,{type:"primary"},O.a.createElement(T.a,{to:"/shixuns/".concat(v.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),x&&O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(T.a,{to:"/shixuns/".concat(v.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(T.a,{to:"/shixuns/".concat(v.id,"/challenges")},"\u8FD4\u56DE")))))};Le.a=Object(y.a)(function(h){var o=h.shixunsDetail,l=h.newCourse,d=h.loading,A=h.globalSetting;return{shixunsDetail:o,newCourse:l,globalSetting:A,loading:d.effects}})(C)},DlQD:function(Me,Le,Z){(function(ie,X){Me.exports=X()})(this,function(){"use strict";function ie(ge,de){for(var fe=0;fe<de.length;fe++){var te=de[fe];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(ge,te.key,te)}}function X(ge,de,fe){return de&&ie(ge.prototype,de),fe&&ie(ge,fe),ge}function R(ge,de){if(!ge)return;if(typeof ge=="string")return Q(ge,de);var fe=Object.prototype.toString.call(ge).slice(8,-1);if(fe==="Object"&&ge.constructor&&(fe=ge.constructor.name),fe==="Map"||fe==="Set")return Array.from(ge);if(fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe))return Q(ge,de)}function Q(ge,de){(de==null||de>ge.length)&&(de=ge.length);for(var fe=0,te=new Array(de);fe<de;fe++)te[fe]=ge[fe];return te}function B(ge,de){var fe;if(typeof Symbol=="undefined"||ge[Symbol.iterator]==null){if(Array.isArray(ge)||(fe=R(ge))||de&&ge&&typeof ge.length=="number"){fe&&(ge=fe);var te=0;return function(){return te>=ge.length?{done:!0}:{done:!1,value:ge[te++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return fe=ge[Symbol.iterator](),fe.next.bind(fe)}function _(ge,de){return de={exports:{}},ge(de,de.exports),de.exports}var G=_(function(ge){function de(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function fe(te){ge.exports.defaults=te}ge.exports={defaults:de(),getDefaults:de,changeDefaults:fe}}),j=G.defaults,O=G.getDefaults,M=G.changeDefaults,y=/[&<>"']/,T=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},C=function(de){return w[de]};function h(ge,de){if(de){if(y.test(ge))return ge.replace(T,C)}else if(k.test(ge))return ge.replace(D,C);return ge}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(ge){return ge.replace(o,function(de,fe){return fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""})}var d=/(^|[^\[])\^/g;function A(ge,de){ge=ge.source||ge,de=de||"";var fe={replace:function(re,ne){return ne=ne.source||ne,ne=ne.replace(d,"$1"),ge=ge.replace(re,ne),fe},getRegex:function(){return new RegExp(ge,de)}};return fe}var f=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(ge,de,fe){if(ge){var te;try{te=decodeURIComponent(l(fe)).replace(f,"").toLowerCase()}catch(re){return null}if(te.indexOf("javascript:")===0||te.indexOf("vbscript:")===0||te.indexOf("data:")===0)return null}de&&!g.test(fe)&&(fe=a(de,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(re){return null}return fe}var E={},m=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(ge,de){E[" "+ge]||(m.test(ge)?E[" "+ge]=ge+"/":E[" "+ge]=P(ge,"/",!0)),ge=E[" "+ge];var fe=ge.indexOf(":")===-1;return de.substring(0,2)==="//"?fe?de:ge.replace(c,"$1")+de:de.charAt(0)==="/"?fe?de:ge.replace(u,"$1")+de:ge+de}var b={exec:function(){}};function v(ge){for(var de=1,fe,te;de<arguments.length;de++){fe=arguments[de];for(te in fe)Object.prototype.hasOwnProperty.call(fe,te)&&(ge[te]=fe[te])}return ge}function x(ge,de){var fe=ge.replace(/\|/g,function(ne,he,me){for(var Ae=!1,_e=he;--_e>=0&&me[_e]==="\\";)Ae=!Ae;return Ae?"|":" |"}),te=fe.split(/ \|/),re=0;if(te.length>de)te.splice(de);else for(;te.length<de;)te.push("");for(;re<te.length;re++)te[re]=te[re].trim().replace(/\\\|/g,"|");return te}function P(ge,de,fe){var te=ge.length;if(te===0)return"";for(var re=0;re<te;){var ne=ge.charAt(te-re-1);if(ne===de&&!fe)re++;else if(ne!==de&&fe)re++;else break}return ge.substr(0,te-re)}function H(ge,de){if(ge.indexOf(de[1])===-1)return-1;for(var fe=ge.length,te=0,re=0;re<fe;re++)if(ge[re]==="\\")re++;else if(ge[re]===de[0])te++;else if(ge[re]===de[1]&&(te--,te<0))return re;return-1}function V(ge){ge&&ge.sanitize&&!ge.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 $={escape:h,unescape:l,edit:A,cleanUrl:L,resolveUrl:a,noopTest:b,merge:v,splitCells:x,rtrim:P,findClosingBracket:H,checkSanitizeDeprecation:V},z=G.defaults,F=$.rtrim,ee=$.splitCells,oe=$.escape,le=$.findClosingBracket;function ve(ge,de,fe){var te=de.href,re=de.title?oe(de.title):null,ne=ge[1].replace(/\\([\[\]])/g,"$1");return ge[0].charAt(0)!=="!"?{type:"link",raw:fe,href:te,title:re,text:ne}:{type:"image",raw:fe,href:te,title:re,text:oe(ne)}}function Ie(ge,de){var fe=ge.match(/^(\s+)(?:```)/);if(fe===null)return de;var te=fe[1];return de.split(`
|
|
`).map(function(re){var ne=re.match(/^\s+/);if(ne===null)return re;var he=ne[0];return he.length>=te.length?re.slice(te.length):re}).join(`
|
|
`)}var xe=function(){function ge(fe){this.options=fe||z}var de=ge.prototype;return de.space=function(te){var re=this.rules.block.newline.exec(te);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:`
|
|
`}},de.code=function(te,re){var ne=this.rules.block.code.exec(te);if(ne){var he=re[re.length-1];if(he&&he.type==="paragraph")return{raw:ne[0],text:ne[0].trimRight()};var me=ne[0].replace(/^ {4}/gm,"");return{type:"code",raw:ne[0],codeBlockStyle:"indented",text:this.options.pedantic?me:F(me,`
|
|
`)}}},de.fences=function(te){var re=this.rules.block.fences.exec(te);if(re){var ne=re[0],he=Ie(ne,re[3]||"");return{type:"code",raw:ne,lang:re[2]?re[2].trim():re[2],text:he}}},de.heading=function(te){var re=this.rules.block.heading.exec(te);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},de.nptable=function(te){var re=this.rules.block.nptable.exec(te);if(re){var ne={type:"table",header:ee(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
|
|
`):[],raw:re[0]};if(ne.header.length===ne.align.length){var he=ne.align.length,me;for(me=0;me<he;me++)/^ *-+: *$/.test(ne.align[me])?ne.align[me]="right":/^ *:-+: *$/.test(ne.align[me])?ne.align[me]="center":/^ *:-+ *$/.test(ne.align[me])?ne.align[me]="left":ne.align[me]=null;for(he=ne.cells.length,me=0;me<he;me++)ne.cells[me]=ee(ne.cells[me],ne.header.length);return ne}}},de.hr=function(te){var re=this.rules.block.hr.exec(te);if(re)return{type:"hr",raw:re[0]}},de.blockquote=function(te){var re=this.rules.block.blockquote.exec(te);if(re){var ne=re[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:re[0],text:ne}}},de.list=function(te){var re=this.rules.block.list.exec(te);if(re){for(var ne=re[0],he=re[2],me=he.length>1,Ae=he[he.length-1]===")",_e={type:"list",raw:ne,ordered:me,start:me?+he.slice(0,-1):"",loose:!1,items:[]},st=re[0].match(this.rules.block.item),gt=!1,pt,Tt,St,dt,Ut,Mt,Jt,Qt=st.length,It=0;It<Qt;It++)pt=st[It],ne=pt,Tt=pt.length,pt=pt.replace(/^ *([*+-]|\d+[.)]) */,""),~pt.indexOf(`
|
|
`)&&(Tt-=pt.length,pt=this.options.pedantic?pt.replace(/^ {1,4}/gm,""):pt.replace(new RegExp("^ {1,"+Tt+"}","gm"),"")),It!==Qt-1&&(St=this.rules.block.bullet.exec(st[It+1])[0],(me?St.length===1||!Ae&&St[St.length-1]===")":St.length>1||this.options.smartLists&&St!==he)&&(dt=st.slice(It+1).join(`
|
|
`),_e.raw=_e.raw.substring(0,_e.raw.length-dt.length),It=Qt-1)),Ut=gt||/\n\n(?!\s*$)/.test(pt),It!==Qt-1&&(gt=pt.charAt(pt.length-1)===`
|
|
`,Ut||(Ut=gt)),Ut&&(_e.loose=!0),Mt=/^\[[ xX]\] /.test(pt),Jt=void 0,Mt&&(Jt=pt[1]!==" ",pt=pt.replace(/^\[[ xX]\] +/,"")),_e.items.push({type:"list_item",raw:ne,task:Mt,checked:Jt,loose:Ut,text:pt});return _e}},de.html=function(te){var re=this.rules.block.html.exec(te);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):oe(re[0]):re[0]}},de.def=function(te){var re=this.rules.block.def.exec(te);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var ne=re[1].toLowerCase().replace(/\s+/g," ");return{tag:ne,raw:re[0],href:re[2],title:re[3]}}},de.table=function(te){var re=this.rules.block.table.exec(te);if(re){var ne={type:"table",header:ee(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
|
|
`):[]};if(ne.header.length===ne.align.length){ne.raw=re[0];var he=ne.align.length,me;for(me=0;me<he;me++)/^ *-+: *$/.test(ne.align[me])?ne.align[me]="right":/^ *:-+: *$/.test(ne.align[me])?ne.align[me]="center":/^ *:-+ *$/.test(ne.align[me])?ne.align[me]="left":ne.align[me]=null;for(he=ne.cells.length,me=0;me<he;me++)ne.cells[me]=ee(ne.cells[me].replace(/^ *\| *| *\| *$/g,""),ne.header.length);return ne}}},de.lheading=function(te){var re=this.rules.block.lheading.exec(te);if(re)return{type:"heading",raw:re[0],depth:re[2].charAt(0)==="="?1:2,text:re[1]}},de.paragraph=function(te){var re=this.rules.block.paragraph.exec(te);if(re)return{type:"paragraph",raw:re[0],text:re[1].charAt(re[1].length-1)===`
|
|
`?re[1].slice(0,-1):re[1]}},de.text=function(te,re){var ne=this.rules.block.text.exec(te);if(ne){var he=re[re.length-1];return he&&he.type==="text"?{raw:ne[0],text:ne[0]}:{type:"text",raw:ne[0],text:ne[0]}}},de.escape=function(te){var re=this.rules.inline.escape.exec(te);if(re)return{type:"escape",raw:re[0],text:oe(re[1])}},de.tag=function(te,re,ne){var he=this.rules.inline.tag.exec(te);if(he)return!re&&/^<a /i.test(he[0])?re=!0:re&&/^<\/a>/i.test(he[0])&&(re=!1),!ne&&/^<(pre|code|kbd|script)(\s|>)/i.test(he[0])?ne=!0:ne&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(he[0])&&(ne=!1),{type:this.options.sanitize?"text":"html",raw:he[0],inLink:re,inRawBlock:ne,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):oe(he[0]):he[0]}},de.link=function(te){var re=this.rules.inline.link.exec(te);if(re){var ne=le(re[2],"()");if(ne>-1){var he=re[0].indexOf("!")===0?5:4,me=he+re[1].length+ne;re[2]=re[2].substring(0,ne),re[0]=re[0].substring(0,me).trim(),re[3]=""}var Ae=re[2],_e="";if(this.options.pedantic){var st=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ae);st?(Ae=st[1],_e=st[3]):_e=""}else _e=re[3]?re[3].slice(1,-1):"";Ae=Ae.trim().replace(/^<([\s\S]*)>$/,"$1");var gt=ve(re,{href:Ae&&Ae.replace(this.rules.inline._escapes,"$1"),title:_e&&_e.replace(this.rules.inline._escapes,"$1")},re[0]);return gt}},de.reflink=function(te,re){var ne;if((ne=this.rules.inline.reflink.exec(te))||(ne=this.rules.inline.nolink.exec(te))){var he=(ne[2]||ne[1]).replace(/\s+/g," ");if(he=re[he.toLowerCase()],!he||!he.href){var me=ne[0].charAt(0);return{type:"text",raw:me,text:me}}var Ae=ve(ne,he,ne[0]);return Ae}},de.strong=function(te,re,ne){ne===void 0&&(ne="");var he=this.rules.inline.strong.start.exec(te);if(he&&(!he[1]||he[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){re=re.slice(-1*te.length);var me=he[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;me.lastIndex=0;for(var Ae;(he=me.exec(re))!=null;)if(Ae=this.rules.inline.strong.middle.exec(re.slice(0,he.index+3)),Ae)return{type:"strong",raw:te.slice(0,Ae[0].length),text:te.slice(2,Ae[0].length-2)}}},de.em=function(te,re,ne){ne===void 0&&(ne="");var he=this.rules.inline.em.start.exec(te);if(he&&(!he[1]||he[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){re=re.slice(-1*te.length);var me=he[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;me.lastIndex=0;for(var Ae;(he=me.exec(re))!=null;)if(Ae=this.rules.inline.em.middle.exec(re.slice(0,he.index+2)),Ae)return{type:"em",raw:te.slice(0,Ae[0].length),text:te.slice(1,Ae[0].length-1)}}},de.codespan=function(te){var re=this.rules.inline.code.exec(te);if(re){var ne=re[2].replace(/\n/g," "),he=/[^ ]/.test(ne),me=ne.startsWith(" ")&&ne.endsWith(" ");return he&&me&&(ne=ne.substring(1,ne.length-1)),ne=oe(ne,!0),{type:"codespan",raw:re[0],text:ne}}},de.br=function(te){var re=this.rules.inline.br.exec(te);if(re)return{type:"br",raw:re[0]}},de.del=function(te){var re=this.rules.inline.del.exec(te);if(re)return{type:"del",raw:re[0],text:re[1]}},de.autolink=function(te,re){var ne=this.rules.inline.autolink.exec(te);if(ne){var he,me;return ne[2]==="@"?(he=oe(this.options.mangle?re(ne[1]):ne[1]),me="mailto:"+he):(he=oe(ne[1]),me=he),{type:"link",raw:ne[0],text:he,href:me,tokens:[{type:"text",raw:he,text:he}]}}},de.url=function(te,re){var ne;if(ne=this.rules.inline.url.exec(te)){var he,me;if(ne[2]==="@")he=oe(this.options.mangle?re(ne[0]):ne[0]),me="mailto:"+he;else{var Ae;do Ae=ne[0],ne[0]=this.rules.inline._backpedal.exec(ne[0])[0];while(Ae!==ne[0]);he=oe(ne[0]),ne[1]==="www."?me="http://"+he:me=he}return{type:"link",raw:ne[0],text:he,href:me,tokens:[{type:"text",raw:he,text:he}]}}},de.inlineText=function(te,re,ne){var he=this.rules.inline.text.exec(te);if(he){var me;return re?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):oe(he[0]):he[0]:me=oe(this.options.smartypants?ne(he[0]):he[0]),{type:"text",raw:he[0],text:me}}},ge}(),Ce=$.noopTest,Te=$.edit,Se=$.merge,pe={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:Ce,table:Ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Te(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Te(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Te(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._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",pe._comment=/<!--(?!-?>)[\s\S]*?-->/,pe.html=Te(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Te(pe._paragraph).replace("hr",pe.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",pe._tag).getRegex(),pe.blockquote=Te(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Se({},pe),pe.gfm=Se({},pe.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*|$)"}),pe.gfm.nptable=Te(pe.gfm.nptable).replace("hr",pe.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",pe._tag).getRegex(),pe.gfm.table=Te(pe.gfm.table).replace("hr",pe.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",pe._tag).getRegex(),pe.pedantic=Se({},pe.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._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:Ce,paragraph:Te(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ce,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:Ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",se.punctuation=Te(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=Te(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=Te(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=Te(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=Te(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=Te(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=Te(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=Te(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=Te(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=Te(se._blockSkip,"g").getRegex(),se.overlapSkip=Te(se._overlapSkip,"g").getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=Te(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=Te(se.tag).replace("comment",pe._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=Te(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=Te(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=Te(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=Se({},se),se.pedantic=Se({},se.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:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=Se({},se.normal,{escape:Te(se.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),se.gfm.url=Te(se.gfm.url,"i").replace("email",se.gfm._extended_email).getRegex(),se.breaks=Se({},se.gfm,{br:Te(se.br).replace("{2,}","*").getRegex(),text:Te(se.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var De={block:pe,inline:se},Ye=G.defaults,Ge=De.block,$e=De.inline;function et(ge){return ge.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 Re(ge){var de="",fe,te,re=ge.length;for(fe=0;fe<re;fe++)te=ge.charCodeAt(fe),Math.random()>.5&&(te="x"+te.toString(16)),de+="&#"+te+";";return de}var Be=function(){function ge(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||Ye,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var te={block:Ge.normal,inline:$e.normal};this.options.pedantic?(te.block=Ge.pedantic,te.inline=$e.pedantic):this.options.gfm&&(te.block=Ge.gfm,this.options.breaks?te.inline=$e.breaks:te.inline=$e.gfm),this.tokenizer.rules=te}ge.lex=function(te,re){var ne=new ge(re);return ne.lex(te)};var de=ge.prototype;return de.lex=function(te){return te=te.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(te,this.tokens,!0),this.inline(this.tokens),this.tokens},de.blockTokens=function(te,re,ne){re===void 0&&(re=[]),ne===void 0&&(ne=!0),te=te.replace(/^ +$/gm,"");for(var he,me,Ae,_e;te;){if(he=this.tokenizer.space(te)){te=te.substring(he.raw.length),he.type&&re.push(he);continue}if(he=this.tokenizer.code(te,re)){te=te.substring(he.raw.length),he.type?re.push(he):(_e=re[re.length-1],_e.raw+=`
|
|
`+he.raw,_e.text+=`
|
|
`+he.text);continue}if(he=this.tokenizer.fences(te)){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.heading(te)){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.nptable(te)){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.hr(te)){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.blockquote(te)){te=te.substring(he.raw.length),he.tokens=this.blockTokens(he.text,[],ne),re.push(he);continue}if(he=this.tokenizer.list(te)){for(te=te.substring(he.raw.length),Ae=he.items.length,me=0;me<Ae;me++)he.items[me].tokens=this.blockTokens(he.items[me].text,[],!1);re.push(he);continue}if(he=this.tokenizer.html(te)){te=te.substring(he.raw.length),re.push(he);continue}if(ne&&(he=this.tokenizer.def(te))){te=te.substring(he.raw.length),this.tokens.links[he.tag]||(this.tokens.links[he.tag]={href:he.href,title:he.title});continue}if(he=this.tokenizer.table(te)){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.lheading(te)){te=te.substring(he.raw.length),re.push(he);continue}if(ne&&(he=this.tokenizer.paragraph(te))){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.text(te,re)){te=te.substring(he.raw.length),he.type?re.push(he):(_e=re[re.length-1],_e.raw+=`
|
|
`+he.raw,_e.text+=`
|
|
`+he.text);continue}if(te){var st="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return re},de.inline=function(te){var re,ne,he,me,Ae,_e,st=te.length;for(re=0;re<st;re++){_e=te[re];switch(_e.type){case"paragraph":case"text":case"heading":{_e.tokens=[],this.inlineTokens(_e.text,_e.tokens);break}case"table":{for(_e.tokens={header:[],cells:[]},me=_e.header.length,ne=0;ne<me;ne++)_e.tokens.header[ne]=[],this.inlineTokens(_e.header[ne],_e.tokens.header[ne]);for(me=_e.cells.length,ne=0;ne<me;ne++)for(Ae=_e.cells[ne],_e.tokens.cells[ne]=[],he=0;he<Ae.length;he++)_e.tokens.cells[ne][he]=[],this.inlineTokens(Ae[he],_e.tokens.cells[ne][he]);break}case"blockquote":{this.inline(_e.tokens);break}case"list":{for(me=_e.items.length,ne=0;ne<me;ne++)this.inline(_e.items[ne].tokens);break}}}return te},de.inlineTokens=function(te,re,ne,he,me){re===void 0&&(re=[]),ne===void 0&&(ne=!1),he===void 0&&(he=!1),me===void 0&&(me="");var Ae,_e=te,st;if(this.tokens.links){var gt=Object.keys(this.tokens.links);if(gt.length>0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(_e))!=null;)gt.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(_e=_e.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+_e.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(_e))!=null;)_e=_e.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+_e.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;te;){if(Ae=this.tokenizer.escape(te)){te=te.substring(Ae.raw.length),re.push(Ae);continue}if(Ae=this.tokenizer.tag(te,ne,he)){te=te.substring(Ae.raw.length),ne=Ae.inLink,he=Ae.inRawBlock,re.push(Ae);continue}if(Ae=this.tokenizer.link(te)){te=te.substring(Ae.raw.length),Ae.type==="link"&&(Ae.tokens=this.inlineTokens(Ae.text,[],!0,he)),re.push(Ae);continue}if(Ae=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(Ae.raw.length),Ae.type==="link"&&(Ae.tokens=this.inlineTokens(Ae.text,[],!0,he)),re.push(Ae);continue}if(Ae=this.tokenizer.strong(te,_e,me)){te=te.substring(Ae.raw.length),Ae.tokens=this.inlineTokens(Ae.text,[],ne,he),re.push(Ae);continue}if(Ae=this.tokenizer.em(te,_e,me)){te=te.substring(Ae.raw.length),Ae.tokens=this.inlineTokens(Ae.text,[],ne,he),re.push(Ae);continue}if(Ae=this.tokenizer.codespan(te)){te=te.substring(Ae.raw.length),re.push(Ae);continue}if(Ae=this.tokenizer.br(te)){te=te.substring(Ae.raw.length),re.push(Ae);continue}if(Ae=this.tokenizer.del(te)){te=te.substring(Ae.raw.length),Ae.tokens=this.inlineTokens(Ae.text,[],ne,he),re.push(Ae);continue}if(Ae=this.tokenizer.autolink(te,Re)){te=te.substring(Ae.raw.length),re.push(Ae);continue}if(!ne&&(Ae=this.tokenizer.url(te,Re))){te=te.substring(Ae.raw.length),re.push(Ae);continue}if(Ae=this.tokenizer.inlineText(te,he,et)){te=te.substring(Ae.raw.length),me=Ae.raw.slice(-1),re.push(Ae);continue}if(te){var pt="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(pt);break}else throw new Error(pt)}}return re},X(ge,null,[{key:"rules",get:function(){return{block:Ge,inline:$e}}}]),ge}(),He=G.defaults,Xe=$.cleanUrl,Ke=$.escape,Fe=function(){function ge(fe){this.options=fe||He}var de=ge.prototype;return de.code=function(te,re,ne){var he=(re||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(te,he);me!=null&&me!==te&&(ne=!0,te=me)}return he?'<pre><code class="'+this.options.langPrefix+Ke(he,!0)+'">'+(ne?te:Ke(te,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ne?te:Ke(te,!0))+`</code></pre>
|
|
`},de.blockquote=function(te){return`<blockquote>
|
|
`+te+`</blockquote>
|
|
`},de.html=function(te){return te},de.heading=function(te,re,ne,he){return this.options.headerIds?"<h"+re+' id="'+this.options.headerPrefix+he.slug(ne)+'">'+te+"</h"+re+`>
|
|
`:"<h"+re+">"+te+"</h"+re+`>
|
|
`},de.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},de.list=function(te,re,ne){var he=re?"ol":"ul",me=re&&ne!==1?' start="'+ne+'"':"";return"<"+he+me+`>
|
|
`+te+"</"+he+`>
|
|
`},de.listitem=function(te){return"<li>"+te+`</li>
|
|
`},de.checkbox=function(te){return"<input "+(te?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},de.paragraph=function(te){return"<p>"+te+`</p>
|
|
`},de.table=function(te,re){return re&&(re="<tbody>"+re+"</tbody>"),`<table>
|
|
<thead>
|
|
`+te+`</thead>
|
|
`+re+`</table>
|
|
`},de.tablerow=function(te){return`<tr>
|
|
`+te+`</tr>
|
|
`},de.tablecell=function(te,re){var ne=re.header?"th":"td",he=re.align?"<"+ne+' align="'+re.align+'">':"<"+ne+">";return he+te+"</"+ne+`>
|
|
`},de.strong=function(te){return"<strong>"+te+"</strong>"},de.em=function(te){return"<em>"+te+"</em>"},de.codespan=function(te){return"<code>"+te+"</code>"},de.br=function(){return this.options.xhtml?"<br/>":"<br>"},de.del=function(te){return"<del>"+te+"</del>"},de.link=function(te,re,ne){if(te=Xe(this.options.sanitize,this.options.baseUrl,te),te===null)return ne;var he='<a href="'+Ke(te)+'"';return re&&(he+=' title="'+re+'"'),he+=">"+ne+"</a>",he},de.image=function(te,re,ne){if(te=Xe(this.options.sanitize,this.options.baseUrl,te),te===null)return ne;var he='<img src="'+te+'" alt="'+ne+'"';return re&&(he+=' title="'+re+'"'),he+=this.options.xhtml?"/>":">",he},de.text=function(te){return te},ge}(),Pe=function(){function ge(){}var de=ge.prototype;return de.strong=function(te){return te},de.em=function(te){return te},de.codespan=function(te){return te},de.del=function(te){return te},de.html=function(te){return te},de.text=function(te){return te},de.link=function(te,re,ne){return""+ne},de.image=function(te,re,ne){return""+ne},de.br=function(){return""},ge}(),ot=function(){function ge(){this.seen={}}var de=ge.prototype;return de.slug=function(te){var re=te.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var ne=re;do this.seen[ne]++,re=ne+"-"+this.seen[ne];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},ge}(),Je=G.defaults,Ze=$.unescape,tt=function(){function ge(fe){this.options=fe||Je,this.options.renderer=this.options.renderer||new Fe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new ot}ge.parse=function(te,re){var ne=new ge(re);return ne.parse(te)};var de=ge.prototype;return de.parse=function(te,re){re===void 0&&(re=!0);var ne="",he,me,Ae,_e,st,gt,pt,Tt,St,dt,Ut,Mt,Jt,Qt,It,_r,Kr,Et,Br=te.length;for(he=0;he<Br;he++){dt=te[he];switch(dt.type){case"space":continue;case"hr":{ne+=this.renderer.hr();continue}case"heading":{ne+=this.renderer.heading(this.parseInline(dt.tokens),dt.depth,Ze(this.parseInline(dt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ne+=this.renderer.code(dt.text,dt.lang,dt.escaped);continue}case"table":{for(Tt="",pt="",_e=dt.header.length,me=0;me<_e;me++)pt+=this.renderer.tablecell(this.parseInline(dt.tokens.header[me]),{header:!0,align:dt.align[me]});for(Tt+=this.renderer.tablerow(pt),St="",_e=dt.cells.length,me=0;me<_e;me++){for(gt=dt.tokens.cells[me],pt="",st=gt.length,Ae=0;Ae<st;Ae++)pt+=this.renderer.tablecell(this.parseInline(gt[Ae]),{header:!1,align:dt.align[Ae]});St+=this.renderer.tablerow(pt)}ne+=this.renderer.table(Tt,St);continue}case"blockquote":{St=this.parse(dt.tokens),ne+=this.renderer.blockquote(St);continue}case"list":{for(Ut=dt.ordered,Mt=dt.start,Jt=dt.loose,_e=dt.items.length,St="",me=0;me<_e;me++)It=dt.items[me],_r=It.checked,Kr=It.task,Qt="",It.task&&(Et=this.renderer.checkbox(_r),Jt?It.tokens.length>0&&It.tokens[0].type==="text"?(It.tokens[0].text=Et+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=Et+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:Et}):Qt+=Et),Qt+=this.parse(It.tokens,Jt),St+=this.renderer.listitem(Qt,Kr,_r);ne+=this.renderer.list(St,Ut,Mt);continue}case"html":{ne+=this.renderer.html(dt.text);continue}case"paragraph":{ne+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(St=dt.tokens?this.parseInline(dt.tokens):dt.text;he+1<Br&&te[he+1].type==="text";)dt=te[++he],St+=`
|
|
`+(dt.tokens?this.parseInline(dt.tokens):dt.text);ne+=re?this.renderer.paragraph(St):St;continue}default:{var hr='Token with "'+dt.type+'" type was not found.';if(this.options.silent){console.error(hr);return}else throw new Error(hr)}}}return ne},de.parseInline=function(te,re){re=re||this.renderer;var ne="",he,me,Ae=te.length;for(he=0;he<Ae;he++){me=te[he];switch(me.type){case"escape":{ne+=re.text(me.text);break}case"html":{ne+=re.html(me.text);break}case"link":{ne+=re.link(me.href,me.title,this.parseInline(me.tokens,re));break}case"image":{ne+=re.image(me.href,me.title,me.text);break}case"strong":{ne+=re.strong(this.parseInline(me.tokens,re));break}case"em":{ne+=re.em(this.parseInline(me.tokens,re));break}case"codespan":{ne+=re.codespan(me.text);break}case"br":{ne+=re.br();break}case"del":{ne+=re.del(this.parseInline(me.tokens,re));break}case"text":{ne+=re.text(me.text);break}default:{var _e='Token with "'+me.type+'" type was not found.';if(this.options.silent){console.error(_e);return}else throw new Error(_e)}}}return ne},ge}(),ht=$.merge,rt=$.checkSanitizeDeprecation,Ve=$.escape,Ee=G.getDefaults,it=G.changeDefaults,qe=G.defaults;function we(ge,de,fe){if(typeof ge=="undefined"||ge===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ge!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ge)+", string expected");if(typeof de=="function"&&(fe=de,de=null),de=ht({},we.defaults,de||{}),rt(de),fe){var te=de.highlight,re;try{re=Be.lex(ge,de)}catch(Ae){return fe(Ae)}var ne=function(_e){var st;if(!_e)try{st=tt.parse(re,de)}catch(gt){_e=gt}return de.highlight=te,_e?fe(_e):fe(null,st)};if(!te||te.length<3)return ne();if(delete de.highlight,!re.length)return ne();var he=0;we.walkTokens(re,function(Ae){Ae.type==="code"&&(he++,setTimeout(function(){te(Ae.text,Ae.lang,function(_e,st){if(_e)return ne(_e);st!=null&&st!==Ae.text&&(Ae.text=st,Ae.escaped=!0),he--,he===0&&ne()})},0))}),he===0&&ne();return}try{var me=Be.lex(ge,de);return de.walkTokens&&we.walkTokens(me,de.walkTokens),tt.parse(me,de)}catch(Ae){if(Ae.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,de.silent)return"<p>An error occurred:</p><pre>"+Ve(Ae.message+"",!0)+"</pre>";throw Ae}}we.options=we.setOptions=function(ge){return ht(we.defaults,ge),it(we.defaults),we},we.getDefaults=Ee,we.defaults=qe,we.use=function(ge){var de=ht({},ge);if(ge.renderer&&function(){var te=we.defaults.renderer||new Fe,re=function(me){var Ae=te[me];te[me]=function(){for(var _e=arguments.length,st=new Array(_e),gt=0;gt<_e;gt++)st[gt]=arguments[gt];var pt=ge.renderer[me].apply(te,st);return pt===!1&&(pt=Ae.apply(te,st)),pt}};for(var ne in ge.renderer)re(ne);de.renderer=te}(),ge.tokenizer&&function(){var te=we.defaults.tokenizer||new xe,re=function(me){var Ae=te[me];te[me]=function(){for(var _e=arguments.length,st=new Array(_e),gt=0;gt<_e;gt++)st[gt]=arguments[gt];var pt=ge.tokenizer[me].apply(te,st);return pt===!1&&(pt=Ae.apply(te,st)),pt}};for(var ne in ge.tokenizer)re(ne);de.tokenizer=te}(),ge.walkTokens){var fe=we.defaults.walkTokens;de.walkTokens=function(te){ge.walkTokens(te),fe&&fe(te)}}we.setOptions(de)},we.walkTokens=function(ge,de){for(var fe=B(ge),te;!(te=fe()).done;){var re=te.value;de(re);switch(re.type){case"table":{for(var ne=B(re.tokens.header),he;!(he=ne()).done;){var me=he.value;we.walkTokens(me,de)}for(var Ae=B(re.tokens.cells),_e;!(_e=Ae()).done;)for(var st=_e.value,gt=B(st),pt;!(pt=gt()).done;){var Tt=pt.value;we.walkTokens(Tt,de)}break}case"list":{we.walkTokens(re.items,de);break}default:re.tokens&&we.walkTokens(re.tokens,de)}}},we.Parser=tt,we.parser=tt.parse,we.Renderer=Fe,we.TextRenderer=Pe,we.Lexer=Be,we.lexer=Be.lex,we.Tokenizer=xe,we.Slugger=ot,we.parse=we;var We=we;return We})},E7E6:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454Dh58iQdPPiJBk0fKN1E9KyU8gehUKjVcuIOPciAOCRYJ5J95JFHyq9cuaJZACHEJCklIOgHQUqZ0QIAACg/FB+//niPwxD/H3793QqwJkePHqW2tj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pIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(Me,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){var X={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},R=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(w,C,h){h&&h!=ie.Init&&(w.removeKeyMap(B),w.state.closeBrackets=null),C&&(_(Q(C,"pairs")),w.state.closeBrackets=C,w.addKeyMap(B))});function Q(w,C){return C=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[C]!=null?w[C]:X[C]}var B={Backspace:O,Enter:M};function _(w){for(var C=0;C<w.length;C++){var h=w.charAt(C),o="'"+h+"'";B[o]||(B[o]=G(h))}}_(X.pairs+"`");function G(w){return function(C){return T(C,w)}}function j(w){var C=w.state.closeBrackets;if(!C||C.override)return C;var h=w.getModeAt(w.getCursor());return h.closeBrackets||C}function O(w){var C=j(w);if(!C||w.getOption("disableInput"))return ie.Pass;for(var h=Q(C,"pairs"),o=w.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return ie.Pass;var d=k(w,o[l].head);if(!d||h.indexOf(d)%2!=0)return ie.Pass}for(var l=o.length-1;l>=0;l--){var A=o[l].head;w.replaceRange("",R(A.line,A.ch-1),R(A.line,A.ch+1),"+delete")}}function M(w){var C=j(w),h=C&&Q(C,"explode");if(!h||w.getOption("disableInput"))return ie.Pass;for(var o=w.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return ie.Pass;var d=k(w,o[l].head);if(!d||h.indexOf(d)%2!=0)return ie.Pass}w.operation(function(){var A=w.lineSeparator()||`
|
|
`;w.replaceSelection(A+A,null),w.execCommand("goCharLeft"),o=w.listSelections();for(var f=0;f<o.length;f++){var g=o[f].head.line;w.indentLine(g,null,!0),w.indentLine(g+1,null,!0)}})}function y(w){var C=ie.cmpPos(w.anchor,w.head)>0;return{anchor:new R(w.anchor.line,w.anchor.ch+(C?-1:1)),head:new R(w.head.line,w.head.ch+(C?1:-1))}}function T(w,C){var h=j(w);if(!h||w.getOption("disableInput"))return ie.Pass;var o=Q(h,"pairs"),l=o.indexOf(C);if(l==-1)return ie.Pass;for(var d=Q(h,"closeBefore"),A=Q(h,"triples"),f=o.charAt(l+1)==C,g=w.listSelections(),L=l%2==0,E,m=0;m<g.length;m++){var c=g[m],u=c.head,a,b=w.getRange(u,R(u.line,u.ch+1));if(L&&!c.empty())a="surround";else if((f||!L)&&b==C)f&&D(w,u)?a="both":A.indexOf(C)>=0&&w.getRange(u,R(u.line,u.ch+3))==C+C+C?a="skipThree":a="skip";else if(f&&u.ch>1&&A.indexOf(C)>=0&&w.getRange(R(u.line,u.ch-2),u)==C+C){if(u.ch>2&&/\bstring/.test(w.getTokenTypeAt(R(u.line,u.ch-2))))return ie.Pass;a="addFour"}else if(f){var v=u.ch==0?" ":w.getRange(R(u.line,u.ch-1),u);if(!ie.isWordChar(b)&&v!=C&&!ie.isWordChar(v))a="both";else return ie.Pass}else if(L&&(b.length===0||/\s/.test(b)||d.indexOf(b)>-1))a="both";else return ie.Pass;if(!E)E=a;else if(E!=a)return ie.Pass}var x=l%2?o.charAt(l-1):C,P=l%2?C:o.charAt(l+1);w.operation(function(){if(E=="skip")w.execCommand("goCharRight");else if(E=="skipThree")for(var H=0;H<3;H++)w.execCommand("goCharRight");else if(E=="surround"){for(var V=w.getSelections(),H=0;H<V.length;H++)V[H]=x+V[H]+P;w.replaceSelections(V,"around"),V=w.listSelections().slice();for(var H=0;H<V.length;H++)V[H]=y(V[H]);w.setSelections(V)}else E=="both"?(w.replaceSelection(x+P,null),w.triggerElectric(x+P),w.execCommand("goCharLeft")):E=="addFour"&&(w.replaceSelection(x+x+x+x,"before"),w.execCommand("goCharRight"))})}function k(w,C){var h=w.getRange(R(C.line,C.ch-1),R(C.line,C.ch+1));return h.length==2?h:null}function D(w,C){var h=w.getTokenAt(R(C.line,C.ch+1));return/\bstring/.test(h.type)&&h.start==C.ch&&(C.ch==0||!/\bstring/.test(w.getTokenTypeAt(C)))}})},FOrL:function(Me,Le,Z){Me.exports=Z.p+"static/nodata.a6b3f948.png"},FPkq:function(Me,Le,Z){Me.exports=Z.p+"static/qrCode.dd0fe9b2.png"},GABl:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k4b2EFVfTt29NQ8l+zKf4EIUbi4kAnhz7ohuLiH1qCwwo62cf9ccf3l0jibh1DckPy3lKzmTcbYQWV9+k7HlArOjaEjmejRm9yaWmzOMMKMncCp9x9dwlkYEeEQUCBrO0IrqYcApx1xsV6XLt2nWl43kyQqyB38dQJPZ7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vDCjIfulZM/KMo9YptchsAEk8HvPkvhdbVwYznIJJnA97EVBvLXlvfblZ0whG58nPWCvCHyJy0gyKPde7WOdVcP3JkWHfUqkOAxNn2Rcxn2vbZLXFhr15vW/nEdeeNcyUArr5ctO25OUAjH6z0+tZfzs4qRFJZiU1IHTySvPoDQKt3yeb1cFDJNhHcdI0amhQk7gh4fen1YoYPhgQ/ss/NzxHtHGj2nHDYNi/Hk9/MTQka2CoiN9t3fNVkUDr0/hU5b5SK5Gnw7yyCiMcWL+GH5sxkz80nWsO1e9uftHJysqHqtoigpy3nLYxJLgt4fY+EsnMg41FAltriIzciyjm2tcy0WuXCOUnKf/xGg1VvishwW0Fc8XIhNoYpJ7J9gfpLRByGyM8tc5FzkTromXBrxlJRaM2ReW0sSi0QQTfLwZiG1P582rv876Hs+DNehpKZFvEnoWE2U7dbbrrtTrmWjhPfeqybEby0ECLjrARF8ETML9DzxD2+WikbdifqDHND2vb/PpDm5/oXcV3XRey+tsaKH1tTLhyh661H0xCsmyaQCW1dg1HTHwpMWLbmcpneBJH7Wg+QVdCwFKI/z7R/fWdHyDULaiCIL5jdScM3Y6X+m04/aXIPQGJnwJs/OCTm8yEjYSDMLSurQPkI5CrcoK2ja0vobBTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},Gytx:function(Me,Le){Me.exports=function(ie,X,R,Q){var B=R?R.call(Q,ie,X):void 0;if(B!==void 0)return!!B;if(ie===X)return!0;if(typeof ie!="object"||!ie||typeof X!="object"||!X)return!1;var _=Object.keys(ie),G=Object.keys(X);if(_.length!==G.length)return!1;for(var j=Object.prototype.hasOwnProperty.bind(X),O=0;O<_.length;O++){var M=_[O];if(!j(M))return!1;var y=ie[M],T=X[M];if(B=R?R.call(Q,y,T,M):void 0,B===!1||B===void 0&&y!==T)return!1}return!0}},HmJG:function(Me,Le,Z){},HpTS:function(Me,Le,Z){Me.exports=Z.p+"static/small_program.f74069ec.png"},JWDV:function(Me,Le,Z){Me.exports=Z.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/9qgVaWlHIggHMB+AA8K4TIbe2ek/FzKWUmgLGw7THQtLlCiBUn4z6j9ySa26SUMg3A+ZDyaljBMTC87mXrAUwSQtT+fxBOSqmbpjnaMIyrYJnToRvtQ/sOAJgihFh1ssvRSEFSysEAroJlXQZdp8VhXUEAS07UYGavBPSIQz10vacQ4vjJLJiUMgPAhZByJoQYyr0erZFYmFOFZK+GK7szGOB3Qoi/nsxycG9KQVLKKyDltbDMbBge5NYD87+twvxjNdhbZiIoJZZMysRpPqsShreXECL/ZBRMSjkAwM2wzIugG2k2gOW59fjgaDU2FNbjRI2Fm/r48eigdtz+TUKIF05GOSL3JKSUDwN4SALYXBRQwqzIrUNBvQ1DAIYm4BHAJxMz0TPOLoJu9BFClJxsglVVVWXGx8d/IYTIOl4rsSCnGvNzarCvIghLAl5NoN6WuKVPAu4dkMjtXyuEeP1kk6NJDpJSHgTQ8+Ht5Xj5UBWoqBhNQAsFP/6dwi2alIlTYq1caEY/IUT5zyGYlLIvgD4AugLIgm0zF3qgaccDgcCbMTExu1v6Xinl6YDc/lWxiWvWF6E04BiYxxUEQK0lcUe/BNx9qlLQFUKIt38mOVIAnA6gG4AugM104Qe0ajo1gA+FEHTwVhc96CoAbzy9txJP7KpAPKWKWFRQrCawZEoHZHnN4yEFVbX65DZeIKW8DVI+DiHimrtVSnlCCDFUCHGihc+TYJl7jwf1DlOW5KHWltCiLqSCfndqIm7vlwDLsi41DOP9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+"static/qrcode.2267e4d5.png"},LdHM:function(Me,Le,Z){"use strict";Z.d(Le,"b",function(){return d}),Z.d(Le,"a",function(){return f});var ie=Z("1OyB"),X=Z("vuIU"),R=Z("Ji7U"),Q=Z("LK+K"),B=Z("q1tI"),_=Z("rePB"),G=Z("Ff2n"),j=Z("ODXe"),O=Z("4IlW"),M=Z("bX4T"),y=Z("YrtM"),T=Z("TSYQ"),k=Z.n(T),D=Z("+nKL"),w=Z("8OUc"),C=function(ee,oe){var le=ee.prefixCls,ve=ee.id,Ie=ee.flattenOptions,xe=ee.childrenAsData,Ce=ee.values,Te=ee.searchValue,Se=ee.multiple,pe=ee.defaultActiveFirstOption,se=ee.height,De=ee.itemHeight,Ye=ee.notFoundContent,Ge=ee.open,$e=ee.menuItemSelectedIcon,et=ee.virtual,Re=ee.onSelect,Be=ee.onToggleOpen,He=ee.onActiveValue,Xe=ee.onScroll,Ke=ee.onMouseEnter,Fe="".concat(le,"-item"),Pe=Object(y.a)(function(){return Ie},[Ge,Ie],function(We,ge){return ge[0]&&We[1]!==ge[1]}),ot=B.useRef(null),Je=function(ge){ge.preventDefault()},Ze=function(ge){ot.current&&ot.current.scrollTo({index:ge})},tt=function(ge){for(var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fe=Pe.length,te=0;te<fe;te+=1){var re=(ge+te*de+fe)%fe,ne=Pe[re],he=ne.group,me=ne.data;if(!he&&!me.disabled)return re}return-1},ht=B.useState(function(){return tt(0)}),rt=Object(j.a)(ht,2),Ve=rt[0],Ee=rt[1],it=function(ge){Ee(ge);var de=Pe[ge];if(!de){He(null,-1);return}He(de.data.value,ge)};B.useEffect(function(){it(pe!==!1?tt(0):-1)},[Pe.length,Te]),B.useEffect(function(){var We=setTimeout(function(){if(!Se&&Ge&&Ce.size===1){var ge=Array.from(Ce)[0],de=Pe.findIndex(function(fe){var te=fe.data;return te.value===ge});it(de),Ze(de)}});return function(){return clearTimeout(We)}},[Ge]);var qe=function(ge){ge!==void 0&&Re(ge,{selected:!Ce.has(ge)}),Se||Be(!1)};if(B.useImperativeHandle(oe,function(){return{onKeyDown:function(ge){var de=ge.which;switch(de){case O.a.UP:case O.a.DOWN:{var fe=0;if(de===O.a.UP?fe=-1:de===O.a.DOWN&&(fe=1),fe!==0){var te=tt(Ve+fe,fe);Ze(te),it(te)}break}case O.a.ENTER:{var re=Pe[Ve];re&&!re.data.disabled?qe(re.data.value):qe(void 0),Ge&&ge.preventDefault();break}case O.a.ESC:Be(!1)}},onKeyUp:function(){},scrollTo:function(ge){Ze(ge)}}}),Pe.length===0)return B.createElement("div",{role:"listbox",id:"".concat(ve,"_list"),className:"".concat(Fe,"-empty"),onMouseDown:Je},Ye);function we(We){var ge=Pe[We];if(!ge)return null;var de=ge.data||{},fe=de.value,te=de.label,re=de.children,ne=Object(M.a)(de,!0),he=xe?re:te;return ge?B.createElement("div",Object.assign({"aria-label":typeof he=="string"?he:null},ne,{key:We,role:"option",id:"".concat(ve,"_list_").concat(We),"aria-selected":Ce.has(fe)}),fe):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(ve,"_list"),style:{height:0,width:0,overflow:"hidden"}},we(Ve-1),we(Ve),we(Ve+1)),B.createElement(D.a,{itemKey:"key",ref:ot,data:Pe,height:se,itemHeight:De,fullHeight:!1,onMouseDown:Je,onScroll:Xe,virtual:et,onMouseEnter:Ke},function(We,ge){var de,fe=We.group,te=We.groupOption,re=We.data,ne=re.label,he=re.key;if(fe)return B.createElement("div",{className:k()(Fe,"".concat(Fe,"-group"))},ne!==void 0?ne:he);var me=re.disabled,Ae=re.value,_e=re.title,st=re.children,gt=re.style,pt=re.className,Tt=Object(G.a)(re,["disabled","value","title","children","style","className"]),St=Ce.has(Ae),dt="".concat(Fe,"-option"),Ut=k()(Fe,dt,pt,(de={},Object(_.a)(de,"".concat(dt,"-grouped"),te),Object(_.a)(de,"".concat(dt,"-active"),Ve===ge&&!me),Object(_.a)(de,"".concat(dt,"-disabled"),me),Object(_.a)(de,"".concat(dt,"-selected"),St),de)),Mt=xe?st:ne,Jt=!$e||typeof $e=="function"||St;return B.createElement("div",Object.assign({},Tt,{"aria-selected":St,className:Ut,title:_e,onMouseMove:function(){if(Ve===ge||me)return;it(ge)},onClick:function(){me||qe(Ae)},style:gt}),B.createElement("div",{className:"".concat(dt,"-content")},Mt||Ae),B.isValidElement($e)||St,Jt&&B.createElement(w.a,{className:"".concat(Fe,"-option-state"),customizeIcon:$e,customizeIconProps:{isSelected:St}},St?"\u2713":null))}))},h=B.forwardRef(C);h.displayName="OptionList";var o=h,l=function(){return null};l.isSelectOption=!0;var d=l,A=function(){return null};A.isSelectOptGroup=!0;var f=A,g=Z("VTBJ"),L=Z("Zm9Q");function E(F){var ee=F.key,oe=F.props,le=oe.children,ve=oe.value,Ie=Object(G.a)(oe,["children","value"]);return Object(g.a)({key:ee,value:ve!==void 0?ve:ee,children:le},Ie)}function m(F){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(F).map(function(oe,le){if(!B.isValidElement(oe)||!oe.type)return null;var ve=oe.type.isSelectOptGroup,Ie=oe.key,xe=oe.props,Ce=xe.children,Te=Object(G.a)(xe,["children"]);return ee||!ve?E(oe):Object(g.a)(Object(g.a)({key:"__RC_SELECT_GRP__".concat(Ie===null?le:Ie,"__"),label:Ie},Te),{},{options:m(Ce)})}).filter(function(oe){return oe})}var c=Z("2Qr1"),u=Z("qNPg"),a=Z("U8pU"),b=Z("Kwbf"),v=Z("WKfj");function x(F){var ee=F.mode,oe=F.options,le=F.children,ve=F.backfill,Ie=F.allowClear,xe=F.placeholder,Ce=F.getInputElement,Te=F.showSearch,Se=F.onSearch,pe=F.defaultOpen,se=F.autoFocus,De=F.labelInValue,Ye=F.value,Ge=F.inputValue,$e=F.optionLabelProp,et=ee==="multiple"||ee==="tags",Re=Te!==void 0?Te:et||ee==="combobox",Be=oe||m(le);if(Object(b.a)(ee!=="tags"||Be.every(function(Fe){return!Fe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ee==="tags"||ee==="combobox"){var He=Be.some(function(Fe){return Fe.options?Fe.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in Fe?Fe.value:Fe.key)=="number"});Object(b.a)(!He,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(ee!=="combobox"||!$e,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(ee==="combobox"||!ve,"`backfill` only works with `combobox` mode."),Object(b.a)(ee==="combobox"||!Ce,"`getInputElement` only work with `combobox` mode."),Object(b.b)(ee!=="combobox"||!Ce||!Ie||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Se&&!Re&&ee!=="combobox"&&ee!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!pe||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ye!=null){var Xe=Object(v.d)(Ye);Object(b.a)(!De||Xe.every(function(Fe){return Object(a.a)(Fe)==="object"&&("key"in Fe||"value"in Fe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!et||Array.isArray(Ye),"`value` should be array when `mode` is `multiple` or `tags`")}if(le){var Ke=null;Object(L.a)(le).some(function(Fe){if(!B.isValidElement(Fe)||!Fe.type)return!1;var Pe=Fe.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var ot=Object(L.a)(Fe.props.children).every(function(Je){return!B.isValidElement(Je)||!Fe.type||Je.type.isSelectOption?!0:(Ke=Je.type,!1)});return!ot}return Ke=Pe,!0}),Ke&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ke.displayName||Ke.name||Ke,"`.")),Object(b.a)(Ge===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=x,H=Object(u.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:m,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:P,fillOptionsWithMissingValue:c.a}),V=function(F){Object(R.a)(oe,F);var ee=Object(Q.a)(oe);function oe(){var le;return Object(ie.a)(this,oe),le=ee.apply(this,arguments),le.selectRef=B.createRef(),le.focus=function(){le.selectRef.current.focus()},le.blur=function(){le.selectRef.current.blur()},le}return Object(X.a)(oe,[{key:"render",value:function(){return B.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),oe}(B.Component);V.Option=d,V.OptGroup=f;var $=V,z=Le.c=$},M8RZ:function(Me,Le,Z){"use strict";Z.d(Le,"a",function(){return O});var ie=Z("fWQN"),X=Z("mtLc"),R=Z("yKVA"),Q=Z("879j"),B=Z("q1tI"),_=Z.n(B),G=Z("i8i4"),j=Z.n(G),O=function(M){Object(R.a)(T,M);var y=Object(Q.a)(T);function T(k){var D;Object(ie.a)(this,T),D=y.call(this,k);var w=window.document;return D.node=w.createElement("div"),w.body.appendChild(D.node),D}return Object(X.a)(T,[{key:"render",value:function(){var D=this.props.children;return Object(G.createPortal)(D,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),T}(_.a.Component)},Nmxd:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStK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7jLJdlOIxzfUwwbTHY+zSy+ccldAkbtRjimThroCYAzA46bqUl6JmxOh+IH8mbq1K65NXLuIIAnymqAMQbyNRrhtvT0qkQgqe4lRof7RHKdEe6Y9XEe0NVDBLzsnrMwcmbp/rOs8lXPQtzODHhY+/9LEq0aCcV0M22wX21jge5yiwdwGVW+RuPZnGUVM9FkP+NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},OLES:function(Me,Le,Z){"use strict";var ie=Z("U8pU"),X=Z("VTBJ"),R=Z("Ff2n"),Q=Z("q1tI"),B=Z("uciX"),_=Z("7ixt"),G=function(k){var D=k.overlay,w=k.prefixCls,C=k.id,h=k.overlayInnerStyle;return Q.createElement("div",{className:"".concat(w,"-inner"),id:C,role:"tooltip",style:h},typeof D=="function"?D():D)},j=G,O=function(k,D){var w=k.overlayClassName,C=k.trigger,h=C===void 0?["hover"]:C,o=k.mouseEnterDelay,l=o===void 0?0:o,d=k.mouseLeaveDelay,A=d===void 0?.1:d,f=k.overlayStyle,g=k.prefixCls,L=g===void 0?"rc-tooltip":g,E=k.children,m=k.onVisibleChange,c=k.afterVisibleChange,u=k.transitionName,a=k.animation,b=k.placement,v=b===void 0?"right":b,x=k.align,P=x===void 0?{}:x,H=k.destroyTooltipOnHide,V=H===void 0?!1:H,$=k.defaultVisible,z=k.getTooltipContainer,F=k.overlayInnerStyle,ee=Object(R.a)(k,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),oe=Object(Q.useRef)(null);Object(Q.useImperativeHandle)(D,function(){return oe.current});var le=Object(X.a)({},ee);"visible"in k&&(le.popupVisible=k.visible);var ve=function(){var Se=k.arrowContent,pe=Se===void 0?null:Se,se=k.overlay,De=k.id;return[Q.createElement("div",{className:"".concat(L,"-arrow"),key:"arrow"},pe),Q.createElement(j,{key:"content",prefixCls:L,id:De,overlay:se,overlayInnerStyle:F})]},Ie=!1,xe=!1;if(typeof V=="boolean")Ie=V;else if(V&&Object(ie.a)(V)==="object"){var Ce=V.keepParent;Ie=Ce===!0,xe=Ce===!1}return Q.createElement(B.a,Object.assign({popupClassName:w,prefixCls:L,popup:ve,action:h,builtinPlacements:_.a,popupPlacement:v,ref:oe,popupAlign:P,getPopupContainer:z,onPopupVisibleChange:m,afterPopupVisibleChange:c,popupTransitionName:u,popupAnimation:a,defaultPopupVisible:$,destroyPopupOnHide:Ie,autoDestroy:xe,mouseLeaveDelay:A,popupStyle:f,mouseEnterDelay:l},le),E)},M=Object(Q.forwardRef)(O),y=Le.a=M},Ohmc:function(Me,Le,Z){Me.exports=Z.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Me,Le,Z){"use strict";var ie=Z("2qtc"),X=Z("kLXV"),R=Z("rAM+"),Q=Z("miYZ"),B=Z("tsqr"),_=Z("9og8"),G=Z("tJVT"),j=Z("jrin"),O=Z("WmNS"),M=Z.n(O),y=Z("q1tI"),T=Z.n(y),k=Z("VrN/"),D=Z.n(k),w=Z("bdgK"),C=Z("p77/"),h=Z("Bd2K"),o=Z("ELLl"),l=Z("19Vz"),d=Z("lZu9"),A=Z("+NIl"),f=Z("kSUc"),g=Z("9Bee"),L=function(me){var Ae=me.value,_e=Ae===void 0?"":Ae,st=me.className,gt=me.showTextOnly,pt=me.showLines,Tt=me.style,St=Tt===void 0?{}:Tt,dt=Object(y.useMemo)(function(){return""},[_e]);return T.a.createElement(T.a.Fragment,null,T.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},E=Z("0Owb"),m=Z("dejd"),c=Z("C+DQ"),u=Z("1vsH"),a=Z("m3rI"),b=[{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 v(me){var Ae=me.onActionCallback,_e=me.title,st=me.icon,gt=me.actionName,pt=me.className,Tt=pt===void 0?"":pt,St=me.children;function dt(){Ae(gt)}return T.a.createElement("a",{title:_e,className:Tt,onClick:dt},T.a.createElement("i",{className:"md-iconfont ".concat(st)}),St)}var x=function(me){var Ae=me.watch,_e=me.showNullButton,st=me.onActionCallback,gt=me.fullScreen,pt=me.insertTemp,Tt=me.hidetoolBar,St=me.uuid,dt=me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(u.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(u.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Ut=[].concat(b,[{title:"".concat(Ae?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ae?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return T.a.createElement("ul",{className:"markdown-toolbar-container"},!Tt&&Ut.map(function(Mt,Jt){return T.a.createElement("li",{key:Jt},Mt.actionName?T.a.createElement(v,Object(E.a)({},Mt,{onActionCallback:st})):T.a.createElement("span",{className:"v-line"}))}),_e?T.a.createElement("li",null,T.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:st},T.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,pt&&T.a.createElement("li",null,T.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(pt),onActionCallback:st},T.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),T.a.createElement("li",{className:"btn-full-screen"},T.a.createElement(v,{icon:"".concat(gt?"icon-shrink":"icon-enlarge"),title:gt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:st})))},P=Z("M8RZ"),H=Z("+L6B"),V=Z("2/Rp"),$=Z("y8nQ"),z=Z("Vl3Y"),F=Z("5NDa"),ee=Z("5rEg"),oe={labelCol:{span:4},wrapperCol:{span:20}},le=function(me){var Ae=me.callback,_e=me.onCancel;function st(gt){Ae(gt)}return T.a.createElement(z.a,Object(E.a)({},oe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:st}),T.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},T.a.createElement(ee.a,null)),T.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},T.a.createElement(ee.a,null)),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(V.a,{type:"ghost",onClick:_e},"\u53D6\u6D88")))},ve=Z("7ahc"),Ie=Z("HmJG"),xe=Z("BjJ7"),Ce=z.a.useForm,Te={width:280,marginRight:10},Se={labelCol:{span:5},wrapperCol:{span:19}},pe=function(me){var Ae=me.callback,_e=me.onCancel,st=Ce(),gt=Object(G.a)(st,1),pt=gt[0];function Tt(Ut){Ae(Ut)}function St(Ut,Mt){if(Ut.status===-1){B.b.error(Ut.message);return}pt.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Mt.type})}function dt(Ut){var Mt=Ut.target.files[0];De(Mt,St)}return T.a.createElement(z.a,Object(E.a)({form:pt},Se,{className:"upload-image-panel",onFinish:Tt}),T.a.createElement(z.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},T.a.createElement("div",{className:"flex-container"},T.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},T.a.createElement(ee.a,{style:Te})),T.a.createElement(se,{onFileChange:dt}))),T.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},T.a.createElement(ee.a,{style:{width:264}})),T.a.createElement(z.a.Item,{style:{textAlign:"right"}},T.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(V.a,{type:"ghost",onClick:_e},"\u53D6\u6D88")))};function se(me){var Ae=me.onFileChange;return T.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",T.a.createElement("input",{type:"file",onChange:Ae}))}function De(me,Ae){if(!me)throw new String("\u6CA1\u6709\u6587\u4EF6");var _e=new FormData;_e.append("editormd-image-file",me),_e.append("file_param_name","editormd-image-file"),_e.append("byxhr","true");var st=new window.XMLHttpRequest;st.withCredentials=!0,st.addEventListener("load",function(gt){Ae(JSON.parse(gt.target.responseText),me)},!1),st.addEventListener("error",function(gt){console.error(gt)},!1),st.open("POST","".concat(xe.a,"/api/attachments.json")),st.send(_e)}var Ye=Z("giR+"),Ge=Z("fyUT"),$e=Z("7Kak"),et=Z("9yH6"),Re=et.a.Group,Be={margin:"0 8px"},He=function(me){var Ae=me.callback,_e=me.onCancel;function st(gt){Ae(gt)}return T.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:st},T.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},T.a.createElement("span",{style:Be},"\u5355\u5143\u683C\u6570\uFF1A"),T.a.createElement("span",{style:Be},"\u884C\u6570"),T.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},T.a.createElement(Ge.a,null)),T.a.createElement("span",{style:Be},"\u5217\u6570"),T.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},T.a.createElement(Ge.a,null))),T.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},T.a.createElement("span",{style:Be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),T.a.createElement(z.a.Item,{name:"align"},T.a.createElement(Re,null,T.a.createElement(et.a,{value:"default"},T.a.createElement("i",{className:"fa fa-align-justify"})),T.a.createElement(et.a,{value:"left"},T.a.createElement("i",{className:"fa fa-align-left"})),T.a.createElement(et.a,{value:"center"},T.a.createElement("i",{className:"fa fa-align-center"})),T.a.createElement(et.a,{value:"right"},T.a.createElement("i",{className:"fa fa-align-right"}))))),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(V.a,{type:"ghost",onClick:_e},"\u53D6\u6D88")))},Xe=Z("ErOA"),Ke=Z("7Cbv"),Fe="link",Pe="upload-image",ot="code-block",Je="add-table",Ze="------------",tt={default:Ze,left:":".concat(Ze),center:":".concat(Ze,":"),right:"".concat(Ze,":")},ht=Z("9VGf"),rt,Ve;function Ee(){}var it=0,qe=1e4,we="\u2581",We=`
|
|
**\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 ge(me){return/^\d+$/.test(me)?"".concat(me,"px"):me}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=de?"Cmd":"Ctrl",te=["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"],re=(rt={},Object(j.a)(rt,fe+"-B","bold"),Object(j.a)(rt,fe+"-I","italic"),rt),ne=(Ve={},Object(j.a)(Ve,Fe,"\u6DFB\u52A0\u94FE\u63A5"),Object(j.a)(Ve,ot,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(j.a)(Ve,Pe,"\u6DFB\u52A0\u6587\u4EF6"),Object(j.a)(Ve,Je,"\u6DFB\u52A0\u8868\u683C"),Ve),he=Le.a=function(me){var Ae=me.defaultValue,_e=Ae===void 0?"":Ae,st=me.onChange,gt=me.width,pt=gt===void 0?"100%":gt,Tt=me.height,St=Tt===void 0?400:Tt,dt=me.miniToolbar,Ut=dt===void 0?!1:dt,Mt=me.isFocus,Jt=Mt===void 0?!1:Mt,Qt=me.watch,It=me.insertTemp,_r=me.mode,Kr=_r===void 0?"markdown":_r,Et=me.id,Br=Et===void 0?"markdown-editor-id":Et,hr=me.showResizeBar,pr=hr===void 0?!1:hr,Nr=me.noStorage,ci=Nr===void 0?!1:Nr,$r=me.showNullButton,_t=$r===void 0?!1:$r,ct=me.hidetoolBar,Hr=ct===void 0?!1:ct,ei=me.fullScreen,mr=ei===void 0?!1:ei,Lt=me.onBlur,Ur=me.onCMBeforeChange,Vr=me.onFullScreen,fi=me.className,je=fi===void 0?"":fi,Ct=me.disablePaste,pi=Ct===void 0?!1:Ct,mi=me.placeholder,gi=mi===void 0?"":mi,vi=me.values,W=vi===void 0?"":vi,s=Object(y.useState)(null),p=Object(G.a)(s,2),I=p[0],J=p[1],U=Object(y.useState)(_e),ce=Object(G.a)(U,2),Oe=ce[0],Qe=ce[1],ft=Object(y.useState)(Qt),Ne=Object(G.a)(ft,2),yt=Ne[0],Bt=Ne[1],Kt=Object(y.useState)(mr),Ir=Object(G.a)(Kt,2),gr=Ir[0],vr=Ir[1],Qr=Object(y.useState)(""),Ii=Object(G.a)(Qr,2),nr=Ii[0],Fr=Ii[1],oi=Object(y.useState)(0),si=Object(G.a)(oi,2),Mr=si[0],Mi=si[1],yi=Object(y.useState)(St),zi=Object(G.a)(yi,2),Ki=zi[0],Yr=zi[1],Gr=Object(y.useState)(!1),bi=Object(G.a)(Gr,2),dn=bi[0],Ei=bi[1],Zt=Object(y.useRef)(Object(Ke.a)()),Nt=Object(y.useRef)(!1),dr=Object(y.useRef)(),Rt=Object(y.useRef)(),$t=Object(y.useRef)(),jt=Object(y.useRef)(),ti=Object(y.useRef)(),ar=function(){var mt=Object(_.a)(M.a.mark(function At(){var bt,Dt;return M.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(Xe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Zt.current}});case 2:Dt=Gt.sent,Dt!=null&&(bt=Dt.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",I,Rt),Dt.attachments.map(function(Ot){Ot.content_type.indexOf("image")>-1?I.replaceSelection(".concat(Ot.content_type,")")):Ot.content_type.indexOf("video")>-1?I.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ot.content_type.indexOf("pdf")>-1?I.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Ot.id,"?type=").concat(Ot.content_type,'&disposition=inline" target="_blank">').concat(Ot.name,"</a>")):I.replaceSelection("[".concat(Ot.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ot.id,"?type=").concat(Ot.content_type,")"))}));case 4:case"end":return Gt.stop()}},At)}));return function(){return mt.apply(this,arguments)}}();Object(y.useEffect)(function(){Qe(W),I==null||I.setValue(W)},[W]),Object(y.useEffect)(function(){Vr==null||Vr(gr)},[gr]),Object(y.useEffect)(function(){if(Rt.current){var mt=D.a.fromTextArea(Rt.current,{mode:Kr,lineNumbers:!Ut,lineWrapping:!0,value:_e,autoCloseTags:!0,autoCloseBrackets:!0});Jt&&mt.focus();function At(bt,Dt){if(pi){Dt.preventDefault();return}var Pt=Dt.clipboardData;if(Pt){var Gt=Pt.types.toString(),Ot=Pt.items;if(Gt==="Files"||Pt.types.indexOf("Files")>-1){if(Dt.preventDefault(),Kr=="stex")return;try{var rr,Ar=Ot[1];((rr=Ot[0])===null||rr===void 0?void 0:rr.kind)==="file"&&(Ar=Ot[0]);var kt=Ar.getAsFile(),li=kt.name.split(".").pop();De(kt,function(Ft){if(Ft.id){var Tr,yr,zr;(kt==null||((Tr=kt.type)===null||Tr===void 0)?void 0:Tr.indexOf("image"))>-1?mt.replaceSelection(".concat(Ft.content_type,")")):(kt==null||((yr=kt.type)===null||yr===void 0)?void 0:yr.indexOf("video"))>-1?mt.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,'"></video>')):(kt==null||((zr=kt.type)===null||zr===void 0)?void 0:zr.indexOf("pdf"))>-1?mt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(kt.type,'&disposition=inline" target="_blank">').concat(kt.name,"</a>")):te.includes(li)?mt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,'?type=office&disposition=inline" target="_blank">').concat(kt.name,"</a>")):mt.replaceSelection("[".concat(kt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Ft.content_type,")"))}else(Ft==null?void 0:Ft.status)===401&&(document.location.href="/user/login")})}catch(Ft){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return mt.on("paste",At),mt.on("dragleave",function(bt,Dt){$t.current.classList.remove("mouse-hover-md")}),mt.on("dragover",function(bt,Dt){$t.current.classList.add("mouse-hover-md")}),mt.on("drop",function(bt,Dt){$t.current.classList.add("mouse-hover-md");var Pt;if(Pt=Dt.dataTransfer.files,Pt.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Gt=function(Ar){var kt=Pt[Ar],li=kt.name.split(".").pop();De(kt,function(Ft){if(Ft.id){var Tr,yr,zr;(kt==null||((Tr=kt.type)===null||Tr===void 0)?void 0:Tr.indexOf("image"))>-1?mt.replaceSelection(".concat(Ft.content_type,")")):(kt==null||((yr=kt.type)===null||yr===void 0)?void 0:yr.indexOf("video"))>-1?mt.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,'"></video>')):(kt==null||((zr=kt.type)===null||zr===void 0)?void 0:zr.indexOf("pdf"))>-1?mt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(kt.type,'&disposition=inline" target="_blank">').concat(kt.name,"</a>")):te.includes(li)?mt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,'?type=office&disposition=inline" target="_blank">').concat(kt.name,"</a>")):mt.replaceSelection("[".concat(kt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Ft.content_type,")"))}else(Ft==null?void 0:Ft.status)===401&&(document.location.href="/user/login")})},Ot=0;Ot<Pt.length;Ot++)Gt(Ot)}}),J(mt),function(){mt.off("paste",At)}}},[]);var xr=Object(y.useCallback)(function(){if($t.current)try{}catch(mt){console.log(mt,"---- to set md editor body height")}},[Ki,$t,gr]);Object(y.useEffect)(function(){function mt(){var bt=new w.default(function(Dt){var Pt=Object(R.a)(Dt),Gt;try{for(Pt.s();!(Gt=Pt.n()).done;){var Ot=Gt.value;(Ot.target.offsetHeight>0||Ot.target.offsetWidth>0)&&(xr(),I.setSize("100%","100%"),I.refresh())}}catch(rr){Pt.e(rr)}finally{Pt.f()}});return bt.observe(Rt.current.parentElement),bt}if(I){var At=mt();return function(){At.unobserve(Rt.current.parentElement)}}},[I,xr]),Object(y.useEffect)(function(){if(I){for(var mt=[],At=function(){var Ot=Dt[bt];Pt=Object(G.a)(Ot,2);var rr=Pt[0],Ar=Pt[1],kt=Object(j.a)({},rr,function(){Vi(Ar)});mt.push(kt),I.addKeyMap(kt)},bt=0,Dt=Object.entries(re);bt<Dt.length;bt++){var Pt;At()}return dr.current=setInterval(function(){Nt.current&&ar()},4e3),function(){clearInterval(dr.current);var Gt=Object(R.a)(mt),Ot;try{for(Gt.s();!(Ot=Gt.n()).done;){var rr=Ot.value;I.removeKeyMap(rr)}}catch(Ar){Gt.e(Ar)}finally{Gt.f()}}}},[I]),Object(y.useEffect)(function(){mr!==gr&&vr(mr)},[mr]),Object(ht.a)(function(){if(!ci&&Mr>0){var mt=new Date().getTime(),At=window.sessionStorage.getItem(Br);mt>=Mr+qe&&(!At||At!==Oe)&&(window.sessionStorage.setItem(Br,Oe),Ei(!0))}},qe),Object(y.useEffect)(function(){Bt(Qt)},[I,Qt]),Object(y.useEffect)(function(){I&&(Jt&&I.focus())},[I,Jt]),Object(y.useEffect)(function(){if(yt&&I){var mt=I.getScrollerElement();function At(bt){var Dt=bt.target;if(ti.current){var Pt=Dt.scrollTop/Dt.scrollHeight;ti.current.scrollTop=ti.current.scrollHeight*Pt}}return mt.addEventListener("scroll",At),function(){mt.removeEventListener("scroll",At)}}},[I,yt]),Object(y.useEffect)(function(){if(I&&Ur){function mt(At,bt){Ur(At,bt)}return I.on("beforeChange",mt),function(){I.off("beforeChange",mt)}}},[I,Ur]),Object(y.useEffect)(function(){if(I&&Lt){function mt(){Lt(I.getValue())}return I.on("blur",mt),function(){I.off("blur",mt)}}},[I,Lt]),Object(y.useEffect)(function(){if(I){function mt(At){var bt=At.getValue();Qe(bt),Mi(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),st&&st(bt)}return I.on("change",mt),function(){I.off("change",mt)}}},[I,st]),Object(y.useEffect)(function(){I&&(_e==null?(I.setValue(""),Qe("")):_e!==I.getValue()&&(I.setValue(_e),Qe(_e),I.setCursor(I.lineCount(),0)))},[I,_e]);var Vi=Object(y.useCallback)(function(mt){var At=I.getCursor(),bt=I.getSelection(),Dt=bt.split(`
|
|
`);switch(mt){case"bold":return I.replaceSelection("**"+bt+"**"),bt===""&&I.setCursor(At.line,At.ch+2),I.focus();case"italic":return I.replaceSelection("*"+bt+"*"),bt===""&&I.setCursor(At.line,At.ch+1),I.focus();case"code":return I.replaceSelection("`"+bt+"`"),bt===""&&I.setCursor(At.line,At.ch+1),I.focus();case"inline-latex":return I.replaceSelection("`$$"+bt+"$$`"),bt===""&&I.setCursor(At.line,At.ch+3),I.focus();case"latex":return I.replaceSelection("```latex\n"+bt+"\n```"),I.setCursor(At.line+1,bt.length+1),I.focus();case"line-break":return I.replaceSelection(`<br/>
|
|
`),I.focus();case"list-ul":return bt===""?I.replaceSelection("- "+bt):I.replaceSelection(Dt.map(function(Pt){return Pt===""?"":"- ".concat(Pt)}).join(`
|
|
`)),I.focus();case"list-ol":return bt===""?I.replaceSelection("1. "+bt):I.replaceSelection(Dt.map(function(Pt,Gt){return Pt===""?"":"".concat(Gt+1,". ").concat(Pt)}).join(`
|
|
`)),I.focus();case"add-null-ch":return bt===""&&I.setCursor(At.line,At.ch+1),I.replaceSelection(we),I.focus();case"inster-template-1":return bt===""&&I.setCursor(At.line,At.ch),I.replaceSelection(We),I.focus();case"eraser":return I.setValue(""),I.focus();case"trigger-watch":return Bt(!yt),I.focus();case"trigger-full-screen":return vr(!gr),I.focus();case Fe:Fr(Fe);return;case ot:Fr(ot);return;case Pe:Fr(Pe);return;case Je:Fr(Je);return;default:throw new Error}},[I,yt,gr]),xi=Object(y.useCallback)(function(mt){Fr("");switch(nr){case Fe:var At=mt.title,bt=mt.link;return I.replaceSelection("[".concat(At,"](").concat(bt,")")),I.focus();case ot:var Dt=mt.language,Pt=mt.content;return I.replaceSelection(["```"+Dt,Pt,"```"].join(`
|
|
`)),I.focus();case Pe:var Gt=mt.src,Ot=mt.alt;return Ot?I.replaceSelection(".concat(Gt,' "').concat(Ot,'" )')):I.replaceSelection("")),I.focus();case Je:for(var rr=mt.row,Ar=mt.col,kt=mt.align,li=`
|
|
`,Ft=0;Ft<rr;Ft++){for(var Tr=[],yr=[],zr=0;zr<Ar;zr++)Ft===1&&yr.push(tt[kt]),Tr.push(" ");Ft===1&&(li+="| ".concat(yr.join(" | "),` |
|
|
`)),li+="| ".concat(Tr.join(Ar===1?"":" | "),` |
|
|
`)}return I.replaceSelection(li+`
|
|
`),I.focus();default:throw new Error}},[I,nr]),cn=Object(y.useMemo)(function(){switch(nr){case Fe:return T.a.createElement(le,{callback:xi,onCancel:Ci});case ot:return T.a.createElement(ve.b,{callback:xi,onCancel:Ci});case Pe:return T.a.createElement(pe,{callback:xi,onCancel:Ci});case Je:return T.a.createElement(He,{callback:xi,onCancel:Ci});default:return null}},[nr]);function Ci(){Fr("")}Object(y.useEffect)(function(){if(jt.current){var mt=jt.current,At=!1,bt=0;function Dt(Ot){At=!0,bt=Ot.pageY}function Pt(){At=!1}function Gt(Ot){if(At){var rr=Ot.pageY-bt;rr<0&&(rr=0),rr>300&&(rr=300);var Ar=St+rr+"px";Yr(Ar)}}return mt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Gt),document.addEventListener("mouseup",Pt),function(){mt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Gt),document.removeEventListener("mouseup",Pt)}}},[I,jt]),Object(y.useEffect)(function(){Yr(St)},[St]);var ri=ge(pt),fn=ge(Ki),Xr={width:ri,height:fn},pn=Object(y.useMemo)(function(){if(Mr){var mt=new Date(Mr),At=mt.getHours(),bt=mt.getMinutes(),Dt=mt.getSeconds();return At=At<10?"0"+At:At,bt=bt<10?"0"+bt:bt,Dt=Dt<10?"0"+Dt:Dt,"".concat(At,":").concat(bt,":").concat(Dt)}return 0},[Mr]);function Wn(){window.sessionStorage.removeItem(Br),Ei(!1),Mi(0)}function Oi(){Ei(!1),Mi(0),I.setValue(window.sessionStorage.getItem(Br))}function ua(mt,At){var bt=I.getValue();bt=bt.replace(mt,At),Qe(bt),I==null||I.setValue(bt)}return T.a.createElement(y.Fragment,null,T.a.createElement("div",{className:"markdown-editor-wrapper",ref:$t},T.a.createElement("div",{className:"markdown-editor-container ".concat(je," ").concat(yt?"on-preview":""," ").concat(Ut?"mini":""," ").concat(gr?"full-screen":""),style:Xr},T.a.createElement(x,{insertTemp:It,watch:yt,fullScreen:gr,showNullButton:_t,onActionCallback:Vi,hidetoolBar:Hr,uuid:Zt.current,setOpenPhones:function(){Nt.current=!0}}),T.a.createElement("div",{className:"markdown-editor-body"},T.a.createElement("div",{className:"codemirror-container"},T.a.createElement("textarea",{ref:Rt,placeholder:gi})),yt?T.a.createElement("div",{ref:ti,className:"preview-container"},Kr==="stex"&&T.a.createElement(L,{value:Oe}),Kr!=="stex"&&T.a.createElement(g.a,{edit:!0,value:Oe,replaces:ua})):null))),pr?T.a.createElement("a",{ref:jt,className:"editor-resize"}):null,T.a.createElement(P.a,null,ne[nr]?T.a.createElement(X.a,{centered:!0,title:ne[nr],visible:!0,onCancel:Ci,footer:null,className:"markdown-popup-form"},cn):null))}},RMFE:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYaxFgAABgfYNECBAICog0NHDWIsAAQIC7RsgQIBAVECgo4exFgECBATaN0CAAIGogEBHD2MtAgQICLRvgAABAlEBgY4exloECBAQaN8AAQIEogICHT2MtQgQICDQvgECBAhEBQQ6ehhrESBAQKB9AwQIEIgKCHT0MNYiQICAQPsGCBAgEBUQ6OhhrEWAAAGB9g0QIEAgKiDQ0cNYiwABAgLtGyBAgEBUQKCjh7EWAQIEBNo3QIAAgaiAQEcPYy0CBAh8/5Tg6+vrp3/q7wgQIEDgPwKfz+c/v92v/Ac9CxMBAgRSAgKdOodlCBAgMAGBnoWJAAECKQGBTp3DMgQIEJiAQM/CRIAAgZSAQKfOYRkCBAhMQKBnYSJAgEBKQKBT57AMAQIEJiDQszARIEAgJSDQqXNYhgABAhMQ6FmYCBAgkBIQ6NQ5LEOAAIEJCPQsTAQIEEgJCHTqHJYhQIDABAR6FiYCBAikBAQ6dQ7LECBAYAICPQs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/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},S3tb:function(Me,Le,Z){Me.exports={flex_box_center:"flex_box_center___2JPaF",flex_space_between:"flex_space_between___2Xc04",flex_box_vertical_center:"flex_box_vertical_center___2dKRj",flex_box_center_end:"flex_box_center_end___1mhGC",flex_box_column:"flex_box_column___3_40N",bg:"bg___2hbcT",flexRow:"flexRow___1-nzu",flexJustifyCenter:"flexJustifyCenter___3gMIE",flexAlignEnd:"flexAlignEnd___ofjNV",flexAlignCenter:"flexAlignCenter___ozmjE",flexColumn:"flexColumn___2ijgP",formWrap:"formWrap___1fz8-",titleWrap:"titleWrap___Sj-tB",fieldWrap:"fieldWrap___49q9k",mdWrap:"mdWrap___3TEhM",backgroundFa:"backgroundFa___1anEp",button:"button___3i0ZA",icons:"icons___1IO0Z",navBar:"navBar___11xzI",active:"active___tYbqS"}},SJMd:function(Me,Le){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var Z,ie,X,R=!1,Q,B;window.PR_SHOULD_USE_CONTINUATION=!0;var _,G;(function(){var j=window,O=["break,continue,do,else,for,if,return,while"],M=[O,"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=[M,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],T=[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"],k=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],D=[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"],w="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",C=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="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",o=[O,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],l=[O,"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=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[T,D,k,C,h,o,l,d],f=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,g="str",L="kwd",E="com",m="typ",c="lit",u="pun",a="pln",b="tag",v="dec",x="src",P="atn",H="atv",V="nocode",$="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(Re){for(var Be=0,He=!1,Xe=!1,Ke=0,Fe=Re.length;Ke<Fe;++Ke){var Pe=Re[Ke];if(Pe.ignoreCase)Xe=!0;else if(/[a-z]/i.test(Pe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){He=!0,Xe=!1;break}}var ot={b:8,t:9,n:10,v:11,f:12,r:13};function Je(Ve){var Ee=Ve.charCodeAt(0);if(Ee!==92)return Ee;var it=Ve.charAt(1);return Ee=ot[it],Ee||("0"<=it&&it<="7"?parseInt(Ve.substring(1),8):it==="u"||it==="x"?parseInt(Ve.substring(2),16):Ve.charCodeAt(1))}function Ze(Ve){if(Ve<32)return(Ve<16?"\\x0":"\\x")+Ve.toString(16);var Ee=String.fromCharCode(Ve);return Ee==="\\"||Ee==="-"||Ee==="]"||Ee==="^"?"\\"+Ee:Ee}function tt(Ve){var Ee=Ve.substring(1,Ve.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),it=[],qe=Ee[0]==="^",we=["["];qe&&we.push("^");for(var We=qe?1:0,ge=Ee.length;We<ge;++We){var de=Ee[We];if(/\\[bdsw]/i.test(de))we.push(de);else{var fe=Je(de),te;We+2<ge&&Ee[We+1]==="-"?(te=Je(Ee[We+2]),We+=2):te=fe,it.push([fe,te]),te<65||fe>122||(te<65||fe>90||it.push([Math.max(65,fe)|32,Math.min(te,90)|32]),te<97||fe>122||it.push([Math.max(97,fe)&~32,Math.min(te,122)&~32]))}}it.sort(function(me,Ae){return me[0]-Ae[0]||Ae[1]-me[1]});for(var re=[],ne=[],We=0;We<it.length;++We){var he=it[We];he[0]<=ne[1]+1?ne[1]=Math.max(ne[1],he[1]):re.push(ne=he)}for(var We=0;We<re.length;++We){var he=re[We];we.push(Ze(he[0])),he[1]>he[0]&&(he[1]+1>he[0]&&we.push("-"),we.push(Ze(he[1])))}return we.push("]"),we.join("")}function ht(Ve){for(var Ee=Ve.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),it=Ee.length,qe=[],we=0,We=0;we<it;++we){var ge=Ee[we];if(ge==="(")++We;else if(ge.charAt(0)==="\\"){var de=+ge.substring(1);de&&(de<=We?qe[de]=-1:Ee[we]=Ze(de))}}for(var we=1;we<qe.length;++we)qe[we]===-1&&(qe[we]=++Be);for(var we=0,We=0;we<it;++we){var ge=Ee[we];if(ge==="(")++We,qe[We]||(Ee[we]="(?:");else if(ge.charAt(0)==="\\"){var de=+ge.substring(1);de&&de<=We&&(Ee[we]="\\"+qe[de])}}for(var we=0;we<it;++we)Ee[we]==="^"&&Ee[we+1]!=="^"&&(Ee[we]="");if(Ve.ignoreCase&&He)for(var we=0;we<it;++we){var ge=Ee[we],fe=ge.charAt(0);ge.length>=2&&fe==="["?Ee[we]=tt(ge):fe!=="\\"&&(Ee[we]=ge.replace(/[a-zA-Z]/g,function(ne){var he=ne.charCodeAt(0);return"["+String.fromCharCode(he&~32,he|32)+"]"}))}return Ee.join("")}for(var rt=[],Ke=0,Fe=Re.length;Ke<Fe;++Ke){var Pe=Re[Ke];if(Pe.global||Pe.multiline)throw new Error(""+Pe);rt.push("(?:"+ht(Pe)+")")}return new RegExp(rt.join("|"),Xe?"gi":"g")}function F(Re,Be){var He=/(?:^|\s)nocode(?:\s|$)/,Xe=[],Ke=0,Fe=[],Pe=0;function ot(Je){var Ze=Je.nodeType;if(Ze==1){if(He.test(Je.className))return;for(var tt=Je.firstChild;tt;tt=tt.nextSibling)ot(tt);var ht=Je.nodeName.toLowerCase();(ht==="br"||ht==="li")&&(Xe[Pe]=`
|
|
`,Fe[Pe<<1]=Ke++,Fe[Pe++<<1|1]=Je)}else if(Ze==3||Ze==4){var rt=Je.nodeValue;rt.length&&(Be?rt=rt.replace(/\r\n?/g,`
|
|
`):rt=rt.replace(/[ \t\r\n]+/g," "),Xe[Pe]=rt,Fe[Pe<<1]=Ke,Ke+=rt.length,Fe[Pe++<<1|1]=Je)}}return ot(Re),{sourceCode:Xe.join("").replace(/\n$/,""),spans:Fe}}function ee(Re,Be,He,Xe,Ke){if(!He)return;var Fe={sourceNode:Re,pre:1,langExtension:null,numberLines:null,sourceCode:He,spans:null,basePos:Be,decorations:null};Xe(Fe),Ke.push.apply(Ke,Fe.decorations)}var oe=/\S/;function le(Re){for(var Be=void 0,He=Re.firstChild;He;He=He.nextSibling){var Xe=He.nodeType;Be=Xe===1?Be?Re:He:Xe===3&&oe.test(He.nodeValue)?Re:Be}return Be===Re?void 0:Be}function ve(Re,Be){var He={},Xe;(function(){for(var Pe=Re.concat(Be),ot=[],Je={},Ze=0,tt=Pe.length;Ze<tt;++Ze){var ht=Pe[Ze],rt=ht[3];if(rt)for(var Ve=rt.length;--Ve>=0;)He[rt.charAt(Ve)]=ht;var Ee=ht[1],it=""+Ee;Je.hasOwnProperty(it)||(ot.push(Ee),Je[it]=null)}ot.push(/[\0-\uffff]/),Xe=z(ot)})();var Ke=Be.length,Fe=function(Pe){for(var ot=Pe.sourceCode,Je=Pe.basePos,Ze=Pe.sourceNode,tt=[Je,a],ht=0,rt=ot.match(Xe)||[],Ve={},Ee=0,it=rt.length;Ee<it;++Ee){var qe=rt[Ee],we=Ve[qe],We=void 0,ge;if(typeof we=="string")ge=!1;else{var de=He[qe.charAt(0)];if(de)We=qe.match(de[1]),we=de[0];else{for(var fe=0;fe<Ke;++fe)if(de=Be[fe],We=qe.match(de[1]),We){we=de[0];break}We||(we=a)}ge=we.length>=5&&we.substring(0,5)==="lang-",ge&&!(We&&typeof We[1]=="string")&&(ge=!1,we=x),ge||(Ve[qe]=we)}var te=ht;if(ht+=qe.length,!ge)tt.push(Je+te,we);else{var re=We[1],ne=qe.indexOf(re),he=ne+re.length;We[2]&&(he=qe.length-We[2].length,ne=he-re.length);var me=we.substring(5);ee(Ze,Je+te,qe.substring(0,ne),Fe,tt),ee(Ze,Je+te+ne,re,se(me,re),tt),ee(Ze,Je+te+he,qe.substring(he),Fe,tt)}}Pe.decorations=tt};return Fe}function Ie(Re){var Be=[],He=[];Re.tripleQuotedStrings?Be.push([g,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Re.multiLineStrings?Be.push([g,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Be.push([g,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Re.verbatimStrings&&He.push([g,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Xe=Re.hashComments;Xe&&(Re.cStyleComments?(Xe>1?Be.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Be.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),He.push([g,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Be.push([E,/^#[^\r\n]*/,null,"#"])),Re.cStyleComments&&(He.push([E,/^\/\/[^\r\n]*/,null]),He.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ke=Re.regexLiterals;if(Ke){var Fe=Ke>1?"":`
|
|
\r`,Pe=Fe?".":"[\\S\\s]",ot="/(?=[^/*"+Fe+"])(?:[^/\\x5B\\x5C"+Fe+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+Fe+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";He.push(["lang-regex",RegExp("^"+$+"("+ot+")")])}var Je=Re.types;Je&&He.push([m,Je]);var Ze=(""+Re.keywords).replace(/^ | $/g,"");Ze.length&&He.push([L,new RegExp("^(?:"+Ze.replace(/[\s,]+/g,"|")+")\\b"),null]),Be.push([a,/^\s+/,null,` \r
|
|
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return Re.regexLiterals&&(tt+="(?!s*/)"),He.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[u,new RegExp(tt),null]),ve(Be,He)}var xe=Ie({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ce(Re,Be,He){for(var Xe=/(?:^|\s)nocode(?:\s|$)/,Ke=/\r\n?|\n/,Fe=Re.ownerDocument,Pe=Fe.createElement("li");Re.firstChild;)Pe.appendChild(Re.firstChild);var ot=[Pe];function Je(Ee){var it=Ee.nodeType;if(it==1&&!Xe.test(Ee.className))if(Ee.nodeName==="br")Ze(Ee),Ee.parentNode&&Ee.parentNode.removeChild(Ee);else for(var qe=Ee.firstChild;qe;qe=qe.nextSibling)Je(qe);else if((it==3||it==4)&&He){var we=Ee.nodeValue,We=we.match(Ke);if(We){var ge=we.substring(0,We.index);Ee.nodeValue=ge;var de=we.substring(We.index+We[0].length);if(de){var fe=Ee.parentNode;fe.insertBefore(Fe.createTextNode(de),Ee.nextSibling)}Ze(Ee),ge||Ee.parentNode.removeChild(Ee)}}}function Ze(Ee){for(;!Ee.nextSibling;)if(Ee=Ee.parentNode,!Ee)return;function it(We,ge){var de=ge?We.cloneNode(!1):We,fe=We.parentNode;if(fe){var te=it(fe,1),re=We.nextSibling;te.appendChild(de);for(var ne=re;ne;ne=re)re=ne.nextSibling,te.appendChild(ne)}return de}for(var qe=it(Ee.nextSibling,0),we;(we=qe.parentNode)&&we.nodeType===1;)qe=we;ot.push(qe)}for(var tt=0;tt<ot.length;++tt)Je(ot[tt]);Be===(Be|0)&&ot[0].setAttribute("value",Be);var ht=Fe.createElement("ol");ht.className="linenums";for(var rt=Math.max(0,Be-1|0)||0,tt=0,Ve=ot.length;tt<Ve;++tt)Pe=ot[tt],Pe.className="L"+(tt+rt)%10,Pe.firstChild||Pe.appendChild(Fe.createTextNode("\xA0")),ht.appendChild(Pe);Re.appendChild(ht)}function Te(Re){var Be=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Be=Be&&+Be[1]<=8;var He=/\n/g,Xe=Re.sourceCode,Ke=Xe.length,Fe=0,Pe=Re.spans,ot=Pe.length,Je=0,Ze=Re.decorations,tt=Ze.length,ht=0;Ze[tt]=Ke;var rt,Ve;for(Ve=rt=0;Ve<tt;)Ze[Ve]!==Ze[Ve+2]?(Ze[rt++]=Ze[Ve++],Ze[rt++]=Ze[Ve++]):Ve+=2;for(tt=rt,Ve=rt=0;Ve<tt;){for(var Ee=Ze[Ve],it=Ze[Ve+1],qe=Ve+2;qe+2<=tt&&Ze[qe+1]===it;)qe+=2;Ze[rt++]=Ee,Ze[rt++]=it,Ve=qe}tt=Ze.length=rt;var we=Re.sourceNode,We="";we&&(We=we.style.display,we.style.display="none");try{for(var ge=null;Je<ot;){var de=Pe[Je],fe=Pe[Je+2]||Ke,te=Ze[ht+2]||Ke,qe=Math.min(fe,te),re=Pe[Je+1],ne;if(re.nodeType!==1&&(ne=Xe.substring(Fe,qe))){Be&&(ne=ne.replace(He,"\r")),re.nodeValue=ne;var he=re.ownerDocument,me=he.createElement("span");me.className=Ze[ht+1];var Ae=re.parentNode;Ae.replaceChild(me,re),me.appendChild(re),Fe<fe&&(Pe[Je+1]=re=he.createTextNode(Xe.substring(qe,fe)),Ae.insertBefore(re,me.nextSibling))}Fe=qe,Fe>=fe&&(Je+=2),Fe>=te&&(ht+=2)}}finally{we&&(we.style.display=We)}}var Se={};function pe(Re,Be){for(var He=Be.length;--He>=0;){var Xe=Be[He];Se.hasOwnProperty(Xe)?j.console&&console.warn("cannot override language handler %s",Xe):Se[Xe]=Re}}function se(Re,Be){return Re&&Se.hasOwnProperty(Re)||(Re=/^\s*</.test(Be)?"default-markup":"default-code"),Se[Re]}pe(xe,["default-code"]),pe(ve([],[[a,/^[^<?]+/],[v,/^<!\w[^>]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["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"]),pe(ve([[a,/^[\s]+/,null,` \r
|
|
`],[H,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[b,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[u,/^[=<>\/]+/],["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"]),pe(ve([],[[H,/^[\s\S]+/]]),["uq.val"]),pe(Ie({keywords:T,hashComments:!0,cStyleComments:!0,types:f}),["c","cc","cpp","cxx","cyc","m"]),pe(Ie({keywords:"null,true,false"}),["json"]),pe(Ie({keywords:D,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:f}),["cs"]),pe(Ie({keywords:k,cStyleComments:!0}),["java"]),pe(Ie({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(Ie({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(Ie({keywords:h,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(Ie({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(Ie({keywords:C,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(Ie({keywords:w,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(ve([],[[g,/^[\s\S]+/]]),["regex"]);function De(Re){var Be=Re.langExtension;try{var He=F(Re.sourceNode,Re.pre),Xe=He.sourceCode;Re.sourceCode=Xe,Re.spans=He.spans,Re.basePos=0,se(Be,Xe)(Re),Te(Re)}catch(Ke){j.console&&console.log(Ke&&Ke.stack||Ke)}}function Ye(Re,Be,He){var Xe=He||!1,Ke=Be||null,Fe=document.createElement("div");Fe.innerHTML="<pre>"+Re+"</pre>",Fe=Fe.firstChild,Xe&&Ce(Fe,Xe,!0);var Pe={langExtension:Ke,numberLines:Xe,sourceNode:Fe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return De(Pe),Fe.innerHTML}function Ge(Re,Be){var He=Be||document.body,Xe=He.ownerDocument||document;function Ke(de){return He.getElementsByTagName(de)}for(var Fe=[Ke("pre"),Ke("code"),Ke("xmp")],Pe=[],ot=0;ot<Fe.length;++ot)for(var Je=0,Ze=Fe[ot].length;Je<Ze;++Je)Pe.push(Fe[ot][Je]);Fe=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var ht=0,rt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ve=/\bprettyprint\b/,Ee=/\bprettyprinted\b/,it=/pre|xmp/i,qe=/^code$/i,we=/^(?:pre|code|xmp)$/i,We={};function ge(){for(var de=j.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;ht<Pe.length&&tt.now()<de;ht++){for(var fe=Pe[ht],te=We,re=fe;re=re.previousSibling;){var ne=re.nodeType,he=(ne===7||ne===8)&&re.nodeValue;if(he?!/^\??prettify\b/.test(he):ne!==3||/\S/.test(re.nodeValue))break;if(he){te={},he.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Qt,It,_r){te[It]=_r});break}}var me=fe.className;if((te!==We||Ve.test(me))&&!Ee.test(me)){for(var Ae=!1,_e=fe.parentNode;_e;_e=_e.parentNode){var st=_e.tagName;if(we.test(st)&&_e.className&&Ve.test(_e.className)){Ae=!0;break}}if(!Ae){fe.className+=" prettyprinted";var gt=te.lang;if(!gt){gt=me.match(rt);var pt;!gt&&(pt=le(fe))&&qe.test(pt.tagName)&&(gt=pt.className.match(rt)),gt&&(gt=gt[1])}var Tt;if(it.test(fe.tagName))Tt=1;else{var St=fe.currentStyle,dt=Xe.defaultView,Ut=St?St.whiteSpace:dt&&dt.getComputedStyle?dt.getComputedStyle(fe,null).getPropertyValue("white-space"):0;Tt=Ut&&Ut.substring(0,3)==="pre"}var Mt=te.linenums;(Mt=Mt==="true"||+Mt)||(Mt=me.match(/\blinenums\b(?::(\d+))?/),Mt=Mt?Mt[1]&&Mt[1].length?+Mt[1]:!0:!1),Mt&&Ce(fe,Mt,Tt);var Jt={langExtension:gt,sourceNode:fe,numberLines:Mt,pre:Tt,sourceCode:null,basePos:null,spans:null,decorations:null};De(Jt)}}}ht<Pe.length?j.setTimeout(ge,250):typeof Re=="function"&&Re()}ge()}var $e=j.PR={createSimpleLexer:ve,registerLangHandler:pe,sourceDecorator:Ie,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:H,PR_COMMENT:E,PR_DECLARATION:v,PR_KEYWORD:L,PR_LITERAL:c,PR_NOCODE:V,PR_PLAIN:a,PR_PUNCTUATION:u,PR_SOURCE:x,PR_STRING:g,PR_TAG:b,PR_TYPE:m,prettyPrintOne:R?j.prettyPrintOne=Ye:_=Ye,prettyPrint:G=R?j.prettyPrint=Ge:G=Ge},et=j.define;typeof et=="function"&&et.amd&&et("google-code-prettify",[],function(){return $e})})()},SMhR:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3//KNo2/8NU8XzCQyCpSReivSJKk/zmRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7yMiB/s7a5AWTTNhsgN9pmA2TTNp8MyI22uQHkv7TNDSCbttkAudE2bwJyo22eBGTTNhsgf7O2ecuJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpPGTD9c2nwzIk9pmA2TTNjeAPAnIpm1uANm0zQbIDSBPAXIDyKZtPhmQG22zAfLN2uaTAflUJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZLGT74ckCe1zZOAbNpm0zYbIDfaZgPkRts8qW1utM0GyKZtntI2GyBPArJpmw2QTds8CcimbW4A+WRAntQ23+pEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0viJXtU2T2qbDZA3Adm0zZOAbNpm0zYbIJu2+VZtswGyaZsbbbMBsmmbDZBN29xoG32mE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjJ3oVkCe1zZPaZgNk0zYbIJu2eRKQJwF5S9vcAPIkIJu2uQFk0zY32kbf6USSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnS+MmXa5t/WdtsgGza5psB+WRt8xQgN4DcaJtv1jYbIDfa5pO1jf5/J5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZLGTz4ckH9Z22yAbNpmA2TTNhsgm7bZANm0zQbIpm02QDZtswFyA8h/aZsb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N/":function(Me,Le,Z){(function(ie,X){Me.exports=X()})(this,function(){"use strict";var ie=navigator.userAgent,X=navigator.platform,R=/gecko\/\d/i.test(ie),Q=/MSIE \d/.test(ie),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),_=/Edge\/(\d+)/.exec(ie),G=Q||B||_,j=G&&(Q?document.documentMode||6:+(_||B)[1]),O=!_&&/WebKit\//.test(ie),M=O&&/Qt\/\d+\.\d+/.test(ie),y=!_&&/Chrome\//.test(ie),T=/Opera\//.test(ie),k=/Apple Computer/.test(navigator.vendor),D=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),w=/PhantomJS/.test(ie),C=!_&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),h=/Android/.test(ie),o=C||h||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),l=C||/Mac/.test(X),d=/\bCrOS\b/.test(ie),A=/win/i.test(X),f=T&&ie.match(/Version\/(\d*\.\d*)/);f&&(f=Number(f[1])),f&&f>=15&&(T=!1,O=!0);var g=l&&(M||T&&(f==null||f<12.11)),L=R||G&&j>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var m=function(e,t){var i=e.className,r=E(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function c(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function u(e,t){return c(e).appendChild(t)}function a(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var S=0;S<t.length;++S)n.appendChild(t[S]);return n}function b(e,t,i,r){var n=a(e,t,i,r);return n.setAttribute("role","presentation"),n}var v;document.createRange?v=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:v=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(n){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function x(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 P(){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 H(e,t){var i=e.className;E(t).test(i)||(e.className+=(i?" ":"")+t)}function V(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!E(i[r]).test(t)&&(t+=" "+i[r]);return t}var $=function(e){e.select()};C?$=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&($=function(e){try{e.select()}catch(t){}});function z(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function F(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function ee(e,t,i,r,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var S=r||0,N=n||0;;){var K=e.indexOf(" ",S);if(K<0||K>=t)return N+(t-S);N+=K-S,N+=i-N%i,S=K+1}}var oe=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};oe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},oe.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 le(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var ve=50,Ie={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Ce={origin:"*mouse"},Te={origin:"+move"};function Se(e,t,i){for(var r=0,n=0;;){var S=e.indexOf(" ",r);S==-1&&(S=e.length);var N=S-r;if(S==e.length||n+N>=t)return r+Math.min(N,t-n);if(n+=S-r,n+=i-n%i,r=S+1,n>=t)return r}}var pe=[""];function se(e){for(;pe.length<=e;)pe.push(De(pe)+" ");return pe[e]}function De(e){return e[e.length-1]}function Ye(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function Ge(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function $e(){}function et(e,t){var i;return Object.create?i=Object.create(e):($e.prototype=e,i=new $e),t&&F(t,i),i}var Re=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Be(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Re.test(e))}function He(e,t){return t?t.source.indexOf("\\w")>-1&&Be(e)?!0:t.test(e):Be(e)}function Xe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ke=/[\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 Fe(e){return e.charCodeAt(0)>=768&&Ke.test(e)}function Pe(e,t,i){for(;(i<0?t>0:t<e.length)&&Fe(e.charAt(t));)t+=i;return t}function ot(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,S=r<0?Math.ceil(n):Math.floor(n);if(S==t)return e(S)?t:i;e(S)?i=S:t=S+r}}function Je(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,S=0;S<e.length;++S){var N=e[S];(N.from<i&&N.to>t||t==i&&N.to==t)&&(r(Math.max(N.from,t),Math.min(N.to,i),N.level==1?"rtl":"ltr",S),n=!0)}n||r(t,i,"ltr")}var Ze=null;function tt(e,t,i){var r;Ze=null;for(var n=0;n<e.length;++n){var S=e[n];if(S.from<t&&S.to>t)return n;S.to==t&&(S.from!=S.to&&i=="before"?r=n:Ze=n),S.from==t&&(S.from!=S.to&&i!="before"?r=n:Ze=n)}return r!=null?r:Ze}var ht=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(q){return q<=247?e.charAt(q):1424<=q&&q<=1524?"R":1536<=q&&q<=1785?t.charAt(q-1536):1774<=q&&q<=2220?"r":8192<=q&&q<=8203?"w":q==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,S=/[LRr]/,N=/[Lb1n]/,K=/[1n]/;function Y(q,ae,ue){this.level=q,this.from=ae,this.to=ue}return function(q,ae){var ue=ae=="ltr"?"L":"R";if(q.length==0||ae=="ltr"&&!r.test(q))return!1;for(var be=q.length,ye=[],ke=0;ke<be;++ke)ye.push(i(q.charCodeAt(ke)));for(var Ue=0,ze=ue;Ue<be;++Ue){var nt=ye[Ue];nt=="m"?ye[Ue]=ze:ze=nt}for(var lt=0,at=ue;lt<be;++lt){var ut=ye[lt];ut=="1"&&at=="r"?ye[lt]="n":S.test(ut)&&(at=ut,ut=="r"&&(ye[lt]="R"))}for(var xt=1,vt=ye[0];xt<be-1;++xt){var wt=ye[xt];wt=="+"&&vt=="1"&&ye[xt+1]=="1"?ye[xt]="1":wt==","&&vt==ye[xt+1]&&(vt=="1"||vt=="n")&&(ye[xt]=vt),vt=wt}for(var zt=0;zt<be;++zt){var lr=ye[zt];if(lr==",")ye[zt]="N";else if(lr=="%"){var Yt=void 0;for(Yt=zt+1;Yt<be&&ye[Yt]=="%";++Yt);for(var Pr=zt&&ye[zt-1]=="!"||Yt<be&&ye[Yt]=="1"?"1":"N",Lr=zt;Lr<Yt;++Lr)ye[Lr]=Pr;zt=Yt-1}}for(var er=0,Rr=ue;er<be;++er){var fr=ye[er];Rr=="L"&&fr=="1"?ye[er]="L":S.test(fr)&&(Rr=fr)}for(var ir=0;ir<be;++ir)if(n.test(ye[ir])){var tr=void 0;for(tr=ir+1;tr<be&&n.test(ye[tr]);++tr);for(var Xt=(ir?ye[ir-1]:ue)=="L",kr=(tr<be?ye[tr]:ue)=="L",un=Xt==kr?Xt?"L":"R":ue,ki=ir;ki<tr;++ki)ye[ki]=un;ir=tr-1}for(var Er=[],ai,ur=0;ur<be;)if(N.test(ye[ur])){var Va=ur;for(++ur;ur<be&&N.test(ye[ur]);++ur);Er.push(new Y(0,Va,ur))}else{var di=ur,Hi=Er.length,Gi=ae=="rtl"?1:0;for(++ur;ur<be&&ye[ur]!="L";++ur);for(var Sr=di;Sr<ur;)if(K.test(ye[Sr])){di<Sr&&(Er.splice(Hi,0,new Y(1,di,Sr)),Hi+=Gi);var hn=Sr;for(++Sr;Sr<ur&&K.test(ye[Sr]);++Sr);Er.splice(Hi,0,new Y(2,hn,Sr)),Hi+=Gi,di=Sr}else++Sr;di<ur&&Er.splice(Hi,0,new Y(1,di,ur))}return ae=="ltr"&&(Er[0].level==1&&(ai=q.match(/^\s+/))&&(Er[0].from=ai[0].length,Er.unshift(new Y(0,0,ai[0].length))),De(Er).level==1&&(ai=q.match(/\s+$/))&&(De(Er).to-=ai[0].length,Er.push(new Y(0,be-ai[0].length,be)))),ae=="rtl"?Er.reverse():Er}}();function rt(e,t){var i=e.order;return i==null&&(i=e.order=ht(e.text,t)),i}var Ve=[],Ee=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ve).concat(i)}};function it(e,t){return e._handlers&&e._handlers[t]||Ve}function qe(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,n=r&&r[t];if(n){var S=le(n,i);S>-1&&(r[t]=n.slice(0,S).concat(n.slice(S+1)))}}}function we(e,t){var i=it(e,t);if(!i.length)return;for(var r=Array.prototype.slice.call(arguments,2),n=0;n<i.length;++n)i[n].apply(null,r)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),we(e,i||t.type,e,t),ne(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)le(i,t[r])==-1&&i.push(t[r])}function de(e,t){return it(e,t).length>0}function fe(e){e.prototype.on=function(t,i){Ee(this,t,i)},e.prototype.off=function(t,i){qe(this,t,i)}}function te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function re(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ne(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function he(e){te(e),re(e)}function me(e){return e.target||e.srcElement}function Ae(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),l&&e.ctrlKey&&t==1&&(t=3),t}var _e=function(){if(G&&j<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),st;function gt(e){if(st==null){var t=a("span","\u200B");u(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(st=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&j<8))}var i=st?a("span","\u200B"):a("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var pt;function Tt(e){if(pt!=null)return pt;var t=u(e,document.createTextNode("A\u062EA")),i=v(t,0,1).getBoundingClientRect(),r=v(t,1,2).getBoundingClientRect();return c(e),!i||i.left==i.right?!1:pt=r.right-i.right<3}var St=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(`
|
|
`,t);n==-1&&(n=e.length);var S=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),N=S.indexOf("\r");N!=-1?(i.push(S.slice(0,N)),t+=N+1):(i.push(S),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},dt=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},Ut=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Mt=null;function Jt(e){if(Mt!=null)return Mt;var t=u(e,a("span","x")),i=t.getBoundingClientRect(),r=v(t,0,1).getBoundingClientRect();return Mt=Math.abs(i.left-r.left)>1}var Qt={},It={};function _r(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qt[e]=t}function Kr(e,t){It[e]=t}function Et(e){if(typeof e=="string"&&It.hasOwnProperty(e))e=It[e];else if(e&&typeof e.name=="string"&&It.hasOwnProperty(e.name)){var t=It[e.name];typeof t=="string"&&(t={name:t}),e=et(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Et("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Et("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Br(e,t){t=Et(t);var i=Qt[t.name];if(!i)return Br(e,"text/plain");var r=i(e,t);if(hr.hasOwnProperty(t.name)){var n=hr[t.name];for(var S in n){if(!n.hasOwnProperty(S))continue;r.hasOwnProperty(S)&&(r["_"+S]=r[S]),r[S]=n[S]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var N in t.modeProps)r[N]=t.modeProps[N];return r}var hr={};function pr(e,t){var i=hr.hasOwnProperty(e)?hr[e]:hr[e]={};F(t,i)}function Nr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function ci(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 $r(e,t,i){return e.startState?e.startState(t,i):!0}var _t=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};_t.prototype.eol=function(){return this.pos>=this.string.length},_t.prototype.sol=function(){return this.pos==this.lineStart},_t.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},_t.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},_t.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},_t.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},_t.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},_t.prototype.skipToEnd=function(){this.pos=this.string.length},_t.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},_t.prototype.backUp=function(e){this.pos-=e},_t.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ee(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ee(this.string,this.lineStart,this.tabSize):0)},_t.prototype.indentation=function(){return ee(this.string,null,this.tabSize)-(this.lineStart?ee(this.string,this.lineStart,this.tabSize):0)},_t.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(N){return i?N.toLowerCase():N},n=this.string.substr(this.pos,e.length);if(r(n)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var S=this.string.slice(this.pos).match(e);return S&&S.index>0?null:(S&&t!==!1&&(this.pos+=S[0].length),S)}},_t.prototype.current=function(){return this.string.slice(this.start,this.pos)},_t.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},_t.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},_t.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],S=n.chunkSize();if(t<S){i=n;break}t-=S}return i.lines[t]}function Hr(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(S){var N=S.text;n==i.line&&(N=N.slice(0,i.ch)),n==t.line&&(N=N.slice(t.ch)),r.push(N),++n}),r}function ei(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function mr(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function Lt(e){if(e.parent==null)return null;for(var t=e.parent,i=le(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var n=0;!(r.children[n]==t);++n)i+=r.children[n].chunkSize();return i+t.first}function Ur(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var n=e.children[r],S=n.height;if(t<S){e=n;continue e}t-=S,i+=n.chunkSize()}return i}while(!e.lines);for(var N=0;N<e.lines.length;++N){var K=e.lines[N],Y=K.height;if(t<Y)break;t-=Y}return i+N}function Vr(e,t){return t>=e.first&&t<e.first+e.size}function fi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function je(e,t,i){if(i===void 0&&(i=null),!(this instanceof je))return new je(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function pi(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function mi(e){return je(e.line,e.ch)}function gi(e,t){return Ct(e,t)<0?t:e}function vi(e,t){return Ct(e,t)<0?e:t}function W(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function s(e,t){if(t.line<e.first)return je(e.first,0);var i=e.first+e.size-1;return t.line>i?je(i,ct(e,i).text.length):p(t,ct(e,t.line).text.length)}function p(e,t){var i=e.ch;return i==null||i>t?je(e.line,t):i<0?je(e.line,0):e}function I(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=s(e,t[r]);return i}var J=function(e,t){this.state=e,this.lookAhead=t},U=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};U.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},U.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}},U.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},U.fromSaved=function(e,t,i){return t instanceof J?new U(e,Nr(e.mode,t.state),i,t.lookAhead):new U(e,Nr(e.mode,t),i)},U.prototype.save=function(e){var t=e!==!1?Nr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new J(t,this.maxLookAhead):t};function ce(e,t,i,r){var n=[e.state.modeGen],S={};gr(e,t.text,e.doc.mode,i,function(q,ae){return n.push(q,ae)},S,r);for(var N=i.state,K=function(q){i.baseTokens=n;var ae=e.state.overlays[q],ue=1,be=0;i.state=!0,gr(e,t.text,ae.mode,i,function(ye,ke){for(var Ue=ue;be<ye;){var ze=n[ue];ze>ye&&n.splice(ue,1,ye,n[ue+1],ze),ue+=2,be=Math.min(ye,ze)}if(!ke)return;if(ae.opaque)n.splice(Ue,ue-Ue,ye,"overlay "+ke),ue=Ue+2;else for(;Ue<ue;Ue+=2){var nt=n[Ue+1];n[Ue+1]=(nt?nt+" ":"")+"overlay "+ke}},S),i.state=N,i.baseTokens=null,i.baseTokenPos=1},Y=0;Y<e.state.overlays.length;++Y)K(Y);return{styles:n,classes:S.bgClass||S.textClass?S:null}}function Oe(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Qe(e,Lt(t)),n=t.text.length>e.options.maxHighlightLength&&Nr(e.doc.mode,r.state),S=ce(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=S.styles,S.classes?t.styleClasses=S.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 Qe(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new U(r,!0,t);var S=vr(e,t,i),N=S>r.first&&ct(r,S-1).stateAfter,K=N?U.fromSaved(r,N,S):new U(r,$r(r.mode),S);return r.iter(S,t,function(Y){ft(e,Y.text,K);var q=K.line;Y.stateAfter=q==t-1||q%5==0||q>=n.viewFrom&&q<n.viewTo?K.save():null,K.nextLine()}),i&&(r.modeFrontier=K.line),K}function ft(e,t,i,r){var n=e.doc.mode,S=new _t(t,e.options.tabSize,i);for(S.start=S.pos=r||0,t==""&&Ne(n,i.state);!S.eol();)yt(n,S,i.state),S.start=S.pos}function Ne(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=ci(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function yt(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=ci(e,i).mode);var S=e.token(t,i);if(t.pos>t.start)return S}throw new Error("Mode "+e.name+" failed to advance stream.")}var Bt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Kt(e,t,i,r){var n=e.doc,S=n.mode,N;t=s(n,t);var K=ct(n,t.line),Y=Qe(e,t.line,i),q=new _t(K.text,e.options.tabSize,Y),ae;for(r&&(ae=[]);(r||q.pos<t.ch)&&!q.eol();)q.start=q.pos,N=yt(S,q,Y.state),r&&ae.push(new Bt(q,N,Nr(n.mode,Y.state)));return r?ae:new Bt(q,N,Y.state)}function Ir(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function gr(e,t,i,r,n,S,N){var K=i.flattenSpans;K==null&&(K=e.options.flattenSpans);var Y=0,q=null,ae=new _t(t,e.options.tabSize,r),ue,be=e.options.addModeClass&&[null];for(t==""&&Ir(Ne(i,r.state),S);!ae.eol();){if(ae.pos>e.options.maxHighlightLength?(K=!1,N&&ft(e,t,r,ae.pos),ae.pos=t.length,ue=null):ue=Ir(yt(i,ae,r.state,be),S),be){var ye=be[0].name;ye&&(ue="m-"+(ue?ye+" "+ue:ye))}if(!K||q!=ue){for(;Y<ae.start;)Y=Math.min(ae.start,Y+5e3),n(Y,q);q=ue}ae.start=ae.pos}for(;Y<ae.pos;){var ke=Math.min(ae.pos,Y+5e3);n(ke,q),Y=ke}}function vr(e,t,i){for(var r,n,S=e.doc,N=i?-1:t-(e.doc.mode.innerMode?1e3:100),K=t;K>N;--K){if(K<=S.first)return S.first;var Y=ct(S,K-1),q=Y.stateAfter;if(q&&(!i||K+(q instanceof J?q.lookAhead:0)<=S.modeFrontier))return K;var ae=ee(Y.text,null,e.options.tabSize);(n==null||r>ae)&&(n=K-1,r=ae)}return n}function Qr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,r=t-1;r>i;r--){var n=ct(e,r).stateAfter;if(n&&(!(n instanceof J)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Ii=!1,nr=!1;function Fr(){Ii=!0}function oi(){nr=!0}function si(e,t,i){this.marker=e,this.from=t,this.to=i}function Mr(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Mi(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function yi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function zi(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var S=e[n],N=S.marker,K=S.from==null||(N.inclusiveLeft?S.from<=t:S.from<t);if(K||S.from==t&&N.type=="bookmark"&&(!i||!S.marker.insertLeft)){var Y=S.to==null||(N.inclusiveRight?S.to>=t:S.to>t);(r||(r=[])).push(new si(N,S.from,Y?null:S.to))}}return r}function Ki(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var S=e[n],N=S.marker,K=S.to==null||(N.inclusiveRight?S.to>=t:S.to>t);if(K||S.from==t&&N.type=="bookmark"&&(!i||S.marker.insertLeft)){var Y=S.from==null||(N.inclusiveLeft?S.from<=t:S.from<t);(r||(r=[])).push(new si(N,Y?null:S.from-t,S.to==null?null:S.to-t))}}return r}function Yr(e,t){if(t.full)return null;var i=Vr(e,t.from.line)&&ct(e,t.from.line).markedSpans,r=Vr(e,t.to.line)&&ct(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,S=t.to.ch,N=Ct(t.from,t.to)==0,K=zi(i,n,N),Y=Ki(r,S,N),q=t.text.length==1,ae=De(t.text).length+(q?n:0);if(K)for(var ue=0;ue<K.length;++ue){var be=K[ue];if(be.to==null){var ye=Mr(Y,be.marker);ye?q&&(be.to=ye.to==null?null:ye.to+ae):be.to=n}}if(Y)for(var ke=0;ke<Y.length;++ke){var Ue=Y[ke];if(Ue.to!=null&&(Ue.to+=ae),Ue.from==null){var ze=Mr(K,Ue.marker);ze||(Ue.from=ae,q&&(K||(K=[])).push(Ue))}else Ue.from+=ae,q&&(K||(K=[])).push(Ue)}K&&(K=Gr(K)),Y&&Y!=K&&(Y=Gr(Y));var nt=[K];if(!q){var lt=t.text.length-2,at;if(lt>0&&K)for(var ut=0;ut<K.length;++ut)K[ut].to==null&&(at||(at=[])).push(new si(K[ut].marker,null,null));for(var xt=0;xt<lt;++xt)nt.push(at);nt.push(Y)}return nt}function Gr(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 bi(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(ye){if(ye.markedSpans)for(var ke=0;ke<ye.markedSpans.length;++ke){var Ue=ye.markedSpans[ke].marker;Ue.readOnly&&(!r||le(r,Ue)==-1)&&(r||(r=[])).push(Ue)}}),!r)return null;for(var n=[{from:t,to:i}],S=0;S<r.length;++S)for(var N=r[S],K=N.find(0),Y=0;Y<n.length;++Y){var q=n[Y];if(Ct(q.to,K.from)<0||Ct(q.from,K.to)>0)continue;var ae=[Y,1],ue=Ct(q.from,K.from),be=Ct(q.to,K.to);(ue<0||!N.inclusiveLeft&&!ue)&&ae.push({from:q.from,to:K.from}),(be>0||!N.inclusiveRight&&!be)&&ae.push({from:K.to,to:q.to}),n.splice.apply(n,ae),Y+=ae.length-3}return n}function dn(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 Ei(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Zt(e){return e.inclusiveLeft?-1:0}function Nt(e){return e.inclusiveRight?1:0}function dr(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),n=t.find(),S=Ct(r.from,n.from)||Zt(e)-Zt(t);if(S)return-S;var N=Ct(r.to,n.to)||Nt(e)-Nt(t);return N||t.id-e.id}function Rt(e,t){var i=nr&&e.markedSpans,r;if(i)for(var n=void 0,S=0;S<i.length;++S)n=i[S],n.marker.collapsed&&(t?n.from:n.to)==null&&(!r||dr(r,n.marker)<0)&&(r=n.marker);return r}function $t(e){return Rt(e,!0)}function jt(e){return Rt(e,!1)}function ti(e,t){var i=nr&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var S=i[n];S.marker.collapsed&&(S.from==null||S.from<t)&&(S.to==null||S.to>t)&&(!r||dr(r,S.marker)<0)&&(r=S.marker)}return r}function ar(e,t,i,r,n){var S=ct(e,t),N=nr&&S.markedSpans;if(N)for(var K=0;K<N.length;++K){var Y=N[K];if(!Y.marker.collapsed)continue;var q=Y.marker.find(0),ae=Ct(q.from,i)||Zt(Y.marker)-Zt(n),ue=Ct(q.to,r)||Nt(Y.marker)-Nt(n);if(ae>=0&&ue<=0||ae<=0&&ue>=0)continue;if(ae<=0&&(Y.marker.inclusiveRight&&n.inclusiveLeft?Ct(q.to,i)>=0:Ct(q.to,i)>0)||ae>=0&&(Y.marker.inclusiveRight&&n.inclusiveLeft?Ct(q.from,r)<=0:Ct(q.from,r)<0))return!0}}function xr(e){for(var t;t=$t(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=jt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=jt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function cn(e,t){var i=ct(e,t),r=xr(i);return i==r?t:Lt(r)}function Ci(e,t){if(t>e.lastLine())return t;var i=ct(e,t),r;if(!ri(e,i))return t;for(;r=jt(i);)i=r.find(1,!0).line;return Lt(i)+1}function ri(e,t){var i=nr&&t.markedSpans;if(i)for(var r=void 0,n=0;n<i.length;++n){if(r=i[n],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&fn(e,t,r))return!0}}function fn(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return fn(e,r.line,Mr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,S=0;S<t.markedSpans.length;++S)if(n=t.markedSpans[S],n.marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(n.to==null||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&fn(e,t,n))return!0}function Xr(e){e=xr(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var S=i.parent;S;i=S,S=i.parent)for(var N=0;N<S.children.length;++N){var K=S.children[N];if(K==i)break;t+=K.height}return t}function pn(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=$t(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=jt(r);){var S=i.find(0,!0);t-=r.text.length-S.from.ch,r=S.to.line,t+=r.text.length-S.to.ch}return t}function Wn(e){var t=e.display,i=e.doc;t.maxLine=ct(i,i.first),t.maxLineLength=pn(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var n=pn(r);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var Oi=function(e,t,i){this.text=e,Ei(this,t),this.height=i?i(this):1};Oi.prototype.lineNo=function(){return Lt(this)},fe(Oi);function ua(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dn(e),Ei(e,i);var n=r?r(e):1;n!=e.height&&mr(e,n)}function mt(e){e.parent=null,dn(e)}var At={},bt={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?bt:At;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Pt(e,t){var i=b("span",null,null,O?"padding-right: .1px":null),r={pre:b("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var S=n?t.rest[n-1]:t.line,N=void 0;r.pos=0,r.addToken=Ot,Tt(e.display.measure)&&(N=rt(S,e.doc.direction))&&(r.addToken=Ar(r.addToken,N)),r.map=[];var K=t!=e.display.externalMeasured&&Lt(S);li(S,r,Oe(e,S,K)),S.styleClasses&&(S.styleClasses.bgClass&&(r.bgClass=V(S.styleClasses.bgClass,r.bgClass||"")),S.styleClasses.textClass&&(r.textClass=V(S.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(gt(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(O){var Y=r.content.lastChild;(/\bcm-tab\b/.test(Y.className)||Y.querySelector&&Y.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return we(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=V(r.pre.className,r.textClass||"")),r}function Gt(e){var t=a("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ot(e,t,i,r,n,S,N){if(!t)return;var K=e.splitSpaces?rr(t,e.trailingSpace):t,Y=e.cm.state.specialChars,q=!1,ae;if(!Y.test(t))e.col+=t.length,ae=document.createTextNode(K),e.map.push(e.pos,e.pos+t.length,ae),G&&j<9&&(q=!0),e.pos+=t.length;else{ae=document.createDocumentFragment();for(var ue=0;;){Y.lastIndex=ue;var be=Y.exec(t),ye=be?be.index-ue:t.length-ue;if(ye){var ke=document.createTextNode(K.slice(ue,ue+ye));G&&j<9?ae.appendChild(a("span",[ke])):ae.appendChild(ke),e.map.push(e.pos,e.pos+ye,ke),e.col+=ye,e.pos+=ye}if(!be)break;ue+=ye+1;var Ue=void 0;if(be[0]==" "){var ze=e.cm.options.tabSize,nt=ze-e.col%ze;Ue=ae.appendChild(a("span",se(nt),"cm-tab")),Ue.setAttribute("role","presentation"),Ue.setAttribute("cm-text"," "),e.col+=nt}else be[0]=="\r"||be[0]==`
|
|
`?(Ue=ae.appendChild(a("span",be[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ue.setAttribute("cm-text",be[0]),e.col+=1):(Ue=e.cm.options.specialCharPlaceholder(be[0]),Ue.setAttribute("cm-text",be[0]),G&&j<9?ae.appendChild(a("span",[Ue])):ae.appendChild(Ue),e.col+=1);e.map.push(e.pos,e.pos+1,Ue),e.pos++}}if(e.trailingSpace=K.charCodeAt(t.length-1)==32,i||r||n||q||S||N){var lt=i||"";r&&(lt+=r),n&&(lt+=n);var at=a("span",[ae],lt,S);if(N)for(var ut in N)N.hasOwnProperty(ut)&&ut!="style"&&ut!="class"&&at.setAttribute(ut,N[ut]);return e.content.appendChild(at)}e.content.appendChild(ae)}function rr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var S=e.charAt(n);S==" "&&i&&(n==e.length-1||e.charCodeAt(n+1)==32)&&(S="\xA0"),r+=S,i=S==" "}return r}function Ar(e,t){return function(i,r,n,S,N,K,Y){n=n?n+" cm-force-border":"cm-force-border";for(var q=i.pos,ae=q+r.length;;){for(var ue=void 0,be=0;be<t.length&&!(ue=t[be],ue.to>q&&ue.from<=q);be++);if(ue.to>=ae)return e(i,r,n,S,N,K,Y);e(i,r.slice(0,ue.to-q),n,S,null,K,Y),S=null,r=r.slice(ue.to-q),q=ue.to}}}function kt(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function li(e,t,i){var r=e.markedSpans,n=e.text,S=0;if(!r){for(var N=1;N<i.length;N+=2)t.addToken(t,n.slice(S,S=i[N]),Dt(i[N+1],t.cm.options));return}for(var K=n.length,Y=0,q=1,ae="",ue,be,ye=0,ke,Ue,ze,nt,lt;;){if(ye==Y){ke=Ue=ze=be="",lt=null,nt=null,ye=Infinity;for(var at=[],ut=void 0,xt=0;xt<r.length;++xt){var vt=r[xt],wt=vt.marker;if(wt.type=="bookmark"&&vt.from==Y&&wt.widgetNode)at.push(wt);else if(vt.from<=Y&&(vt.to==null||vt.to>Y||wt.collapsed&&vt.to==Y&&vt.from==Y)){if(vt.to!=null&&vt.to!=Y&&ye>vt.to&&(ye=vt.to,Ue=""),wt.className&&(ke+=" "+wt.className),wt.css&&(be=(be?be+";":"")+wt.css),wt.startStyle&&vt.from==Y&&(ze+=" "+wt.startStyle),wt.endStyle&&vt.to==ye&&(ut||(ut=[])).push(wt.endStyle,vt.to),wt.title&&((lt||(lt={})).title=wt.title),wt.attributes)for(var zt in wt.attributes)(lt||(lt={}))[zt]=wt.attributes[zt];wt.collapsed&&(!nt||dr(nt.marker,wt)<0)&&(nt=vt)}else vt.from>Y&&ye>vt.from&&(ye=vt.from)}if(ut)for(var lr=0;lr<ut.length;lr+=2)ut[lr+1]==ye&&(Ue+=" "+ut[lr]);if(!nt||nt.from==Y)for(var Yt=0;Yt<at.length;++Yt)kt(t,0,at[Yt]);if(nt&&(nt.from||0)==Y){if(kt(t,(nt.to==null?K+1:nt.to)-Y,nt.marker,nt.from==null),nt.to==null)return;nt.to==Y&&(nt=!1)}}if(Y>=K)break;for(var Pr=Math.min(K,ye);;){if(ae){var Lr=Y+ae.length;if(!nt){var er=Lr>Pr?ae.slice(0,Pr-Y):ae;t.addToken(t,er,ue?ue+ke:ke,ze,Y+er.length==ye?Ue:"",be,lt)}if(Lr>=Pr){ae=ae.slice(Pr-Y),Y=Pr;break}Y=Lr,ze=""}ae=n.slice(S,S=i[q++]),ue=Dt(i[q++],t.cm.options)}}}function Ft(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Lt(De(this.rest))-i+1:1,this.node=this.text=null,this.hidden=ri(e,t)}function Tr(e,t,i){for(var r=[],n,S=t;S<i;S=n){var N=new Ft(e.doc,ct(e.doc,S),S);n=S+N.size,r.push(N)}return r}var yr=null;function zr(e){yr?yr.ops.push(e):e.ownsGroup=yr={ops:[e],delayedCallbacks:[]}}function ks(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}function Is(e,t){var i=e.ownsGroup;if(!i)return;try{ks(i)}finally{yr=null,t(i)}}var mn=null;function cr(e,t){var i=it(e,t);if(!i.length)return;var r=Array.prototype.slice.call(arguments,2),n;yr?n=yr.delayedCallbacks:mn?n=mn:(n=mn=[],setTimeout(Ms,0));for(var S=function(K){n.push(function(){return i[K].apply(null,r)})},N=0;N<i.length;++N)S(N)}function Ms(){var e=mn;mn=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,i,r){for(var n=0;n<t.changes.length;n++){var S=t.changes[n];S=="text"?Ps(e,t):S=="gutter"?Ja(e,t,i,r):S=="class"?ha(e,t):S=="widget"&&_s(e,t,r)}t.changes=null}function gn(e){return e.node==e.text&&(e.node=a("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&j<8&&(e.node.style.zIndex=2)),e.node}function Os(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=gn(t);t.background=r.insertBefore(a("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function Xa(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Pt(e,t)}function Ps(e,t){var i=t.text.className,r=Xa(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ha(e,t)):i&&(t.text.className=i)}function ha(e,t){Os(e,t),t.line.wrapClass?gn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ja(e,t,i,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var n=gn(t);t.gutterBackground=a("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text)}var S=t.line.gutterMarkers;if(e.options.lineNumbers||S){var N=gn(t),K=t.gutter=a("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(K),N.insertBefore(K,t.text),t.line.gutterClass&&(K.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!S||!S["CodeMirror-linenumbers"])&&(t.lineNumber=K.appendChild(a("div",fi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),S)for(var Y=0;Y<e.display.gutterSpecs.length;++Y){var q=e.display.gutterSpecs[Y].className,ae=S.hasOwnProperty(q)&&S[q];ae&&K.appendChild(a("div",[ae],"CodeMirror-gutter-elt","left: "+r.gutterLeft[q]+"px; width: "+r.gutterWidth[q]+"px"))}}}function _s(e,t,i){t.alignable&&(t.alignable=null);for(var r=E("CodeMirror-linewidget"),n=t.node.firstChild,S=void 0;n;n=S)S=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);Za(e,t,i)}function Bs(e,t,i,r){var n=Xa(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),ha(e,t),Ja(e,t,i,r),Za(e,t,r),t.node}function Za(e,t,i){if(qa(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)qa(e,t.rest[r],t,i,!1)}function qa(e,t,i,r,n){if(!t.widgets)return;for(var S=gn(i),N=0,K=t.widgets;N<K.length;++N){var Y=K[N],q=a("div",[Y.node],"CodeMirror-linewidget"+(Y.className?" "+Y.className:""));Y.handleMouseEvents||q.setAttribute("cm-ignore-events","true"),Ns(Y,q,i,r),e.display.input.setUneditable(q),n&&Y.above?S.insertBefore(q,i.gutter||i.text):S.appendChild(q),cr(Y,"redraw")}}function Ns(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(n-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function vn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(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;"),u(t.display.measure,a("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function ui(e,t){for(var i=me(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 jn(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $a(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=u(e.measure,a("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function ii(e){return ve-e.display.nativeBarWidth}function Pi(e){return e.display.scroller.clientWidth-ii(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-ii(e)-e.display.barHeight}function Us(e,t,i){var r=e.options.lineWrapping,n=r&&Pi(e);if(!t.measure.heights||r&&t.measure.width!=n){var S=t.measure.heights=[];if(r){t.measure.width=n;for(var N=t.text.firstChild.getClientRects(),K=0;K<N.length-1;K++){var Y=N[K],q=N[K+1];Math.abs(Y.bottom-q.bottom)>2&&S.push((Y.bottom+q.top)/2-i.top)}}S.push(i.bottom-i.top)}}function eo(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var n=0;n<e.rest.length;n++)if(Lt(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Fs(e,t){t=xr(t);var i=Lt(t),r=e.display.externalMeasured=new Ft(e.doc,t,i);r.lineN=i;var n=r.built=Pt(e,r);return r.text=n.pre,u(e.display.lineMeasure,n.pre),r}function to(e,t,i,r){return ni(e,Qi(e,t),i,r)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ni(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Qi(e,t){var i=Lt(t),r=fa(e,i);r&&!r.text?r=null:r&&r.changes&&(Ya(e,r,i,ba(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var n=eo(r,t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function ni(e,t,i,r,n){t.before&&(i=-1);var S=i+(r||""),N;return t.cache.hasOwnProperty(S)?N=t.cache[S]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),N=js(e,t,i,r),N.bogus||(t.cache[S]=N)),{left:N.left,right:N.right,top:n?N.rtop:N.top,bottom:n?N.rbottom:N.bottom}}var ro={left:0,right:0,top:0,bottom:0};function io(e,t,i){for(var r,n,S,N,K,Y,q=0;q<e.length;q+=3)if(K=e[q],Y=e[q+1],t<K?(n=0,S=1,N="left"):t<Y?(n=t-K,S=n+1):(q==e.length-3||t==Y&&e[q+3]>t)&&(S=Y-K,n=S-1,t>=Y&&(N="right")),n!=null){if(r=e[q+2],K==Y&&i==(r.insertLeft?"left":"right")&&(N=i),i=="left"&&n==0)for(;q&&e[q-2]==e[q-3]&&e[q-1].insertLeft;)r=e[(q-=3)+2],N="left";if(i=="right"&&n==Y-K)for(;q<e.length-3&&e[q+3]==e[q+4]&&!e[q+5].insertLeft;)r=e[(q+=3)+2],N="right";break}return{node:r,start:n,end:S,collapse:N,coverStart:K,coverEnd:Y}}function Ws(e,t){var i=ro;if(t=="left")for(var r=0;r<e.length&&!((i=e[r]).left!=i.right);r++);else for(var n=e.length-1;n>=0&&!((i=e[n]).left!=i.right);n--);return i}function js(e,t,i,r){var n=io(t.map,i,r),S=n.node,N=n.start,K=n.end,Y=n.collapse,q;if(S.nodeType==3){for(var ae=0;ae<4;ae++){for(;N&&Fe(t.line.text.charAt(n.coverStart+N));)--N;for(;n.coverStart+K<n.coverEnd&&Fe(t.line.text.charAt(n.coverStart+K));)++K;if(G&&j<9&&N==0&&K==n.coverEnd-n.coverStart?q=S.parentNode.getBoundingClientRect():q=Ws(v(S,N,K).getClientRects(),r),q.left||q.right||N==0)break;K=N,N=N-1,Y="right"}G&&j<11&&(q=Hs(e.display.measure,q))}else{N>0&&(Y=r="right");var ue;e.options.lineWrapping&&(ue=S.getClientRects()).length>1?q=ue[r=="right"?ue.length-1:0]:q=S.getBoundingClientRect()}if(G&&j<9&&!N&&(!q||!q.left&&!q.right)){var be=S.parentNode.getClientRects()[0];be?q={left:be.left,right:be.left+Xi(e.display),top:be.top,bottom:be.bottom}:q=ro}for(var ye=q.top-t.rect.top,ke=q.bottom-t.rect.top,Ue=(ye+ke)/2,ze=t.view.measure.heights,nt=0;nt<ze.length-1&&!(Ue<ze[nt]);nt++);var lt=nt?ze[nt-1]:0,at=ze[nt],ut={left:(Y=="right"?q.right:q.left)-t.rect.left,right:(Y=="left"?q.left:q.right)-t.rect.left,top:lt,bottom:at};return!q.left&&!q.right&&(ut.bogus=!0),e.options.singleCursorHeightPerLine||(ut.rtop=ye,ut.rbottom=ke),ut}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Jt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function no(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 ao(e){e.display.externalMeasure=null,c(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)no(e.display.view[t])}function yn(e){ao(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function oo(){return y&&h?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return y&&h?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=vn(e.widgets[i]));return t}function Hn(e,t,i,r,n){if(!n){var S=pa(t);i.top+=S,i.bottom+=S}if(r=="line")return i;r||(r="local");var N=Xr(t);if(r=="local"?N+=jn(e.display):N-=e.display.viewOffset,r=="page"||r=="window"){var K=e.display.lineSpace.getBoundingClientRect();N+=K.top+(r=="window"?0:so());var Y=K.left+(r=="window"?0:oo());i.left+=Y,i.right+=Y}return i.top+=N,i.bottom+=N,i}function lo(e,t,i){if(i=="div")return t;var r=t.left,n=t.top;if(i=="page")r-=oo(),n-=so();else if(i=="local"||!i){var S=e.display.sizer.getBoundingClientRect();r+=S.left,n+=S.top}var N=e.display.lineSpace.getBoundingClientRect();return{left:r-N.left,top:n-N.top}}function ma(e,t,i,r,n){return r||(r=ct(e.doc,t.line)),Hn(e,r,to(e,r,t.ch,n),i)}function Jr(e,t,i,r,n,S){r=r||ct(e.doc,t.line),n||(n=Qi(e,r));function N(ke,Ue){var ze=ni(e,n,ke,Ue?"right":"left",S);return Ue?ze.left=ze.right:ze.right=ze.left,Hn(e,r,ze,i)}var K=rt(r,e.doc.direction),Y=t.ch,q=t.sticky;if(Y>=r.text.length?(Y=r.text.length,q="before"):Y<=0&&(Y=0,q="after"),!K)return N(q=="before"?Y-1:Y,q=="before");function ae(ke,Ue,ze){var nt=K[Ue],lt=nt.level==1;return N(ze?ke-1:ke,lt!=ze)}var ue=tt(K,Y,q),be=Ze,ye=ae(Y,ue,q=="before");return be!=null&&(ye.other=ae(Y,be,q!="before")),ye}function uo(e,t){var i=0;t=s(e.doc,t),e.options.lineWrapping||(i=Xi(e.display)*t.ch);var r=ct(e.doc,t.line),n=Xr(r)+jn(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function ga(e,t,i,r,n){var S=je(e,t,i);return S.xRel=n,r&&(S.outside=r),S}function va(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return ga(r.first,0,null,-1,-1);var n=Ur(r,i),S=r.first+r.size-1;if(n>S)return ga(r.first+r.size-1,ct(r,S).text.length,null,1,1);t<0&&(t=0);for(var N=ct(r,n);;){var K=Gs(e,N,n,t,i),Y=ti(N,K.ch+(K.xRel>0||K.outside>0?1:0));if(!Y)return K;var q=Y.find(1);if(q.line==n)return q;N=ct(r,n=q.line)}}function ho(e,t,i,r){r-=pa(t);var n=t.text.length,S=ot(function(N){return ni(e,i,N-1).bottom<=r},n,0);return n=ot(function(N){return ni(e,i,N).top>r},S,n),{begin:S,end:n}}function co(e,t,i,r){i||(i=Qi(e,t));var n=Hn(e,t,ni(e,i,r),"line").top;return ho(e,t,i,n)}function ya(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Gs(e,t,i,r,n){n-=Xr(t);var S=Qi(e,t),N=pa(t),K=0,Y=t.text.length,q=!0,ae=rt(t,e.doc.direction);if(ae){var ue=(e.options.lineWrapping?Ks:zs)(e,t,i,S,ae,r,n);q=ue.level!=1,K=q?ue.from:ue.to-1,Y=q?ue.to:ue.from-1}var be=null,ye=null,ke=ot(function(xt){var vt=ni(e,S,xt);return vt.top+=N,vt.bottom+=N,ya(vt,r,n,!1)?(vt.top<=n&&vt.left<=r&&(be=xt,ye=vt),!0):!1},K,Y),Ue,ze,nt=!1;if(ye){var lt=r-ye.left<ye.right-r,at=lt==q;ke=be+(at?0:1),ze=at?"after":"before",Ue=lt?ye.left:ye.right}else{!q&&(ke==Y||ke==K)&&ke++,ze=ke==0?"after":ke==t.text.length?"before":ni(e,S,ke-(q?1:0)).bottom+N<=n==q?"after":"before";var ut=Jr(e,je(i,ke,ze),"line",t,S);Ue=ut.left,nt=n<ut.top?-1:n>=ut.bottom?1:0}return ke=Pe(t.text,ke,1),ga(i,ke,ze,nt,r-Ue)}function zs(e,t,i,r,n,S,N){var K=ot(function(ue){var be=n[ue],ye=be.level!=1;return ya(Jr(e,je(i,ye?be.to:be.from,ye?"before":"after"),"line",t,r),S,N,!0)},0,n.length-1),Y=n[K];if(K>0){var q=Y.level!=1,ae=Jr(e,je(i,q?Y.from:Y.to,q?"after":"before"),"line",t,r);ya(ae,S,N,!0)&&ae.top>N&&(Y=n[K-1])}return Y}function Ks(e,t,i,r,n,S,N){var K=ho(e,t,r,N),Y=K.begin,q=K.end;/\s/.test(t.text.charAt(q-1))&&q--;for(var ae=null,ue=null,be=0;be<n.length;be++){var ye=n[be];if(ye.from>=q||ye.to<=Y)continue;var ke=ye.level!=1,Ue=ni(e,r,ke?Math.min(q,ye.to)-1:Math.max(Y,ye.from)).right,ze=Ue<S?S-Ue+1e9:Ue-S;(!ae||ue>ze)&&(ae=ye,ue=ze)}return ae||(ae=n[n.length-1]),ae.from<Y&&(ae={from:Y,to:ae.to,level:ae.level}),ae.to>q&&(ae={from:ae.from,to:q,level:ae.level}),ae}var _i;function Yi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(_i==null){_i=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)_i.appendChild(document.createTextNode("x")),_i.appendChild(a("br"));_i.appendChild(document.createTextNode("x"))}u(e.measure,_i);var i=_i.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),c(e.measure),i||1}function Xi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),i=a("pre",[t],"CodeMirror-line-like");u(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function ba(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,S=t.gutters.firstChild,N=0;S;S=S.nextSibling,++N){var K=e.display.gutterSpecs[N].className;i[K]=S.offsetLeft+S.clientLeft+n,r[K]=S.clientWidth}return{fixedPos:Ea(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ea(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function fo(e){var t=Yi(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Xi(e.display)-3);return function(n){if(ri(e.doc,n))return 0;var S=0;if(n.widgets)for(var N=0;N<n.widgets.length;N++)n.widgets[N].height&&(S+=n.widgets[N].height);return i?S+(Math.ceil(n.text.length/r)||1)*t:S+t}}function xa(e){var t=e.doc,i=fo(e);t.iter(function(r){var n=i(r);n!=r.height&&mr(r,n)})}function Bi(e,t,i,r){var n=e.display;if(!i&&me(t).getAttribute("cm-not-content")=="true")return null;var S,N,K=n.lineSpace.getBoundingClientRect();try{S=t.clientX-K.left,N=t.clientY-K.top}catch(ue){return null}var Y=va(e,S,N),q;if(r&&Y.xRel>0&&(q=ct(e.doc,Y.line).text).length==Y.ch){var ae=ee(q,q.length,e.options.tabSize)-q.length;Y=je(Y.line,Math.max(0,Math.round((S-$a(e.display).left)/Xi(e.display))-ae))}return Y}function Ni(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function wr(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)nr&&cn(e.doc,t)<n.viewTo&&Ai(e);else if(i<=n.viewFrom)nr&&Ci(e.doc,i+r)>n.viewFrom?Ai(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ai(e);else if(t<=n.viewFrom){var S=Gn(e,i,i+r,1);S?(n.view=n.view.slice(S.index),n.viewFrom=S.lineN,n.viewTo+=r):Ai(e)}else if(i>=n.viewTo){var N=Gn(e,t,t,-1);N?(n.view=n.view.slice(0,N.index),n.viewTo=N.lineN):Ai(e)}else{var K=Gn(e,t,t,-1),Y=Gn(e,i,i+r,1);K&&Y?(n.view=n.view.slice(0,K.index).concat(Tr(e,K.lineN,Y.lineN)).concat(n.view.slice(Y.index)),n.viewTo+=r):Ai(e)}var q=n.externalMeasured;q&&(i<q.lineN?q.lineN+=r:t<q.lineN+q.size&&(n.externalMeasured=null))}function Si(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var S=r.view[Ni(e,t)];if(S.node==null)return;var N=S.changes||(S.changes=[]);le(N,i)==-1&&N.push(i)}function Ai(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gn(e,t,i,r){var n=Ni(e,t),S,N=e.display.view;if(!nr||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var K=e.display.viewFrom,Y=0;Y<n;Y++)K+=N[Y].size;if(K!=t){if(r>0){if(n==N.length-1)return null;S=K+N[n].size-t,n++}else S=K-t;t+=S,i+=S}for(;cn(e.doc,i)!=i;){if(n==(r<0?0:N.length-1))return null;i+=r*N[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Vs(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Tr(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Tr(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Ni(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(Tr(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,Ni(e,i)))),r.viewTo=i}function po(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];!n.hidden&&(!n.node||n.changes)&&++i}return i}function bn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mo(e,t){t===void 0&&(t=!0);for(var i=e.doc,r={},n=r.cursors=document.createDocumentFragment(),S=r.selection=document.createDocumentFragment(),N=0;N<i.sel.ranges.length;N++){if(!t&&N==i.sel.primIndex)continue;var K=i.sel.ranges[N];if(K.from().line>=e.display.viewTo||K.to().line<e.display.viewFrom)continue;var Y=K.empty();(Y||e.options.showCursorWhenSelecting)&&go(e,K.head,n),Y||Qs(e,K,S)}return r}function go(e,t,i){var r=Jr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),n=i.appendChild(a("div","\xA0","CodeMirror-cursor"));if(n.style.left=r.left+"px",n.style.top=r.top+"px",n.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var S=i.appendChild(a("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));S.style.display="",S.style.left=r.other.left+"px",S.style.top=r.other.top+"px",S.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function zn(e,t){return e.top-t.top||e.left-t.left}function Qs(e,t,i){var r=e.display,n=e.doc,S=document.createDocumentFragment(),N=$a(e.display),K=N.left,Y=Math.max(r.sizerWidth,Pi(e)-r.sizer.offsetLeft)-N.right,q=n.direction=="ltr";function ae(at,ut,xt,vt){ut<0&&(ut=0),ut=Math.round(ut),vt=Math.round(vt),S.appendChild(a("div",null,"CodeMirror-selected","position: absolute; left: "+at+`px;
|
|
top: `+ut+"px; width: "+(xt==null?Y-at:xt)+`px;
|
|
height: `+(vt-ut)+"px"))}function ue(at,ut,xt){var vt=ct(n,at),wt=vt.text.length,zt,lr;function Yt(er,Rr){return ma(e,je(at,er),"div",vt,Rr)}function Pr(er,Rr,fr){var ir=co(e,vt,null,er),tr=Rr=="ltr"==(fr=="after")?"left":"right",Xt=fr=="after"?ir.begin:ir.end-(/\s/.test(vt.text.charAt(ir.end-1))?2:1);return Yt(Xt,tr)[tr]}var Lr=rt(vt,n.direction);return Je(Lr,ut||0,xt==null?wt:xt,function(er,Rr,fr,ir){var tr=fr=="ltr",Xt=Yt(er,tr?"left":"right"),kr=Yt(Rr-1,tr?"right":"left"),un=ut==null&&er==0,ki=xt==null&&Rr==wt,Er=ir==0,ai=!Lr||ir==Lr.length-1;if(kr.top-Xt.top<=3){var ur=(q?un:ki)&&Er,Va=(q?ki:un)&&ai,di=ur?K:(tr?Xt:kr).left,Hi=Va?Y:(tr?kr:Xt).right;ae(di,Xt.top,Hi-di,Xt.bottom)}else{var Gi,Sr,hn,Qa;tr?(Gi=q&&un&&Er?K:Xt.left,Sr=q?Y:Pr(er,fr,"before"),hn=q?K:Pr(Rr,fr,"after"),Qa=q&&ki&&ai?Y:kr.right):(Gi=q?Pr(er,fr,"before"):K,Sr=!q&&un&&Er?Y:Xt.right,hn=!q&&ki&&ai?K:kr.left,Qa=q?Pr(Rr,fr,"after"):Y),ae(Gi,Xt.top,Sr-Gi,Xt.bottom),Xt.bottom<kr.top&&ae(K,Xt.bottom,null,kr.top),ae(hn,kr.top,Qa-hn,kr.bottom)}(!zt||zn(Xt,zt)<0)&&(zt=Xt),zn(kr,zt)<0&&(zt=kr),(!lr||zn(Xt,lr)<0)&&(lr=Xt),zn(kr,lr)<0&&(lr=kr)}),{start:zt,end:lr}}var be=t.from(),ye=t.to();if(be.line==ye.line)ue(be.line,be.ch,ye.ch);else{var ke=ct(n,be.line),Ue=ct(n,ye.line),ze=xr(ke)==xr(Ue),nt=ue(be.line,be.ch,ze?ke.text.length+1:null).end,lt=ue(ye.line,ze?0:null,ye.ch).start;ze&&(nt.top<lt.top-2?(ae(nt.right,nt.top,null,nt.bottom),ae(K,lt.top,lt.left,lt.bottom)):ae(nt.right,nt.top,lt.left-nt.right,nt.bottom)),nt.bottom<lt.top&&ae(K,nt.bottom,null,lt.top)}i.appendChild(S)}function Ca(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()||Ji(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function vo(e){e.state.focused||(e.display.input.focus(),Sa(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ji(e))},100)}function Sa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(we(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),O&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ca(e)}function Ji(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(we(e,"blur",e,t),e.state.focused=!1,m(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Kn(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var n=t.view[r],S=e.options.lineWrapping,N=void 0,K=0;if(n.hidden)continue;if(G&&j<8){var Y=n.node.offsetTop+n.node.offsetHeight;N=Y-i,i=Y}else{var q=n.node.getBoundingClientRect();N=q.bottom-q.top,!S&&n.text.firstChild&&(K=n.text.firstChild.getBoundingClientRect().right-q.left-1)}var ae=n.line.height-N;if((ae>.005||ae<-.005)&&(mr(n.line,N),bo(n.line),n.rest))for(var ue=0;ue<n.rest.length;ue++)bo(n.rest[ue]);if(K>e.display.sizerWidth){var be=Math.ceil(K/Xi(e.display));be>e.display.maxLineLength&&(e.display.maxLineLength=be,e.display.maxLine=n.line,e.display.maxLineChanged=!0)}}}function bo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Vn(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-jn(e));var n=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,S=Ur(t,r),N=Ur(t,n);if(i&&i.ensure){var K=i.ensure.from.line,Y=i.ensure.to.line;K<S?(S=K,N=Ur(t,Xr(ct(t,K))+e.wrapper.clientHeight)):Math.min(Y,t.lastLine())>=N&&(S=Ur(t,Xr(ct(t,Y))-e.wrapper.clientHeight),N=Y)}return{from:S,to:Math.max(N,S+1)}}function Ys(e,t){if(We(e,"scrollCursorIntoView"))return;var i=e.display,r=i.sizer.getBoundingClientRect(),n=null;if(t.top+r.top<0?n=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1),n!=null&&!w){var S=a("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-jn(e.display))+`px;
|
|
height: `+(t.bottom-t.top+ii(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(S),S.scrollIntoView(n),e.display.lineSpace.removeChild(S)}}function Xs(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(t=t.ch?je(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?je(t.line,t.ch+1,"before"):t);for(var S=0;S<5;S++){var N=!1,K=Jr(e,t),Y=!i||i==t?K:Jr(e,i);n={left:Math.min(K.left,Y.left),top:Math.min(K.top,Y.top)-r,right:Math.max(K.left,Y.left),bottom:Math.max(K.bottom,Y.bottom)+r};var q=Aa(e,n),ae=e.doc.scrollTop,ue=e.doc.scrollLeft;if(q.scrollTop!=null&&(xn(e,q.scrollTop),Math.abs(e.doc.scrollTop-ae)>1&&(N=!0)),q.scrollLeft!=null&&(Ui(e,q.scrollLeft),Math.abs(e.doc.scrollLeft-ue)>1&&(N=!0)),!N)break}return n}function Js(e,t){var i=Aa(e,t);i.scrollTop!=null&&xn(e,i.scrollTop),i.scrollLeft!=null&&Ui(e,i.scrollLeft)}function Aa(e,t){var i=e.display,r=Yi(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,S=ca(e),N={};t.bottom-t.top>S&&(t.bottom=t.top+S);var K=e.doc.height+da(i),Y=t.top<r,q=t.bottom>K-r;if(t.top<n)N.scrollTop=Y?0:t.top;else if(t.bottom>n+S){var ae=Math.min(t.top,(q?K:t.bottom)-S);ae!=n&&(N.scrollTop=ae)}var ue=e.options.fixedGutter?0:i.gutters.offsetWidth,be=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-ue,ye=Pi(e)-i.gutters.offsetWidth,ke=t.right-t.left>ye;return ke&&(t.right=t.left+ye),t.left<10?N.scrollLeft=0:t.left<be?N.scrollLeft=Math.max(0,t.left+ue-(ke?0:10)):t.right>ye+be-3&&(N.scrollLeft=t.right+(ke?0:10)-ye),N}function Ta(e,t){if(t==null)return;Qn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Zi(e){Qn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function En(e,t,i){(t!=null||i!=null)&&Qn(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Qn(e),e.curOp.scrollToPos=t}function Qn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=uo(e,t.from),r=uo(e,t.to);Eo(e,i,r,t.margin)}}function Eo(e,t,i,r){var n=Aa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});En(e,n.scrollLeft,n.scrollTop)}function xn(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;R||Da(e,{top:t}),xo(e,t,!0),R&&Da(e),An(e,100)}function xo(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 Ui(e,t,i,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,wo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cn(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+ii(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Fi=function(e,t,i){this.cm=i;var r=this.vert=a("div",[a("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=a("div",[a("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),Ee(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ee(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&j<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var S=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+S)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},Fi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fi.prototype.zeroWidthHack=function(){var e=l&&!D?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new oe,this.disableVert=new oe},Fi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var n=e.getBoundingClientRect(),S=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);S!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Fi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sn=function(){};Sn.prototype.update=function(){return{bottom:0,right:0}},Sn.prototype.setScrollLeft=function(){},Sn.prototype.setScrollTop=function(){},Sn.prototype.clear=function(){};function qi(e,t){t||(t=Cn(e));var i=e.display.barWidth,r=e.display.barHeight;Co(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Kn(e),Co(e,Cn(e)),i=e.display.barWidth,r=e.display.barHeight}function Co(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var So={native:Fi,null:Sn};function Ao(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&m(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new So[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ee(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"?Ui(e,t):xn(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function Wi(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:++qs},zr(e.curOp)}function ji(e){var t=e.curOp;t&&Is(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;$s(i)})}function $s(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var r=0;r<t.length;r++)tl(t[r]);for(var n=0;n<t.length;n++)rl(t[n]);for(var S=0;S<t.length;S++)il(t[S]);for(var N=0;N<t.length;N++)nl(t[N])}function el(e){var t=e.cm,i=t.display;ol(t),e.updateMaxLine&&Wn(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 Yn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&wa(e.cm,e.update)}function rl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Kn(t),e.barMeasure=Cn(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(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+ii(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Pi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ui(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qi(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&Ca(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&vo(e.cm)}function nl(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&To(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&xo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ui(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=Xs(t,s(r,e.scrollToPos.from),s(r,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,n)}var S=e.maybeHiddenMarkers,N=e.maybeUnhiddenMarkers;if(S)for(var K=0;K<S.length;++K)S[K].lines.length||we(S[K],"hide");if(N)for(var Y=0;Y<N.length;++Y)N[Y].lines.length&&we(N[Y],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&we(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Or(e,t){if(e.curOp)return t();Wi(e);try{return t()}finally{ji(e)}}function or(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Wi(e);try{return t.apply(e,arguments)}finally{ji(e)}}}function Cr(e){return function(){if(this.curOp)return e.apply(this,arguments);Wi(this);try{return e.apply(this,arguments)}finally{ji(this)}}}function sr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Wi(t);try{return e.apply(this,arguments)}finally{ji(t)}}}function An(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,z(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,r=Qe(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(S){if(r.line>=e.display.viewFrom){var N=S.styles,K=S.text.length>e.options.maxHighlightLength?Nr(t.mode,r.state):null,Y=ce(e,S,r,!0);K&&(r.state=K),S.styles=Y.styles;var q=S.styleClasses,ae=Y.classes;ae?S.styleClasses=ae:q&&(S.styleClasses=null);for(var ue=!N||N.length!=S.styles.length||q!=ae&&(!q||!ae||q.bgClass!=ae.bgClass||q.textClass!=ae.textClass),be=0;!ue&&be<N.length;++be)ue=N[be]!=S.styles[be];ue&&n.push(r.line),S.stateAfter=r.save(),r.nextLine()}else S.text.length<=e.options.maxHighlightLength&&ft(e,S.text,r),S.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return An(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&Or(e,function(){for(var S=0;S<n.length;S++)Si(e,n[S],"text")})}var Yn=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Vn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Pi(e),this.force=i,this.dims=ba(e),this.events=[]};Yn.prototype.signal=function(e,t){de(e,t)&&this.events.push(arguments)},Yn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)we.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=ii(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ii(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=P();if(!t||!x(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&x(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==P())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(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 wa(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Ai(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&&po(e)==0)return!1;Do(e)&&(Ai(e),t.dims=ba(e));var n=r.first+r.size,S=Math.max(t.visible.from-e.options.viewportMargin,r.first),N=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<S&&S-i.viewFrom<20&&(S=Math.max(r.first,i.viewFrom)),i.viewTo>N&&i.viewTo-N<20&&(N=Math.min(n,i.viewTo)),nr&&(S=cn(e.doc,S),N=Ci(e.doc,N));var K=S!=i.viewFrom||N!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vs(e,S,N),i.viewOffset=Xr(ct(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var Y=po(e);if(!K&&Y==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var q=sl(e);return Y>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),Y>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(q),c(i.cursorDiv),c(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,K&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,An(e,400)),i.updateLineNumbers=null,!0}function To(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Pi(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+da(e.display)-ca(e),i.top)}),t.visible=Vn(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,i));if(!wa(e,t))break;Kn(e);var n=Cn(e);bn(e),qi(e,n),Ra(e,n),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 Da(e,t){var i=new Yn(e,t);if(wa(e,i)){Kn(e),To(e,i);var r=Cn(e);bn(e),qi(e,r),Ra(e,r),i.finish()}}function ul(e,t,i){var r=e.display,n=e.options.lineNumbers,S=r.lineDiv,N=S.firstChild;function K(ke){var Ue=ke.nextSibling;return O&&l&&e.display.currentWheelTarget==ke?ke.style.display="none":ke.parentNode.removeChild(ke),Ue}for(var Y=r.view,q=r.viewFrom,ae=0;ae<Y.length;ae++){var ue=Y[ae];if(!ue.hidden)if(!ue.node||ue.node.parentNode!=S){var be=Bs(e,ue,q,i);S.insertBefore(be,N)}else{for(;N!=ue.node;)N=K(N);var ye=n&&t!=null&&t<=q&&ue.lineNumber;ue.changes&&(le(ue.changes,"gutter")>-1&&(ye=!1),Ya(e,ue,q,i)),ye&&(c(ue.lineNumber),ue.lineNumber.appendChild(document.createTextNode(fi(e.options,q)))),N=ue.node.nextSibling}q+=ue.size}for(;N;)N=K(N)}function La(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(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+ii(e)+"px"}function wo(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ea(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,S=r+"px",N=0;N<i.length;N++)if(!i[N].hidden){e.options.fixedGutter&&(i[N].gutter&&(i[N].gutter.style.left=S),i[N].gutterBackground&&(i[N].gutterBackground.style.left=S));var K=i[N].alignable;if(K)for(var Y=0;Y<K.length;Y++)K[Y].style.left=S}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}function Do(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=fi(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(a("div",[a("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),S=n.firstChild.offsetWidth,N=n.offsetWidth-S;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(S,r.lineGutter.offsetWidth-N)+1,r.lineNumWidth=r.lineNumInnerWidth+N,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",La(e.display),!0}return!1}function ka(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var S=e[n],N=null;if(typeof S!="string"&&(N=S.style,S=S.className),S=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:S,style:N})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Lo(e){var t=e.gutters,i=e.gutterSpecs;c(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],S=n.className,N=n.style,K=t.appendChild(a("div",null,"CodeMirror-gutter "+S));N&&(K.style.cssText=N),S=="CodeMirror-linenumbers"&&(e.lineGutter=K,K.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",La(e)}function Tn(e){Lo(e.display),wr(e),wo(e)}function hl(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=a("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=a("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=b("div",null,"CodeMirror-code"),n.selectionDiv=a("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=a("div",null,"CodeMirror-cursors"),n.measure=a("div",null,"CodeMirror-measure"),n.lineMeasure=a("div",null,"CodeMirror-measure"),n.lineSpace=b("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var S=b("div",[n.lineSpace],"CodeMirror-lines");n.mover=a("div",[S],null,"position: relative"),n.sizer=a("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=a("div",null,null,"position: absolute; height: "+ve+"px; width: 1px;"),n.gutters=a("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=a("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=a("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),G&&j<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!O&&!(R&&o)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=ka(r.gutters,r.lineNumbers),Lo(n),i.init(n)}var Xn=0,Wr=null;G?Wr=-.53:R?Wr=15:y?Wr=-.7:k&&(Wr=-1/3);function Ro(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 dl(e){var t=Ro(e);return t.x*=Wr,t.y*=Wr,t}function ko(e,t){var i=Ro(t),r=i.x,n=i.y,S=e.display,N=S.scroller,K=N.scrollWidth>N.clientWidth,Y=N.scrollHeight>N.clientHeight;if(!(r&&K||n&&Y))return;if(n&&l&&O){e:for(var q=t.target,ae=S.view;q!=N;q=q.parentNode)for(var ue=0;ue<ae.length;ue++)if(ae[ue].node==q){e.display.currentWheelTarget=q;break e}}if(r&&!R&&!T&&Wr!=null){n&&Y&&xn(e,Math.max(0,N.scrollTop+n*Wr)),Ui(e,Math.max(0,N.scrollLeft+r*Wr)),(!n||n&&Y)&&te(t),S.wheelStartX=null;return}if(n&&Wr!=null){var be=n*Wr,ye=e.doc.scrollTop,ke=ye+S.wrapper.clientHeight;be<0?ye=Math.max(0,ye+be-50):ke=Math.min(e.doc.height,ke+be+50),Da(e,{top:ye,bottom:ke})}Xn<20&&(S.wheelStartX==null?(S.wheelStartX=N.scrollLeft,S.wheelStartY=N.scrollTop,S.wheelDX=r,S.wheelDY=n,setTimeout(function(){if(S.wheelStartX==null)return;var Ue=N.scrollLeft-S.wheelStartX,ze=N.scrollTop-S.wheelStartY,nt=ze&&S.wheelDY&&ze/S.wheelDY||Ue&&S.wheelDX&&Ue/S.wheelDX;if(S.wheelStartX=S.wheelStartY=null,!nt)return;Wr=(Wr*Xn+nt)/(Xn+1),++Xn},200)):(S.wheelDX+=r,S.wheelDY+=n))}var jr=function(e,t){this.ranges=e,this.primIndex=t};jr.prototype.primary=function(){return this.ranges[this.primIndex]},jr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!pi(i.anchor,r.anchor)||!pi(i.head,r.head))return!1}return!0},jr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Wt(mi(this.ranges[t].anchor),mi(this.ranges[t].head));return new jr(e,this.primIndex)},jr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},jr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(Ct(t,r.from())>=0&&Ct(e,r.to())<=0)return i}return-1};var Wt=function(e,t){this.anchor=e,this.head=t};Wt.prototype.from=function(){return vi(this.anchor,this.head)},Wt.prototype.to=function(){return gi(this.anchor,this.head)},Wt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Zr(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(be,ye){return Ct(be.from(),ye.from())}),i=le(t,n);for(var S=1;S<t.length;S++){var N=t[S],K=t[S-1],Y=Ct(K.to(),N.from());if(r&&!N.empty()?Y>0:Y>=0){var q=vi(K.from(),N.from()),ae=gi(K.to(),N.to()),ue=K.empty()?N.from()==N.head:K.from()==K.head;S<=i&&--i,t.splice(--S,2,new Wt(ue?ae:q,ue?q:ae))}}return new jr(t,i)}function Ti(e,t){return new jr([new Wt(e,t||e)],0)}function wi(e){return e.text?je(e.from.line+e.text.length-1,De(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Io(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return wi(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wi(t).ch-t.to.ch),je(i,r)}function Ia(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new Wt(Io(n.anchor,t),Io(n.head,t)))}return Zr(e.cm,i,e.sel.primIndex)}function Mo(e,t,i){return e.line==t.line?je(i.line,e.ch-t.ch+i.ch):je(i.line+(e.line-t.line),e.ch)}function cl(e,t,i){for(var r=[],n=je(e.first,0),S=n,N=0;N<t.length;N++){var K=t[N],Y=Mo(K.from,n,S),q=Mo(wi(K),n,S);if(n=K.to,S=q,i=="around"){var ae=e.sel.ranges[N],ue=Ct(ae.head,ae.anchor)<0;r[N]=new Wt(ue?q:Y,ue?Y:q)}else r[N]=new Wt(Y,Y)}return new jr(r,e.sel.primIndex)}function Ma(e){e.doc.mode=Br(e.options,e.doc.modeOption),wn(e)}function wn(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,An(e,100),e.state.modeGen++,e.curOp&&wr(e)}function Oo(e,t){return t.from.ch==0&&t.to.ch==0&&De(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Oa(e,t,i,r){function n(lt){return i?i[lt]:null}function S(lt,at,ut){ua(lt,at,ut,r),cr(lt,"change",lt,t)}function N(lt,at){for(var ut=[],xt=lt;xt<at;++xt)ut.push(new Oi(q[xt],n(xt),r));return ut}var K=t.from,Y=t.to,q=t.text,ae=ct(e,K.line),ue=ct(e,Y.line),be=De(q),ye=n(q.length-1),ke=Y.line-K.line;if(t.full)e.insert(0,N(0,q.length)),e.remove(q.length,e.size-q.length);else if(Oo(e,t)){var Ue=N(0,q.length-1);S(ue,ue.text,ye),ke&&e.remove(K.line,ke),Ue.length&&e.insert(K.line,Ue)}else if(ae==ue)if(q.length==1)S(ae,ae.text.slice(0,K.ch)+be+ae.text.slice(Y.ch),ye);else{var ze=N(1,q.length-1);ze.push(new Oi(be+ae.text.slice(Y.ch),ye,r)),S(ae,ae.text.slice(0,K.ch)+q[0],n(0)),e.insert(K.line+1,ze)}else if(q.length==1)S(ae,ae.text.slice(0,K.ch)+q[0]+ue.text.slice(Y.ch),n(0)),e.remove(K.line+1,ke);else{S(ae,ae.text.slice(0,K.ch)+q[0],n(0)),S(ue,be+ue.text.slice(Y.ch),ye);var nt=N(1,q.length-1);ke>1&&e.remove(K.line+1,ke-1),e.insert(K.line+1,nt)}cr(e,"change",e,t)}function Di(e,t,i){function r(n,S,N){if(n.linked)for(var K=0;K<n.linked.length;++K){var Y=n.linked[K];if(Y.doc==S)continue;var q=N&&Y.sharedHist;if(i&&!q)continue;t(Y.doc,q),r(Y.doc,n,q)}}r(e,null,!0)}function Po(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,xa(e),Ma(e),_o(e),e.options.lineWrapping||Wn(e),e.options.mode=t.modeOption,wr(e)}function _o(e){(e.doc.direction=="rtl"?H:m)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Or(e,function(){_o(e),wr(e)})}function Jn(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 Pa(e,t){var i={from:mi(t.from),to:wi(t),text:Hr(e,t.from,t.to)};return Uo(e,i,t.from.line,t.to.line+1),Di(e,function(r){return Uo(r,i,t.from.line,t.to.line+1)},!0),i}function Bo(e){for(;e.length;){var t=De(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Bo(e.done),De(e.done);if(e.done.length&&!De(e.done).ranges)return De(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),De(e.done)}function No(e,t,i,r){var n=e.history;n.undone.length=0;var S=+new Date,N,K;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>S-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(N=pl(n,n.lastOp==r)))K=De(N.changes),Ct(t.from,t.to)==0&&Ct(t.from,K.to)==0?K.to=wi(t):N.changes.push(Pa(e,t));else{var Y=De(n.done);for((!Y||!Y.ranges)&&Zn(e.sel,n.done),N={changes:[Pa(e,t)],generation:n.generation},n.done.push(N);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=S,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,K||we(e,"historyAdded")}function ml(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,r){var n=e.history,S=r&&r.origin;i==n.lastSelOp||S&&n.lastSelOrigin==S&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==S||ml(e,S,De(n.done),t))?n.done[n.done.length-1]=t:Zn(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=S,n.lastSelOp=i,r&&r.clearRedo!==!1&&Bo(n.undone)}function Zn(e,t){var i=De(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Uo(e,t,i,r){var n=t["spans_"+e.id],S=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(N){N.markedSpans&&((n||(n=t["spans_"+e.id]={}))[S]=N.markedSpans),++S})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(vl(i[n]));return r}function Fo(e,t){var i=yl(e,t),r=Yr(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var S=i[n],N=r[n];if(S&&N){e:for(var K=0;K<N.length;++K){for(var Y=N[K],q=0;q<S.length;++q)if(S[q].marker==Y.marker)continue e;S.push(Y)}}else N&&(i[n]=N)}return i}function $i(e,t,i){for(var r=[],n=0;n<e.length;++n){var S=e[n];if(S.ranges){r.push(i?jr.prototype.deepCopy.call(S):S);continue}var N=S.changes,K=[];r.push({changes:K});for(var Y=0;Y<N.length;++Y){var q=N[Y],ae=void 0;if(K.push({from:q.from,to:q.to,text:q.text}),t)for(var ue in q)(ae=ue.match(/^spans_(\d+)$/))&&(le(t,Number(ae[1]))>-1&&(De(K)[ue]=q[ue],delete q[ue]))}}return r}function _a(e,t,i,r){if(r){var n=e.anchor;if(i){var S=Ct(t,n)<0;S!=Ct(i,n)<0?(n=t,t=i):S!=Ct(t,i)<0&&(t=i)}return new Wt(n,t)}else return new Wt(i||t,t)}function qn(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),br(e,new jr([_a(e.sel.primary(),t,i,n)],0),r)}function Wo(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),S=0;S<e.sel.ranges.length;S++)r[S]=_a(e.sel.ranges[S],t[S],null,n);var N=Zr(e.cm,r,e.sel.primIndex);br(e,N,i)}function Ba(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,br(e,Zr(e.cm,n,e.sel.primIndex),r)}function jo(e,t,i,r){br(e,Ti(t,i),r)}function bl(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var S=0;S<n.length;S++)this.ranges[S]=new Wt(s(e,n[S].anchor),s(e,n[S].head))},origin:i&&i.origin};return we(e,"beforeSelectionChange",e,r),e.cm&&we(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Zr(e.cm,r.ranges,r.ranges.length-1):t}function Ho(e,t,i){var r=e.history.done,n=De(r);n&&n.ranges?(r[r.length-1]=t,$n(e,t,i)):br(e,t,i)}function br(e,t,i){$n(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function $n(e,t,i){(de(e,"beforeSelectionChange")||e.cm&&de(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var r=i&&i.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);Go(e,Ko(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&Zi(e.cm)}function Go(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),cr(e,"cursorActivity",e)}function zo(e){Go(e,Ko(e,e.sel,null,!1))}function Ko(e,t,i,r){for(var n,S=0;S<t.ranges.length;S++){var N=t.ranges[S],K=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[S],Y=ea(e,N.anchor,K&&K.anchor,i,r),q=ea(e,N.head,K&&K.head,i,r);(n||Y!=N.anchor||q!=N.head)&&(n||(n=t.ranges.slice(0,S)),n[S]=new Wt(Y,q))}return n?Zr(e.cm,n,t.primIndex):t}function en(e,t,i,r,n){var S=ct(e,t.line);if(S.markedSpans)for(var N=0;N<S.markedSpans.length;++N){var K=S.markedSpans[N],Y=K.marker,q="selectLeft"in Y?!Y.selectLeft:Y.inclusiveLeft,ae="selectRight"in Y?!Y.selectRight:Y.inclusiveRight;if((K.from==null||(q?K.from<=t.ch:K.from<t.ch))&&(K.to==null||(ae?K.to>=t.ch:K.to>t.ch))){if(n&&(we(Y,"beforeCursorEnter"),Y.explicitlyCleared))if(S.markedSpans){--N;continue}else break;if(!Y.atomic)continue;if(i){var ue=Y.find(r<0?1:-1),be=void 0;if((r<0?ae:q)&&(ue=Vo(e,ue,-r,ue&&ue.line==t.line?S:null)),ue&&ue.line==t.line&&(be=Ct(ue,i))&&(r<0?be<0:be>0))return en(e,ue,t,r,n)}var ye=Y.find(r<0?-1:1);return(r<0?q:ae)&&(ye=Vo(e,ye,r,ye.line==t.line?S:null)),ye?en(e,ye,t,r,n):null}}return t}function ea(e,t,i,r,n){var S=r||1,N=en(e,t,i,S,n)||!n&&en(e,t,i,S,!0)||en(e,t,i,-S,n)||!n&&en(e,t,i,-S,!0);return N||(e.cantEdit=!0,je(e.first,0))}function Vo(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?s(e,je(t.line-1)):null:i>0&&t.ch==(r||ct(e,t.line)).text.length?t.line<e.first+e.size-1?je(t.line+1,0):null:new je(t.line,t.ch+i)}function Qo(e){e.setSelection(je(e.firstLine(),0),je(e.lastLine()),xe)}function Yo(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,S,N,K){n&&(r.from=s(e,n)),S&&(r.to=s(e,S)),N&&(r.text=N),K!==void 0&&(r.origin=K)}),we(e,"beforeChange",e,r),e.cm&&we(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function tn(e,t,i){if(e.cm){if(!e.cm.curOp)return or(e.cm,tn)(e,t,i);if(e.cm.state.suppressEdits)return}if((de(e,"beforeChange")||e.cm&&de(e.cm,"beforeChange"))&&(t=Yo(e,t,!0),!t))return;var r=Ii&&!i&&bi(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)Xo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Xo(e,t)}function Xo(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var i=Ia(e,t);No(e,t,i,e.cm?e.cm.curOp.id:NaN),Dn(e,t,i,Yr(e,t));var r=[];Di(e,function(n,S){!S&&le(r,n.history)==-1&&($o(n.history,t),r.push(n.history)),Dn(n,t,null,Yr(n,t))})}function ta(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!i)return;for(var n=e.history,S,N=e.sel,K=t=="undo"?n.done:n.undone,Y=t=="undo"?n.undone:n.done,q=0;q<K.length&&!(S=K[q],i?S.ranges&&!S.equals(e.sel):!S.ranges);q++);if(q==K.length)return;for(n.lastOrigin=n.lastSelOrigin=null;;)if(S=K.pop(),S.ranges){if(Zn(S,Y),i&&!S.equals(e.sel)){br(e,S,{clearRedo:!1});return}N=S}else if(r){K.push(S);return}else break;var ae=[];Zn(N,Y),Y.push({changes:ae,generation:n.generation}),n.generation=S.generation||++n.maxGeneration;for(var ue=de(e,"beforeChange")||e.cm&&de(e.cm,"beforeChange"),be=function(Ue){var ze=S.changes[Ue];if(ze.origin=t,ue&&!Yo(e,ze,!1))return K.length=0,{};ae.push(Pa(e,ze));var nt=Ue?Ia(e,ze):De(K);Dn(e,ze,nt,Fo(e,ze)),!Ue&&e.cm&&e.cm.scrollIntoView({from:ze.from,to:wi(ze)});var lt=[];Di(e,function(at,ut){!ut&&le(lt,at.history)==-1&&($o(at.history,ze),lt.push(at.history)),Dn(at,ze,null,Fo(at,ze))})},ye=S.changes.length-1;ye>=0;--ye){var ke=be(ye);if(ke)return ke.v}}function Jo(e,t){if(t==0)return;if(e.first+=t,e.sel=new jr(Ye(e.sel.ranges,function(n){return new Wt(je(n.anchor.line+t,n.anchor.ch),je(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm){wr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Si(e.cm,r,"gutter")}}function Dn(e,t,i,r){if(e.cm&&!e.cm.curOp)return or(e.cm,Dn)(e,t,i,r);if(t.to.line<e.first){Jo(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 n=t.text.length-1-(e.first-t.from.line);Jo(e,n),t={from:je(e.first,0),to:je(t.to.line+n,t.to.ch),text:[De(t.text)],origin:t.origin}}var S=e.lastLine();t.to.line>S&&(t={from:t.from,to:je(S,ct(e,S).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Hr(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?El(e.cm,t,r):Oa(e,t,r),$n(e,i,xe),e.cantEdit&&ea(e,je(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var r=e.doc,n=e.display,S=t.from,N=t.to,K=!1,Y=S.line;e.options.lineWrapping||(Y=Lt(xr(ct(r,S.line))),r.iter(Y,N.line+1,function(ye){if(ye==n.maxLine)return K=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ge(e),Oa(r,t,i,fo(e)),e.options.lineWrapping||(r.iter(Y,S.line+t.text.length,function(ye){var ke=pn(ye);ke>n.maxLineLength&&(n.maxLine=ye,n.maxLineLength=ke,n.maxLineChanged=!0,K=!1)}),K&&(e.curOp.updateMaxLine=!0)),Qr(r,S.line),An(e,400);var q=t.text.length-(N.line-S.line)-1;t.full?wr(e):S.line==N.line&&t.text.length==1&&!Oo(e.doc,t)?Si(e,S.line,"text"):wr(e,S.line,N.line+1,q);var ae=de(e,"changes"),ue=de(e,"change");if(ue||ae){var be={from:S,to:N,text:t.text,removed:t.removed,origin:t.origin};ue&&cr(e,"change",e,be),ae&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(be)}e.display.selForContextMenu=null}function rn(e,t,i,r,n){var S;r||(r=i),Ct(r,i)<0&&(S=[r,i],i=S[0],r=S[1]),typeof t=="string"&&(t=e.splitLines(t)),tn(e,{from:i,to:r,text:t,origin:n})}function Zo(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function qo(e,t,i,r){for(var n=0;n<e.length;++n){var S=e[n],N=!0;if(S.ranges){S.copied||(S=e[n]=S.deepCopy(),S.copied=!0);for(var K=0;K<S.ranges.length;K++)Zo(S.ranges[K].anchor,t,i,r),Zo(S.ranges[K].head,t,i,r);continue}for(var Y=0;Y<S.changes.length;++Y){var q=S.changes[Y];if(i<q.from.line)q.from=je(q.from.line+r,q.from.ch),q.to=je(q.to.line+r,q.to.ch);else if(t<=q.to.line){N=!1;break}}N||(e.splice(0,n+1),n=0)}}function $o(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;qo(e.done,i,r,n),qo(e.undone,i,r,n)}function Ln(e,t,i,r){var n=t,S=t;return typeof t=="number"?S=ct(e,W(e,t)):n=Lt(t),n==null?null:(r(S,n)&&e.cm&&Si(e.cm,n,i),S)}function Rn(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}Rn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,mt(n),cr(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function kn(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}kn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var S=Math.min(t,n-e),N=r.height;if(r.removeInner(e,S),this.height-=N-r.height,n==S&&(this.children.splice(i--,1),r.parent=null),(t-=S)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Rn))){var K=[];this.collapse(K),this.children=[new Rn(K)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],S=n.chunkSize();if(e<=S){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var N=n.lines.length%25+25,K=N;K<n.lines.length;){var Y=new Rn(n.lines.slice(K,K+=25));n.height-=Y.height,this.children.splice(++r,0,Y),Y.parent=this}n.lines=n.lines.slice(0,N),this.maybeSpill()}break}e-=S}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new kn(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=le(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new kn(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],S=n.chunkSize();if(e<S){var N=Math.min(t,S-e);if(n.iterN(e,N,i))return!0;if((t-=N)==0)break;e=0}else e-=S}}};var In=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};In.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=Lt(i);if(r==null||!t)return;for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var S=vn(this);mr(i,Math.max(0,i.height-S)),e&&(Or(e,function(){es(e,i,-S),Si(e,r,"widget")}),cr(e,"lineWidgetCleared",e,this,r))},In.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=vn(this)-t;if(!n)return;ri(this.doc,r)||mr(r,r.height+n),i&&Or(i,function(){i.curOp.forceUpdate=!0,es(i,r,n),cr(i,"lineWidgetChanged",i,e,Lt(r))})},fe(In);function es(e,t,i){Xr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ta(e,i)}function xl(e,t,i,r){var n=new In(e,i,r),S=e.cm;return S&&n.noHScroll&&(S.display.alignWidgets=!0),Ln(e,t,"widget",function(N){var K=N.widgets||(N.widgets=[]);if(n.insertAt==null?K.push(n):K.splice(Math.min(K.length-1,Math.max(0,n.insertAt)),0,n),n.line=N,S&&!ri(e,N)){var Y=Xr(N)<e.scrollTop;mr(N,N.height+vn(n)),Y&&Ta(S,n.height),S.curOp.forceUpdate=!0}return!0}),S&&cr(S,"lineWidgetAdded",S,n,typeof t=="number"?t:Lt(t)),n}var ts=0,Li=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};Li.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Wi(e),de(this,"clear")){var i=this.find();i&&cr(this,"clear",i.from,i.to)}for(var r=null,n=null,S=0;S<this.lines.length;++S){var N=this.lines[S],K=Mr(N.markedSpans,this);e&&!this.collapsed?Si(e,Lt(N),"text"):e&&(K.to!=null&&(n=Lt(N)),K.from!=null&&(r=Lt(N))),N.markedSpans=Mi(N.markedSpans,K),K.from==null&&this.collapsed&&!ri(this.doc,N)&&e&&mr(N,Yi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Y=0;Y<this.lines.length;++Y){var q=xr(this.lines[Y]),ae=pn(q);ae>e.display.maxLineLength&&(e.display.maxLine=q,e.display.maxLineLength=ae,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&wr(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&zo(e.doc)),e&&cr(e,"markerCleared",e,this,r,n),t&&ji(e),this.parent&&this.parent.clear()},Li.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var S=this.lines[n],N=Mr(S.markedSpans,this);if(N.from!=null&&(i=je(t?S:Lt(S),N.from),e==-1))return i;if(N.to!=null&&(r=je(t?S:Lt(S),N.to),e==1))return r}return i&&{from:i,to:r}},Li.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;if(!t||!r)return;Or(r,function(){var n=t.line,S=Lt(t.line),N=fa(r,S);if(N&&(no(N),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ri(i.doc,n)&&i.height!=null){var K=i.height;i.height=null;var Y=vn(i)-K;Y&&mr(n,n.height+Y)}cr(r,"markerChanged",r,e)})},Li.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||le(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Li.prototype.detachLine=function(e){if(this.lines.splice(le(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},fe(Li);function nn(e,t,i,r,n){if(r&&r.shared)return Cl(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return or(e.cm,nn)(e,t,i,r,n);var S=new Li(e,n),N=Ct(t,i);if(r&&F(r,S,!1),N>0||N==0&&S.clearWhenEmpty!==!1)return S;if(S.replacedWith&&(S.collapsed=!0,S.widgetNode=b("span",[S.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||S.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(S.widgetNode.insertLeft=!0)),S.collapsed){if(ar(e,t.line,t,i,S)||t.line!=i.line&&ar(e,i.line,t,i,S))throw new Error("Inserting collapsed marker partially overlapping an existing one");oi()}S.addToHistory&&No(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var K=t.line,Y=e.cm,q;if(e.iter(K,i.line+1,function(ue){Y&&S.collapsed&&!Y.options.lineWrapping&&xr(ue)==Y.display.maxLine&&(q=!0),S.collapsed&&K!=t.line&&mr(ue,0),yi(ue,new si(S,K==t.line?t.ch:null,K==i.line?i.ch:null)),++K}),S.collapsed&&e.iter(t.line,i.line+1,function(ue){ri(e,ue)&&mr(ue,0)}),S.clearOnEnter&&Ee(S,"beforeCursorEnter",function(){return S.clear()}),S.readOnly&&(Fr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),S.collapsed&&(S.id=++ts,S.atomic=!0),Y){if(q&&(Y.curOp.updateMaxLine=!0),S.collapsed)wr(Y,t.line,i.line+1);else if(S.className||S.startStyle||S.endStyle||S.css||S.attributes||S.title)for(var ae=t.line;ae<=i.line;ae++)Si(Y,ae,"text");S.atomic&&zo(Y.doc),cr(Y,"markerAdded",Y,S)}return S}var Mn=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Mn.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();cr(this,"clear")},Mn.prototype.find=function(e,t){return this.primary.find(e,t)},fe(Mn);function Cl(e,t,i,r,n){r=F(r),r.shared=!1;var S=[nn(e,t,i,r,n)],N=S[0],K=r.widgetNode;return Di(e,function(Y){K&&(r.widgetNode=K.cloneNode(!0)),S.push(nn(Y,s(Y,t),s(Y,i),r,n));for(var q=0;q<Y.linked.length;++q)if(Y.linked[q].isParent)return;N=De(S)}),new Mn(S,N)}function rs(e){return e.findMarks(je(e.first,0),e.clipPos(je(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),S=e.clipPos(n.from),N=e.clipPos(n.to);if(Ct(S,N)){var K=nn(e,S,N,r.primary,r.primary.type);r.markers.push(K),K.parent=r}}}function Al(e){for(var t=function(r){var n=e[r],S=[n.primary.doc];Di(n.primary.doc,function(Y){return S.push(Y)});for(var N=0;N<n.markers.length;N++){var K=n.markers[N];le(S,K.doc)==-1&&(K.parent=null,n.markers.splice(N--,1))}},i=0;i<e.length;i++)t(i)}var Tl=0,Dr=function(e,t,i,r,n){if(!(this instanceof Dr))return new Dr(e,t,i,r,n);i==null&&(i=0),kn.call(this,[new Rn([new Oi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var S=je(i,0);this.sel=Ti(S),this.history=new Jn(null),this.id=++Tl,this.modeOption=t,this.lineSep=r,this.direction=n=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Oa(this,{from:S,to:S,text:e}),br(this,Ti(S),xe)};Dr.prototype=et(kn.prototype,{constructor:Dr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ei(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:sr(function(e){var t=je(this.first,0),i=this.first+this.size-1;tn(this,{from:t,to:je(i,ct(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&En(this.cm,0,0),br(this,Ti(t),xe)}),replaceRange:function(e,t,i,r){t=s(this,t),i=i?s(this,i):t,rn(this,e,t,i,r)},getRange:function(e,t,i){var r=Hr(this,s(this,e),s(this,t));return i===!1?r:r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Vr(this,e))return ct(this,e)},getLineNumber:function(e){return Lt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),xr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return s(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:sr(function(e,t,i){jo(this,s(this,typeof e=="number"?je(e,t||0):e),null,i)}),setSelection:sr(function(e,t,i){jo(this,s(this,e),s(this,t||e),i)}),extendSelection:sr(function(e,t,i){qn(this,s(this,e),t&&s(this,t),i)}),extendSelections:sr(function(e,t){Wo(this,I(this,e),t)}),extendSelectionsBy:sr(function(e,t){var i=Ye(this.sel.ranges,e);Wo(this,I(this,i),t)}),setSelections:sr(function(e,t,i){if(!e.length)return;for(var r=[],n=0;n<e.length;n++)r[n]=new Wt(s(this,e[n].anchor),s(this,e[n].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),br(this,Zr(this.cm,r,t),i)}),addSelection:sr(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new Wt(s(this,e),s(this,t||e))),br(this,Zr(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var n=Hr(this,t[r].from(),t[r].to());i=i?i.concat(n):n}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=Hr(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:sr(function(e,t,i){for(var r=[],n=this.sel,S=0;S<n.ranges.length;S++){var N=n.ranges[S];r[S]={from:N.from(),to:N.to(),text:this.splitLines(e[S]),origin:i}}for(var K=t&&t!="end"&&cl(this,r,t),Y=r.length-1;Y>=0;Y--)tn(this,r[Y]);K?Ho(this,K):this.cm&&Zi(this.cm)}),undo:sr(function(){ta(this,"undo")}),redo:sr(function(){ta(this,"redo")}),undoSelection:sr(function(){ta(this,"undo",!0)}),redoSelection:sr(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Jn(this.history.maxGeneration),Di(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:$i(this.history.done),undone:$i(this.history.undone)}},setHistory:function(e){var t=this.history=new Jn(this.history.maxGeneration);t.done=$i(e.done.slice(0),null,!0),t.undone=$i(e.undone.slice(0),null,!0)},setGutterMarker:sr(function(e,t,i){return Ln(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&Xe(n)&&(r.gutterMarkers=null),!0})}),clearGutter:sr(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Ln(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Xe(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Vr(this,e))return null;if(t=e,e=ct(this,e),!e)return null}else if(t=Lt(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:sr(function(e,t,i){return Ln(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(E(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:sr(function(e,t,i){return Ln(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",S=r[n];if(S)if(i==null)r[n]=null;else{var N=S.match(E(i));if(!N)return!1;var K=N.index+N[0].length;r[n]=S.slice(0,N.index)+(!N.index||K==S.length?"":" ")+S.slice(K)||null}else return!1;return!0})}),addLineWidget:sr(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return nn(this,s(this,e),s(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=s(this,e),nn(this,e,e,i,"bookmark")},findMarksAt:function(e){e=s(this,e);var t=[],i=ct(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=s(this,e),t=s(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(S){var N=S.markedSpans;if(N)for(var K=0;K<N.length;K++){var Y=N[K];!(Y.to!=null&&n==e.line&&e.ch>=Y.to||Y.from==null&&n!=e.line||Y.from!=null&&n==t.line&&Y.from>=t.ch)&&(!i||i(Y.marker))&&r.push(Y.marker.parent||Y.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var S=n.text.length+r;if(S>e)return t=e,!0;e-=S,++i}),s(this,je(i,t))},indexFromPos:function(e){e=s(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new Dr(ei(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new Dr(ei(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(r,rs(this)),r},unlinkDoc:function(e){if(e instanceof Vt&&(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),Al(rs(this));break}if(e.history==this.history){var r=[e.id];Di(e,function(n){return r.push(n.id)},!0),e.history=new Jn(null),e.history.done=$i(this.history.done,r),e.history.undone=$i(this.history.undone,r)}},iterLinkedDocs:function(e){Di(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):St(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:sr(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)})}),Dr.prototype.eachLine=Dr.prototype.iter;var is=0;function wl(e){var t=this;if(ns(t),We(t,e)||ui(t.display,e))return;te(e),G&&(is=+new Date);var i=Bi(t,e,!0),r=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,S=Array(n),N=0,K=function(){++N==n&&or(t,function(){i=s(t.doc,i);var ye={from:i,to:i,text:t.doc.splitLines(S.filter(function(ke){return ke!=null}).join(t.doc.lineSeparator())),origin:"paste"};tn(t.doc,ye),Ho(t.doc,Ti(s(t.doc,i),s(t.doc,wi(ye))))})()},Y=function(ye,ke){if(t.options.allowDropFileTypes&&le(t.options.allowDropFileTypes,ye.type)==-1){K();return}var Ue=new FileReader;Ue.onerror=function(){return K()},Ue.onload=function(){var ze=Ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ze)){K();return}S[ke]=ze,K()},Ue.readAsText(ye)},q=0;q<r.length;q++)Y(r[q],q);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 ae=e.dataTransfer.getData("Text");if(ae){var ue;if(t.state.draggingText&&!t.state.draggingText.copy&&(ue=t.listSelections()),$n(t.doc,Ti(i,i)),ue)for(var be=0;be<ue.length;++be)rn(t.doc,"",ue[be].anchor,ue[be].head,"drag");t.replaceSelection(ae,"around","paste"),t.display.input.focus()}}catch(ye){}}}function Dl(e,t){if(G&&(!e.state.draggingText||+new Date-is<100)){he(t);return}if(We(e,t)||ui(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!k){var i=a("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",T&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),T&&i.parentNode.removeChild(i)}}function Ll(e,t){var i=Bi(e,t);if(!i)return;var r=document.createDocumentFragment();go(e,i,r),e.display.dragCursor||(e.display.dragCursor=a("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),u(e.display.dragCursor,r)}function ns(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function as(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var S=0;S<i.length;S++)e(i[S])})}var os=!1;function Rl(){if(os)return;kl(),os=!0}function kl(){var e;Ee(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Il)},100))}),Ee(window,"blur",function(){return as(Ji)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ri={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"},On=0;On<10;On++)Ri[On+48]=Ri[On+96]=String(On);for(var ra=65;ra<=90;ra++)Ri[ra]=String.fromCharCode(ra);for(var Pn=1;Pn<=12;Pn++)Ri[Pn+111]=Ri[Pn+63235]="F"+Pn;var hi={};hi.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"},hi.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"},hi.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"},hi.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"]},hi.default=l?hi.macDefault:hi.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,S,N=0;N<t.length-1;N++){var K=t[N];if(/^(cmd|meta|m)$/i.test(K))S=!0;else if(/^a(lt)?$/i.test(K))i=!0;else if(/^(c|ctrl|control)$/i.test(K))r=!0;else if(/^s(hift)?$/i.test(K))n=!0;else throw new Error("Unrecognized modifier name: "+K)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),S&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Ol(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var n=Ye(i.split(" "),Ml),S=0;S<n.length;S++){var N=void 0,K=void 0;S==n.length-1?(K=n.join(" "),N=r):(K=n.slice(0,S+1).join(" "),N="...");var Y=t[K];if(!Y)t[K]=N;else if(Y!=N)throw new Error("Inconsistent bindings for "+K)}delete e[i]}for(var q in t)e[q]=t[q];return e}function an(e,t,i,r){t=ia(t);var n=t.call?t.call(e,r):t[e];if(n===!1)return"nothing";if(n==="...")return"multi";if(n!=null&&i(n))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return an(e,t.fallthrough,i,r);for(var S=0;S<t.fallthrough.length;S++){var N=an(e,t.fallthrough[S],i,r);if(N)return N}}}function ss(e){var t=typeof e=="string"?e:Ri[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ls(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(g?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(g?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(T&&e.keyCode==34&&e.char)return!1;var i=Ri[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),ls(i,e,t))}function ia(e){return typeof e=="string"?hi[e]:e}function on(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var S=t(i[n]);r.length&&Ct(S.from,De(r).to)<=0;){var N=r.pop();if(Ct(N.from,S.from)<0){S.from=N.from;break}}r.push(S)}Or(e,function(){for(var K=r.length-1;K>=0;K--)rn(e.doc,"",r[K].from,r[K].to,"+delete");Zi(e)})}function Na(e,t,i){var r=Pe(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Ua(e,t,i){var r=Na(e,t.ch,i);return r==null?null:new je(t.line,r,i<0?"after":"before")}function Fa(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var S=rt(i,t.doc.direction);if(S){var N=n<0?De(S):S[0],K=n<0==(N.level==1),Y=K?"after":"before",q;if(N.level>0||t.doc.direction=="rtl"){var ae=Qi(t,i);q=n<0?i.text.length-1:0;var ue=ni(t,ae,q).top;q=ot(function(be){return ni(t,ae,be).top==ue},n<0==(N.level==1)?N.from:N.to-1,q),Y=="before"&&(q=Na(i,q,1))}else q=n<0?N.to:N.from;return new je(r,q,Y)}}return new je(r,n<0?i.text.length:0,n<0?"before":"after")}function Pl(e,t,i,r){var n=rt(t,e.doc.direction);if(!n)return Ua(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var S=tt(n,i.ch,i.sticky),N=n[S];if(e.doc.direction=="ltr"&&N.level%2==0&&(r>0?N.to>i.ch:N.from<i.ch))return Ua(t,i,r);var K=function(nt,lt){return Na(t,nt instanceof je?nt.ch:nt,lt)},Y,q=function(nt){return e.options.lineWrapping?(Y=Y||Qi(e,t),co(e,t,Y,nt)):{begin:0,end:t.text.length}},ae=q(i.sticky=="before"?K(i,-1):i.ch);if(e.doc.direction=="rtl"||N.level==1){var ue=N.level==1==r<0,be=K(i,ue?1:-1);if(be!=null&&(ue?be<=N.to&&be<=ae.end:be>=N.from&&be>=ae.begin)){var ye=ue?"before":"after";return new je(i.line,be,ye)}}var ke=function(nt,lt,at){for(var ut=function(zt,lr){return lr?new je(i.line,K(zt,1),"before"):new je(i.line,zt,"after")};nt>=0&&nt<n.length;nt+=lt){var xt=n[nt],vt=lt>0==(xt.level!=1),wt=vt?at.begin:K(at.end,-1);if(xt.from<=wt&&wt<xt.to)return ut(wt,vt);if(wt=vt?xt.from:K(xt.to,-1),at.begin<=wt&&wt<at.end)return ut(wt,vt)}},Ue=ke(S+r,r,ae);if(Ue)return Ue;var ze=r>0?ae.end:K(ae.begin,-1);return ze!=null&&!(r>0&&ze==t.text.length)&&(Ue=ke(r>0?0:n.length-1,r,q(ze)),Ue)?Ue:null}var _n={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return on(e,function(t){if(t.empty()){var i=ct(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:je(t.head.line+1,0)}:{from:t.head,to:je(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return on(e,function(t){return{from:je(t.from().line,0),to:s(e.doc,je(t.to().line+1,0))}})},delLineLeft:function(e){return on(e,function(t){return{from:je(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return on(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return on(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(je(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(je(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return hs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return _l(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")},Te)},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")},Te)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?ds(e,t.head):r},Te)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var S=i[n].from(),N=ee(e.getLine(S.line),S.ch,r);t.push(se(r-N%r))}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=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var n=t[r].head,S=ct(e.doc,n.line).text;if(S){if(n.ch==S.length&&(n=new je(n.line,n.ch-1)),n.ch>0)n=new je(n.line,n.ch+1),e.replaceRange(S.charAt(n.ch-1)+S.charAt(n.ch-2),je(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var N=ct(e.doc,n.line-1).text;N&&(n=new je(n.line,1),e.replaceRange(S.charAt(0)+e.doc.lineSeparator()+N.charAt(N.length-1),je(n.line-1,N.length-1),n,"+transpose"))}}i.push(new Wt(n,n))}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 r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Zi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function hs(e,t){var i=ct(e.doc,t),r=xr(i);return r!=i&&(t=Lt(r)),Fa(!0,e,r,t,1)}function _l(e,t){var i=ct(e.doc,t),r=Vi(i);return r!=i&&(t=Lt(r)),Fa(!0,e,i,t,-1)}function ds(e,t){var i=hs(e,t.line),r=ct(e.doc,i.line),n=rt(r,e.doc.direction);if(!n||n[0].level==0){var S=Math.max(i.ch,r.text.search(/\S/)),N=t.line==i.line&&t.ch<=S&&t.ch;return je(i.line,N?0:S,i.sticky)}return i}function na(e,t,i){if(typeof t=="string"&&(t=_n[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=Ie}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}function Bl(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=an(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&an(t,e.options.extraKeys,i,e)||an(t,e.options.keyMap,i,e)}var Nl=new oe;function Bn(e,t,i,r){var n=e.state.keySeq;if(n){if(ss(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Nl.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),cs(e,n+" "+t,i,r))return!0}return cs(e,t,i,r)}function cs(e,t,i,r){var n=Bl(e,t,r);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&cr(e,"keyHandled",e,t,i),(n=="handled"||n=="multi")&&(te(i),Ca(e)),!!n}function fs(e,t){var i=us(t,!0);return i?t.shiftKey&&!e.state.keySeq?Bn(e,"Shift-"+i,t,function(r){return na(e,r,!0)})||Bn(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return na(e,r)}):Bn(e,i,t,function(r){return na(e,r)}):!1}function Ul(e,t,i){return Bn(e,"'"+i+"'",t,function(r){return na(e,r,!0)})}var Wa=null;function ps(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),We(t,e))return;G&&j<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=fs(t,e);T&&(Wa=r?i:null,!r&&i==88&&!Ut&&(l?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),R&&!l&&!r&&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;H(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(m(t,"CodeMirror-crosshair"),qe(document,"keyup",i),qe(document,"mouseover",i))}Ee(document,"keyup",i),Ee(document,"mouseover",i)}function ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ui(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||l&&e.metaKey)return;var i=e.keyCode,r=e.charCode;if(T&&i==Wa){Wa=null,te(e);return}if(T&&(!e.which||e.which<10)&&fs(t,e))return;var n=String.fromCharCode(r==null?i:r);if(n=="\b")return;if(Ul(t,e,n))return;t.display.input.onKeyPress(e)}var Wl=400,ja=function(e,t,i){this.time=e,this.pos=t,this.button=i};ja.prototype.compare=function(e,t,i){return this.time+Wl>e&&Ct(t,this.pos)==0&&i==this.button};var Nn,Un;function jl(e,t){var i=+new Date;return Un&&Un.compare(i,e,t)?(Nn=Un=null,"triple"):Nn&&Nn.compare(i,e,t)?(Un=new ja(i,e,t),Nn=null,"double"):(Nn=new ja(i,e,t),Un=null,"single")}function vs(e){var t=this,i=t.display;if(We(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,ui(i,e)){O||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Ha(t,e))return;var r=Bi(t,e),n=Ae(e),S=r?jl(r,n):"single";if(window.focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,n,r,S,e))return;n==1?r?zl(t,r,S,e):me(e)==i.scroller&&te(e):n==2?(r&&qn(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(L?t.display.input.onContextMenu(e):yo(t))}function Hl(e,t,i,r,n){var S="Click";return r=="double"?S="Double"+S:r=="triple"&&(S="Triple"+S),S=(t==1?"Left":t==2?"Middle":"Right")+S,Bn(e,ls(S,n),n,function(N){if(typeof N=="string"&&(N=_n[N]),!N)return!1;var K=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),K=N(e,i)!=Ie}finally{e.state.suppressEdits=!1}return K})}function Gl(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var S=d?i.shiftKey&&i.metaKey:i.altKey;n.unit=S?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=l?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(l?i.altKey:i.ctrlKey)),n}function zl(e,t,i,r){G?setTimeout(z(vo,e),0):e.curOp.focus=P();var n=Gl(e,i,r),S=e.doc.sel,N;e.options.dragDrop&&_e&&!e.isReadOnly()&&i=="single"&&(N=S.contains(t))>-1&&(Ct((N=S.ranges[N]).from(),t)<0||t.xRel>0)&&(Ct(N.to(),t)>0||t.xRel<0)?Kl(e,r,t,n):Vl(e,r,t,n)}function Kl(e,t,i,r){var n=e.display,S=!1,N=or(e,function(q){O&&(n.scroller.draggable=!1),e.state.draggingText=!1,qe(n.wrapper.ownerDocument,"mouseup",N),qe(n.wrapper.ownerDocument,"mousemove",K),qe(n.scroller,"dragstart",Y),qe(n.scroller,"drop",N),S||(te(q),r.addNew||qn(e.doc,i,null,null,r.extend),O&&!k||G&&j==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),K=function(q){S=S||Math.abs(t.clientX-q.clientX)+Math.abs(t.clientY-q.clientY)>=10},Y=function(){return S=!0};O&&(n.scroller.draggable=!0),e.state.draggingText=N,N.copy=!r.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),Ee(n.wrapper.ownerDocument,"mouseup",N),Ee(n.wrapper.ownerDocument,"mousemove",K),Ee(n.scroller,"dragstart",Y),Ee(n.scroller,"drop",N),yo(e),setTimeout(function(){return n.input.focus()},20)}function ys(e,t,i){if(i=="char")return new Wt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Wt(je(t.line,0),s(e.doc,je(t.line+1,0)));var r=i(e,t);return new Wt(r.from,r.to)}function Vl(e,t,i,r){var n=e.display,S=e.doc;te(t);var N,K,Y=S.sel,q=Y.ranges;if(r.addNew&&!r.extend?(K=S.sel.contains(i),K>-1?N=q[K]:N=new Wt(i,i)):(N=S.sel.primary(),K=S.sel.primIndex),r.unit=="rectangle")r.addNew||(N=new Wt(i,i)),i=Bi(e,t,!0,!0),K=-1;else{var ae=ys(e,i,r.unit);r.extend?N=_a(N,ae.anchor,ae.head,r.extend):N=ae}r.addNew?K==-1?(K=q.length,br(S,Zr(e,q.concat([N]),K),{scroll:!1,origin:"*mouse"})):q.length>1&&q[K].empty()&&r.unit=="char"&&!r.extend?(br(S,Zr(e,q.slice(0,K).concat(q.slice(K+1)),0),{scroll:!1,origin:"*mouse"}),Y=S.sel):Ba(S,K,N,Ce):(K=0,br(S,new jr([N],0),Ce),Y=S.sel);var ue=i;function be(at){if(Ct(ue,at)==0)return;if(ue=at,r.unit=="rectangle"){for(var ut=[],xt=e.options.tabSize,vt=ee(ct(S,i.line).text,i.ch,xt),wt=ee(ct(S,at.line).text,at.ch,xt),zt=Math.min(vt,wt),lr=Math.max(vt,wt),Yt=Math.min(i.line,at.line),Pr=Math.min(e.lastLine(),Math.max(i.line,at.line));Yt<=Pr;Yt++){var Lr=ct(S,Yt).text,er=Se(Lr,zt,xt);zt==lr?ut.push(new Wt(je(Yt,er),je(Yt,er))):Lr.length>er&&ut.push(new Wt(je(Yt,er),je(Yt,Se(Lr,lr,xt))))}ut.length||ut.push(new Wt(i,i)),br(S,Zr(e,Y.ranges.slice(0,K).concat(ut),K),{origin:"*mouse",scroll:!1}),e.scrollIntoView(at)}else{var Rr=N,fr=ys(e,at,r.unit),ir=Rr.anchor,tr;Ct(fr.anchor,ir)>0?(tr=fr.head,ir=vi(Rr.from(),fr.anchor)):(tr=fr.anchor,ir=gi(Rr.to(),fr.head));var Xt=Y.ranges.slice(0);Xt[K]=Ql(e,new Wt(s(S,ir),tr)),br(S,Zr(e,Xt,K),Ce)}}var ye=n.wrapper.getBoundingClientRect(),ke=0;function Ue(at){var ut=++ke,xt=Bi(e,at,!0,r.unit=="rectangle");if(!xt)return;if(Ct(xt,ue)!=0){e.curOp.focus=P(),be(xt);var vt=Vn(n,S);(xt.line>=vt.to||xt.line<vt.from)&&setTimeout(or(e,function(){ke==ut&&Ue(at)}),150)}else{var wt=at.clientY<ye.top?-20:at.clientY>ye.bottom?20:0;wt&&setTimeout(or(e,function(){if(ke!=ut)return;n.scroller.scrollTop+=wt,Ue(at)}),50)}}function ze(at){e.state.selectingText=!1,ke=Infinity,at&&(te(at),n.input.focus()),qe(n.wrapper.ownerDocument,"mousemove",nt),qe(n.wrapper.ownerDocument,"mouseup",lt),S.history.lastSelOrigin=null}var nt=or(e,function(at){at.buttons===0||!Ae(at)?ze(at):Ue(at)}),lt=or(e,ze);e.state.selectingText=lt,Ee(n.wrapper.ownerDocument,"mousemove",nt),Ee(n.wrapper.ownerDocument,"mouseup",lt)}function Ql(e,t){var i=t.anchor,r=t.head,n=ct(e.doc,i.line);if(Ct(i,r)==0&&i.sticky==r.sticky)return t;var S=rt(n);if(!S)return t;var N=tt(S,i.ch,i.sticky),K=S[N];if(K.from!=i.ch&&K.to!=i.ch)return t;var Y=N+(K.from==i.ch==(K.level!=1)?0:1);if(Y==0||Y==S.length)return t;var q;if(r.line!=i.line)q=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ae=tt(S,r.ch,r.sticky),ue=ae-N||(r.ch-i.ch)*(K.level==1?-1:1);ae==Y-1||ae==Y?q=ue<0:q=ue>0}var be=S[Y+(q?-1:0)],ye=q==(be.level==1),ke=ye?be.from:be.to,Ue=ye?"after":"before";return i.ch==ke&&i.sticky==Ue?t:new Wt(new je(i.line,ke,Ue),r)}function bs(e,t,i,r){var n,S;if(t.touches)n=t.touches[0].clientX,S=t.touches[0].clientY;else try{n=t.clientX,S=t.clientY}catch(be){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&te(t);var N=e.display,K=N.lineDiv.getBoundingClientRect();if(S>K.bottom||!de(e,i))return ne(t);S-=K.top-N.viewOffset;for(var Y=0;Y<e.display.gutterSpecs.length;++Y){var q=N.gutters.childNodes[Y];if(q&&q.getBoundingClientRect().right>=n){var ae=Ur(e.doc,S),ue=e.display.gutterSpecs[Y];return we(e,i,e,ae,ue.className,t),ne(t)}}}function Ha(e,t){return bs(e,t,"gutterClick",!0)}function Es(e,t){if(ui(e.display,t)||Yl(e,t))return;if(We(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return de(e,"gutterContextMenu")?bs(e,t,"gutterContextMenu",!1):!1}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yn(e)}var sn={toString:function(){return"CodeMirror.Init"}},Cs={},aa={};function Xl(e){var t=e.optionHandlers;function i(r,n,S,N){e.defaults[r]=n,S&&(t[r]=N?function(K,Y,q){q!=sn&&S(K,Y,q)}:S)}e.defineOption=i,e.Init=sn,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Ma(r)},!0),i("indentUnit",2,Ma,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){wn(r),yn(r),wr(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!n)return;var S=[],N=r.doc.first;r.doc.iter(function(Y){for(var q=0;;){var ae=Y.text.indexOf(n,q);if(ae==-1)break;q=ae+n.length,S.push(je(N,ae))}N++});for(var K=S.length-1;K>=0;K--)rn(r.doc,n,S[K],je(S[K].line,S[K].ch+n.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,n,S){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),S!=sn&&r.refresh()}),i("specialCharPlaceholder",Gt,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!A),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){xs(r),Tn(r)},!0),i("keyMap","default",function(r,n,S){var N=ia(n),K=S!=sn&&ia(S);K&&K.detach&&K.detach(r,N),N.attach&&N.attach(r,K||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=ka(n,r.options.lineNumbers),Tn(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?Ea(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return qi(r)},!0),i("scrollbarStyle","native",function(r){Ao(r),qi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=ka(r.options.gutters,n),Tn(r)},!0),i("firstLineNumber",1,Tn,!0),i("lineNumberFormatter",function(r){return r},Tn,!0),i("showCursorWhenSelecting",!1,bn,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Ji(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,bn,!0),i("singleCursorHeightPerLine",!0,bn,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,wn,!0),i("addModeClass",!1,wn,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,wn,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Jl(e,t,i){var r=i&&i!=sn;if(!t!=!r){var n=e.display.dragFunctions,S=t?Ee:qe;S(e.display.scroller,"dragstart",n.start),S(e.display.scroller,"dragenter",n.enter),S(e.display.scroller,"dragover",n.over),S(e.display.scroller,"dragleave",n.leave),S(e.display.scroller,"drop",n.drop)}}function Zl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(m(e.display.wrapper,"CodeMirror-wrap"),Wn(e)),xa(e),wr(e),yn(e),setTimeout(function(){return qi(e)},100)}function Vt(e,t){var i=this;if(!(this instanceof Vt))return new Vt(e,t);this.options=t=t?F(t):{},F(Cs,t,!1);var r=t.value;typeof r=="string"?r=new Dr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Vt.inputStyles[t.inputStyle](this),S=this.display=new hl(e,r,n,t);S.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ao(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 oe,keySeq:null,specialChars:null},t.autofocus&&!o&&S.input.focus(),G&&j<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Rl(),Wi(this),this.curOp.forceUpdate=!0,Po(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Sa(i)},20):Ji(this);for(var N in aa)aa.hasOwnProperty(N)&&aa[N](this,t[N],sn);Do(this),t.finishInit&&t.finishInit(this);for(var K=0;K<Ga.length;++K)Ga[K](this);ji(this),O&&t.lineWrapping&&getComputedStyle(S.lineDiv).textRendering=="optimizelegibility"&&(S.lineDiv.style.textRendering="auto")}Vt.defaults=Cs,Vt.optionHandlers=aa;function ql(e){var t=e.display;Ee(t.scroller,"mousedown",or(e,vs)),G&&j<11?Ee(t.scroller,"dblclick",or(e,function(Y){if(We(e,Y))return;var q=Bi(e,Y);if(!q||Ha(e,Y)||ui(e.display,Y))return;te(Y);var ae=e.findWordAt(q);qn(e.doc,ae.anchor,ae.head)})):Ee(t.scroller,"dblclick",function(Y){return We(e,Y)||te(Y)}),Ee(t.scroller,"contextmenu",function(Y){return Es(e,Y)}),Ee(t.input.getField(),"contextmenu",function(Y){t.scroller.contains(Y.target)||Es(e,Y)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function S(Y){if(Y.touches.length!=1)return!1;var q=Y.touches[0];return q.radiusX<=1&&q.radiusY<=1}function N(Y,q){if(q.left==null)return!0;var ae=q.left-Y.left,ue=q.top-Y.top;return ae*ae+ue*ue>20*20}Ee(t.scroller,"touchstart",function(Y){if(!We(e,Y)&&!S(Y)&&!Ha(e,Y)){t.input.ensurePolled(),clearTimeout(i);var q=+new Date;t.activeTouch={start:q,moved:!1,prev:q-r.end<=300?r:null},Y.touches.length==1&&(t.activeTouch.left=Y.touches[0].pageX,t.activeTouch.top=Y.touches[0].pageY)}}),Ee(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ee(t.scroller,"touchend",function(Y){var q=t.activeTouch;if(q&&!ui(t,Y)&&q.left!=null&&!q.moved&&new Date-q.start<300){var ae=e.coordsChar(t.activeTouch,"page"),ue;!q.prev||N(q,q.prev)?ue=new Wt(ae,ae):!q.prev.prev||N(q,q.prev.prev)?ue=e.findWordAt(ae):ue=new Wt(je(ae.line,0),s(e.doc,je(ae.line+1,0))),e.setSelection(ue.anchor,ue.head),e.focus(),te(Y)}n()}),Ee(t.scroller,"touchcancel",n),Ee(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xn(e,t.scroller.scrollTop),Ui(e,t.scroller.scrollLeft,!0),we(e,"scroll",e))}),Ee(t.scroller,"mousewheel",function(Y){return ko(e,Y)}),Ee(t.scroller,"DOMMouseScroll",function(Y){return ko(e,Y)}),Ee(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Y){We(e,Y)||he(Y)},over:function(Y){We(e,Y)||(Ll(e,Y),he(Y))},start:function(Y){return Dl(e,Y)},drop:or(e,wl),leave:function(Y){We(e,Y)||ns(e)}};var K=t.input.getField();Ee(K,"keyup",function(Y){return ms.call(e,Y)}),Ee(K,"keydown",or(e,ps)),Ee(K,"keypress",or(e,gs)),Ee(K,"focus",function(Y){return Sa(e,Y)}),Ee(K,"blur",function(Y){return Ji(e,Y)})}var Ga=[];Vt.defineInitHook=function(e){return Ga.push(e)};function Fn(e,t,i,r){var n=e.doc,S;i==null&&(i="add"),i=="smart"&&(n.mode.indent?S=Qe(e,t).state:i="prev");var N=e.options.tabSize,K=ct(n,t),Y=ee(K.text,null,N);K.stateAfter&&(K.stateAfter=null);var q=K.text.match(/^\s*/)[0],ae;if(!r&&!/\S/.test(K.text))ae=0,i="not";else if(i=="smart"&&(ae=n.mode.indent(S,K.text.slice(q.length),K.text),ae==Ie||ae>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?ae=ee(ct(n,t-1).text,null,N):ae=0:i=="add"?ae=Y+e.options.indentUnit:i=="subtract"?ae=Y-e.options.indentUnit:typeof i=="number"&&(ae=Y+i),ae=Math.max(0,ae);var ue="",be=0;if(e.options.indentWithTabs)for(var ye=Math.floor(ae/N);ye;--ye)be+=N,ue+=" ";if(be<ae&&(ue+=se(ae-be)),ue!=q)return rn(n,ue,je(t,0),je(t,q.length),"+input"),K.stateAfter=null,!0;for(var ke=0;ke<n.sel.ranges.length;ke++){var Ue=n.sel.ranges[ke];if(Ue.head.line==t&&Ue.head.ch<q.length){var ze=je(t,q.length);Ba(n,ke,new Wt(ze,ze));break}}}var qr=null;function oa(e){qr=e}function za(e,t,i,r,n){var S=e.doc;e.display.shift=!1,r||(r=S.sel);var N=+new Date-200,K=n=="paste"||e.state.pasteIncoming>N,Y=St(t),q=null;if(K&&r.ranges.length>1)if(qr&&qr.text.join(`
|
|
`)==t){if(r.ranges.length%qr.text.length==0){q=[];for(var ae=0;ae<qr.text.length;ae++)q.push(S.splitLines(qr.text[ae]))}}else Y.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(q=Ye(Y,function(nt){return[nt]}));for(var ue=e.curOp.updateInput,be=r.ranges.length-1;be>=0;be--){var ye=r.ranges[be],ke=ye.from(),Ue=ye.to();ye.empty()&&(i&&i>0?ke=je(ke.line,ke.ch-i):e.state.overwrite&&!K?Ue=je(Ue.line,Math.min(ct(S,Ue.line).text.length,Ue.ch+De(Y).length)):K&&qr&&qr.lineWise&&qr.text.join(`
|
|
`)==Y.join(`
|
|
`)&&(ke=Ue=je(ke.line,0)));var ze={from:ke,to:Ue,text:q?q[be%q.length]:Y,origin:n||(K?"paste":e.state.cutIncoming>N?"cut":"+input")};tn(e.doc,ze),cr(e,"inputRead",e,ze)}t&&!K&&As(e,t),Zi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ue),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ss(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Or(t,function(){return za(t,i,0,null,"paste")}),!0}function As(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)continue;var S=e.getModeAt(n.head),N=!1;if(S.electricChars){for(var K=0;K<S.electricChars.length;K++)if(t.indexOf(S.electricChars.charAt(K))>-1){N=Fn(e,n.head.line,"smart");break}}else S.electricInput&&(S.electricInput.test(ct(e.doc,n.head.line).text.slice(0,n.head.ch))&&(N=Fn(e,n.head.line,"smart")));N&&cr(e,"electricInput",e,n.head.line)}}function Ts(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,S={anchor:je(n,0),head:je(n+1,0)};i.push(S),t.push(e.getRange(S.anchor,S.head))}return{text:t,ranges:i}}function ws(e,t,i,r){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ds(){var e=a("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=a("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return O?e.style.width="1000px":e.setAttribute("wrap","off"),C&&(e.style.border="1px solid black"),ws(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(r,n){var S=this.options,N=S[r];if(S[r]==n&&r!="mode")return;S[r]=n,t.hasOwnProperty(r)&&or(this,t[r])(this,n,N),we(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,n){this.state.keyMaps[n?"push":"unshift"](ia(r))},removeKeyMap:function(r){for(var n=this.state.keyMaps,S=0;S<n.length;++S)if(n[S]==r||n[S].name==r)return n.splice(S,1),!0},addOverlay:Cr(function(r,n){var S=r.token?r:e.getMode(this.options,r);if(S.startState)throw new Error("Overlays may not be stateful.");Ge(this.state.overlays,{mode:S,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(N){return N.priority}),this.state.modeGen++,wr(this)}),removeOverlay:Cr(function(r){for(var n=this.state.overlays,S=0;S<n.length;++S){var N=n[S].modeSpec;if(N==r||typeof r=="string"&&N.name==r){n.splice(S,1),this.state.modeGen++,wr(this);return}}}),indentLine:Cr(function(r,n,S){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),Vr(this.doc,r)&&Fn(this,r,n,S)}),indentSelection:Cr(function(r){for(var n=this.doc.sel.ranges,S=-1,N=0;N<n.length;N++){var K=n[N];if(K.empty())K.head.line>S&&(Fn(this,K.head.line,r,!0),S=K.head.line,N==this.doc.sel.primIndex&&Zi(this));else{var Y=K.from(),q=K.to(),ae=Math.max(S,Y.line);S=Math.min(this.lastLine(),q.line-(q.ch?0:1))+1;for(var ue=ae;ue<S;++ue)Fn(this,ue,r);var be=this.doc.sel.ranges;Y.ch==0&&n.length==be.length&&be[N].from().ch>0&&Ba(this.doc,N,new Wt(Y,be[N].to()),xe)}}}),getTokenAt:function(r,n){return Kt(this,r,n)},getLineTokens:function(r,n){return Kt(this,je(r),n,!0)},getTokenTypeAt:function(r){r=s(this.doc,r);var n=Oe(this,ct(this.doc,r.line)),S=0,N=(n.length-1)/2,K=r.ch,Y;if(K==0)Y=n[2];else for(;;){var q=S+N>>1;if((q?n[q*2-1]:0)>=K)N=q;else if(n[q*2+1]<K)S=q+1;else{Y=n[q*2+2];break}}var ae=Y?Y.indexOf("overlay "):-1;return ae<0?Y:ae==0?null:Y.slice(0,ae-1)},getModeAt:function(r){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(r).state).mode:n},getHelper:function(r,n){return this.getHelpers(r,n)[0]},getHelpers:function(r,n){var S=[];if(!i.hasOwnProperty(n))return S;var N=i[n],K=this.getModeAt(r);if(typeof K[n]=="string")N[K[n]]&&S.push(N[K[n]]);else if(K[n])for(var Y=0;Y<K[n].length;Y++){var q=N[K[n][Y]];q&&S.push(q)}else K.helperType&&N[K.helperType]?S.push(N[K.helperType]):N[K.name]&&S.push(N[K.name]);for(var ae=0;ae<N._global.length;ae++){var ue=N._global[ae];ue.pred(K,this)&&le(S,ue.val)==-1&&S.push(ue.val)}return S},getStateAfter:function(r,n){var S=this.doc;return r=W(S,r==null?S.first+S.size-1:r),Qe(this,r+1,n).state},cursorCoords:function(r,n){var S,N=this.doc.sel.primary();return r==null?S=N.head:typeof r=="object"?S=s(this.doc,r):S=r?N.from():N.to(),Jr(this,S,n||"page")},charCoords:function(r,n){return ma(this,s(this.doc,r),n||"page")},coordsChar:function(r,n){return r=lo(this,r,n||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,n){return r=lo(this,{top:r,left:0},n||"page").top,Ur(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,n,S){var N=!1,K;if(typeof r=="number"){var Y=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>Y&&(r=Y,N=!0),K=ct(this.doc,r)}else K=r;return Hn(this,K,{top:0,left:0},n||"page",S||N).top+(N?this.doc.height-Xr(K):0)},defaultTextHeight:function(){return Yi(this.display)},defaultCharWidth:function(){return Xi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,S,N,K){var Y=this.display;r=Jr(this,s(this.doc,r));var q=r.bottom,ae=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),Y.sizer.appendChild(n),N=="over")q=r.top;else if(N=="above"||N=="near"){var ue=Math.max(Y.wrapper.clientHeight,this.doc.height),be=Math.max(Y.sizer.clientWidth,Y.lineSpace.clientWidth);(N=="above"||r.bottom+n.offsetHeight>ue)&&r.top>n.offsetHeight?q=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=ue&&(q=r.bottom),ae+n.offsetWidth>be&&(ae=be-n.offsetWidth)}n.style.top=q+"px",n.style.left=n.style.right="",K=="right"?(ae=Y.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(K=="left"?ae=0:K=="middle"&&(ae=(Y.sizer.clientWidth-n.offsetWidth)/2),n.style.left=ae+"px"),S&&Js(this,{left:ae,top:q,right:ae+n.offsetWidth,bottom:q+n.offsetHeight})},triggerOnKeyDown:Cr(ps),triggerOnKeyPress:Cr(gs),triggerOnKeyUp:ms,triggerOnMouseDown:Cr(vs),execCommand:function(r){if(_n.hasOwnProperty(r))return _n[r].call(null,this)},triggerElectric:Cr(function(r){As(this,r)}),findPosH:function(r,n,S,N){var K=1;n<0&&(K=-1,n=-n);for(var Y=s(this.doc,r),q=0;q<n&&!(Y=Ka(this.doc,Y,K,S,N),Y.hitSide);++q);return Y},moveH:Cr(function(r,n){var S=this;this.extendSelectionsBy(function(N){return S.display.shift||S.doc.extend||N.empty()?Ka(S.doc,N.head,r,n,S.options.rtlMoveVisually):r<0?N.from():N.to()},Te)}),deleteH:Cr(function(r,n){var S=this.doc.sel,N=this.doc;S.somethingSelected()?N.replaceSelection("",null,"+delete"):on(this,function(K){var Y=Ka(N,K.head,r,n,!1);return r<0?{from:Y,to:K.head}:{from:K.head,to:Y}})}),findPosV:function(r,n,S,N){var K=1,Y=N;n<0&&(K=-1,n=-n);for(var q=s(this.doc,r),ae=0;ae<n;++ae){var ue=Jr(this,q,"div");if(Y==null?Y=ue.left:ue.left=Y,q=Ls(this,ue,K,S),q.hitSide)break}return q},moveV:Cr(function(r,n){var S=this,N=this.doc,K=[],Y=!this.display.shift&&!N.extend&&N.sel.somethingSelected();if(N.extendSelectionsBy(function(ae){if(Y)return r<0?ae.from():ae.to();var ue=Jr(S,ae.head,"div");ae.goalColumn!=null&&(ue.left=ae.goalColumn),K.push(ue.left);var be=Ls(S,ue,r,n);return n=="page"&&ae==N.sel.primary()&&Ta(S,ma(S,be,"div").top-ue.top),be},Te),K.length)for(var q=0;q<N.sel.ranges.length;q++)N.sel.ranges[q].goalColumn=K[q]}),findWordAt:function(r){var n=this.doc,S=ct(n,r.line).text,N=r.ch,K=r.ch;if(S){var Y=this.getHelper(r,"wordChars");(r.sticky=="before"||K==S.length)&&N?--N:++K;for(var q=S.charAt(N),ae=He(q,Y)?function(ue){return He(ue,Y)}:/\s/.test(q)?function(ue){return/\s/.test(ue)}:function(ue){return!/\s/.test(ue)&&!He(ue)};N>0&&ae(S.charAt(N-1));)--N;for(;K<S.length&&ae(S.charAt(K));)++K}return new Wt(je(r.line,N),je(r.line,K))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):m(this.display.cursorDiv,"CodeMirror-overwrite"),we(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Cr(function(r,n){En(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-ii(this)-this.display.barHeight,width:r.scrollWidth-ii(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:Pi(this)}},scrollIntoView:Cr(function(r,n){r==null?(r={from:this.doc.sel.primary().head,to:null},n==null&&(n=this.options.cursorScrollMargin)):typeof r=="number"?r={from:je(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=n||0,r.from.line!=null?Zs(this,r):Eo(this,r.from,r.to,r.margin)}),setSize:Cr(function(r,n){var S=this,N=function(Y){return typeof Y=="number"||/^\d+$/.test(String(Y))?Y+"px":Y};r!=null&&(this.display.wrapper.style.width=N(r)),n!=null&&(this.display.wrapper.style.height=N(n)),this.options.lineWrapping&&ao(this);var K=this.display.viewFrom;this.doc.iter(K,this.display.viewTo,function(Y){if(Y.widgets){for(var q=0;q<Y.widgets.length;q++)if(Y.widgets[q].noHScroll){Si(S,K,"widget");break}}++K}),this.curOp.forceUpdate=!0,we(this,"refresh",this)}),operation:function(r){return Or(this,r)},startOperation:function(){return Wi(this)},endOperation:function(){return ji(this)},refresh:Cr(function(){var r=this.display.cachedTextHeight;wr(this),this.curOp.forceUpdate=!0,yn(this),En(this,this.doc.scrollLeft,this.doc.scrollTop),La(this.display),(r==null||Math.abs(r-Yi(this.display))>.5||this.options.lineWrapping)&&xa(this),we(this,"refresh",this)}),swapDoc:Cr(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Po(this,r),yn(this),this.display.input.reset(),En(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,cr(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},fe(e),e.registerHelper=function(r,n,S){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=S},e.registerGlobalHelper=function(r,n,S,N){e.registerHelper(r,n,N),i[r]._global.push({pred:S,val:N})}}function Ka(e,t,i,r,n){var S=t,N=i,K=ct(e,t.line),Y=n&&e.direction=="rtl"?-i:i;function q(){var lt=t.line+Y;return lt<e.first||lt>=e.first+e.size?!1:(t=new je(lt,t.ch,t.sticky),K=ct(e,lt))}function ae(lt){var at;if(r=="codepoint"){var ut=K.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(ut)?at=null:at=new je(t.line,Math.max(0,Math.min(K.text.length,t.ch+i*(ut>=55296&&ut<56320?2:1))),-i)}else n?at=Pl(e.cm,K,t,i):at=Ua(K,t,i);if(at==null)if(!lt&&q())t=Fa(n,e.cm,K,t.line,Y);else return!1;else t=at;return!0}if(r=="char"||r=="codepoint")ae();else if(r=="column")ae(!0);else if(r=="word"||r=="group")for(var ue=null,be=r=="group",ye=e.cm&&e.cm.getHelper(t,"wordChars"),ke=!0;!(i<0&&!ae(!ke));ke=!1){var Ue=K.text.charAt(t.ch)||`
|
|
`,ze=He(Ue,ye)?"w":be&&Ue==`
|
|
`?"n":!be||/\s/.test(Ue)?null:"p";if(be&&!ke&&!ze&&(ze="s"),ue&&ue!=ze){i<0&&(i=1,ae(),t.sticky="after");break}if(ze&&(ue=ze),i>0&&!ae(!ke))break}var nt=ea(e,t,S,N,!0);return pi(S,nt)&&(nt.hitSide=!0),nt}function Ls(e,t,i,r){var n=e.doc,S=t.left,N;if(r=="page"){var K=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Y=Math.max(K-.5*Yi(e.display),3);N=(i>0?t.bottom:t.top)+i*Y}else r=="line"&&(N=i>0?t.bottom+3:t.top-3);for(var q;!(q=va(e,S,N),!q.outside);){if(i<0?N<=0:N>=n.height){q.hitSide=!0;break}N+=i*5}return q}var Ht=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new oe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ht.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;ws(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function S(K){for(var Y=K.target;Y;Y=Y.parentNode){if(Y==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Y.className))break}return!1}Ee(n,"paste",function(K){if(!S(K)||We(r,K)||Ss(K,r))return;j<=11&&setTimeout(or(r,function(){return t.updateFromDOM()}),20)}),Ee(n,"compositionstart",function(K){t.composing={data:K.data,done:!1}}),Ee(n,"compositionupdate",function(K){t.composing||(t.composing={data:K.data,done:!1})}),Ee(n,"compositionend",function(K){t.composing&&(K.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ee(n,"touchstart",function(){return i.forceCompositionEnd()}),Ee(n,"input",function(){t.composing||t.readFromDOMSoon()});function N(K){if(!S(K)||We(r,K))return;if(r.somethingSelected())oa({lineWise:!1,text:r.getSelections()}),K.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var Y=Ts(r);oa({lineWise:!0,text:Y.text}),K.type=="cut"&&r.operation(function(){r.setSelections(Y.ranges,0,xe),r.replaceSelection("",null,"cut")})}else return;if(K.clipboardData){K.clipboardData.clearData();var q=qr.text.join(`
|
|
`);if(K.clipboardData.setData("Text",q),K.clipboardData.getData("Text")==q){K.preventDefault();return}}var ae=Ds(),ue=ae.firstChild;r.display.lineSpace.insertBefore(ae,r.display.lineSpace.firstChild),ue.value=qr.text.join(`
|
|
`);var be=document.activeElement;$(ue),setTimeout(function(){r.display.lineSpace.removeChild(ae),be.focus(),be==n&&i.showPrimarySelection()},50)}Ee(n,"copy",N),Ee(n,"cut",N)},Ht.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ht.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ht.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ht.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ht.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line<t.display.viewFrom){e.removeAllRanges();return}var S=sa(t,e.anchorNode,e.anchorOffset),N=sa(t,e.focusNode,e.focusOffset);if(S&&!S.bad&&N&&!N.bad&&Ct(vi(S,N),r)==0&&Ct(gi(S,N),n)==0)return;var K=t.display.view,Y=r.line>=t.display.viewFrom&&Rs(t,r)||{node:K[0].measure.map[2],offset:0},q=n.line<t.display.viewTo&&Rs(t,n);if(!q){var ae=K[K.length-1].measure,ue=ae.maps?ae.maps[ae.maps.length-1]:ae.map;q={node:ue[ue.length-1],offset:ue[ue.length-2]-ue[ue.length-3]}}if(!Y||!q){e.removeAllRanges();return}var be=e.rangeCount&&e.getRangeAt(0),ye;try{ye=v(Y.node,Y.offset,q.offset,q.node)}catch(ke){}ye&&(!R&&t.state.focused?(e.collapse(Y.node,Y.offset),ye.collapsed||(e.removeAllRanges(),e.addRange(ye))):(e.removeAllRanges(),e.addRange(ye)),be&&e.anchorNode==null?e.addRange(be):R&&this.startGracePeriod()),this.rememberSelection()},Ht.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)},Ht.prototype.showMultipleSelections=function(e){u(this.cm.display.cursorDiv,e.cursors),u(this.cm.display.selectionDiv,e.selection)},Ht.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ht.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},Ht.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ht.prototype.blur=function(){this.div.blur()},Ht.prototype.getField=function(){return this.div},Ht.prototype.supportsTouch=function(){return!0},Ht.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)},Ht.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ht.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(h&&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=sa(t,e.anchorNode,e.anchorOffset),r=sa(t,e.focusNode,e.focusOffset);i&&r&&Or(t,function(){br(t.doc,Ti(i,r),xe),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Ht.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),n=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=je(r.line-1,ct(e.doc,r.line-1).length)),n.ch==ct(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=je(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var S,N,K;r.line==t.viewFrom||(S=Ni(e,r.line))==0?(N=Lt(t.view[0].line),K=t.view[0].node):(N=Lt(t.view[S].line),K=t.view[S-1].node.nextSibling);var Y=Ni(e,n.line),q,ae;if(Y==t.view.length-1?(q=t.viewTo-1,ae=t.lineDiv.lastChild):(q=Lt(t.view[Y+1].line)-1,ae=t.view[Y+1].node.previousSibling),!K)return!1;for(var ue=e.doc.splitLines(tu(e,K,ae,N,q)),be=Hr(e.doc,je(N,0),je(q,ct(e.doc,q).text.length));ue.length>1&&be.length>1;)if(De(ue)==De(be))ue.pop(),be.pop(),q--;else if(ue[0]==be[0])ue.shift(),be.shift(),N++;else break;for(var ye=0,ke=0,Ue=ue[0],ze=be[0],nt=Math.min(Ue.length,ze.length);ye<nt&&Ue.charCodeAt(ye)==ze.charCodeAt(ye);)++ye;for(var lt=De(ue),at=De(be),ut=Math.min(lt.length-(ue.length==1?ye:0),at.length-(be.length==1?ye:0));ke<ut&<.charCodeAt(lt.length-ke-1)==at.charCodeAt(at.length-ke-1);)++ke;if(ue.length==1&&be.length==1&&N==r.line)for(;ye&&ye>r.ch&<.charCodeAt(lt.length-ke-1)==at.charCodeAt(at.length-ke-1);)ye--,ke++;ue[ue.length-1]=lt.slice(0,lt.length-ke).replace(/^\u200b+/,""),ue[0]=ue[0].slice(ye).replace(/\u200b+$/,"");var xt=je(N,ye),vt=je(q,be.length?De(be).length-ke:0);if(ue.length>1||ue[0]||Ct(xt,vt))return rn(e.doc,ue,xt,vt,"+input"),!0},Ht.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ht.prototype.reset=function(){this.forceCompositionEnd()},Ht.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ht.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)},Ht.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Or(this.cm,function(){return wr(e.cm)})},Ht.prototype.setUneditable=function(e){e.contentEditable="false"},Ht.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||or(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ht.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ht.prototype.onContextMenu=function(){},Ht.prototype.resetPosition=function(){},Ht.prototype.needsContentAttribute=!0;function Rs(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var r=ct(e.doc,t.line),n=eo(i,r,t.line),S=rt(r,e.doc.direction),N="left";if(S){var K=tt(S,t.ch);N=K%2?"right":"left"}var Y=io(n.map,t.ch,N);return Y.offset=Y.collapse=="right"?Y.end:Y.start,Y}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ln(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,r,n){var S="",N=!1,K=e.doc.lineSeparator(),Y=!1;function q(ye){return function(ke){return ke.id==ye}}function ae(){N&&(S+=K,Y&&(S+=K),N=Y=!1)}function ue(ye){ye&&(ae(),S+=ye)}function be(ye){if(ye.nodeType==1){var ke=ye.getAttribute("cm-text");if(ke){ue(ke);return}var Ue=ye.getAttribute("cm-marker"),ze;if(Ue){var nt=e.findMarks(je(r,0),je(n+1,0),q(+Ue));nt.length&&(ze=nt[0].find(0))&&ue(Hr(e.doc,ze.from,ze.to).join(K));return}if(ye.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(ye.nodeName);if(!/^br$/i.test(ye.nodeName)&&ye.textContent.length==0)return;lt&&ae();for(var at=0;at<ye.childNodes.length;at++)be(ye.childNodes[at]);/^(pre|p)$/i.test(ye.nodeName)&&(Y=!0),lt&&(N=!0)}else ye.nodeType==3&&ue(ye.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(be(t),t==i);)t=t.nextSibling,Y=!1;return S}function sa(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return ln(e.clipPos(je(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var S=e.display.view[n];if(S.node==r)return ru(S,t,i)}}function ru(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!x(r,t))return ln(je(Lt(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var S=e.rest?De(e.rest):e.line;return ln(je(Lt(S),S.text.length),n)}var N=t.nodeType==3?t:null,K=t;for(!N&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(N=t.firstChild,i&&(i=N.nodeValue.length));K.parentNode!=r;)K=K.parentNode;var Y=e.measure,q=Y.maps;function ae(ze,nt,lt){for(var at=-1;at<(q?q.length:0);at++)for(var ut=at<0?Y.map:q[at],xt=0;xt<ut.length;xt+=3){var vt=ut[xt+2];if(vt==ze||vt==nt){var wt=Lt(at<0?e.line:e.rest[at]),zt=ut[xt]+lt;return(lt<0||vt!=ze)&&(zt=ut[xt+(lt?1:0)]),je(wt,zt)}}}var ue=ae(N,K,i);if(ue)return ln(ue,n);for(var be=K.nextSibling,ye=N?N.nodeValue.length-i:0;be;be=be.nextSibling){if(ue=ae(be,be.firstChild,0),ue)return ln(je(ue.line,ue.ch-ye),n);ye+=be.textContent.length}for(var ke=K.previousSibling,Ue=i;ke;ke=ke.previousSibling){if(ue=ae(ke,ke.firstChild,-1),ue)return ln(je(ue.line,ue.ch+Ue),n);Ue+=ke.textContent.length}}var qt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new oe,this.hasSelection=!1,this.composing=null};qt.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),C&&(n.style.width="0px"),Ee(n,"input",function(){G&&j>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ee(n,"paste",function(N){if(We(r,N)||Ss(N,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function S(N){if(We(r,N))return;if(r.somethingSelected())oa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var K=Ts(r);oa({lineWise:!0,text:K.text}),N.type=="cut"?r.setSelections(K.ranges,null,xe):(i.prevInput="",n.value=K.text.join(`
|
|
`),$(n))}else return;N.type=="cut"&&(r.state.cutIncoming=+new Date)}Ee(n,"cut",S),Ee(n,"copy",S),Ee(e.scroller,"paste",function(N){if(ui(e,N)||We(r,N))return;if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var K=new Event("paste");K.clipboardData=N.clipboardData,n.dispatchEvent(K)}),Ee(e.lineSpace,"selectstart",function(N){ui(e,N)||te(N)}),Ee(n,"compositionstart",function(){var N=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:N,range:r.markText(N,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ee(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},qt.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},qt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=mo(e);if(e.options.moveInputWithCursor){var n=Jr(e,i.sel.primary().head,"div"),S=t.wrapper.getBoundingClientRect(),N=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+N.top-S.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+N.left-S.left))}return r},qt.prototype.showSelection=function(e){var t=this.cm,i=t.display;u(i.cursorDiv,e.cursors),u(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qt.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&&$(this.textarea),G&&j>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",G&&j>=9&&(this.hasSelection=null))},qt.prototype.getField=function(){return this.textarea},qt.prototype.supportsTouch=function(){return!1},qt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},qt.prototype.blur=function(){this.textarea.blur()},qt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qt.prototype.receivedFocus=function(){this.slowPoll()},qt.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()})},qt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},qt.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||dt(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(G&&j>=9&&this.hasSelection===n||l&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var S=n.charCodeAt(0);if(S==8203&&!r&&(r="\u200B"),S==8666)return this.reset(),this.cm.execCommand("undo")}for(var N=0,K=Math.min(r.length,n.length);N<K&&r.charCodeAt(N)==n.charCodeAt(N);)++N;return Or(t,function(){za(t,n.slice(N),r.length-N,null,e.composing?"*compose":null),n.length>1e3||n.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qt.prototype.onKeyPress=function(){G&&j>=9&&(this.hasSelection=null),this.fastPoll()},qt.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var S=Bi(i,e),N=r.scroller.scrollTop;if(!S||T)return;var K=i.options.resetSelectionOnContextMenu;K&&i.doc.sel.contains(S)==-1&&or(i,br)(i.doc,Ti(S),xe);var Y=n.style.cssText,q=t.wrapper.style.cssText,ae=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-ae.top-5)+"px; left: "+(e.clientX-ae.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ue;O&&(ue=window.scrollY),r.input.focus(),O&&window.scrollTo(null,ue),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=ye,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function be(){if(n.selectionStart!=null){var Ue=i.somethingSelected(),ze="\u200B"+(Ue?n.value:"");n.value="\u21DA",n.value=ze,t.prevInput=Ue?"":"\u200B",n.selectionStart=1,n.selectionEnd=ze.length,r.selForContextMenu=i.doc.sel}}function ye(){if(t.contextMenuPending!=ye)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=q,n.style.cssText=Y,G&&j<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=N),n.selectionStart!=null){(!G||G&&j<9)&&be();var Ue=0,ze=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?or(i,Qo)(i):Ue++<10?r.detectingSelectAll=setTimeout(ze,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(ze,200)}}if(G&&j>=9&&be(),L){he(e);var ke=function(){qe(window,"mouseup",ke),setTimeout(ye,20)};Ee(window,"mouseup",ke)}else setTimeout(ye,50)},qt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qt.prototype.setUneditable=function(){},qt.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?F(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=P();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=K.getValue()}var n;if(e.form&&(Ee(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var S=e.form;n=S.submit;try{var N=S.submit=function(){r(),S.submit=n,S.submit(),S.submit=N}}catch(Y){}}t.finishInit=function(Y){Y.save=r,Y.getTextArea=function(){return e},Y.toTextArea=function(){Y.toTextArea=isNaN,r(),e.parentNode.removeChild(Y.getWrapperElement()),e.style.display="",e.form&&(qe(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var K=Vt(function(Y){return e.parentNode.insertBefore(Y,e.nextSibling)},t);return K}function nu(e){e.off=qe,e.on=Ee,e.wheelEventPixels=dl,e.Doc=Dr,e.splitLines=St,e.countColumn=ee,e.findColumn=Se,e.isWordChar=Be,e.Pass=Ie,e.signal=we,e.Line=Oi,e.changeEnd=wi,e.scrollbarModel=So,e.Pos=je,e.cmpPos=Ct,e.modes=Qt,e.mimeModes=It,e.resolveMode=Et,e.getMode=Br,e.modeExtensions=hr,e.extendMode=pr,e.copyState=Nr,e.startState=$r,e.innerMode=ci,e.commands=_n,e.keyMap=hi,e.keyName=us,e.isModifierKey=ss,e.lookupKey=an,e.normalizeKeyMap=Ol,e.StringStream=_t,e.SharedTextMarker=Mn,e.TextMarker=Li,e.LineWidget=In,e.e_preventDefault=te,e.e_stopPropagation=re,e.e_stop=he,e.addClass=H,e.contains=x,e.rmClass=m,e.keyNames=Ri}Xl(Vt),$l(Vt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Dr.prototype)Dr.prototype.hasOwnProperty(la)&&le(au,la)<0&&(Vt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Dr.prototype[la]));return fe(Dr),Vt.inputStyles={textarea:qt,contenteditable:Ht},Vt.defineMode=function(e){!Vt.defaults.mode&&e!="null"&&(Vt.defaults.mode=e),_r.apply(this,arguments)},Vt.defineMIME=Kr,Vt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Vt.defineMIME("text/plain","null"),Vt.defineExtension=function(e,t){Vt.prototype[e]=t},Vt.defineDocExtension=function(e,t){Dr.prototype[e]=t},Vt.fromTextArea=iu,nu(Vt),Vt.version="5.58.2",Vt})},W6BS:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bYQBIEkaBEAkqbRmo/9FulSoX2Qz9GVVQJqUJBhKKA1KRJCIlowwdDDDa+jOd65syc275f1v1d1fOufYYE2ZhJZKRWXjOjvffaa6/1/p//8/yfyzuqLMuS/48P9RrA/8fZfY3B2yXQBHQpf185tBUK+SvH8uV2H/eK1/+jGfwRIBC5ks/Vq/yplq2Wqz+B/ONg5LNlrlz+Qhnot373iih+wgX/YIAivrJgjTKA9BKcYa/Uy/MnUEpD0S2AyzdKkMslZYklbwVYWZpXQSygrSVoc+4fcPzUAKtsom4xpIGiLCkMZbJGs1LkvOHPfJbrhRX5/CM/NDwJZlXiqBKlc7AEjg1aI2iVDXZpoeS9AFXlkmV1W8z+VACLE7dbMiWLE2CFADLgqig6SakCSs4jizcvAvBHMVkqxxhKkePqAs8S1mxyLUxqw6AYKLdtbMtGINpiKKUM07bc96dk9BUBykIFoNYVC/JewMkCDDh18p0so6w+GzfT+FoWC7Yl11curQpFVCoyJQsvDThP6crNdVldi0KLcwogyzJGssVrxYWXAOWzwWg84eXd92UByoK0WHEJqBCA4oC6ChstYHRJIW6lZHWQlsoYQH6rypyOLZ5Xuahx3NIi1TAvLBIcHIlUw8rfcWFLFmzhmPBUxi0NKIRdAVi5qmPAL88LrS9z/AigmHBpCcOaCIUA1BVj4ma6LCi1FkjLBZRoVRrLR9piXjhkysI2mqJxhY2lQUrDjG3iVv5k5YmgyHI1ngLPBqfUxg21nC5LbGUhHJbGUPKu8hTbUthKGcZP3Palks3fY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7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(Me,Le,Z){Me.exports=Z.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Me,Le,Z){"use strict";Z.r(Le),Z.d(Le,"ResizableTextArea",function(){return le});var ie=Z("wx14"),X=Z("1OyB"),R=Z("vuIU"),Q=Z("Ji7U"),B=Z("LK+K"),_=Z("q1tI"),G=Z("VTBJ"),j=Z("rePB"),O=Z("Zm9Q"),M=Z("Kwbf"),y=Z("c+Xe"),T=Z("m+aA"),k=Z("bdgK"),D=new Map;function w(xe){xe.forEach(function(Ce){var Te,Se=Ce.target;(Te=D.get(Se))===null||Te===void 0||Te.forEach(function(pe){return pe(Se)})})}var C=new k.default(w),h=null,o=null;function l(xe,Ce){D.has(xe)||(D.set(xe,new Set),C.observe(xe)),D.get(xe).add(Ce)}function d(xe,Ce){D.has(xe)&&(D.get(xe).delete(Ce),D.get(xe).size||(C.unobserve(xe),D.delete(xe)))}var A=function(xe){Object(Q.a)(Te,xe);var Ce=Object(B.a)(Te);function Te(){return Object(X.a)(this,Te),Ce.apply(this,arguments)}return Object(R.a)(Te,[{key:"render",value:function(){return this.props.children}}]),Te}(_.Component),f=_.createContext(null);function g(xe){var Ce=xe.children,Te=xe.onBatchResize,Se=_.useRef(0),pe=_.useRef([]),se=_.useContext(f),De=_.useCallback(function(Ye,Ge,$e){Se.current+=1;var et=Se.current;pe.current.push({size:Ye,element:Ge,data:$e}),Promise.resolve().then(function(){et===Se.current&&(Te==null||Te(pe.current),pe.current=[])}),se==null||se(Ye,Ge,$e)},[Te,se]);return _.createElement(f.Provider,{value:De},Ce)}function L(xe){var Ce=xe.children,Te=xe.disabled,Se=_.useRef(null),pe=_.useRef(null),se=_.useContext(f),De=_.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ye=_.isValidElement(Ce)&&Object(y.c)(Ce),Ge=Ye?Ce.ref:null,$e=_.useMemo(function(){return Object(y.a)(Ge,Se)},[Ge,Se]),et=_.useRef(xe);et.current=xe;var Re=_.useCallback(function(Be){var He=et.current,Xe=He.onResize,Ke=He.data,Fe=Be.getBoundingClientRect(),Pe=Fe.width,ot=Fe.height,Je=Be.offsetWidth,Ze=Be.offsetHeight,tt=Math.floor(Pe),ht=Math.floor(ot);if(De.current.width!==tt||De.current.height!==ht||De.current.offsetWidth!==Je||De.current.offsetHeight!==Ze){var rt={width:tt,height:ht,offsetWidth:Je,offsetHeight:Ze};De.current=rt;var Ve=Je===Math.round(Pe)?Pe:Je,Ee=Ze===Math.round(ot)?ot:Ze,it=Object(G.a)(Object(G.a)({},rt),{},{offsetWidth:Ve,offsetHeight:Ee});se==null||se(it,Be,Ke),Xe&&Promise.resolve().then(function(){Xe(it,Be)})}},[]);return _.useEffect(function(){var Be=Object(T.a)(Se.current)||Object(T.a)(pe.current);return Be&&!Te&&l(Be,Re),function(){return d(Be,Re)}},[Se.current,Te]),_.createElement(A,{ref:pe},Ye?_.cloneElement(Ce,{ref:$e}):Ce)}var E="rc-observer-key";function m(xe){var Ce=xe.children,Te=Object(O.a)(Ce);return Te.map(function(Se,pe){var se=(Se==null?void 0:Se.key)||"".concat(E,"-").concat(pe);return _.createElement(L,Object(ie.a)({},xe,{key:se}),Se)})}m.Collection=g;var c=m,u=Z("bT9E"),a=Z("TSYQ"),b=Z.n(a),v=`
|
|
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
|
|
`,x=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},H;function V(xe){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Ce&&P[Te])return P[Te];var Se=window.getComputedStyle(xe),pe=Se.getPropertyValue("box-sizing")||Se.getPropertyValue("-moz-box-sizing")||Se.getPropertyValue("-webkit-box-sizing"),se=parseFloat(Se.getPropertyValue("padding-bottom"))+parseFloat(Se.getPropertyValue("padding-top")),De=parseFloat(Se.getPropertyValue("border-bottom-width"))+parseFloat(Se.getPropertyValue("border-top-width")),Ye=x.map(function($e){return"".concat($e,":").concat(Se.getPropertyValue($e))}).join(";"),Ge={sizingStyle:Ye,paddingSize:se,borderSize:De,boxSizing:pe};return Ce&&Te&&(P[Te]=Ge),Ge}function $(xe){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;H||(H=document.createElement("textarea"),H.setAttribute("tab-index","-1"),H.setAttribute("aria-hidden","true"),document.body.appendChild(H)),xe.getAttribute("wrap")?H.setAttribute("wrap",xe.getAttribute("wrap")):H.removeAttribute("wrap");var pe=V(xe,Ce),se=pe.paddingSize,De=pe.borderSize,Ye=pe.boxSizing,Ge=pe.sizingStyle;H.setAttribute("style","".concat(Ge,";").concat(v)),H.value=xe.value||xe.placeholder||"";var $e=Number.MIN_SAFE_INTEGER,et=Number.MAX_SAFE_INTEGER,Re=H.scrollHeight,Be;if(Ye==="border-box"?Re+=De:Ye==="content-box"&&(Re-=se),Te!==null||Se!==null){H.value=" ";var He=H.scrollHeight-se;Te!==null&&($e=He*Te,Ye==="border-box"&&($e=$e+se+De),Re=Math.max($e,Re)),Se!==null&&(et=He*Se,Ye==="border-box"&&(et=et+se+De),Be=Re>et?"":"hidden",Re=Math.min(et,Re))}return{height:Re,minHeight:$e,maxHeight:et,overflowY:Be,resize:"none"}}var z=Z("Gytx"),F=Z.n(z),ee;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(ee||(ee={}));var oe=function(xe){Object(Q.a)(Te,xe);var Ce=Object(B.a)(Te);function Te(Se){var pe;return Object(X.a)(this,Te),pe=Ce.call(this,Se),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(se){pe.textArea=se},pe.handleResize=function(se){var De=pe.state.resizeStatus,Ye=pe.props,Ge=Ye.autoSize,$e=Ye.onResize;if(De!==ee.NONE)return;typeof $e=="function"&&$e(se),Ge&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var se=pe.props.autoSize;if(!se||!pe.textArea)return;var De=se.minRows,Ye=se.maxRows,Ge=$(pe.textArea,!1,De,Ye);pe.setState({textareaStyles:Ge,resizeStatus:ee.RESIZING},function(){cancelAnimationFrame(pe.resizeFrameId),pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:ee.RESIZED},function(){pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:ee.NONE}),pe.fixFirefoxAutoScroll()})})})})},pe.renderTextArea=function(){var se=pe.props,De=se.prefixCls,Ye=De===void 0?"rc-textarea":De,Ge=se.autoSize,$e=se.onResize,et=se.className,Re=se.disabled,Be=pe.state,He=Be.textareaStyles,Xe=Be.resizeStatus,Ke=Object(u.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Fe=b()(Ye,et,Object(j.a)({},"".concat(Ye,"-disabled"),Re));"value"in Ke&&(Ke.value=Ke.value||"");var Pe=Object(G.a)(Object(G.a)(Object(G.a)({},pe.props.style),He),Xe===ee.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return _.createElement(c,{onResize:pe.handleResize,disabled:!(Ge||$e)},_.createElement("textarea",Object(ie.a)({},Ke,{className:Fe,style:Pe,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:ee.NONE},pe}return Object(R.a)(Te,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!F()(pe.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 pe=this.textArea.selectionStart,se=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,se)}}catch(De){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Te}(_.Component),le=oe,ve=function(xe){Object(Q.a)(Te,xe);var Ce=Object(B.a)(Te);function Te(Se){var pe;Object(X.a)(this,Te),pe=Ce.call(this,Se),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(De){pe.resizableTextArea=De},pe.handleChange=function(De){var Ye=pe.props.onChange;pe.setValue(De.target.value,function(){pe.resizableTextArea.resizeTextarea()}),Ye&&Ye(De)},pe.handleKeyDown=function(De){var Ye=pe.props,Ge=Ye.onPressEnter,$e=Ye.onKeyDown;De.keyCode===13&&Ge&&Ge(De),$e&&$e(De)};var se=typeof Se.value=="undefined"||Se.value===null?Se.defaultValue:Se.value;return pe.state={value:se},pe}return Object(R.a)(Te,[{key:"setValue",value:function(pe,se){"value"in this.props||this.setState({value:pe},se)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return _.createElement(le,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(pe){return"value"in pe?{value:pe.value}:null}}]),Te}(_.Component),Ie=Le.default=ve},ZpRC:function(Me,Le,Z){"use strict";function ie(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function X(y,T){return(!T||y!=="hidden")&&y!=="visible"&&y!=="clip"}function R(y,T){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var k=getComputedStyle(y,null);return X(k.overflowY,T)||X(k.overflowX,T)||function(D){var w=function(C){if(!C.ownerDocument||!C.ownerDocument.defaultView)return null;try{return C.ownerDocument.defaultView.frameElement}catch(h){return null}}(D);return!!w&&(w.clientHeight<D.scrollHeight||w.clientWidth<D.scrollWidth)}(y)}return!1}function Q(y,T,k,D,w,C,h,o){return C<y&&h>T||C>y&&h<T?0:C<=y&&o<=k||h>=T&&o>=k?C-y-D:h>T&&o<k||C<y&&o>k?h-T+w:0}var B=function(y,T){var k=window,D=T.scrollMode,w=T.block,C=T.inline,h=T.boundary,o=T.skipOverflowHiddenElements,l=typeof h=="function"?h:function(He){return He!==h};if(!ie(y))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,A=[],f=y;ie(f)&&l(f);){if((f=f.parentElement)===d){A.push(f);break}f!=null&&f===document.body&&R(f)&&!R(document.documentElement)||f!=null&&R(f,o)&&A.push(f)}for(var g=k.visualViewport?k.visualViewport.width:innerWidth,L=k.visualViewport?k.visualViewport.height:innerHeight,E=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,c=y.getBoundingClientRect(),u=c.height,a=c.width,b=c.top,v=c.right,x=c.bottom,P=c.left,H=w==="start"||w==="nearest"?b:w==="end"?x:b+u/2,V=C==="center"?P+a/2:C==="end"?v:P,$=[],z=0;z<A.length;z++){var F=A[z],ee=F.getBoundingClientRect(),oe=ee.height,le=ee.width,ve=ee.top,Ie=ee.right,xe=ee.bottom,Ce=ee.left;if(D==="if-needed"&&b>=0&&P>=0&&x<=L&&v<=g&&b>=ve&&x<=xe&&P>=Ce&&v<=Ie)return $;var Te=getComputedStyle(F),Se=parseInt(Te.borderLeftWidth,10),pe=parseInt(Te.borderTopWidth,10),se=parseInt(Te.borderRightWidth,10),De=parseInt(Te.borderBottomWidth,10),Ye=0,Ge=0,$e="offsetWidth"in F?F.offsetWidth-F.clientWidth-Se-se:0,et="offsetHeight"in F?F.offsetHeight-F.clientHeight-pe-De:0;if(d===F)Ye=w==="start"?H:w==="end"?H-L:w==="nearest"?Q(m,m+L,L,pe,De,m+H,m+H+u,u):H-L/2,Ge=C==="start"?V:C==="center"?V-g/2:C==="end"?V-g:Q(E,E+g,g,Se,se,E+V,E+V+a,a),Ye=Math.max(0,Ye+m),Ge=Math.max(0,Ge+E);else{Ye=w==="start"?H-ve-pe:w==="end"?H-xe+De+et:w==="nearest"?Q(ve,xe,oe,pe,De+et,H,H+u,u):H-(ve+oe/2)+et/2,Ge=C==="start"?V-Ce-Se:C==="center"?V-(Ce+le/2)+$e/2:C==="end"?V-Ie+se+$e:Q(Ce,Ie,le,Se,se+$e,V,V+a,a);var Re=F.scrollLeft,Be=F.scrollTop;H+=Be-(Ye=Math.max(0,Math.min(Be+Ye,F.scrollHeight-oe+et))),V+=Re-(Ge=Math.max(0,Math.min(Re+Ge,F.scrollWidth-le+$e)))}$.push({el:F,top:Ye,left:Ge})}return $};function _(y){return y===Object(y)&&Object.keys(y).length!==0}function G(y,T){T===void 0&&(T="auto");var k="scrollBehavior"in document.body.style;y.forEach(function(D){var w=D.el,C=D.top,h=D.left;w.scroll&&k?w.scroll({top:C,left:h,behavior:T}):(w.scrollTop=C,w.scrollLeft=h)})}function j(y){return y===!1?{block:"end",inline:"nearest"}:_(y)?y:{block:"start",inline:"nearest"}}function O(y,T){var k=!y.ownerDocument.documentElement.contains(y);if(_(T)&&typeof T.behavior=="function")return T.behavior(k?[]:B(y,T));if(k)return;var D=j(T);return G(B(y,D),D.behavior)}var M=Le.a=O},bT9E:function(Me,Le,Z){"use strict";Z.d(Le,"a",function(){return X});var ie=Z("VTBJ");function X(R,Q){var B=Object(ie.a)({},R);return Array.isArray(Q)&&Q.forEach(function(_){delete B[_]}),B}},c5Ni:function(Me,Le,Z){},cRFk:function(Me,Le,Z){Me.exports=Z.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Me,Le,Z){Me.exports=Z.p+"static/choose.4ad1045f.svg"},dNgX:function(Me,Le,Z){"use strict";Z.r(Le);var ie=Z("14J3"),X=Z("BMrR"),R=Z("jCWc"),Q=Z("kPKH"),B=Z("OaEy"),_=Z("2fM7"),G=Z("7Kak"),j=Z("9yH6"),O=Z("5NDa"),M=Z("5rEg"),y=Z("miYZ"),T=Z("tsqr"),k=Z("9og8"),D=Z("k1fw"),w=Z("y8nQ"),C=Z("Vl3Y"),h=Z("tJVT"),o=Z("PpiC"),l=Z("WmNS"),d=Z.n(l),A=Z("q1tI"),f=Z.n(A),g=Z("9kvl"),L=Z("Ot1p"),E=Z("HBuW"),m=Z("S3tb"),c=Z.n(m),u=Z("9ZNV"),a=Z("CJF0"),b=Z("2RCv"),v={1:[100,200],2:[300,400,500,600],3:[700,800,900,1e3]},x=function(H){var V,$,z,F=H.shixunsDetail,ee=H.dispatch,oe=H.loading,le=H.match,ve=Object(o.a)(H,["shixunsDetail","dispatch","loading","match"]),Ie=C.a.useForm(),xe=Object(h.a)(Ie,1),Ce=xe[0],Te=Object(A.useState)({}),Se=Object(h.a)(Te,2),pe=Se[0],se=Se[1],De=Object(A.useState)([100,200]),Ye=Object(h.a)(De,2),Ge=Ye[0],$e=Ye[1],et=F.challengesNew,Re=Object(A.useState)(),Be=Object(h.a)(Re,2),He=Be[0],Xe=Be[1],Ke=Object(A.useState)(),Fe=Object(h.a)(Ke,2),Pe=Fe[0],ot=Fe[1];Object(A.useEffect)(function(){return ee({type:"globalSetting/footerToggle",payload:!1}),function(){ee({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(A.useEffect)(function(){le.params.challengesId?(ot(!0),Je()):(ot(!1),ee({type:"shixunsDetail/getChallengesNew",payload:Object(D.a)({},le.params)}))},[le.params]);var Je=function(){var Ve=Object(k.a)(d.a.mark(function Ee(){var it;return d.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return we.next=2,Object(E.H)({id:le.params.id,challengeId:le.params.challengesId,tab:0});case 2:it=we.sent,it&&(Xe(it),Ze(it));case 4:case"end":return we.stop()}},Ee)}));return function(){return Ve.apply(this,arguments)}}(),Ze=function(Ee){var it={subject:Ee.name,difficulty:Ee.difficulty,score:Ee.score,challenge_tag:Ee.tags,task_pass:Ee.task_pass},qe=v[Ee.difficulty];$e(qe),Ce.setFieldsValue(Object(D.a)({},it)),se(Object(D.a)({},it))},tt=function(Ee){var it=v[Ee],qe=it==null?void 0:it[0];$e(it),Ce.setFieldsValue({score:qe}),se(Object(D.a)(Object(D.a)({},Ce.getFieldsValue()),{score:qe}))},ht=function(Ee,it){se(Object(D.a)({},Ce.getFieldsValue())),"difficulty"in Ee&&tt(Ee.difficulty)},rt=function(){var Ve=Object(k.a)(d.a.mark(function Ee(){var it,qe,we,We,ge,de=arguments;return d.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:if(qe=de.length>0&&de[0]!==void 0?de[0]:{},!(!Pe&&((it=F.detail)===null||it===void 0?void 0:it.shixun_status)===2)){te.next=4;break}return T.b.info("\u8BE5\u5B9E\u8BAD\u5DF2\u7ECF\u53D1\u5E03\u4E0D\u80FD\u65B0\u5EFA"),te.abrupt("return");case 4:if(!Pe){te.next=10;break}return te.next=7,Object(E.Mb)(Object(D.a)(Object(D.a)({},le.params),{},{tab:0,challenge:Object(D.a)({},qe),challenge_tag:qe.challenge_tag}));case 7:return we=te.sent,we&&g.d.replace("/shixuns/".concat(le.params.id,"/challenges/").concat(le.params.challengesId,"/tab=2")),te.abrupt("return");case 10:return We=Object(D.a)({},pe),We.identifier=le.params.id,We.st=0,te.next=15,Object(E.b)(Object(D.a)({},We));case 15:ge=te.sent,ge.status===1&&ve.history.replace("/shixuns/".concat(le.params.id,"/challenges/").concat(ge.challenge_id,"/tab=2"));case 17:case"end":return te.stop()}},Ee)}));return function(){return Ve.apply(this,arguments)}}();return f.a.createElement("section",{className:c.a.bg},f.a.createElement(a.a,{data:He||et,title:"\u5B9E\u8DF5\u9898"}),f.a.createElement(C.a,{form:Ce,className:c.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:ht,onFinish:rt},f.a.createElement("aside",{className:["bg-white",c.a.navBar,c.a.flexRow].join(" ")},f.a.createElement("li",{className:"".concat(c.a.active," current")},f.a.createElement("a",null,"1\u3001\u672C\u5173\u4EFB\u52A1")),Pe&&f.a.createElement(f.a.Fragment,null,f.a.createElement("li",{className:"current"},f.a.createElement("a",{onClick:function(){g.d.push("/shixuns/".concat(le.params.id,"/challenges/").concat(le.params.challengesId,"/tab=2"))}},"2\u3001\u8BC4\u6D4B\u8BBE\u7F6E")),f.a.createElement("li",{className:"current"},f.a.createElement("a",{onClick:function(){g.d.push("/shixuns/".concat(le.params.id,"/challenges/").concat(le.params.challengesId,"/tab=3"))}},"3\u3001\u53C2\u8003\u7B54\u6848")),f.a.createElement("li",{className:"current"},f.a.createElement("a",{onClick:function(){g.d.push("/shixuns/".concat(le.params.id,"/challenges/").concat(le.params.challengesId,"/tab=4"))}},"4\u3001\u5173\u5361\u6392\u884C\u699C")))),f.a.createElement("div",{className:c.a.fieldWrap},f.a.createElement(C.a.Item,{name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},f.a.createElement(M.a,{maxLength:60,suffix:"".concat(((V=pe.subject)===null||V===void 0?void 0:V.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),f.a.createElement("div",{className:c.a.mdWrap},f.a.createElement(C.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u8FC7\u5173\u4EFB\u52A1\u7B80\u4ECB\u6700\u5927\u9650\u523635000\u4E2A\u5B57\u7B26"}]},f.a.createElement(L.a,{watch:!0,defaultValue:Pe?He==null?void 0:He.task_pass:et.task_pass_default})),f.a.createElement(C.a.Item,{name:"difficulty",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},f.a.createElement(j.a.Group,{disabled:(($=F.detail)===null||$===void 0?void 0:$.shixun_status)===2},f.a.createElement(j.a,{value:1},"\u7B80\u5355"),f.a.createElement(j.a,{value:2},"\u4E2D\u7B49"),f.a.createElement(j.a,{value:3},"\u56F0\u96BE"))),f.a.createElement(X.a,null,f.a.createElement(Q.a,null,f.a.createElement(C.a.Item,{name:"score",label:"\u5956\u52B1\u7ECF\u9A8C\u503C:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},f.a.createElement(_.a,{disabled:((z=F.detail)===null||z===void 0?void 0:z.shixun_status)===2},Ge==null?void 0:Ge.map(function(Ve){return f.a.createElement(_.a.Option,{value:Ve},Ve)})))),f.a.createElement(Q.a,{flex:1},f.a.createElement("div",{className:"font12 c-light-black ml10 mt20"},"\u5982\u679C\u5B66\u5458\u7B54\u9898\u9519\u8BEF\uFF0C\u5219\u4E0D\u80FD\u5F97\u5230\u76F8\u5E94\u7684\u7ECF\u9A8C\u503C",f.a.createElement("br",null),"\u5982\u679C\u5B66\u5458\u6210\u529F\u5F97\u5230\u7ECF\u9A8C\u503C\uFF0C\u90A3\u4E48\u5C06\u540C\u65F6\u83B7\u5F97\u7B49\u503C\u7684\u91D1\u5E01\u5956\u52B1\uFF0C\u5982\uFF1A+10\u7ECF\u9A8C\u503C\u3001+10\u91D1\u5E01"))),f.a.createElement(C.a.Item,{name:"challenge_tag",label:f.a.createElement("div",null,"\u6280\u80FD\u6807\u7B7E"," ",f.a.createElement("span",{className:"pl20 font12 c-light-black"},"\u5B66\u5458\u7B54\u9898\u6B63\u786E\u5C06\u83B7\u5F97\u6280\u80FD\uFF0C\u5426\u5219\u4E0D\u80FD\u83B7\u5F97\u6280\u80FD\uFF08\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E\uFF09")),rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6280\u80FD\u6807\u7B7E"}]},f.a.createElement(b.a,{placeholder:"\u6DFB\u52A0\u6807\u7B7E",style:{width:"260px"},InputRight:f.a.createElement("span",{className:"ml5"},"(\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E)")}))),f.a.createElement(C.a.Item,{noStyle:!0},f.a.createElement(u.a,{okButtonProps:{htmlType:"submit"},onCancel:function(){return g.d.push("/shixuns/".concat(le.params.id,"/challenges"))}}))))};Le.default=Object(g.a)(function(P){var H=P.shixunsDetail,V=P.newCourse,$=P.loading,z=P.globalSetting;return{shixunsDetail:H,newCourse:V,globalSetting:z,loading:$.effects}})(x)},dejd:function(Me,Le,Z){},djh8:function(Me,Le,Z){Me.exports=Z.p+"static/qrCode.d852fdfc.png"},dmUQ:function(Me,Le,Z){"use strict";var ie=Z("Ff2n"),X=Z("rePB"),R=Z("1OyB"),Q=Z("vuIU"),B=Z("Ji7U"),_=Z("md7G"),G=Z("foSv"),j=Z("q1tI"),O=Z.n(j),M=Z("TSYQ"),y=Z.n(M),T=Z("4IlW");function k(u,a){var b=Object.keys(u);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(u);a&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(u,x).enumerable})),b.push.apply(b,v)}return b}function D(u){for(var a=1;a<arguments.length;a++){var b=arguments[a]!=null?arguments[a]:{};a%2?k(Object(b),!0).forEach(function(v){Object(X.a)(u,v,b[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(b)):k(Object(b)).forEach(function(v){Object.defineProperty(u,v,Object.getOwnPropertyDescriptor(b,v))})}return u}function w(u){var a=C();return function(){var v=Object(G.a)(u),x;if(a){var P=Object(G.a)(this).constructor;x=Reflect.construct(v,arguments,P)}else x=v.apply(this,arguments);return Object(_.a)(this,x)}}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(u){return!1}}function h(){}function o(u){u.preventDefault()}var l=function(a){return a.replace(/[^\w.-]+/g,"")},d=200,A=600,f=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,g=function(a){return a!=null},L=function(a,b){return b===a||typeof b=="number"&&typeof a=="number"&&isNaN(b)&&isNaN(a)},E=function(u){Object(B.a)(b,u);var a=w(b);function b(v){var x;Object(R.a)(this,b),x=a.call(this,v),x.onKeyDown=function(V){var $=x.props,z=$.onKeyDown,F=$.onPressEnter;if(V.keyCode===T.a.UP){var ee=x.getRatio(V);x.up(V,ee,null),x.stop()}else if(V.keyCode===T.a.DOWN){var oe=x.getRatio(V);x.down(V,oe,null),x.stop()}else V.keyCode===T.a.ENTER&&F&&F(V);if(x.recordCursorPosition(),x.lastKeyCode=V.keyCode,z){for(var le=arguments.length,ve=new Array(le>1?le-1:0),Ie=1;Ie<le;Ie++)ve[Ie-1]=arguments[Ie];z.apply(void 0,[V].concat(ve))}},x.onKeyUp=function(V){var $=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),$){for(var z=arguments.length,F=new Array(z>1?z-1:0),ee=1;ee<z;ee++)F[ee-1]=arguments[ee];$.apply(void 0,[V].concat(F))}},x.onChange=function(V){var $=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(V)),x.setState({inputValue:x.rawInput}),$(x.toNumber(x.rawInput))},x.onMouseUp=function(){var V=x.props.onMouseUp;x.recordCursorPosition(),V&&V.apply(void 0,arguments)},x.onFocus=function(){var V;x.setState({focused:!0}),(V=x.props).onFocus.apply(V,arguments)},x.onBlur=function(){var V=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var $=x.getCurrentValidValue(x.state.inputValue),z=x.setValue($,h);if(V){var F=x.input.value,ee=x.getInputDisplayValue({focus:!1,value:z});x.input.value=ee&&Number(ee),V.apply(void 0,arguments),x.input.value=F}},x.getRatio=function(V){var $=1;return V.metaKey||V.ctrlKey?$=.1:V.shiftKey&&($=10),$},x.getFullNum=function(V){return isNaN(V)?V:/e/i.test(String(V))?Number(V).toFixed(18).replace(/\.?0+$/,""):V},x.getPrecision=function(V){if(g(x.props.precision))return x.props.precision;var $=String(V);if($.indexOf("e-")>=0)return parseInt($.slice($.indexOf("e-")+2),10);var z=0;return $.indexOf(".")>=0&&(z=$.length-$.indexOf(".")-1),z},x.getInputDisplayValue=function(V){var $=V||x.state,z=$.focused,F=$.inputValue,ee=$.value,oe;z?oe=F:oe=x.toPrecisionAsStep(ee),oe==null&&(oe="");var le=x.formatWrapper(oe);return g(x.props.decimalSeparator)&&(le=le.toString().replace(".",x.props.decimalSeparator)),le},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(V){}},x.restoreByAfter=function(V){if(V===void 0)return!1;var $=x.input.value,z=$.lastIndexOf(V);if(z===-1)return!1;var F=x.cursorBefore.length;return x.lastKeyCode===T.a.DELETE&&x.cursorBefore.charAt(F-1)===V[0]?(x.fixCaret(F,F),!0):z+V.length===$.length?(x.fixCaret(z,z),!0):!1},x.partRestoreByAfter=function(V){return V===void 0?!1:Array.prototype.some.call(V,function($,z){var F=V.substring(z);return x.restoreByAfter(F)})},x.isNotCompleteNumber=function(V){return isNaN(V)||V===""||V===null||V&&V.toString().indexOf(".")===V.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(V,$,z){x.pressingUpOrDown=!0,x.step("down",V,$,z)},x.up=function(V,$,z){x.pressingUpOrDown=!0,x.step("up",V,$,z)},x.saveInput=function(V){x.input=V};var P=v.value;P===void 0&&(P=v.defaultValue),x.state={focused:v.autoFocus};var H=x.getValidValue(x.toNumber(P));return x.state=D(D({},x.state),{},{inputValue:x.toPrecisionAsStep(H),value:H}),x}return Object(Q.a)(b,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var P=this.props,H=P.value,V=P.onChange,$=P.max,z=P.min,F=this.state.focused;if(x){if(!L(x.value,H)||!L(x.max,$)||!L(x.min,z)){var ee=F?H:this.getValidValue(H),oe;this.pressingUpOrDown?oe=ee:this.inputting?oe=this.rawInput:oe=this.toPrecisionAsStep(ee),this.setState({value:ee,inputValue:oe})}var le="value"in this.props?H:this.state.value;"max"in this.props&&x.max!==$&&typeof le=="number"&&le>$&&V&&V($),"min"in this.props&&x.min!==z&&typeof le=="number"&&le<z&&V&&V(z)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ve=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===T.a.BACKSPACE?ve=this.cursorStart-1:this.lastKeyCode===T.a.DELETE&&(ve=this.cursorStart):ve=this.input.value.length,this.fixCaret(ve,ve)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case T.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case T.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ie){}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(x){var P=x;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(x){var P=x.target.value.trim().replace(/。/g,".");return g(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(x){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,V=parseFloat(x);return isNaN(V)?x:(V<P&&(V=P),V>H&&(V=H),V)}},{key:"setValue",value:function(x,P){var H=this.props.precision,V=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),$=this.state.value,z=$===void 0?null:$,F=this.state.inputValue,ee=F===void 0?null:F,oe=typeof V=="number"?V.toFixed(H):"".concat(V),le=V!==z||oe!=="".concat(ee);return"value"in this.props?(ee=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:ee},P)):this.setState({value:V,inputValue:this.toPrecisionAsStep(x)},P),le&&this.props.onChange(V),V}},{key:"getMaxPrecision",value:function(x){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.props,V=H.precision,$=H.step;if(g(V))return V;var z=this.getPrecision(P),F=this.getPrecision($),ee=this.getPrecision(x);return x?Math.max(ee,z+F):z+F}},{key:"getPrecisionFactor",value:function(x){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.getMaxPrecision(x,P);return Math.pow(10,H)}},{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(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var P=Math.abs(this.getMaxPrecision(x));return isNaN(P)?x.toString():Number(x).toFixed(P)}},{key:"toNumber",value:function(x){var P=this.props.precision,H=this.state.focused,V=x&&x.length>16&&H;return this.isNotCompleteNumber(x)||V?x:g(P)?Math.round(x*Math.pow(10,P))/Math.pow(10,P):Number(x)}},{key:"upStep",value:function(x,P){var H=this.props.step,V=this.getPrecisionFactor(x,P),$=Math.abs(this.getMaxPrecision(x,P)),z=((V*x+V*H*P)/V).toFixed($);return this.toNumber(z)}},{key:"downStep",value:function(x,P){var H=this.props.step,V=this.getPrecisionFactor(x,P),$=Math.abs(this.getMaxPrecision(x,P)),z=((V*x-V*H*P)/V).toFixed($);return this.toNumber(z)}},{key:"step",value:function(x,P){var H=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,$=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var z=this.props;if(z.disabled)return;var F=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(F))return;var ee=this["".concat(x,"Step")](F,V),oe=ee>z.max||ee<z.min;if(ee>z.max?ee=z.max:ee<z.min&&(ee=z.min),this.setValue(ee,null),this.setState({focused:!0},function(){H.pressingUpOrDown=!1}),oe)return;this.autoStepTimer=setTimeout(function(){H[x](P,V,!0)},$?d:A)}},{key:"fixCaret",value:function(x,P){if(x===void 0||P===void 0||!this.input||!this.input.value)return;try{var H=this.input.selectionStart,V=this.input.selectionEnd;(x!==H||P!==V)&&this.input.setSelectionRange(x,P)}catch($){}}},{key:"render",value:function(){var x,P=this.props,H=P.prefixCls,V=P.disabled,$=P.readOnly,z=P.useTouch,F=P.autoComplete,ee=P.upHandler,oe=P.downHandler,le=P.className,ve=P.max,Ie=P.min,xe=P.style,Ce=P.title,Te=P.onMouseEnter,Se=P.onMouseLeave,pe=P.onMouseOver,se=P.onMouseOut,De=P.required,Ye=P.onClick,Ge=P.tabIndex,$e=P.type,et=P.placeholder,Re=P.id,Be=P.inputMode,He=P.pattern,Xe=P.step,Ke=P.maxLength,Fe=P.autoFocus,Pe=P.name,ot=P.onPaste,Je=P.onInput,Ze=Object(ie.a)(P,["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"]),tt=this.state,ht=tt.value,rt=tt.focused,Ve=y()(H,(x={},Object(X.a)(x,le,!!le),Object(X.a)(x,"".concat(H,"-disabled"),V),Object(X.a)(x,"".concat(H,"-focused"),rt),x)),Ee={};Object.keys(Ze).forEach(function(he){(he.substr(0,5)==="data-"||he.substr(0,5)==="aria-"||he==="role")&&(Ee[he]=Ze[he])});var it=!$&&!V,qe=this.getInputDisplayValue(null),we=(ht||ht===0)&&(isNaN(ht)||Number(ht)>=ve),We=(ht||ht===0)&&(isNaN(ht)||Number(ht)<=Ie),ge=we||V||$,de=We||V||$,fe=y()("".concat(H,"-handler"),"".concat(H,"-handler-up"),Object(X.a)({},"".concat(H,"-handler-up-disabled"),ge)),te=y()("".concat(H,"-handler"),"".concat(H,"-handler-down"),Object(X.a)({},"".concat(H,"-handler-down-disabled"),de)),re=z?{onTouchStart:ge?h:this.up,onTouchEnd:this.stop}:{onMouseDown:ge?h:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ne=z?{onTouchStart:de?h:this.down,onTouchEnd:this.stop}:{onMouseDown:de?h:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:Ve,style:xe,title:Ce,onMouseEnter:Te,onMouseLeave:Se,onMouseOver:pe,onMouseOut:se,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(H,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Increase Value","aria-disabled":ge,className:fe}),ee||O.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-up-inner"),onClick:o})),O.a.createElement("span",Object.assign({unselectable:"on"},ne,{role:"button","aria-label":"Decrease Value","aria-disabled":de,className:te}),oe||O.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-down-inner"),onClick:o}))),O.a.createElement("div",{className:"".concat(H,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ie,"aria-valuemax":ve,"aria-valuenow":ht,required:De,type:$e,placeholder:et,onPaste:ot,onClick:Ye,onMouseUp:this.onMouseUp,className:"".concat(H,"-input"),tabIndex:Ge,autoComplete:F,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:it?this.onKeyDown:h,onKeyUp:it?this.onKeyUp:h,autoFocus:Fe,maxLength:Ke,readOnly:$,disabled:V,max:ve,min:Ie,step:Xe,name:Pe,title:Ce,id:Re,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(qe),pattern:He,inputMode:Be,onInput:Je},Ee))))}}]),b}(O.a.Component);E.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:f,min:-f,step:1,style:{},onChange:h,onKeyDown:h,onPressEnter:h,onFocus:h,onBlur:h,parser:l,required:!1,autoComplete:"off"};var m=E,c=Le.a=m},ji0R:function(Me,Le,Z){Me.exports=Z.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Me,Le,Z){Me.exports=Z.p+"static/question.cb52bef9.gif"},kPYp:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/yWGX2YZtv5untT0dJ7SpOZrAX9mLTeIYarAIIQEYLrZTQNNFj7A8rx6/GrPfDncPmdihV6Y9nkA+Ot4nrIXaDSGElH6KfjdzpBSpVo8ttVU8Xitx/7hw/imWmYD4wXy6Iqjje9mOGYj/uX0bjYf/5nsaLcpY9fqDZ5hNTD8/wi+27bB+CzfOVcqSiq0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HpNJFDKjxr4dHOunv3rcY9rANNC7dbR4WFkbhIP7ddFxSxTK3Cr0nzgFMz2+05Su37saTsWJRVS5VnuHnnAnmtp8vPnKne+1NY4jlZwtDfWpob6ijzhQ098fyLVmn/bJ97PMPtQJ5r8Dxck5VUMyqXP0wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(Me,Le,Z){},l2Kq:function(Me,Le,Z){Me.exports=Z.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Me,Le,Z){(function(ie){ie(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function(X,R){var Q=ie.getMode(X,"text/html"),B=Q.name=="null";function _(z){if(ie.findModeByName){var F=ie.findModeByName(z);F&&(z=F.mime||F.mimes[0])}var ee=ie.getMode(X,z);return ee.name=="null"?null:ee}R.highlightFormatting===void 0&&(R.highlightFormatting=!1),R.maxBlockquoteDepth===void 0&&(R.maxBlockquoteDepth=0),R.taskLists===void 0&&(R.taskLists=!1),R.strikethrough===void 0&&(R.strikethrough=!1),R.emoji===void 0&&(R.emoji=!1),R.fencedCodeBlockHighlighting===void 0&&(R.fencedCodeBlockHighlighting=!0),R.fencedCodeBlockDefaultMode===void 0&&(R.fencedCodeBlockDefaultMode="text/plain"),R.xml===void 0&&(R.xml=!0),R.tokenTypeOverrides===void 0&&(R.tokenTypeOverrides={});var G={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 j in G)G.hasOwnProperty(j)&&R.tokenTypeOverrides[j]&&(G[j]=R.tokenTypeOverrides[j]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,T=R.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,k=/^ {0,3}(?:\={1,}|-{2,})\s*$/,D=/^[^#!\[\]*_\\<>` "'(~:]+/,w=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,C=/^\s*\[[^\]]+?\]:.*$/,h=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,o=" ";function l(z,F,ee){return F.f=F.inline=ee,ee(z,F)}function d(z,F,ee){return F.f=F.block=ee,ee(z,F)}function A(z){return!z||!/\S/.test(z.string)}function f(z){if(z.linkTitle=!1,z.linkHref=!1,z.linkText=!1,z.em=!1,z.strong=!1,z.strikethrough=!1,z.quote=0,z.indentedCode=!1,z.f==L){var F=B;if(!F){var ee=ie.innerMode(Q,z.htmlState);F=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}F&&(z.f=u,z.block=g,z.htmlState=null)}return z.trailingSpace=0,z.trailingSpaceNewLine=!1,z.prevLine=z.thisLine,z.thisLine={stream:null},null}function g(z,F){var ee=z.column()===F.indentation,oe=A(F.prevLine.stream),le=F.indentedCode,ve=F.prevLine.hr,Ie=F.list!==!1,xe=(F.listStack[F.listStack.length-1]||0)+3;F.indentedCode=!1;var Ce=F.indentation;if(F.indentationDiff===null&&(F.indentationDiff=F.indentation,Ie)){for(F.list=null;Ce<F.listStack[F.listStack.length-1];)F.listStack.pop(),F.listStack.length?F.indentation=F.listStack[F.listStack.length-1]:F.list=!1;F.list!==!1&&(F.indentationDiff=Ce-F.listStack[F.listStack.length-1])}var Te=!oe&&!ve&&!F.prevLine.header&&(!Ie||!le)&&!F.prevLine.fencedCodeEnd,Se=(F.list===!1||ve||oe)&&F.indentation<=xe&&z.match(O),pe=null;if(F.indentationDiff>=4&&(le||F.prevLine.fencedCodeEnd||F.prevLine.header||oe))return z.skipToEnd(),F.indentedCode=!0,G.code;if(z.eatSpace())return null;if(ee&&F.indentation<=xe&&(pe=z.match(T))&&pe[1].length<=6)return F.quote=0,F.header=pe[1].length,F.thisLine.header=!0,R.highlightFormatting&&(F.formatting="header"),F.f=F.inline,m(F);if(F.indentation<=xe&&z.eat(">"))return F.quote=ee?1:F.quote+1,R.highlightFormatting&&(F.formatting="quote"),z.eatSpace(),m(F);if(!Se&&!F.setext&&ee&&F.indentation<=xe&&(pe=z.match(M))){var se=pe[1]?"ol":"ul";return F.indentation=Ce+z.current().length,F.list=!0,F.quote=0,F.listStack.push(F.indentation),F.em=!1,F.strong=!1,F.code=!1,F.strikethrough=!1,R.taskLists&&z.match(y,!1)&&(F.taskList=!0),F.f=F.inline,R.highlightFormatting&&(F.formatting=["list","list-"+se]),m(F)}else{if(ee&&F.indentation<=xe&&(pe=z.match(w,!0)))return F.quote=0,F.fencedEndRE=new RegExp(pe[1]+"+ *$"),F.localMode=R.fencedCodeBlockHighlighting&&_(pe[2]||R.fencedCodeBlockDefaultMode),F.localMode&&(F.localState=ie.startState(F.localMode)),F.f=F.block=E,R.highlightFormatting&&(F.formatting="code-block"),F.code=-1,m(F);if(F.setext||(!Te||!Ie)&&!F.quote&&F.list===!1&&!F.code&&!Se&&!C.test(z.string)&&(pe=z.lookAhead(1))&&(pe=pe.match(k)))return F.setext?(F.header=F.setext,F.setext=0,z.skipToEnd(),R.highlightFormatting&&(F.formatting="header")):(F.header=pe[0].charAt(0)=="="?1:2,F.setext=F.header),F.thisLine.header=!0,F.f=F.inline,m(F);if(Se)return z.skipToEnd(),F.hr=!0,F.thisLine.hr=!0,G.hr;if(z.peek()==="[")return l(z,F,P)}return l(z,F,F.inline)}function L(z,F){var ee=Q.token(z,F.htmlState);if(!B){var oe=ie.innerMode(Q,F.htmlState);(oe.mode.name=="xml"&&oe.state.tagStart===null&&!oe.state.context&&oe.state.tokenize.isInText||F.md_inside&&z.current().indexOf(">")>-1)&&(F.f=u,F.block=g,F.htmlState=null)}return ee}function E(z,F){var ee=F.listStack[F.listStack.length-1]||0,oe=F.indentation<ee,le=ee+3;if(F.fencedEndRE&&F.indentation<=le&&(oe||z.match(F.fencedEndRE))){R.highlightFormatting&&(F.formatting="code-block");var ve;return oe||(ve=m(F)),F.localMode=F.localState=null,F.block=g,F.f=u,F.fencedEndRE=null,F.code=0,F.thisLine.fencedCodeEnd=!0,oe?d(z,F,F.block):ve}else return F.localMode?F.localMode.token(z,F.localState):(z.skipToEnd(),G.code)}function m(z){var F=[];if(z.formatting){F.push(G.formatting),typeof z.formatting=="string"&&(z.formatting=[z.formatting]);for(var ee=0;ee<z.formatting.length;ee++)F.push(G.formatting+"-"+z.formatting[ee]),z.formatting[ee]==="header"&&F.push(G.formatting+"-"+z.formatting[ee]+"-"+z.header),z.formatting[ee]==="quote"&&(!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=z.quote?F.push(G.formatting+"-"+z.formatting[ee]+"-"+z.quote):F.push("error"))}if(z.taskOpen)return F.push("meta"),F.length?F.join(" "):null;if(z.taskClosed)return F.push("property"),F.length?F.join(" "):null;if(z.linkHref?F.push(G.linkHref,"url"):(z.strong&&F.push(G.strong),z.em&&F.push(G.em),z.strikethrough&&F.push(G.strikethrough),z.emoji&&F.push(G.emoji),z.linkText&&F.push(G.linkText),z.code&&F.push(G.code),z.image&&F.push(G.image),z.imageAltText&&F.push(G.imageAltText,"link"),z.imageMarker&&F.push(G.imageMarker)),z.header&&F.push(G.header,G.header+"-"+z.header),z.quote&&(F.push(G.quote),!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=z.quote?F.push(G.quote+"-"+z.quote):F.push(G.quote+"-"+R.maxBlockquoteDepth)),z.list!==!1){var oe=(z.listStack.length-1)%3;oe?oe===1?F.push(G.list2):F.push(G.list3):F.push(G.list1)}return z.trailingSpaceNewLine?F.push("trailing-space-new-line"):z.trailingSpace&&F.push("trailing-space-"+(z.trailingSpace%2?"a":"b")),F.length?F.join(" "):null}function c(z,F){return z.match(D,!0)?m(F):void 0}function u(z,F){var ee=F.text(z,F);if(typeof ee!="undefined")return ee;if(F.list)return F.list=null,m(F);if(F.taskList){var oe=z.match(y,!0)[1]===" ";return oe?F.taskOpen=!0:F.taskClosed=!0,R.highlightFormatting&&(F.formatting="task"),F.taskList=!1,m(F)}if(F.taskOpen=!1,F.taskClosed=!1,F.header&&z.match(/^#+$/,!0))return R.highlightFormatting&&(F.formatting="header"),m(F);var le=z.next();if(F.linkTitle){F.linkTitle=!1;var ve=le;le==="("&&(ve=")"),ve=(ve+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ie="^\\s*(?:[^"+ve+"\\\\]+|\\\\\\\\|\\\\.)"+ve;if(z.match(new RegExp(Ie),!0))return G.linkHref}if(le==="`"){var xe=F.formatting;R.highlightFormatting&&(F.formatting="code"),z.eatWhile("`");var Ce=z.current().length;if(F.code==0&&(!F.quote||Ce==1))return F.code=Ce,m(F);if(Ce==F.code){var Te=m(F);return F.code=0,Te}else return F.formatting=xe,m(F)}else if(F.code)return m(F);if(le==="\\"&&(z.next(),R.highlightFormatting)){var Se=m(F),pe=G.formatting+"-escape";return Se?Se+" "+pe:pe}if(le==="!"&&z.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return F.imageMarker=!0,F.image=!0,R.highlightFormatting&&(F.formatting="image"),m(F);if(le==="["&&F.imageMarker&&z.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return F.imageMarker=!1,F.imageAltText=!0,R.highlightFormatting&&(F.formatting="image"),m(F);if(le==="]"&&F.imageAltText){R.highlightFormatting&&(F.formatting="image");var Se=m(F);return F.imageAltText=!1,F.image=!1,F.inline=F.f=b,Se}if(le==="["&&!F.image)return F.linkText&&z.match(/^.*?\]/)||(F.linkText=!0,R.highlightFormatting&&(F.formatting="link")),m(F);if(le==="]"&&F.linkText){R.highlightFormatting&&(F.formatting="link");var Se=m(F);return F.linkText=!1,F.inline=F.f=z.match(/\(.*?\)| ?\[.*?\]/,!1)?b:u,Se}if(le==="<"&&z.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=a,R.highlightFormatting&&(F.formatting="link");var Se=m(F);return Se?Se+=" ":Se="",Se+G.linkInline}if(le==="<"&&z.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=a,R.highlightFormatting&&(F.formatting="link");var Se=m(F);return Se?Se+=" ":Se="",Se+G.linkEmail}if(R.xml&&le==="<"&&z.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var se=z.string.indexOf(">",z.pos);if(se!=-1){var De=z.string.substring(z.start,se);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(De)&&(F.md_inside=!0)}return z.backUp(1),F.htmlState=ie.startState(Q),d(z,F,L)}if(R.xml&&le==="<"&&z.match(/^\/\w*?>/))return F.md_inside=!1,"tag";if(le==="*"||le==="_"){for(var Ye=1,Ge=z.pos==1?" ":z.string.charAt(z.pos-2);Ye<3&&z.eat(le);)Ye++;var $e=z.peek()||" ",et=!/\s/.test($e)&&(!h.test($e)||/\s/.test(Ge)||h.test(Ge)),Re=!/\s/.test(Ge)&&(!h.test(Ge)||/\s/.test($e)||h.test($e)),Be=null,He=null;if(Ye%2&&(!F.em&&et&&(le==="*"||!Re||h.test(Ge))?Be=!0:F.em==le&&Re&&(le==="*"||!et||h.test($e))&&(Be=!1)),Ye>1&&(!F.strong&&et&&(le==="*"||!Re||h.test(Ge))?He=!0:F.strong==le&&Re&&(le==="*"||!et||h.test($e))&&(He=!1)),He!=null||Be!=null){R.highlightFormatting&&(F.formatting=Be==null?"strong":He==null?"em":"strong em"),Be===!0&&(F.em=le),He===!0&&(F.strong=le);var Te=m(F);return Be===!1&&(F.em=!1),He===!1&&(F.strong=!1),Te}}else if(le===" "&&(z.eat("*")||z.eat("_"))){if(z.peek()===" ")return m(F);z.backUp(1)}if(R.strikethrough){if(le==="~"&&z.eatWhile(le)){if(F.strikethrough){R.highlightFormatting&&(F.formatting="strikethrough");var Te=m(F);return F.strikethrough=!1,Te}else if(z.match(/^[^\s]/,!1))return F.strikethrough=!0,R.highlightFormatting&&(F.formatting="strikethrough"),m(F)}else if(le===" "&&z.match(/^~~/,!0)){if(z.peek()===" ")return m(F);z.backUp(2)}}if(R.emoji&&le===":"&&z.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){F.emoji=!0,R.highlightFormatting&&(F.formatting="emoji");var Xe=m(F);return F.emoji=!1,Xe}return le===" "&&(z.match(/^ +$/,!1)?F.trailingSpace++:F.trailingSpace&&(F.trailingSpaceNewLine=!0)),m(F)}function a(z,F){var ee=z.next();if(ee===">"){F.f=F.inline=u,R.highlightFormatting&&(F.formatting="link");var oe=m(F);return oe?oe+=" ":oe="",oe+G.linkInline}return z.match(/^[^>]+/,!0),G.linkInline}function b(z,F){if(z.eatSpace())return null;var ee=z.next();return ee==="("||ee==="["?(F.f=F.inline=x(ee==="("?")":"]"),R.highlightFormatting&&(F.formatting="link-string"),F.linkHref=!0,m(F)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(z){return function(F,ee){var oe=F.next();if(oe===z){ee.f=ee.inline=u,R.highlightFormatting&&(ee.formatting="link-string");var le=m(ee);return ee.linkHref=!1,le}return F.match(v[z]),ee.linkHref=!0,m(ee)}}function P(z,F){return z.match(/^([^\]\\]|\\.)*\]:/,!1)?(F.f=H,z.next(),R.highlightFormatting&&(F.formatting="link"),F.linkText=!0,m(F)):l(z,F,u)}function H(z,F){if(z.match(/^\]:/,!0)){F.f=F.inline=V,R.highlightFormatting&&(F.formatting="link");var ee=m(F);return F.linkText=!1,ee}return z.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function V(z,F){return z.eatSpace()?null:(z.match(/^[^\s]+/,!0),z.peek()===void 0?F.linkTitle=!0:z.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),F.f=F.inline=u,G.linkHref+" url")}var $={startState:function(){return{f:g,prevLine:{stream:null},thisLine:{stream:null},block:g,htmlState:null,indentation:0,inline:u,text:c,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(z){return{f:z.f,prevLine:z.prevLine,thisLine:z.thisLine,block:z.block,htmlState:z.htmlState&&ie.copyState(Q,z.htmlState),indentation:z.indentation,localMode:z.localMode,localState:z.localMode?ie.copyState(z.localMode,z.localState):null,inline:z.inline,text:z.text,formatting:!1,linkText:z.linkText,linkTitle:z.linkTitle,linkHref:z.linkHref,code:z.code,em:z.em,strong:z.strong,strikethrough:z.strikethrough,emoji:z.emoji,header:z.header,setext:z.setext,hr:z.hr,taskList:z.taskList,list:z.list,listStack:z.listStack.slice(0),quote:z.quote,indentedCode:z.indentedCode,trailingSpace:z.trailingSpace,trailingSpaceNewLine:z.trailingSpaceNewLine,md_inside:z.md_inside,fencedEndRE:z.fencedEndRE}},token:function(z,F){if(F.formatting=!1,z!=F.thisLine.stream){if(F.header=0,F.hr=!1,z.match(/^\s*$/,!0))return f(F),null;if(F.prevLine=F.thisLine,F.thisLine={stream:z},F.taskList=!1,F.trailingSpace=0,F.trailingSpaceNewLine=!1,!F.localState&&(F.f=F.block,F.f!=L)){var ee=z.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(F.indentation=ee,F.indentationDiff=null,ee>0)return null}}return F.f(z,F)},innerMode:function(z){return z.block==L?{state:z.htmlState,mode:Q}:z.localState?{state:z.localState,mode:z.localMode}:{state:z,mode:$}},indent:function(z,F,ee){return z.block==L&&Q.indent?Q.indent(z.htmlState,F,ee):z.localState&&z.localMode.indent?z.localMode.indent(z.localState,F,ee):ie.Pass},blankLine:f,getType:m,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return $},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},lzim:function(Me,Le,Z){"use strict";var ie=Z("E7E6"),X=Z.n(ie);Z.d(Le,"w",function(){return X.a});var R=Z("/GNS"),Q=Z.n(R);Z.d(Le,"v",function(){return Q.a});var B=Z("FOrL"),_=Z.n(B);Z.d(Le,"q",function(){return _.a});var G=Z("HpTS"),j=Z.n(G);Z.d(Le,"x",function(){return j.a});var O=Z("tWlo"),M=Z.n(O);Z.d(Le,"a",function(){return M.a});var y=Z("7ZXX"),T=Z.n(y);Z.d(Le,"l",function(){return T.a});var k=Z("GABl"),D=Z.n(k);Z.d(Le,"e",function(){return D.a});var w=Z("onxn"),C=Z.n(w);Z.d(Le,"n",function(){return C.a});var h=Z("nKGa"),o=Z.n(h);Z.d(Le,"m",function(){return o.a});var l=Z("4qgm"),d=Z.n(l);Z.d(Le,"y",function(){return d.a});var A=Z("JeFH"),f=Z.n(A);Z.d(Le,"b",function(){return f.a});var g=Z("ji0R"),L=Z.n(g);Z.d(Le,"i",function(){return L.a});var E=Z("W6BS"),m=Z.n(E);Z.d(Le,"z",function(){return m.a});var c=Z("kPYp"),u=Z.n(c);Z.d(Le,"A",function(){return u.a});var a=Z("nukY"),b=Z.n(a),v=Z("4u4S"),x=Z.n(v),P=Z("yslc"),H=Z.n(P),V=Z("l2Kq"),$=Z.n(V),z=Z("RMFE"),F=Z.n(z);Z.d(Le,"o",function(){return F.a});var ee=Z("TGq3"),oe=Z.n(ee),le=Z("SMhR"),ve=Z.n(le),Ie=Z("8/bI"),xe=Z.n(Ie);Z.d(Le,"j",function(){return xe.a});var Ce=Z("JWDV"),Te=Z.n(Ce),Se=Z("Xsq0"),pe=Z.n(Se);Z.d(Le,"p",function(){return pe.a});var se=Z("Ohmc"),De=Z.n(se);Z.d(Le,"c",function(){return De.a});var Ye=Z("csWT"),Ge=Z.n(Ye);Z.d(Le,"d",function(){return Ge.a});var $e=Z("7v3h"),et=Z.n($e);Z.d(Le,"k",function(){return et.a});var Re=Z("cRFk"),Be=Z.n(Re);Z.d(Le,"u",function(){return Be.a});var He=Z("kPWJ"),Xe=Z.n(He);Z.d(Le,"t",function(){return Xe.a});var Ke=Z("qgvg"),Fe=Z.n(Ke);Z.d(Le,"r",function(){return Fe.a});var Pe=Z("FPkq"),ot=Z.n(Pe);Z.d(Le,"s",function(){return ot.a});var Je=Z("A/g1"),Ze=Z.n(Je);Z.d(Le,"f",function(){return Ze.a});var tt=Z("Nmxd"),ht=Z.n(tt);Z.d(Le,"g",function(){return ht.a});var rt=Z("5D2P"),Ve=Z.n(rt);Z.d(Le,"h",function(){return Ve.a});var Ee=Z("djh8"),it=Z.n(Ee),qe=Z("Jq4h"),we=Z.n(qe)},nKGa:function(Me,Le,Z){Me.exports=Z.p+"static/export_exercise-template.f7655c19.png"},nZ20:function(Me,Le,Z){Me.exports={icons:"icons___3O80F"}},nukY:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EXYdzPzv4hoToZtolVPoQUmgV6E/QVm/hMRNaVQX61SRi3wDOiwg5Tya0qpn2TUJlrtFFqgIujFnv27zPztFOqsVcqgBaqCzsyGlPJXzPy5DNpFq5wyC1QFHXr29fVN6+/v/zszfyBlemt1MmYBW9Bhi3w+v7hQKJwkog0Zs41WN0UWcAS96K9vI6J3mHl+inTXqmTIAq5Ahz1yudxHDcN4k5mbM2QfrWpKLOAa9CLsB4ioLSW6azUyZAFPoBdh/w4RvZYhG2lVU2ABz6AXYf8FEb2cAv21ChmxgC/Qu7q6moeHh/9KRB/JiJ20mnVuAV+gQ+fu7u4FQ0ND/yGiLXVuAy1+BizgG/Ri2HEjEZ1k5kUZsJVWsY4tEAh06N3e3v7B8fHxt4hoWh3b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dl6QfsAHmYlMZcEpiXsak6tnQY70bWubrUepjkNJTKTbGv8s8SSlOaD5Z0LwhL4XWmQvSa42rWrgf7+Fn7byVVV5KX6mLbTWcKueEa6etz+M+OphwqlZtmnSUME1bjJyb6vOmm8tc3PvrCeMIJZTLt5zBb1i59tUxuvDeRm+14RscbD1IB9Uo6ZnHRfp2XsX4489Ujy8eT08YTAjSg6Plf333p9HDLpzPlpnEvg4kYH83TrZrxcugy7IkU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(Me,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var X=ie.Pos;function R(h,o){return h.line-o.line||h.ch-o.ch}var Q="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",B=Q+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",_=new RegExp("<(/?)(["+Q+"]["+B+"]*)","g");function G(h,o,l,d){this.line=o,this.ch=l,this.cm=h,this.text=h.getLine(o),this.min=d?Math.max(d.from,h.firstLine()):h.firstLine(),this.max=d?Math.min(d.to-1,h.lastLine()):h.lastLine()}function j(h,o){var l=h.cm.getTokenTypeAt(X(h.line,o));return l&&/\btag\b/.test(l)}function O(h){return h.line>=h.max?void 0:(h.ch=0,h.text=h.cm.getLine(++h.line),!0)}function M(h){return h.line<=h.min?void 0:(h.text=h.cm.getLine(--h.line),h.ch=h.text.length,!0)}function y(h){for(;;){var o=h.text.indexOf(">",h.ch);if(o==-1){if(O(h))continue;return}if(!j(h,o+1)){h.ch=o+1;continue}var l=h.text.lastIndexOf("/",o),d=l>-1&&!/\S/.test(h.text.slice(l+1,o));return h.ch=o+1,d?"selfClose":"regular"}}function T(h){for(;;){var o=h.ch?h.text.lastIndexOf("<",h.ch-1):-1;if(o==-1){if(M(h))continue;return}if(!j(h,o+1)){h.ch=o;continue}_.lastIndex=o,h.ch=o;var l=_.exec(h.text);if(l&&l.index==o)return l}}function k(h){for(;;){_.lastIndex=h.ch;var o=_.exec(h.text);if(!o){if(O(h))continue;return}if(!j(h,o.index+1)){h.ch=o.index+1;continue}return h.ch=o.index+o[0].length,o}}function D(h){for(;;){var o=h.ch?h.text.lastIndexOf(">",h.ch-1):-1;if(o==-1){if(M(h))continue;return}if(!j(h,o+1)){h.ch=o;continue}var l=h.text.lastIndexOf("/",o),d=l>-1&&!/\S/.test(h.text.slice(l+1,o));return h.ch=o+1,d?"selfClose":"regular"}}function w(h,o){for(var l=[];;){var d=k(h),A,f=h.line,g=h.ch-(d?d[0].length:0);if(!d||!(A=y(h)))return;if(A=="selfClose")continue;if(d[1]){for(var L=l.length-1;L>=0;--L)if(l[L]==d[2]){l.length=L;break}if(L<0&&(!o||o==d[2]))return{tag:d[2],from:X(f,g),to:X(h.line,h.ch)}}else l.push(d[2])}}function C(h,o){for(var l=[];;){var d=D(h);if(!d)return;if(d=="selfClose"){T(h);continue}var A=h.line,f=h.ch,g=T(h);if(!g)return;if(g[1])l.push(g[2]);else{for(var L=l.length-1;L>=0;--L)if(l[L]==g[2]){l.length=L;break}if(L<0&&(!o||o==g[2]))return{tag:g[2],from:X(h.line,h.ch),to:X(A,f)}}}}ie.registerHelper("fold","xml",function(h,o){for(var l=new G(h,o.line,0);;){var d=k(l);if(!d||l.line!=o.line)return;var A=y(l);if(!A)return;if(!d[1]&&A!="selfClose"){var f=X(l.line,l.ch),g=w(l,d[2]);return g&&R(g.from,f)>0?{from:f,to:g.from}:null}}}),ie.findMatchingTag=function(h,o,l){var d=new G(h,o.line,o.ch,l);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var A=y(d),f=A&&X(d.line,d.ch),g=A&&T(d);if(!A||!g||R(d,o)>0)return;var L={from:X(d.line,d.ch),to:f,tag:g[2]};return A=="selfClose"?{open:L,close:null,at:"open"}:g[1]?{open:C(d,g[2]),close:L,at:"close"}:(d=new G(h,f.line,f.ch,l),{open:L,close:w(d,g[2]),at:"open"})},ie.findEnclosingTag=function(h,o,l,d){for(var A=new G(h,o.line,o.ch,l);;){var f=C(A,d);if(!f)break;var g=new G(h,o.line,o.ch,l),L=w(g,f.tag);if(L)return{open:f,close:L}}},ie.scanForClosingTag=function(h,o,l,d){var A=new G(h,o.line,o.ch,d?{from:0,to:d}:null);return w(A,l)}})},p5ED:function(Me,Le,Z){"use strict";var ie=Z("+L6B"),X=Z("2/Rp"),R=Z("5Dmo"),Q=Z("3S7+"),B=Z("k1fw"),_=Z("9og8"),G=Z("tJVT"),j=Z("WmNS"),O=Z.n(j),M=Z("q1tI"),y=Z.n(M),T=Z("vHTk"),k=Z.n(T),D=Z("yEEn"),w=Z("ZW9T"),C=Z("1vsH"),h=Z("V0Rq"),o=Z("m3rI");Le.a=function(l){var d,A,f,g,L,E,m,c=l.editOffice,u=c===void 0?"view":c,a=l.data,b=l.theme,v=l.type,x=l.filename,P=l.monacoEditor,H=l.className,V=l.style,$=l.close,z=l.onClose,F=l.hasMask,ee=l.disabledDownload,oe=Object(M.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),le=Object(G.a)(oe,2),ve=le[0],Ie=le[1],xe=Object(M.useState)(""),Ce=Object(G.a)(xe,2),Te=Ce[0],Se=Ce[1],pe=Object(M.useState)(),se=Object(G.a)(pe,2),De=se[0],Ye=se[1],Ge=window.ENV==="build"?"/react/build":"",$e=o.a.PROXY_SERVER||location.origin,et,Re=1024*1024,Be=10*Re,He=Object(M.useRef)();(d=a)!==null&&d!==void 0&&d.startsWith("/api")&&v!=="txt"&&(a=o.a.API_SERVER+a),v==="office"&&(et=Object(C.T)(a).filesize,et>Be&&(v="other")),x&&P&&(P.filename=x),Object(M.useEffect)(function(){var Pe,ot,Je=(Pe=document.cookie)===null||Pe===void 0||((ot=Pe.replace(/\s/g,""))===null||ot===void 0)?void 0:ot.split(";");Je==null||Je.map(function(Ze){var tt=Ze.split("=");tt[0]==="_educoder_session"&&Se(tt[1])})},[]),Object(M.useEffect)(function(){v==="office"&&Xe()},[v,a]);var Xe=function(){var Pe=Object(_.a)(O.a.mark(function ot(){var Je,Ze,tt;return O.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return console.log("data:",a),Je=a,a.startsWith("http")||(Je=location.origin+Je),Ze=new URL(Je).pathname.split("/").pop(),rt.next=6,Object(h.W)({attachment_id:Ze});case 6:tt=rt.sent,Ye(tt);case 8:case"end":return rt.stop()}},ot)}));return function(){return Pe.apply(this,arguments)}}(),Ke=function(){if(a.startsWith("http")||a.startsWith("blob:")){Fe();return}Object(C.z)(x||"educoder",a,x)},Fe=function(){Object(C.x)(x||"educoder",decodeURIComponent(a))};return y.a.createElement("div",{style:Object(B.a)({},V||{}),className:"".concat(F&&k.a.bgBlack," ").concat(v?k.a.wrp:"hide")},$&&y.a.createElement("div",{className:k.a.close,ref:He},!ee&&y.a.createElement(Q.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return He.current}},y.a.createElement("span",{onClick:Fe},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(Q.a,{title:"\u5173\u95ED",getPopupContainer:function(){return He.current}},y.a.createElement("span",{className:"",onClick:z},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(k.a[H]," ").concat(H," ").concat(k.a.monaco," ").concat(v==="txt"?"show":"hide")},v==="txt"&&y.a.createElement(w.b,P)),v==="audio"&&y.a.createElement("audio",{src:"".concat(((A=a)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((f=a)===null||f===void 0?void 0:f.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(a),autoPlay:!0}),v==="video"&&y.a.createElement(y.a.Fragment,null,((g=a)===null||g===void 0?void 0:g.indexOf("http"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(a),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(a),autoPlay:!0})),v==="office"&&De&&y.a.createElement("iframe",{src:"".concat(Ge,"/office.html?key=").concat(De.key,"&url=").concat($e+De.url,"&callbackUrl=").concat($e+De.callbackUrl,"&fileType=").concat(De.fileType,"&title=").concat(De.title,"&model=").concat(u,"&officeServer=").concat(o.a.OFFICE_SERVER,"&disabledDownload=").concat(!!ee)}),v==="html"&&y.a.createElement("iframe",{src:a+"&disposition=inline"}),v==="pdf"&&y.a.createElement("iframe",{src:"".concat(Ge,"/js/pdfview/index.html?url=").concat(a,"&disabledDownload=").concat(!!ee)}),v==="image"&&y.a.createElement("img",{src:"".concat(((L=a)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((E=a)===null||E===void 0?void 0:E.indexOf("https://"))>-1||(m=a)!==null&&m!==void 0&&m.startsWith("/api")?"":"data:image/png;base64,").concat(a)}),v==="other"&&y.a.createElement("div",null,y.a.createElement(X.a,{type:"primary",size:"large",onClick:Ke},y.a.createElement(D.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),v==="download"&&y.a.createElement(X.a,{type:"primary",size:"large",onClick:Ke},y.a.createElement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JPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(Me,Le){const Z=/[&<>"']/,ie=/[&<>"']/g,X=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},B=E=>Q[E];function _(E,m){if(m){if(Z.test(E))return E.replace(ie,B)}else if(X.test(E))return E.replace(R,B);return E}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function j(E){return E.replace(G,(m,c)=>(c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""))}const O=/(^|[^\[])\^/g;function M(E,m){E=E.source||E,m=m||"";const c={replace:(u,a)=>(a=a.source||a,a=a.replace(O,"$1"),E=E.replace(u,a),c),getRegex:()=>new RegExp(E,m)};return c}const y=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(E,m,c){if(E){let u;try{u=decodeURIComponent(j(c)).replace(y,"").toLowerCase()}catch(a){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}m&&!T.test(c)&&(c=o(m,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(u){return null}return c}const D={},w=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(E,m){D[" "+E]||(w.test(E)?D[" "+E]=E+"/":D[" "+E]=f(E,"/",!0)),E=D[" "+E];const c=E.indexOf(":")===-1;return m.substring(0,2)==="//"?c?m:E.replace(C,"$1")+m:m.charAt(0)==="/"?c?m:E.replace(h,"$1")+m:E+m}const l={exec:function(){}};function d(E){let m=1,c,u;for(;m<arguments.length;m++){c=arguments[m];for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(E[u]=c[u])}return E}function A(E,m){const c=E.replace(/\|/g,(b,v,x)=>{let P=!1,H=v;for(;--H>=0&&x[H]==="\\";)P=!P;return P?"|":" |"}),u=c.split(/ \|/);let a=0;if(u.length>m)u.splice(m);else for(;u.length<m;)u.push("");for(;a<u.length;a++)u[a]=u[a].trim().replace(/\\\|/g,"|");return u}function f(E,m,c){const u=E.length;if(u===0)return"";let a=0;for(;a<u;){const b=E.charAt(u-a-1);if(b===m&&!c)a++;else if(b!==m&&c)a++;else break}return E.substr(0,u-a)}function g(E,m){if(E.indexOf(m[1])===-1)return-1;const c=E.length;let u=0,a=0;for(;a<c;a++)if(E[a]==="\\")a++;else if(E[a]===m[0])u++;else if(E[a]===m[1]&&(u--,u<0))return a;return-1}function L(E){E&&E.sanitize&&!E.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")}Me.exports={escape:_,unescape:j,edit:M,cleanUrl:k,resolveUrl:o,noopTest:l,merge:d,splitCells:A,rtrim:f,findClosingBracket:g,checkSanitizeDeprecation:L}},tWlo:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prY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39BOp3Nt+YiUViLQKNjBH8sV7EXNivhslgb4xb2J28SMtMSRmbrwBBYpZPOI+xw4J2aka23tzB4VETrdct6zoCECC7wjjWIy1tbewZT//9R4RYzxZOtZTwK0C2vEjHjT2Ov3sx2d3TA7ZxPzuhrB5nVdiQ8pNPPvKP+XkEjjbYKtXm0VOpHe5x01KDDI72dFtmI+EGz1IkDyOeIvnlETH/T/digqKoLXeLLts3UNgY0REXGQZpmpqtCmrjV1/ZWcrEzIzEhnTtwQhwQb/5vNDc1dkinak4gDsMUFSEhwMJQ9vhueqihnWhYBMhnokYRGowGLZRwcW9fWLsGxTV6HqA8F6sMfR5z0qiDUKsjQpoEuPQ1SsSILVPDd1FJTrDA/Fwry9NDX1w9dxh7MSs2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(Me,Le,Z){typeof window!="undefined"&&function(X,R){Me.exports=R()}(this,function(){return function(ie){var X={};function R(Q){if(X[Q])return X[Q].exports;var B=X[Q]={i:Q,l:!1,exports:{}};return ie[Q].call(B.exports,B,B.exports,R),B.l=!0,B.exports}return R.m=ie,R.c=X,R.d=function(Q,B,_){R.o(Q,B)||Object.defineProperty(Q,B,{enumerable:!0,get:_})},R.r=function(Q){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Q,"__esModule",{value:!0})},R.t=function(Q,B){if(B&1&&(Q=R(Q)),B&8)return Q;if(B&4&&typeof Q=="object"&&Q&&Q.__esModule)return Q;var _=Object.create(null);if(R.r(_),Object.defineProperty(_,"default",{enumerable:!0,value:Q}),B&2&&typeof Q!="string")for(var G in Q)R.d(_,G,function(j){return Q[j]}.bind(null,G));return _},R.n=function(Q){var B=Q&&Q.__esModule?function(){return Q.default}:function(){return Q};return R.d(B,"a",B),B},R.o=function(Q,B){return Object.prototype.hasOwnProperty.call(Q,B)},R.p="/dist/",R(R.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,X,R){"use strict";var Q=Object.prototype.hasOwnProperty,B="~";function _(){}Object.create&&(_.prototype=Object.create(null),new _().__proto__||(B=!1));function G(y,T,k){this.fn=y,this.context=T,this.once=k||!1}function j(y,T,k,D,w){if(typeof k!="function")throw new TypeError("The listener must be a function");var C=new G(k,D||y,w),h=B?B+T:T;return y._events[h]?y._events[h].fn?y._events[h]=[y._events[h],C]:y._events[h].push(C):(y._events[h]=C,y._eventsCount++),y}function O(y,T){--y._eventsCount===0?y._events=new _:delete y._events[T]}function M(){this._events=new _,this._eventsCount=0}M.prototype.eventNames=function(){var T=[],k,D;if(this._eventsCount===0)return T;for(D in k=this._events)Q.call(k,D)&&T.push(B?D.slice(1):D);return Object.getOwnPropertySymbols?T.concat(Object.getOwnPropertySymbols(k)):T},M.prototype.listeners=function(T){var k=B?B+T:T,D=this._events[k];if(!D)return[];if(D.fn)return[D.fn];for(var w=0,C=D.length,h=new Array(C);w<C;w++)h[w]=D[w].fn;return h},M.prototype.listenerCount=function(T){var k=B?B+T:T,D=this._events[k];return D?D.fn?1:D.length:0},M.prototype.emit=function(T,k,D,w,C,h){var o=B?B+T:T;if(!this._events[o])return!1;var l=this._events[o],d=arguments.length,A,f;if(l.fn){l.once&&this.removeListener(T,l.fn,void 0,!0);switch(d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,k),!0;case 3:return l.fn.call(l.context,k,D),!0;case 4:return l.fn.call(l.context,k,D,w),!0;case 5:return l.fn.call(l.context,k,D,w,C),!0;case 6:return l.fn.call(l.context,k,D,w,C,h),!0}for(f=1,A=new Array(d-1);f<d;f++)A[f-1]=arguments[f];l.fn.apply(l.context,A)}else{var g=l.length,L;for(f=0;f<g;f++){l[f].once&&this.removeListener(T,l[f].fn,void 0,!0);switch(d){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,k);break;case 3:l[f].fn.call(l[f].context,k,D);break;case 4:l[f].fn.call(l[f].context,k,D,w);break;default:if(!A)for(L=1,A=new Array(d-1);L<d;L++)A[L-1]=arguments[L];l[f].fn.apply(l[f].context,A)}}}return!0},M.prototype.on=function(T,k,D){return j(this,T,k,D,!1)},M.prototype.once=function(T,k,D){return j(this,T,k,D,!0)},M.prototype.removeListener=function(T,k,D,w){var C=B?B+T:T;if(!this._events[C])return this;if(!k)return O(this,C),this;var h=this._events[C];if(h.fn)h.fn===k&&(!w||h.once)&&(!D||h.context===D)&&O(this,C);else{for(var o=0,l=[],d=h.length;o<d;o++)(h[o].fn!==k||w&&!h[o].once||D&&h[o].context!==D)&&l.push(h[o]);l.length?this._events[C]=l.length===1?l[0]:l:O(this,C)}return this},M.prototype.removeAllListeners=function(T){var k;return T?(k=B?B+T:T,this._events[k]&&O(this,k)):(this._events=new _,this._eventsCount=0),this},M.prototype.off=M.prototype.removeListener,M.prototype.addListener=M.prototype.on,M.prefixed=B,M.EventEmitter=M,ie.exports=M},"./node_modules/url-toolkit/src/url-toolkit.js":function(ie,X,R){(function(Q){var B=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,_=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,j=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,O={buildAbsoluteURL:function(M,y,T){if(T=T||{},M=M.trim(),y=y.trim(),!y){if(!T.alwaysNormalize)return M;var k=O.parseURL(M);if(!k)throw new Error("Error trying to parse base URL.");return k.path=O.normalizePath(k.path),O.buildURLFromParts(k)}var D=O.parseURL(y);if(!D)throw new Error("Error trying to parse relative URL.");if(D.scheme)return T.alwaysNormalize?(D.path=O.normalizePath(D.path),O.buildURLFromParts(D)):y;var w=O.parseURL(M);if(!w)throw new Error("Error trying to parse base URL.");if(!w.netLoc&&w.path&&w.path[0]!=="/"){var C=_.exec(w.path);w.netLoc=C[1],w.path=C[2]}w.netLoc&&!w.path&&(w.path="/");var h={scheme:w.scheme,netLoc:D.netLoc,path:null,params:D.params,query:D.query,fragment:D.fragment};if(!D.netLoc&&(h.netLoc=w.netLoc,D.path[0]!=="/"))if(!D.path)h.path=w.path,D.params||(h.params=w.params,D.query||(h.query=w.query));else{var o=w.path,l=o.substring(0,o.lastIndexOf("/")+1)+D.path;h.path=O.normalizePath(l)}return h.path===null&&(h.path=T.alwaysNormalize?O.normalizePath(D.path):D.path),O.buildURLFromParts(h)},parseURL:function(M){var y=B.exec(M);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(M){for(M=M.split("").reverse().join("").replace(G,"");M.length!==(M=M.replace(j,"")).length;);return M.split("").reverse().join("")},buildURLFromParts:function(M){return M.scheme+M.netLoc+M.path+M.params+M.query+M.fragment}};ie.exports=O})(this)},"./node_modules/webworkify-webpack/index.js":function(ie,X,R){function Q(T){var k={};function D(C){if(k[C])return k[C].exports;var h=k[C]={i:C,l:!1,exports:{}};return T[C].call(h.exports,h,h.exports,D),h.l=!0,h.exports}D.m=T,D.c=k,D.i=function(C){return C},D.d=function(C,h,o){D.o(C,h)||Object.defineProperty(C,h,{configurable:!1,enumerable:!0,get:o})},D.r=function(C){Object.defineProperty(C,"__esModule",{value:!0})},D.n=function(C){var h=C&&C.__esModule?function(){return C.default}:function(){return C};return D.d(h,"a",h),h},D.o=function(C,h){return Object.prototype.hasOwnProperty.call(C,h)},D.p="/",D.oe=function(C){throw console.error(C),C};var w=D(D.s=ENTRY_MODULE);return w.default||w}var B="[\\.|\\-|\\+|\\w|/|@]+",_="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+B+").*?\\)";function G(T){return(T+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function j(T){return!isNaN(1*T)}function O(T,k,D){var w={};w[D]=[];var C=k.toString(),h=C.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!h)return w;for(var o=h[1],l=new RegExp("(\\\\n|\\W)"+G(o)+_,"g"),d;d=l.exec(C);){if(d[3]==="dll-reference")continue;w[D].push(d[3])}for(l=new RegExp("\\("+G(o)+'\\("(dll-reference\\s('+B+'))"\\)\\)'+_,"g");d=l.exec(C);)T[d[2]]||(w[D].push(d[1]),T[d[2]]=R(d[1]).m),w[d[2]]=w[d[2]]||[],w[d[2]].push(d[4]);for(var A=Object.keys(w),f=0;f<A.length;f++)for(var g=0;g<w[A[f]].length;g++)j(w[A[f]][g])&&(w[A[f]][g]=1*w[A[f]][g]);return w}function M(T){var k=Object.keys(T);return k.reduce(function(D,w){return D||T[w].length>0},!1)}function y(T,k){for(var D={main:[k]},w={main:[]},C={main:{}};M(D);)for(var h=Object.keys(D),o=0;o<h.length;o++){var l=h[o],d=D[l],A=d.pop();if(C[l]=C[l]||{},C[l][A]||!T[l][A])continue;C[l][A]=!0,w[l]=w[l]||[],w[l].push(A);for(var f=O(T,T[l][A],l),g=Object.keys(f),L=0;L<g.length;L++)D[g[L]]=D[g[L]]||[],D[g[L]]=D[g[L]].concat(f[g[L]])}return w}ie.exports=function(T,k){k=k||{};var D={main:R.m},w=k.all?{main:Object.keys(D.main)}:y(D,T),C="";Object.keys(w).filter(function(A){return A!=="main"}).forEach(function(A){for(var f=0;w[A][f];)f++;w[A].push(f),D[A][f]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",C=C+"var "+A+" = ("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+w[A].map(function(g){return""+JSON.stringify(g)+": "+D[A][g].toString()}).join(",")+`});
|
|
`}),C=C+"new (("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+w.main.map(function(A){return""+JSON.stringify(A)+": "+D.main[A].toString()}).join(",")+"}))(self);";var h=new window.Blob([C],{type:"text/javascript"});if(k.bare)return h;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,l=o.createObjectURL(h),d=new window.Worker(l);return d.objectURL=l,d}},"./src/config.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"hlsDefaultConfig",function(){return L}),R.d(X,"mergeConfig",function(){return m}),R.d(X,"enableStreamingMode",function(){return c});var Q=R("./src/controller/abr-controller.ts"),B=R("./src/controller/audio-stream-controller.ts"),_=R("./src/controller/audio-track-controller.ts"),G=R("./src/controller/subtitle-stream-controller.ts"),j=R("./src/controller/subtitle-track-controller.ts"),O=R("./src/controller/buffer-controller.ts"),M=R("./src/controller/timeline-controller.ts"),y=R("./src/controller/cap-level-controller.ts"),T=R("./src/controller/fps-controller.ts"),k=R("./src/controller/eme-controller.ts"),D=R("./src/controller/cmcd-controller.ts"),w=R("./src/utils/xhr-loader.ts"),C=R("./src/utils/fetch-loader.ts"),h=R("./src/utils/cues.ts"),o=R("./src/utils/mediakeys-helper.ts"),l=R("./src/utils/logger.ts");function d(){return d=Object.assign||function(u){for(var a=1;a<arguments.length;a++){var b=arguments[a];for(var v in b)Object.prototype.hasOwnProperty.call(b,v)&&(u[v]=b[v])}return u},d.apply(this,arguments)}function A(u,a){var b=Object.keys(u);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(u);a&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(u,x).enumerable})),b.push.apply(b,v)}return b}function f(u){for(var a=1;a<arguments.length;a++){var b=arguments[a]!=null?arguments[a]:{};a%2?A(Object(b),!0).forEach(function(v){g(u,v,b[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(b)):A(Object(b)).forEach(function(v){Object.defineProperty(u,v,Object.getOwnPropertyDescriptor(b,v))})}return u}function g(u,a,b){return a in u?Object.defineProperty(u,a,{value:b,enumerable:!0,configurable:!0,writable:!0}):u[a]=b,u}var L=f(f({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:w.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Q.default,bufferController:O.default,capLevelController:y.default,fpsController:T.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:o.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},E()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:j.default,timelineController:M.TimelineController,audioStreamController:B.default,audioTrackController:_.default,emeController:k.default,cmcdController:D.default});function E(){return{cueHandler:h.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 m(u,a){if((a.liveSyncDurationCount||a.liveMaxLatencyDurationCount)&&(a.liveSyncDuration||a.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(a.liveMaxLatencyDurationCount!==void 0&&(a.liveSyncDurationCount===void 0||a.liveMaxLatencyDurationCount<=a.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(a.liveMaxLatencyDuration!==void 0&&(a.liveSyncDuration===void 0||a.liveMaxLatencyDuration<=a.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},u,a)}function c(u){var a=u.loader;if(a!==C.default&&a!==w.default)l.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var b=Object(C.fetchSupported)();b&&(u.loader=C.default,u.progressive=!0,u.enableSoftwareAES=!0,l.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/ewma-bandwidth-estimator.ts"),_=R("./src/events.ts"),G=R("./src/utils/buffer-helper.ts"),j=R("./src/errors.ts"),O=R("./src/types/loader.ts"),M=R("./src/utils/logger.ts");function y(D,w){for(var C=0;C<w.length;C++){var h=w[C];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function T(D,w,C){return w&&y(D.prototype,w),C&&y(D,C),D}var k=function(){function D(C){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=C;var h=C.config;this.bwEstimator=new B.default(h.abrEwmaSlowVoD,h.abrEwmaFastVoD,h.abrEwmaDefaultEstimate),this.registerListeners()}var w=D.prototype;return w.registerListeners=function(){var h=this.hls;h.on(_.Events.FRAG_LOADING,this.onFragLoading,this),h.on(_.Events.FRAG_LOADED,this.onFragLoaded,this),h.on(_.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(_.Events.ERROR,this.onError,this)},w.unregisterListeners=function(){var h=this.hls;h.off(_.Events.FRAG_LOADING,this.onFragLoading,this),h.off(_.Events.FRAG_LOADED,this.onFragLoaded,this),h.off(_.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(_.Events.ERROR,this.onError,this)},w.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},w.onFragLoading=function(h,o){var l=o.frag;if(l.type===O.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=l,this.partCurrent=(d=o.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},w.onLevelLoaded=function(h,o){var l=this.hls.config;o.details.live?this.bwEstimator.update(l.abrEwmaSlowLive,l.abrEwmaFastLive):this.bwEstimator.update(l.abrEwmaSlowVoD,l.abrEwmaFastVoD)},w._abandonRulesCheck=function(){var h=this.fragCurrent,o=this.partCurrent,l=this.hls,d=l.autoLevelEnabled,A=l.config,f=l.media;if(!h||!f)return;var g=o?o.stats:h.stats,L=o?o.duration:h.duration;if(g.aborted){M.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||f.paused||!f.playbackRate||!f.readyState)return;var E=performance.now()-g.loading.start,m=Math.abs(f.playbackRate);if(E<=500*L/m)return;var c=l.levels,u=l.minAutoLevel,a=c[h.level],b=g.total||Math.max(g.loaded,Math.round(L*a.maxBitrate/8)),v=Math.max(1,g.bwEstimate?g.bwEstimate/8:g.loaded*1e3/E),x=(b-g.loaded)/v,P=f.currentTime,H=(G.BufferHelper.bufferInfo(f,P,A.maxBufferHole).end-P)/m;if(H>=2*L/m||x<=H)return;var V=Number.POSITIVE_INFINITY,$;for($=h.level-1;$>u;$--){var z=c[$].maxBitrate;if(V=L*z/(8*.8*v),V<H)break}if(V>=x)return;var F=this.bwEstimator.getEstimate();M.logger.warn("Fragment "+h.sn+(o?" part "+o.index:"")+" of level "+h.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+$+`
|
|
Current BW estimate: `+(Object(Q.isFiniteNumber)(F)?(F/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+x.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+V.toFixed(3)+` s
|
|
Time to underbuffer: `+H.toFixed(3)+" s"),l.nextLoadLevel=$,this.bwEstimator.sample(E,g.loaded),this.clearTimer(),h.loader&&(this.fragCurrent=this.partCurrent=null,h.loader.abort()),l.trigger(_.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:h,part:o,stats:g})},w.onFragLoaded=function(h,o){var l=o.frag,d=o.part;if(l.type===O.PlaylistLevelType.MAIN&&Object(Q.isFiniteNumber)(l.sn)){var A=d?d.stats:l.stats,f=d?d.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var g=this.hls.levels[l.level],L=(g.loaded?g.loaded.bytes:0)+A.loaded,E=(g.loaded?g.loaded.duration:0)+f;g.loaded={bytes:L,duration:E},g.realBitrate=Math.round(8*L/E)}if(l.bitrateTest){var m={stats:A,frag:l,part:d,id:l.type};this.onFragBuffered(_.Events.FRAG_BUFFERED,m),l.bitrateTest=!1}}},w.onFragBuffered=function(h,o){var l=o.frag,d=o.part,A=d?d.stats:l.stats;if(A.aborted)return;if(l.type!==O.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var f=A.parsing.end-A.loading.start;this.bwEstimator.sample(f,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=f/1e3:this.bitrateTestDelay=0},w.onError=function(h,o){switch(o.details){case j.ErrorDetails.FRAG_LOAD_ERROR:case j.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},w.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},w.getNextABRAutoLevel=function(){var h=this.fragCurrent,o=this.partCurrent,l=this.hls,d=l.maxAutoLevel,A=l.config,f=l.minAutoLevel,g=l.media,L=o?o.duration:h?h.duration:0,E=g?g.currentTime:0,m=g&&g.playbackRate!==0?Math.abs(g.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,u=(G.BufferHelper.bufferInfo(g,E,A.maxBufferHole).end-E)/m,a=this.findBestLevel(c,f,d,u,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(a>=0)return a;M.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var b=L?Math.min(L,A.maxStarvationDelay):A.maxStarvationDelay,v=A.abrBandWidthFactor,x=A.abrBandWidthUpFactor;if(!u){var P=this.bitrateTestDelay;if(P){var H=L?Math.min(L,A.maxLoadingDelay):A.maxLoadingDelay;b=H-P,M.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*b)+" ms"),v=x=1}}return a=this.findBestLevel(c,f,d,u+b,v,x),Math.max(a,0)},w.findBestLevel=function(h,o,l,d,A,f){for(var g,L=this.fragCurrent,E=this.partCurrent,m=this.lastLoadedFragLevel,c=this.hls.levels,u=c[m],a=!!(u!=null&&(g=u.details)!==null&&g!==void 0&&g.live),b=u==null?void 0:u.codecSet,v=E?E.duration:L?L.duration:0,x=l;x>=o;x--){var P=c[x];if(!P||b&&P.codecSet!==b)continue;var H=P.details,V=(E?H==null?void 0:H.partTarget:H==null?void 0:H.averagetargetduration)||v,$=void 0;x<=m?$=A*h:$=f*h;var z=c[x].maxBitrate,F=z*V/$;if(M.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round($)+"/"+z+"/"+V+"/"+d+"/"+F),$>z&&(!F||a&&!this.bitrateTestDelay||F<d))return x}return-1},T(D,[{key:"nextAutoLevel",get:function(){var h=this._nextAutoLevel,o=this.bwEstimator;if(h!==-1&&(!o||!o.canEstimate()))return h;var l=this.getNextABRAutoLevel();return h!==-1&&(l=Math.min(h,l)),l},set:function(h){this._nextAutoLevel=h}}]),D}();X.default=k},"./src/controller/audio-stream-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/polyfills/number.ts"),B=R("./src/controller/base-stream-controller.ts"),_=R("./src/events.ts"),G=R("./src/utils/buffer-helper.ts"),j=R("./src/controller/fragment-tracker.ts"),O=R("./src/types/level.ts"),M=R("./src/types/loader.ts"),y=R("./src/loader/fragment.ts"),T=R("./src/demux/chunk-cache.ts"),k=R("./src/demux/transmuxer-interface.ts"),D=R("./src/types/transmuxer.ts"),w=R("./src/controller/fragment-finders.ts"),C=R("./src/utils/discontinuities.ts"),h=R("./src/errors.ts"),o=R("./src/utils/logger.ts");function l(){return l=Object.assign||function(L){for(var E=1;E<arguments.length;E++){var m=arguments[E];for(var c in m)Object.prototype.hasOwnProperty.call(m,c)&&(L[c]=m[c])}return L},l.apply(this,arguments)}function d(L,E){L.prototype=Object.create(E.prototype),L.prototype.constructor=L,A(L,E)}function A(L,E){return A=Object.setPrototypeOf||function(c,u){return c.__proto__=u,c},A(L,E)}var f=100,g=function(L){d(E,L);function E(c,u){var a;return a=L.call(this,c,u,"[audio-stream-controller]")||this,a.videoBuffer=null,a.videoTrackCC=-1,a.waitingVideoCC=-1,a.audioSwitch=!1,a.trackId=-1,a.waitingData=null,a.mainDetails=null,a.bufferFlushed=!1,a._registerListeners(),a}var m=E.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var u=this.hls;u.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(_.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.on(_.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(_.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(_.Events.ERROR,this.onError,this),u.on(_.Events.BUFFER_RESET,this.onBufferReset,this),u.on(_.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(_.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(_.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var u=this.hls;u.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(_.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.off(_.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(_.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(_.Events.ERROR,this.onError,this),u.off(_.Events.BUFFER_RESET,this.onBufferReset,this),u.off(_.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(_.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(_.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onInitPtsFound=function(u,a){var b=a.frag,v=a.id,x=a.initPTS;if(v==="main"){var P=b.cc;this.initPTS[b.cc]=x,this.log("InitPTS for cc: "+P+" found from main: "+x),this.videoTrackCC=P,this.state===B.State.WAITING_INIT_PTS&&this.tick()}},m.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=B.State.STOPPED;return}var a=this.lastCurrentTime;this.stopLoad(),this.setInterval(f),this.fragLoadError=0,a>0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=B.State.IDLE):(this.loadedmetadata=!1,this.state=B.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},m.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_TRACK:{var u,a=this.levels,b=this.trackId,v=a==null||((u=a[b])===null||u===void 0)?void 0:u.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=B.State.WAITING_INIT_PTS}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var x,P=performance.now(),H=this.retryDate;(!H||P>=H||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=B.State.IDLE);break}case B.State.WAITING_INIT_PTS:{var V=this.waitingData;if(V){var $=V.frag,z=V.part,F=V.cache,ee=V.complete;if(this.initPTS[$.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.FRAG_LOADING;var oe=F.flush(),le={frag:$,part:z,payload:oe,networkDetails:null};this._handleFragmentLoadProgress(le),ee&&L.prototype._handleFragmentLoadComplete.call(this,le)}else if(this.videoTrackCC!==this.waitingVideoCC)o.logger.log("Waiting fragment cc ("+$.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ve=this.getLoadPosition(),Ie=G.BufferHelper.bufferInfo(this.mediaBuffer,ve,this.config.maxBufferHole),xe=Object(w.fragmentWithinToleranceTest)(Ie.end,this.config.maxFragLookUpTolerance,$);xe<0&&(o.logger.log("Waiting fragment cc ("+$.cc+") @ "+$.start+" cancelled because another fragment at "+Ie.end+" is needed"),this.clearWaitingFragment())}}else this.state=B.State.IDLE}}this.onTickEnd()},m.clearWaitingFragment=function(){var u=this.waitingData;u&&(this.fragmentTracker.removeFragment(u.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.IDLE)},m.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:u,b=a.buffered;!this.loadedmetadata&&b.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},m.doTickIdle=function(){var u,a,b=this.hls,v=this.levels,x=this.media,P=this.trackId,H=b.config;if(!v||!v[P])return;if(!x&&(this.startFragRequested||!H.startFragPrefetch))return;var V=v[P],$=V.details;if(!$||$.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn($)){this.state=B.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,M.PlaylistLevelType.AUDIO));var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,M.PlaylistLevelType.AUDIO);if(z===null)return;var F=z.len,ee=this.getMaxBufferLength(),oe=this.audioSwitch;if(F>=ee&&!oe)return;if(!oe&&this._streamEnded(z,$)){b.trigger(_.Events.BUFFER_EOS,{type:"audio"}),this.state=B.State.ENDED;return}var le=$.fragments,ve=le[0].start,Ie=z.end;if(oe){var xe=this.getLoadPosition();Ie=xe,$.PTSKnown&&xe<ve&&((z.end>ve||z.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),x.currentTime=ve+.05))}var Ce=this.getNextFragment(Ie,$);if(!Ce){this.bufferFlushed=!0;return}((u=Ce.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((a=Ce.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Ce,$):this.loadFragment(Ce,$,Ie)},m.getMaxBufferLength=function(){var u=L.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,M.PlaylistLevelType.MAIN);return a===null?u:Math.max(u,a.len)},m.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},m.onAudioTracksUpdated=function(u,a){var b=a.audioTracks;this.resetTransmuxer(),this.levels=b.map(function(v){return new O.Level(v)})},m.onAudioTrackSwitching=function(u,a){var b=!!a.url;this.trackId=a.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),b?this.setInterval(f):this.resetTransmuxer(),b?(this.audioSwitch=!0,this.state=B.State.IDLE):this.state=B.State.STOPPED,this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},m.onLevelLoaded=function(u,a){this.mainDetails=a.details},m.onAudioTrackLoaded=function(u,a){var b,v=this.levels,x=a.details,P=a.id;if(!v){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+x.startSN+","+x.endSN+"],duration:"+x.totalduration);var H=v[P],V=0;if(x.live||(b=H.details)!==null&&b!==void 0&&b.live){var $=this.mainDetails;if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed||!$)return;!H.details&&x.hasProgramDateTime&&$.hasProgramDateTime?(Object(C.alignMediaPlaylistByPDT)(x,$),V=x.fragments[0].start):V=this.alignPlaylists(x,H.details)}H.details=x,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!x.live)&&this.setStartPosition(H.details,V),this.state===B.State.WAITING_TRACK&&!this.waitForCdnTuneIn(x)&&(this.state=B.State.IDLE),this.tick()},m._handleFragmentLoadProgress=function(u){var a,b=u.frag,v=u.part,x=u.payload,P=this.config,H=this.trackId,V=this.levels;if(!V){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+b.sn+" of level "+b.level+" will not be buffered");return}var $=V[H];console.assert($,"Audio track is defined on fragment load progress");var z=$.details;console.assert(z,"Audio track details are defined on fragment load progress");var F=P.defaultAudioCodec||$.audioCodec||"mp4a.40.2",ee=this.transmuxer;ee||(ee=this.transmuxer=new k.default(this.hls,M.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var oe=this.initPTS[b.cc],le=(a=b.initSegment)===null||a===void 0?void 0:a.data;if(oe!==void 0){var ve=!1,Ie=v?v.index:-1,xe=Ie!==-1,Ce=new D.ChunkMetadata(b.level,b.sn,b.stats.chunkCount,x.byteLength,Ie,xe);ee.push(x,le,F,"",b,v,z.totalduration,ve,Ce,oe)}else{o.logger.log("Unknown video PTS for cc "+b.cc+", waiting for video PTS before demuxing audio frag "+b.sn+" of ["+z.startSN+" ,"+z.endSN+"],track "+H);var Te=this.waitingData=this.waitingData||{frag:b,part:v,cache:new T.default,complete:!1},Se=Te.cache;Se.push(new Uint8Array(x)),this.waitingVideoCC=this.videoTrackCC,this.state=B.State.WAITING_INIT_PTS}},m._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,u)},m.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},m.onBufferCreated=function(u,a){var b=a.tracks.audio;b&&(this.mediaBuffer=b.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},m.onFragBuffered=function(u,a){var b=a.frag,v=a.part;if(b.type!==M.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(b)){this.warn("Fragment "+b.sn+(v?" p: "+v.index:"")+" of level "+b.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}b.sn!=="initSegment"&&(this.fragPrevious=b,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(b,v)},m.onError=function(u,a){switch(a.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.AUDIO,a);break;case h.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case h.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==B.State.ERROR&&this.state!==B.State.STOPPED&&(this.state=a.fatal?B.State.ERROR:B.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case h.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var b=!0,v=this.getFwdBufferInfo(this.mediaBuffer,M.PlaylistLevelType.AUDIO);v&&v.len>.5&&(b=!this.reduceMaxBufferLength(v.len)),b&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},m.onBufferFlushed=function(u,a){var b=a.type;b===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},m._handleTransmuxComplete=function(u){var a,b="audio",v=this.hls,x=u.remuxResult,P=u.chunkMeta,H=this.getCurrentContext(P);if(!H){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var V=H.frag,$=H.part,z=x.audio,F=x.text,ee=x.id3,oe=x.initSegment;if(this.fragContextChanged(V))return;if(this.state=B.State.PARSING,this.audioSwitch&&z&&this.completeAudioSwitch(),oe!=null&&oe.tracks&&(this._bufferInitSegment(oe.tracks,V,P),v.trigger(_.Events.FRAG_PARSING_INIT_SEGMENT,{frag:V,id:b,tracks:oe.tracks})),z){var le=z.startPTS,ve=z.endPTS,Ie=z.startDTS,xe=z.endDTS;$&&($.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:ve,startDTS:Ie,endDTS:xe}),V.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,le,ve,Ie,xe),this.bufferFragmentData(z,V,$,P)}if(ee!=null&&(a=ee.samples)!==null&&a!==void 0&&a.length){var Ce=l({frag:V,id:b},ee);v.trigger(_.Events.FRAG_PARSING_METADATA,Ce)}if(F){var Te=l({frag:V,id:b},F);v.trigger(_.Events.FRAG_PARSING_USERDATA,Te)}},m._bufferInitSegment=function(u,a,b){if(this.state!==B.State.PARSING)return;u.video&&delete u.video;var v=u.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(_.Events.BUFFER_CODECS,u);var x=v.initSegment;if(x!=null&&x.byteLength){var P={type:"audio",frag:a,part:null,chunkMeta:b,parent:a.type,data:x};this.hls.trigger(_.Events.BUFFER_APPENDING,P)}this.tick()},m.loadFragment=function(u,a,b){var v=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||v===j.FragmentState.NOT_LOADED||v===j.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):a.live&&!Object(Q.isFiniteNumber)(this.initPTS[u.cc])?(this.log("Waiting for video PTS in continuity counter "+u.cc+" of live stream before loading audio fragment "+u.sn+" of level "+this.trackId),this.state=B.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,u,a,b)))},m.completeAudioSwitch=function(){var u=this.hls,a=this.media,b=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:b})},E}(B.default);X.default=g},"./src/controller/audio-track-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/controller/base-playlist-controller.ts"),G=R("./src/types/loader.ts");function j(k,D){for(var w=0;w<D.length;w++){var C=D[w];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(k,C.key,C)}}function O(k,D,w){return D&&j(k.prototype,D),w&&j(k,w),k}function M(k,D){k.prototype=Object.create(D.prototype),k.prototype.constructor=k,y(k,D)}function y(k,D){return y=Object.setPrototypeOf||function(C,h){return C.__proto__=h,C},y(k,D)}var T=function(k){M(D,k);function D(C){var h;return h=k.call(this,C,"[audio-track-controller]")||this,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.trackName="",h.selectDefaultTrack=!0,h.registerListeners(),h}var w=D.prototype;return w.registerListeners=function(){var h=this.hls;h.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on(Q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(Q.Events.ERROR,this.onError,this)},w.unregisterListeners=function(){var h=this.hls;h.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off(Q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(Q.Events.ERROR,this.onError,this)},w.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,k.prototype.destroy.call(this)},w.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},w.onManifestParsed=function(h,o){this.tracks=o.audioTracks||[]},w.onAudioTrackLoaded=function(h,o){var l=o.id,d=o.details,A=this.tracksInGroup[l];if(!A){this.warn("Invalid audio track id "+l);return}var f=A.details;A.details=o.details,this.log("audioTrack "+l+" loaded ["+d.startSN+"-"+d.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,o,f))},w.onLevelLoading=function(h,o){this.switchLevel(o.level)},w.onLevelSwitching=function(h,o){this.switchLevel(o.level)},w.switchLevel=function(h){var o=this.hls.levels[h];if(!(o!=null&&o.audioGroupIds))return;var l=o.audioGroupIds[o.urlId];if(this.groupId!==l){this.groupId=l;var d=this.tracks.filter(function(f){return!l||f.groupId===l});this.selectDefaultTrack&&!d.some(function(f){return f.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var A={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(Q.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},w.onError=function(h,o){if(k.prototype.onError.call(this,h,o),o.fatal||!o.context)return;o.context.type===G.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},w.setAudioTrack=function(h){var o=this.tracksInGroup;if(h<0||h>=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=o[this.trackId];this.log("Now switching to audio-track index "+h);var d=o[h],A=d.id,f=d.groupId,g=f===void 0?"":f,L=d.name,E=d.type,m=d.url;if(this.trackId=h,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(Q.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:g,name:L,type:E,url:m}),d.details&&!d.details.live)return;var c=this.switchParams(d.url,l==null?void 0:l.details);this.loadPlaylist(c)},w.selectInitialTrack=function(){var h=this.tracksInGroup;console.assert(h.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,l=this.findTrackId(o)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},w.findTrackId=function(h){for(var o=this.tracksInGroup,l=0;l<o.length;l++){var d=o[l];if((!this.selectDefaultTrack||d.default)&&(!h||h===d.name))return d.id}return-1},w.loadPlaylist=function(h){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var l=o.id,d=o.groupId,A=o.url;if(h)try{A=h.addDirectives(A)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("loading audio-track playlist for id: "+l),this.clearTimer(),this.hls.trigger(Q.Events.AUDIO_TRACK_LOADING,{url:A,id:l,groupId:d,deliveryDirectives:h||null})}},O(D,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1,this.setAudioTrack(h)}}]),D}(_.default);X.default=T},"./src/controller/base-playlist-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return O});var Q=R("./src/polyfills/number.ts"),B=R("./src/types/level.ts"),_=R("./src/controller/level-helper.ts"),G=R("./src/utils/logger.ts"),j=R("./src/errors.ts"),O=function(){function M(T,k){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,k+":"),this.warn=G.logger.warn.bind(G.logger,k+":"),this.hls=T}var y=M.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(k,D){D.fatal&&D.type===j.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(k,D){var w=D==null?void 0:D.renditionReports;if(w)for(var C=0;C<w.length;C++){var h=w[C],o=""+h.URI;if(o===k.substr(-o.length)){var l=parseInt(h["LAST-MSN"]),d=parseInt(h["LAST-PART"]);if(D&&this.hls.config.lowLatencyMode){var A=Math.min(D.age-D.partTarget,D.targetduration);d!==void 0&&A>D.partTarget&&(d+=1)}if(Object(Q.isFiniteNumber)(l))return new B.HlsUrlParameters(l,Object(Q.isFiniteNumber)(d)?d:void 0,B.HlsSkip.No)}}},y.loadPlaylist=function(k){},y.shouldLoadTrack=function(k){return this.canLoad&&k&&!!k.url&&(!k.details||k.details.live)},y.playlistLoaded=function(k,D,w){var C=this,h=D.details,o=D.stats,l=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(h.advancedDateTime=Date.now()-l,h.live||w!=null&&w.live){if(h.reloaded(w),w&&this.log("live playlist "+k+" "+(h.advanced?"REFRESHED "+h.lastPartSn+"-"+h.lastPartIndex:"MISSED")),w&&h.fragments.length>0&&Object(_.mergeDetails)(w,h),!this.canLoad||!h.live)return;var d,A=void 0,f=void 0;if(h.canBlockReload&&h.endSN&&h.advanced){var g=this.hls.config.lowLatencyMode,L=h.lastPartSn,E=h.endSN,m=h.lastPartIndex,c=m!==-1,u=L===E,a=g?0:m;c?(A=u?E+1:L,f=u?a:m+1):A=E+1;var b=h.age,v=b+h.ageHeader,x=Math.min(v-h.partTarget,h.targetduration*1.5);if(x>0){if(w&&x>w.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+w.tuneInGoal+" to: "+x+" with playlist age: "+h.age),x=0;else{var P=Math.floor(x/h.targetduration);if(A+=P,f!==void 0){var H=Math.round(x%h.targetduration/h.partTarget);f+=H}this.log("CDN Tune-in age: "+h.ageHeader+"s last advanced "+b.toFixed(2)+"s goal: "+x+" skip sn "+P+" to part "+f)}h.tuneInGoal=x}if(d=this.getDeliveryDirectives(h,D.deliveryDirectives,A,f),g||!u){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(h,D.deliveryDirectives,A,f);var V=Object(_.computeReloadInterval)(h,o);A!==void 0&&h.canBlockReload&&(V-=h.partTarget||1),this.log("reload live playlist "+k+" in "+Math.round(V)+" ms"),this.timer=self.setTimeout(function(){return C.loadPlaylist(d)},V)}else this.clearTimer()},y.getDeliveryDirectives=function(k,D,w,C){var h=Object(B.getSkipValue)(k,w);return D!=null&&D.skip&&k.deltaUpdateFailed&&(w=D.msn,C=D.part,h=B.HlsSkip.No),new B.HlsUrlParameters(w,C,h)},y.retryLoadingOrFail=function(k){var D=this,w=this.hls.config,C=this.retryCount<w.levelLoadingMaxRetry;if(C){var h;if(this.retryCount++,k.details.indexOf("LoadTimeOut")>-1&&(h=k.context)!==null&&h!==void 0&&h.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+k.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*w.levelLoadingRetryDelay,w.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return D.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+k.details+'"')}}else this.warn('cannot recover from error "'+k.details+'"'),this.clearTimer(),k.fatal=!0;return C},M}()},"./src/controller/base-stream-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"State",function(){return E}),R.d(X,"default",function(){return m});var Q=R("./src/polyfills/number.ts"),B=R("./src/task-loop.ts"),_=R("./src/controller/fragment-tracker.ts"),G=R("./src/utils/buffer-helper.ts"),j=R("./src/utils/logger.ts"),O=R("./src/events.ts"),M=R("./src/errors.ts"),y=R("./src/types/transmuxer.ts"),T=R("./src/utils/mp4-tools.ts"),k=R("./src/utils/discontinuities.ts"),D=R("./src/controller/fragment-finders.ts"),w=R("./src/controller/level-helper.ts"),C=R("./src/loader/fragment-loader.ts"),h=R("./src/crypt/decrypter.ts"),o=R("./src/utils/time-ranges.ts"),l=R("./src/types/loader.ts");function d(c,u){for(var a=0;a<u.length;a++){var b=u[a];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}function A(c,u,a){return u&&d(c.prototype,u),a&&d(c,a),c}function f(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function g(c,u){c.prototype=Object.create(u.prototype),c.prototype.constructor=c,L(c,u)}function L(c,u){return L=Object.setPrototypeOf||function(b,v){return b.__proto__=v,b},L(c,u)}var E={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"},m=function(c){g(u,c);function u(b,v,x){var P;return P=c.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=E.STOPPED,P.media=void 0,P.mediaBuffer=void 0,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=x,P.log=j.logger.log.bind(j.logger,x+":"),P.warn=j.logger.warn.bind(j.logger,x+":"),P.hls=b,P.fragmentLoader=new C.default(b.config),P.fragmentTracker=v,P.config=b.config,P.decrypter=new h.default(b,b.config),b.on(O.Events.KEY_LOADED,P.onKeyLoaded,f(P)),P}var a=u.prototype;return a.doTick=function(){this.onTickEnd()},a.onTickEnd=function(){},a.startLoad=function(v){},a.stopLoad=function(){this.fragmentLoader.abort();var v=this.fragCurrent;v&&this.fragmentTracker.removeFragment(v),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=E.STOPPED},a._streamEnded=function(v,x){var P=this.fragCurrent,H=this.fragmentTracker;if(!x.live&&P&&P.sn===x.endSN&&!v.nextStart){var V=H.getState(P);return V===_.FragmentState.PARTIAL||V===_.FragmentState.OK}return!1},a.onMediaAttached=function(v,x){var P=this.media=this.mediaBuffer=x.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var H=this.config;this.levels&&H.autoStartLoad&&this.state===E.STOPPED&&this.startLoad(H.startPosition)},a.onMediaDetaching=function(){var v=this.media;v!=null&&v.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),v&&(v.removeEventListener("seeking",this.onvseeking),v.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},a.onMediaSeeking=function(){var v=this.config,x=this.fragCurrent,P=this.media,H=this.mediaBuffer,V=this.state,$=P?P.currentTime:0,z=G.BufferHelper.bufferInfo(H||P,$,v.maxBufferHole);if(this.log("media seeking to "+(Object(Q.isFiniteNumber)($)?$.toFixed(3):$)+", state: "+V),V===E.ENDED)this.resetLoadingState();else if(x&&!z.len){var F=v.maxFragLookUpTolerance,ee=x.start-F,oe=x.start+x.duration+F,le=$>oe;($<ee||le)&&(le&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.loader.abort()),this.resetLoadingState())}P&&(this.lastCurrentTime=$),!this.loadedmetadata&&!z.len&&(this.nextLoadPosition=this.startPosition=$),this.tickImmediate()},a.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},a.onKeyLoaded=function(v,x){if(this.state!==E.KEY_LOADING||x.frag!==this.fragCurrent||!this.levels)return;this.state=E.IDLE;var P=this.levels[x.frag.level].details;P&&this.loadFragment(x.frag,P,x.frag.start)},a.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},a.onHandlerDestroyed=function(){this.state=E.STOPPED,this.hls.off(O.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,c.prototype.onHandlerDestroyed.call(this)},a.loadKey=function(v,x){this.log("Loading key for "+v.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level),this.state=E.KEY_LOADING,this.fragCurrent=v,this.hls.trigger(O.Events.KEY_LOADING,{frag:v})},a.loadFragment=function(v,x,P){this._loadFragForPlayback(v,x,P)},a._loadFragForPlayback=function(v,x,P){var H=this,V=function(z){if(H.fragContextChanged(v)){H.warn("Fragment "+v.sn+(z.part?" p: "+z.part.index:"")+" of level "+v.level+" was dropped during download."),H.fragmentTracker.removeFragment(v);return}v.stats.chunkCount++,H._handleFragmentLoadProgress(z)};this._doFragLoad(v,x,P,V).then(function($){if(!$)return;H.fragLoadError=0;var z=H.state;if(H.fragContextChanged(v)){(z===E.FRAG_LOADING||z===E.BACKTRACKING||!H.fragCurrent&&z===E.PARSING)&&(H.fragmentTracker.removeFragment(v),H.state=E.IDLE);return}if("payload"in $&&(H.log("Loaded fragment "+v.sn+" of level "+v.level),H.hls.trigger(O.Events.FRAG_LOADED,$),H.state===E.BACKTRACKING)){H.fragmentTracker.backtrack(v,$),H.resetFragmentLoading(v);return}H._handleFragmentLoadComplete($)}).catch(function($){H.warn($),H.resetFragmentLoading(v)})},a.flushMainBuffer=function(v,x,P){if(P===void 0&&(P=null),!(v-x))return;var H={startOffset:v,endOffset:x,type:P};this.fragLoadError=0,this.hls.trigger(O.Events.BUFFER_FLUSHING,H)},a._loadInitSegment=function(v){var x=this;this._doFragLoad(v).then(function(P){if(!P||x.fragContextChanged(v)||!x.levels)throw new Error("init load aborted");return P}).then(function(P){var H=x.hls,V=P.payload,$=v.decryptdata;if(V&&V.byteLength>0&&$&&$.key&&$.iv&&$.method==="AES-128"){var z=self.performance.now();return x.decrypter.webCryptoDecrypt(new Uint8Array(V),$.key.buffer,$.iv.buffer).then(function(F){var ee=self.performance.now();return H.trigger(O.Events.FRAG_DECRYPTED,{frag:v,payload:F,stats:{tstart:z,tdecrypt:ee}}),P.payload=F,P})}return P}).then(function(P){var H=x.fragCurrent,V=x.hls,$=x.levels;if(!$)throw new Error("init load aborted, missing levels");var z=$[v.level].details;console.assert(z,"Level details are defined when init segment is loaded");var F=v.stats;x.state=E.IDLE,x.fragLoadError=0,v.data=new Uint8Array(P.payload),F.parsing.start=F.buffering.start=self.performance.now(),F.parsing.end=F.buffering.end=self.performance.now(),P.frag===H&&V.trigger(O.Events.FRAG_BUFFERED,{stats:F,frag:H,part:null,id:v.type}),x.tick()}).catch(function(P){x.warn(P),x.resetFragmentLoading(v)})},a.fragContextChanged=function(v){var x=this.fragCurrent;return!v||!x||v.level!==x.level||v.sn!==x.sn||v.urlId!==x.urlId},a.fragBufferedComplete=function(v,x){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+o.default.toString(G.BufferHelper.getBuffered(P))),this.state=E.IDLE,this.tick()},a._handleFragmentLoadComplete=function(v){var x=this.transmuxer;if(!x)return;var P=v.frag,H=v.part,V=v.partsLoaded,$=!V||V.length===0||V.some(function(F){return!F}),z=new y.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,H?H.index:-1,!$);x.flush(z)},a._handleFragmentLoadProgress=function(v){},a._doFragLoad=function(v,x,P,H){var V=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(v.start,P||0),this.config.lowLatencyMode&&x){var $=x.partList;if($&&H){P>v.end&&x.fragmentHint&&(v=x.fragmentHint);var z=this.getNextPart($,v,P);if(z>-1){var F=$[z];return this.log("Loading part sn: "+v.sn+" p: "+F.index+" cc: "+v.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+z+"-"+($.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=F.start+F.duration,this.state=E.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:v,part:$[z],targetBufferTime:P}),this.doFragPartsLoad(v,$,z,H).catch(function(ee){return V.handleFragLoadError(ee)})}else if(!v.url||this.loadedEndOfParts($,P))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(P.toFixed(3))),Object(Q.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=E.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:v,targetBufferTime:P}),this.fragmentLoader.load(v,H).catch(function(ee){return V.handleFragLoadError(ee)})},a.doFragPartsLoad=function(v,x,P,H){var V=this;return new Promise(function($,z){var F=[],ee=function oe(le){var ve=x[le];V.fragmentLoader.loadPart(v,ve,H).then(function(Ie){F[ve.index]=Ie;var xe=Ie.part;V.hls.trigger(O.Events.FRAG_LOADED,Ie);var Ce=x[le+1];if(Ce&&Ce.fragment===v)oe(le+1);else return $({frag:v,part:xe,partsLoaded:F})}).catch(z)};ee(P)})},a.handleFragLoadError=function(v){var x=v.data;return x&&x.details===M.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(O.Events.ERROR,x),null},a._handleTransmuxerFlush=function(v){var x=this.getCurrentContext(v);if(!x||this.state!==E.PARSING){this.fragCurrent||(this.state=E.IDLE);return}var P=x.frag,H=x.part,V=x.level,$=self.performance.now();P.stats.parsing.end=$,H&&(H.stats.parsing.end=$),this.updateLevelTiming(P,H,V,v.partial)},a.getCurrentContext=function(v){var x=this.levels,P=v.level,H=v.sn,V=v.part;if(!x||!x[P])return this.warn("Levels object was unset while buffering fragment "+H+" of level "+P+". The current chunk will not be buffered."),null;var $=x[P],z=V>-1?Object(w.getPartWith)($,H,V):null,F=z?z.fragment:Object(w.getFragmentWithSN)($,H,this.fragCurrent);return F?{frag:F,part:z,level:$}:null},a.bufferFragmentData=function(v,x,P,H){if(!v||this.state!==E.PARSING)return;var V=v.data1,$=v.data2,z=V;if(V&&$&&(z=Object(T.appendUint8Array)(V,$)),!z||!z.length)return;var F={type:v.type,frag:x,part:P,chunkMeta:H,parent:x.type,data:z};this.hls.trigger(O.Events.BUFFER_APPENDING,F),v.dropped&&v.independent&&!P&&this.flushBufferGap(x)},a.flushBufferGap=function(v){var x=this.media;if(!x)return;if(!G.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,v.start);return}var P=x.currentTime,H=G.BufferHelper.bufferInfo(x,P,0),V=v.duration,$=Math.min(this.config.maxFragLookUpTolerance*2,V*.25),z=Math.max(Math.min(v.start-$,H.end-$),P+$);v.start-z>$&&this.flushMainBuffer(z,v.start)},a.getFwdBufferInfo=function(v,x){var P=this.config,H=this.getLoadPosition();if(!Object(Q.isFiniteNumber)(H))return null;var V=G.BufferHelper.bufferInfo(v,H,P.maxBufferHole);if(V.len===0&&V.nextStart!==void 0){var $=this.fragmentTracker.getBufferedFrag(H,x);if($&&V.nextStart<$.end)return G.BufferHelper.bufferInfo(v,H,Math.max(V.nextStart,P.maxBufferHole))}return V},a.getMaxBufferLength=function(v){var x=this.config,P;return v?P=Math.max(8*x.maxBufferSize/v,x.maxBufferLength):P=x.maxBufferLength,Math.min(P,x.maxMaxBufferLength)},a.reduceMaxBufferLength=function(v){var x=this.config,P=v||x.maxBufferLength;return x.maxMaxBufferLength>=P?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(v,x){var P,H,V=x.fragments,$=V.length;if(!$)return null;var z=this.config,F=V[0].start,ee;if(x.live){var oe=z.initialLiveManifestSize;if($<oe)return this.warn("Not enough fragments to start playback (have: "+$+", need: "+oe+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(ee=this.getInitialLiveFragment(x,V),this.startPosition=ee?this.hls.liveSyncPosition||ee.start:v)}else v<=F&&(ee=V[0]);if(!ee){var le=z.lowLatencyMode?x.partEnd:x.fragmentEnd;ee=this.getFragmentAtPosition(v,le,x)}return(P=ee)!==null&&P!==void 0&&P.initSegment&&!((H=ee)!==null&&H!==void 0&&H.initSegment.data)&&!this.bitrateTest&&(ee=ee.initSegment),ee},a.getNextPart=function(v,x,P){for(var H=-1,V=!1,$=!0,z=0,F=v.length;z<F;z++){var ee=v[z];if($=$&&!ee.independent,H>-1&&P<ee.start)break;var oe=ee.loaded;!oe&&(V||ee.independent||$)&&ee.fragment===x&&(H=z),V=oe}return H},a.loadedEndOfParts=function(v,x){var P=v[v.length-1];return P&&x>P.start&&P.loaded},a.getInitialLiveFragment=function(v,x){var P=this.fragPrevious,H=null;if(P){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),H=Object(D.findFragmentByPDT)(x,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!H){var V=P.sn+1;if(V>=v.startSN&&V<=v.endSN){var $=x[V-v.startSN];P.cc===$.cc&&(H=$,this.log("Live playlist, switching playlist, load frag with next SN: "+H.sn))}H||(H=Object(D.findFragWithCC)(x,P.cc),H&&this.log("Live playlist, switching playlist, load frag with same CC: "+H.sn))}}else{var z=this.hls.liveSyncPosition;z!==null&&(H=this.getFragmentAtPosition(z,this.bitrateTest?v.fragmentEnd:v.edge,v))}return H},a.getFragmentAtPosition=function(v,x,P){var H=this.config,V=this.fragPrevious,$=P.fragments,z=P.endSN,F=P.fragmentHint,ee=H.maxFragLookUpTolerance,oe=!!(H.lowLatencyMode&&P.partList&&F);oe&&F&&!this.bitrateTest&&($=$.concat(F),z=F.sn);var le;if(v<x){var ve=v>x-ee?0:ee;le=Object(D.findFragmentByPTS)(V,$,v,ve)}else le=$[$.length-1];if(le){var Ie=le.sn-P.startSN,xe=V&&le.level===V.level,Ce=$[Ie+1],Te=this.fragmentTracker.getState(le);if(Te===_.FragmentState.BACKTRACKED){le=null;for(var Se=Ie;$[Se]&&this.fragmentTracker.getState($[Se])===_.FragmentState.BACKTRACKED;)V?le=$[Se--]:le=$[--Se];le||(le=Ce)}else V&&le.sn===V.sn&&!oe&&(xe&&(le.sn<z&&this.fragmentTracker.getState(Ce)!==_.FragmentState.OK?(this.log("SN "+le.sn+" just loaded, load next one: "+Ce.sn),le=Ce):le=null))}return le},a.synchronizeToLiveEdge=function(v){var x=this.config,P=this.media;if(!P)return;var H=this.hls.liveSyncPosition,V=P.currentTime,$=v.fragments[0].start,z=v.edge,F=V>=$-x.maxFragLookUpTolerance&&V<=z;if(H!==null&&P.duration>H&&(V<H||!F)){var ee=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*v.targetduration;(!F&&P.readyState<4||V<z-ee)&&(this.loadedmetadata||(this.nextLoadPosition=H),P.readyState&&(this.warn("Playback: "+V.toFixed(3)+" is located too far from the end of live sliding playlist: "+z+", reset currentTime to : "+H.toFixed(3)),P.currentTime=H))}},a.alignPlaylists=function(v,x){var P=this.levels,H=this.levelLastLoaded,V=this.fragPrevious,$=H!==null?P[H]:null,z=v.fragments.length;if(!z)return this.warn("No fragments in live playlist"),0;var F=v.fragments[0].start,ee=!x,oe=v.alignedSliding&&Object(Q.isFiniteNumber)(F);if(ee||!oe&&!F){Object(k.alignStream)(V,$,v);var le=v.fragments[0].start;return this.log("Live playlist sliding: "+le.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+v.startSN+" prev-sn: "+(V?V.sn:"na")+" fragments: "+z),le}return F},a.waitForCdnTuneIn=function(v){var x=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*x)},a.setStartPosition=function(v,x){var P=this.startPosition;if(P<x&&(P=-1),P===-1||this.lastCurrentTime===-1){var H=v.startTimeOffset;Object(Q.isFiniteNumber)(H)?(P=x+H,H<0&&(P+=v.totalduration),P=Math.min(Math.max(x,P),x+v.totalduration),this.log("Start time offset "+H+" found in playlist, adjust startPosition to "+P),this.startPosition=P):v.live?P=this.hls.liveSyncPosition||x:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},a.getLoadPosition=function(){var v=this.media,x=0;return this.loadedmetadata&&v?x=v.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},a.handleFragLoadAborted=function(v,x){this.transmuxer&&v.sn!=="initSegment"&&v.stats.aborted&&(this.warn("Fragment "+v.sn+(x?" part"+x.index:"")+" of level "+v.level+" was aborted"),this.resetFragmentLoading(v))},a.resetFragmentLoading=function(v){(!this.fragCurrent||!this.fragContextChanged(v))&&(this.state=E.IDLE)},a.onFragmentOrKeyLoadError=function(v,x){if(x.fatal)return;var P=x.frag;if(!P||P.type!==v)return;var H=this.fragCurrent;console.assert(H&&P.sn===H.sn&&P.level===H.level&&P.urlId===H.urlId,"Frag load error must match current frag to retry");var V=this.config;if(this.fragLoadError+1<=V.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var $=Math.min(Math.pow(2,this.fragLoadError)*V.fragLoadingRetryDelay,V.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+v+" "+P.level+" failed to load, retrying in "+$+"ms"),this.retryDate=self.performance.now()+$,this.fragLoadError++,this.state=E.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(v===l.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=E.IDLE):(j.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=E.ERROR)},a.afterBufferFlushed=function(v,x,P){if(!v)return;var H=G.BufferHelper.getBuffered(v);this.fragmentTracker.detectEvictedFragments(x,H,P),this.state===E.ENDED&&this.resetLoadingState()},a.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=E.IDLE},a.resetLiveStartWhenNotLoaded=function(v){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[v].details:null;if(x!=null&&x.live)return this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},a.updateLevelTiming=function(v,x,P,H){var V=this,$=P.details;console.assert(!!$,"level.details must be defined");var z=Object.keys(v.elementaryStreams).reduce(function(F,ee){var oe=v.elementaryStreams[ee];if(oe){var le=oe.endPTS-oe.startPTS;if(le<=0)return V.warn("Could not parse fragment "+v.sn+" "+ee+" duration reliably ("+le+") resetting transmuxer to fallback to playlist timing"),V.resetTransmuxer(),F||!1;var ve=H?0:Object(w.updateFragPTSDTS)($,v,oe.startPTS,oe.endPTS,oe.startDTS,oe.endDTS);return V.hls.trigger(O.Events.LEVEL_PTS_UPDATED,{details:$,level:P,drift:ve,type:ee,frag:v,start:oe.startPTS,end:oe.endPTS}),!0}return F},!1);z?(this.state=E.PARSED,this.hls.trigger(O.Events.FRAG_PARSED,{frag:v,part:x})):this.resetLoadingState()},a.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(u,[{key:"state",get:function(){return this._state},set:function(v){var x=this._state;x!==v&&(this._state=v,this.log(x+"->"+v))}}]),u}(B.default)},"./src/controller/buffer-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return D});var Q=R("./src/polyfills/number.ts"),B=R("./src/events.ts"),_=R("./src/utils/logger.ts"),G=R("./src/errors.ts"),j=R("./src/utils/buffer-helper.ts"),O=R("./src/utils/mediasource-helper.ts"),M=R("./src/loader/fragment.ts"),y=R("./src/controller/buffer-operation-queue.ts"),T=Object(O.getMediaSource)(),k=/([ha]vc.)(?:\.[^.,]+)+/,D=function(){function w(h){var o=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var l=o.hls,d=o.media,A=o.mediaSource;_.logger.log("[buffer-controller]: Media source opened"),d&&(o.updateMediaElementDuration(),l.trigger(B.Events.MEDIA_ATTACHED,{media:d})),A&&A.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){_.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){_.logger.log("[buffer-controller]: Media source ended")},this.hls=h,this._initSourceBuffer(),this.registerListeners()}var C=w.prototype;return C.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},C.destroy=function(){this.unregisterListeners(),this.details=null},C.registerListeners=function(){var o=this.hls;o.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(B.Events.BUFFER_RESET,this.onBufferReset,this),o.on(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(B.Events.BUFFER_EOS,this.onBufferEos,this),o.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(B.Events.FRAG_PARSED,this.onFragParsed,this),o.on(B.Events.FRAG_CHANGED,this.onFragChanged,this)},C.unregisterListeners=function(){var o=this.hls;o.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(B.Events.BUFFER_RESET,this.onBufferReset,this),o.off(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(B.Events.BUFFER_EOS,this.onBufferEos,this),o.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(B.Events.FRAG_PARSED,this.onFragParsed,this),o.off(B.Events.FRAG_CHANGED,this.onFragChanged,this)},C._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},C.onManifestParsed=function(o,l){var d=2;(l.audio&&!l.video||!l.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,_.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},C.onMediaAttaching=function(o,l){var d=this.media=l.media;if(d&&T){var A=this.mediaSource=new T;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(A),this._objectUrl=d.src}},C.onMediaDetaching=function(){var o=this.media,l=this.mediaSource,d=this._objectUrl;if(l){if(_.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(A){_.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(d&&self.URL.revokeObjectURL(d),o.src===d?(o.removeAttribute("src"),o.load()):_.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(B.Events.MEDIA_DETACHED,void 0)},C.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(l){var d=o.sourceBuffer[l];try{d&&(o.removeBufferListeners(l),o.mediaSource&&o.mediaSource.removeSourceBuffer(d),o.sourceBuffer[l]=void 0)}catch(A){_.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",A)}}),this._initSourceBuffer()},C.onBufferCodecs=function(o,l){var d=this,A=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(f){if(A){var g=d.tracks[f];if(g&&typeof g.buffer.changeType=="function"){var L=l[f],E=L.codec,m=L.levelCodec,c=L.container,u=(g.levelCodec||g.codec).replace(k,"$1"),a=(m||E).replace(k,"$1");if(u!==a){var b=c+";codecs="+(m||E);d.appendChangeType(f,b)}}}else d.pendingTracks[f]=l[f]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},C.appendChangeType=function(o,l){var d=this,A=this.operationQueue,f={execute:function(){var L=d.sourceBuffer[o];L&&(_.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+l),L.changeType(l)),A.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(L){_.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",L)}};A.append(f,o)},C.onBufferAppending=function(o,l){var d=this,A=this.hls,f=this.operationQueue,g=this.tracks,L=l.data,E=l.type,m=l.frag,c=l.part,u=l.chunkMeta,a=u.buffering[E],b=self.performance.now();a.start=b;var v=m.stats.buffering,x=c?c.stats.buffering:null;v.start===0&&(v.start=b),x&&x.start===0&&(x.start=b);var P=g.audio,H=E==="audio"&&u.id===1&&(P==null?void 0:P.container)==="audio/mpeg",V={execute:function(){if(a.executeStart=self.performance.now(),H){var z=d.sourceBuffer[E];if(z){var F=m.start-z.timestampOffset;Math.abs(F)>=.1&&(_.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+m.start+" (delta: "+F+") sn: "+m.sn+")"),z.timestampOffset=m.start)}}d.appendExecutor(L,E)},onStart:function(){},onComplete:function(){var z=self.performance.now();a.executeEnd=a.end=z,v.first===0&&(v.first=z),x&&x.first===0&&(x.first=z);var F=d.sourceBuffer,ee={};for(var oe in F)ee[oe]=j.BufferHelper.getBuffered(F[oe]);d.appendError=0,d.hls.trigger(B.Events.BUFFER_APPENDED,{type:E,frag:m,part:c,chunkMeta:u,parent:m.type,timeRanges:ee})},onError:function(z){_.logger.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",z);var F={type:G.ErrorTypes.MEDIA_ERROR,parent:m.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:z,fatal:!1};z.code===DOMException.QUOTA_EXCEEDED_ERR?F.details=G.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,F.details=G.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>A.config.appendErrorMaxRetry&&(_.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),F.fatal=!0)),A.trigger(B.Events.ERROR,F)}};f.append(V,E)},C.onBufferFlushing=function(o,l){var d=this,A=this.operationQueue,f=function(L){return{execute:d.removeExecutor.bind(d,L,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(B.Events.BUFFER_FLUSHED,{type:L})},onError:function(m){_.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",m)}}};l.type?A.append(f(l.type),l.type):this.getSourceBufferTypes().forEach(function(g){A.append(f(g),g)})},C.onFragParsed=function(o,l){var d=this,A=l.frag,f=l.part,g=[],L=f?f.elementaryStreams:A.elementaryStreams;L[M.ElementaryStreamTypes.AUDIOVIDEO]?g.push("audiovideo"):(L[M.ElementaryStreamTypes.AUDIO]&&g.push("audio"),L[M.ElementaryStreamTypes.VIDEO]&&g.push("video"));var E=function(){var c=self.performance.now();A.stats.buffering.end=c,f&&(f.stats.buffering.end=c);var u=f?f.stats:A.stats;d.hls.trigger(B.Events.FRAG_BUFFERED,{frag:A,part:f,stats:u,id:A.type})};g.length===0&&_.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(E,g)},C.onFragChanged=function(o,l){this.flushBackBuffer()},C.onBufferEos=function(o,l){var d=this,A=this.getSourceBufferTypes().reduce(function(f,g){var L=d.sourceBuffer[g];return(!l.type||l.type===g)&&(L&&!L.ended&&(L.ended=!0,_.logger.log("[buffer-controller]: "+g+" sourceBuffer now EOS"))),f&&!!(!L||L.ended)},!0);A&&this.blockBuffers(function(){var f=d.mediaSource;if(!f||f.readyState!=="open")return;f.endOfStream()})},C.onLevelUpdated=function(o,l){var d=l.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},C.flushBackBuffer=function(){var o=this.hls,l=this.details,d=this.media,A=this.sourceBuffer;if(!d||l===null)return;var f=this.getSourceBufferTypes();if(!f.length)return;var g=l.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(Q.isFiniteNumber)(g)||g<0)return;var L=d.currentTime,E=l.levelTargetDuration,m=Math.max(g,E),c=Math.floor(L/E)*E-m;f.forEach(function(u){var a=A[u];if(a){var b=j.BufferHelper.getBuffered(a);b.length>0&&c>b.start(0)&&(o.trigger(B.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),l.live&&o.trigger(B.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),o.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:u}))}})},C.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,l=this.hls,d=this.media,A=this.mediaSource,f=o.fragments[0].start+o.totalduration,g=d.duration,L=Object(Q.isFiniteNumber)(A.duration)?A.duration:0;o.live&&l.config.liveDurationInfinity?(_.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(o)):(f>L&&f>g||!Object(Q.isFiniteNumber)(g))&&(_.logger.log("[buffer-controller]: Updating Media Source duration to "+f.toFixed(3)),A.duration=f)},C.updateSeekableRange=function(o){var l=this.mediaSource,d=o.fragments,A=d.length;if(A&&o.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var f=Math.max(0,d[0].start),g=Math.max(f,f+o.totalduration);l.setLiveSeekableRange(f,g)}},C.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,l=this.operationQueue,d=this.pendingTracks,A=Object.keys(d).length;if(A&&!o||A===2){this.createSourceBuffers(d),this.pendingTracks={};var f=this.getSourceBufferTypes();if(f.length===0){this.hls.trigger(B.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}f.forEach(function(g){l.executeNext(g)})}},C.createSourceBuffers=function(o){var l=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var f in o)if(!l[f]){var g=o[f];if(!g)throw Error("source buffer exists for track "+f+", however track does not");var L=g.levelCodec||g.codec,E=g.container+";codecs="+L;_.logger.log("[buffer-controller]: creating sourceBuffer("+E+")");try{var m=l[f]=d.addSourceBuffer(E),c=f;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[f]={buffer:m,codec:L,container:g.container,levelCodec:g.levelCodec,id:g.id},A++}catch(u){_.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(B.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:E})}}A&&this.hls.trigger(B.Events.BUFFER_CREATED,{tracks:this.tracks})},C._onSBUpdateStart=function(o){var l=this.operationQueue,d=l.current(o);d.onStart()},C._onSBUpdateEnd=function(o){var l=this.operationQueue,d=l.current(o);d.onComplete(),l.shiftAndExecuteNext(o)},C._onSBUpdateError=function(o,l){_.logger.error("[buffer-controller]: "+o+" SourceBuffer error",l),this.hls.trigger(B.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(o);d&&d.onError(l)},C.removeExecutor=function(o,l,d){var A=this.media,f=this.mediaSource,g=this.operationQueue,L=this.sourceBuffer,E=L[o];if(!A||!f||!E){_.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),g.shiftAndExecuteNext(o);return}var m=Object(Q.isFiniteNumber)(A.duration)?A.duration:Infinity,c=Object(Q.isFiniteNumber)(f.duration)?f.duration:Infinity,u=Math.max(0,l),a=Math.min(d,m,c);a>u?(_.logger.log("[buffer-controller]: Removing ["+u+","+a+"] from the "+o+" SourceBuffer"),console.assert(!E.updating,o+" sourceBuffer must not be updating"),E.remove(u,a)):g.shiftAndExecuteNext(o)},C.appendExecutor=function(o,l){var d=this.operationQueue,A=this.sourceBuffer,f=A[l];if(!f){_.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(l);return}f.ended=!1,console.assert(!f.updating,l+" sourceBuffer must not be updating"),f.appendBuffer(o)},C.blockBuffers=function(o,l){var d=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){_.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var A=this.operationQueue,f=l.map(function(g){return A.appendBlocker(g)});Promise.all(f).then(function(){o(),l.forEach(function(g){var L=d.sourceBuffer[g];(!L||!L.updating)&&A.shiftAndExecuteNext(g)})})},C.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},C.addBufferListener=function(o,l,d){var A=this.sourceBuffer[o];if(!A)return;var f=d.bind(this,o);this.listeners[o].push({event:l,listener:f}),A.addEventListener(l,f)},C.removeBufferListeners=function(o){var l=this.sourceBuffer[o];if(!l)return;this.listeners[o].forEach(function(d){l.removeEventListener(d.event,d.listener)})},w}()},"./src/controller/buffer-operation-queue.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return B});var Q=R("./src/utils/logger.ts"),B=function(){function _(j){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=j}var G=_.prototype;return G.append=function(O,M){var y=this.queues[M];y.push(O),y.length===1&&this.buffers[M]&&this.executeNext(M)},G.insertAbort=function(O,M){var y=this.queues[M];y.unshift(O),this.executeNext(M)},G.appendBlocker=function(O){var M,y=new Promise(function(k){M=k}),T={execute:M,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(T,O),y},G.executeNext=function(O){var M=this.buffers,y=this.queues,T=M[O],k=y[O];if(k.length){var D=k[0];try{D.execute()}catch(w){Q.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),D.onError(w),(!T||!T.updating)&&(k.shift(),this.executeNext(O))}}},G.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},G.current=function(O){return this.queues[O][0]},_}()},"./src/controller/cap-level-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/events.ts");function B(j,O){for(var M=0;M<O.length;M++){var y=O[M];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(j,y.key,y)}}function _(j,O,M){return O&&B(j.prototype,O),M&&B(j,M),j}var G=function(){function j(M){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=M,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var O=j.prototype;return O.setStreamController=function(y){this.streamController=y},O.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},O.registerListeners=function(){var y=this.hls;y.on(Q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(Q.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.unregisterListener=function(){var y=this.hls;y.off(Q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(Q.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.onFpsDropLevelCapping=function(y,T){j.isLevelAllowed(T.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(T.droppedLevel)},O.onMediaAttaching=function(y,T){this.media=T.media instanceof HTMLVideoElement?T.media:null},O.onManifestParsed=function(y,T){var k=this.hls;this.restrictedLevels=[],this.firstLevel=T.firstLevel,k.config.capLevelToPlayerSize&&T.video&&this.startCapping()},O.onBufferCodecs=function(y,T){var k=this.hls;k.config.capLevelToPlayerSize&&T.video&&this.startCapping()},O.onMediaDetaching=function(){this.stopCapping()},O.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var T=this.hls;T.autoLevelCapping=this.getMaxLevel(y.length-1),T.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=T.autoLevelCapping}}},O.getMaxLevel=function(y){var T=this,k=this.hls.levels;if(!k.length)return-1;var D=k.filter(function(w,C){return j.isLevelAllowed(C,T.restrictedLevels)&&C<=y});return this.clientRect=null,j.getMaxLevelByMediaSize(D,this.mediaWidth,this.mediaHeight)},O.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()},O.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},O.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,T={width:0,height:0};if(y){var k=y.getBoundingClientRect();T.width=k.width,T.height=k.height,!T.width&&!T.height&&(T.width=k.right-k.left||y.width||0,T.height=k.bottom-k.top||y.height||0)}return this.clientRect=T,T},j.isLevelAllowed=function(y,T){return T===void 0&&(T=[]),T.indexOf(y)===-1},j.getMaxLevelByMediaSize=function(y,T,k){if(!y||!y.length)return-1;for(var D=function(l,d){return d?l.width!==d.width||l.height!==d.height:!0},w=y.length-1,C=0;C<y.length;C+=1){var h=y[C];if((h.width>=T||h.height>=k)&&D(h,y[C+1])){w=C;break}}return w},_(j,[{key:"mediaWidth",get:function(){return this.getDimensions().width*j.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*j.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(T){}return y}}]),j}();X.default=G},"./src/controller/cmcd-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return D});var Q=R("./src/events.ts"),B=R("./src/types/cmcd.ts"),_=R("./src/utils/buffer-helper.ts"),G=R("./src/utils/logger.ts");function j(w,C){for(var h=0;h<C.length;h++){var o=C[h];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(w,o.key,o)}}function O(w,C,h){return C&&j(w.prototype,C),h&&j(w,h),w}function M(w,C){var h=typeof Symbol!="undefined"&&w[Symbol.iterator]||w["@@iterator"];if(h)return(h=h.call(w)).next.bind(h);if(Array.isArray(w)||(h=y(w))||C&&w&&typeof w.length=="number"){h&&(w=h);var o=0;return function(){return o>=w.length?{done:!0}:{done:!1,value:w[o++]}}}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(w,C){if(!w)return;if(typeof w=="string")return T(w,C);var h=Object.prototype.toString.call(w).slice(8,-1);if(h==="Object"&&w.constructor&&(h=w.constructor.name),h==="Map"||h==="Set")return Array.from(w);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return T(w,C)}function T(w,C){(C==null||C>w.length)&&(C=w.length);for(var h=0,o=new Array(C);h<C;h++)o[h]=w[h];return o}function k(){return k=Object.assign||function(w){for(var C=1;C<arguments.length;C++){var h=arguments[C];for(var o in h)Object.prototype.hasOwnProperty.call(h,o)&&(w[o]=h[o])}return w},k.apply(this,arguments)}var D=function(){function w(h){var o=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(){o.initialized&&(o.starved=!0),o.buffering=!0},this.onPlaying=function(){o.initialized||(o.initialized=!0),o.buffering=!1},this.applyPlaylistData=function(A){try{o.apply(A,{ot:B.CMCDObjectType.MANIFEST,su:!o.initialized})}catch(f){G.logger.warn("Could not generate manifest CMCD data.",f)}},this.applyFragmentData=function(A){try{var f=A.frag,g=o.hls.levels[f.level],L=o.getObjectType(f),E={d:f.duration*1e3,ot:L};(L===B.CMCDObjectType.VIDEO||L===B.CMCDObjectType.AUDIO||L==B.CMCDObjectType.MUXED)&&(E.br=g.bitrate/1e3,E.tb=o.getTopBandwidth(L),E.bl=o.getBufferLength(L)),o.apply(A,E)}catch(m){G.logger.warn("Could not generate segment CMCD data.",m)}},this.hls=h;var l=this.config=h.config,d=l.cmcd;d!=null&&(l.pLoader=this.createPlaylistLoader(),l.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||w.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var C=w.prototype;return C.registerListeners=function(){var o=this.hls;o.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.on(Q.Events.BUFFER_CREATED,this.onBufferCreated,this)},C.unregisterListeners=function(){var o=this.hls;o.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.off(Q.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},C.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},C.onMediaAttached=function(o,l){this.media=l.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},C.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},C.onBufferCreated=function(o,l){var d,A;this.audioBuffer=(d=l.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(A=l.tracks.video)===null||A===void 0?void 0:A.buffer},C.createData=function(){var o;return{v:B.CMCDVersion,sf:B.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(o=this.media)===null||o===void 0?void 0:o.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},C.apply=function(o,l){l===void 0&&(l={}),k(l,this.createData());var d=l.ot===B.CMCDObjectType.INIT||l.ot===B.CMCDObjectType.VIDEO||l.ot===B.CMCDObjectType.MUXED;if(this.starved&&d&&(l.bs=!0,l.su=!0,this.starved=!1),l.su==null&&(l.su=this.buffering),this.useHeaders){var A=w.toHeaders(l);if(!Object.keys(A).length)return;o.headers||(o.headers={}),k(o.headers,A)}else{var f=w.toQuery(l);if(!f)return;o.url=w.appendQueryToUri(o.url,f)}},C.getObjectType=function(o){var l=o.type;return l==="subtitle"?B.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?B.CMCDObjectType.INIT:l==="audio"?B.CMCDObjectType.AUDIO:l==="main"?this.hls.audioTracks.length?B.CMCDObjectType.VIDEO:B.CMCDObjectType.MUXED:void 0},C.getTopBandwidth=function(o){for(var l=0,d=o===B.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=M(d),f;!(f=A()).done;){var g=f.value;g.bitrate>l&&(l=g.bitrate)}return l>0?l:NaN},C.getBufferLength=function(o){var l=this.hls.media,d=o===B.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!l)return NaN;var A=_.BufferHelper.bufferInfo(d,l.currentTime,this.config.maxBufferHole);return A.len*1e3},C.createPlaylistLoader=function(){var o=this.config.pLoader,l=this.applyPlaylistData,d=o||this.config.loader;return function(){function A(g){this.loader=void 0,this.loader=new d(g)}var f=A.prototype;return f.destroy=function(){this.loader.destroy()},f.abort=function(){this.loader.abort()},f.load=function(L,E,m){l(L),this.loader.load(L,E,m)},O(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},C.createFragmentLoader=function(){var o=this.config.fLoader,l=this.applyFragmentData,d=o||this.config.loader;return function(){function A(g){this.loader=void 0,this.loader=new d(g)}var f=A.prototype;return f.destroy=function(){this.loader.destroy()},f.abort=function(){this.loader.abort()},f.load=function(L,E,m){l(L),this.loader.load(L,E,m)},O(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},w.uuid=function(){var o=URL.createObjectURL(new Blob),l=o.toString();return URL.revokeObjectURL(o),l.substr(l.lastIndexOf("/")+1)},w.serialize=function(o){for(var l=[],d=function(H){return!Number.isNaN(H)&&H!=null&&H!==""&&H!==!1},A=function(H){return Math.round(H)},f=function(H){return A(H/100)*100},g=function(H){return encodeURIComponent(H)},L={br:A,d:A,bl:f,dl:f,mtp:f,nor:g,rtp:f,tb:A},E=Object.keys(o||{}).sort(),m=M(E),c;!(c=m()).done;){var u=c.value,a=o[u];if(!d(a))continue;if(u==="v"&&a===1)continue;if(u=="pr"&&a===1)continue;var b=L[u];b&&(a=b(a));var v=typeof a,x=void 0;u==="ot"||u==="sf"||u==="st"?x=u+"="+a:v==="boolean"?x=u:v==="number"?x=u+"="+a:x=u+"="+JSON.stringify(a),l.push(x)}return l.join(",")},w.toHeaders=function(o){for(var l=Object.keys(o),d={},A=["Object","Request","Session","Status"],f=[{},{},{},{}],g={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},L=0,E=l;L<E.length;L++){var m=E[L],c=g[m]!=null?g[m]:1;f[c][m]=o[m]}for(var u=0;u<f.length;u++){var a=w.serialize(f[u]);a&&(d["CMCD-"+A[u]]=a)}return d},w.toQuery=function(o){return"CMCD="+encodeURIComponent(w.serialize(o))},w.appendQueryToUri=function(o,l){if(!l)return o;var d=o.includes("?")?"&":"?";return""+o+d+l},w}()},"./src/controller/eme-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/utils/logger.ts"),G=R("./src/utils/mediakeys-helper.ts");function j(D,w){for(var C=0;C<w.length;C++){var h=w[C];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function O(D,w,C){return w&&j(D.prototype,w),C&&j(D,C),D}var M=3,y=function(w,C,h){var o={audioCapabilities:[],videoCapabilities:[]};return w.forEach(function(l){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+l+'"',robustness:h.audioRobustness||""})}),C.forEach(function(l){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+l+'"',robustness:h.videoRobustness||""})}),[o]},T=function(w,C,h,o){switch(w){case G.KeySystems.WIDEVINE:return y(C,h,o);default:throw new Error("Unknown key-system: "+w)}},k=function(){function D(C){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=C,this._config=C.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 w=D.prototype;return w.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},w._registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},w._unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},w.getLicenseServerUrl=function(h){switch(h){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+h+'"')},w._attemptKeySystemAccess=function(h,o,l){var d=this,A=T(h,o,l,this._drmSystemOptions);_.logger.log("Requesting encrypted media key-system access");var f=this.requestMediaKeySystemAccess(h,A);this.mediaKeysPromise=f.then(function(g){return d._onMediaKeySystemAccessObtained(h,g)}),f.catch(function(g){_.logger.error('Failed to obtain key-system "'+h+'" access:',g)})},w._onMediaKeySystemAccessObtained=function(h,o){var l=this;_.logger.log('Access for key-system "'+h+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:o,mediaKeySystemDomain:h};this._mediaKeysList.push(d);var A=Promise.resolve().then(function(){return o.createMediaKeys()}).then(function(f){return d.mediaKeys=f,_.logger.log('Media-keys created for key-system "'+h+'"'),l._onMediaKeysCreated(),f});return A.catch(function(f){_.logger.error("Failed to create media-keys:",f)}),A},w._onMediaKeysCreated=function(){var h=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),h._onNewMediaKeySession(o.mediaKeysSession))})},w._onNewMediaKeySession=function(h){var o=this;_.logger.log("New key-system session "+h.sessionId),h.addEventListener("message",function(l){o._onKeySessionMessage(h,l.message)},!1)},w._onKeySessionMessage=function(h,o){_.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(l){_.logger.log("Received license data (length: "+(l&&l.byteLength)+"), updating key-session"),h.update(l)})},w.onMediaEncrypted=function(h){var o=this;if(_.logger.log('Media is encrypted using "'+h.initDataType+'" init data type'),!this.mediaKeysPromise){_.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var l=function(A){if(!o._media)return;o._attemptSetMediaKeys(A),o._generateRequestWithPreferredKeySession(h.initDataType,h.initData)};this.mediaKeysPromise.then(l).catch(l)},w._attemptSetMediaKeys=function(h){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var o=this._mediaKeysList[0];if(!o||!o.mediaKeys){_.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}_.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(o.mediaKeys),this._hasSetMediaKeys=!0}},w._generateRequestWithPreferredKeySession=function(h,o){var l=this,d=this._mediaKeysList[0];if(!d){_.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){_.logger.warn("Key-Session already initialized but requested again");return}var A=d.mediaKeysSession;if(!A){_.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!o){_.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}_.logger.log('Generating key-session request for "'+h+'" init data type'),d.mediaKeysSessionInitialized=!0,A.generateRequest(h,o).then(function(){_.logger.debug("Key-session generation succeeded")}).catch(function(f){_.logger.error("Error generating key-session request:",f),l.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},w._createLicenseXhr=function(h,o,l){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,h,o,l);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,d,h),A=void 0}catch(f){_.logger.error(f)}try{d.readyState||d.open("POST",h,!0),A&&A.call(this.hls,d,h)}catch(f){throw new Error("issue setting up KeySystem license XHR "+f)}return d},w._onLicenseRequestReadyStageChange=function(h,o,l,d){switch(h.readyState){case 4:if(h.status===200){this._requestLicenseFailureCount=0,_.logger.log("License request succeeded");var A=h.response,f=this._licenseResponseCallback;if(f)try{A=f.call(this.hls,h,o)}catch(L){_.logger.error(L)}d(A)}else{if(_.logger.error("License Request XHR failed ("+o+"). Status: "+h.status+" ("+h.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>M){this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var g=M-this._requestLicenseFailureCount+1;_.logger.warn("Retrying license request, "+g+" attempts left"),this._requestLicense(l,d)}break}},w._generateLicenseRequestChallenge=function(h,o){switch(h.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+h.mediaKeySystemDomain)},w._requestLicense=function(h,o){_.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){_.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(l.mediaKeySystemDomain),A=this._createLicenseXhr(d,h,o);_.logger.log("Sending license request to URL: "+d);var f=this._generateLicenseRequestChallenge(l,h);A.send(f)}catch(g){_.logger.error("Failure requesting DRM license: "+g),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},w.onMediaAttached=function(h,o){if(!this._emeEnabled)return;var l=o.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},w.onMediaDetached=function(){var h=this._media,o=this._mediaKeysList;if(!h)return;h.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return h.setMediaKeys(null)}).catch(function(){})},w.onManifestParsed=function(h,o){if(!this._emeEnabled)return;var l=o.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),d=o.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,l,d)},O(D,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),D}();X.default=k},"./src/controller/fps-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/events.ts"),B=R("./src/utils/logger.ts"),_=function(){function G(O){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=O,this.registerListeners()}var j=G.prototype;return j.setStreamController=function(M){this.streamController=M},j.registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},j.unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching)},j.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},j.onMediaAttaching=function(M,y){var T=this.hls.config;if(T.capLevelOnFPSDrop){var k=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=k,k&&typeof k.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),T.fpsDroppedMonitoringPeriod)}},j.checkFPS=function(M,y,T){var k=performance.now();if(y){if(this.lastTime){var D=k-this.lastTime,w=T-this.lastDroppedFrames,C=y-this.lastDecodedFrames,h=1e3*w/D,o=this.hls;if(o.trigger(Q.Events.FPS_DROP,{currentDropped:w,currentDecoded:C,totalDroppedFrames:T}),h>0&&w>o.config.fpsDroppedMonitoringThreshold*C){var l=o.currentLevel;B.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=l)&&(l=l-1,o.trigger(Q.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:o.currentLevel}),o.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=k,this.lastDroppedFrames=T,this.lastDecodedFrames=y}},j.checkFPSInterval=function(){var M=this.media;if(M)if(this.isVideoPlaybackQualityAvailable){var y=M.getVideoPlaybackQuality();this.checkFPS(M,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(M,M.webkitDecodedFrameCount,M.webkitDroppedFrameCount)},G}();X.default=_},"./src/controller/fragment-finders.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"findFragmentByPDT",function(){return _}),R.d(X,"findFragmentByPTS",function(){return G}),R.d(X,"fragmentWithinToleranceTest",function(){return j}),R.d(X,"pdtWithinToleranceTest",function(){return O}),R.d(X,"findFragWithCC",function(){return M});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/binary-search.ts");function _(y,T,k){if(T===null||!Array.isArray(y)||!y.length||!Object(Q.isFiniteNumber)(T))return null;var D=y[0].programDateTime;if(T<(D||0))return null;var w=y[y.length-1].endProgramDateTime;if(T>=(w||0))return null;k=k||0;for(var C=0;C<y.length;++C){var h=y[C];if(O(T,k,h))return h}return null}function G(y,T,k,D){k===void 0&&(k=0),D===void 0&&(D=0);var w=null;if(y?w=T[y.sn-T[0].sn+1]||null:k===0&&T[0].start===0&&(w=T[0]),w&&j(k,D,w)===0)return w;var C=B.default.search(T,j.bind(null,k,D));return C||w}function j(y,T,k){y===void 0&&(y=0),T===void 0&&(T=0);var D=Math.min(T,k.duration+(k.deltaPTS?k.deltaPTS:0));return k.start+k.duration-D<=y?1:k.start-D>y&&k.start?-1:0}function O(y,T,k){var D=Math.min(T,k.duration+(k.deltaPTS?k.deltaPTS:0))*1e3,w=k.endProgramDateTime||0;return w-D>y}function M(y,T){return B.default.search(y,function(k){return k.cc<T?1:k.cc>T?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"FragmentState",function(){return _}),R.d(X,"FragmentTracker",function(){return G});var Q=R("./src/events.ts"),B=R("./src/types/loader.ts"),_;(function(M){M.NOT_LOADED="NOT_LOADED",M.BACKTRACKED="BACKTRACKED",M.APPENDING="APPENDING",M.PARTIAL="PARTIAL",M.OK="OK"})(_||(_={}));var G=function(){function M(T){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=T,this._registerListeners()}var y=M.prototype;return y._registerListeners=function(){var k=this.hls;k.on(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.on(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.on(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var k=this.hls;k.off(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.off(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.off(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(k,D){if(D===B.PlaylistLevelType.MAIN){var w=this.activeFragment,C=this.activeParts;if(!w)return null;if(C)for(var h=C.length;h--;){var o=C[h],l=o?o.end:w.appendedPTS;if(o.start<=k&&l!==void 0&&k<=l)return h>9&&(this.activeParts=C.slice(h-9)),o}else if(w.start<=k&&w.appendedPTS!==void 0&&k<=w.appendedPTS)return w}return this.getBufferedFrag(k,D)},y.getBufferedFrag=function(k,D){for(var w=this.fragments,C=Object.keys(w),h=C.length;h--;){var o=w[C[h]];if((o==null?void 0:o.body.type)===D&&o.buffered){var l=o.body;if(l.start<=k&&k<=l.end)return l}}return null},y.detectEvictedFragments=function(k,D,w){var C=this;Object.keys(this.fragments).forEach(function(h){var o=C.fragments[h];if(!o)return;if(!o.buffered){o.body.type===w&&C.removeFragment(o.body);return}var l=o.range[k];if(!l)return;l.time.some(function(d){var A=!C.isTimeBuffered(d.startPTS,d.endPTS,D);return A&&C.removeFragment(o.body),A})})},y.detectPartialFragments=function(k){var D=this,w=this.timeRanges,C=k.frag,h=k.part;if(!w||C.sn==="initSegment")return;var o=O(C),l=this.fragments[o];if(!l)return;Object.keys(w).forEach(function(d){var A=C.elementaryStreams[d];if(!A)return;var f=w[d],g=h!==null||A.partial===!0;l.range[d]=D.getBufferedTimes(C,h,g,f)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},y.fragBuffered=function(k){var D=O(k),w=this.fragments[D];w&&(w.backtrack=w.loaded=null,w.buffered=!0)},y.getBufferedTimes=function(k,D,w,C){for(var h={time:[],partial:w},o=D?D.start:k.start,l=D?D.end:k.end,d=k.minEndPTS||l,A=k.maxStartPTS||o,f=0;f<C.length;f++){var g=C.start(f)-this.bufferPadding,L=C.end(f)+this.bufferPadding;if(A>=g&&d<=L){h.time.push({startPTS:Math.max(o,C.start(f)),endPTS:Math.min(l,C.end(f))});break}else if(o<L&&l>g)h.partial=!0,h.time.push({startPTS:Math.max(o,C.start(f)),endPTS:Math.min(l,C.end(f))});else if(l<=g)break}return h},y.getPartialFragment=function(k){var D=null,w,C,h,o=0,l=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(A){var f=d[A];if(!f)return;j(f)&&(C=f.body.start-l,h=f.body.end+l,k>=C&&k<=h&&(w=Math.min(k-C,h-k),o<=w&&(D=f.body,o=w)))}),D},y.getState=function(k){var D=O(k),w=this.fragments[D];return w?w.buffered?j(w)?_.PARTIAL:_.OK:w.backtrack?_.BACKTRACKED:_.APPENDING:_.NOT_LOADED},y.backtrack=function(k,D){var w=O(k),C=this.fragments[w];if(!C||C.backtrack)return null;var h=C.backtrack=D||C.loaded;return C.loaded=null,h},y.getBacktrackData=function(k){var D=O(k),w=this.fragments[D];if(w){var C,h=w.backtrack;if(h!=null&&(C=h.payload)!==null&&C!==void 0&&C.byteLength)return h;this.removeFragment(k)}return null},y.isTimeBuffered=function(k,D,w){for(var C,h,o=0;o<w.length;o++){if(C=w.start(o)-this.bufferPadding,h=w.end(o)+this.bufferPadding,k>=C&&D<=h)return!0;if(D<=C)return!1}return!1},y.onFragLoaded=function(k,D){var w=D.frag,C=D.part;if(w.sn==="initSegment"||w.bitrateTest||C)return;var h=O(w);this.fragments[h]={body:w,loaded:D,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(k,D){var w=this,C=D.frag,h=D.part,o=D.timeRanges;if(C.type===B.PlaylistLevelType.MAIN)if(this.activeFragment=C,h){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(h)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(d){var A=o[d];if(w.detectEvictedFragments(d,A),!h)for(var f=0;f<A.length;f++)C.appendedPTS=Math.max(A.end(f),C.appendedPTS||0)})},y.onFragBuffered=function(k,D){this.detectPartialFragments(D)},y.hasFragment=function(k){var D=O(k);return!!this.fragments[D]},y.removeFragmentsInRange=function(k,D,w){var C=this;Object.keys(this.fragments).forEach(function(h){var o=C.fragments[h];if(!o)return;if(o.buffered){var l=o.body;l.type===w&&l.start<D&&l.end>k&&C.removeFragment(l)}})},y.removeFragment=function(k){var D=O(k);k.stats.loaded=0,k.clearElementaryStreamInfo(),delete this.fragments[D]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},M}();function j(M){var y,T;return M.buffered&&(((y=M.range.video)===null||y===void 0?void 0:y.partial)||((T=M.range.audio)===null||T===void 0?void 0:T.partial))}function O(M){return M.type+"_"+M.level+"_"+M.urlId+"_"+M.sn}},"./src/controller/gap-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"STALL_MINIMUM_DURATION_MS",function(){return j}),R.d(X,"MAX_START_GAP_JUMP",function(){return O}),R.d(X,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return M}),R.d(X,"SKIP_BUFFER_RANGE_START",function(){return y}),R.d(X,"default",function(){return T});var Q=R("./src/utils/buffer-helper.ts"),B=R("./src/errors.ts"),_=R("./src/events.ts"),G=R("./src/utils/logger.ts"),j=250,O=2,M=.1,y=.05,T=function(){function k(w,C,h,o){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=w,this.media=C,this.fragmentTracker=h,this.hls=o}var D=k.prototype;return D.destroy=function(){this.hls=this.fragmentTracker=this.media=null},D.poll=function(C){var h=this.config,o=this.media,l=this.stalled,d=o.currentTime,A=o.seeking,f=this.seeking&&!A,g=!this.seeking&&A;if(this.seeking=A,d!==C){if(this.moved=!0,l!==null){if(this.stallReported){var L=self.performance.now()-l;G.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((g||f)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!Q.BufferHelper.getBuffered(o).length)return;var E=Q.BufferHelper.bufferInfo(o,d,0),m=E.len>0,c=E.nextStart||0;if(!m&&!c)return;if(A){var u=E.len>O,a=!c||c-d>O&&!this.fragmentTracker.getPartialFragment(d);if(u||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var b,v=Math.max(c,E.start||0)-d,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=x==null||((b=x.details)===null||b===void 0)?void 0:b.live,H=P?x.details.targetduration*2:O;if(v>0&&v<=H){this._trySkipBufferHole(null);return}}var V=self.performance.now();if(l===null){this.stalled=V;return}var $=V-l;!A&&$>=j&&this._reportStall(E.len);var z=Q.BufferHelper.bufferInfo(o,d,h.maxBufferHole);this._tryFixBufferStall(z,$)},D._tryFixBufferStall=function(C,h){var o=this.config,l=this.fragmentTracker,d=this.media,A=d.currentTime,f=l.getPartialFragment(A);if(f){var g=this._trySkipBufferHole(f);if(g)return}C.len>o.maxBufferHole&&h>o.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},D._reportStall=function(C){var h=this.hls,o=this.media,l=this.stallReported;l||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+C+")"),h.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:C}))},D._trySkipBufferHole=function(C){for(var h=this.config,o=this.hls,l=this.media,d=l.currentTime,A=0,f=Q.BufferHelper.getBuffered(l),g=0;g<f.length;g++){var L=f.start(g);if(d+h.maxBufferHole>=A&&d<L){var E=Math.max(L+y,l.currentTime+M);return G.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+E),this.moved=!0,this.stalled=null,l.currentTime=E,C&&o.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+E,frag:C}),E}A=f.end(g)}return 0},D._tryNudgeBuffer=function(){var C=this.config,h=this.hls,o=this.media,l=o.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<C.nudgeMaxRetry){var A=l+d*C.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+l+" to "+A),o.currentTime=A,h.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+l+" after "+C.nudgeMaxRetry+" nudges"),h.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},k}()},"./src/controller/id3-track-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/events.ts"),B=R("./src/utils/texttrack-utils.ts"),_=R("./src/demux/id3.ts"),G=.25,j=function(){function O(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var M=O.prototype;return M.destroy=function(){this._unregisterListeners()},M._registerListeners=function(){var T=this.hls;T.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),T.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M._unregisterListeners=function(){var T=this.hls;T.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),T.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M.onMediaAttached=function(T,k){this.media=k.media},M.onMediaDetaching=function(){if(!this.id3Track)return;Object(B.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},M.getID3Track=function(T){if(!this.media)return;for(var k=0;k<T.length;k++){var D=T[k];if(D.kind==="metadata"&&D.label==="id3")return Object(B.sendAddTrackEvent)(D,this.media),D}return this.media.addTextTrack("metadata","id3")},M.onFragParsingMetadata=function(T,k){if(!this.media)return;var D=k.frag,w=k.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var C=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,h=0;h<w.length;h++){var o=_.getID3Frames(w[h].data);if(o){var l=w[h].pts,d=h<w.length-1?w[h+1].pts:D.end,A=d-l;A<=0&&(d=l+G);for(var f=0;f<o.length;f++){var g=o[f];if(!_.isTimeStampFrame(g)){var L=new C(l,d,"");L.value=g,this.id3Track.addCue(L)}}}}},M.onBufferFlushing=function(T,k){var D=k.startOffset,w=k.endOffset,C=k.type;if(!C||C==="audio"){var h=this.id3Track;h&&Object(B.removeCuesInRange)(h,D,w)}},O}();X.default=j},"./src/controller/latency-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return O});var Q=R("./src/errors.ts"),B=R("./src/events.ts"),_=R("./src/utils/logger.ts");function G(M,y){for(var T=0;T<y.length;T++){var k=y[T];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(M,k.key,k)}}function j(M,y,T){return y&&G(M.prototype,y),T&&G(M,T),M}var O=function(){function M(T){var k=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 k.timeupdate()},this.hls=T,this.config=T.config,this.registerListeners()}var y=M.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(B.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(B.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(B.Events.ERROR,this.onError)},y.onMediaAttached=function(k,D){this.media=D.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(k,D){var w=D.details;this.levelDetails=w,w.advanced&&this.timeupdate(),!w.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(k,D){if(D.details!==Q.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,_.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var k=this.media,D=this.levelDetails;if(!k||!D)return;this.currentTime=k.currentTime;var w=this.computeLatency();if(w===null)return;this._latency=w;var C=this.config,h=C.lowLatencyMode,o=C.maxLiveSyncPlaybackRate;if(!h||o===1)return;var l=this.targetLatency;if(l===null)return;var d=w-l,A=Math.min(this.maxLatency,l+D.targetduration),f=d<A;if(D.live&&f&&d>.05&&this.forwardBufferLength>1){var g=Math.min(2,Math.max(1,o)),L=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;k.playbackRate=Math.min(g,Math.max(1,L))}else k.playbackRate!==1&&k.playbackRate!==0&&(k.playbackRate=1)},y.estimateLiveEdge=function(){var k=this.levelDetails;return k===null?null:k.edge+k.age},y.computeLatency=function(){var k=this.estimateLiveEdge();return k===null?null:k-this.currentTime},j(M,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var k=this.config,D=this.levelDetails;return k.liveMaxLatencyDuration!==void 0?k.liveMaxLatencyDuration:D?k.liveMaxLatencyDurationCount*D.targetduration:0}},{key:"targetLatency",get:function(){var k=this.levelDetails;if(k===null)return null;var D=k.holdBack,w=k.partHoldBack,C=k.targetduration,h=this.config,o=h.liveSyncDuration,l=h.liveSyncDurationCount,d=h.lowLatencyMode,A=this.hls.userConfig,f=d&&w||D;(A.liveSyncDuration||A.liveSyncDurationCount||f===0)&&(f=o!==void 0?o:l*C);var g=C,L=1;return f+Math.min(this.stallCount*L,g)}},{key:"liveSyncPosition",get:function(){var k=this.estimateLiveEdge(),D=this.targetLatency,w=this.levelDetails;if(k===null||D===null||w===null)return null;var C=w.edge,h=k-D-this.edgeStalled,o=C-w.totalduration,l=C-(this.config.lowLatencyMode&&w.partTarget||w.targetduration);return Math.min(Math.max(o,h),l)}},{key:"drift",get:function(){var k=this.levelDetails;return k===null?1:k.drift}},{key:"edgeStalled",get:function(){var k=this.levelDetails;if(k===null)return 0;var D=(this.config.lowLatencyMode&&k.partTarget||k.targetduration)*3;return Math.max(k.age-D,0)}},{key:"forwardBufferLength",get:function(){var k=this.media,D=this.levelDetails;if(!k||!D)return 0;var w=k.buffered.length;return w?k.buffered.end(w-1):D.edge-this.currentTime}}]),M}()},"./src/controller/level-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return h});var Q=R("./src/types/level.ts"),B=R("./src/events.ts"),_=R("./src/errors.ts"),G=R("./src/utils/codecs.ts"),j=R("./src/controller/level-helper.ts"),O=R("./src/controller/base-playlist-controller.ts"),M=R("./src/types/loader.ts");function y(){return y=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var d=arguments[l];for(var A in d)Object.prototype.hasOwnProperty.call(d,A)&&(o[A]=d[A])}return o},y.apply(this,arguments)}function T(o,l){for(var d=0;d<l.length;d++){var A=l[d];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(o,A.key,A)}}function k(o,l,d){return l&&T(o.prototype,l),d&&T(o,d),o}function D(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,w(o,l)}function w(o,l){return w=Object.setPrototypeOf||function(A,f){return A.__proto__=f,A},w(o,l)}var C=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),h=function(o){D(l,o);function l(A){var f;return f=o.call(this,A,"[level-controller]")||this,f._levels=[],f._firstLevel=-1,f._startLevel=void 0,f.currentLevelIndex=-1,f.manualLevelIndex=-1,f.onParsedComplete=void 0,f._registerListeners(),f}var d=l.prototype;return d._registerListeners=function(){var f=this.hls;f.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),f.on(B.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var f=this.hls;f.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(B.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,o.prototype.destroy.call(this)},d.startLoad=function(){var f=this._levels;f.forEach(function(g){g.loadError=0}),o.prototype.startLoad.call(this)},d.onManifestLoaded=function(f,g){var L=[],E=[],m=[],c,u={},a,b=!1,v=!1,x=!1;if(g.levels.forEach(function($){var z=$.attrs;b=b||!!($.width&&$.height),v=v||!!$.videoCodec,x=x||!!$.audioCodec,C&&$.audioCodec&&$.audioCodec.indexOf("mp4a.40.34")!==-1&&($.audioCodec=void 0);var F=$.bitrate+"-"+$.attrs.RESOLUTION+"-"+$.attrs.CODECS;a=u[F],a?a.url.push($.url):(a=new Q.Level($),u[F]=a,L.push(a)),z&&(z.AUDIO&&Object(j.addGroupId)(a,"audio",z.AUDIO),z.SUBTITLES&&Object(j.addGroupId)(a,"text",z.SUBTITLES))}),(b||v)&&x&&(L=L.filter(function($){var z=$.videoCodec,F=$.width,ee=$.height;return!!z||!!(F&&ee)})),L=L.filter(function($){var z=$.audioCodec,F=$.videoCodec;return(!z||Object(G.isCodecSupportedInMp4)(z,"audio"))&&(!F||Object(G.isCodecSupportedInMp4)(F,"video"))}),g.audioTracks&&(E=g.audioTracks.filter(function($){return!$.audioCodec||Object(G.isCodecSupportedInMp4)($.audioCodec,"audio")}),Object(j.assignTrackIdsByGroup)(E)),g.subtitles&&(m=g.subtitles,Object(j.assignTrackIdsByGroup)(m)),L.length>0){c=L[0].bitrate,L.sort(function($,z){return $.bitrate-z.bitrate}),this._levels=L;for(var P=0;P<L.length;P++)if(L[P].bitrate===c){this._firstLevel=P,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+c);break}var H=x&&!v,V={levels:L,audioTracks:E,subtitleTracks:m,firstLevel:this._firstLevel,stats:g.stats,audio:x,video:v,altAudio:!H&&E.some(function($){return!!$.url})};this.hls.trigger(B.Events.MANIFEST_PARSED,V),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(B.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:g.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(f,g){if(o.prototype.onError.call(this,f,g),g.fatal)return;var L=g.context,E=this._levels[this.currentLevelIndex];if(L&&(L.type===M.PlaylistContextType.AUDIO_TRACK&&E.audioGroupIds&&L.groupId===E.audioGroupIds[E.urlId]||L.type===M.PlaylistContextType.SUBTITLE_TRACK&&E.textGroupIds&&L.groupId===E.textGroupIds[E.urlId])){this.redundantFailover(this.currentLevelIndex);return}var m=!1,c=!0,u;switch(g.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:if(g.frag){var a=this._levels[g.frag.level];a?(a.fragmentError++,a.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=g.frag.level)):u=g.frag.level}break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(c=!1),u=L.level),m=!0;break;case _.ErrorDetails.REMUX_ALLOC_ERROR:u=g.level,m=!0;break}u!==void 0&&this.recoverLevel(g,u,m,c)},d.recoverLevel=function(f,g,L,E){var m=f.details,c=this._levels[g];if(c.loadError++,L){var u=this.retryLoadingOrFail(f);if(u)f.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(E){var a=c.url.length;if(a>1&&c.loadError<a)f.levelRetry=!0,this.redundantFailover(g);else if(this.manualLevelIndex===-1){var b=g===0?this._levels.length-1:g-1;this.currentLevelIndex!==b&&this._levels[b].loadError===0&&(this.warn(m+": switch to "+b),f.levelRetry=!0,this.hls.nextAutoLevel=b)}}},d.redundantFailover=function(f){var g=this._levels[f],L=g.url.length;if(L>1){var E=(g.urlId+1)%L;this.warn("Switching to redundant URL-id "+E),this._levels.forEach(function(m){m.urlId=E}),this.level=f}},d.onFragLoaded=function(f,g){var L=g.frag;if(L!==void 0&&L.type===M.PlaylistLevelType.MAIN){var E=this._levels[L.level];E!==void 0&&(E.fragmentError=0,E.loadError=0)}},d.onLevelLoaded=function(f,g){var L,E=g.level,m=g.details,c=this._levels[E];if(!c){var u;this.warn("Invalid level index "+E),(u=g.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(m.deltaUpdateFailed=!0);return}E===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(E,g,c.details)):(L=g.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(m.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(f,g){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var E=-1,m=this.hls.audioTracks[g.id].groupId,c=0;c<L.audioGroupIds.length;c++)if(L.audioGroupIds[c]===m){E=c;break}E!==L.urlId&&(L.urlId=E,this.startLoad())}},d.loadPlaylist=function(f){var g=this.currentLevelIndex,L=this._levels[g];if(this.canLoad&&L&&L.url.length>0){var E=L.urlId,m=L.url[E];if(f)try{m=f.addDirectives(m)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+g+(f?" at sn "+f.msn+" part "+f.part:"")+" with URL-id "+E+" "+m),this.clearTimer(),this.hls.trigger(B.Events.LEVEL_LOADING,{url:m,level:g,id:E,deliveryDirectives:f||null})}},d.removeLevel=function(f,g){var L=function(c,u){return u!==g},E=this._levels.filter(function(m,c){return c!==f?!0:m.url.length>1&&g!==void 0?(m.url=m.url.filter(L),m.audioGroupIds&&(m.audioGroupIds=m.audioGroupIds.filter(L)),m.textGroupIds&&(m.textGroupIds=m.textGroupIds.filter(L)),m.urlId=0,!0):!1}).map(function(m,c){var u=m.details;return u!=null&&u.fragments&&u.fragments.forEach(function(a){a.level=c}),m});this._levels=E,this.hls.trigger(B.Events.LEVELS_UPDATED,{levels:E})},k(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(f){var g,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===f&&(g=L[f])!==null&&g!==void 0&&g.details)return;if(f<0||f>=L.length){var E=f<0;if(this.hls.trigger(B.Events.ERROR,{type:_.ErrorTypes.OTHER_ERROR,details:_.ErrorDetails.LEVEL_SWITCH_ERROR,level:f,fatal:E,reason:"invalid level idx"}),E)return;f=Math.min(f,L.length-1)}this.clearTimer();var m=this.currentLevelIndex,c=L[m],u=L[f];this.log("switching to level "+f+" from "+m),this.currentLevelIndex=f;var a=y({},u,{level:f,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete a._urlId,this.hls.trigger(B.Events.LEVEL_SWITCHING,a);var b=u.details;if(!b||b.live){var v=this.switchParams(u.uri,c==null?void 0:c.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(f){this.manualLevelIndex=f,this._startLevel===void 0&&(this._startLevel=f),f!==-1&&(this.level=f)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(f){this._firstLevel=f}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var f=this.hls.config.startLevel;return f!==void 0?f:this._firstLevel}else return this._startLevel},set:function(f){this._startLevel=f}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(f){this.level=f,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=f)}}]),l}(O.default)},"./src/controller/level-helper.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"addGroupId",function(){return _}),R.d(X,"assignTrackIdsByGroup",function(){return G}),R.d(X,"updatePTS",function(){return j}),R.d(X,"updateFragPTSDTS",function(){return M}),R.d(X,"mergeDetails",function(){return y}),R.d(X,"mapPartIntersection",function(){return T}),R.d(X,"mapFragmentIntersection",function(){return k}),R.d(X,"adjustSliding",function(){return D}),R.d(X,"addSliding",function(){return w}),R.d(X,"computeReloadInterval",function(){return C}),R.d(X,"getFragmentWithSN",function(){return h}),R.d(X,"getPartWith",function(){return o});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/logger.ts");function _(l,d,A){switch(d){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(A);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(A);break}}function G(l){var d={};l.forEach(function(A){var f=A.groupId||"";A.id=d[f]=d[f]||0,d[f]++})}function j(l,d,A){var f=l[d],g=l[A];O(f,g)}function O(l,d){var A=d.startPTS;if(Object(Q.isFiniteNumber)(A)){var f=0,g;d.sn>l.sn?(f=A-l.start,g=l):(f=l.start-A,g=d),g.duration!==f&&(g.duration=f)}else if(d.sn>l.sn){var L=l.cc===d.cc;L&&l.minEndPTS?d.start=l.start+(l.minEndPTS-l.start):d.start=l.start+l.duration}else d.start=Math.max(l.start-d.duration,0)}function M(l,d,A,f,g,L){var E=f-A;E<=0&&(B.logger.warn("Fragment should have a positive duration",d),f=A+d.duration,L=g+d.duration);var m=A,c=f,u=d.startPTS,a=d.endPTS;if(Object(Q.isFiniteNumber)(u)){var b=Math.abs(u-A);Object(Q.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(b,d.deltaPTS):d.deltaPTS=b,m=Math.max(A,u),A=Math.min(A,u),g=Math.min(g,d.startDTS),c=Math.min(f,a),f=Math.max(f,a),L=Math.max(L,d.endDTS)}d.duration=f-A;var v=A-d.start;d.appendedPTS=f,d.start=d.startPTS=A,d.maxStartPTS=m,d.startDTS=g,d.endPTS=f,d.minEndPTS=c,d.endDTS=L;var x=d.sn;if(!l||x<l.startSN||x>l.endSN)return 0;var P,H=x-l.startSN,V=l.fragments;for(V[H]=d,P=H;P>0;P--)O(V[P],V[P-1]);for(P=H;P<V.length-1;P++)O(V[P],V[P+1]);return l.fragmentHint&&O(V[V.length-1],l.fragmentHint),l.PTSKnown=l.alignedSliding=!0,v}function y(l,d){for(var A=null,f=l.fragments,g=f.length-1;g>=0;g--){var L=f[g].initSegment;if(L){A=L;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var E=0,m;if(k(l,d,function(P,H){P.relurl&&(E=P.cc-H.cc),Object(Q.isFiniteNumber)(P.startPTS)&&Object(Q.isFiniteNumber)(P.endPTS)&&(H.start=H.startPTS=P.startPTS,H.startDTS=P.startDTS,H.appendedPTS=P.appendedPTS,H.maxStartPTS=P.maxStartPTS,H.endPTS=P.endPTS,H.endDTS=P.endDTS,H.minEndPTS=P.minEndPTS,H.duration=P.endPTS-P.startPTS,H.duration&&(m=H),d.PTSKnown=d.alignedSliding=!0),H.elementaryStreams=P.elementaryStreams,H.loader=P.loader,H.stats=P.stats,H.urlId=P.urlId,P.initSegment&&(H.initSegment=P.initSegment,A=P.initSegment)}),A){var c=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;c.forEach(function(P){var H;(!P.initSegment||P.initSegment.relurl===((H=A)===null||H===void 0?void 0:H.relurl))&&(P.initSegment=A)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(P){return!P}),d.deltaUpdateFailed)){B.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=d.skippedSegments;u--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var a=d.fragments;if(E){B.logger.warn("discontinuity sliding from playlist, take drift into account");for(var b=0;b<a.length;b++)a[b].cc+=E}d.skippedSegments&&(d.startCC=d.fragments[0].cc),T(l.partList,d.partList,function(P,H){H.elementaryStreams=P.elementaryStreams,H.stats=P.stats}),m?M(d,m,m.startPTS,m.endPTS,m.startDTS,m.endDTS):D(l,d),a.length&&(d.totalduration=d.edge-a[0].start),d.driftStartTime=l.driftStartTime,d.driftStart=l.driftStart;var v=d.advancedDateTime;if(d.advanced&&v){var x=d.edge;d.driftStart||(d.driftStartTime=v,d.driftStart=x),d.driftEndTime=v,d.driftEnd=x}else d.driftEndTime=l.driftEndTime,d.driftEnd=l.driftEnd,d.advancedDateTime=l.advancedDateTime}function T(l,d,A){if(l&&d)for(var f=0,g=0,L=l.length;g<=L;g++){var E=l[g],m=d[g+f];E&&m&&E.index===m.index&&E.fragment.sn===m.fragment.sn?A(E,m):f--}}function k(l,d,A){for(var f=d.skippedSegments,g=Math.max(l.startSN,d.startSN)-d.startSN,L=(l.fragmentHint?1:0)+(f?d.endSN:Math.min(l.endSN,d.endSN))-d.startSN,E=d.startSN-l.startSN,m=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,c=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,u=g;u<=L;u++){var a=c[E+u],b=m[u];f&&!b&&u<f&&(b=d.fragments[u]=a),a&&b&&A(a,b)}}function D(l,d){var A=d.startSN+d.skippedSegments-l.startSN,f=l.fragments;if(A<0||A>=f.length)return;w(d,f[A].start)}function w(l,d){if(d){for(var A=l.fragments,f=l.skippedSegments;f<A.length;f++)A[f].start+=d;l.fragmentHint&&(l.fragmentHint.start+=d)}}function C(l,d){var A=1e3*l.levelTargetDuration,f=A/2,g=l.age,L=g>0&&g<A*3,E=d.loading.end-d.loading.start,m,c=l.availabilityDelay;if(l.updated===!1)if(L){var u=333*l.misses;m=Math.max(Math.min(f,E*2),u),l.availabilityDelay=(l.availabilityDelay||0)+m}else m=f;else L?(c=Math.min(c||A/2,g),l.availabilityDelay=c,m=c+A-g):m=A-E;return Math.round(m)}function h(l,d,A){if(!l||!l.details)return null;var f=l.details,g=f.fragments[d-f.startSN];return g||(g=f.fragmentHint,g&&g.sn===d?g:d<f.startSN&&A&&A.sn===d?A:null)}function o(l,d,A){if(!l||!l.details)return null;var f=l.details.partList;if(f)for(var g=f.length;g--;){var L=f[g];if(L.index===A&&L.fragment.sn===d)return L}return null}},"./src/controller/stream-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return f});var Q=R("./src/polyfills/number.ts"),B=R("./src/controller/base-stream-controller.ts"),_=R("./src/is-supported.ts"),G=R("./src/events.ts"),j=R("./src/utils/buffer-helper.ts"),O=R("./src/controller/fragment-tracker.ts"),M=R("./src/types/loader.ts"),y=R("./src/loader/fragment.ts"),T=R("./src/demux/transmuxer-interface.ts"),k=R("./src/types/transmuxer.ts"),D=R("./src/controller/gap-controller.ts"),w=R("./src/errors.ts"),C=R("./src/utils/logger.ts");function h(g,L){for(var E=0;E<L.length;E++){var m=L[E];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(g,m.key,m)}}function o(g,L,E){return L&&h(g.prototype,L),E&&h(g,E),g}function l(g,L){g.prototype=Object.create(L.prototype),g.prototype.constructor=g,d(g,L)}function d(g,L){return d=Object.setPrototypeOf||function(m,c){return m.__proto__=c,m},d(g,L)}var A=100,f=function(g){l(L,g);function L(m,c){var u;return u=g.call(this,m,c,"[stream-controller]")||this,u.audioCodecSwap=!1,u.gapController=null,u.level=-1,u._forceStartLoad=!1,u.altAudio=!1,u.audioOnly=!1,u.fragPlaying=null,u.onvplaying=null,u.onvseeked=null,u.fragLastKbps=0,u.stalled=!1,u.couldBacktrack=!1,u.audioCodecSwitch=!1,u.videoBuffer=null,u._registerListeners(),u}var E=L.prototype;return E._registerListeners=function(){var c=this.hls;c.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.on(G.Events.ERROR,this.onError,this),c.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var c=this.hls;c.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.off(G.Events.ERROR,this.onError,this),c.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},E.startLoad=function(c){if(this.levels){var u=this.lastCurrentTime,a=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var b=a.startLevel;b===-1&&(a.config.testBandwidth?(b=0,this.bitrateTest=!0):b=a.nextAutoLevel),this.level=a.nextLoadLevel=b,this.loadedmetadata=!1}u>0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),c=u),this.state=B.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=B.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,g.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_LEVEL:{var c,u=this.levels,a=this.level,b=u==null||((c=u[a])===null||c===void 0)?void 0:c.details;if(b&&(!b.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(b))break;this.state=B.State.IDLE;break}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var v,x=self.performance.now(),P=this.retryDate;(!P||x>=P||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=B.State.IDLE)}break;default:break}this.onTickEnd()},E.onTickEnd=function(){g.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var c,u,a=this.hls,b=this.levelLastLoaded,v=this.levels,x=this.media,P=a.config,H=a.nextLoadLevel;if(b===null||!x&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[H])return;var V=v[H];this.level=a.nextLoadLevel=H;var $=V.details;if(!$||this.state===B.State.WAITING_LEVEL||$.live&&this.levelLastLoaded!==H){this.state=B.State.WAITING_LEVEL;return}var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:x,M.PlaylistLevelType.MAIN);if(z===null)return;var F=z.len,ee=this.getMaxBufferLength(V.maxBitrate);if(F>=ee)return;if(this._streamEnded(z,$)){var oe={};this.altAudio&&(oe.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,oe),this.state=B.State.ENDED;return}var le=z.end,ve=this.getNextFragment(le,$);if(this.couldBacktrack&&!this.fragPrevious&&ve&&ve.sn!=="initSegment"){var Ie=ve.sn-$.startSN;Ie>1&&(ve=$.fragments[Ie-1],this.fragmentTracker.removeFragment(ve))}if(ve&&this.fragmentTracker.getState(ve)===O.FragmentState.OK&&this.nextLoadPosition>le){var xe=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(x,xe,M.PlaylistLevelType.MAIN),ve=this.getNextFragment(this.nextLoadPosition,$)}if(!ve)return;ve.initSegment&&!ve.initSegment.data&&!this.bitrateTest&&(ve=ve.initSegment),((c=ve.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((u=ve.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(ve,$):this.loadFragment(ve,$,le)},E.loadFragment=function(c,u,a){var b,v=this.fragmentTracker.getState(c);if(this.fragCurrent=c,v===O.FragmentState.BACKTRACKED){var x=this.fragmentTracker.getBacktrackData(c);if(x){this._handleFragmentLoadProgress(x),this._handleFragmentLoadComplete(x);return}else v=O.FragmentState.NOT_LOADED}v===O.FragmentState.NOT_LOADED||v===O.FragmentState.PARTIAL?c.sn==="initSegment"?this._loadInitSegment(c):this.bitrateTest?(c.bitrateTest=!0,this.log("Fragment "+c.sn+" of level "+c.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(c)):(this.startFragRequested=!0,g.prototype.loadFragment.call(this,c,u,a)):v===O.FragmentState.APPENDING?this.reduceMaxBufferLength(c.duration)&&this.fragmentTracker.removeFragment(c):((b=this.media)===null||b===void 0?void 0:b.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},E.getAppendedFrag=function(c){var u=this.fragmentTracker.getAppendedFrag(c,M.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},E.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,M.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.nextLevelSwitch=function(){var c=this.levels,u=this.media;if(u!=null&&u.readyState){var a,b=this.getAppendedFrag(u.currentTime);if(b&&b.start>1&&this.flushMainBuffer(0,b.start-1),!u.paused&&c){var v=this.hls.nextLoadLevel,x=c[v],P=this.fragLastKbps;P&&this.fragCurrent?a=this.fragCurrent.duration*x.maxBitrate/(1e3*P)+1:a=0}else a=0;var H=this.getBufferedFrag(u.currentTime+a);if(H){var V=this.followingBufferedFrag(H);if(V){this.abortCurrentFrag();var $=V.maxStartPTS?V.maxStartPTS:V.start,z=V.duration,F=Math.max(H.end,$+Math.min(Math.max(z-this.config.maxFragLookUpTolerance,z*.5),z*.75));this.flushMainBuffer(F,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var c=this.fragCurrent;this.fragCurrent=null,c!=null&&c.loader&&c.loader.abort(),this.state===B.State.KEY_LOADING&&(this.state=B.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(c,u){g.prototype.flushMainBuffer.call(this,c,u,this.altAudio?"video":null)},E.onMediaAttached=function(c,u){g.prototype.onMediaAttached.call(this,c,u);var a=u.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new D.default(this.config,a,this.fragmentTracker,this.hls)},E.onMediaDetaching=function(){var c=this.media;c&&(c.removeEventListener("playing",this.onvplaying),c.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),g.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var c=this.media,u=c?c.currentTime:null;Object(Q.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},E.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},E.onManifestParsed=function(c,u){var a=!1,b=!1,v;u.levels.forEach(function(x){v=x.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(a=!0),v.indexOf("mp4a.40.5")!==-1&&(b=!0))}),this.audioCodecSwitch=a&&b&&!Object(_.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=u.levels,this.startFragRequested=!1},E.onLevelLoading=function(c,u){var a=this.levels;if(!a||this.state!==B.State.IDLE)return;var b=a[u.level];(!b.details||b.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(b.details))&&(this.state=B.State.WAITING_LEVEL)},E.onLevelLoaded=function(c,u){var a,b=this.levels,v=u.level,x=u.details,P=x.totalduration;if(!b){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+x.startSN+","+x.endSN+"], cc ["+x.startCC+", "+x.endCC+"] duration:"+P);var H=this.fragCurrent;H&&(this.state===B.State.FRAG_LOADING||this.state===B.State.FRAG_LOADING_WAITING_RETRY)&&(H.level!==u.level&&H.loader&&(this.state=B.State.IDLE,H.loader.abort()));var V=b[v],$=0;if(x.live||(a=V.details)!==null&&a!==void 0&&a.live){if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed)return;$=this.alignPlaylists(x,V.details)}if(V.details=x,this.levelLastLoaded=v,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:x,level:v}),this.state===B.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(x))return;this.state=B.State.IDLE}this.startFragRequested?x.live&&this.synchronizeToLiveEdge(x):this.setStartPosition(x,$),this.tick()},E._handleFragmentLoadProgress=function(c){var u,a=c.frag,b=c.part,v=c.payload,x=this.levels;if(!x){this.warn("Levels were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered");return}var P=x[a.level],H=P.details;if(!H){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var V=P.videoCodec,$=H.PTSKnown||!H.live,z=(u=a.initSegment)===null||u===void 0?void 0:u.data,F=this._getAudioCodec(P),ee=this.transmuxer=this.transmuxer||new T.default(this.hls,M.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),oe=b?b.index:-1,le=oe!==-1,ve=new k.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,v.byteLength,oe,le),Ie=this.initPTS[a.cc];ee.push(v,z,F,V,a,b,H.totalduration,$,ve,Ie)},E.onAudioTrackSwitching=function(c,u){var a=this.altAudio,b=!!u.url,v=u.id;if(!b){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var x=this.fragCurrent;x!=null&&x.loader&&(this.log("Switching to main audio track, cancel main fragment load"),x.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;a&&P.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:v})}},E.onAudioTrackSwitched=function(c,u){var a=u.id,b=!!this.hls.audioTracks[a].url;if(b){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=b,this.tick()},E.onBufferCreated=function(c,u){var a=u.tracks,b,v,x=!1;for(var P in a){var H=a[P];if(H.id==="main"){if(v=P,b=H,P==="video"){var V=a[P];V&&(this.videoBuffer=V.buffer)}}else x=!0}x&&b?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=b.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(c,u){var a=u.frag,b=u.part;if(a&&a.type!==M.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(a)){this.warn("Fragment "+a.sn+(b?" p: "+b.index:"")+" of level "+a.level+" finished buffering, but was aborted. state: "+this.state),this.state===B.State.PARSED&&(this.state=B.State.IDLE);return}var v=b?b.stats:a.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,b)},E.onError=function(c,u){switch(u.details){case w.ErrorDetails.FRAG_LOAD_ERROR:case w.ErrorDetails.FRAG_LOAD_TIMEOUT:case w.ErrorDetails.KEY_LOAD_ERROR:case w.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.MAIN,u);break;case w.ErrorDetails.LEVEL_LOAD_ERROR:case w.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==B.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=B.State.ERROR):!u.levelRetry&&this.state===B.State.WAITING_LEVEL&&(this.state=B.State.IDLE));break;case w.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var a=!0,b=this.getFwdBufferInfo(this.media,M.PlaylistLevelType.MAIN);b&&b.len>.5&&(a=!this.reduceMaxBufferLength(b.len)),a&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},E.checkBuffer=function(){var c=this.media,u=this.gapController;if(!c||!u||!c.readyState)return;var a=j.BufferHelper.getBuffered(c);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},E.onFragLoadEmergencyAborted=function(){this.state=B.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(c,u){var a=u.type;if(a!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var b=(a===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(b,a,M.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(c,u){this.levels=u.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.seekToStartPos=function(){var c=this.media,u=c.currentTime,a=this.startPosition;if(a>=0&&u<a){if(c.seeking){C.logger.log("could not seek to "+a+", already seeking at "+u);return}var b=j.BufferHelper.getBuffered(c),v=b.length?b.start(0):0,x=v-a;x>0&&(x<this.config.maxBufferHole||x<this.config.maxFragLookUpTolerance)&&(C.logger.log("adjusting start position by "+x+" to match buffer start"),a+=x,this.startPosition=a),this.log("seek to target start position "+a+" from current time "+u),c.currentTime=a}},E._getAudioCodec=function(c){var u=this.config.defaultAudioCodec||c.audioCodec;return this.audioCodecSwap&&u&&(this.log("Swapping audio codec"),u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5"),u},E._loadBitrateTestFrag=function(c){var u=this;this._doFragLoad(c).then(function(a){var b=u.hls;if(!a||b.nextLoadLevel||u.fragContextChanged(c))return;u.fragLoadError=0,u.state=B.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var v=c.stats;v.parsing.start=v.parsing.end=v.buffering.start=v.buffering.end=self.performance.now(),b.trigger(G.Events.FRAG_LOADED,a)})},E._handleTransmuxComplete=function(c){var u,a="main",b=this.hls,v=c.remuxResult,x=c.chunkMeta,P=this.getCurrentContext(x);if(!P){this.warn("The loading context changed while buffering fragment "+x.sn+" of level "+x.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(x.level);return}var H=P.frag,V=P.part,$=P.level,z=v.video,F=v.text,ee=v.id3,oe=v.initSegment,le=this.altAudio?void 0:v.audio;if(this.fragContextChanged(H))return;if(this.state=B.State.PARSING,oe){oe.tracks&&(this._bufferInitSegment($,oe.tracks,H,x),b.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:a,tracks:oe.tracks}));var ve=oe.initPTS,Ie=oe.timescale;Object(Q.isFiniteNumber)(ve)&&(this.initPTS[H.cc]=ve,b.trigger(G.Events.INIT_PTS_FOUND,{frag:H,id:a,initPTS:ve,timescale:Ie}))}if(z&&v.independent!==!1){if($.details){var xe=z.startPTS,Ce=z.endPTS,Te=z.startDTS,Se=z.endDTS;if(V)V.elementaryStreams[z.type]={startPTS:xe,endPTS:Ce,startDTS:Te,endDTS:Se};else if(z.firstKeyFrame&&z.independent&&(this.couldBacktrack=!0),z.dropped&&z.independent){var pe=this.getLoadPosition()+this.config.maxBufferHole;if(pe<xe){this.backtrack(H);return}H.setElementaryStreamInfo(z.type,H.start,Ce,H.start,Se,!0)}H.setElementaryStreamInfo(z.type,xe,Ce,Te,Se),this.bufferFragmentData(z,H,V,x)}}else if(v.independent===!1){this.backtrack(H);return}if(le){var se=le.startPTS,De=le.endPTS,Ye=le.startDTS,Ge=le.endDTS;V&&(V.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:De,startDTS:Ye,endDTS:Ge}),H.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,se,De,Ye,Ge),this.bufferFragmentData(le,H,V,x)}if(ee!=null&&(u=ee.samples)!==null&&u!==void 0&&u.length){var $e={frag:H,id:a,samples:ee.samples};b.trigger(G.Events.FRAG_PARSING_METADATA,$e)}if(F){var et={frag:H,id:a,samples:F.samples};b.trigger(G.Events.FRAG_PARSING_USERDATA,et)}},E._bufferInitSegment=function(c,u,a,b){var v=this;if(this.state!==B.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var x=u.audio,P=u.video,H=u.audiovideo;if(x){var V=c.audioCodec,$=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(V&&(V.indexOf("mp4a.40.5")!==-1?V="mp4a.40.2":V="mp4a.40.5"),x.metadata.channelCount!==1&&$.indexOf("firefox")===-1&&(V="mp4a.40.5")),$.indexOf("android")!==-1&&x.container!=="audio/mpeg"&&(V="mp4a.40.2",this.log("Android: force audio codec to "+V)),c.audioCodec&&c.audioCodec!==V&&this.log('Swapping manifest audio codec "'+c.audioCodec+'" for "'+V+'"'),x.levelCodec=V,x.id="main",this.log("Init audio buffer, container:"+x.container+", codecs[selected/level/parsed]=["+(V||"")+"/"+(c.audioCodec||"")+"/"+x.codec+"]")}P&&(P.levelCodec=c.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(c.videoCodec||"")+"/"+P.codec+"]")),H&&this.log("Init audiovideo buffer, container:"+H.container+", codecs[level/parsed]=["+(c.attrs.CODECS||"")+"/"+H.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(z){var F=u[z],ee=F.initSegment;ee!=null&&ee.byteLength&&v.hls.trigger(G.Events.BUFFER_APPENDING,{type:z,data:ee,frag:a,part:null,chunkMeta:b,parent:a.type})}),this.tick()},E.backtrack=function(c){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(c);var u=this.fragmentTracker.backtrack(c);this.fragPrevious=null,this.nextLoadPosition=c.start,u?this.resetFragmentLoading(c):this.state=B.State.BACKTRACKING},E.checkFragmentChanged=function(){var c=this.media,u=null;if(c&&c.readyState>1&&c.seeking===!1){var a=c.currentTime;if(j.BufferHelper.isBuffered(c,a)?u=this.getAppendedFrag(a):j.BufferHelper.isBuffered(c,a+.1)&&(u=this.getAppendedFrag(a+.1)),u){var b=this.fragPlaying,v=u.level;(!b||u.sn!==b.sn||b.level!==v||u.urlId!==b.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:u}),(!b||b.level!==v)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:v}),this.fragPlaying=u)}}},o(L,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var u=this.getAppendedFrag(c.currentTime);if(u)return u.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var u=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(u)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(B.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"SubtitleStreamController",function(){return l});var Q=R("./src/events.ts"),B=R("./src/utils/logger.ts"),_=R("./src/utils/buffer-helper.ts"),G=R("./src/controller/fragment-finders.ts"),j=R("./src/utils/discontinuities.ts"),O=R("./src/controller/level-helper.ts"),M=R("./src/controller/fragment-tracker.ts"),y=R("./src/controller/base-stream-controller.ts"),T=R("./src/types/loader.ts"),k=R("./src/types/level.ts");function D(d,A){for(var f=0;f<A.length;f++){var g=A[f];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(d,g.key,g)}}function w(d,A,f){return A&&D(d.prototype,A),f&&D(d,f),d}function C(d,A){d.prototype=Object.create(A.prototype),d.prototype.constructor=d,h(d,A)}function h(d,A){return h=Object.setPrototypeOf||function(g,L){return g.__proto__=L,g},h(d,A)}var o=500,l=function(d){C(A,d);function A(g,L){var E;return E=d.call(this,g,L,"[subtitle-stream-controller]")||this,E.levels=[],E.currentTrackId=-1,E.tracksBuffered=[],E.mainDetails=null,E._registerListeners(),E}var f=A.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var L=this.hls;L.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(Q.Events.ERROR,this.onError,this),L.on(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},f._unregisterListeners=function(){var L=this.hls;L.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(Q.Events.ERROR,this.onError,this),L.off(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},f.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(o),this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},f.onLevelLoaded=function(L,E){this.mainDetails=E.details},f.onSubtitleFragProcessed=function(L,E){var m=E.frag,c=E.success;if(this.fragPrevious=m,this.state=y.State.IDLE,!c)return;var u=this.tracksBuffered[this.currentTrackId];if(!u)return;for(var a,b=m.start,v=0;v<u.length;v++)if(b>=u[v].start&&b<=u[v].end){a=u[v];break}var x=m.start+m.duration;a?a.end=x:(a={start:b,end:x},u.push(a)),this.fragmentTracker.fragBuffered(m)},f.onBufferFlushing=function(L,E){var m=E.startOffset,c=E.endOffset;if(m===0&&c!==Number.POSITIVE_INFINITY){var u=this.currentTrackId,a=this.levels;if(!a.length||!a[u]||!a[u].details)return;var b=a[u].details,v=b.targetduration,x=c-v;if(x<=0)return;E.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(P){for(var H=0;H<P.length;){if(P[H].end<=x){P.shift();continue}else if(P[H].start<x)P[H].start=x;else break;H++}}),this.fragmentTracker.removeFragmentsInRange(m,x,T.PlaylistLevelType.SUBTITLE)}},f.onError=function(L,E){var m,c=E.frag;if(!c||c.type!==T.PlaylistLevelType.SUBTITLE)return;(m=this.fragCurrent)!==null&&m!==void 0&&m.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},f.onSubtitleTracksUpdated=function(L,E){var m=this,c=E.subtitleTracks;this.tracksBuffered=[],this.levels=c.map(function(u){return new k.Level(u)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(u){m.tracksBuffered[u.id]=[]}),this.mediaBuffer=null},f.onSubtitleTrackSwitch=function(L,E){if(this.currentTrackId=E.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var m=this.levels[this.currentTrackId];m!=null&&m.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,m&&this.setInterval(o)},f.onSubtitleTrackLoaded=function(L,E){var m,c=E.details,u=E.id,a=this.currentTrackId,b=this.levels;if(!b.length)return;var v=b[a];if(u>=b.length||u!==a||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(m=v.details)!==null&&m!==void 0&&m.live){var x=this.mainDetails;if(c.deltaUpdateFailed||!x)return;var P=x.fragments[0];if(!v.details)c.hasProgramDateTime&&x.hasProgramDateTime?Object(j.alignMediaPlaylistByPDT)(c,x):P&&Object(O.addSliding)(c,P.start);else{var H=this.alignPlaylists(c,v.details);H===0&&P&&Object(O.addSliding)(c,P.start)}}if(v.details=c,this.levelLastLoaded=u,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var V=Object(G.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);V||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},f._handleFragmentLoadComplete=function(L){var E=L.frag,m=L.payload,c=E.decryptdata,u=this.hls;if(this.fragContextChanged(E))return;if(m&&m.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(m),c.key.buffer,c.iv.buffer).then(function(b){var v=performance.now();u.trigger(Q.Events.FRAG_DECRYPTED,{frag:E,payload:b,stats:{tstart:a,tdecrypt:v}})})}},f.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var L,E=this.currentTrackId,m=this.levels;if(!m.length||!m[E]||!m[E].details)return;var c=m[E].details,u=c.targetduration,a=this.config,b=this.media,v=_.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,b.currentTime-u,a.maxBufferHole),x=v.end,P=v.len,H=this.getMaxBufferLength()+u;if(P>H)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var V=c.fragments,$=V.length,z=c.edge,F,ee=this.fragPrevious;if(x<z){var oe=a.maxFragLookUpTolerance;ee&&c.hasProgramDateTime&&(F=Object(G.findFragmentByPDT)(V,ee.endProgramDateTime,oe)),F||(F=Object(G.findFragmentByPTS)(ee,V,x,oe),!F&&ee&&ee.start<V[0].start&&(F=V[0]))}else F=V[$-1];(L=F)!==null&&L!==void 0&&L.encrypted?(B.logger.log("Loading key for "+F.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(Q.Events.KEY_LOADING,{frag:F})):F&&this.fragmentTracker.getState(F)===M.FragmentState.NOT_LOADED&&this.loadFragment(F,c,x)}},f.loadFragment=function(L,E,m){this.fragCurrent=L,d.prototype.loadFragment.call(this,L,E,m)},w(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(y.default)},"./src/controller/subtitle-track-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/events.ts"),B=R("./src/utils/texttrack-utils.ts"),_=R("./src/controller/base-playlist-controller.ts"),G=R("./src/types/loader.ts");function j(D,w){for(var C=0;C<w.length;C++){var h=w[C];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function O(D,w,C){return w&&j(D.prototype,w),C&&j(D,C),D}function M(D,w){D.prototype=Object.create(w.prototype),D.prototype.constructor=D,y(D,w)}function y(D,w){return y=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},y(D,w)}var T=function(D){M(w,D);function w(h){var o;return o=D.call(this,h,"[subtitle-track-controller]")||this,o.media=null,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.selectDefaultTrack=!0,o.queuedDefaultTrack=-1,o.trackChangeListener=function(){return o.onTextTracksChanged()},o.asyncPollTrackChange=function(){return o.pollTrackChange(0)},o.useTextTrackPolling=!1,o.subtitlePollingInterval=-1,o.subtitleDisplay=!0,o.registerListeners(),o}var C=w.prototype;return C.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,D.prototype.destroy.call(this)},C.registerListeners=function(){var o=this.hls;o.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.on(Q.Events.ERROR,this.onError,this)},C.unregisterListeners=function(){var o=this.hls;o.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.off(Q.Events.ERROR,this.onError,this)},C.onMediaAttached=function(o,l){if(this.media=l.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)},C.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},C.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var o=k(this.media.textTracks);o.forEach(function(l){Object(B.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},C.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},C.onManifestParsed=function(o,l){this.tracks=l.subtitleTracks},C.onSubtitleTrackLoaded=function(o,l){var d=l.id,A=l.details,f=this.trackId,g=this.tracksInGroup[f];if(!g){this.warn("Invalid subtitle track id "+d);return}var L=g.details;g.details=l.details,this.log("subtitle track "+d+" loaded ["+A.startSN+"-"+A.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,l,L))},C.onLevelLoading=function(o,l){this.switchLevel(l.level)},C.onLevelSwitching=function(o,l){this.switchLevel(l.level)},C.switchLevel=function(o){var l=this.hls.levels[o];if(!(l!=null&&l.textGroupIds))return;var d=l.textGroupIds[l.urlId];if(this.groupId!==d){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,f=this.tracks.filter(function(E){return!d||E.groupId===d});this.tracksInGroup=f;var g=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=d;var L={subtitleTracks:f};this.log("Updating subtitle tracks, "+f.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(Q.Events.SUBTITLE_TRACKS_UPDATED,L),g!==-1&&this.setSubtitleTrack(g,A)}},C.findTrackId=function(o){for(var l=this.tracksInGroup,d=0;d<l.length;d++){var A=l[d];if((!this.selectDefaultTrack||A.default)&&(!o||o===A.name))return A.id}return-1},C.onError=function(o,l){if(D.prototype.onError.call(this,o,l),l.fatal||!l.context)return;l.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},C.loadPlaylist=function(o){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var d=l.id,A=l.groupId,f=l.url;if(o)try{f=o.addDirectives(f)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(Q.Events.SUBTITLE_TRACK_LOADING,{url:f,id:d,groupId:A,deliveryDirectives:o||null})}},C.toggleTrackModes=function(o){var l=this,d=this.media,A=this.subtitleDisplay,f=this.trackId;if(!d)return;var g=k(d.textTracks),L=g.filter(function(c){return c.groupId===l.groupId});if(o===-1)[].slice.call(g).forEach(function(c){c.mode="disabled"});else{var E=L[f];E&&(E.mode="disabled")}var m=L[o];m&&(m.mode=A?"showing":"hidden")},C.setSubtitleTrack=function(o,l){var d,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=o;return}if(this.trackId!==o&&this.toggleTrackModes(o),this.trackId===o&&(o===-1||(d=A[o])!==null&&d!==void 0&&d.details)||o<-1||o>=A.length)return;this.clearTimer();var f=A[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,f){var g=f.id,L=f.groupId,E=L===void 0?"":L,m=f.name,c=f.type,u=f.url;this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:g,groupId:E,name:m,type:c,url:u});var a=this.switchParams(f.url,l==null?void 0:l.details);this.loadPlaylist(a)}else this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:o})},C.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,l=k(this.media.textTracks),d=0;d<l.length;d++)if(l[d].mode==="hidden")o=d;else if(l[d].mode==="showing"){o=d;break}this.subtitleTrack!==o&&(this.subtitleTrack=o)},O(w,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1;var l=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,l)}}]),w}(_.default);function k(D){for(var w=[],C=0;C<D.length;C++){var h=D[C];h.kind==="subtitles"&&h.label&&w.push(D[C])}return w}X.default=T},"./src/controller/timeline-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"TimelineController",function(){return k});var Q=R("./src/polyfills/number.ts"),B=R("./src/events.ts"),_=R("./src/utils/cea-608-parser.ts"),G=R("./src/utils/output-filter.ts"),j=R("./src/utils/webvtt-parser.ts"),O=R("./src/utils/texttrack-utils.ts"),M=R("./src/utils/imsc1-ttml-parser.ts"),y=R("./src/types/loader.ts"),T=R("./src/utils/logger.ts"),k=function(){function h(l){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=C(),this.captionsProperties=void 0,this.hls=l,this.config=l.config,this.Cues=l.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 G.default(this,"textTrack1"),A=new G.default(this,"textTrack2"),f=new G.default(this,"textTrack3"),g=new G.default(this,"textTrack4");this.cea608Parser1=new _.default(1,d,A),this.cea608Parser2=new _.default(3,f,g)}l.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.on(B.Events.FRAG_LOADING,this.onFragLoading,this),l.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.on(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var o=h.prototype;return o.destroy=function(){var d=this.hls;d.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(B.Events.FRAG_LOADING,this.onFragLoading,this),d.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},o.addCues=function(d,A,f,g,L){for(var E=!1,m=L.length;m--;){var c=L[m],u=w(c[0],c[1],A,f);if(u>=0&&(c[0]=Math.min(c[0],A),c[1]=Math.max(c[1],f),E=!0,u/(f-A)>.5))return}if(E||L.push([A,f]),this.config.renderTextTracksNatively){var a=this.captionsTracks[d];this.Cues.newCue(a,A,f,g)}else{var b=this.Cues.newCue(null,A,f,g);this.hls.trigger(B.Events.CUES_PARSED,{type:"captions",cues:b,track:d})}},o.onInitPtsFound=function(d,A){var f=this,g=A.frag,L=A.id,E=A.initPTS,m=A.timescale,c=this.unparsedVttFrags;L==="main"&&(this.initPTS[g.cc]=E,this.timescale[g.cc]=m),c.length&&(this.unparsedVttFrags=[],c.forEach(function(u){f.onFragLoaded(B.Events.FRAG_LOADED,u)}))},o.getExistingTrack=function(d){var A=this.media;if(A)for(var f=0;f<A.textTracks.length;f++){var g=A.textTracks[f];if(g[d])return g}return null},o.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},o.createNativeTrack=function(d){if(this.captionsTracks[d])return;var A=this.captionsProperties,f=this.captionsTracks,g=this.media,L=A[d],E=L.label,m=L.languageCode,c=this.getExistingTrack(d);if(c)f[d]=c,Object(O.clearCurrentCues)(f[d]),Object(O.sendAddTrackEvent)(f[d],g);else{var u=this.createTextTrack("captions",E,m);u&&(u[d]=!0,f[d]=u)}},o.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var A=this.captionsProperties[d];if(!A)return;var f=A.label,g={_id:d,label:f,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[d]=g,this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[g]})},o.createTextTrack=function(d,A,f){var g=this.media;return g?g.addTextTrack(d,A,f):void 0},o.onMediaAttaching=function(d,A){this.media=A.media,this._cleanTracks()},o.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(A){Object(O.clearCurrentCues)(d[A]),delete d[A]}),this.nonNativeCaptionsTracks={}},o.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=C(),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())},o._cleanTracks=function(){var d=this.media;if(!d)return;var A=d.textTracks;if(A)for(var f=0;f<A.length;f++)Object(O.clearCurrentCues)(A[f])},o.onSubtitleTracksUpdated=function(d,A){var f=this;this.textTracks=[];var g=A.subtitleTracks||[],L=g.some(function(u){return u.textCodec===M.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var E=this.tracks&&g&&this.tracks.length===g.length;if(this.tracks=g||[],this.config.renderTextTracksNatively){var m=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,a){var b;if(a<m.length){for(var v=null,x=0;x<m.length;x++)if(D(m[x],u)){v=m[x];break}v&&(b=v)}b?Object(O.clearCurrentCues)(b):(b=f.createTextTrack("subtitles",u.name,u.lang),b&&(b.mode="disabled")),b&&(b.groupId=u.groupId,f.textTracks.push(b))})}else if(!E&&this.tracks&&this.tracks.length){var c=this.tracks.map(function(u){return{label:u.name,kind:u.type.toLowerCase(),default:u.default,subtitleTrack:u}});this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},o.onManifestLoaded=function(d,A){var f=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(g){var L=/(?:CC|SERVICE)([1-4])/.exec(g.instreamId);if(!L)return;var E="textTrack"+L[1],m=f.captionsProperties[E];if(!m)return;m.label=g.name,g.lang&&(m.languageCode=g.lang),m.media=g})},o.onFragLoading=function(d,A){var f=this.cea608Parser1,g=this.cea608Parser2,L=this.lastSn,E=this.lastPartIndex;if(!this.enabled||!(f&&g))return;if(A.frag.type===y.PlaylistLevelType.MAIN){var m,c,u=A.frag.sn,a=(m=A==null||((c=A.part)===null||c===void 0)?void 0:c.index)!=null?m:-1;u===L+1||u===L&&a===E+1||(f.reset(),g.reset()),this.lastSn=u,this.lastPartIndex=a}},o.onFragLoaded=function(d,A){var f=A.frag,g=A.payload,L=this.initPTS,E=this.unparsedVttFrags;if(f.type===y.PlaylistLevelType.SUBTITLE)if(g.byteLength){if(!Object(Q.isFiniteNumber)(L[f.cc])){E.push(A),L.length&&this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Missing initial subtitle PTS")});return}var m=f.decryptdata;if(m==null||m.key==null||m.method!=="AES-128"){var c=this.tracks[f.level],u=this.vttCCs;u[f.cc]||(u[f.cc]={start:f.start,prevCC:this.prevCC,new:!0},this.prevCC=f.cc),c&&c.textCodec===M.IMSC1_CODEC?this._parseIMSC1(f,g):this._parseVTTs(f,g,u)}}else this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(d,A){var f=this,g=this.hls;Object(M.parseIMSC1)(A,this.initPTS[d.cc],this.timescale[d.cc],function(L){f._appendCues(L,d.level),g.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(L){T.logger.log("Failed to parse IMSC1: "+L),g.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:L})})},o._parseVTTs=function(d,A,f){var g=this,L=this.hls;Object(j.parseWebVTT)(A,this.initPTS[d.cc],this.timescale[d.cc],f,d.cc,d.start,function(E){g._appendCues(E,d.level),L.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(E){g._fallbackToIMSC1(d,A),T.logger.log("Failed to parse VTT cue: "+E),L.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:E})})},o._fallbackToIMSC1=function(d,A){var f=this,g=this.tracks[d.level];g.textCodec||Object(M.parseIMSC1)(A,this.initPTS[d.cc],this.timescale[d.cc],function(){g.textCodec=M.IMSC1_CODEC,f._parseIMSC1(d,A)},function(){g.textCodec="wvtt"})},o._appendCues=function(d,A){var f=this.hls;if(this.config.renderTextTracksNatively){var g=this.textTracks[A];if(g.mode==="disabled")return;d.forEach(function(m){return Object(O.addCueToTrack)(g,m)})}else{var L=this.tracks[A],E=L.default?"default":"subtitles"+A;f.trigger(B.Events.CUES_PARSED,{type:"subtitles",cues:d,track:E})}},o.onFragDecrypted=function(d,A){var f=A.frag;if(f.type===y.PlaylistLevelType.SUBTITLE){if(!Object(Q.isFiniteNumber)(this.initPTS[f.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(B.Events.FRAG_LOADED,A)}},o.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},o.onFragParsingUserdata=function(d,A){var f=this.cea608Parser1,g=this.cea608Parser2;if(!this.enabled||!(f&&g))return;for(var L=0;L<A.samples.length;L++){var E=A.samples[L].bytes;if(E){var m=this.extractCea608Data(E);f.addData(A.samples[L].pts,m[0]),g.addData(A.samples[L].pts,m[1])}}},o.onBufferFlushing=function(d,A){var f=A.startOffset,g=A.endOffset,L=A.endOffsetSubtitles,E=A.type,m=this.media;if(!m||m.currentTime<g)return;if(!E||E==="video"){var c=this.captionsTracks;Object.keys(c).forEach(function(a){return Object(O.removeCuesInRange)(c[a],f,g)})}if(this.config.renderTextTracksNatively&&(f===0&&L!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(a){return Object(O.removeCuesInRange)(u[a],f,L)})}},o.extractCea608Data=function(d){for(var A=d[0]&31,f=2,g=[[],[]],L=0;L<A;L++){var E=d[f++],m=127&d[f++],c=127&d[f++],u=(4&E)!==0,a=3&E;if(m===0&&c===0)continue;u&&((a===0||a===1)&&(g[a].push(m),g[a].push(c)))}return g},h}();function D(h,o){return h&&h.label===o.name&&!(h.textTrack1||h.textTrack2)}function w(h,o,l,d){return Math.min(o,d)-Math.max(h,l)}function C(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return Q});var Q=function(){function B(G,j){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=j}var _=B.prototype;return _.decrypt=function(j,O){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},O,j)},B}()},"./src/crypt/aes-decryptor.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"removePadding",function(){return B}),R.d(X,"default",function(){return _});var Q=R("./src/utils/typed-array.ts");function B(G){var j=G.byteLength,O=j&&new DataView(G.buffer).getUint8(j-1);return O?Object(Q.sliceUint8)(G,0,j-O):G}var _=function(){function G(){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 j=G.prototype;return j.uint8ArrayToUint32Array_=function(M){for(var y=new DataView(M),T=new Uint32Array(4),k=0;k<4;k++)T[k]=y.getUint32(k*4);return T},j.initTable=function(){var M=this.sBox,y=this.invSBox,T=this.subMix,k=T[0],D=T[1],w=T[2],C=T[3],h=this.invSubMix,o=h[0],l=h[1],d=h[2],A=h[3],f=new Uint32Array(256),g=0,L=0,E=0;for(E=0;E<256;E++)E<128?f[E]=E<<1:f[E]=E<<1^283;for(E=0;E<256;E++){var m=L^L<<1^L<<2^L<<3^L<<4;m=m>>>8^m&255^99,M[g]=m,y[m]=g;var c=f[g],u=f[c],a=f[u],b=f[m]*257^m*16843008;k[g]=b<<24|b>>>8,D[g]=b<<16|b>>>16,w[g]=b<<8|b>>>24,C[g]=b,b=a*16843009^u*65537^c*257^g*16843008,o[m]=b<<24|b>>>8,l[m]=b<<16|b>>>16,d[m]=b<<8|b>>>24,A[m]=b,g?(g=c^f[f[f[a^c]]],L^=f[f[L]]):g=L=1}},j.expandKey=function(M){for(var y=this.uint8ArrayToUint32Array_(M),T=!0,k=0;k<y.length&&T;)T=y[k]===this.key[k],k++;if(T)return;this.key=y;var D=this.keySize=y.length;if(D!==4&&D!==6&&D!==8)throw new Error("Invalid aes key size="+D);var w=this.ksRows=(D+6+1)*4,C,h,o=this.keySchedule=new Uint32Array(w),l=this.invKeySchedule=new Uint32Array(w),d=this.sBox,A=this.rcon,f=this.invSubMix,g=f[0],L=f[1],E=f[2],m=f[3],c,u;for(C=0;C<w;C++){if(C<D){c=o[C]=y[C];continue}u=c,C%D===0?(u=u<<8|u>>>24,u=d[u>>>24]<<24|d[u>>>16&255]<<16|d[u>>>8&255]<<8|d[u&255],u^=A[C/D|0]<<24):D>6&&C%D===4&&(u=d[u>>>24]<<24|d[u>>>16&255]<<16|d[u>>>8&255]<<8|d[u&255]),o[C]=c=(o[C-D]^u)>>>0}for(h=0;h<w;h++)C=w-h,h&3?u=o[C]:u=o[C-4],h<4||C<=4?l[h]=u:l[h]=g[d[u>>>24]]^L[d[u>>>16&255]]^E[d[u>>>8&255]]^m[d[u&255]],l[h]=l[h]>>>0},j.networkToHostOrderSwap=function(M){return M<<24|(M&65280)<<8|(M&16711680)>>8|M>>>24},j.decrypt=function(M,y,T){for(var k=this.keySize+6,D=this.invKeySchedule,w=this.invSBox,C=this.invSubMix,h=C[0],o=C[1],l=C[2],d=C[3],A=this.uint8ArrayToUint32Array_(T),f=A[0],g=A[1],L=A[2],E=A[3],m=new Int32Array(M),c=new Int32Array(m.length),u,a,b,v,x,P,H,V,$,z,F,ee,oe,le,ve=this.networkToHostOrderSwap;y<m.length;){for($=ve(m[y]),z=ve(m[y+1]),F=ve(m[y+2]),ee=ve(m[y+3]),x=$^D[0],P=ee^D[1],H=F^D[2],V=z^D[3],oe=4,le=1;le<k;le++)u=h[x>>>24]^o[P>>16&255]^l[H>>8&255]^d[V&255]^D[oe],a=h[P>>>24]^o[H>>16&255]^l[V>>8&255]^d[x&255]^D[oe+1],b=h[H>>>24]^o[V>>16&255]^l[x>>8&255]^d[P&255]^D[oe+2],v=h[V>>>24]^o[x>>16&255]^l[P>>8&255]^d[H&255]^D[oe+3],x=u,P=a,H=b,V=v,oe=oe+4;u=w[x>>>24]<<24^w[P>>16&255]<<16^w[H>>8&255]<<8^w[V&255]^D[oe],a=w[P>>>24]<<24^w[H>>16&255]<<16^w[V>>8&255]<<8^w[x&255]^D[oe+1],b=w[H>>>24]<<24^w[V>>16&255]<<16^w[x>>8&255]<<8^w[P&255]^D[oe+2],v=w[V>>>24]<<24^w[x>>16&255]<<16^w[P>>8&255]<<8^w[H&255]^D[oe+3],c[y]=ve(u^f),c[y+1]=ve(v^g),c[y+2]=ve(b^L),c[y+3]=ve(a^E),f=$,g=z,L=F,E=ee,y=y+4}return c.buffer},G}()},"./src/crypt/decrypter.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return y});var Q=R("./src/crypt/aes-crypto.ts"),B=R("./src/crypt/fast-aes-key.ts"),_=R("./src/crypt/aes-decryptor.ts"),G=R("./src/utils/logger.ts"),j=R("./src/utils/mp4-tools.ts"),O=R("./src/utils/typed-array.ts"),M=16,y=function(){function T(D,w,C){var h=C===void 0?{}:C,o=h.removePKCS7Padding,l=o===void 0?!0:o;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=D,this.config=w,this.removePKCS7Padding=l,l)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var k=T.prototype;return k.destroy=function(){this.observer=null},k.isSync=function(){return this.config.enableSoftwareAES},k.flush=function(){var w=this.currentResult;if(!w){this.reset();return}var C=new Uint8Array(w);return this.reset(),this.removePKCS7Padding?Object(_.removePadding)(C):C},k.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},k.decrypt=function(w,C,h,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(w),C,h);var l=this.flush();l&&o(l.buffer)}else this.webCryptoDecrypt(new Uint8Array(w),C,h).then(o)},k.softwareDecrypt=function(w,C,h){var o=this.currentIV,l=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(w=Object(j.appendUint8Array)(d,w),this.remainderData=null);var A=this.getValidChunk(w);if(!A.length)return null;o&&(h=o);var f=this.softwareDecrypter;f||(f=this.softwareDecrypter=new _.default),f.expandKey(C);var g=l;return this.currentResult=f.decrypt(A.buffer,0,h),this.currentIV=Object(O.sliceUint8)(A,-16).buffer,g||null},k.webCryptoDecrypt=function(w,C,h){var o=this,l=this.subtle;return(this.key!==C||!this.fastAesKey)&&(this.key=C,this.fastAesKey=new B.default(l,C)),this.fastAesKey.expandKey().then(function(d){if(!l)return Promise.reject(new Error("web crypto not initialized"));var A=new Q.default(l,h);return A.decrypt(w.buffer,d)}).catch(function(d){return o.onWebCryptoError(d,w,C,h)})},k.onWebCryptoError=function(w,C,h,o){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",w),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(C,h,o)},k.getValidChunk=function(w){var C=w,h=w.length-w.length%M;return h!==w.length&&(C=Object(O.sliceUint8)(w,0,h),this.remainderData=Object(O.sliceUint8)(w,h)),C},k.logOnce=function(w){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+w),this.logEnabled=!1},T}()},"./src/crypt/fast-aes-key.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return Q});var Q=function(){function B(G,j){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=j}var _=B.prototype;return _.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},B}()},"./src/demux/aacdemuxer.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/demux/base-audio-demuxer.ts"),B=R("./src/demux/adts.ts"),_=R("./src/utils/logger.ts"),G=R("./src/demux/id3.ts");function j(y,T){y.prototype=Object.create(T.prototype),y.prototype.constructor=y,O(y,T)}function O(y,T){return O=Object.setPrototypeOf||function(D,w){return D.__proto__=w,D},O(y,T)}var M=function(y){j(T,y);function T(D,w){var C;return C=y.call(this)||this,C.observer=void 0,C.config=void 0,C.observer=D,C.config=w,C}var k=T.prototype;return k.resetInitSegment=function(w,C,h){y.prototype.resetInitSegment.call(this,w,C,h),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:w,duration:h,inputTimeScale:9e4,dropped:0}},T.probe=function(w){if(!w)return!1;for(var C=G.getID3Data(w,0)||[],h=C.length,o=w.length;h<o;h++)if(B.probe(w,h))return _.logger.log("ADTS sync word found !"),!0;return!1},k.canParse=function(w,C){return B.canParse(w,C)},k.appendFrame=function(w,C,h){B.initTrackConfig(w,this.observer,C,h,w.manifestCodec);var o=B.appendFrame(w,C,h,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},T}(Q.default);M.minProbeByteLength=9,X.default=M},"./src/demux/adts.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"getAudioConfig",function(){return G}),R.d(X,"isHeaderPattern",function(){return j}),R.d(X,"getHeaderLength",function(){return O}),R.d(X,"getFullFrameLength",function(){return M}),R.d(X,"canGetFrameLength",function(){return y}),R.d(X,"isHeader",function(){return T}),R.d(X,"canParse",function(){return k}),R.d(X,"probe",function(){return D}),R.d(X,"initTrackConfig",function(){return w}),R.d(X,"getFrameDuration",function(){return C}),R.d(X,"parseFrameHeader",function(){return h}),R.d(X,"appendFrame",function(){return o});var Q=R("./src/utils/logger.ts"),B=R("./src/errors.ts"),_=R("./src/events.ts");function G(l,d,A,f){var g,L,E,m,c=navigator.userAgent.toLowerCase(),u=f,a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];g=((d[A+2]&192)>>>6)+1;var b=(d[A+2]&60)>>>2;if(b>a.length-1){l.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+b});return}return E=(d[A+2]&1)<<2,E|=(d[A+3]&192)>>>6,Q.logger.log("manifest codec:"+f+", ADTS type:"+g+", samplingIndex:"+b),/firefox/i.test(c)?b>=6?(g=5,m=new Array(4),L=b-3):(g=2,m=new Array(2),L=b):c.indexOf("android")!==-1?(g=2,m=new Array(2),L=b):(g=5,m=new Array(4),f&&(f.indexOf("mp4a.40.29")!==-1||f.indexOf("mp4a.40.5")!==-1)||!f&&b>=6?L=b-3:((f&&f.indexOf("mp4a.40.2")!==-1&&(b>=6&&E===1||/vivaldi/i.test(c))||!f&&E===1)&&(g=2,m=new Array(2)),L=b)),m[0]=g<<3,m[0]|=(b&14)>>1,m[1]|=(b&1)<<7,m[1]|=E<<3,g===5&&(m[1]|=(L&14)>>1,m[2]=(L&1)<<7,m[2]|=2<<2,m[3]=0),{config:m,samplerate:a[b],channelCount:E,codec:"mp4a.40."+g,manifestCodec:u}}function j(l,d){return l[d]===255&&(l[d+1]&246)===240}function O(l,d){return l[d+1]&1?7:9}function M(l,d){return(l[d+3]&3)<<11|l[d+4]<<3|(l[d+5]&224)>>>5}function y(l,d){return d+5<l.length}function T(l,d){return d+1<l.length&&j(l,d)}function k(l,d){return y(l,d)&&j(l,d)&&M(l,d)<=l.length-d}function D(l,d){if(T(l,d)){var A=O(l,d);if(d+A>=l.length)return!1;var f=M(l,d);if(f<=A)return!1;var g=d+f;return g===l.length||T(l,g)}return!1}function w(l,d,A,f,g){if(!l.samplerate){var L=G(d,A,f,g);if(!L)return;l.config=L.config,l.samplerate=L.samplerate,l.channelCount=L.channelCount,l.codec=L.codec,l.manifestCodec=L.manifestCodec,Q.logger.log("parsed codec:"+l.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function C(l){return 1024*9e4/l}function h(l,d,A,f,g){var L=O(l,d),E=M(l,d);if(E-=L,E>0){var m=A+f*g;return{headerLength:L,frameLength:E,stamp:m}}}function o(l,d,A,f,g){var L=C(l.samplerate),E=h(d,A,f,g,L);if(E){var m=E.frameLength,c=E.headerLength,u=E.stamp,a=c+m,b=Math.max(0,A+a-d.length),v;b?(v=new Uint8Array(a-c),v.set(d.subarray(A+c,d.length),0)):v=d.subarray(A+c,A+a);var x={unit:v,pts:u};return b||l.samples.push(x),{sample:x,length:a,missing:b}}}},"./src/demux/base-audio-demuxer.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"initPTSFn",function(){return M});var Q=R("./src/polyfills/number.ts"),B=R("./src/demux/id3.ts"),_=R("./src/demux/dummy-demuxed-track.ts"),G=R("./src/utils/mp4-tools.ts"),j=R("./src/utils/typed-array.ts"),O=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var T=y.prototype;return T.resetInitSegment=function(D,w,C){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},T.resetTimeStamp=function(){},T.resetContiguity=function(){},T.canParse=function(D,w){return!1},T.appendFrame=function(D,w,C){},T.demux=function(D,w){this.cachedData&&(D=Object(G.appendUint8Array)(this.cachedData,D),this.cachedData=null);var C=B.getID3Data(D,0),h=C?C.length:0,o,l,d=this._audioTrack,A=this._id3Track,f=C?B.getTimeStamp(C):void 0,g=D.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=M(f,w)),C&&C.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:C}),l=this.initPTS;h<g;){if(this.canParse(D,h)){var L=this.appendFrame(d,D,h);L?(this.frameIndex++,l=L.sample.pts,h+=L.length,o=h):h=g}else B.canParse(D,h)?(C=B.getID3Data(D,h),A.samples.push({pts:l,dts:l,data:C}),h+=C.length,o=h):h++;if(h===g&&o!==g){var E=Object(j.sliceUint8)(D,o);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,E):this.cachedData=E}}return{audioTrack:d,avcTrack:Object(_.dummyTrack)(),id3Track:A,textTrack:Object(_.dummyTrack)()}},T.demuxSampleAes=function(D,w,C){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},T.flush=function(D){var w=this.cachedData;return w&&(this.cachedData=null,this.demux(w,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(_.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(_.dummyTrack)()}},T.destroy=function(){},y}(),M=function(T,k){return Object(Q.isFiniteNumber)(T)?T*90:k*9e4};X.default=O},"./src/demux/chunk-cache.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return Q});var Q=function(){function _(){this.chunks=[],this.dataLength=0}var G=_.prototype;return G.push=function(O){this.chunks.push(O),this.dataLength+=O.length},G.flush=function(){var O=this.chunks,M=this.dataLength,y;if(O.length)O.length===1?y=O[0]:y=B(O,M);else return new Uint8Array(0);return this.reset(),y},G.reset=function(){this.chunks.length=0,this.dataLength=0},_}();function B(_,G){for(var j=new Uint8Array(G),O=0,M=0;M<_.length;M++){var y=_[M];j.set(y,O),O+=y.length}return j}},"./src/demux/dummy-demuxed-track.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"dummyTrack",function(){return Q});function Q(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/utils/logger.ts"),B=function(){function _(j){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=j,this.bytesAvailable=j.byteLength,this.word=0,this.bitsAvailable=0}var G=_.prototype;return G.loadWord=function(){var O=this.data,M=this.bytesAvailable,y=O.byteLength-M,T=new Uint8Array(4),k=Math.min(4,M);if(k===0)throw new Error("no bytes available");T.set(O.subarray(y,y+k)),this.word=new DataView(T.buffer).getUint32(0),this.bitsAvailable=k*8,this.bytesAvailable-=k},G.skipBits=function(O){var M;this.bitsAvailable>O?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,M=O>>3,O-=M>>3,this.bytesAvailable-=M,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},G.readBits=function(O){var M=Math.min(this.bitsAvailable,O),y=this.word>>>32-M;return O>32&&Q.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=M,this.bitsAvailable>0?this.word<<=M:this.bytesAvailable>0&&this.loadWord(),M=O-M,M>0&&this.bitsAvailable?y<<M|this.readBits(M):y},G.skipLZ=function(){var O;for(O=0;O<this.bitsAvailable;++O)if((this.word&2147483648>>>O)!==0)return this.word<<=O,this.bitsAvailable-=O,O;return this.loadWord(),O+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},G.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(O){for(var M=8,y=8,T,k=0;k<O;k++)y!==0&&(T=this.readEG(),y=(M+T+256)%256),M=y===0?M:y},G.readSPS=function(){var O=0,M=0,y=0,T=0,k,D,w,C=this.readUByte.bind(this),h=this.readBits.bind(this),o=this.readUEG.bind(this),l=this.readBoolean.bind(this),d=this.skipBits.bind(this),A=this.skipEG.bind(this),f=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);C();var L=C();if(h(5),d(3),C(),f(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var E=o();if(E===3&&d(1),f(),f(),d(1),l())for(D=E!==3?8:12,w=0;w<D;w++)l()&&(w<6?g(16):g(64))}f();var m=o();if(m===0)o();else if(m===1)for(d(1),A(),A(),k=o(),w=0;w<k;w++)A();f(),d(1);var c=o(),u=o(),a=h(1);a===0&&d(1),d(1),l()&&(O=o(),M=o(),y=o(),T=o());var b=[1,1];if(l()&&l()){var v=C();switch(v){case 1:b=[1,1];break;case 2:b=[12,11];break;case 3:b=[10,11];break;case 4:b=[16,11];break;case 5:b=[40,33];break;case 6:b=[24,11];break;case 7:b=[20,11];break;case 8:b=[32,11];break;case 9:b=[80,33];break;case 10:b=[18,11];break;case 11:b=[15,11];break;case 12:b=[64,33];break;case 13:b=[160,99];break;case 14:b=[4,3];break;case 15:b=[3,2];break;case 16:b=[2,1];break;case 255:{b=[C()<<8|C(),C()<<8|C()];break}}}return{width:Math.ceil((c+1)*16-O*2-M*2),height:(2-a)*(u+1)*16-(a?2:4)*(y+T),pixelRatio:b}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},_}();X.default=B},"./src/demux/id3.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"isHeader",function(){return Q}),R.d(X,"isFooter",function(){return B}),R.d(X,"getID3Data",function(){return _}),R.d(X,"canParse",function(){return j}),R.d(X,"getTimeStamp",function(){return O}),R.d(X,"isTimeStampFrame",function(){return M}),R.d(X,"getID3Frames",function(){return T}),R.d(X,"decodeFrame",function(){return k}),R.d(X,"utf8ArrayToStr",function(){return o}),R.d(X,"testables",function(){return l});var Q=function(g,L){return L+10<=g.length&&(g[L]===73&&g[L+1]===68&&g[L+2]===51&&(g[L+3]<255&&g[L+4]<255&&(g[L+6]<128&&g[L+7]<128&&g[L+8]<128&&g[L+9]<128)))},B=function(g,L){return L+10<=g.length&&(g[L]===51&&g[L+1]===68&&g[L+2]===73&&(g[L+3]<255&&g[L+4]<255&&(g[L+6]<128&&g[L+7]<128&&g[L+8]<128&&g[L+9]<128)))},_=function(g,L){for(var E=L,m=0;Q(g,L);){m+=10;var c=G(g,L+6);m+=c,B(g,L+10)&&(m+=10),L+=m}return m>0?g.subarray(E,E+m):void 0},G=function(g,L){var E=0;return E=(g[L]&127)<<21,E|=(g[L+1]&127)<<14,E|=(g[L+2]&127)<<7,E|=g[L+3]&127,E},j=function(g,L){return Q(g,L)&&G(g,L+6)+10<=g.length-L},O=function(g){for(var L=T(g),E=0;E<L.length;E++){var m=L[E];if(M(m))return h(m)}return},M=function(g){return g&&g.key==="PRIV"&&g.info==="com.apple.streaming.transportStreamTimestamp"},y=function(g){var L=String.fromCharCode(g[0],g[1],g[2],g[3]),E=G(g,4),m=10;return{type:L,size:E,data:g.subarray(m,m+E)}},T=function(g){for(var L=0,E=[];Q(g,L);){var m=G(g,L+6);L+=10;for(var c=L+m;L+8<c;){var u=y(g.subarray(L)),a=k(u);a&&E.push(a),L+=u.size+10}B(g,L)&&(L+=10)}return E},k=function(g){return g.type==="PRIV"?D(g):g.type[0]==="W"?C(g):w(g)},D=function(g){if(g.size<2)return;var L=o(g.data,!0),E=new Uint8Array(g.data.subarray(L.length+1));return{key:g.type,info:L,data:E.buffer}},w=function(g){if(g.size<2)return;if(g.type==="TXXX"){var L=1,E=o(g.data.subarray(L),!0);L+=E.length+1;var m=o(g.data.subarray(L));return{key:g.type,info:E,data:m}}var c=o(g.data.subarray(1));return{key:g.type,data:c}},C=function(g){if(g.type==="WXXX"){if(g.size<2)return;var L=1,E=o(g.data.subarray(L),!0);L+=E.length+1;var m=o(g.data.subarray(L));return{key:g.type,info:E,data:m}}var c=o(g.data);return{key:g.type,data:c}},h=function(g){if(g.data.byteLength===8){var L=new Uint8Array(g.data),E=L[3]&1,m=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return m/=45,E&&(m+=4772185884e-2),Math.round(m)}return},o=function(g,L){L===void 0&&(L=!1);var E=A();if(E){var m=E.decode(g);if(L){var c=m.indexOf("\0");return c!==-1?m.substring(0,c):m}return m.replace(/\0/g,"")}for(var u=g.length,a,b,v,x="",P=0;P<u;){if(a=g[P++],a===0&&L)return x;if(a===0||a===3)continue;switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:x+=String.fromCharCode(a);break;case 12:case 13:b=g[P++],x+=String.fromCharCode((a&31)<<6|b&63);break;case 14:b=g[P++],v=g[P++],x+=String.fromCharCode((a&15)<<12|(b&63)<<6|(v&63)<<0);break;default:}}return x},l={decodeTextFrame:w},d;function A(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/demux/base-audio-demuxer.ts"),B=R("./src/demux/id3.ts"),_=R("./src/utils/logger.ts"),G=R("./src/demux/mpegaudio.ts");function j(y,T){y.prototype=Object.create(T.prototype),y.prototype.constructor=y,O(y,T)}function O(y,T){return O=Object.setPrototypeOf||function(D,w){return D.__proto__=w,D},O(y,T)}var M=function(y){j(T,y);function T(){return y.apply(this,arguments)||this}var k=T.prototype;return k.resetInitSegment=function(w,C,h){y.prototype.resetInitSegment.call(this,w,C,h),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:w,duration:h,inputTimeScale:9e4,dropped:0}},T.probe=function(w){if(!w)return!1;for(var C=B.getID3Data(w,0)||[],h=C.length,o=w.length;h<o;h++)if(G.probe(w,h))return _.logger.log("MPEG Audio sync word found !"),!0;return!1},k.canParse=function(w,C){return G.canParse(w,C)},k.appendFrame=function(w,C,h){return this.initPTS===null?void 0:G.appendFrame(w,C,h,this.initPTS,this.frameIndex)},T}(Q.default);M.minProbeByteLength=4,X.default=M},"./src/demux/mp4demuxer.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/utils/mp4-tools.ts"),B=R("./src/demux/dummy-demuxed-track.ts"),_=function(){function G(O,M){this.remainderData=null,this.config=void 0,this.config=M}var j=G.prototype;return j.resetTimeStamp=function(){},j.resetInitSegment=function(){},j.resetContiguity=function(){},G.probe=function(M){return Object(Q.findBox)({data:M,start:0,end:Math.min(M.length,16384)},["moof"]).length>0},j.demux=function(M){var y=M,T=Object(B.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(Q.appendUint8Array)(this.remainderData,M));var k=Object(Q.segmentValidRange)(y);this.remainderData=k.remainder,T.samples=k.valid||new Uint8Array}else T.samples=y;return{audioTrack:Object(B.dummyTrack)(),avcTrack:T,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},j.flush=function(){var M=Object(B.dummyTrack)();return M.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(B.dummyTrack)(),avcTrack:M,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},j.demuxSampleAes=function(M,y,T){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},j.destroy=function(){},G}();_.minProbeByteLength=1024,X.default=_},"./src/demux/mpegaudio.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"appendFrame",function(){return O}),R.d(X,"parseHeader",function(){return M}),R.d(X,"isHeaderPattern",function(){return y}),R.d(X,"isHeader",function(){return T}),R.d(X,"canParse",function(){return k}),R.d(X,"probe",function(){return D});var Q=null,B=[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],_=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],j=[0,1,1,4];function O(w,C,h,o,l){if(h+24>C.length)return;var d=M(C,h);if(d&&h+d.frameLength<=C.length){var A=d.samplesPerFrame*9e4/d.sampleRate,f=o+l*A,g={unit:C.subarray(h,h+d.frameLength),pts:f,dts:f};return w.config=[],w.channelCount=d.channelCount,w.samplerate=d.sampleRate,w.samples.push(g),{sample:g,length:d.frameLength,missing:0}}}function M(w,C){var h=w[C+1]>>3&3,o=w[C+1]>>1&3,l=w[C+2]>>4&15,d=w[C+2]>>2&3;if(h!==1&&l!==0&&l!==15&&d!==3){var A=w[C+2]>>1&1,f=w[C+3]>>6,g=h===3?3-o:o===3?3:4,L=B[g*14+l-1]*1e3,E=h===3?0:h===2?1:2,m=_[E*3+d],c=f===3?1:2,u=G[h][o],a=j[o],b=u*8*a,v=Math.floor(u*L/m+A)*a;if(Q===null){var x=navigator.userAgent||"",P=x.match(/Chrome\/(\d+)/i);Q=P?parseInt(P[1]):0}var H=!!Q&&Q<=87;return H&&o===2&&L>=224e3&&f===0&&(w[C+3]=w[C+3]|128),{sampleRate:m,channelCount:c,frameLength:v,samplesPerFrame:b}}}function y(w,C){return w[C]===255&&(w[C+1]&224)===224&&(w[C+1]&6)!==0}function T(w,C){return C+1<w.length&&y(w,C)}function k(w,C){var h=4;return y(w,C)&&h<=w.length-C}function D(w,C){if(C+1<w.length&&y(w,C)){var h=4,o=M(w,C),l=h;o!=null&&o.frameLength&&(l=o.frameLength);var d=C+l;return d===w.length||T(w,d)}return!1}},"./src/demux/sample-aes.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/crypt/decrypter.ts"),B=R("./src/demux/tsdemuxer.ts"),_=function(){function G(O,M,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new Q.default(O,M,{removePKCS7Padding:!1})}var j=G.prototype;return j.decryptBuffer=function(M,y){this.decrypter.decrypt(M,this.keyData.key.buffer,this.keyData.iv.buffer,y)},j.decryptAacSample=function(M,y,T,k){var D=M[y].unit,w=D.subarray(16,D.length-D.length%16),C=w.buffer.slice(w.byteOffset,w.byteOffset+w.length),h=this;this.decryptBuffer(C,function(o){var l=new Uint8Array(o);D.set(l,16),k||h.decryptAacSamples(M,y+1,T)})},j.decryptAacSamples=function(M,y,T){for(;;y++){if(y>=M.length){T();return}if(M[y].unit.length<32)continue;var k=this.decrypter.isSync();if(this.decryptAacSample(M,y,T,k),!k)return}},j.getAvcEncryptedData=function(M){for(var y=Math.floor((M.length-48)/160)*16+16,T=new Int8Array(y),k=0,D=32;D<=M.length-16;D+=160,k+=16)T.set(M.subarray(D,D+16),k);return T},j.getAvcDecryptedUnit=function(M,y){for(var T=new Uint8Array(y),k=0,D=32;D<=M.length-16;D+=160,k+=16)M.set(T.subarray(k,k+16),D);return M},j.decryptAvcSample=function(M,y,T,k,D,w){var C=Object(B.discardEPB)(D.data),h=this.getAvcEncryptedData(C),o=this;this.decryptBuffer(h.buffer,function(l){D.data=o.getAvcDecryptedUnit(C,l),w||o.decryptAvcSamples(M,y,T+1,k)})},j.decryptAvcSamples=function(M,y,T,k){if(M instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,T=0){if(y>=M.length){k();return}for(var D=M[y].units;!(T>=D.length);T++){var w=D[T];if(w.data.length<=48||w.type!==1&&w.type!==5)continue;var C=this.decrypter.isSync();if(this.decryptAvcSample(M,y,T,k,w,C),!C)return}}},G}();X.default=_},"./src/demux/transmuxer-interface.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return D});var Q=R("./node_modules/webworkify-webpack/index.js"),B=R.n(Q),_=R("./src/events.ts"),G=R("./src/demux/transmuxer.ts"),j=R("./src/utils/logger.ts"),O=R("./src/errors.ts"),M=R("./src/utils/mediasource-helper.ts"),y=R("./node_modules/eventemitter3/index.js"),T=R.n(y),k=Object(M.getMediaSource)()||{isTypeSupported:function(){return!1}},D=function(){function w(h,o,l,d){var A=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=h,this.id=o,this.onTransmuxComplete=l,this.onFlush=d;var f=h.config,g=function(u,a){a=a||{},a.frag=A.frag,a.id=A.id,h.trigger(u,a)};this.observer=new y.EventEmitter,this.observer.on(_.Events.FRAG_DECRYPTED,g),this.observer.on(_.Events.ERROR,g);var L={mp4:k.isTypeSupported("video/mp4"),mpeg:k.isTypeSupported("audio/mpeg"),mp3:k.isTypeSupported('audio/mp4; codecs="mp3"')},E=navigator.vendor;if(f.enableWorker&&typeof Worker!="undefined"){j.logger.log("demuxing in webworker");var m;try{m=this.worker=Q("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(c){h.trigger(_.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(c.message+" ("+c.filename+":"+c.lineno+")")})},m.postMessage({cmd:"init",typeSupported:L,vendor:E,id:o,config:JSON.stringify(f)})}catch(c){j.logger.warn("Error in worker:",c),j.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new G.default(this.observer,L,f,E,o),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,f,E,o)}var C=w.prototype;return C.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},C.push=function(o,l,d,A,f,g,L,E,m,c){var u=this;m.transmuxing.start=self.performance.now();var a=this.transmuxer,b=this.worker,v=g?g.start:f.start,x=f.decryptdata,P=this.frag,H=!(P&&f.cc===P.cc),V=!(P&&m.level===P.level),$=P?m.sn-P.sn:-1,z=this.part?m.part-this.part.index:1,F=!V&&($===1||$===0&&z===1),ee=self.performance.now();(V||$||f.stats.parsing.start===0)&&(f.stats.parsing.start=ee),g&&(z||!F)&&(g.stats.parsing.start=ee);var oe=new G.TransmuxState(H,F,E,V,v);if(!F||H){j.logger.log("[transmuxer-interface, "+f.type+"]: Starting new transmux session for sn: "+m.sn+" p: "+m.part+" level: "+m.level+" id: "+m.id+`
|
|
discontinuity: `+H+`
|
|
trackSwitch: `+V+`
|
|
contiguous: `+F+`
|
|
accurateTimeOffset: `+E+`
|
|
timeOffset: `+v);var le=new G.TransmuxConfig(d,A,l,L,c);this.configureTransmuxer(le)}if(this.frag=f,this.part=g,b)b.postMessage({cmd:"demux",data:o,decryptdata:x,chunkMeta:m,state:oe},o instanceof ArrayBuffer?[o]:[]);else if(a){var ve=a.push(o,x,m,oe);Object(G.isPromise)(ve)?ve.then(function(Ie){u.handleTransmuxComplete(Ie)}):this.handleTransmuxComplete(ve)}},C.flush=function(o){var l=this;o.transmuxing.start=self.performance.now();var d=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:o});else if(d){var f=d.flush(o);Object(G.isPromise)(f)?f.then(function(g){l.handleFlushResult(g,o)}):this.handleFlushResult(f,o)}},C.handleFlushResult=function(o,l){var d=this;o.forEach(function(A){d.handleTransmuxComplete(A)}),this.onFlush(l)},C.onWorkerMessage=function(o){var l=o.data,d=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,d.trigger(l.event,l.data);break}}},C.configureTransmuxer=function(o){var l=this.worker,d=this.transmuxer;l?l.postMessage({cmd:"configure",config:o}):d&&d.configure(o)},C.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},w}()},"./src/demux/transmuxer-worker.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return O});var Q=R("./src/demux/transmuxer.ts"),B=R("./src/events.ts"),_=R("./src/utils/logger.ts"),G=R("./node_modules/eventemitter3/index.js"),j=R.n(G);function O(D){var w=new G.EventEmitter,C=function(o,l){D.postMessage({event:o,data:l})};w.on(B.Events.FRAG_DECRYPTED,C),w.on(B.Events.ERROR,C),D.addEventListener("message",function(h){var o=h.data;switch(o.cmd){case"init":{var l=JSON.parse(o.config);D.transmuxer=new Q.default(w,o.typeSupported,l,o.vendor,o.id),Object(_.enableLogs)(l.debug),C("init",null);break}case"configure":{D.transmuxer.configure(o.config);break}case"demux":{var d=D.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(Q.isPromise)(d)?d.then(function(g){M(D,g)}):M(D,d);break}case"flush":{var A=o.chunkMeta,f=D.transmuxer.flush(A);Object(Q.isPromise)(f)?f.then(function(g){T(D,g,A)}):T(D,f,A);break}default:break}})}function M(D,w){if(k(w.remuxResult))return;var C=[],h=w.remuxResult,o=h.audio,l=h.video;o&&y(C,o),l&&y(C,l),D.postMessage({event:"transmuxComplete",data:w},C)}function y(D,w){w.data1&&D.push(w.data1.buffer),w.data2&&D.push(w.data2.buffer)}function T(D,w,C){w.forEach(function(h){M(D,h)}),D.postMessage({event:"flush",data:C})}function k(D){return!D.audio&&!D.video&&!D.text&&!D.id3&&!D.initSegment}},"./src/demux/transmuxer.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return l}),R.d(X,"isPromise",function(){return f}),R.d(X,"TransmuxConfig",function(){return g}),R.d(X,"TransmuxState",function(){return L});var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/crypt/decrypter.ts"),G=R("./src/demux/aacdemuxer.ts"),j=R("./src/demux/mp4demuxer.ts"),O=R("./src/demux/tsdemuxer.ts"),M=R("./src/demux/mp3demuxer.ts"),y=R("./src/remux/mp4-remuxer.ts"),T=R("./src/remux/passthrough-remuxer.ts"),k=R("./src/demux/chunk-cache.ts"),D=R("./src/utils/mp4-tools.ts"),w=R("./src/utils/logger.ts"),C;try{C=self.performance.now.bind(self.performance)}catch(E){w.logger.debug("Unable to use Performance API on this environment"),C=self.Date.now}var h=[{demux:O.default,remux:y.default},{demux:j.default,remux:T.default},{demux:G.default,remux:y.default},{demux:M.default,remux:y.default}],o=1024;h.forEach(function(E){var m=E.demux;o=Math.max(o,m.minProbeByteLength)});var l=function(){function E(c,u,a,b,v){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 k.default,this.observer=c,this.typeSupported=u,this.config=a,this.vendor=b,this.id=v}var m=E.prototype;return m.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},m.push=function(u,a,b,v){var x=this,P=b.transmuxing;P.executeStart=C();var H=new Uint8Array(u),V=this.cache,$=this.config,z=this.currentTransmuxState,F=this.transmuxConfig;v&&(this.currentTransmuxState=v);var ee=d(H,a);if(ee&&ee.method==="AES-128"){var oe=this.getDecrypter();if($.enableSoftwareAES){var le=oe.softwareDecrypt(H,ee.key.buffer,ee.iv.buffer);if(!le)return P.executeEnd=C(),A(b);H=new Uint8Array(le)}else return this.decryptionPromise=oe.webCryptoDecrypt(H,ee.key.buffer,ee.iv.buffer).then(function(Be){var He=x.push(Be,null,b);return x.decryptionPromise=null,He}),this.decryptionPromise}var ve=v||z,Ie=ve.contiguous,xe=ve.discontinuity,Ce=ve.trackSwitch,Te=ve.accurateTimeOffset,Se=ve.timeOffset,pe=F.audioCodec,se=F.videoCodec,De=F.defaultInitPts,Ye=F.duration,Ge=F.initSegmentData;if((xe||Ce)&&this.resetInitSegment(Ge,pe,se,Ye),xe&&this.resetInitialTimestamp(De),Ie||this.resetContiguity(),this.needsProbing(H,xe,Ce)){if(V.dataLength){var $e=V.flush();H=Object(D.appendUint8Array)($e,H)}this.configureTransmuxer(H,F)}var et=this.transmux(H,ee,Se,Te,b),Re=this.currentTransmuxState;return Re.contiguous=!0,Re.discontinuity=!1,Re.trackSwitch=!1,P.executeEnd=C(),et},m.flush=function(u){var a=this,b=u.transmuxing;b.executeStart=C();var v=this.decrypter,x=this.cache,P=this.currentTransmuxState,H=this.decryptionPromise;if(H)return H.then(function(){return a.flush(u)});var V=[],$=P.timeOffset;if(v){var z=v.flush();z&&V.push(this.push(z,null,u))}var F=x.dataLength;x.reset();var ee=this.demuxer,oe=this.remuxer;if(!ee||!oe)return F>=o&&this.observer.emit(Q.Events.ERROR,Q.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),b.executeEnd=C(),[A(u)];var le=ee.flush($);return f(le)?le.then(function(ve){return a.flushRemux(V,ve,u),V}):(this.flushRemux(V,le,u),V)},m.flushRemux=function(u,a,b){var v=a.audioTrack,x=a.avcTrack,P=a.id3Track,H=a.textTrack,V=this.currentTransmuxState,$=V.accurateTimeOffset,z=V.timeOffset;w.logger.log("[transmuxer.ts]: Flushed fragment "+b.sn+(b.part>-1?" p: "+b.part:"")+" of level "+b.level);var F=this.remuxer.remux(v,x,P,H,z,$,!0,this.id);u.push({remuxResult:F,chunkMeta:b}),b.transmuxing.executeEnd=C()},m.resetInitialTimestamp=function(u){var a=this.demuxer,b=this.remuxer;if(!a||!b)return;a.resetTimeStamp(u),b.resetTimeStamp(u)},m.resetContiguity=function(){var u=this.demuxer,a=this.remuxer;if(!u||!a)return;u.resetContiguity(),a.resetNextTimestamp()},m.resetInitSegment=function(u,a,b,v){var x=this.demuxer,P=this.remuxer;if(!x||!P)return;x.resetInitSegment(a,b,v),P.resetInitSegment(u,a,b)},m.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},m.transmux=function(u,a,b,v,x){var P;return a&&a.method==="SAMPLE-AES"?P=this.transmuxSampleAes(u,a,b,v,x):P=this.transmuxUnencrypted(u,b,v,x),P},m.transmuxUnencrypted=function(u,a,b,v){var x=this.demuxer.demux(u,a,!1,!this.config.progressive),P=x.audioTrack,H=x.avcTrack,V=x.id3Track,$=x.textTrack,z=this.remuxer.remux(P,H,V,$,a,b,!1,this.id);return{remuxResult:z,chunkMeta:v}},m.transmuxSampleAes=function(u,a,b,v,x){var P=this;return this.demuxer.demuxSampleAes(u,a,b).then(function(H){var V=P.remuxer.remux(H.audioTrack,H.avcTrack,H.id3Track,H.textTrack,b,v,!1,P.id);return{remuxResult:V,chunkMeta:x}})},m.configureTransmuxer=function(u,a){for(var b=this.config,v=this.observer,x=this.typeSupported,P=this.vendor,H=a.audioCodec,V=a.defaultInitPts,$=a.duration,z=a.initSegmentData,F=a.videoCodec,ee,oe=0,le=h.length;oe<le;oe++)if(h[oe].demux.probe(u)){ee=h[oe];break}ee||(w.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),ee={demux:j.default,remux:T.default});var ve=this.demuxer,Ie=this.remuxer,xe=ee.remux,Ce=ee.demux;(!Ie||!(Ie instanceof xe))&&(this.remuxer=new xe(v,b,x,P)),(!ve||!(ve instanceof Ce))&&(this.demuxer=new Ce(v,b,x),this.probe=Ce.probe),this.resetInitSegment(z,H,F,$),this.resetInitialTimestamp(V)},m.needsProbing=function(u,a,b){return!this.demuxer||!this.remuxer||a||b},m.getDecrypter=function(){var u=this.decrypter;return u||(u=this.decrypter=new _.default(this.observer,this.config)),u},E}();function d(E,m){var c=null;return E.byteLength>0&&m!=null&&m.key!=null&&m.iv!==null&&m.method!=null&&(c=m),c}var A=function(m){return{remuxResult:{},chunkMeta:m}};function f(E){return"then"in E&&E.then instanceof Function}var g=function(m,c,u,a,b){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=m,this.videoCodec=c,this.initSegmentData=u,this.duration=a,this.defaultInitPts=b},L=function(m,c,u,a,b){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=m,this.contiguous=c,this.accurateTimeOffset=u,this.trackSwitch=a,this.timeOffset=b}},"./src/demux/tsdemuxer.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"discardEPB",function(){return A});var Q=R("./src/demux/adts.ts"),B=R("./src/demux/mpegaudio.ts"),_=R("./src/demux/exp-golomb.ts"),G=R("./src/demux/id3.ts"),j=R("./src/demux/sample-aes.ts"),O=R("./src/events.ts"),M=R("./src/utils/mp4-tools.ts"),y=R("./src/utils/logger.ts"),T=R("./src/errors.ts"),k={video:1,audio:2,id3:3,text:4},D=function(){function f(L,E,m){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=L,this.config=E,this.typeSupported=m}f.probe=function(E){var m=f.syncOffset(E);return m<0?!1:(m&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+m+", junk ahead ?"),!0)},f.syncOffset=function(E){for(var m=Math.min(1e3,E.length-3*188),c=0;c<m;){if(E[c]===71&&E[c+188]===71&&E[c+2*188]===71)return c;c++}return-1},f.createTrack=function(E,m){return{container:E==="video"||E==="audio"?"video/mp2t":void 0,type:E,id:k[E],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:E==="audio"?m:void 0}};var g=f.prototype;return g.resetInitSegment=function(E,m,c){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=f.createTrack("video",c),this._audioTrack=f.createTrack("audio",c),this._id3Track=f.createTrack("id3",c),this._txtTrack=f.createTrack("text",c),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=E,this.videoCodec=m,this._duration=c},g.resetTimeStamp=function(){},g.resetContiguity=function(){var E=this._audioTrack,m=this._avcTrack,c=this._id3Track;E&&(E.pesData=null),m&&(m.pesData=null),c&&(c.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},g.demux=function(E,m,c,u){c===void 0&&(c=!1),u===void 0&&(u=!1),c||(this.sampleAes=null);var a,b=this._avcTrack,v=this._audioTrack,x=this._id3Track,P=b.pid,H=b.pesData,V=v.pid,$=x.pid,z=v.pesData,F=x.pesData,ee=!1,oe=this.pmtParsed,le=this._pmtId,ve=E.length;if(this.remainderData&&(E=Object(M.appendUint8Array)(this.remainderData,E),ve=E.length,this.remainderData=null),ve<188&&!u)return this.remainderData=E,{audioTrack:v,avcTrack:b,id3Track:x,textTrack:this._txtTrack};var Ie=Math.max(0,f.syncOffset(E));ve-=(ve+Ie)%188,ve<E.byteLength&&!u&&(this.remainderData=new Uint8Array(E.buffer,ve,E.buffer.byteLength-ve));for(var xe=Ie;xe<ve;xe+=188)if(E[xe]===71){var Ce=!!(E[xe+1]&64),Te=((E[xe+1]&31)<<8)+E[xe+2],Se=(E[xe+3]&48)>>4,pe=void 0;if(Se>1){if(pe=xe+5+E[xe+4],pe===xe+188)continue}else pe=xe+4;switch(Te){case P:Ce&&(H&&(a=o(H))&&this.parseAVCPES(a,!1),H={data:[],size:0}),H&&(H.data.push(E.subarray(pe,xe+188)),H.size+=xe+188-pe);break;case V:Ce&&(z&&(a=o(z))&&(v.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),z={data:[],size:0}),z&&(z.data.push(E.subarray(pe,xe+188)),z.size+=xe+188-pe);break;case $:Ce&&(F&&(a=o(F))&&this.parseID3PES(a),F={data:[],size:0}),F&&(F.data.push(E.subarray(pe,xe+188)),F.size+=xe+188-pe);break;case 0:Ce&&(pe+=E[pe]+1),le=this._pmtId=C(E,pe);break;case le:{Ce&&(pe+=E[pe]+1);var se=h(E,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);P=se.avc,P>0&&(b.pid=P),V=se.audio,V>0&&(v.pid=V,v.isAAC=se.isAAC),$=se.id3,$>0&&(x.pid=$),ee&&!oe&&(y.logger.log("reparse from beginning"),ee=!1,xe=Ie-188),oe=this.pmtParsed=!0;break}case 17:case 8191:break;default:ee=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});b.pesData=H,v.pesData=z,x.pesData=F;var De={audioTrack:v,avcTrack:b,id3Track:x,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(De),De},g.flush=function(){var E=this.remainderData;this.remainderData=null;var m;return E?m=this.demux(E,-1,!1,!0):m={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(m),this.sampleAes?this.decrypt(m,this.sampleAes):m},g.extractRemainingSamples=function(E){var m=E.audioTrack,c=E.avcTrack,u=E.id3Track,a=c.pesData,b=m.pesData,v=u.pesData,x;a&&(x=o(a))?(this.parseAVCPES(x,!0),c.pesData=null):c.pesData=a,b&&(x=o(b))?(m.isAAC?this.parseAACPES(x):this.parseMPEGPES(x),m.pesData=null):(b!=null&&b.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=b),v&&(x=o(v))?(this.parseID3PES(x),u.pesData=null):u.pesData=v},g.demuxSampleAes=function(E,m,c){var u=this.demux(E,c,!0,!this.config.progressive),a=this.sampleAes=new j.default(this.observer,this.config,m);return this.decrypt(u,a)},g.decrypt=function(E,m){return new Promise(function(c){var u=E.audioTrack,a=E.avcTrack;u.samples&&u.isAAC?m.decryptAacSamples(u.samples,0,function(){a.samples?m.decryptAvcSamples(a.samples,0,0,function(){c(E)}):c(E)}):a.samples&&m.decryptAvcSamples(a.samples,0,0,function(){c(E)})})},g.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},g.parseAVCPES=function(E,m){var c=this,u=this._avcTrack,a=this.parseAVCNALu(E.data),b=!1,v=this.avcSample,x,P=!1;E.data=null,v&&a.length&&!u.audFound&&(l(v,u),v=this.avcSample=w(!1,E.pts,E.dts,"")),a.forEach(function(H){switch(H.type){case 1:{x=!0,v||(v=c.avcSample=w(!0,E.pts,E.dts,"")),b&&(v.debug+="NDR "),v.frame=!0;var V=H.data;if(P&&V.length>4){var $=new _.default(V).readSliceType();($===2||$===4||$===7||$===9)&&(v.key=!0)}break}case 5:x=!0,v||(v=c.avcSample=w(!0,E.pts,E.dts,"")),b&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{x=!0,b&&v&&(v.debug+="SEI ");var z=new _.default(A(H.data));z.readUByte();for(var F=0,ee=0,oe=!1,le=0;!oe&&z.bytesAvailable>1;){F=0;do le=z.readUByte(),F+=le;while(le===255);ee=0;do le=z.readUByte(),ee+=le;while(le===255);if(F===4&&z.bytesAvailable!==0){oe=!0;var ve=z.readUByte();if(ve===181){var Ie=z.readUShort();if(Ie===49){var xe=z.readUInt();if(xe===1195456820){var Ce=z.readUByte();if(Ce===3){for(var Te=z.readUByte(),Se=z.readUByte(),pe=31&Te,se=[Te,Se],De=0;De<pe;De++)se.push(z.readUByte()),se.push(z.readUByte()),se.push(z.readUByte());d(c._txtTrack.samples,{type:3,pts:E.pts,bytes:se})}}}}}else if(F===5&&z.bytesAvailable!==0){if(oe=!0,ee>16){for(var Ye=[],Ge=0;Ge<16;Ge++)Ye.push(z.readUByte().toString(16)),(Ge===3||Ge===5||Ge===7||Ge===9)&&Ye.push("-");for(var $e=ee-16,et=new Uint8Array($e),Re=0;Re<$e;Re++)et[Re]=z.readUByte();d(c._txtTrack.samples,{pts:E.pts,payloadType:F,uuid:Ye.join(""),userData:Object(G.utf8ArrayToStr)(et),userDataBytes:et})}}else if(ee<z.bytesAvailable)for(var Be=0;Be<ee;Be++)z.readUByte()}break}case 7:if(x=!0,P=!0,b&&v&&(v.debug+="SPS "),!u.sps){var He=new _.default(H.data),Xe=He.readSPS();u.width=Xe.width,u.height=Xe.height,u.pixelRatio=Xe.pixelRatio,u.sps=[H.data],u.duration=c._duration;for(var Ke=H.data.subarray(1,4),Fe="avc1.",Pe=0;Pe<3;Pe++){var ot=Ke[Pe].toString(16);ot.length<2&&(ot="0"+ot),Fe+=ot}u.codec=Fe}break;case 8:x=!0,b&&v&&(v.debug+="PPS "),u.pps||(u.pps=[H.data]);break;case 9:x=!1,u.audFound=!0,v&&l(v,u),v=c.avcSample=w(!1,E.pts,E.dts,b?"AUD ":"");break;case 12:x=!1;break;default:x=!1,v&&(v.debug+="unknown NAL "+H.type+" ");break}if(v&&x){var Je=v.units;Je.push(H)}}),m&&v&&(l(v,u),this.avcSample=null)},g.getLastNalUnit=function(){var E,m=this.avcSample,c;if(!m||m.units.length===0){var u=this._avcTrack.samples;m=u[u.length-1]}if((E=m)!==null&&E!==void 0&&E.units){var a=m.units;c=a[a.length-1]}return c},g.parseAVCNALu=function(E){var m=E.byteLength,c=this._avcTrack,u=c.naluState||0,a=u,b=[],v=0,x,P,H,V=-1,$=0;for(u===-1&&(V=0,$=E[0]&31,u=0,v=1);v<m;){if(x=E[v++],!u){u=x?0:1;continue}if(u===1){u=x?0:2;continue}if(!x)u=3;else if(x===1){if(V>=0){var z={data:E.subarray(V,v-u-1),type:$};b.push(z)}else{var F=this.getLastNalUnit();if(F&&(a&&v<=4-a&&(F.state&&(F.data=F.data.subarray(0,F.data.byteLength-a))),P=v-u-1,P>0)){var ee=new Uint8Array(F.data.byteLength+P);ee.set(F.data,0),ee.set(E.subarray(0,P),F.data.byteLength),F.data=ee,F.state=0}}v<m?(H=E[v]&31,V=v,$=H,u=0):u=-1}else u=0}if(V>=0&&u>=0){var oe={data:E.subarray(V,m),type:$,state:u};b.push(oe)}if(b.length===0){var le=this.getLastNalUnit();if(le){var ve=new Uint8Array(le.data.byteLength+E.byteLength);ve.set(le.data,0),ve.set(E,le.data.byteLength),le.data=ve}}return c.naluState=u,b},g.parseAACPES=function(E){var m=0,c=this._audioTrack,u=this.aacOverFlow,a=E.data;if(u){this.aacOverFlow=null;var b=u.sample.unit.byteLength,v=Math.min(u.missing,b),x=b-v;u.sample.unit.set(a.subarray(0,v),x),c.samples.push(u.sample),m=u.missing}var P,H;for(P=m,H=a.length;P<H-1&&!Q.isHeader(a,P);P++);if(P!==m){var V,$;if(P<H-1?(V="AAC PES did not start with ADTS header,offset:"+P,$=!1):(V="no ADTS header found in AAC PES",$=!0),y.logger.warn("parsing error:"+V),this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:$,reason:V}),$)return}Q.initTrackConfig(c,this.observer,a,P,this.audioCodec);var z;if(E.pts!==void 0)z=E.pts;else if(u){var F=Q.getFrameDuration(c.samplerate);z=u.sample.pts+F}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var ee=0;P<H;)if(Q.isHeader(a,P)){if(P+5<H){var oe=Q.appendFrame(c,a,P,z,ee);if(oe)if(oe.missing)this.aacOverFlow=oe;else{P+=oe.length,ee++;continue}}break}else P++},g.parseMPEGPES=function(E){var m=E.data,c=m.length,u=0,a=0,b=E.pts;if(b===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<c;)if(B.isHeader(m,a)){var v=B.appendFrame(this._audioTrack,m,a,b,u);if(v)a+=v.length,u++;else break}else a++},g.parseID3PES=function(E){if(E.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(E)},f}();D.minProbeByteLength=188;function w(f,g,L,E){return{key:f,frame:!1,pts:g,dts:L,units:[],debug:E,length:0}}function C(f,g){return(f[g+10]&31)<<8|f[g+11]}function h(f,g,L,E){var m={audio:-1,avc:-1,id3:-1,isAAC:!0},c=(f[g+1]&15)<<8|f[g+2],u=g+3+c-4,a=(f[g+10]&15)<<8|f[g+11];for(g+=12+a;g<u;){var b=(f[g+1]&31)<<8|f[g+2];switch(f[g]){case 207:if(!E){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:m.audio===-1&&(m.audio=b);break;case 21:m.id3===-1&&(m.id3=b);break;case 219:if(!E){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:m.avc===-1&&(m.avc=b);break;case 3:case 4:L?m.audio===-1&&(m.audio=b,m.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}g+=((f[g+3]&15)<<8|f[g+4])+5}return m}function o(f){var g=0,L,E,m,c,u,a=f.data;if(!f||f.size===0)return null;for(;a[0].length<19&&a.length>1;){var b=new Uint8Array(a[0].length+a[1].length);b.set(a[0]),b.set(a[1],a[0].length),a[0]=b,a.splice(1,1)}L=a[0];var v=(L[0]<<16)+(L[1]<<8)+L[2];if(v===1){if(E=(L[4]<<8)+L[5],E&&E>f.size-6)return null;var x=L[7];x&192&&(c=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,x&64?(u=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,c-u>60*9e4&&(y.logger.warn(Math.round((c-u)/9e4)+"s delta between PTS and DTS, align them"),c=u)):u=c),m=L[8];var P=m+9;if(f.size<=P)return null;f.size-=P;for(var H=new Uint8Array(f.size),V=0,$=a.length;V<$;V++){L=a[V];var z=L.byteLength;if(P)if(P>z){P-=z;continue}else L=L.subarray(P),z-=P,P=0;H.set(L,g),g+=z}return E&&(E-=m+3),{data:H,pts:c,dts:u,len:E}}return null}function l(f,g){if(f.units.length&&f.frame){if(f.pts===void 0){var L=g.samples,E=L.length;if(E){var m=L[E-1];f.pts=m.pts,f.dts=m.dts}else{g.dropped++;return}}g.samples.push(f)}f.debug.length&&y.logger.log(f.pts+"/"+f.dts+":"+f.debug)}function d(f,g){var L=f.length;if(L>0){if(g.pts>=f[L-1].pts)f.push(g);else for(var E=L-1;E>=0;E--)if(g.pts<f[E].pts){f.splice(E,0,g);break}}else f.push(g)}function A(f){for(var g=f.byteLength,L=[],E=1;E<g-2;)f[E]===0&&f[E+1]===0&&f[E+2]===3?(L.push(E+2),E+=2):E++;if(L.length===0)return f;var m=g-L.length,c=new Uint8Array(m),u=0;for(E=0;E<m;u++,E++)u===L[0]&&(u++,L.shift()),c[E]=f[u];return c}X.default=D},"./src/errors.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"ErrorTypes",function(){return Q}),R.d(X,"ErrorDetails",function(){return B});var Q;(function(_){_.NETWORK_ERROR="networkError",_.MEDIA_ERROR="mediaError",_.KEY_SYSTEM_ERROR="keySystemError",_.MUX_ERROR="muxError",_.OTHER_ERROR="otherError"})(Q||(Q={}));var B;(function(_){_.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",_.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",_.KEY_SYSTEM_NO_SESSION="keySystemNoSession",_.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",_.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",_.MANIFEST_LOAD_ERROR="manifestLoadError",_.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",_.MANIFEST_PARSING_ERROR="manifestParsingError",_.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",_.LEVEL_EMPTY_ERROR="levelEmptyError",_.LEVEL_LOAD_ERROR="levelLoadError",_.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",_.LEVEL_SWITCH_ERROR="levelSwitchError",_.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",_.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",_.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",_.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",_.FRAG_LOAD_ERROR="fragLoadError",_.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",_.FRAG_DECRYPT_ERROR="fragDecryptError",_.FRAG_PARSING_ERROR="fragParsingError",_.REMUX_ALLOC_ERROR="remuxAllocError",_.KEY_LOAD_ERROR="keyLoadError",_.KEY_LOAD_TIMEOUT="keyLoadTimeOut",_.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",_.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",_.BUFFER_APPEND_ERROR="bufferAppendError",_.BUFFER_APPENDING_ERROR="bufferAppendingError",_.BUFFER_STALLED_ERROR="bufferStalledError",_.BUFFER_FULL_ERROR="bufferFullError",_.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",_.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",_.INTERNAL_EXCEPTION="internalException",_.INTERNAL_ABORTED="aborted",_.UNKNOWN="unknown"})(B||(B={}))},"./src/events.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"Events",function(){return Q});var Q;(function(B){B.MEDIA_ATTACHING="hlsMediaAttaching",B.MEDIA_ATTACHED="hlsMediaAttached",B.MEDIA_DETACHING="hlsMediaDetaching",B.MEDIA_DETACHED="hlsMediaDetached",B.BUFFER_RESET="hlsBufferReset",B.BUFFER_CODECS="hlsBufferCodecs",B.BUFFER_CREATED="hlsBufferCreated",B.BUFFER_APPENDING="hlsBufferAppending",B.BUFFER_APPENDED="hlsBufferAppended",B.BUFFER_EOS="hlsBufferEos",B.BUFFER_FLUSHING="hlsBufferFlushing",B.BUFFER_FLUSHED="hlsBufferFlushed",B.MANIFEST_LOADING="hlsManifestLoading",B.MANIFEST_LOADED="hlsManifestLoaded",B.MANIFEST_PARSED="hlsManifestParsed",B.LEVEL_SWITCHING="hlsLevelSwitching",B.LEVEL_SWITCHED="hlsLevelSwitched",B.LEVEL_LOADING="hlsLevelLoading",B.LEVEL_LOADED="hlsLevelLoaded",B.LEVEL_UPDATED="hlsLevelUpdated",B.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",B.LEVELS_UPDATED="hlsLevelsUpdated",B.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",B.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",B.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",B.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",B.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",B.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",B.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",B.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",B.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",B.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",B.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",B.CUES_PARSED="hlsCuesParsed",B.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",B.INIT_PTS_FOUND="hlsInitPtsFound",B.FRAG_LOADING="hlsFragLoading",B.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",B.FRAG_LOADED="hlsFragLoaded",B.FRAG_DECRYPTED="hlsFragDecrypted",B.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",B.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",B.FRAG_PARSING_METADATA="hlsFragParsingMetadata",B.FRAG_PARSED="hlsFragParsed",B.FRAG_BUFFERED="hlsFragBuffered",B.FRAG_CHANGED="hlsFragChanged",B.FPS_DROP="hlsFpsDrop",B.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",B.ERROR="hlsError",B.DESTROYING="hlsDestroying",B.KEY_LOADING="hlsKeyLoading",B.KEY_LOADED="hlsKeyLoaded",B.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",B.BACK_BUFFER_REACHED="hlsBackBufferReached"})(Q||(Q={}))},"./src/hls.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return f});var Q=R("./node_modules/url-toolkit/src/url-toolkit.js"),B=R.n(Q),_=R("./src/loader/playlist-loader.ts"),G=R("./src/loader/key-loader.ts"),j=R("./src/controller/id3-track-controller.ts"),O=R("./src/controller/latency-controller.ts"),M=R("./src/controller/level-controller.ts"),y=R("./src/controller/fragment-tracker.ts"),T=R("./src/controller/stream-controller.ts"),k=R("./src/is-supported.ts"),D=R("./src/utils/logger.ts"),w=R("./src/config.ts"),C=R("./node_modules/eventemitter3/index.js"),h=R.n(C),o=R("./src/events.ts"),l=R("./src/errors.ts");function d(g,L){for(var E=0;E<L.length;E++){var m=L[E];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(g,m.key,m)}}function A(g,L,E){return L&&d(g.prototype,L),E&&d(g,E),g}var f=function(){g.isSupported=function(){return Object(k.isSupported)()};function g(E){E===void 0&&(E={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new C.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 m=this.config=Object(w.mergeConfig)(g.DefaultConfig,E);this.userConfig=E,Object(D.enableLogs)(m.debug),this._autoLevelCapping=-1,m.progressive&&Object(w.enableStreamingMode)(m);var c=m.abrController,u=m.bufferController,a=m.capLevelController,b=m.fpsController,v=this.abrController=new c(this),x=this.bufferController=new u(this),P=this.capLevelController=new a(this),H=new b(this),V=new _.default(this),$=new G.default(this),z=new j.default(this),F=this.levelController=new M.default(this),ee=new y.FragmentTracker(this),oe=this.streamController=new T.default(this,ee);P.setStreamController(oe),H.setStreamController(oe);var le=[F,oe];this.networkControllers=le;var ve=[V,$,v,x,P,H,z,ee];this.audioTrackController=this.createController(m.audioTrackController,null,le),this.createController(m.audioStreamController,ee,le),this.subtitleTrackController=this.createController(m.subtitleTrackController,null,le),this.createController(m.subtitleStreamController,ee,le),this.createController(m.timelineController,null,ve),this.emeController=this.createController(m.emeController,null,ve),this.cmcdController=this.createController(m.cmcdController,null,ve),this.latencyController=this.createController(O.default,null,ve),this.coreComponents=ve}var L=g.prototype;return L.createController=function(m,c,u){if(m){var a=c?new m(this,c):new m(this);return u&&u.push(a),a}return null},L.on=function(m,c,u){u===void 0&&(u=this),this._emitter.on(m,c,u)},L.once=function(m,c,u){u===void 0&&(u=this),this._emitter.once(m,c,u)},L.removeAllListeners=function(m){this._emitter.removeAllListeners(m)},L.off=function(m,c,u,a){u===void 0&&(u=this),this._emitter.off(m,c,u,a)},L.listeners=function(m){return this._emitter.listeners(m)},L.emit=function(m,c,u){return this._emitter.emit(m,c,u)},L.trigger=function(m,c){if(this.config.debug)return this.emit(m,m,c);try{return this.emit(m,m,c)}catch(u){D.logger.error("An internal error happened while handling event "+m+'. Error message: "'+u.message+'". Here is a stacktrace:',u),this.trigger(o.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:m,error:u})}return!1},L.listenerCount=function(m){return this._emitter.listenerCount(m)},L.destroy=function(){D.logger.log("destroy"),this.trigger(o.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(m){return m.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(m){return m.destroy()}),this.coreComponents.length=0},L.attachMedia=function(m){D.logger.log("attachMedia"),this._media=m,this.trigger(o.Events.MEDIA_ATTACHING,{media:m})},L.detachMedia=function(){D.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(m){this.stopLoad();var c=this.media,u=this.url,a=this.url=Q.buildAbsoluteURL(self.location.href,m,{alwaysNormalize:!0});D.logger.log("loadSource:"+a),c&&u&&u!==a&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(c)),this.trigger(o.Events.MANIFEST_LOADING,{url:m})},L.startLoad=function(m){m===void 0&&(m=-1),D.logger.log("startLoad("+m+")"),this.networkControllers.forEach(function(c){c.startLoad(m)})},L.stopLoad=function(){D.logger.log("stopLoad"),this.networkControllers.forEach(function(m){m.stopLoad()})},L.swapAudioCodec=function(){D.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){D.logger.log("recoverMediaError");var m=this._media;this.detachMedia(),m&&this.attachMedia(m)},L.removeLevel=function(m,c){c===void 0&&(c=0),this.levelController.removeLevel(m,c)},A(g,[{key:"levels",get:function(){var m=this.levelController.levels;return m||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(m){D.logger.log("set currentLevel:"+m),this.loadLevel=m,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(m){D.logger.log("set nextLevel:"+m),this.levelController.manualLevel=m,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(m){D.logger.log("set loadLevel:"+m),this.levelController.manualLevel=m}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(m){this.levelController.nextLoadLevel=m}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(m){D.logger.log("set firstLevel:"+m),this.levelController.firstLevel=m}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(m){D.logger.log("set startLevel:"+m),m!==-1&&(m=Math.max(m,this.minAutoLevel)),this.levelController.startLevel=m}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(m){var c=!!m;c!==this.config.capLevelToPlayerSize&&(c?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=c)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(m){this._autoLevelCapping!==m&&(D.logger.log("set autoLevelCapping:"+m),this._autoLevelCapping=m)}},{key:"bandwidthEstimate",get:function(){var m=this.abrController.bwEstimator;return m?m.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var m=this.levels,c=this.config.minAutoBitrate;if(!m)return 0;for(var u=m.length,a=0;a<u;a++)if(m[a].maxBitrate>c)return a;return 0}},{key:"maxAutoLevel",get:function(){var m=this.levels,c=this.autoLevelCapping,u;return c===-1&&m&&m.length?u=m.length-1:u=c,u}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(m){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,m)}},{key:"audioTracks",get:function(){var m=this.audioTrackController;return m?m.audioTracks:[]}},{key:"audioTrack",get:function(){var m=this.audioTrackController;return m?m.audioTrack:-1},set:function(m){var c=this.audioTrackController;c&&(c.audioTrack=m)}},{key:"subtitleTracks",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTrack:-1},set:function(m){var c=this.subtitleTrackController;c&&(c.subtitleTrack=m)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var m=this.subtitleTrackController;return m?m.subtitleDisplay:!1},set:function(m){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=m)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(m){this.config.lowLatencyMode=m}},{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 o.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return g.defaultConfig?g.defaultConfig:w.hlsDefaultConfig},set:function(m){g.defaultConfig=m}}]),g}();f.defaultConfig=void 0},"./src/is-supported.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"isSupported",function(){return _}),R.d(X,"changeTypeSupported",function(){return G});var Q=R("./src/utils/mediasource-helper.ts");function B(){return self.SourceBuffer||self.WebKitSourceBuffer}function _(){var j=Object(Q.getMediaSource)();if(!j)return!1;var O=B(),M=j&&typeof j.isTypeSupported=="function"&&j.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!M&&!!y}function G(){var j,O=B();return typeof(O==null||((j=O.prototype)===null||j===void 0)?void 0:j.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return D}),R.d(X,"LoadError",function(){return C});var Q=R("./src/polyfills/number.ts"),B=R("./src/errors.ts");function _(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,y(h,o)}function G(h){var o=typeof Map=="function"?new Map:void 0;return G=function(d){if(d===null||!M(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(d))return o.get(d);o.set(d,A)}function A(){return j(d,arguments,T(this).constructor)}return A.prototype=Object.create(d.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),y(A,d)},G(h)}function j(h,o,l){return O()?j=Reflect.construct:j=function(A,f,g){var L=[null];L.push.apply(L,f);var E=Function.bind.apply(A,L),m=new E;return g&&y(m,g.prototype),m},j.apply(null,arguments)}function O(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(h){return!1}}function M(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function y(h,o){return y=Object.setPrototypeOf||function(d,A){return d.__proto__=A,d},y(h,o)}function T(h){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},T(h)}var k=Math.pow(2,17),D=function(){function h(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var o=h.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(d,A){var f=this,g=d.url;if(!g)return Promise.reject(new C({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(g?"part list":"url")));this.abort();var L=this.config,E=L.fLoader,m=L.loader;return new Promise(function(c,u){f.loader&&f.loader.destroy();var a=f.loader=d.loader=E?new E(L):new m(L),b=w(d),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:k};d.stats=a.stats,a.load(b,v,{onSuccess:function(P,H,V,$){f.resetLoader(d,a),c({frag:d,part:null,payload:P.data,networkDetails:$})},onError:function(P,H,V){f.resetLoader(d,a),u(new C({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:P,networkDetails:V}))},onAbort:function(P,H,V){f.resetLoader(d,a),u(new C({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:V}))},onTimeout:function(P,H,V){f.resetLoader(d,a),u(new C({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:V}))},onProgress:function(P,H,V,$){A&&A({frag:d,part:null,payload:V,networkDetails:$})}})})},o.loadPart=function(d,A,f){var g=this;this.abort();var L=this.config,E=L.fLoader,m=L.loader;return new Promise(function(c,u){g.loader&&g.loader.destroy();var a=g.loader=d.loader=E?new E(L):new m(L),b=w(d,A),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:k};A.stats=a.stats,a.load(b,v,{onSuccess:function(P,H,V,$){g.resetLoader(d,a),g.updateStatsFromPart(d,A);var z={frag:d,part:A,payload:P.data,networkDetails:$};f(z),c(z)},onError:function(P,H,V){g.resetLoader(d,a),u(new C({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:A,response:P,networkDetails:V}))},onAbort:function(P,H,V){d.stats.aborted=A.stats.aborted,g.resetLoader(d,a),u(new C({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:A,networkDetails:V}))},onTimeout:function(P,H,V){g.resetLoader(d,a),u(new C({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:A,networkDetails:V}))}})})},o.updateStatsFromPart=function(d,A){var f=d.stats,g=A.stats,L=g.total;if(f.loaded+=g.loaded,L){var E=Math.round(d.duration/A.duration),m=Math.min(Math.round(f.loaded/L),E),c=E-m,u=c*Math.round(f.loaded/m);f.total=f.loaded+u}else f.total=Math.max(f.loaded,f.total);var a=f.loading,b=g.loading;a.start?a.first+=b.first-b.start:(a.start=b.start,a.first=b.first),a.end=b.end},o.resetLoader=function(d,A){d.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},h}();function w(h,o){o===void 0&&(o=null);var l=o||h,d={frag:h,part:o,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},A=l.byteRangeStartOffset,f=l.byteRangeEndOffset;return Object(Q.isFiniteNumber)(A)&&Object(Q.isFiniteNumber)(f)&&(d.rangeStart=A,d.rangeEnd=f),d}var C=function(h){_(o,h);function o(l){for(var d,A=arguments.length,f=new Array(A>1?A-1:0),g=1;g<A;g++)f[g-1]=arguments[g];return d=h.call.apply(h,[this].concat(f))||this,d.data=void 0,d.data=l,d}return o}(G(Error))},"./src/loader/fragment.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"ElementaryStreamTypes",function(){return D}),R.d(X,"BaseSegment",function(){return w}),R.d(X,"Fragment",function(){return C}),R.d(X,"Part",function(){return h});var Q=R("./src/polyfills/number.ts"),B=R("./node_modules/url-toolkit/src/url-toolkit.js"),_=R.n(B),G=R("./src/utils/logger.ts"),j=R("./src/loader/level-key.ts"),O=R("./src/loader/load-stats.ts");function M(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,y(o,l)}function y(o,l){return y=Object.setPrototypeOf||function(A,f){return A.__proto__=f,A},y(o,l)}function T(o,l){for(var d=0;d<l.length;d++){var A=l[d];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(o,A.key,A)}}function k(o,l,d){return l&&T(o.prototype,l),d&&T(o,d),o}var D;(function(o){o.AUDIO="audio",o.VIDEO="video",o.AUDIOVIDEO="audiovideo"})(D||(D={}));var w=function(){function o(d){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[D.AUDIO]=null,A[D.VIDEO]=null,A[D.AUDIOVIDEO]=null,A),this.baseurl=d}var l=o.prototype;return l.setByteRange=function(A,f){var g=A.split("@",2),L=[];g.length===1?L[0]=f?f.byteRangeEndOffset:0:L[0]=parseInt(g[1]),L[1]=parseInt(g[0])+L[0],this._byteRange=L},k(o,[{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(B.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),o}(),C=function(o){M(l,o);function l(A,f){var g;return g=o.call(this,f)||this,g._decryptdata=null,g.rawProgramDateTime=null,g.programDateTime=null,g.tagList=[],g.duration=0,g.sn=0,g.levelkey=void 0,g.type=void 0,g.loader=null,g.level=-1,g.cc=0,g.startPTS=void 0,g.endPTS=void 0,g.appendedPTS=void 0,g.startDTS=void 0,g.endDTS=void 0,g.start=0,g.deltaPTS=void 0,g.maxStartPTS=void 0,g.minEndPTS=void 0,g.stats=new O.LoadStats,g.urlId=0,g.data=void 0,g.bitrateTest=!1,g.title=null,g.initSegment=null,g.type=A,g}var d=l.prototype;return d.createInitializationVector=function(f){for(var g=new Uint8Array(16),L=12;L<16;L++)g[L]=f>>8*(15-L)&255;return g},d.setDecryptDataFromLevelKey=function(f,g){var L=f;return(f==null?void 0:f.method)==="AES-128"&&f.uri&&!f.iv&&(L=j.LevelKey.fromURI(f.uri),L.method=f.method,L.iv=this.createInitializationVector(g),L.keyFormat="identity"),L},d.setElementaryStreamInfo=function(f,g,L,E,m,c){c===void 0&&(c=!1);var u=this.elementaryStreams,a=u[f];if(!a){u[f]={startPTS:g,endPTS:L,startDTS:E,endDTS:m,partial:c};return}a.startPTS=Math.min(a.startPTS,g),a.endPTS=Math.max(a.endPTS,L),a.startDTS=Math.min(a.startDTS,E),a.endDTS=Math.max(a.endDTS,m)},d.clearElementaryStreamInfo=function(){var f=this.elementaryStreams;f[D.AUDIO]=null,f[D.VIDEO]=null,f[D.AUDIOVIDEO]=null},k(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var f=this.sn;typeof f!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),f=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,f)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Q.isFiniteNumber)(this.programDateTime))return null;var f=Object(Q.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+f*1e3}},{key:"encrypted",get:function(){var f;return!!((f=this.decryptdata)!==null&&f!==void 0&&f.keyFormat&&this.decryptdata.uri)}}]),l}(w),h=function(o){M(l,o);function l(d,A,f,g,L){var E;E=o.call(this,f)||this,E.fragOffset=0,E.duration=0,E.gap=!1,E.independent=!1,E.relurl=void 0,E.fragment=void 0,E.index=void 0,E.stats=new O.LoadStats,E.duration=d.decimalFloatingPoint("DURATION"),E.gap=d.bool("GAP"),E.independent=d.bool("INDEPENDENT"),E.relurl=d.enumeratedString("URI"),E.fragment=A,E.index=g;var m=d.enumeratedString("BYTERANGE");return m&&E.setByteRange(m,L),L&&(E.fragOffset=L.fragOffset+L.duration),E}return k(l,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),l}(w)},"./src/loader/key-loader.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return G});var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/utils/logger.ts"),G=function(){function j(M){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=M,this._registerListeners()}var O=j.prototype;return O._registerListeners=function(){this.hls.on(Q.Events.KEY_LOADING,this.onKeyLoading,this)},O._unregisterListeners=function(){this.hls.off(Q.Events.KEY_LOADING,this.onKeyLoading)},O.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var T=this.loaders[y];T&&T.destroy()}this.loaders={}},O.onKeyLoading=function(y,T){var k=T.frag,D=k.type,w=this.loaders[D];if(!k.decryptdata){_.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var C=k.decryptdata.uri;if(C!==this.decrypturl||this.decryptkey===null){var h=this.hls.config;if(w&&(_.logger.warn("abort previous key loader for type:"+D),w.abort()),!C){_.logger.warn("key uri is falsy");return}var o=h.loader,l=k.loader=this.loaders[D]=new o(h);this.decrypturl=C,this.decryptkey=null;var d={url:C,frag:k,responseType:"arraybuffer"},A={timeout:h.fragLoadingTimeOut,maxRetry:0,retryDelay:h.fragLoadingRetryDelay,maxRetryDelay:h.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(d,A,f)}else this.decryptkey&&(k.decryptdata.key=this.decryptkey,this.hls.trigger(Q.Events.KEY_LOADED,{frag:k}))},O.loadsuccess=function(y,T,k){var D=k.frag;if(!D.decryptdata){_.logger.error("after key load, decryptdata unset");return}this.decryptkey=D.decryptdata.key=new Uint8Array(y.data),D.loader=null,delete this.loaders[D.type],this.hls.trigger(Q.Events.KEY_LOADED,{frag:D})},O.loaderror=function(y,T){var k=T.frag,D=k.loader;D&&D.abort(),delete this.loaders[k.type],this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:k,response:y})},O.loadtimeout=function(y,T){var k=T.frag,D=k.loader;D&&D.abort(),delete this.loaders[k.type],this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:k})},j}()},"./src/loader/level-details.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"LevelDetails",function(){return j});var Q=R("./src/polyfills/number.ts");function B(O,M){for(var y=0;y<M.length;y++){var T=M[y];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(O,T.key,T)}}function _(O,M,y){return M&&B(O.prototype,M),y&&B(O,y),O}var G=10,j=function(){function O(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 M=O.prototype;return M.reloaded=function(T){if(!T){this.advanced=!0,this.updated=!0;return}var k=this.lastPartSn-T.lastPartSn,D=this.lastPartIndex-T.lastPartIndex;this.updated=this.endSN!==T.endSN||!!D||!!k,this.advanced=this.endSN>T.endSN||k>0||k===0&&D>0,this.updated||this.advanced?this.misses=Math.floor(T.misses*.6):this.misses=T.misses+1,this.availabilityDelay=T.availabilityDelay},_(O,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Q.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var T=this.driftEndTime-this.driftStartTime;if(T>0){var k=this.driftEnd-this.driftStart;return k*1e3/T}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var T;return(T=this.fragments)!==null&&T!==void 0&&T.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 T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"LevelKey",function(){return j});var Q=R("./node_modules/url-toolkit/src/url-toolkit.js"),B=R.n(Q);function _(O,M){for(var y=0;y<M.length;y++){var T=M[y];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(O,T.key,T)}}function G(O,M,y){return M&&_(O.prototype,M),y&&_(O,y),O}var j=function(){O.fromURL=function(y,T){return new O(y,T)},O.fromURI=function(y){return new O(y)};function O(M,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(Q.buildAbsoluteURL)(M,y,{alwaysNormalize:!0}):this._uri=M}return G(O,[{key:"uri",get:function(){return this._uri}}]),O}()},"./src/loader/load-stats.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"LoadStats",function(){return Q});var Q=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(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return l});var Q=R("./src/polyfills/number.ts"),B=R("./node_modules/url-toolkit/src/url-toolkit.js"),_=R.n(B),G=R("./src/loader/fragment.ts"),j=R("./src/loader/level-details.ts"),O=R("./src/loader/level-key.ts"),M=R("./src/utils/attr-list.ts"),y=R("./src/utils/logger.ts"),T=R("./src/utils/codecs.ts"),k=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,D=/#EXT-X-MEDIA:(.*)/g,w=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),C=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("|")),h=/\.(mp4|m4s|m4v|m4a)$/i;function o(L){var E,m;return h.test((E=(m=B.parseURL(L))===null||m===void 0?void 0:m.path)!=null?E:"")}var l=function(){function L(){}return L.findGroup=function(m,c){for(var u=0;u<m.length;u++){var a=m[u];if(a.id===c)return a}},L.convertAVC1ToAVCOTI=function(m){var c=m.split(".");if(c.length>2){var u=c.shift()+".";return u+=parseInt(c.shift()).toString(16),u+=("000"+parseInt(c.shift()).toString(16)).substr(-4),u}return m},L.resolve=function(m,c){return B.buildAbsoluteURL(c,m,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(m,c){var u=[],a={},b=!1;k.lastIndex=0;for(var v;(v=k.exec(m))!=null;)if(v[1]){var x=new M.AttrList(v[1]),P={attrs:x,bitrate:x.decimalInteger("AVERAGE-BANDWIDTH")||x.decimalInteger("BANDWIDTH"),name:x.NAME,url:L.resolve(v[2],c)},H=x.decimalResolution("RESOLUTION");H&&(P.width=H.width,P.height=H.height),d((x.CODECS||"").split(/[ ,]+/).filter(function($){return $}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=L.convertAVC1ToAVCOTI(P.videoCodec)),u.push(P)}else if(v[3]){var V=new M.AttrList(v[3]);V["DATA-ID"]&&(b=!0,a[V["DATA-ID"]]=V)}return{levels:u,sessionData:b?a:null}},L.parseMasterPlaylistMedia=function(m,c,u,a){a===void 0&&(a=[]);var b,v=[],x=0;for(D.lastIndex=0;(b=D.exec(m))!==null;){var P=new M.AttrList(b[1]);if(P.TYPE===u){var H={attrs:P,bitrate:0,id:x++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:u,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?L.resolve(P.URI,c):""};if(a.length){var V=L.findGroup(a,H.groupId)||a[0];A(H,V,"audioCodec"),A(H,V,"textCodec")}v.push(H)}}return v},L.parseLevelPlaylist=function(m,c,u,a,b){var v=new j.LevelDetails(c),x=v.fragments,P=null,H=0,V=0,$=0,z=0,F=null,ee=new G.Fragment(a,c),oe,le,ve,Ie=-1,xe=!1;for(w.lastIndex=0,v.m3u8=m;(oe=w.exec(m))!==null;){xe&&(xe=!1,ee=new G.Fragment(a,c),ee.start=$,ee.sn=H,ee.cc=z,ee.level=u,P&&(ee.initSegment=P,ee.rawProgramDateTime=P.rawProgramDateTime));var Ce=oe[1];if(Ce){ee.duration=parseFloat(Ce);var Te=(" "+oe[2]).slice(1);ee.title=Te||null,ee.tagList.push(Te?["INF",Ce,Te]:["INF",Ce])}else if(oe[3])Object(Q.isFiniteNumber)(ee.duration)&&(ee.start=$,ve&&(ee.levelkey=ve),ee.sn=H,ee.level=u,ee.cc=z,ee.urlId=b,x.push(ee),ee.relurl=(" "+oe[3]).slice(1),g(ee,F),F=ee,$+=ee.duration,H++,V=0,xe=!0);else if(oe[4]){var Se=(" "+oe[4]).slice(1);F?ee.setByteRange(Se,F):ee.setByteRange(Se)}else if(oe[5])ee.rawProgramDateTime=(" "+oe[5]).slice(1),ee.tagList.push(["PROGRAM-DATE-TIME",ee.rawProgramDateTime]),Ie===-1&&(Ie=x.length);else{if(oe=oe[0].match(C),!oe){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(le=1;le<oe.length&&!(typeof oe[le]!="undefined");le++);var pe=(" "+oe[le]).slice(1),se=(" "+oe[le+1]).slice(1),De=oe[le+2]?(" "+oe[le+2]).slice(1):"";switch(pe){case"PLAYLIST-TYPE":v.type=se.toUpperCase();break;case"MEDIA-SEQUENCE":H=v.startSN=parseInt(se);break;case"SKIP":{var Ye=new M.AttrList(se),Ge=Ye.decimalInteger("SKIPPED-SEGMENTS");if(Object(Q.isFiniteNumber)(Ge)){v.skippedSegments=Ge;for(var $e=Ge;$e--;)x.unshift(null);H+=Ge}var et=Ye.enumeratedString("RECENTLY-REMOVED-DATERANGES");et&&(v.recentlyRemovedDateranges=et.split(" "));break}case"TARGETDURATION":v.targetduration=parseFloat(se);break;case"VERSION":v.version=parseInt(se);break;case"EXTM3U":break;case"ENDLIST":v.live=!1;break;case"#":(se||De)&&ee.tagList.push(De?[se,De]:[se]);break;case"DIS":z++;case"GAP":ee.tagList.push([pe]);break;case"BITRATE":ee.tagList.push([pe,se]);break;case"DISCONTINUITY-SEQ":z=parseInt(se);break;case"KEY":{var Re,Be=new M.AttrList(se),He=Be.enumeratedString("METHOD"),Xe=Be.URI,Ke=Be.hexadecimalInteger("IV"),Fe=Be.enumeratedString("KEYFORMATVERSIONS"),Pe=Be.enumeratedString("KEYID"),ot=(Re=Be.enumeratedString("KEYFORMAT"))!=null?Re:"identity",Je=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Je.indexOf(ot)>-1){y.logger.warn("Keyformat "+ot+" is not supported from the manifest");continue}else if(ot!=="identity")continue;He&&(ve=O.LevelKey.fromURL(c,Xe),Xe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(He)>=0&&(ve.method=He,ve.keyFormat=ot,Pe&&(ve.keyID=Pe),Fe&&(ve.keyFormatVersions=Fe),ve.iv=Ke));break}case"START":{var Ze=new M.AttrList(se),tt=Ze.decimalFloatingPoint("TIME-OFFSET");Object(Q.isFiniteNumber)(tt)&&(v.startTimeOffset=tt);break}case"MAP":{var ht=new M.AttrList(se);ee.relurl=ht.URI,ht.BYTERANGE&&ee.setByteRange(ht.BYTERANGE),ee.level=u,ee.sn="initSegment",ve&&(ee.levelkey=ve),ee.initSegment=null,P=ee,xe=!0;break}case"SERVER-CONTROL":{var rt=new M.AttrList(se);v.canBlockReload=rt.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=rt.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&rt.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=rt.optionalFloat("PART-HOLD-BACK",0),v.holdBack=rt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ve=new M.AttrList(se);v.partTarget=Ve.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ee=v.partList;Ee||(Ee=v.partList=[]);var it=V>0?Ee[Ee.length-1]:void 0,qe=V++,we=new G.Part(new M.AttrList(se),ee,c,qe,it);Ee.push(we),ee.duration+=we.duration;break}case"PRELOAD-HINT":{var We=new M.AttrList(se);v.preloadHint=We;break}case"RENDITION-REPORT":{var ge=new M.AttrList(se);v.renditionReports=v.renditionReports||[],v.renditionReports.push(ge);break}default:y.logger.warn("line parsed but not handled: "+oe);break}}}F&&!F.relurl?(x.pop(),$-=F.duration,v.partList&&(v.fragmentHint=F)):v.partList&&(g(ee,F),ee.cc=z,v.fragmentHint=ee);var de=x.length,fe=x[0],te=x[de-1];if($+=v.skippedSegments*v.targetduration,$>0&&de&&te){v.averagetargetduration=$/de;var re=te.sn;v.endSN=re!=="initSegment"?re:0,fe&&(v.startCC=fe.cc,fe.initSegment||v.fragments.every(function(ne){return ne.relurl&&o(ne.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),ee=new G.Fragment(a,c),ee.relurl=te.relurl,ee.level=u,ee.sn="initSegment",fe.initSegment=ee,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&($+=v.fragmentHint.duration),v.totalduration=$,v.endCC=z,Ie>0&&f(x,Ie),v},L}();function d(L,E){["video","audio","text"].forEach(function(m){var c=L.filter(function(a){return Object(T.isCodecType)(a,m)});if(c.length){var u=c.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});E[m+"Codec"]=u.length>0?u[0]:c[0],L=L.filter(function(a){return c.indexOf(a)===-1})}}),E.unknownCodecs=L}function A(L,E,m){var c=E[m];c&&(L[m]=c)}function f(L,E){for(var m=L[E],c=E;c--;){var u=L[c];if(!u)return;u.programDateTime=m.programDateTime-u.duration*1e3,m=u}}function g(L,E){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):E!=null&&E.programDateTime&&(L.programDateTime=E.endProgramDateTime),Object(Q.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/polyfills/number.ts"),B=R("./src/events.ts"),_=R("./src/errors.ts"),G=R("./src/utils/logger.ts"),j=R("./src/utils/mp4-tools.ts"),O=R("./src/loader/m3u8-parser.ts"),M=R("./src/types/loader.ts"),y=R("./src/utils/attr-list.ts");function T(w){var C=w.type;switch(C){case M.PlaylistContextType.AUDIO_TRACK:return M.PlaylistLevelType.AUDIO;case M.PlaylistContextType.SUBTITLE_TRACK:return M.PlaylistLevelType.SUBTITLE;default:return M.PlaylistLevelType.MAIN}}function k(w,C){var h=w.url;return(h===void 0||h.indexOf("data:")===0)&&(h=C.url),h}var D=function(){function w(h){this.hls=void 0,this.loaders=Object.create(null),this.hls=h,this.registerListeners()}var C=w.prototype;return C.registerListeners=function(){var o=this.hls;o.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},C.unregisterListeners=function(){var o=this.hls;o.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},C.createInternalLoader=function(o){var l=this.hls.config,d=l.pLoader,A=l.loader,f=d||A,g=new f(l);return o.loader=g,this.loaders[o.type]=g,g},C.getInternalLoader=function(o){return this.loaders[o.type]},C.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},C.destroyInternalLoaders=function(){for(var o in this.loaders){var l=this.loaders[o];l&&l.destroy(),this.resetInternalLoader(o)}},C.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},C.onManifestLoading=function(o,l){var d=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:M.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},C.onLevelLoading=function(o,l){var d=l.id,A=l.level,f=l.url,g=l.deliveryDirectives;this.load({id:d,groupId:null,level:A,responseType:"text",type:M.PlaylistContextType.LEVEL,url:f,deliveryDirectives:g})},C.onAudioTrackLoading=function(o,l){var d=l.id,A=l.groupId,f=l.url,g=l.deliveryDirectives;this.load({id:d,groupId:A,level:null,responseType:"text",type:M.PlaylistContextType.AUDIO_TRACK,url:f,deliveryDirectives:g})},C.onSubtitleTrackLoading=function(o,l){var d=l.id,A=l.groupId,f=l.url,g=l.deliveryDirectives;this.load({id:d,groupId:A,level:null,responseType:"text",type:M.PlaylistContextType.SUBTITLE_TRACK,url:f,deliveryDirectives:g})},C.load=function(o){var l,d=this.hls.config,A=this.getInternalLoader(o);if(A){var f=A.context;if(f&&f.url===o.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),A.abort()}var g,L,E,m;switch(o.type){case M.PlaylistContextType.MANIFEST:g=d.manifestLoadingMaxRetry,L=d.manifestLoadingTimeOut,E=d.manifestLoadingRetryDelay,m=d.manifestLoadingMaxRetryTimeout;break;case M.PlaylistContextType.LEVEL:case M.PlaylistContextType.AUDIO_TRACK:case M.PlaylistContextType.SUBTITLE_TRACK:g=0,L=d.levelLoadingTimeOut;break;default:g=d.levelLoadingMaxRetry,L=d.levelLoadingTimeOut,E=d.levelLoadingRetryDelay,m=d.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(o),(l=o.deliveryDirectives)!==null&&l!==void 0&&l.part){var c;if(o.type===M.PlaylistContextType.LEVEL&&o.level!==null?c=this.hls.levels[o.level].details:o.type===M.PlaylistContextType.AUDIO_TRACK&&o.id!==null?c=this.hls.audioTracks[o.id].details:o.type===M.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(c=this.hls.subtitleTracks[o.id].details),c){var u=c.partTarget,a=c.targetduration;u&&a&&(L=Math.min(Math.max(u*3,a*.8)*1e3,L))}}var b={timeout:L,maxRetry:g,retryDelay:E,maxRetryDelay:m,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(o,b,v)},C.loadsuccess=function(o,l,d,A){if(A===void 0&&(A=null),d.isSidxRequest){this.handleSidxRequest(o,d),this.handlePlaylistLoaded(o,l,d,A);return}this.resetInternalLoader(d.type);var f=o.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,d,"no EXTM3U delimiter",A);return}l.parsing.start=performance.now(),f.indexOf("#EXTINF:")>0||f.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,l,d,A):this.handleMasterPlaylist(o,l,d,A)},C.loaderror=function(o,l,d){d===void 0&&(d=null),this.handleNetworkError(l,d,!1,o)},C.loadtimeout=function(o,l,d){d===void 0&&(d=null),this.handleNetworkError(l,d,!0)},C.handleMasterPlaylist=function(o,l,d,A){var f=this.hls,g=o.data,L=k(o,d),E=O.default.parseMasterPlaylist(g,L),m=E.levels,c=E.sessionData;if(!m.length){this.handleManifestParsingError(o,d,"no level found in manifest",A);return}var u=m.map(function(H){return{id:H.attrs.AUDIO,audioCodec:H.audioCodec}}),a=m.map(function(H){return{id:H.attrs.SUBTITLES,textCodec:H.textCodec}}),b=O.default.parseMasterPlaylistMedia(g,L,"AUDIO",u),v=O.default.parseMasterPlaylistMedia(g,L,"SUBTITLES",a),x=O.default.parseMasterPlaylistMedia(g,L,"CLOSED-CAPTIONS");if(b.length){var P=b.some(function(H){return!H.url});!P&&m[0].audioCodec&&!m[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),b.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}f.trigger(B.Events.MANIFEST_LOADED,{levels:m,audioTracks:b,subtitles:v,captions:x,url:L,stats:l,networkDetails:A,sessionData:c})},C.handleTrackOrLevelPlaylist=function(o,l,d,A){var f=this.hls,g=d.id,L=d.level,E=d.type,m=k(o,d),c=Object(Q.isFiniteNumber)(g)?g:0,u=Object(Q.isFiniteNumber)(L)?L:c,a=T(d),b=O.default.parseLevelPlaylist(o.data,m,u,a,c);if(!b.fragments.length){f.trigger(B.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(E===M.PlaylistContextType.MANIFEST){var v={attrs:new y.AttrList({}),bitrate:0,details:b,name:"",url:m};f.trigger(B.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:m,stats:l,networkDetails:A,sessionData:null})}if(l.parsing.end=performance.now(),b.needSidxRanges){var x,P=(x=b.fragments[0].initSegment)===null||x===void 0?void 0:x.url;this.load({url:P,isSidxRequest:!0,type:E,level:L,levelDetails:b,id:g,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=b,this.handlePlaylistLoaded(o,l,d,A)},C.handleSidxRequest=function(o,l){var d=Object(j.parseSegmentIndex)(new Uint8Array(o.data));if(!d)return;var A=d.references,f=l.levelDetails;A.forEach(function(g,L){var E=g.info,m=f.fragments[L];m.byteRange.length===0&&m.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),m.initSegment&&m.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},C.handleManifestParsingError=function(o,l,d,A){this.hls.trigger(B.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===M.PlaylistContextType.MANIFEST,url:o.url,reason:d,response:o,context:l,networkDetails:A})},C.handleNetworkError=function(o,l,d,A){d===void 0&&(d=!1),G.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var f=_.ErrorDetails.UNKNOWN,g=!1,L=this.getInternalLoader(o);switch(o.type){case M.PlaylistContextType.MANIFEST:f=d?_.ErrorDetails.MANIFEST_LOAD_TIMEOUT:_.ErrorDetails.MANIFEST_LOAD_ERROR,g=!0;break;case M.PlaylistContextType.LEVEL:f=d?_.ErrorDetails.LEVEL_LOAD_TIMEOUT:_.ErrorDetails.LEVEL_LOAD_ERROR,g=!1;break;case M.PlaylistContextType.AUDIO_TRACK:f=d?_.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case M.PlaylistContextType.SUBTITLE_TRACK:f=d?_.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:_.ErrorDetails.SUBTITLE_LOAD_ERROR,g=!1;break}L&&this.resetInternalLoader(o.type);var E={type:_.ErrorTypes.NETWORK_ERROR,details:f,fatal:g,url:o.url,loader:L,context:o,networkDetails:l};A&&(E.response=A),this.hls.trigger(B.Events.ERROR,E)},C.handlePlaylistLoaded=function(o,l,d,A){var f=d.type,g=d.level,L=d.id,E=d.groupId,m=d.loader,c=d.levelDetails,u=d.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(o,d,"invalid target duration",A);return}if(!m)return;c.live&&(m.getCacheAge&&(c.ageHeader=m.getCacheAge()||0),(!m.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(f){case M.PlaylistContextType.MANIFEST:case M.PlaylistContextType.LEVEL:this.hls.trigger(B.Events.LEVEL_LOADED,{details:c,level:g||0,id:L||0,stats:l,networkDetails:A,deliveryDirectives:u});break;case M.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,{details:c,id:L||0,groupId:E||"",stats:l,networkDetails:A,deliveryDirectives:u});break;case M.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADED,{details:c,id:L||0,groupId:E||"",stats:l,networkDetails:A,deliveryDirectives:u});break}},w}();X.default=D},"./src/polyfills/number.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"isFiniteNumber",function(){return Q}),R.d(X,"MAX_SAFE_INTEGER",function(){return B});var Q=Number.isFinite||function(_){return typeof _=="number"&&isFinite(_)},B=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,X,R){"use strict";R.r(X);var Q=function(){function B(){}return B.getSilentFrame=function(G,j){switch(G){case"mp4a.40.2":if(j===1)return new Uint8Array([0,200,0,128,35,128]);if(j===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(j===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(j===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(j===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(j===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(j===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(j===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(j===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},B}();X.default=Q},"./src/remux/mp4-generator.ts":function(ie,X,R){"use strict";R.r(X);var Q=Math.pow(2,32)-1,B=function(){function _(){}return _.init=function(){_.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 j;for(j in _.types)_.types.hasOwnProperty(j)&&(_.types[j]=[j.charCodeAt(0),j.charCodeAt(1),j.charCodeAt(2),j.charCodeAt(3)]);var O=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]),M=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]);_.HDLR_TYPES={video:O,audio:M};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),T=new Uint8Array([0,0,0,0,0,0,0,0]);_.STTS=_.STSC=_.STCO=T,_.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),_.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),_.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var k=new Uint8Array([105,115,111,109]),D=new Uint8Array([97,118,99,49]),w=new Uint8Array([0,0,0,1]);_.FTYP=_.box(_.types.ftyp,k,w,k,D),_.DINF=_.box(_.types.dinf,_.box(_.types.dref,y))},_.box=function(j){for(var O=8,M=arguments.length,y=new Array(M>1?M-1:0),T=1;T<M;T++)y[T-1]=arguments[T];for(var k=y.length,D=k;k--;)O+=y[k].byteLength;var w=new Uint8Array(O);for(w[0]=O>>24&255,w[1]=O>>16&255,w[2]=O>>8&255,w[3]=O&255,w.set(j,4),k=0,O=8;k<D;k++)w.set(y[k],O),O+=y[k].byteLength;return w},_.hdlr=function(j){return _.box(_.types.hdlr,_.HDLR_TYPES[j])},_.mdat=function(j){return _.box(_.types.mdat,j)},_.mdhd=function(j,O){O*=j;var M=Math.floor(O/(Q+1)),y=Math.floor(O%(Q+1));return _.box(_.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,j>>24&255,j>>16&255,j>>8&255,j&255,M>>24,M>>16&255,M>>8&255,M&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},_.mdia=function(j){return _.box(_.types.mdia,_.mdhd(j.timescale,j.duration),_.hdlr(j.type),_.minf(j))},_.mfhd=function(j){return _.box(_.types.mfhd,new Uint8Array([0,0,0,0,j>>24,j>>16&255,j>>8&255,j&255]))},_.minf=function(j){return j.type==="audio"?_.box(_.types.minf,_.box(_.types.smhd,_.SMHD),_.DINF,_.stbl(j)):_.box(_.types.minf,_.box(_.types.vmhd,_.VMHD),_.DINF,_.stbl(j))},_.moof=function(j,O,M){return _.box(_.types.moof,_.mfhd(j),_.traf(M,O))},_.moov=function(j){for(var O=j.length,M=[];O--;)M[O]=_.trak(j[O]);return _.box.apply(null,[_.types.moov,_.mvhd(j[0].timescale,j[0].duration)].concat(M).concat(_.mvex(j)))},_.mvex=function(j){for(var O=j.length,M=[];O--;)M[O]=_.trex(j[O]);return _.box.apply(null,[_.types.mvex].concat(M))},_.mvhd=function(j,O){O*=j;var M=Math.floor(O/(Q+1)),y=Math.floor(O%(Q+1)),T=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,j>>24&255,j>>16&255,j>>8&255,j&255,M>>24,M>>16&255,M>>8&255,M&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 _.box(_.types.mvhd,T)},_.sdtp=function(j){var O=j.samples||[],M=new Uint8Array(4+O.length),y,T;for(y=0;y<O.length;y++)T=O[y].flags,M[y+4]=T.dependsOn<<4|T.isDependedOn<<2|T.hasRedundancy;return _.box(_.types.sdtp,M)},_.stbl=function(j){return _.box(_.types.stbl,_.stsd(j),_.box(_.types.stts,_.STTS),_.box(_.types.stsc,_.STSC),_.box(_.types.stsz,_.STSZ),_.box(_.types.stco,_.STCO))},_.avc1=function(j){var O=[],M=[],y,T,k;for(y=0;y<j.sps.length;y++)T=j.sps[y],k=T.byteLength,O.push(k>>>8&255),O.push(k&255),O=O.concat(Array.prototype.slice.call(T));for(y=0;y<j.pps.length;y++)T=j.pps[y],k=T.byteLength,M.push(k>>>8&255),M.push(k&255),M=M.concat(Array.prototype.slice.call(T));var D=_.box(_.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|j.sps.length].concat(O).concat([j.pps.length]).concat(M))),w=j.width,C=j.height,h=j.pixelRatio[0],o=j.pixelRatio[1];return _.box(_.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,w>>8&255,w&255,C>>8&255,C&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),D,_.box(_.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),_.box(_.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,o>>24,o>>16&255,o>>8&255,o&255])))},_.esds=function(j){var O=j.config.length;return new Uint8Array([0,0,0,0,3,23+O,0,1,0,4,15+O,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([O]).concat(j.config).concat([6,1,2]))},_.mp4a=function(j){var O=j.samplerate;return _.box(_.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),_.box(_.types.esds,_.esds(j)))},_.mp3=function(j){var O=j.samplerate;return _.box(_.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},_.stsd=function(j){return j.type==="audio"?!j.isAAC&&j.codec==="mp3"?_.box(_.types.stsd,_.STSD,_.mp3(j)):_.box(_.types.stsd,_.STSD,_.mp4a(j)):_.box(_.types.stsd,_.STSD,_.avc1(j))},_.tkhd=function(j){var O=j.id,M=j.duration*j.timescale,y=j.width,T=j.height,k=Math.floor(M/(Q+1)),D=Math.floor(M%(Q+1));return _.box(_.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,D>>24,D>>16&255,D>>8&255,D&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,T>>8&255,T&255,0,0]))},_.traf=function(j,O){var M=_.sdtp(j),y=j.id,T=Math.floor(O/(Q+1)),k=Math.floor(O%(Q+1));return _.box(_.types.traf,_.box(_.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),_.box(_.types.tfdt,new Uint8Array([1,0,0,0,T>>24,T>>16&255,T>>8&255,T&255,k>>24,k>>16&255,k>>8&255,k&255])),_.trun(j,M.length+16+20+8+16+8+8),M)},_.trak=function(j){return j.duration=j.duration||4294967295,_.box(_.types.trak,_.tkhd(j),_.mdia(j))},_.trex=function(j){var O=j.id;return _.box(_.types.trex,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},_.trun=function(j,O){var M=j.samples||[],y=M.length,T=12+16*y,k=new Uint8Array(T),D,w,C,h,o,l;for(O+=8+T,k.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),D=0;D<y;D++)w=M[D],C=w.duration,h=w.size,o=w.flags,l=w.cts,k.set([C>>>24&255,C>>>16&255,C>>>8&255,C&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*D);return _.box(_.types.trun,k)},_.initSegment=function(j){_.types||_.init();var O=_.moov(j),M=new Uint8Array(_.FTYP.byteLength+O.byteLength);return M.set(_.FTYP),M.set(O,_.FTYP.byteLength),M},_}();B.types=void 0,B.HDLR_TYPES=void 0,B.STTS=void 0,B.STSC=void 0,B.STCO=void 0,B.STSZ=void 0,B.VMHD=void 0,B.SMHD=void 0,B.STSD=void 0,B.FTYP=void 0,B.DINF=void 0,X.default=B},"./src/remux/mp4-remuxer.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return l}),R.d(X,"normalizePts",function(){return d});var Q=R("./src/polyfills/number.ts"),B=R("./src/remux/aac-helper.ts"),_=R("./src/remux/mp4-generator.ts"),G=R("./src/events.ts"),j=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),M=R("./src/types/loader.ts"),y=R("./src/utils/timescale-conversion.ts");function T(){return T=Object.assign||function(L){for(var E=1;E<arguments.length;E++){var m=arguments[E];for(var c in m)Object.prototype.hasOwnProperty.call(m,c)&&(L[c]=m[c])}return L},T.apply(this,arguments)}var k=10*1e3,D=1024,w=1152,C=null,h=null,o=!1,l=function(){function L(m,c,u,a){if(a===void 0&&(a=""),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=m,this.config=c,this.typeSupported=u,this.ISGenerated=!1,C===null){var b=navigator.userAgent||"",v=b.match(/Chrome\/(\d+)/i);C=v?parseInt(v[1]):0}if(h===null){var x=navigator.userAgent.match(/Safari\/(\d+)/i);h=x?parseInt(x[1]):0}o=!!C&&C<75||!!h&&h<600}var E=L.prototype;return E.destroy=function(){},E.resetTimeStamp=function(c){O.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=c},E.resetNextTimestamp=function(){O.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},E.resetInitSegment=function(){O.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},E.getVideoStartPts=function(c){var u=!1,a=c.reduce(function(b,v){var x=v.pts-b;return x<-4294967296?(u=!0,d(b,v.pts)):x>0?b:v.pts},c[0].pts);return u&&O.logger.debug("PTS rollover detected"),a},E.remux=function(c,u,a,b,v,x,P,H){var V,$,z,F,ee,oe,le=v,ve=v,Ie=c.pid>-1,xe=u.pid>-1,Ce=u.samples.length,Te=c.samples.length>0,Se=Ce>1,pe=(!Ie||Te)&&(!xe||Se)||this.ISGenerated||P;if(pe){this.ISGenerated||(z=this.generateIS(c,u,v));var se=this.isVideoContiguous,De=-1;if(Se&&(De=A(u.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if(oe=!0,De>0){O.logger.warn("[mp4-remuxer]: Dropped "+De+" out of "+Ce+" video samples due to a missing keyframe");var Ye=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(De),u.dropped+=De,ve+=(u.samples[0].pts-Ye)/(u.timescale||9e4)}else De===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ce+" video samples"),oe=!1);if(this.ISGenerated){if(Te&&Se){var Ge=this.getVideoStartPts(u.samples),$e=d(c.samples[0].pts,Ge)-Ge,et=$e/u.inputTimeScale;le+=Math.max(0,et),ve+=Math.max(0,-et)}if(Te){if(c.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),z=this.generateIS(c,u,v)),$=this.remuxAudio(c,le,this.isAudioContiguous,x,xe||Se||H===M.PlaylistLevelType.AUDIO?ve:void 0),Se){var Re=$?$.endPTS-$.startPTS:0;u.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),z=this.generateIS(c,u,v)),V=this.remuxVideo(u,ve,se,Re)}}else Se&&(V=this.remuxVideo(u,ve,se,0));V&&(V.firstKeyFrame=De,V.independent=De!==-1)}}return this.ISGenerated&&(a.samples.length&&(ee=this.remuxID3(a,v)),b.samples.length&&(F=this.remuxText(b,v))),{audio:$,video:V,initSegment:z,independent:oe,text:F,id3:ee}},E.generateIS=function(c,u,a){var b=c.samples,v=u.samples,x=this.typeSupported,P={},H=!Object(Q.isFiniteNumber)(this._initPTS),V="audio/mp4",$,z,F;if(H&&($=z=Infinity),c.config&&b.length&&(c.timescale=c.samplerate,c.isAAC||(x.mpeg?(V="audio/mpeg",c.codec=""):x.mp3&&(c.codec="mp3")),P.audio={id:"audio",container:V,codec:c.codec,initSegment:!c.isAAC&&x.mpeg?new Uint8Array(0):_.default.initSegment([c]),metadata:{channelCount:c.channelCount}},H&&(F=c.inputTimeScale,$=z=b[0].pts-Math.round(F*a))),u.sps&&u.pps&&v.length&&(u.timescale=u.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:_.default.initSegment([u]),metadata:{width:u.width,height:u.height}},H)){F=u.inputTimeScale;var ee=this.getVideoStartPts(v),oe=Math.round(F*a);z=Math.min(z,d(v[0].dts,ee)-oe),$=Math.min($,ee-oe)}if(Object.keys(P).length)return this.ISGenerated=!0,H&&(this._initPTS=$,this._initDTS=z),{tracks:P,initPTS:$,timescale:F}},E.remuxVideo=function(c,u,a,b){var v=c.inputTimeScale,x=c.samples,P=[],H=x.length,V=this._initPTS,$=this.nextAvcDts,z=8,F,ee,oe,le=Number.POSITIVE_INFINITY,ve=Number.NEGATIVE_INFINITY,Ie=0,xe=!1;if(!a||$===null){var Ce=u*v,Te=x[0].pts-d(x[0].dts,x[0].pts);$=Ce-Te}for(var Se=0;Se<H;Se++){var pe=x[Se];if(pe.pts=d(pe.pts-V,$),pe.dts=d(pe.dts-V,$),pe.dts>pe.pts){var se=9e4*.2;Ie=Math.max(Math.min(Ie,pe.pts-pe.dts),-1*se)}pe.dts<x[Se>0?Se-1:Se].dts&&(xe=!0)}xe&&x.sort(function(Tt,St){var dt=Tt.dts-St.dts,Ut=Tt.pts-St.pts;return dt||Ut}),ee=x[0].dts,oe=x[x.length-1].dts;var De=Math.round((oe-ee)/(H-1));if(Ie<0){if(Ie<De*-2){O.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-De,!0)+" ms");for(var Ye=Ie,Ge=0;Ge<H;Ge++)x[Ge].dts=Ye=Math.max(Ye,x[Ge].pts-De),x[Ge].pts=Math.max(Ye,x[Ge].pts)}else{O.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(Ie,!0)+" ms to overcome this issue");for(var $e=0;$e<H;$e++)x[$e].dts=x[$e].dts+Ie}ee=x[0].dts}if(a){var et=ee-$,Re=et>De,Be=et<-1;if(Re||Be){Re?O.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(et,!0)+" ms ("+et+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-et,!0)+" ms ("+et+"dts) overlapping between fragments detected"),ee=$;var He=x[0].pts-et;x[0].dts=ee,x[0].pts=He,O.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(He,!0)+"/"+Object(y.toMsFromMpegTsClock)(ee,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(et,!0)+" ms")}}o&&(ee=Math.max(0,ee));for(var Xe=0,Ke=0,Fe=0;Fe<H;Fe++){for(var Pe=x[Fe],ot=Pe.units,Je=ot.length,Ze=0,tt=0;tt<Je;tt++)Ze+=ot[tt].data.length;Ke+=Ze,Xe+=Je,Pe.length=Ze,Pe.dts=Math.max(Pe.dts,ee),Pe.pts=Math.max(Pe.pts,Pe.dts,0),le=Math.min(Pe.pts,le),ve=Math.max(Pe.pts,ve)}oe=x[H-1].dts;var ht=Ke+4*Xe+8,rt;try{rt=new Uint8Array(ht)}catch(Tt){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:j.ErrorTypes.MUX_ERROR,details:j.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ht,reason:"fail allocating video mdat "+ht});return}var Ve=new DataView(rt.buffer);Ve.setUint32(0,ht),rt.set(_.default.types.mdat,4);for(var Ee=0;Ee<H;Ee++){for(var it=x[Ee],qe=it.units,we=0,We=0,ge=qe.length;We<ge;We++){var de=qe[We],fe=de.data,te=de.data.byteLength;Ve.setUint32(z,te),z+=4,rt.set(fe,z),z+=te,we+=4+te}if(Ee<H-1)F=x[Ee+1].dts-it.dts;else{var re=this.config,ne=it.dts-x[Ee>0?Ee-1:Ee].dts;if(re.stretchShortVideoTrack&&this.nextAudioPts!==null){var he=Math.floor(re.maxBufferHole*v),me=(b?le+b*v:this.nextAudioPts)-it.pts;me>he?(F=me-ne,F<0&&(F=ne),O.logger.log("[mp4-remuxer]: It is approximately "+me/90+" ms to the next segment; using duration "+F/90+" ms for the last video frame.")):F=ne}else F=ne}var Ae=Math.round(it.pts-it.dts);P.push(new f(it.key,F,we,Ae))}if(P.length&&C&&C<70){var _e=P[0].flags;_e.dependsOn=2,_e.isNonSync=0}console.assert(F!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=$=oe+F,this.isVideoContiguous=!0;var st=_.default.moof(c.sequenceNumber++,ee,T({},c,{samples:P})),gt="video",pt={data1:st,data2:rt,startPTS:le/v,endPTS:(ve+F)/v,startDTS:ee/v,endDTS:$/v,type:gt,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(rt.length,"MDAT length must not be zero"),pt},E.remuxAudio=function(c,u,a,b,v){var x=c.inputTimeScale,P=c.samplerate?c.samplerate:x,H=x/P,V=c.isAAC?D:w,$=V*H,z=this._initPTS,F=!c.isAAC&&this.typeSupported.mpeg,ee=[],oe=c.samples,le=F?0:8,ve=this.nextAudioPts||-1,Ie=u*x;if(this.isAudioContiguous=a=a||oe.length&&ve>0&&(b&&Math.abs(Ie-ve)<9e3||Math.abs(d(oe[0].pts-z,Ie)-ve)<20*$),oe.forEach(function(fe){fe.pts=d(fe.pts-z,Ie)}),!a||ve<0){if(oe=oe.filter(function(fe){return fe.pts>=0}),!oe.length)return;v===0?ve=0:b?ve=Math.max(0,Ie):ve=oe[0].pts}if(c.isAAC)for(var xe=v!==void 0,Ce=this.config.maxAudioFramesDrift,Te=0,Se=ve;Te<oe.length;Te++){var pe=oe[Te],se=pe.pts,De=se-Se,Ye=Math.abs(1e3*De/x);if(De<=-Ce*$&&xe)Te===0&&(O.logger.warn("Audio frame @ "+(se/x).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*De/x)+" ms."),this.nextAudioPts=ve=Se=se);else if(De>=Ce*$&&Ye<k&&xe){var Ge=Math.round(De/$);Se=se-Ge*$,Se<0&&(Ge--,Se+=$),Te===0&&(this.nextAudioPts=ve=Se),O.logger.warn("[mp4-remuxer]: Injecting "+Ge+" audio frame @ "+(Se/x).toFixed(3)+"s due to "+Math.round(1e3*De/x)+" ms gap.");for(var $e=0;$e<Ge;$e++){var et=Math.max(Se,0),Re=B.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);Re||(O.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Re=pe.unit.subarray()),oe.splice(Te,0,{unit:Re,pts:et}),Se+=$,Te++}}pe.pts=Se,Se+=$}for(var Be=null,He=null,Xe,Ke=0,Fe=oe.length;Fe--;)Ke+=oe[Fe].unit.byteLength;for(var Pe=0,ot=oe.length;Pe<ot;Pe++){var Je=oe[Pe],Ze=Je.unit,tt=Je.pts;if(He!==null){var ht=ee[Pe-1];ht.duration=Math.round((tt-He)/H)}else if(a&&c.isAAC&&(tt=ve),Be=tt,Ke>0){Ke+=le;try{Xe=new Uint8Array(Ke)}catch(fe){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:j.ErrorTypes.MUX_ERROR,details:j.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ke,reason:"fail allocating audio mdat "+Ke});return}if(!F){var rt=new DataView(Xe.buffer);rt.setUint32(0,Ke),Xe.set(_.default.types.mdat,4)}}else return;Xe.set(Ze,le);var Ve=Ze.byteLength;le+=Ve,ee.push(new f(!0,V,Ve,0)),He=tt}var Ee=ee.length;if(!Ee)return;var it=ee[ee.length-1];this.nextAudioPts=ve=He+H*it.duration;var qe=F?new Uint8Array(0):_.default.moof(c.sequenceNumber++,Be/H,T({},c,{samples:ee}));c.samples=[];var we=Be/x,We=ve/x,ge="audio",de={data1:qe,data2:Xe,startPTS:we,endPTS:We,startDTS:we,endDTS:We,type:ge,hasAudio:!0,hasVideo:!1,nb:Ee};return this.isAudioContiguous=!0,console.assert(Xe.length,"MDAT length must not be zero"),de},E.remuxEmptyAudio=function(c,u,a,b){var v=c.inputTimeScale,x=c.samplerate?c.samplerate:v,P=v/x,H=this.nextAudioPts,V=(H!==null?H:b.startDTS*v)+this._initDTS,$=b.endDTS*v+this._initDTS,z=P*D,F=Math.ceil(($-V)/z),ee=B.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!ee){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var oe=[],le=0;le<F;le++){var ve=V+le*z;oe.push({unit:ee,pts:ve,dts:ve})}return c.samples=oe,this.remuxAudio(c,u,a,!1)},E.remuxID3=function(c,u){var a=c.samples.length;if(!a)return;for(var b=c.inputTimeScale,v=this._initPTS,x=this._initDTS,P=0;P<a;P++){var H=c.samples[P];H.pts=d(H.pts-v,u*b)/b,H.dts=d(H.dts-x,u*b)/b}var V=c.samples;return c.samples=[],{samples:V}},E.remuxText=function(c,u){var a=c.samples.length;if(!a)return;for(var b=c.inputTimeScale,v=this._initPTS,x=0;x<a;x++){var P=c.samples[x];P.pts=d(P.pts-v,u*b)/b}c.samples.sort(function(V,$){return V.pts-$.pts});var H=c.samples;return c.samples=[],{samples:H}},L}();function d(L,E){var m;if(E===null)return L;for(E<L?m=-8589934592:m=8589934592;Math.abs(L-E)>4294967296;)L+=m;return L}function A(L){for(var E=0;E<L.length;E++)if(L[E].key)return E;return-1}var f=function(E,m,c,u){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=m,this.size=c,this.cts=u,this.flags=new g(E)},g=function(E){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=E?2:1,this.isNonSync=E?0:1}},"./src/remux/passthrough-remuxer.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/mp4-tools.ts"),_=R("./src/loader/fragment.ts"),G=R("./src/utils/logger.ts"),j=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 T=y.prototype;return T.destroy=function(){},T.resetTimeStamp=function(D){this.initPTS=D,this.lastEndDTS=null},T.resetNextTimestamp=function(){this.lastEndDTS=null},T.resetInitSegment=function(D,w,C){this.audioCodec=w,this.videoCodec=C,this.generateInitSegment(D),this.emitInitSegment=!0},T.generateInitSegment=function(D){var w=this.audioCodec,C=this.videoCodec;if(!D||!D.byteLength){this.initTracks=void 0,this.initData=void 0;return}var h=this.initData=Object(B.parseInitSegment)(D);w||(w=M(h.audio,_.ElementaryStreamTypes.AUDIO)),C||(C=M(h.video,_.ElementaryStreamTypes.VIDEO));var o={};h.audio&&h.video?o.audiovideo={container:"video/mp4",codec:w+","+C,initSegment:D,id:"main"}:h.audio?o.audio={container:"audio/mp4",codec:w,initSegment:D,id:"audio"}:h.video?o.video={container:"video/mp4",codec:C,initSegment:D,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},T.remux=function(D,w,C,h,o){var l=this.initPTS,d=this.lastEndDTS,A={audio:void 0,video:void 0,text:h,id3:C,initSegment:void 0};Object(Q.isFiniteNumber)(d)||(d=this.lastEndDTS=o||0);var f=w.samples;if(!f||!f.length)return A;var g={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(f),L=this.initData),!L||!L.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(g.tracks=this.initTracks,this.emitInitSegment=!1),Object(Q.isFiniteNumber)(l)||(this.initPTS=g.initPTS=l=O(L,f,d));var E=Object(B.getDuration)(f,L),m=d,c=E+m;Object(B.offsetStartDTS)(L,f,l),E>0?this.lastEndDTS=c:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!L.audio,a=!!L.video,b="";u&&(b+="audio"),a&&(b+="video");var v={data1:f,startPTS:m,startDTS:m,endPTS:c,endDTS:c,type:b,hasAudio:u,hasVideo:a,nb:1,dropped:0};return A.audio=v.type==="audio"?v:void 0,A.video=v.type!=="audio"?v:void 0,A.text=h,A.id3=C,A.initSegment=g,A},y}(),O=function(T,k,D){return Object(B.getStartDTS)(T,k)-D};function M(y,T){var k=y==null?void 0:y.codec;return k&&k.length>4?k:k==="hvc1"?"hvc1.1.c.L120.90":k==="av01"?"av01.0.04M.08":k==="avc1"||T===_.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}X.default=j},"./src/task-loop.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return Q});var Q=function(){function B(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var _=B.prototype;return _.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},_.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},_.onHandlerDestroyed=function(){},_.hasInterval=function(){return!!this._tickInterval},_.hasNextTick=function(){return!!this._tickTimer},_.setInterval=function(j){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,j),!0)},_.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},_.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},_.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},_.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},_.doTick=function(){},B}()},"./src/types/cmcd.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"CMCDVersion",function(){return Q}),R.d(X,"CMCDObjectType",function(){return B}),R.d(X,"CMCDStreamingFormat",function(){return _}),R.d(X,"CMCDStreamType",function(){return G});var Q=1,B;(function(j){j.MANIFEST="m",j.AUDIO="a",j.VIDEO="v",j.MUXED="av",j.INIT="i",j.CAPTION="c",j.TIMED_TEXT="tt",j.KEY="k",j.OTHER="o"})(B||(B={}));var _;(function(j){j.DASH="d",j.HLS="h",j.SMOOTH="s",j.OTHER="o"})(_||(_={}));var G;(function(j){j.VOD="v",j.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"HlsSkip",function(){return _}),R.d(X,"getSkipValue",function(){return G}),R.d(X,"HlsUrlParameters",function(){return j}),R.d(X,"Level",function(){return O});function Q(M,y){for(var T=0;T<y.length;T++){var k=y[T];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(M,k.key,k)}}function B(M,y,T){return y&&Q(M.prototype,y),T&&Q(M,T),M}var _;(function(M){M.No="",M.Yes="YES",M.v2="v2"})(_||(_={}));function G(M,y){var T=M.canSkipUntil,k=M.canSkipDateRanges,D=M.endSN,w=y!==void 0?y-D:0;return T&&w<T?k?_.v2:_.Yes:_.No}var j=function(){function M(T,k,D){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=T,this.part=k,this.skip=D}var y=M.prototype;return y.addDirectives=function(k){var D=new self.URL(k);return this.msn!==void 0&&D.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&D.searchParams.set("_HLS_part",this.part.toString()),this.skip&&D.searchParams.set("_HLS_skip",this.skip),D.toString()},M}(),O=function(){function M(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(T){return T}).join(",").replace(/\.[^.,]+/g,"")}return B(M,[{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(T){var k=T%this.url.length;this._urlId!==k&&(this.details=void 0,this._urlId=k)}}]),M}()},"./src/types/loader.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"PlaylistContextType",function(){return Q}),R.d(X,"PlaylistLevelType",function(){return B});var Q;(function(_){_.MANIFEST="manifest",_.LEVEL="level",_.AUDIO_TRACK="audioTrack",_.SUBTITLE_TRACK="subtitleTrack"})(Q||(Q={}));var B;(function(_){_.MAIN="main",_.AUDIO="audio",_.SUBTITLE="subtitle"})(B||(B={}))},"./src/types/transmuxer.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"ChunkMetadata",function(){return Q});var Q=function(G,j,O,M,y,T){M===void 0&&(M=0),y===void 0&&(y=-1),T===void 0&&(T=!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=B(),this.buffering={audio:B(),video:B(),audiovideo:B()},this.level=G,this.sn=j,this.id=O,this.size=M,this.part=y,this.partial=T};function B(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"AttrList",function(){return _});var Q=/^(\d+)x(\d+)$/,B=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,_=function(){function G(O){typeof O=="string"&&(O=G.parseAttrList(O));for(var M in O)O.hasOwnProperty(M)&&(this[M]=O[M])}var j=G.prototype;return j.decimalInteger=function(M){var y=parseInt(this[M],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},j.hexadecimalInteger=function(M){if(this[M]){var y=(this[M]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var T=new Uint8Array(y.length/2),k=0;k<y.length/2;k++)T[k]=parseInt(y.slice(k*2,k*2+2),16);return T}else return null},j.hexadecimalIntegerAsNumber=function(M){var y=parseInt(this[M],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},j.decimalFloatingPoint=function(M){return parseFloat(this[M])},j.optionalFloat=function(M,y){var T=this[M];return T?parseFloat(T):y},j.enumeratedString=function(M){return this[M]},j.bool=function(M){return this[M]==="YES"},j.decimalResolution=function(M){var y=Q.exec(this[M]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},G.parseAttrList=function(M){var y,T={},k='"';for(B.lastIndex=0;(y=B.exec(M))!==null;){var D=y[2];D.indexOf(k)===0&&D.lastIndexOf(k)===D.length-1&&(D=D.slice(1,-1)),T[y[1]]=D}return T},G}()},"./src/utils/binary-search.ts":function(ie,X,R){"use strict";R.r(X);var Q={search:function(_,G){for(var j=0,O=_.length-1,M=null,y=null;j<=O;){M=(j+O)/2|0,y=_[M];var T=G(y);if(T>0)j=M+1;else if(T<0)O=M-1;else return y}return null}};X.default=Q},"./src/utils/buffer-helper.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"BufferHelper",function(){return _});var Q=R("./src/utils/logger.ts"),B={length:0,start:function(){return 0},end:function(){return 0}},_=function(){function G(){}return G.isBuffered=function(O,M){try{if(O){for(var y=G.getBuffered(O),T=0;T<y.length;T++)if(M>=y.start(T)&&M<=y.end(T))return!0}}catch(k){}return!1},G.bufferInfo=function(O,M,y){try{if(O){var T=G.getBuffered(O),k=[],D;for(D=0;D<T.length;D++)k.push({start:T.start(D),end:T.end(D)});return this.bufferedInfo(k,M,y)}}catch(w){}return{len:0,start:M,end:M,nextStart:void 0}},G.bufferedInfo=function(O,M,y){M=Math.max(0,M),O.sort(function(g,L){var E=g.start-L.start;return E||L.end-g.end});var T=[];if(y)for(var k=0;k<O.length;k++){var D=T.length;if(D){var w=T[D-1].end;O[k].start-w<y?O[k].end>w&&(T[D-1].end=O[k].end):T.push(O[k])}else T.push(O[k])}else T=O;for(var C=0,h,o=M,l=M,d=0;d<T.length;d++){var A=T[d].start,f=T[d].end;if(M+y>=A&&M<f)o=A,l=f,C=l-M;else if(M+y<A){h=A;break}}return{len:C,start:o||0,end:l||0,nextStart:h}},G.getBuffered=function(O){try{return O.buffered}catch(M){return Q.logger.log("failed to get media.buffered",M),B}},G}()},"./src/utils/cea-608-parser.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"Row",function(){return l}),R.d(X,"CaptionScreen",function(){return d});var Q=R("./src/utils/logger.ts"),B={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},_=function(c){var u=c;return B.hasOwnProperty(c)&&(u=B[c]),String.fromCharCode(u)},G=15,j=100,O={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},M={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},T={25:2,26:4,29:6,30:8,31:10,27:13,28:15},k=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],D;(function(m){m[m.ERROR=0]="ERROR",m[m.TEXT=1]="TEXT",m[m.WARNING=2]="WARNING",m[m.INFO=2]="INFO",m[m.DEBUG=3]="DEBUG",m[m.DATA=3]="DATA"})(D||(D={}));var w=function(){function m(){this.time=null,this.verboseLevel=D.ERROR}var c=m.prototype;return c.log=function(a,b){this.verboseLevel>=a&&Q.logger.log(this.time+" ["+a+"] "+b)},m}(),C=function(c){for(var u=[],a=0;a<c.length;a++)u.push(c[a].toString(16));return u},h=function(){function m(u,a,b,v,x){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=u||"white",this.underline=a||!1,this.italics=b||!1,this.background=v||"black",this.flash=x||!1}var c=m.prototype;return c.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},c.setStyles=function(a){for(var b=["foreground","underline","italics","background","flash"],v=0;v<b.length;v++){var x=b[v];a.hasOwnProperty(x)&&(this[x]=a[x])}},c.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},c.equals=function(a){return this.foreground===a.foreground&&this.underline===a.underline&&this.italics===a.italics&&this.background===a.background&&this.flash===a.flash},c.copy=function(a){this.foreground=a.foreground,this.underline=a.underline,this.italics=a.italics,this.background=a.background,this.flash=a.flash},c.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},m}(),o=function(){function m(u,a,b,v,x,P){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new h(a,b,v,x,P)}var c=m.prototype;return c.reset=function(){this.uchar=" ",this.penState.reset()},c.setChar=function(a,b){this.uchar=a,this.penState.copy(b)},c.setPenState=function(a){this.penState.copy(a)},c.equals=function(a){return this.uchar===a.uchar&&this.penState.equals(a.penState)},c.copy=function(a){this.uchar=a.uchar,this.penState.copy(a.penState)},c.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},m}(),l=function(){function m(u){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var a=0;a<j;a++)this.chars.push(new o);this.logger=u,this.pos=0,this.currPenState=new h}var c=m.prototype;return c.equals=function(a){for(var b=!0,v=0;v<j;v++)if(!this.chars[v].equals(a.chars[v])){b=!1;break}return b},c.copy=function(a){for(var b=0;b<j;b++)this.chars[b].copy(a.chars[b])},c.isEmpty=function(){for(var a=!0,b=0;b<j;b++)if(!this.chars[b].isEmpty()){a=!1;break}return a},c.setCursor=function(a){this.pos!==a&&(this.pos=a),this.pos<0?(this.logger.log(D.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>j&&(this.logger.log(D.DEBUG,"Too large cursor position "+this.pos),this.pos=j)},c.moveCursor=function(a){var b=this.pos+a;if(a>1)for(var v=this.pos+1;v<b+1;v++)this.chars[v].setPenState(this.currPenState);this.setCursor(b)},c.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},c.insertChar=function(a){a>=144&&this.backSpace();var b=_(a);if(this.pos>=j){this.logger.log(D.ERROR,"Cannot insert "+a.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(b,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(a){var b;for(b=a;b<j;b++)this.chars[b].reset()},c.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},c.clearToEndOfRow=function(){this.clearFromPos(this.pos)},c.getTextString=function(){for(var a=[],b=!0,v=0;v<j;v++){var x=this.chars[v].uchar;x!==" "&&(b=!1),a.push(x)}return b?"":a.join("")},c.setPenStyles=function(a){this.currPenState.setStyles(a);var b=this.chars[this.pos];b.setPenState(this.currPenState)},m}(),d=function(){function m(u){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var a=0;a<G;a++)this.rows.push(new l(u));this.logger=u,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var c=m.prototype;return c.reset=function(){for(var a=0;a<G;a++)this.rows[a].clear();this.currRow=G-1},c.equals=function(a){for(var b=!0,v=0;v<G;v++)if(!this.rows[v].equals(a.rows[v])){b=!1;break}return b},c.copy=function(a){for(var b=0;b<G;b++)this.rows[b].copy(a.rows[b])},c.isEmpty=function(){for(var a=!0,b=0;b<G;b++)if(!this.rows[b].isEmpty()){a=!1;break}return a},c.backSpace=function(){var a=this.rows[this.currRow];a.backSpace()},c.clearToEndOfRow=function(){var a=this.rows[this.currRow];a.clearToEndOfRow()},c.insertChar=function(a){var b=this.rows[this.currRow];b.insertChar(a)},c.setPen=function(a){var b=this.rows[this.currRow];b.setPenStyles(a)},c.moveCursor=function(a){var b=this.rows[this.currRow];b.moveCursor(a)},c.setCursor=function(a){this.logger.log(D.INFO,"setCursor: "+a);var b=this.rows[this.currRow];b.setCursor(a)},c.setPAC=function(a){this.logger.log(D.INFO,"pacData = "+JSON.stringify(a));var b=a.row-1;if(this.nrRollUpRows&&b<this.nrRollUpRows-1&&(b=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==b){for(var v=0;v<G;v++)this.rows[v].clear();var x=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var H=P.rows[x].cueStartTime,V=this.logger.time;if(H&&V!==null&&H<V)for(var $=0;$<this.nrRollUpRows;$++)this.rows[b-this.nrRollUpRows+$+1].copy(P.rows[x+$])}}this.currRow=b;var z=this.rows[this.currRow];if(a.indent!==null){var F=a.indent,ee=Math.max(F-1,0);z.setCursor(a.indent),a.color=z.chars[ee].penState.foreground}var oe={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(oe)},c.setBkgData=function(a){this.logger.log(D.INFO,"bkgData = "+JSON.stringify(a)),this.backSpace(),this.setPen(a),this.insertChar(32)},c.setRollUpRows=function(a){this.nrRollUpRows=a},c.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(D.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(D.TEXT,this.getDisplayText());var a=this.currRow+1-this.nrRollUpRows,b=this.rows.splice(a,1)[0];b.clear(),this.rows.splice(this.currRow,0,b),this.logger.log(D.INFO,"Rolling up")},c.getDisplayText=function(a){a=a||!1;for(var b=[],v="",x=-1,P=0;P<G;P++){var H=this.rows[P].getTextString();H&&(x=P+1,a?b.push("Row "+x+": '"+H+"'"):b.push(H.trim()))}return b.length>0&&(a?v="["+b.join(" | ")+"]":v=b.join(`
|
|
`)),v},c.getTextAndFormat=function(){return this.rows},m}(),A=function(){function m(u,a,b){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=u,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new d(b),this.nonDisplayedMemory=new d(b),this.lastOutputScreen=new d(b),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=b}var c=m.prototype;return c.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(a){this.outputFilter=a},c.setPAC=function(a){this.writeScreen.setPAC(a)},c.setBkgData=function(a){this.writeScreen.setBkgData(a)},c.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(D.INFO,"MODE="+a),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=a},c.insertChars=function(a){for(var b=0;b<a.length;b++)this.writeScreen.insertChar(a[b]);var v=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(D.INFO,v+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(D.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},c.ccRCL=function(){this.logger.log(D.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},c.ccBS=function(){if(this.logger.log(D.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},c.ccAOF=function(){},c.ccAON=function(){},c.ccDER=function(){this.logger.log(D.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},c.ccRU=function(a){this.logger.log(D.INFO,"RU("+a+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(a)},c.ccFON=function(){this.logger.log(D.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},c.ccRDC=function(){this.logger.log(D.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},c.ccTR=function(){this.logger.log(D.INFO,"TR"),this.setMode("MODE_TEXT")},c.ccRTD=function(){this.logger.log(D.INFO,"RTD"),this.setMode("MODE_TEXT")},c.ccEDM=function(){this.logger.log(D.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},c.ccCR=function(){this.logger.log(D.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},c.ccENM=function(){this.logger.log(D.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},c.ccEOC=function(){if(this.logger.log(D.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var a=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=a,this.writeScreen=this.nonDisplayedMemory,this.logger.log(D.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},c.ccTO=function(a){this.logger.log(D.INFO,"TO("+a+") - Tab Offset"),this.writeScreen.moveCursor(a)},c.ccMIDROW=function(a){var b={flash:!1};if(b.underline=a%2===1,b.italics=a>=46,b.italics)b.foreground="white";else{var v=Math.floor(a/2)-16,x=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=x[v]}this.logger.log(D.INFO,"MIDROW: "+JSON.stringify(b)),this.writeScreen.setPen(b)},c.outputDataUpdate=function(a){a===void 0&&(a=!1);var b=this.logger.time;if(b===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=b:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,b,this.lastOutputScreen),a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:b),this.lastOutputScreen.copy(this.displayedMemory))},c.cueSplitAtTime=function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))},m}(),f=function(){function m(u,a,b){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new w;this.channels=[null,new A(u,a,v),new A(u+1,b,v)],this.cmdHistory=E(),this.logger=v}var c=m.prototype;return c.getHandler=function(a){return this.channels[a].getHandler()},c.setHandler=function(a,b){this.channels[a].setHandler(b)},c.addData=function(a,b){var v,x,P,H=!1;this.logger.time=a;for(var V=0;V<b.length;V+=2){if(x=b[V]&127,P=b[V+1]&127,x===0&&P===0)continue;if(this.logger.log(D.DATA,"["+C([b[V],b[V+1]])+"] -> ("+C([x,P])+")"),v=this.parseCmd(x,P),v||(v=this.parseMidrow(x,P)),v||(v=this.parsePAC(x,P)),v||(v=this.parseBackgroundAttributes(x,P)),!v&&(H=this.parseChars(x,P),H)){var $=this.currentChannel;if($&&$>0){var z=this.channels[$];z.insertChars(H)}else this.logger.log(D.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!H&&this.logger.log(D.WARNING,"Couldn't parse cleaned data "+C([x,P])+" orig: "+C([b[V],b[V+1]]))}},c.parseCmd=function(a,b){var v=this.cmdHistory,x=(a===20||a===28||a===21||a===29)&&b>=32&&b<=47,P=(a===23||a===31)&&b>=33&&b<=35;if(!(x||P))return!1;if(L(a,b,v))return g(null,null,v),this.logger.log(D.DEBUG,"Repeated command ("+C([a,b])+") is dropped"),!0;var H=a===20||a===21||a===23?1:2,V=this.channels[H];return a===20||a===21||a===28||a===29?b===32?V.ccRCL():b===33?V.ccBS():b===34?V.ccAOF():b===35?V.ccAON():b===36?V.ccDER():b===37?V.ccRU(2):b===38?V.ccRU(3):b===39?V.ccRU(4):b===40?V.ccFON():b===41?V.ccRDC():b===42?V.ccTR():b===43?V.ccRTD():b===44?V.ccEDM():b===45?V.ccCR():b===46?V.ccENM():b===47&&V.ccEOC():V.ccTO(b-32),g(a,b,v),this.currentChannel=H,!0},c.parseMidrow=function(a,b){var v=0;if((a===17||a===25)&&b>=32&&b<=47){if(a===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(D.ERROR,"Mismatch channel in midrow parsing"),!1;var x=this.channels[v];return x?(x.ccMIDROW(b),this.logger.log(D.DEBUG,"MIDROW ("+C([a,b])+")"),!0):!1}return!1},c.parsePAC=function(a,b){var v,x=this.cmdHistory,P=(a>=17&&a<=23||a>=25&&a<=31)&&b>=64&&b<=127,H=(a===16||a===24)&&b>=64&&b<=95;if(!(P||H))return!1;if(L(a,b,x))return g(null,null,x),!0;var V=a<=23?1:2;b>=64&&b<=95?v=V===1?O[a]:y[a]:v=V===1?M[a]:T[a];var $=this.channels[V];return $?($.setPAC(this.interpretPAC(v,b)),g(a,b,x),this.currentChannel=V,!0):!1},c.interpretPAC=function(a,b){var v,x={color:null,italics:!1,indent:null,underline:!1,row:a};return b>95?v=b-96:v=b-64,x.underline=(v&1)===1,v<=13?x.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(x.italics=!0,x.color="white"):x.indent=Math.floor((v-16)/2)*4,x},c.parseChars=function(a,b){var v,x=null,P=null;if(a>=25?(v=2,P=a-8):(v=1,P=a),P>=17&&P<=19){var H;P===17?H=b+80:P===18?H=b+112:H=b+144,this.logger.log(D.INFO,"Special char '"+_(H)+"' in channel "+v),x=[H]}else a>=32&&a<=127&&(x=b===0?[a]:[a,b]);if(x){var V=C(x);this.logger.log(D.DEBUG,"Char codes = "+V.join(",")),g(a,b,this.cmdHistory)}return x},c.parseBackgroundAttributes=function(a,b){var v=(a===16||a===24)&&b>=32&&b<=47,x=(a===23||a===31)&&b>=45&&b<=47;if(!(v||x))return!1;var P,H={};a===16||a===24?(P=Math.floor((b-32)/2),H.background=k[P],b%2===1&&(H.background=H.background+"_semi")):b===45?H.background="transparent":(H.foreground="black",b===47&&(H.underline=!0));var V=a<=23?1:2,$=this.channels[V];return $.setBkgData(H),g(a,b,this.cmdHistory),!0},c.reset=function(){for(var a=0;a<Object.keys(this.channels).length;a++){var b=this.channels[a];b&&b.reset()}this.cmdHistory=E()},c.cueSplitAtTime=function(a){for(var b=0;b<this.channels.length;b++){var v=this.channels[b];v&&v.cueSplitAtTime(a)}},m}();function g(m,c,u){u.a=m,u.b=c}function L(m,c,u){return u.a===m&&u.b===c}function E(){return{a:null,b:null}}X.default=f},"./src/utils/codecs.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"isCodecType",function(){return B}),R.d(X,"isCodecSupportedInMp4",function(){return _});var Q={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 B(G,j){var O=Q[j];return!!O&&O[G.slice(0,4)]===!0}function _(G,j){return MediaSource.isTypeSupported((j||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/utils/vttparser.ts"),B=R("./src/utils/webvtt-parser.ts"),_=R("./src/utils/texttrack-utils.ts"),G=/\s/,j={newCue:function(M,y,T,k){for(var D=[],w,C,h,o,l,d=self.VTTCue||self.TextTrackCue,A=0;A<k.rows.length;A++)if(w=k.rows[A],h=!0,o=0,l="",!w.isEmpty()){for(var f=0;f<w.chars.length;f++)G.test(w.chars[f].uchar)&&h?o++:(l+=w.chars[f].uchar,h=!1);w.cueStartTime=y,y===T&&(T+=1e-4),o>=16?o--:o++;var g=Object(Q.fixLineBreaks)(l.trim()),L=Object(B.generateCueId)(y,T,g);(!M||!M.cues||!M.cues.getCueById(L))&&(C=new d(y,T,g),C.id=L,C.line=A+1,C.align="left",C.position=10+Math.min(80,Math.floor(o*8/32)*10),D.push(C))}return M&&D.length&&(D.sort(function(E,m){return E.line==="auto"||m.line==="auto"?0:E.line>8&&m.line>8?m.line-E.line:E.line-m.line}),D.forEach(function(E){return Object(_.addCueToTrack)(M,E)})),D}};X.default=j},"./src/utils/discontinuities.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"findFirstFragWithCC",function(){return G}),R.d(X,"shouldAlignOnDiscontinuities",function(){return j}),R.d(X,"findDiscontinuousReferenceFrag",function(){return O}),R.d(X,"adjustSlidingStart",function(){return y}),R.d(X,"alignStream",function(){return T}),R.d(X,"alignPDT",function(){return D}),R.d(X,"alignFragmentByPDTDelta",function(){return w}),R.d(X,"alignMediaPlaylistByPDT",function(){return C});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/logger.ts"),_=R("./src/controller/level-helper.ts");function G(h,o){for(var l=null,d=0,A=h.length;d<A;d++){var f=h[d];if(f&&f.cc===o){l=f;break}}return l}function j(h,o,l){return!!(o.details&&(l.endCC>l.startCC||h&&h.cc<l.startCC))}function O(h,o){var l=h.fragments,d=o.fragments;if(!d.length||!l.length){B.logger.log("No fragments to align");return}var A=G(l,d[0].cc);if(!A||A&&!A.startPTS){B.logger.log("No frag in previous level to align on");return}return A}function M(h,o){if(h){var l=h.start+o;h.start=h.startPTS=l,h.endPTS=l+h.duration}}function y(h,o){for(var l=o.fragments,d=0,A=l.length;d<A;d++)M(l[d],h);o.fragmentHint&&M(o.fragmentHint,h),o.alignedSliding=!0}function T(h,o,l){if(!o)return;k(h,l,o),!l.alignedSliding&&o.details&&D(l,o.details),!l.alignedSliding&&o.details&&!l.skippedSegments&&Object(_.adjustSliding)(o.details,l)}function k(h,o,l){if(j(h,l,o)){var d=O(l.details,o);d&&Object(Q.isFiniteNumber)(d.start)&&(B.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),y(d.start,o))}}function D(h,o){if(!o.fragments.length||!h.hasProgramDateTime||!o.hasProgramDateTime)return;var l=o.fragments[0].programDateTime,d=h.fragments[0].programDateTime,A=(d-l)/1e3+o.fragments[0].start;A&&Object(Q.isFiniteNumber)(A)&&(B.logger.log("Adjusting PTS using programDateTime delta "+(d-l)+"ms, sliding:"+A.toFixed(3)+" "+h.url+" "),y(A,h))}function w(h,o){var l=h.programDateTime;if(!l)return;var d=(l-o)/1e3;h.start=h.startPTS=d,h.endPTS=d+h.duration}function C(h,o){if(!o.fragments.length||!h.hasProgramDateTime||!o.hasProgramDateTime)return;var l=o.fragments[0].programDateTime,d=o.fragments[0].start,A=l-d*1e3;h.fragments.forEach(function(f){w(f,A)}),h.fragmentHint&&w(h.fragmentHint,A),h.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/utils/ewma.ts"),B=function(){function _(j,O,M){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=M,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Q.default(j),this.fast_=new Q.default(O)}var G=_.prototype;return G.update=function(O,M){var y=this.slow_,T=this.fast_;this.slow_.halfLife!==O&&(this.slow_=new Q.default(O,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==M&&(this.fast_=new Q.default(M,T.getEstimate(),T.getTotalWeight()))},G.sample=function(O,M){O=Math.max(O,this.minDelayMs_);var y=8*M,T=O/1e3,k=y/T;this.fast_.sample(T,k),this.slow_.sample(T,k)},G.canEstimate=function(){var O=this.fast_;return O&&O.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},_}();X.default=B},"./src/utils/ewma.ts":function(ie,X,R){"use strict";R.r(X);var Q=function(){function B(G,j,O){j===void 0&&(j=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=j,this.totalWeight_=O}var _=B.prototype;return _.sample=function(j,O){var M=Math.pow(this.alpha_,j);this.estimate_=O*(1-M)+M*this.estimate_,this.totalWeight_+=j},_.getTotalWeight=function(){return this.totalWeight_},_.getEstimate=function(){if(this.alpha_){var j=1-Math.pow(this.alpha_,this.totalWeight_);if(j)return this.estimate_/j}return this.estimate_},B}();X.default=Q},"./src/utils/fetch-loader.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"fetchSupported",function(){return w});var Q=R("./src/polyfills/number.ts"),B=R("./src/loader/load-stats.ts"),_=R("./src/demux/chunk-cache.ts");function G(d,A){d.prototype=Object.create(A.prototype),d.prototype.constructor=d,T(d,A)}function j(d){var A=typeof Map=="function"?new Map:void 0;return j=function(g){if(g===null||!y(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(g))return A.get(g);A.set(g,L)}function L(){return O(g,arguments,k(this).constructor)}return L.prototype=Object.create(g.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),T(L,g)},j(d)}function O(d,A,f){return M()?O=Reflect.construct:O=function(L,E,m){var c=[null];c.push.apply(c,E);var u=Function.bind.apply(L,c),a=new u;return m&&T(a,m.prototype),a},O.apply(null,arguments)}function M(){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 T(d,A){return T=Object.setPrototypeOf||function(g,L){return g.__proto__=L,g},T(d,A)}function k(d){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},k(d)}function D(){return D=Object.assign||function(d){for(var A=1;A<arguments.length;A++){var f=arguments[A];for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(d[g]=f[g])}return d},D.apply(this,arguments)}function w(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var C=function(){function d(f){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=f.fetchSetup||o,this.controller=new self.AbortController,this.stats=new B.LoadStats}var A=d.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var g=this.response;(!g||!g.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(g,L,E){var m=this,c=this.stats;if(c.loading.start)throw new Error("Loader can only be used once.");c.loading.start=self.performance.now();var u=h(g,this.controller.signal),a=E.onProgress,b=g.responseType==="arraybuffer",v=b?"byteLength":"length";this.context=g,this.config=L,this.callbacks=E,this.request=this.fetchSetup(g,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){m.abortInternal(),E.onTimeout(c,g,m.response)},L.timeout),self.fetch(this.request).then(function(x){if(m.response=m.loader=x,!x.ok){var P=x.status,H=x.statusText;throw new l(H||"fetch, bad network response",P,x)}return c.loading.first=Math.max(self.performance.now(),c.loading.start),c.total=parseInt(x.headers.get("Content-Length")||"0"),a&&Object(Q.isFiniteNumber)(L.highWaterMark)?m.loadProgressively(x,c,g,L.highWaterMark,a):b?x.arrayBuffer():x.text()}).then(function(x){var P=m.response;self.clearTimeout(m.requestTimeout),c.loading.end=Math.max(self.performance.now(),c.loading.first),c.loaded=c.total=x[v];var H={url:P.url,data:x};a&&!Object(Q.isFiniteNumber)(L.highWaterMark)&&a(c,g,x,P),E.onSuccess(H,c,g,P)}).catch(function(x){if(self.clearTimeout(m.requestTimeout),c.aborted)return;var P=x.code||0;E.onError({code:P,text:x.message},g,x.details)})},A.getCacheAge=function(){var g=null;if(this.response){var L=this.response.headers.get("age");g=L?parseFloat(L):null}return g},A.loadProgressively=function(g,L,E,m,c){m===void 0&&(m=0);var u=new _.default,a=g.body.getReader(),b=function v(){return a.read().then(function(x){if(x.done)return u.dataLength&&c(L,E,u.flush(),g),Promise.resolve(new ArrayBuffer(0));var P=x.value,H=P.length;return L.loaded+=H,H<m||u.dataLength?(u.push(P),u.dataLength>=m&&c(L,E,u.flush(),g)):c(L,E,P,g),v()}).catch(function(){return Promise.reject()})};return b()},d}();function h(d,A){var f={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(D({},d.headers))};return d.rangeEnd&&f.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),f}function o(d,A){return new self.Request(d.url,A)}var l=function(d){G(A,d);function A(f,g,L){var E;return E=d.call(this,f)||this,E.code=void 0,E.details=void 0,E.code=g,E.details=L,E}return A}(j(Error));X.default=C},"./src/utils/imsc1-ttml-parser.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"IMSC1_CODEC",function(){return y}),R.d(X,"parseIMSC1",function(){return w});var Q=R("./src/utils/mp4-tools.ts"),B=R("./src/utils/vttparser.ts"),_=R("./src/utils/vttcue.ts"),G=R("./src/demux/id3.ts"),j=R("./src/utils/timescale-conversion.ts"),O=R("./src/utils/webvtt-parser.ts");function M(){return M=Object.assign||function(m){for(var c=1;c<arguments.length;c++){var u=arguments[c];for(var a in u)Object.prototype.hasOwnProperty.call(u,a)&&(m[a]=u[a])}return m},M.apply(this,arguments)}var y="stpp.ttml.im1t",T=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,k=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,D={left:"start",center:"center",right:"end",start:"start",end:"end"};function w(m,c,u,a,b){var v=Object(Q.findBox)(new Uint8Array(m),["mdat"]);if(v.length===0){b(new Error("Could not parse IMSC1 mdat"));return}var x=v[0],P=Object(G.utf8ArrayToStr)(new Uint8Array(m,x.start,x.end-x.start)),H=Object(j.toTimescaleFromScale)(c,1,u);try{a(C(P,H))}catch(V){b(V)}}function C(m,c){var u=new DOMParser,a=u.parseFromString(m,"text/xml"),b=a.getElementsByTagName("tt")[0];if(!b)throw new Error("Invalid ttml");var v={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},x=Object.keys(v).reduce(function(z,F){return z[F]=b.getAttribute("ttp:"+F)||v[F],z},{}),P=b.getAttribute("xml:space")!=="preserve",H=o(h(b,"styling","style")),V=o(h(b,"layout","region")),$=h(b,"body","[begin]");return[].map.call($,function(z){var F=l(z,P);if(!F||!z.hasAttribute("begin"))return null;var ee=g(z.getAttribute("begin"),x),oe=g(z.getAttribute("dur"),x),le=g(z.getAttribute("end"),x);if(ee===null)throw f(z);if(le===null){if(oe===null)throw f(z);le=ee+oe}var ve=new _.default(ee-c,le-c,F);ve.id=Object(O.generateCueId)(ve.startTime,ve.endTime,ve.text);var Ie=V[z.getAttribute("region")],xe=H[z.getAttribute("style")];ve.position=10,ve.size=80;var Ce=d(Ie,xe),Te=Ce.textAlign;if(Te){var Se=D[Te];Se&&(ve.lineAlign=Se),ve.align=Te}return M(ve,Ce),ve}).filter(function(z){return z!==null})}function h(m,c,u){var a=m.getElementsByTagName(c)[0];return a?[].slice.call(a.querySelectorAll(u)):[]}function o(m){return m.reduce(function(c,u){var a=u.getAttribute("xml:id");return a&&(c[a]=u),c},{})}function l(m,c){return[].slice.call(m.childNodes).reduce(function(u,a,b){var v;return a.nodeName==="br"&&b?u+`
|
|
`:(v=a.childNodes)!==null&&v!==void 0&&v.length?l(a,c):c?u+a.textContent.trim().replace(/\s+/g," "):u+a.textContent},"")}function d(m,c){var u="http://www.w3.org/ns/ttml#styling",a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return a.reduce(function(b,v){var x=A(c,u,v)||A(m,u,v);return x&&(b[v]=x),b},{})}function A(m,c,u){return m.hasAttributeNS(c,u)?m.getAttributeNS(c,u):null}function f(m){return new Error("Could not parse ttml timestamp "+m)}function g(m,c){if(!m)return null;var u=Object(B.parseTimeStamp)(m);return u===null&&(T.test(m)?u=L(m,c):k.test(m)&&(u=E(m,c))),u}function L(m,c){var u=T.exec(m),a=(u[4]|0)+(u[5]|0)/c.subFrameRate;return(u[1]|0)*3600+(u[2]|0)*60+(u[3]|0)+a/c.frameRate}function E(m,c){var u=k.exec(m),a=Number(u[1]),b=u[2];switch(b){case"h":return a*3600;case"m":return a*60;case"ms":return a*1e3;case"f":return a/c.frameRate;case"t":return a/c.tickRate}return a}},"./src/utils/logger.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"enableLogs",function(){return O}),R.d(X,"logger",function(){return M});var Q=function(){},B={trace:Q,debug:Q,log:Q,warn:Q,info:Q,error:Q},_=B;function G(y){var T=self.console[y];return T?T.bind(self.console,"["+y+"] >"):Q}function j(y){for(var T=arguments.length,k=new Array(T>1?T-1:0),D=1;D<T;D++)k[D-1]=arguments[D];k.forEach(function(w){_[w]=y[w]?y[w].bind(y):G(w)})}function O(y){if(self.console&&y===!0||typeof y=="object"){j(y,"debug","log","info","warn","error");try{_.log()}catch(T){_=B}}else _=B}var M=_},"./src/utils/mediakeys-helper.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"KeySystems",function(){return Q}),R.d(X,"requestMediaKeySystemAccess",function(){return B});var Q;(function(_){_.WIDEVINE="com.widevine.alpha",_.PLAYREADY="com.microsoft.playready"})(Q||(Q={}));var B=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"getMediaSource",function(){return Q});function Q(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"bin2str",function(){return j}),R.d(X,"readUint16",function(){return O}),R.d(X,"readUint32",function(){return M}),R.d(X,"writeUint32",function(){return y}),R.d(X,"findBox",function(){return T}),R.d(X,"parseSegmentIndex",function(){return k}),R.d(X,"parseInitSegment",function(){return D}),R.d(X,"getStartDTS",function(){return w}),R.d(X,"getDuration",function(){return C}),R.d(X,"computeRawDurationFromSamples",function(){return h}),R.d(X,"offsetStartDTS",function(){return o}),R.d(X,"segmentValidRange",function(){return l}),R.d(X,"appendUint8Array",function(){return d});var Q=R("./src/utils/typed-array.ts"),B=R("./src/loader/fragment.ts"),_=Math.pow(2,32)-1,G=[].push;function j(A){return String.fromCharCode.apply(null,A)}function O(A,f){"data"in A&&(f+=A.start,A=A.data);var g=A[f]<<8|A[f+1];return g<0?65536+g:g}function M(A,f){"data"in A&&(f+=A.start,A=A.data);var g=A[f]<<24|A[f+1]<<16|A[f+2]<<8|A[f+3];return g<0?4294967296+g:g}function y(A,f,g){"data"in A&&(f+=A.start,A=A.data),A[f]=g>>24,A[f+1]=g>>16&255,A[f+2]=g>>8&255,A[f+3]=g&255}function T(A,f){var g=[];if(!f.length)return g;var L,E,m;"data"in A?(L=A.data,E=A.start,m=A.end):(L=A,E=0,m=L.byteLength);for(var c=E;c<m;){var u=M(L,c),a=j(L.subarray(c+4,c+8)),b=u>1?c+u:m;if(a===f[0])if(f.length===1)g.push({data:L,start:c+8,end:b});else{var v=T({data:L,start:c+8,end:b},f.slice(1));v.length&&G.apply(g,v)}c=b}return g}function k(A){var f=T(A,["moov"]),g=f[0],L=g?g.end:null,E=T(A,["sidx"]);if(!E||!E[0])return null;var m=[],c=E[0],u=c.data[0],a=u===0?8:16,b=M(c,a);a+=4;var v=0,x=0;u===0?a+=8:a+=16,a+=2;var P=c.end+x,H=O(c,a);a+=2;for(var V=0;V<H;V++){var $=a,z=M(c,$);$+=4;var F=z&2147483647,ee=(z&2147483648)>>>31;if(ee===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var oe=M(c,$);$+=4,m.push({referenceSize:F,subsegmentDuration:oe,info:{duration:oe/b,start:P,end:P+F-1}}),P+=F,$+=4,a=$}return{earliestPresentationTime:v,timescale:b,version:u,referencesCount:H,references:m,moovEndOffset:L}}function D(A){for(var f=[],g=T(A,["moov","trak"]),L=0;L<g.length;L++){var E=g[L],m=T(E,["tkhd"])[0];if(m){var c=m.data[m.start],u=c===0?12:20,a=M(m,u),b=T(E,["mdia","mdhd"])[0];if(b){c=b.data[b.start],u=c===0?12:20;var v=M(b,u),x=T(E,["mdia","hdlr"])[0];if(x){var P=j(x.data.subarray(x.start+8,x.start+12)),H={soun:B.ElementaryStreamTypes.AUDIO,vide:B.ElementaryStreamTypes.VIDEO}[P];if(H){var V=T(E,["mdia","minf","stbl","stsd"])[0],$=void 0;V&&($=j(V.data.subarray(V.start+12,V.start+16))),f[a]={timescale:v,type:H},f[H]={timescale:v,id:a,codec:$}}}}}}var z=T(A,["moov","mvex","trex"]);return z.forEach(function(F){var ee=M(F,4),oe=f[ee];oe&&(oe.default={duration:M(F,12),flags:M(F,20)})}),f}function w(A,f){return T(f,["moof","traf"]).reduce(function(g,L){var E=T(L,["tfdt"])[0],m=E.data[E.start],c=T(L,["tfhd"]).reduce(function(u,a){var b=M(a,4),v=A[b];if(v){var x=M(E,4);m===1&&(x*=Math.pow(2,32),x+=M(E,8));var P=v.timescale||9e4,H=x/P;if(isFinite(H)&&(u===null||H<u))return H}return u},null);return c!==null&&isFinite(c)&&(g===null||c<g)?c:g},null)||0}function C(A,f){for(var g=0,L=0,E=0,m=T(A,["moof","traf"]),c=0;c<m.length;c++){var u=m[c],a=T(u,["tfhd"])[0],b=M(a,4),v=f[b];if(!v)continue;var x=v.default,P=M(a,0)|(x==null?void 0:x.flags),H=x==null?void 0:x.duration;P&8&&(P&2?H=M(a,12):H=M(a,8));for(var V=v.timescale||9e4,$=T(u,["trun"]),z=0;z<$.length;z++){if(H){var F=M($[z],4);g=H*F}else g=h($[z]);v.type===B.ElementaryStreamTypes.VIDEO?L+=g/V:v.type===B.ElementaryStreamTypes.AUDIO&&(E+=g/V)}}if(L===0&&E===0){var ee=k(A);if(ee!=null&&ee.references)return ee.references.reduce(function(oe,le){return oe+le.info.duration||0},0)}return L||E}function h(A){var f=M(A,0),g=8;f&1&&(g+=4),f&4&&(g+=4);for(var L=0,E=M(A,4),m=0;m<E;m++){if(f&256){var c=M(A,g);L+=c,g+=4}f&512&&(g+=4),f&1024&&(g+=4),f&2048&&(g+=4)}return L}function o(A,f,g){T(f,["moof","traf"]).forEach(function(L){T(L,["tfhd"]).forEach(function(E){var m=M(E,4),c=A[m];if(!c)return;var u=c.timescale||9e4;T(L,["tfdt"]).forEach(function(a){var b=a.data[a.start],v=M(a,4);if(b===0)y(a,4,v-g*u);else{v*=Math.pow(2,32),v+=M(a,8),v-=g*u,v=Math.max(v,0);var x=Math.floor(v/(_+1)),P=Math.floor(v%(_+1));y(a,4,x),y(a,8,P)}})})})}function l(A){var f={valid:null,remainder:null},g=T(A,["moof"]);if(g){if(g.length<2)return f.remainder=A,f}else return f;var L=g[g.length-1];return f.valid=Object(Q.sliceUint8)(A,0,L.start-8),f.remainder=Object(Q.sliceUint8)(A,L.start-8),f}function d(A,f){var g=new Uint8Array(A.length+f.length);return g.set(A),g.set(f,A.length),g}},"./src/utils/output-filter.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return Q});var Q=function(){function B(G,j){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=j}var _=B.prototype;return _.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},_.newCue=function(j,O,M){(this.startTime===null||this.startTime>j)&&(this.startTime=j),this.endTime=O,this.screen=M,this.timelineController.createCaptionsTrack(this.trackName)},_.reset=function(){this.cueRanges=[]},B}()},"./src/utils/texttrack-utils.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"sendAddTrackEvent",function(){return B}),R.d(X,"addCueToTrack",function(){return _}),R.d(X,"clearCurrentCues",function(){return G}),R.d(X,"removeCuesInRange",function(){return j}),R.d(X,"getCuesInRange",function(){return M});var Q=R("./src/utils/logger.ts");function B(y,T){var k;try{k=new Event("addtrack")}catch(D){k=document.createEvent("Event"),k.initEvent("addtrack",!1,!1)}k.track=y,T.dispatchEvent(k)}function _(y,T){var k=y.mode;if(k==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(T.id))try{if(y.addCue(T),!y.cues.getCueById(T.id))throw new Error("addCue is failed for: "+T)}catch(w){Q.logger.debug("[texttrack-utils]: "+w);var D=new self.TextTrackCue(T.startTime,T.endTime,T.text);D.id=T.id,y.addCue(D)}k==="disabled"&&(y.mode=k)}function G(y){var T=y.mode;if(T==="disabled"&&(y.mode="hidden"),y.cues)for(var k=y.cues.length;k--;)y.removeCue(y.cues[k]);T==="disabled"&&(y.mode=T)}function j(y,T,k){var D=y.mode;if(D==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var w=M(y.cues,T,k),C=0;C<w.length;C++)y.removeCue(w[C]);D==="disabled"&&(y.mode=D)}function O(y,T){if(T<y[0].startTime)return 0;var k=y.length-1;if(T>y[k].endTime)return-1;for(var D=0,w=k;D<=w;){var C=Math.floor((w+D)/2);if(T<y[C].startTime)w=C-1;else if(T>y[C].startTime&&D<k)D=C+1;else return C}return y[D].startTime-T<T-y[w].startTime?D:w}function M(y,T,k){var D=[],w=O(y,T);if(w>-1)for(var C=w,h=y.length;C<h;C++){var o=y[C];if(o.startTime>=T&&o.endTime<=k)D.push(o);else if(o.startTime>k)return D}return D}},"./src/utils/time-ranges.ts":function(ie,X,R){"use strict";R.r(X);var Q={toString:function(_){for(var G="",j=_.length,O=0;O<j;O++)G+="["+_.start(O).toFixed(3)+","+_.end(O).toFixed(3)+"]";return G}};X.default=Q},"./src/utils/timescale-conversion.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"toTimescaleFromBase",function(){return B}),R.d(X,"toTimescaleFromScale",function(){return _}),R.d(X,"toMsFromMpegTsClock",function(){return G}),R.d(X,"toMpegTsClockFromTimescale",function(){return j});var Q=9e4;function B(O,M,y,T){y===void 0&&(y=1),T===void 0&&(T=!1);var k=O*M*y;return T?Math.round(k):k}function _(O,M,y,T){return y===void 0&&(y=1),T===void 0&&(T=!1),B(O,M,1/y,T)}function G(O,M){return M===void 0&&(M=!1),B(O,1e3,1/Q,M)}function j(O,M){return M===void 0&&(M=1),B(O,Q,1/M)}},"./src/utils/typed-array.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"sliceUint8",function(){return Q});function Q(B,_,G){return Uint8Array.prototype.slice?B.slice(_,G):new Uint8Array(Array.prototype.slice.call(B,_,G))}},"./src/utils/vttcue.ts":function(ie,X,R){"use strict";R.r(X),X.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Q=["","lr","rl"],B=["start","middle","end","left","right"];function _(y,T){if(typeof T!="string")return!1;if(!Array.isArray(y))return!1;var k=T.toLowerCase();return~y.indexOf(k)?k:!1}function G(y){return _(Q,y)}function j(y){return _(B,y)}function O(y){for(var T=arguments.length,k=new Array(T>1?T-1:0),D=1;D<T;D++)k[D-1]=arguments[D];for(var w=1;w<arguments.length;w++){var C=arguments[w];for(var h in C)y[h]=C[h]}return y}function M(y,T,k){var D=this,w={enumerable:!0};D.hasBeenReset=!1;var C="",h=!1,o=y,l=T,d=k,A=null,f="",g=!0,L="auto",E="start",m=50,c="middle",u=50,a="middle";Object.defineProperty(D,"id",O({},w,{get:function(){return C},set:function(v){C=""+v}})),Object.defineProperty(D,"pauseOnExit",O({},w,{get:function(){return h},set:function(v){h=!!v}})),Object.defineProperty(D,"startTime",O({},w,{get:function(){return o},set:function(v){if(typeof v!="number")throw new TypeError("Start time must be set to a number.");o=v,this.hasBeenReset=!0}})),Object.defineProperty(D,"endTime",O({},w,{get:function(){return l},set:function(v){if(typeof v!="number")throw new TypeError("End time must be set to a number.");l=v,this.hasBeenReset=!0}})),Object.defineProperty(D,"text",O({},w,{get:function(){return d},set:function(v){d=""+v,this.hasBeenReset=!0}})),Object.defineProperty(D,"region",O({},w,{get:function(){return A},set:function(v){A=v,this.hasBeenReset=!0}})),Object.defineProperty(D,"vertical",O({},w,{get:function(){return f},set:function(v){var x=G(v);if(x===!1)throw new SyntaxError("An invalid or illegal string was specified.");f=x,this.hasBeenReset=!0}})),Object.defineProperty(D,"snapToLines",O({},w,{get:function(){return g},set:function(v){g=!!v,this.hasBeenReset=!0}})),Object.defineProperty(D,"line",O({},w,{get:function(){return L},set:function(v){if(typeof v!="number"&&v!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=v,this.hasBeenReset=!0}})),Object.defineProperty(D,"lineAlign",O({},w,{get:function(){return E},set:function(v){var x=j(v);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");E=x,this.hasBeenReset=!0}})),Object.defineProperty(D,"position",O({},w,{get:function(){return m},set:function(v){if(v<0||v>100)throw new Error("Position must be between 0 and 100.");m=v,this.hasBeenReset=!0}})),Object.defineProperty(D,"positionAlign",O({},w,{get:function(){return c},set:function(v){var x=j(v);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");c=x,this.hasBeenReset=!0}})),Object.defineProperty(D,"size",O({},w,{get:function(){return u},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");u=v,this.hasBeenReset=!0}})),Object.defineProperty(D,"align",O({},w,{get:function(){return a},set:function(v){var x=j(v);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");a=x,this.hasBeenReset=!0}})),D.displayState=void 0}return M.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},M}()},"./src/utils/vttparser.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"parseTimeStamp",function(){return _}),R.d(X,"fixLineBreaks",function(){return T}),R.d(X,"VTTParser",function(){return k});var Q=R("./src/utils/vttcue.ts"),B=function(){function D(){}var w=D.prototype;return w.decode=function(h,o){if(!h)return"";if(typeof h!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(h))},D}();function _(D){function w(h,o,l,d){return(h|0)*3600+(o|0)*60+(l|0)+parseFloat(d||0)}var C=D.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return C?parseFloat(C[2])>59?w(C[2],C[3],0,C[4]):w(C[1],C[2],C[3],C[4]):null}var G=function(){function D(){this.values=Object.create(null)}var w=D.prototype;return w.set=function(h,o){!this.get(h)&&o!==""&&(this.values[h]=o)},w.get=function(h,o,l){return l?this.has(h)?this.values[h]:o[l]:this.has(h)?this.values[h]:o},w.has=function(h){return h in this.values},w.alt=function(h,o,l){for(var d=0;d<l.length;++d)if(o===l[d]){this.set(h,o);break}},w.integer=function(h,o){/^-?\d+$/.test(o)&&this.set(h,parseInt(o,10))},w.percent=function(h,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var l=parseFloat(o);if(l>=0&&l<=100)return this.set(h,l),!0}return!1},D}();function j(D,w,C,h){var o=h?D.split(h):[D];for(var l in o){if(typeof o[l]!="string")continue;var d=o[l].split(C);if(d.length!==2)continue;var A=d[0],f=d[1];w(A,f)}}var O=new Q.default(0,0,""),M=O.align==="middle"?"middle":"center";function y(D,w,C){var h=D;function o(){var A=_(D);if(A===null)throw new Error("Malformed timestamp: "+h);return D=D.replace(/^[^\sa-zA-Z-]+/,""),A}function l(A,f){var g=new G;j(A,function(m,c){var u;switch(m){case"region":for(var a=C.length-1;a>=0;a--)if(C[a].id===c){g.set(m,C[a].region);break}break;case"vertical":g.alt(m,c,["rl","lr"]);break;case"line":u=c.split(","),g.integer(m,u[0]),g.percent(m,u[0])&&g.set("snapToLines",!1),g.alt(m,u[0],["auto"]),u.length===2&&g.alt("lineAlign",u[1],["start",M,"end"]);break;case"position":u=c.split(","),g.percent(m,u[0]),u.length===2&&g.alt("positionAlign",u[1],["start",M,"end","line-left","line-right","auto"]);break;case"size":g.percent(m,c);break;case"align":g.alt(m,c,["start",M,"end","left","right"]);break}},/:/,/\s/),f.region=g.get("region",null),f.vertical=g.get("vertical","");var L=g.get("line","auto");L==="auto"&&O.line===-1&&(L=-1),f.line=L,f.lineAlign=g.get("lineAlign","start"),f.snapToLines=g.get("snapToLines",!0),f.size=g.get("size",100),f.align=g.get("align",M);var E=g.get("position","auto");E==="auto"&&O.position===50&&(E=f.align==="start"||f.align==="left"?0:f.align==="end"||f.align==="right"?100:50),f.position=E}function d(){D=D.replace(/^\s+/,"")}if(d(),w.startTime=o(),d(),D.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+h);D=D.substr(3),d(),w.endTime=o(),d(),l(D,w)}function T(D){return D.replace(/<br(?: \/)?>/gi,`
|
|
`)}var k=function(){function D(){this.state="INITIAL",this.buffer="",this.decoder=new B,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var w=D.prototype;return w.parse=function(h){var o=this;h&&(o.buffer+=o.decoder.decode(h,{stream:!0}));function l(){var E=o.buffer,m=0;for(E=T(E);m<E.length&&E[m]!=="\r"&&E[m]!==`
|
|
`;)++m;var c=E.substr(0,m);return E[m]==="\r"&&++m,E[m]===`
|
|
`&&++m,o.buffer=E.substr(m),c}function d(E){j(E,function(m,c){},/:/)}try{var A="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;A=l();var f=A.match(/^()?WEBVTT([ \t].*)?$/);if(!f||!f[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var g=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;g?g=!1:A=l();switch(o.state){case"HEADER":/:/.test(A)?d(A):A||(o.state="ID");continue;case"NOTE":A||(o.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(A)){o.state="NOTE";break}if(!A)continue;if(o.cue=new Q.default(0,0,""),o.state="CUE",A.indexOf("-->")===-1){o.cue.id=A;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{y(A,o.cue,o.regionList)}catch(E){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var L=A.indexOf("-->")!==-1;if(!A||L&&(g=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=`
|
|
`),o.cue.text+=A}continue;case"BADCUE":A||(o.state="ID")}}}catch(E){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},w.flush=function(){var h=this;try{if((h.cue||h.state==="HEADER")&&(h.buffer+=`
|
|
|
|
`,h.parse()),h.state==="INITIAL"||h.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){h.onparsingerror&&h.onparsingerror(o)}return h.onflush&&h.onflush(),this},D}()},"./src/utils/webvtt-parser.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"generateCueId",function(){return k}),R.d(X,"parseWebVTT",function(){return w});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/vttparser.ts"),_=R("./src/demux/id3.ts"),G=R("./src/utils/timescale-conversion.ts"),j=R("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,M=function(h,o,l){return l===void 0&&(l=0),h.substr(l,o.length)===o},y=function(h){var o=parseInt(h.substr(-3)),l=parseInt(h.substr(-6,2)),d=parseInt(h.substr(-9,2)),A=h.length>9?parseInt(h.substr(0,h.indexOf(":"))):0;if(!Object(Q.isFiniteNumber)(o)||!Object(Q.isFiniteNumber)(l)||!Object(Q.isFiniteNumber)(d)||!Object(Q.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+h);return o+=1e3*l,o+=60*1e3*d,o+=60*60*1e3*A,o},T=function(h){for(var o=5381,l=h.length;l;)o=o*33^h.charCodeAt(--l);return(o>>>0).toString()};function k(C,h,o){return T(C.toString())+T(h.toString())+T(o)}var D=function(h,o,l){var d=h[o],A=h[d.prevCC];if(!A||!A.new&&d.new){h.ccOffset=h.presentationOffset=d.start,d.new=!1;return}for(;(f=A)!==null&&f!==void 0&&f.new;){var f;h.ccOffset+=d.start-A.start,d.new=!1,d=A,A=h[d.prevCC]}h.presentationOffset=l};function w(C,h,o,l,d,A,f,g){var L=new B.VTTParser,E=Object(_.utf8ArrayToStr)(new Uint8Array(C)).trim().replace(O,`
|
|
`).split(`
|
|
`),m=[],c=Object(G.toMpegTsClockFromTimescale)(h,o),u="00:00.000",a=0,b=0,v,x=!0,P=!1;L.oncue=function(H){var V=l[d],$=l.ccOffset,z=(a-c)/9e4;if(V!=null&&V.new&&(b!==void 0?$=l.ccOffset=V.start:D(l,d,z)),z&&($=z-l.presentationOffset),P){var F=H.endTime-H.startTime,ee=Object(j.normalizePts)((H.startTime+$-b)*9e4,A*9e4)/9e4;H.startTime=ee,H.endTime=ee+F}var oe=H.text.trim();H.text=decodeURIComponent(encodeURIComponent(oe)),H.id||(H.id=k(H.startTime,H.endTime,oe)),H.endTime>0&&m.push(H)},L.onparsingerror=function(H){v=H},L.onflush=function(){if(v){g(v);return}f(m)},E.forEach(function(H){if(x)if(M(H,"X-TIMESTAMP-MAP=")){x=!1,P=!0,H.substr(16).split(",").forEach(function(V){M(V,"LOCAL:")?u=V.substr(6):M(V,"MPEGTS:")&&(a=parseInt(V.substr(7)))});try{b=y(u)/1e3}catch(V){P=!1,v=V}return}else H===""&&(x=!1);L.parse(H+`
|
|
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/utils/logger.ts"),B=R("./src/loader/load-stats.ts"),_=/^age:\s*[\d.]+\s*$/m,G=function(){function j(M){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=M?M.xhrSetup:null,this.stats=new B.LoadStats,this.retryDelay=0}var O=j.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.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()))},O.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(y,T,k){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=T,this.callbacks=k,this.retryDelay=T.retryDelay,this.loadInternal()},O.loadInternal=function(){var y=this.config,T=this.context;if(!y)return;var k=this.loader=new self.XMLHttpRequest,D=this.stats;D.loading.first=0,D.loaded=0;var w=this.xhrSetup;try{if(w)try{w(k,T.url)}catch(o){k.open("GET",T.url,!0),w(k,T.url)}k.readyState||k.open("GET",T.url,!0);var C=this.context.headers;if(C)for(var h in C)k.setRequestHeader(h,C[h])}catch(o){this.callbacks.onError({code:k.status,text:o.message},T,k);return}T.rangeEnd&&k.setRequestHeader("Range","bytes="+T.rangeStart+"-"+(T.rangeEnd-1)),k.onreadystatechange=this.readystatechange.bind(this),k.onprogress=this.loadprogress.bind(this),k.responseType=T.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),k.send()},O.readystatechange=function(){var y=this.context,T=this.loader,k=this.stats;if(!y||!T)return;var D=T.readyState,w=this.config;if(k.aborted)return;if(D>=2)if(self.clearTimeout(this.requestTimeout),k.loading.first===0&&(k.loading.first=Math.max(self.performance.now(),k.loading.start)),D===4){T.onreadystatechange=null,T.onprogress=null;var C=T.status;if(C>=200&&C<300){k.loading.end=Math.max(self.performance.now(),k.loading.first);var h,o;if(y.responseType==="arraybuffer"?(h=T.response,o=h.byteLength):(h=T.responseText,o=h.length),k.loaded=k.total=o,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(k,y,h,T),!this.callbacks)return;var d={url:T.responseURL,data:h};this.callbacks.onSuccess(d,k,y,T)}else k.retry>=w.maxRetry||C>=400&&C<499?(Q.logger.error(C+" while loading "+y.url),this.callbacks.onError({code:C,text:T.statusText},y,T)):(Q.logger.warn(C+" 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,w.maxRetryDelay),k.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),w.timeout)},O.loadtimeout=function(){Q.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(y){var T=this.stats;T.loaded=y.loaded,y.lengthComputable&&(T.total=y.total)},O.getCacheAge=function(){var y=null;if(this.loader&&_.test(this.loader.getAllResponseHeaders())){var T=this.loader.getResponseHeader("age");y=T?parseFloat(T):null}return y},j}();X.default=G}}).default})},vHTk:function(Me,Le,Z){Me.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yslc:function(Me,Le){Me.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD4nC4RfIhPsDIaCGBAndEHsujwQMkdBHDGoMmBAvNAtPvZlAMmUAX4GQSEMeCf0wrxgmCu+ASF3K4QnBrOVM+Cd0Cnoorw4mIw/guD6Vs4Ba74CGPBe6IInJicDZn4PgDYK4IpBbMUM+CZ0Qey5t4M3bwUhoa2YB4dNT1CHIzkoEkZzDYrrLtvkCeU0aBsULTw7WntRbtARoQrGbWHtB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