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
1007 KiB
361 lines
1007 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[224,7,9],{"+NIl":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(Y,L){"use strict";function Q(D,T){D.cmdState.push(T)}function B(D){return D.cmdState.length>0?D.cmdState[D.cmdState.length-1]:null}function _(D){var T=D.cmdState.pop();T&&T.closeBracket()}function H(D){for(var T=D.cmdState,S=T.length-1;S>=0;S--){var h=T[S];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function W(D,T,S){return function(){this.name=D,this.bracketNo=0,this.style=T,this.styles=S,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=W("importmodule","tag",["string","builtin"]),O.documentclass=W("documentclass","tag",["","atom"]),O.usepackage=W("usepackage","tag",["atom"]),O.begin=W("begin","tag",["atom"]),O.end=W("end","tag",["atom"]),O.label=W("label","tag",["atom"]),O.ref=W("ref","tag",["atom"]),O.eqref=W("eqref","tag",["atom"]),O.cite=W("cite","tag",["atom"]),O.bibitem=W("bibitem","tag",["atom"]),O.Bibitem=W("Bibitem","tag",["atom"]),O.RBibitem=W("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function M(D,T){D.f=T}function y(D,T){var S;if(D.match(/^\\[a-zA-Z@]+/)){var h=D.current().slice(1);return S=O.hasOwnProperty(h)?O[h]:O.DEFAULT,S=new S,Q(T,S),M(T,k),S.style}if(D.match(/^\\[$&%#{}_]/))return"tag";if(D.match(/^\\[,;!\/\\]/))return"tag";if(D.match("\\["))return M(T,function(u,d){return w(u,d,"\\]")}),"keyword";if(D.match("\\("))return M(T,function(u,d){return w(u,d,"\\)")}),"keyword";if(D.match("$$"))return M(T,function(u,d){return w(u,d,"$$")}),"keyword";if(D.match("$"))return M(T,function(u,d){return w(u,d,"$")}),"keyword";var o=D.next();if(o=="%")return D.skipToEnd(),"comment";if(o=="}"||o=="]"){if(S=B(T),S)S.closeBracket(o),M(T,k);else return"error";return"bracket"}else return o=="{"||o=="["?(S=O.DEFAULT,S=new S,Q(T,S),"bracket"):/\d/.test(o)?(D.eatWhile(/[\w.%]/),"atom"):(D.eatWhile(/[\w\-_]/),S=H(T),S.name=="begin"&&(S.argument=D.current()),S.styleIdentifier())}function w(D,T,S){if(D.eatSpace())return null;if(S&&D.match(S))return M(T,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,T){var S=D.peek(),h;return S=="{"||S=="["?(h=B(T),h.openBracket(S),D.eat(S),M(T,y),"bracket"):/[ \t\r]/.test(S)?(D.eat(S),null):(M(T,y),_(T),y(D,T))}return{startState:function(){var D=L.inMathMode?function(T,S){return w(T,S)}:y;return{cmdState:[],f:D}},copyState:function(D){return{cmdState:D.cmdState.slice(),f:D.f}},token:function(D,T){return T.f(D,T)},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(Pe,Le,Z){Pe.exports=Z.p+"static/search1.c4136dd4.png"},"19Vz":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(W,O,M){var y=M&&M!=ie.Init;if(O&&!y)W.on("blur",B),W.on("change",_),W.on("swapDoc",_),ie.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){Q(W)}),_(W);else if(!O&&y){W.off("blur",B),W.off("change",_),W.off("swapDoc",_),ie.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),Y(W);var w=W.getWrapperElement();w.className=w.className.replace(" CodeMirror-empty","")}O&&!W.hasFocus()&&B(W)});function Y(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function L(W){Y(W);var O=W.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=W.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var M=W.getOption("placeholder");typeof M=="string"&&(M=document.createTextNode(M)),O.appendChild(M),W.display.lineSpace.insertBefore(O,W.display.lineSpace.firstChild)}function Q(W){setTimeout(function(){var O=!1,M=W.getInputField();M.nodeName=="TEXTAREA"?O=!M.value:W.lineCount()==1&&(O=!/[^\u200b]/.test(M.querySelector(".CodeMirror-line").textContent)),O?L(W):Y(W)},20)}function B(W){H(W)&&L(W)}function _(W){var O=W.getWrapperElement(),M=H(W);O.className=O.className.replace(" CodeMirror-empty","")+(M?" CodeMirror-empty":""),M?L(W):Y(W)}function H(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var Y={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},L={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Q,B){var _=Q.indentUnit,H={},W=B.htmlMode?Y:L;for(var O in W)H[O]=W[O];for(var O in B)H[O]=B[O];var M,y;function w(a,b){function g(G){return b.tokenize=G,G(a,b)}var E=a.next();if(E=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?g(T("atom","]]>")):null:a.match("--")?g(T("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),g(S(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=T("meta","?>"),"meta"):(M=a.eat("/")?"closeTag":"openTag",b.tokenize=k,"tag bracket");if(E=="&"){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}w.isInText=!0;function k(a,b){var g=a.next();if(g==">"||g=="/"&&a.eat(">"))return b.tokenize=w,M=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return M="equals",null;if(g=="<"){b.tokenize=w,b.state=d,b.tagName=b.tagStart=null;var E=b.tokenize(a,b);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(g)?(b.tokenize=D(g),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function D(a){var b=function(g,E){for(;!g.eol();)if(g.next()==a){E.tokenize=k;break}return"string"};return b.isInAttribute=!0,b}function T(a,b){return function(g,E){for(;!g.eol();){if(g.match(b)){E.tokenize=w;break}g.next()}return a}}function S(a){return function(b,g){for(var E;(E=b.next())!=null;){if(E=="<")return g.tokenize=S(a+1),g.tokenize(b,g);if(E==">")if(a==1){g.tokenize=w;break}else return g.tokenize=S(a-1),g.tokenize(b,g)}return"meta"}}function h(a,b,g){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=g,(H.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function u(a,b){for(var g;;){if(!a.context)return;if(g=a.context.tagName,!H.contextGrabbers.hasOwnProperty(g)||!H.contextGrabbers[g].hasOwnProperty(b))return;o(a)}}function d(a,b,g){return a=="openTag"?(g.tagStart=b.column(),A):a=="closeTag"?v:d}function A(a,b,g){return a=="word"?(g.tagName=b.current(),y="tag",x):H.allowMissingTagName&&a=="endTag"?(y="tag bracket",x(a,b,g)):(y="error",A)}function v(a,b,g){if(a=="word"){var E=b.current();return g.context&&g.context.tagName!=E&&H.implicitlyClosed.hasOwnProperty(g.context.tagName)&&o(g),g.context&&g.context.tagName==E||H.matchClosing===!1?(y="tag",m):(y="tag error",R)}else return H.allowMissingTagName&&a=="endTag"?(y="tag bracket",m(a,b,g)):(y="error",R)}function m(a,b,g){return a!="endTag"?(y="error",m):(o(g),d)}function R(a,b,g){return y="error",m(a,b,g)}function x(a,b,g){if(a=="word")return y="attribute",f;if(a=="endTag"||a=="selfcloseTag"){var E=g.tagName,P=g.tagStart;return g.tagName=g.tagStart=null,a=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(E)?u(g,E):(u(g,E),g.context=new h(g,E,P==g.indented)),d}return y="error",x}function f(a,b,g){return a=="equals"?c:(H.allowMissing||(y="error"),x(a,b,g))}function c(a,b,g){return a=="string"?s:a=="word"&&H.allowUnquoted?(y="string",x):(y="error",x(a,b,g))}function s(a,b,g){return a=="string"?s:x(a,b,g)}return{startState:function(a){var b={tokenize:w,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 g=b.tokenize(a,b);return(g||M)&&g!="comment"&&(y=null,b.state=b.state(M||g,a,b),y&&(g=y=="error"?g+" error":y)),g},indent:function(a,b,g){var E=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+_;if(E&&E.noIndent)return ie.Pass;if(a.tokenize!=k&&a.tokenize!=w)return g?g.match(/^(\s*)/)[0].length:0;if(a.tagName)return H.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+_*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(b))return 0;var P=b&&/^<(\/)?([\w_:\.-]*)/.exec(b);if(P&&P[1])for(;E;)if(E.tagName==P[2]){E=E.prev;break}else if(H.implicitlyClosed.hasOwnProperty(E.tagName))E=E.prev;else break;else if(P)for(;E;){var G=H.contextGrabbers[E.tagName];if(G&&G.hasOwnProperty(P[2]))E=E.prev;else break}for(;E&&E.prev&&!E.startOfLine;)E=E.prev;return E?E.indent+_:a.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(a){a.state==c&&(a.state=x)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var b=[],g=a.context;g;g=g.prev)g.tagName&&b.push(g.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(Pe,Le,Z){"use strict";var ie=Z("Awhp"),Y=Z("KrTs"),L=Z("+L6B"),Q=Z("2/Rp"),B=Z("5NDa"),_=Z("5rEg"),H=Z("0Owb"),W=Z("oBTY"),O=Z("tJVT"),M=Z("PpiC"),y=Z("q1tI"),w=Z.n(y),k=function(T){var S=T.InputRight,h=T.value,o=h===void 0?[]:h,u=T.onChange,d=u===void 0?function(){}:u,A=Object(M.a)(T,["InputRight","value","onChange"]),v=Object(y.useState)(),m=Object(O.a)(v,2),R=m[0],x=m[1],f=function(a){var b=o.filter(function(g,E){return E!==a});d(b)},c=function(a){if(a.preventDefault(),!R)return;d([].concat(Object(W.a)(o),[R])),x(null)};return w.a.createElement("div",null,w.a.createElement(_.a,Object(H.a)({},A,{value:R,onChange:function(a){return x(a.target.value)},onPressEnter:c,onBlur:c})),S,w.a.createElement("div",{className:"mt20"},o==null?void 0:o.map(function(s,a){return w.a.createElement(Y.a,{className:"ml10 mr10",count:"x",onClick:function(){return f(a)}},w.a.createElement(Q.a,{type:"primary",ghost:!0},s))})))};Le.a=k},"4qgm":function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsL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mYiupdKNDEw+GeH00G5/LgKxQ+A80bVUmpLhzcVSMHbDuyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return u});var ie=Z("Ty5D"),Y=Z("dI71"),L=Z("q1tI"),Q=Z.n(L),B=Z("YS25"),_=Z("17x9"),H=Z.n(_),W=Z("wx14"),O=Z("zLVn"),M=Z("9R94"),y=function(c){Object(Y.a)(s,c);function s(){for(var b,g=arguments.length,E=new Array(g),P=0;P<g;P++)E[P]=arguments[P];return b=c.call.apply(c,[this].concat(E))||this,b.history=Object(B.a)(b.props),b}var a=s.prototype;return a.render=function(){return Q.a.createElement(ie.c,{history:this.history,children:this.props.children})},s}(Q.a.Component),w=function(c){Object(Y.a)(s,c);function s(){for(var b,g=arguments.length,E=new Array(g),P=0;P<g;P++)E[P]=arguments[P];return b=c.call.apply(c,[this].concat(E))||this,b.history=Object(B.b)(b.props),b}var a=s.prototype;return a.render=function(){return Q.a.createElement(ie.c,{history:this.history,children:this.props.children})},s}(Q.a.Component),k=function(s,a){return typeof s=="function"?s(a):s},D=function(s,a){return typeof s=="string"?Object(B.c)(s,null,null,a):s},T=function(s){return s},S=Q.a.forwardRef;typeof S=="undefined"&&(S=T);function h(c){return!!(c.metaKey||c.altKey||c.ctrlKey||c.shiftKey)}var o=S(function(c,s){var a=c.innerRef,b=c.navigate,g=c.onClick,E=Object(O.a)(c,["innerRef","navigate","onClick"]),P=E.target,G=Object(W.a)({},E,{onClick:function($){try{g&&g($)}catch(z){throw $.preventDefault(),z}!$.defaultPrevented&&$.button===0&&(!P||P==="_self")&&!h($)&&($.preventDefault(),b())}});return T!==S?G.ref=s||a:G.ref=a,Q.a.createElement("a",G)}),u=S(function(c,s){var a=c.component,b=a===void 0?o:a,g=c.replace,E=c.to,P=c.innerRef,G=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(E,V.location),V.location),F=z?$.createHref(z):"",ee=Object(W.a)({},G,{href:F,navigate:function(){var ce=k(E,V.location),ve=g?$.replace:$.push;ve(ce)}});return T!==S?ee.ref=s||P:ee.innerRef=P,Q.a.createElement(b,ee)})});if(!1)var d,A;var v=function(s){return s},m=Q.a.forwardRef;typeof m=="undefined"&&(m=v);function R(){for(var c=arguments.length,s=new Array(c),a=0;a<c;a++)s[a]=arguments[a];return s.filter(function(b){return b}).join(" ")}var x=m(function(c,s){var a=c["aria-current"],b=a===void 0?"page":a,g=c.activeClassName,E=g===void 0?"active":g,P=c.activeStyle,G=c.className,V=c.exact,$=c.isActive,z=c.location,F=c.sensitive,ee=c.strict,ae=c.style,ce=c.to,ve=c.innerRef,Me=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 Ee=z||xe.location,Te=D(k(ce,Ee),Ee),Se=Te.pathname,me=Se&&Se.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),se=me?Object(ie.f)(Ee.pathname,{path:me,exact:V,sensitive:F,strict:ee}):null,Re=!!($?$(se,Ee):se),Ve=Re?R(G,E):G,We=Re?Object(W.a)({},ae,{},P):ae,Je=Object(W.a)({"aria-current":Re&&b||null,className:Ve,style:We,to:Te},Me);return v!==m?Je.ref=s||ve:Je.innerRef=ve,Q.a.createElement(u,Je)})});if(!1)var f},"5D2P":function(Pe,Le){Pe.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(Pe,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),Y=new Uint8Array(16);function L(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(Y)}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,H=[],W=0;W<256;++W)H.push((W+256).toString(16).substr(1));function O(k){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,T=(H[k[D+0]]+H[k[D+1]]+H[k[D+2]]+H[k[D+3]]+"-"+H[k[D+4]]+H[k[D+5]]+"-"+H[k[D+6]]+H[k[D+7]]+"-"+H[k[D+8]]+H[k[D+9]]+"-"+H[k[D+10]]+H[k[D+11]]+H[k[D+12]]+H[k[D+13]]+H[k[D+14]]+H[k[D+15]]).toLowerCase();if(!_(T))throw TypeError("Stringified UUID is invalid");return T}var M=O;function y(k,D,T){k=k||{};var S=k.random||(k.rng||L)();if(S[6]=S[6]&15|64,S[8]=S[8]&63|128,D){T=T||0;for(var h=0;h<16;++h)D[T+h]=S[h];return D}return M(S)}var w=Le.a=y},"7ZXX":function(Pe,Le,Z){Pe.exports=Z.p+"static/err.6e7c5817.png"},"7ahc":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return A});var ie=Z("k1fw"),Y=Z("0Owb"),L=Z("+L6B"),Q=Z("2/Rp"),B=Z("y8nQ"),_=Z("Vl3Y"),H=Z("tJVT"),W=Z("OaEy"),O=Z("2fM7"),M=Z("q1tI"),y=Z.n(M),w=Z("VrN/"),k=Z.n(w),D=Z("p77/"),T=Z.n(D),S=Z("c5Ni"),h=Z.n(S),o=O.a.Option,u={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(v){var m=v.callback,R=v.onCancel,x=Object(M.useState)("python"),f=Object(H.a)(x,2),c=f[0],s=f[1];function a(g){s(d[g][1])}function b(g){m(g)}return y.a.createElement(_.a,Object(Y.a)({},u,{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(g){return y.a.createElement(o,{key:g,value:g},d[g][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:R},"\u53D6\u6D88")))};function A(v){var m=v.value,R=v.onChange,x=v.mode,f=v.options,c=f===void 0?{}:f,s=Object(M.useRef)(),a=Object(M.useState)(),b=Object(H.a)(a,2),g=b[0],E=b[1];return Object(M.useEffect)(function(){if(g){function P(G){var V=G.getValue();R&&R(V)}return g.on("change",P),function(){g.off("change",P)}}},[g,R]),Object(M.useEffect)(function(){g&&g.setOption("mode",x)},[g,x]),Object(M.useEffect)(function(){g&&((m!==g.getValue()||m==="")&&setTimeout(function(){g.setValue(m||" ")},300))},[g,m]),Object(M.useEffect)(function(){if(s.current&&!g){var P=k.a.fromTextArea(s.current,Object(ie.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));E(P)}},[s.current,g]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:s}))}},"7ixt":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return L});var ie={adjustX:1,adjustY:1},Y=[0,0],L={left:{points:["cr","cl"],overflow:ie,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:ie,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:ie,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:ie,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:ie,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:ie,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:ie,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:ie,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:ie,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:ie,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:ie,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:ie,offset:[-4,0],targetOffset:Y}},Q=L},"7v3h":function(Pe,Le,Z){Pe.exports=Z.p+"static/empty2.dd73f390.png"},"8/bI":function(Pe,Le,Z){Pe.exports=Z.p+"static/empty.8918e228.png"},"8EBN":function(Pe,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 Y=0;Y<ie.modeInfo.length;Y++){var L=ie.modeInfo[Y];L.mimes&&(L.mime=L.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 H=0;H<_.mimes.length;H++)if(_.mimes[H]==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 H=0;H<_.ext.length;H++)if(_.ext[H]==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 H=Q.lastIndexOf("."),W=H>-1&&Q.substring(H+1,Q.length);if(W)return ie.findModeByExtension(W)},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 H=0;H<_.alias.length;H++)if(_.alias[H].toLowerCase()==Q)return _}}}})},"8hTe":function(Pe,Le,Z){Pe.exports={button:"button___1wy9m"}},"9Bee":function(Pe,Le,Z){"use strict";var ie=Z("DYRE"),Y=Z("zeV3"),L=Z("+L6B"),Q=Z("2/Rp"),B=Z("k1fw"),_=Z("9og8"),H=Z("tJVT"),W=Z("WmNS"),O=Z.n(W),M=Z("q1tI"),y=Z.n(M),w=Z("vg9a"),k=Z("DlQD"),D=Z.n(k),T=Z("rUJ1");function S(j,l){var p=j.match(/^(\s+)(?:```)/);if(p===null)return l;var I=p[1];return l.split(`
|
|
`).map(function(J){var U=J.match(/^\s+/);if(U===null)return J;var he=Object(H.a)(U,1),_e=he[0];return _e.length>=I.length?J.slice(I.length):J}).join(`
|
|
`)}var h=[],o=["<ul>"],u=new D.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){h.length=0,o=["<ul>"]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(j,l,p,I){if(l>=j.length||j[l].level<=p)return l;var J=j[l];I.push("<li><a href='#"+J.anchor+"'>"+J.text+"</a>"),l++;var U=[];return l=m(j,l,J.level,U),U.length>0&&(I.push("<ul>"),U.forEach(function(he){I.push(he)}),I.push("</ul>")),I.push("</li>"),l=m(j,l,p,I),l}function R(){return m(h,0,0,o),o.push("</ul>"),o.join("")}var x={heading:function(l){var p=d.exec(l);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},fences:function(l){var p=this.rules.block.fences.exec(l);if(p){var I=p[0],J=S(I,p[3]||""),U=p[2]?p[2].trim():p[2];if(["latex","katex","math"].indexOf(U)>=0){var he=s(),_e=J;J=he,a[he]={type:"block",expression:_e}}return{type:"code",raw:I,lang:U,text:J}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,s=function(){return"__special_katext_id_".concat(c++,"__")},a={};function b(){return a}function g(){c=0,a={}}function E(j){return j=j.replace(f,function(l,p){var I=s();return a[I]={type:"inline",expression:p},I}),j}var P=u.listitem;u.listitem=function(j){return P(E(j))};var G=u.paragraph;u.paragraph=function(j){return G(E(j))};var V=u.tablecell;u.tablecell=function(j,l){return V(E(j),l)},u.code=function(j,l,p){var I=(l||"").match(/\S*/)[0];return I?["latex","katex","math"].indexOf(I)>=0?"<p class='editormd-tex'>".concat(j,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(l,'">').concat(p?j:Object(T.escape)(j,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(p?j:Object(T.escape)(j,!0))+"</code></pre>"},u.heading=function(j,l,p){var I=this.options.headerPrefix+p.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:I,level:l,text:j}),"<h"+l+' id="'+I+'">'+j+"</h"+l+">"},D.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),D.a.use({tokenizer:x,renderer:u});var $=D.a,z=Z("SJMd"),F=Z("ulZh"),ee=Z.n(F),ae=Z("m3rI"),ce=Z("Oy/b"),ve=Z("p5ED"),Me=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(j,l){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])})(j,l)};function Ee(j,l){function p(){this.constructor=j}xe(j,l),j.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)}function Te(j,l,p,I){return new(p||(p=Promise))(function(J,U){function he(gt){try{tt(I.next(gt))}catch(je){U(je)}}function _e(gt){try{tt(I.throw(gt))}catch(je){U(je)}}function tt(gt){var je;gt.done?J(gt.value):(je=gt.value,je instanceof p?je:new p(function(Ct){Ct(je)})).then(he,_e)}tt((I=I.apply(j,l||[])).next())})}function Se(j,l){var p,I,J,U,he={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return U={next:_e(0),throw:_e(1),return:_e(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function _e(tt){return function(gt){return function(je){if(p)throw new TypeError("Generator is already executing.");for(;he;)try{if(p=1,I&&(J=2&je[0]?I.return:je[0]?I.throw||((J=I.return)&&J.call(I),0):I.next)&&!(J=J.call(I,je[1])).done)return J;switch(I=0,J&&(je=[2&je[0],J.value]),je[0]){case 0:case 1:J=je;break;case 4:return he.label++,{value:je[1],done:!1};case 5:he.label++,I=je[1],je=[0];continue;case 7:je=he.ops.pop(),he.trys.pop();continue;default:if(!(J=he.trys,(J=J.length>0&&J[J.length-1])||je[0]!==6&&je[0]!==2)){he=0;continue}if(je[0]===3&&(!J||je[1]>J[0]&&je[1]<J[3])){he.label=je[1];break}if(je[0]===6&&he.label<J[1]){he.label=J[1],J=je;break}if(J&&he.label<J[2]){he.label=J[2],he.ops.push(je);break}J[2]&&he.ops.pop(),he.trys.pop();continue}je=l.call(j,he)}catch(Ct){je=[6,Ct],I=0}finally{p=J=0}if(5&je[0])throw je[1];return{value:je[0]?je[1]:void 0,done:!0}}([tt,gt])}}}function me(){for(var j=0,l=0,p=arguments.length;l<p;l++)j+=arguments[l].length;var I=Array(j),J=0;for(l=0;l<p;l++)for(var U=arguments[l],he=0,_e=U.length;he<_e;he++,J++)I[J]=U[he];return I}var se=function(){function j(){}return j.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},j.setAttributes=function(l,p){for(var I=0,J=p;I<J.length;I++){var U=J[I],he=U[0],_e=U[1];l.setAttribute(he,_e)}},j.createRect=function(l,p,I){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",l.toString()),J.setAttribute("height",p.toString()),I&&j.setAttributes(J,I),J},j.createLine=function(l,p,I,J,U){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",l.toString()),he.setAttribute("y1",p.toString()),he.setAttribute("x2",I.toString()),he.setAttribute("y2",J.toString()),U&&j.setAttributes(he,U),he},j.createPolygon=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","polygon");return I.setAttribute("points",l),p&&j.setAttributes(I,p),I},j.createCircle=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","circle");return I.setAttribute("cx",(l/2).toString()),I.setAttribute("cy",(l/2).toString()),I.setAttribute("r",l.toString()),p&&j.setAttributes(I,p),I},j.createEllipse=function(l,p,I){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(l/2).toString()),J.setAttribute("cy",(p/2).toString()),J.setAttribute("rx",(l/2).toString()),J.setAttribute("ry",(p/2).toString()),I&&j.setAttributes(J,I),J},j.createGroup=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return l&&j.setAttributes(p,l),p},j.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},j.createMarker=function(l,p,I,J,U,he,_e){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return j.setAttributes(tt,[["id",l],["orient",p],["markerWidth",I.toString()],["markerHeight",J.toString()],["refX",U.toString()],["refY",he.toString()]]),tt.appendChild(_e),tt},j.createText=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),l&&j.setAttributes(p,l),p},j.createTSpan=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","tspan");return I.textContent=l,p&&j.setAttributes(I,p),I},j.createImage=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return l&&j.setAttributes(p,l),p},j.createPoint=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return I.x=l,I.y=p,I},j.createPath=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","path");return I.setAttribute("d",l),p&&j.setAttributes(I,p),I},j}(),Re=function(){function j(){}return j.addKey=function(l){j.key=l},Object.defineProperty(j,"isLicensed",{get:function(){return!!j.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(j.key)},enumerable:!1,configurable:!0}),j}(),Ve=function(){function j(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return j.prototype.rasterize=function(l,p,I){var J=this;return new Promise(function(U){var he=I!==void 0?I:document.createElement("canvas");l===null&&(J.markersOnly=!0,J.naturalSize=!1);var _e=document.createElementNS("http://www.w3.org/2000/svg","svg");_e.setAttribute("xmlns","http://www.w3.org/2000/svg"),_e.setAttribute("width",p.width.baseVal.valueAsString),_e.setAttribute("height",p.height.baseVal.valueAsString),_e.setAttribute("viewBox","0 0 "+p.viewBox.baseVal.width.toString()+" "+p.viewBox.baseVal.height.toString()),_e.innerHTML=p.innerHTML,J.naturalSize===!0?(_e.width.baseVal.value=l.naturalWidth,_e.height.baseVal.value=l.naturalHeight):J.width!==void 0&&J.height!==void 0&&(_e.width.baseVal.value=J.width,_e.height.baseVal.value=J.height),he.width=_e.width.baseVal.value,he.height=_e.height.baseVal.value;var tt=_e.outerHTML,gt=he.getContext("2d");J.markersOnly!==!0&>.drawImage(l,0,0,he.width,he.height);var je=window.URL,Ct=new Image(he.width,he.height);Ct.setAttribute("crossOrigin","anonymous");var Gt=new Blob([tt],{type:"image/svg+xml"}),er=je.createObjectURL(Gt);Ct.onload=function(){gt.drawImage(Ct,0,0),je.revokeObjectURL(er);var jr=he.toDataURL(J.imageType,J.imageQuality);U(jr)},Ct.src=er})},j}(),We=function(){},Je=function(){function j(l){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+l+"_"}return Object.defineProperty(j.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(j.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(j.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),j.prototype.addClass=function(l){return this.styleSheet===void 0&&this.addStyleSheet(),l.name=""+this.classNamePrefix+l.localName,this.classes.push(l),this.styleSheet.sheet.insertRule("."+l.name+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length),l},j.prototype.addRule=function(l){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(l),this.styleSheet.sheet.insertRule(l.selector+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length)},j.prototype.addStyleSheet=function(){var l;this.styleSheet=document.createElement("style"),((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).appendChild(this.styleSheet),this.addRule(new Ze("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ze("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ze("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new De("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new De("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},j.prototype.removeStyleSheet=function(){var l;this.styleSheet&&(((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},j}(),Ze=function(j,l){this.selector=j,this.style=l},De=function(j,l){this.localName=j,this.style=l},Ue=function(){function j(l,p,I,J,U){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=l,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 j.prototype.show=function(l){var p=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=l,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 he=document.createElement("div");he.className=""+p.toolbarButtonStyleClass.name,he.setAttribute("data-type-name",U.typeName),he.innerHTML=U.icon,he.addEventListener("click",function(){p.markerToolbarButtonClicked(he,U)}),p.buttons.push(he),p.markerButtons.push(he)}),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()},j.prototype.addButtonClickListener=function(l){this.buttonClickListeners.push(l)},j.prototype.removeButtonClickListener=function(l){this.buttonClickListeners.indexOf(l)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(l),1)},j.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},j.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var l=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<l||p===l&&this.markerButtons.length-1===l?this.markerButtonBlock.appendChild(this.markerButtons[p]):(p===l&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[p]))}},j.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")},j.prototype.resetButtonStyles=function(){var l=this;this.buttons.forEach(function(p){p.className=p.className.replace(l.uiStyleSettings.toolbarButtonStyleColorsClassName?l.uiStyleSettings.toolbarButtonStyleColorsClassName:l.toolbarButtonStyleColorsClass.name,"").trim(),p.className=p.className.replace(l.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?l.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:l.toolbarActiveButtonStyleColorsClass.name,"").trim(),p.className+=" "+(l.uiStyleSettings.toolbarButtonStyleColorsClassName?l.uiStyleSettings.toolbarButtonStyleColorsClassName:l.toolbarButtonStyleColorsClass.name)})},j.prototype.addActionButton=function(l,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}l.appendChild(U),this.buttons.push(U)},j.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new De("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 De("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new De("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new De("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 De("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var l=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new De("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*l)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*l)+`px;
|
|
padding: `+l+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new De("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new De("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ze("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ze("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},j.prototype.markerToolbarButtonClicked=function(l,p){this.setActiveButton(l),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(I){return I("marker",p)}),this.markerButtonOverflowBlock.style.display="none"},j.prototype.actionToolbarButtonClicked=function(l,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])},j.prototype.setActiveButton=function(l){this.resetButtonStyles(),l.className=l.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),l.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},j.prototype.setActiveMarkerButton=function(l){var p=this.markerButtons.find(function(I){return I.getAttribute("data-type-name")===l});p&&this.setActiveButton(p)},j.prototype.setCurrentMarker=function(l){var p=this;this.currentMarker=l,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")})},j}(),Be=function(){function j(l,p,I,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=l,this.displayMode=p,this.uiStyleSettings=I,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return j.prototype.addStyles=function(){var l;this.toolboxStyleClass=this.styles.addClass(new De("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 De("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new De("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new De("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new De("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 De("toolbox-panel-row_colors",`
|
|
background-color: `+((l=this.uiStyleSettings.toolboxBackgroundColor)!==null&&l!==void 0?l:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new De("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 De("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new De("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},j.prototype.show=function(l){var p;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=l,this.uiContainer.className=this.toolboxStyleClass.name+" "+((p=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},j.prototype.setPanelButtons=function(l){var p,I,J=this;this.panels=l,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 he;U.uiStyleSettings=J.uiStyleSettings;var _e=document.createElement("div");_e.className=J.toolboxButtonStyleClass.name+" "+((he=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:J.toolboxButtonStyleColorsClass.name),_e.innerHTML=U.icon,_e.title=U.title,_e.addEventListener("click",function(){J.panelButtonClick(U)}),J.panelButtons.push(_e),J.buttonRow.appendChild(_e)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},j.prototype.panelButtonClick=function(l){var p=this,I=-1;if(l!==this.activePanel){I=this.panels.indexOf(l),this.panelRow.innerHTML="";var J=l.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=l}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,he){var _e,tt;U.className=p.toolboxButtonStyleClass.name+" "+(he===I?""+((_e=p.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&_e!==void 0?_e:p.toolboxActiveButtonStyleColorsClass.name):""+((tt=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tt!==void 0?tt:p.toolboxButtonStyleColorsClass.name))})},j}(),qe=function(j,l){this.title=j,this.icon=l},Qe=function(j){function l(p,I,J,U){var he=j.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 he.colors=[],he.addTransparent=!1,he.colorBoxes=[],he.colors=I,he.currentColor=J,he.setCurrentColor=he.setCurrentColor.bind(he),he.getColorBox=he.getColorBox.bind(he),he}return Ee(l,j),l.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},l.prototype.getColorBox=function(p){var I=this,J=this.uiStyleSettings.toolbarHeight/4,U=this.uiStyleSettings.toolbarHeight-J,he=document.createElement("div");he.style.display="inline-block",he.style.boxSizing="content-box",he.style.width=U-2+"px",he.style.height=U-2+"px",he.style.padding="1px",he.style.marginRight="2px",he.style.marginBottom="2px",he.style.borderWidth="2px",he.style.borderStyle="solid",he.style.borderRadius=(U+2)/2+"px",he.style.borderColor=p===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",he.addEventListener("click",function(){I.setCurrentColor(p,he)});var _e=document.createElement("div");return _e.style.display="inline-block",_e.style.width=U-2+"px",_e.style.height=U-2+"px",_e.style.backgroundColor=p,_e.style.borderRadius=U/2+"px",p==="transparent"&&(_e.style.fill=this.uiStyleSettings.toolboxAccentColor,_e.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>`),he.appendChild(_e),he},l.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)},l}(qe),Ie=function(){function j(l,p,I){this._state="new",this._isSelected=!1,this._container=l,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(j.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(l){return!1},Object.defineProperty(j.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),j.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},j.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},j.prototype.pointerDown=function(l,p){},j.prototype.dblClick=function(l,p){},j.prototype.manipulate=function(l){},j.prototype.pointerUp=function(l){this.stateChanged()},j.prototype.dispose=function(){},j.prototype.addMarkerVisualToContainer=function(l){this.container.childNodes.length>0?this.container.insertBefore(l,this.container.childNodes[0]):this.container.appendChild(l)},j.prototype.getState=function(){return{typeName:j.typeName,state:this.state,notes:this.notes}},j.prototype.restoreState=function(l){this._state=l.state,this.notes=l.notes},j.prototype.scale=function(l,p){},j.prototype.colorChanged=function(l){this.onColorChanged&&this.onColorChanged(l),this.stateChanged()},j.prototype.fillColorChanged=function(l){this.onFillColorChanged&&this.onFillColorChanged(l),this.stateChanged()},j.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var l=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),l.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(l)&&this.onStateChanged(this)}},j.typeName="MarkerBase",j}(),Ne=function(){function j(){this.findGripByVisual=this.findGripByVisual.bind(this)}return j.prototype.findGripByVisual=function(l){return this.topLeft.ownsTarget(l)?this.topLeft:this.topCenter.ownsTarget(l)?this.topCenter:this.topRight.ownsTarget(l)?this.topRight:this.centerLeft.ownsTarget(l)?this.centerLeft:this.centerRight.ownsTarget(l)?this.centerRight:this.bottomLeft.ownsTarget(l)?this.bottomLeft:this.bottomCenter.ownsTarget(l)?this.bottomCenter:this.bottomRight.ownsTarget(l)?this.bottomRight:void 0},j}(),$e=function(){function j(){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 j.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},j}(),et=function(){function j(){}return j.toITransformMatrix=function(l){return{a:l.a,b:l.b,c:l.c,d:l.d,e:l.e,f:l.f}},j.toSVGMatrix=function(l,p){return l.a=p.a,l.b=p.b,l.c=p.c,l.d=p.d,l.e=p.e,l.f=p.f,l},j}(),Xe=function(j){function l(p,I,J){var U=j.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 Ee(l,j),Object.defineProperty(l.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(l.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}),l.prototype.ownsTarget=function(p){return!!j.prototype.ownsTarget.call(this,p)||!!(this.controlGrips.findGripByVisual(p)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(p))},l.prototype.pointerDown=function(p,I){j.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 he=this.container.transform.baseVal.getItem(0);he.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(he,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},l.prototype.pointerUp=function(p){var I=this.state;j.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)},l.prototype.moveVisual=function(p){this.visual.style.transform="translate("+p.x+"px, "+p.y+"px)"},l.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)},l.prototype.resize=function(p){var I=this.manipulationStartLeft,J=this.manipulationStartWidth,U=this.manipulationStartTop,he=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,he=this.manipulationStartHeight+this.manipulationStartTop-U;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:he=this.manipulationStartHeight+p.y-this.manipulationStartY}J>=0?(this.left=I,this.width=J):(this.left=I+J,this.width=-J),he>=0?(this.top=U,this.height=he):(this.top=U+he,this.height=-he),this.setSize()},l.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},l.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()}},l.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)},l.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}},l.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}},l.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},l.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 Ne,this.addControlGrips(),this.controlBox.style.display="none"},l.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()},l.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()},l.prototype.createGrip=function(){var p=new $e;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},l.prototype.positionGrips=function(){var p=this.controlGrips.topLeft.GRIP_SIZE,I=-p/2,J=I,U=(this.width+this.CB_DISTANCE)/2-p/2,he=(this.height+this.CB_DISTANCE)/2-p/2,_e=this.height+this.CB_DISTANCE-p/2,tt=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,tt,J),this.positionGrip(this.controlGrips.centerLeft.visual,I,he),this.positionGrip(this.controlGrips.centerRight.visual,tt,he),this.positionGrip(this.controlGrips.bottomLeft.visual,I,_e),this.positionGrip(this.controlGrips.bottomCenter.visual,U,_e),this.positionGrip(this.controlGrips.bottomRight.visual,tt,_e),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,U,J-3*this.CB_DISTANCE)},l.prototype.positionGrip=function(p,I,J){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,J),p.transform.baseVal.replaceItem(U,0)},l.prototype.hideControlBox=function(){this.controlBox.style.display="none"},l.prototype.showControlBox=function(){this.controlBox.style.display=""},l.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:et.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:et.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},j.prototype.getState.call(this))},l.prototype.restoreState=function(p){j.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(et.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,I.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(et.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,I.containerTransformMatrix))},l.prototype.scale=function(p,I){j.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()},l}(Ie),Ke=function(j){function l(p,I,J){var U=j.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 Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual)},l.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)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},l.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){j.prototype.resize.call(this,p),this.setSize()},l.prototype.setSize=function(){j.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},l.prototype.pointerUp=function(p){j.prototype.pointerUp.call(this,p),this.setSize()},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},l.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},l.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this))},l.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(),j.prototype.restoreState.call(this,p),this.setSize()},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize()},l.title="Rectangle marker",l}(Xe),ct=function(j){function l(p,I,J,U){var he=j.call(this,p,U||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return he.widths=[],he.widthBoxes=[],he.widths=I,he.currentWidth=J,he.setCurrentWidth=he.setCurrentWidth.bind(he),he}return Ee(l,j),l.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 he=document.createElement("div");he.innerText=J.toString(),he.style.marginRight="5px",U.appendChild(he);var _e=document.createElement("div");_e.style.minHeight="20px",_e.style.flexGrow="2",_e.style.display="flex",_e.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=J+"px solid "+p.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",_e.appendChild(tt),U.appendChild(_e),p.widthBoxes.push(U)}),I},l.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)},l}(qe),rt=function(j){function l(p,I,J,U){var he=j.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 he.styles=[],he.styleBoxes=[],he.styles=I,he.currentStyle=J,he.setCurrentStyle=he.setCurrentStyle.bind(he),he}return Ee(l,j),l.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 he=document.createElement("div");he.style.minHeight="20px",he.style.flexGrow="2",he.style.overflow="hidden";var _e=`<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>`;he.innerHTML=_e,U.appendChild(he),p.styleBoxes.push(U)}),I},l.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)},l}(qe),at=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.strokeColor=J.defaultColor,U.strokeWidth=J.defaultStrokeWidth,U.strokeDasharray=J.defaultStrokeDasharray,U.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ct("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 Ee(l,j),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="FrameMarker",l.title="Frame marker",l.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',l}(Ke),Ae=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},dt=function(j){function l(p,I,J){var U=j.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 Ee(l,j),l.prototype.ownsTarget=function(p){return!!j.prototype.ownsTarget.call(this,p)||!(!this.grip1.ownsTarget(p)&&!this.grip2.ownsTarget(p))},l.prototype.pointerDown=function(p,I){j.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")},l.prototype.pointerUp=function(p){var I=this.state;j.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)},l.prototype.adjustVisual=function(){},l.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)},l.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()},l.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},l.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},l.prototype.adjustControlBox=function(){this.positionGrips()},l.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},l.prototype.createGrip=function(){var p=new $e;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},l.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)},l.prototype.positionGrip=function(p,I,J){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,J),p.transform.baseVal.replaceItem(U,0)},l.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},j.prototype.getState.call(this))},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.x1=I.x1,this.y1=I.y1,this.x2=I.x2,this.y2=I.y2},l.prototype.scale=function(p,I){j.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()},l}(Ie),ot=function(j){function l(p,I,J){var U=j.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 Qe("Line color",J.defaultColorSet,J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ct("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 Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorLine&&p!==this.visibleLine)},l.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)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},l.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()]]))},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.createVisual(),this.adjustVisual()},l.typeName="LineMarker",l.title="Line marker",l.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',l}(dt),we=function(j){function l(p,I,J,U){var he=j.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 he.fonts=[],he.fontBoxes=[],he.fonts=I,he.currentFont=J,he.setCurrentFont=he.setCurrentFont.bind(he),he}return Ee(l,j),l.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 he=document.createElement("div");he.style.display="flex",he.style.minHeight="20px",he.style.flexGrow="2",he.style.fontFamily=J,he.style.overflow="hidden";var _e=document.createElement("div");_e.style.whiteSpace="nowrap",_e.style.overflow="hidden",_e.style.textOverflow="ellipsis",_e.innerHTML="The quick brown fox jumps over the lazy dog",he.appendChild(_e),U.appendChild(he),p.fontBoxes.push(U)}),I},l.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)},l}(qe),Fe=function(j){function l(p,I,J){var U=j.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 Qe("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 Ee(l,j),l.prototype.ownsTarget=function(p){if(j.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},l.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()},l.prototype.pointerDown=function(p,I){j.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")},l.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)}},l.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},l.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}},l.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))},l.prototype.manipulate=function(p){j.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)},l.prototype.resize=function(p){j.prototype.resize.call(this,p),this.isMoved=!0,this.setSize(),this.sizeText()},l.prototype.setSize=function(){j.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()]]))},l.prototype.pointerUp=function(p){var I=this.state;I==="creating"&&(this._suppressMarkerCreateEvent=!0),j.prototype.pointerUp.call(this,p),this.setSize(),(I==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},l.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")},l.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"}},l.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()},l.prototype.select=function(){j.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},l.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),j.prototype.deselect.call(this)},l.prototype.dblClick=function(p,I){j.prototype.dblClick.call(this,p,I),this.showTextEditor()},l.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)},l.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()},l.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},l.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.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(),j.prototype.restoreState.call(this,p),this.setSize()},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize(),this.sizeText(),this.positionTextEditor()},l.typeName="TextMarker",l.title="Text marker",l.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>',l}(Xe),ge=function(j){function l(p,I,J){var U=j.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 Qe("Color",J.defaultColorSet,J.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.lineWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.lineWidthPanel.onWidthChanged=U.setLineWidth,U}return Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.drawingImage)},l.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)},l.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):j.prototype.pointerDown.call(this,p,I)},l.prototype.manipulate=function(p){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(p.x,p.y),this.canvasContext.stroke()):j.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){j.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()]])},l.prototype.pointerUp=function(p){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):j.prototype.pointerUp.call(this,p)},l.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)},l.prototype.select=function(){this.state==="creating"&&this.finishCreation(),j.prototype.select.call(this)},l.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),j.prototype.deselect.call(this)},l.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],he=I[2],_e=I[3],tt=!1,gt=0;gt<this.canvasElement.height;gt++)for(var je=0;je<this.canvasElement.width;je++)p.data[gt*this.canvasElement.width*4+4*je+3]>0&&(tt=!0,gt<U&&(U=gt),je<J&&(J=je),gt>_e&&(_e=gt),je>he&&(he=je));if(tt){this.left=J/this.pixelRatio,this.top=U/this.pixelRatio,this.width=(he-J)/this.pixelRatio,this.height=(_e-U)/this.pixelRatio;var Ct=document.createElement("canvas");Ct.width=he-J,Ct.height=_e-U,Ct.getContext("2d").putImageData(this.canvasContext.getImageData(J,U,he-J,_e-U),0,0),this.drawingImgUrl=Ct.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},l.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})},l.prototype.setColor=function(p){this.color=p,this.colorChanged(p)},l.prototype.setLineWidth=function(p){this.lineWidth=p},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({drawingImgUrl:this.drawingImgUrl},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){this.createVisual(),j.prototype.restoreState.call(this,p),this.drawingImgUrl=p.drawingImgUrl,this.setDrawingImage()},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setDrawingImage()},l.typeName="FreehandMarker",l.title="Freehand marker",l.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>',l}(Xe),de=function(j){function l(p,I,J){var U=j.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 Ee(l,j),l.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(_e){var tt="both";switch(_e){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var gt=document.createElement("div");if(gt.style.display="flex",gt.style.flexGrow="2",gt.style.alignItems="center",gt.style.justifyContent="space-between",gt.style.padding="5px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderColor=tt===U.currentType?U.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){p.setCurrentType(tt,gt)}),I.appendChild(gt),tt==="both"||tt==="start"){var je=document.createElement("div");je.style.display="flex",je.style.alignItems="center",je.style.minHeight="20px",je.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>`,je.style.marginLeft="5px",gt.appendChild(je)}var Ct=document.createElement("div");Ct.style.display="flex",Ct.style.alignItems="center",Ct.style.minHeight="20px",Ct.style.flexGrow="2";var Gt=document.createElement("hr");if(Gt.style.minWidth="20px",Gt.style.border="0px",Gt.style.borderTop="3px solid "+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee"),Gt.style.flexGrow="2",Ct.appendChild(Gt),gt.appendChild(Ct),tt==="both"||tt==="end"){var er=document.createElement("div");er.style.display="flex",er.style.alignItems="center",er.style.minHeight="20px",er.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>`,er.style.marginRight="5px",gt.appendChild(er)}U.typeBoxes.push(gt)},U=this,he=0;he<4;he++)J(he);return I},l.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)},l}(qe),fe=function(j){function l(p,I,J){var U=j.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 Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.arrow1&&p!==this.arrow2)},l.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)},l.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)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},l.prototype.adjustVisual=function(){if(j.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)}},l.prototype.setArrowType=function(p){this.arrowType=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({arrowType:this.arrowType},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.arrowType=I.arrowType,this.createTips(),this.adjustVisual()},l.typeName="ArrowMarker",l.title="Arrow marker",l.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',l}(ot),te=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.fillColor=J.defaultFillColor,U.strokeWidth=0,U.fillPanel=new Qe("Color",J.defaultColorSet,J.defaultFillColor),U.fillPanel.onColorChanged=U.setFillColor,U}return Ee(l,j),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="CoverMarker",l.title="Cover marker",l.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',l}(Ke),re=function(j){function l(p,I,J,U){var he=j.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 he.opacities=[],he.opacityBoxes=[],he.opacities=I,he.currentOpacity=J,he.setCurrentOpacity=he.setCurrentOpacity.bind(he),he}return Ee(l,j),l.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 he=document.createElement("div");he.innerText=100*J+"%",U.appendChild(he),p.opacityBoxes.push(U)}),I},l.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)},l}(qe),ne=function(j){function l(p,I,J){var U=j.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 Qe("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 Ee(l,j),l.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="HighlightMarker",l.title="Highlight marker",l.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>',l}(te),le='<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>',pe=function(j){function l(p,I,J){var U=j.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 Qe("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 Qe("Fill color",J.defaultColorSet,U.bgColor,le),U.bgColorPanel.onColorChanged=U.setBgColor,U.fontFamilyPanel=new we("Font",J.defaultFontFamilies,J.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U.tipGrip=new $e,U.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),U.controlBox.appendChild(U.tipGrip.visual),U}return Ee(l,j),l.prototype.ownsTarget=function(p){return j.prototype.ownsTarget.call(this,p)||this.tipGrip.ownsTarget(p)||this.tip===p},l.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)},l.prototype.pointerDown=function(p,I){this.state==="new"&&j.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):j.prototype.pointerDown.call(this,p,I)},l.prototype.pointerUp=function(p){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,j.prototype.pointerUp.call(this,p);else{var I=this.state==="creating";j.prototype.pointerUp.call(this,p),this.setTipPoints(I),this.positionTip()}},l.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 j.prototype.manipulate.call(this,p)},l.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)},l.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},l.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})},l.prototype.resize=function(p){j.prototype.resize.call(this,p),this.positionTip()},l.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(l.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),l.prototype.select=function(){this.positionTip(),j.prototype.select.call(this)},l.prototype.getState=function(){var p=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){var I=p;this.bgColor=I.bgColor,this.tipPosition=I.tipPosition,j.prototype.restoreState.call(this,p),this.createTip(),this.setTipPoints()},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.tipPosition={x:this.tipPosition.x*p,y:this.tipPosition.y*I},this.positionTip()},l.typeName="CalloutMarker",l.title="Callout marker",l.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>',l}(Fe),Ce=function(j){function l(p,I,J){var U=j.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 Qe("Line color",me(J.defaultColorSet,["transparent"]),J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.fillPanel=new Qe("Fill color",me(J.defaultColorSet,["transparent"]),U.fillColor,le),U.fillPanel.onColorChanged=U.setFillColor,U.strokeWidthPanel=new ct("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 Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual)},l.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)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},l.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){j.prototype.resize.call(this,p),this.setSize()},l.prototype.setSize=function(){j.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()]])},l.prototype.pointerUp=function(p){j.prototype.pointerUp.call(this,p),this.setSize()},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},l.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(p),this.stateChanged()},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},l.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.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(),j.prototype.restoreState.call(this,p),this.setSize()},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize()},l.typeName="EllipseMarker",l.title="Ellipse marker",l.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>',l}(Xe),Oe=function(j){function l(p,I,J){return j.call(this,p,I,J)||this}return Ee(l,j),Object.defineProperty(l.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.tip1&&p!==this.tip2)},l.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)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},l.prototype.adjustVisual=function(){if(j.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(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p),this.createTips(),this.adjustVisual()},l.typeName="MeasurementMarker",l.title="Measurement marker",l.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>',l}(ot),st=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.strokePanel.colors=J.defaultColorSet,U.fillColor="transparent",U}return Ee(l,j),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="EllipseFrameMarker",l.title="Ellipse frame marker",l.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>',l}(Ce),mt=function(){function j(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),j.prototype.addUndoStep=function(l){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(l)||(this.undoStack.push(l),JSON.stringify(this.lastRedoStep)!==JSON.stringify(l)&&this.redoStack.splice(0,this.redoStack.length))},j.prototype.replaceLastUndoStep=function(l){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=l)},j.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},j.prototype.undo=function(){if(this.undoStack.length>1){var l=this.undoStack.pop();return l!==void 0&&this.redoStack.push(l),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},j.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},j}(),ht=function(j){function l(p,I,J){var U=j.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 Qe("Line color",J.defaultColorSet,J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ct("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 Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorCurve&&p!==this.visibleCurve&&!this.curveGrip.ownsTarget(p))},l.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},l.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)},l.prototype.pointerDown=function(p,I){j.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")},l.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()]]))},l.prototype.setupControlBox=function(){j.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)},l.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,j.prototype.addControlGrips.call(this)},l.prototype.positionGrips=function(){j.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()))},l.prototype.manipulate=function(p){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+p.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+p.y-this.manipulationStartY),j.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){this.activeGrip===this.curveGrip&&(this.curveX=p.x,this.curveY=p.y),j.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)},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual()},l.prototype.scale=function(p,I){this.curveX=this.curveX*p,this.curveY=this.curveY*I,j.prototype.scale.call(this,p,I)},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){j.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()},l.typeName="CurveMarker",l.title="Curve marker",l.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>',l}(dt),Rt=function(){function j(l,p){p===void 0&&(p=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=l,this.cancelable=p}return Object.defineProperty(j.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),j.prototype.preventDefault=function(){this._defaultPrevented=!0},j}(),At=function(j){function l(p,I,J){var U=j.call(this,p,!1)||this;return U.dataUrl=I,U.state=J,U}return Ee(l,j),l}(Rt),ft=function(j){function l(p,I,J){J===void 0&&(J=!1);var U=j.call(this,p,J)||this;return U.marker=I,U}return Ee(l,j),l}(Rt),Ft=function(){function j(){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 j.prototype.addEventListener=function(l,p){this[l].push(p)},j.prototype.removeEventListener=function(l,p){var I=this[l].indexOf(p);I>-1&&this[l].splice(I,1)},j}(),kt=function(){function j(l){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ae,this._isOpen=!1,this.undoRedoManager=new mt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=j.instanceCounter++,this.styles=new Je(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=l,this.targetRoot=document.body,this.width=l.clientWidth,this.height=l.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(j.prototype,"ALL_MARKER_TYPES",{get:function(){return[at,ge,fe,Fe,st,Ce,ne,pe,Oe,te,ot,ht]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[at,ge,fe,Fe,Ce,ne,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"BASIC_MARKER_TYPES",{get:function(){return[at,ge,fe,Fe,ne]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(l){var p=this;this._availableMarkerTypes.splice(0),l.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(j.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(l){this._zoomLevel=l,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(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),j.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},j.prototype.show=function(){var l=this;this.styles.styleSheetRoot===void 0&&We.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=We.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(p){return p(new Rt(l))})},j.prototype.render=function(){return Te(this,void 0,void 0,function(){var l;return Se(this,function(p){switch(p.label){case 0:return this.setCurrentMarker(),(l=new Ve).naturalSize=this.renderAtNaturalSize,l.imageType=this.renderImageType,l.imageQuality=this.renderImageQuality,l.markersOnly=this.renderMarkersOnly,l.width=this.renderWidth,l.height=this.renderHeight,[4,l.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return p.sent(),[4,l.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,p.sent()]}})})},j.prototype.close=function(l){var p=this;if(l===void 0&&(l=!1),this.isOpen){var I=!1;l||this.eventListeners.beforeclose.forEach(function(J){var U=new Rt(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 Rt(p))}),this.detachEvents(),this._isOpen=!1)}},j.prototype.addMarkersToToolbar=function(){for(var l,p=[],I=0;I<arguments.length;I++)p[I]=arguments[I];(l=this._availableMarkerTypes).push.apply(l,p)},j.prototype.addRenderEventListener=function(l){this.addEventListener("render",function(p){l(p.dataUrl,p.state)})},j.prototype.removeRenderEventListener=function(l){},j.prototype.addCloseEventListener=function(l){this.addEventListener("close",function(){l()})},j.prototype.removeCloseEventListener=function(l){},j.prototype.setupResizeObserver=function(){var l=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){l.resize(l.target.clientWidth,l.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return l.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},j.prototype.onPopupTargetResize=function(){var l=1*this.target.clientWidth/this.target.clientHeight,p=this.editorCanvas.clientWidth/l>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*l:this.editorCanvas.clientWidth,I=p<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/l;this.resize(p,I)},j.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},j.prototype.resize=function(l,p){this._isResizing=!0;var I=l/this.imageWidth,J=p/this.imageHeight;this.imageWidth=Math.round(l),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},j.prototype.scaleMarkers=function(l,p){var I,J=this;this._currentMarker&&this._currentMarker instanceof Fe?this._currentMarker.scale(l,p):(I=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(U){U!==J._currentMarker&&U.scale(l,p)}),I!==void 0&&this.setCurrentMarker(I)},j.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"},j.prototype.setTopLeft=function(){var l=this.editingTarget.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=l.left-p.left,this.top=l.top-p.top},j.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)},j.prototype.addDefs=function(){for(var l,p=[],I=0;I<arguments.length;I++)p[I]=arguments[I];this.defs=se.createDefs(),this.addDefsToImage(),(l=this.defs).append.apply(l,p)},j.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},j.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)},j.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},j.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},j.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)},j.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},j.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)},j.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 l=document.createElement("a");l.href="https://markerjs.com/",l.target="_blank",l.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>',l.title="Powered by marker.js",l.style.display="grid",l.style.alignItems="center",l.style.justifyItems="center",l.style.padding="3px",l.style.width="20px",l.style.height="20px",this.logoUI.appendChild(l),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},j.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")},j.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"},j.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},j.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 l=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=l+"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 Ue(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 Be(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},j.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},j.prototype.removeMarker=function(l){this.markerImage.removeChild(l.container),this.markers.indexOf(l)>-1&&this.markers.splice(this.markers.indexOf(l),1),l.dispose()},j.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())},j.prototype.toolbarButtonClicked=function(l,p){if(l==="marker"&&p!==void 0)this.createNewMarker(p);else if(l==="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()}},j.prototype.deleteSelectedMarker=function(){var l=this;if(this._currentMarker!==void 0){var p=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var U=new ft(l,l._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 ft(l,I))})}}},j.prototype.clear=function(){var l=this,p=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(he){var _e=new ft(l,void 0,!0);he(_e),_e.defaultPrevented&&(p=!0)}),!p)){this.setCurrentMarker();for(var I=function(he){var _e=J.markers[he];J.setCurrentMarker(J.markers[he]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(tt){return tt(new ft(l,_e))})},J=this,U=this.markers.length-1;U>=0;U--)I(U);this.addUndoStep()}},Object.defineProperty(j.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),j.prototype.showNotesEditor=function(){var l;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=(l=this._currentMarker.notes)!==null&&l!==void 0?l:"",this.overlayContainer.appendChild(this.notesArea))},j.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)},j.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},j.prototype.addUndoStep=function(){var l=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 Rt(l))})}else this.undoRedoManager.replaceLastUndoStep(p),this.eventListeners.statechange.forEach(function(U){return U(new Rt(l))})}},j.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},j.prototype.undoStep=function(){var l=this,p=this.undoRedoManager.undo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(I){return I(new Rt(l))}))},j.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},j.prototype.redoStep=function(){var l=this,p=this.undoRedoManager.redo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(I){return I(new Rt(l))}))},j.prototype.stepZoom=function(){var l=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=l<this.zoomSteps.length-1?this.zoomSteps[l+1]:this.zoomSteps[0]},j.prototype.panTo=function(l){this.contentDiv.scrollBy({left:this.prevPanPoint.x-l.x,top:this.prevPanPoint.y-l.y}),this.prevPanPoint=l},j.prototype.startRenderAndClose=function(){return Te(this,void 0,void 0,function(){var l,p,I=this;return Se(this,function(J){switch(J.label){case 0:return[4,this.render()];case 1:return l=J.sent(),p=this.getState(),this.eventListeners.render.forEach(function(U){return U(new At(I,l,p))}),this.close(!0),[2]}})})},j.prototype.getState=function(l){l===!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},j.prototype.restoreState=function(l){var p=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);l.markers.forEach(function(I){var J=p._availableMarkerTypes.find(function(he){return he.typeName===I.typeName});if(J!==void 0){var U=p.addNewMarker(J);U.restoreState(I),p.markers.push(U)}}),l.width&&l.height&&(l.width!==this.imageWidth||l.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/l.width,this.imageHeight/l.height),this.eventListeners.restorestate.forEach(function(I){return I(new Rt(p))})},j.prototype.addNewMarker=function(l){var p=se.createGroup();return this.markerImage.appendChild(p),new l(p,this.overlayContainer,this.settings)},j.prototype.createNewMarker=function(l){var p,I=this;(p=typeof l=="string"?this._availableMarkerTypes.find(function(J){return J.typeName===l}):l)&&(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 ft(I,I._currentMarker))}))},j.prototype.markerCreated=function(l){var p=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(l),this.setCurrentMarker(l),l instanceof ge&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ge):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(I){return I(new ft(p,p._currentMarker))})},j.prototype.colorChanged=function(l){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=l,this.settings.defaultStrokeColor=l)},j.prototype.fillColorChanged=function(l){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=l)},j.prototype.markerStateChanged=function(l){var p=this;this.eventListeners.markerchange.forEach(function(I){return I(new ft(p,l))})},j.prototype.setCurrentMarker=function(l){var p=this;this._currentMarker!==l&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(I){return I(new ft(p,p._currentMarker))})),this._currentMarker=l,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 ft(p,p._currentMarker))}))},j.prototype.onPointerDown=function(l){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||l.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(l.target)});p!==void 0?(this.setCurrentMarker(p),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(l.clientX,l.clientY),l.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:l.clientX,y:l.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(l.clientX,l.clientY))},j.prototype.onDblClick=function(l){if(this._isFocused||this.focus(),this.mode==="select"){var p=this.markers.find(function(I){return I.ownsTarget(l.target)});p!==void 0&&p!==this._currentMarker&&this.setCurrentMarker(p),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(l.clientX,l.clientY),l.target):this.setCurrentMarker()}},j.prototype.onPointerMove=function(l){this.touchPoints!==1&&l.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||l.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(l.clientX,l.clientY)):this.zoomLevel>1&&this.panTo({x:l.clientX,y:l.clientY}))},j.prototype.onPointerUp=function(l){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(l.clientX,l.clientY)),this.isDragging=!1,this.addUndoStep()},j.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},j.prototype.onKeyUp=function(l){this._currentMarker===void 0||this.notesArea!==void 0||l.key!=="Delete"&&l.key!=="Backspace"||this.deleteSelectedMarker()},j.prototype.clientToLocalCoordinates=function(l,p){var I=this.markerImage.getBoundingClientRect();return{x:(l-I.left)/this.zoomLevel,y:(p-I.top)/this.zoomLevel}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var l=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=l+"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()},j.prototype.addLicenseKey=function(l){Re.addKey(l)},j.prototype.addEventListener=function(l,p){this.eventListeners.addEventListener(l,p)},j.prototype.removeEventListener=function(l,p){this.eventListeners.removeEventListener(l,p)},j.prototype.renderState=function(l){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(l),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(j.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),j.prototype.focus=function(){var l=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 Rt(l))}))},j.prototype.blur=function(){var l=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(p){return p(new Rt(l))}))},j.instanceCounter=0,j}();/* **********************************
|
|
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 Ht=function(j,l){return(Ht=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])})(j,l)};function It(j,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function p(){this.constructor=j}Ht(j,l),j.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)}function xt(j,l,p,I){return new(p||(p=Promise))(function(J,U){function he(gt){try{tt(I.next(gt))}catch(je){U(je)}}function _e(gt){try{tt(I.throw(gt))}catch(je){U(je)}}function tt(gt){var je;gt.done?J(gt.value):(je=gt.value,je instanceof p?je:new p(function(Ct){Ct(je)})).then(he,_e)}tt((I=I.apply(j,l||[])).next())})}function Mt(j,l){var p,I,J,U,he={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return U={next:_e(0),throw:_e(1),return:_e(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function _e(tt){return function(gt){return function(je){if(p)throw new TypeError("Generator is already executing.");for(;he;)try{if(p=1,I&&(J=2&je[0]?I.return:je[0]?I.throw||((J=I.return)&&J.call(I),0):I.next)&&!(J=J.call(I,je[1])).done)return J;switch(I=0,J&&(je=[2&je[0],J.value]),je[0]){case 0:case 1:J=je;break;case 4:return he.label++,{value:je[1],done:!1};case 5:he.label++,I=je[1],je=[0];continue;case 7:je=he.ops.pop(),he.trys.pop();continue;default:if(!(J=he.trys,(J=J.length>0&&J[J.length-1])||je[0]!==6&&je[0]!==2)){he=0;continue}if(je[0]===3&&(!J||je[1]>J[0]&&je[1]<J[3])){he.label=je[1];break}if(je[0]===6&&he.label<J[1]){he.label=J[1],J=je;break}if(J&&he.label<J[2]){he.label=J[2],he.ops.push(je);break}J[2]&&he.ops.pop(),he.trys.pop();continue}je=l.call(j,he)}catch(Ct){je=[6,Ct],I=0}finally{p=J=0}if(5&je[0])throw je[1];return{value:je[0]?je[1]:void 0,done:!0}}([tt,gt])}}}var jt=function(){function j(){}return j.addKey=function(l){j.key=l},Object.defineProperty(j,"isLicensed",{get:function(){return!!j.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(j.key)},enumerable:!1,configurable:!0}),j}(),lt=function(){function j(){}return j.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},j.setAttributes=function(l,p){for(var I=0,J=p;I<J.length;I++){var U=J[I],he=U[0],_e=U[1];l.setAttribute(he,_e)}},j.createRect=function(l,p,I){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",l.toString()),J.setAttribute("height",p.toString()),I&&j.setAttributes(J,I),J},j.createLine=function(l,p,I,J,U){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",l.toString()),he.setAttribute("y1",p.toString()),he.setAttribute("x2",I.toString()),he.setAttribute("y2",J.toString()),U&&j.setAttributes(he,U),he},j.createPolygon=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","polygon");return I.setAttribute("points",l),p&&j.setAttributes(I,p),I},j.createCircle=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","circle");return I.setAttribute("cx",(l/2).toString()),I.setAttribute("cy",(l/2).toString()),I.setAttribute("r",l.toString()),p&&j.setAttributes(I,p),I},j.createEllipse=function(l,p,I){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(l/2).toString()),J.setAttribute("cy",(p/2).toString()),J.setAttribute("rx",(l/2).toString()),J.setAttribute("ry",(p/2).toString()),I&&j.setAttributes(J,I),J},j.createGroup=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return l&&j.setAttributes(p,l),p},j.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},j.createMarker=function(l,p,I,J,U,he,_e){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return j.setAttributes(tt,[["id",l],["orient",p],["markerWidth",I.toString()],["markerHeight",J.toString()],["refX",U.toString()],["refY",he.toString()]]),tt.appendChild(_e),tt},j.createText=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),l&&j.setAttributes(p,l),p},j.createTSpan=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","tspan");return I.textContent=l,p&&j.setAttributes(I,p),I},j.createImage=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return l&&j.setAttributes(p,l),p},j.createPoint=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return I.x=l,I.y=p,I},j.createPath=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg","path");return I.setAttribute("d",l),p&&j.setAttributes(I,p),I},j.createElement=function(l,p){var I=document.createElementNS("http://www.w3.org/2000/svg",l);return p&&j.setAttributes(I,p),I},j.getHollowRectanglePath=function(l,p,I,J,U,he,_e,tt){return"M"+l+","+p+"V"+(p+J)+"H"+(l+I)+"V"+p+"H"+U+"V"+he+"H"+(U+_e)+"V"+(he+tt)+"H"+U+"V"+p+"Z"},j}(),$t=function(){function j(l){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+l+"_"}return Object.defineProperty(j.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(j.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(j.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),j.prototype.addClass=function(l){return this.styleSheet===void 0&&this.addStyleSheet(),l.name=""+this.classNamePrefix+l.localName,this.classes.push(l),this.styleSheet.sheet.insertRule("."+l.name+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length),l},j.prototype.addRule=function(l){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(l),this.styleSheet.sheet.insertRule(l.selector+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length)},j.prototype.addStyleSheet=function(){var l;this.styleSheet=document.createElement("style"),((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).appendChild(this.styleSheet),this.addRule(new ar("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ar("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ar("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ir("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ir("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},j.prototype.removeStyleSheet=function(){var l;this.styleSheet&&(((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},j}(),ar=function(j,l){this.selector=j,this.style=l},ir=function(j,l){this.localName=j,this.style=l},Mr=function(){function j(){this.blocks=[],this.display=""}return j.prototype.addButtonBlock=function(l){l.className=this.blockClassName,l.buttonClassName=this.buttonClassName,l.buttonColorsClassName=this.buttonColorsClassName,l.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(l)},j.prototype.addElementBlock=function(l){l.className===void 0&&(l.className=this.blockClassName),this.blocks.push(l)},j.prototype.getUI=function(){var l=document.createElement("div");return l.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,l.style.display=this.display,this.blocks.forEach(function(p){return l.appendChild(p.getUI())}),l},j}(),ti=function(){function j(){}return j.prototype.getUI=function(){var l=document.createElement("div");if(l.className=this.className,this.minWidth!==void 0&&(l.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":l.style.justifyContent="flex-start";break;case"center":l.style.justifyContent="center";break;case"end":l.style.justifyContent="flex-end"}return l.style.whiteSpace="nowrap",l},j}(),Xt=function(j){function l(){var p=j!==null&&j.apply(this,arguments)||this;return p.buttons=[],p}return It(l,j),l.prototype.addButton=function(p){p.className=this.buttonClassName,p.colorsClassName=this.buttonColorsClassName,p.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(p)},l.prototype.getUI=function(){var p=j.prototype.getUI.call(this);return this.buttons.forEach(function(I){return p.appendChild(I.getUI())}),p},l}(ti),yt=function(){function j(l,p){this._isActive=!1,this._isHidden=!1,this._icon=l,this.title=p,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(j.prototype,"icon",{get:function(){return this._icon},set:function(l){this._icon=l,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isActive",{get:function(){return this._isActive},set:function(l){this._isActive=l,this.adjustClassName()},enumerable:!1,configurable:!0}),j.prototype.getUI=function(){var l=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 l.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},j.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,"")))},j.prototype.hide=function(){this._isHidden=!0},j}(),ze=function(j){function l(){var p=j!==null&&j.apply(this,arguments)||this;return p.elements=[],p}return It(l,j),l.prototype.addElement=function(p){this.elements.push(p)},l.prototype.getUI=function(){var p=j.prototype.getUI.call(this);return this.elements.forEach(function(I){return p.appendChild(I)}),p},l}(ti),Kt=function(){function j(l,p){this.horizontal=l,this.vertical=p}return Object.defineProperty(j.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),j.prototype.getVerticalLength=function(l){return l/this.ratio},j.prototype.getHorizontalLength=function(l){return l*this.ratio},j}(),wt=function(){function j(){}return j.getIcon=function(l,p){if(l>0&&p>0){var I=new Kt(l,p),J=I.ratio>=1?20:I.getHorizontalLength(20),U=I.ratio<1?20:I.getVerticalLength(20),he=document.createElementNS("http://www.w3.org/2000/svg","svg");he.setAttribute("xmlns","http://www.w3.org/2000/svg"),he.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(he);var _e=lt.createDefs();he.appendChild(_e);var tt=lt.createElement("clipPath",[["id","text-bg-clip"]]);_e.appendChild(tt);var gt=lt.createPath(lt.getHollowRectanglePath((24-J)/2,(24-U)/2,J,U,(24-J)/2+2,(24-U)/2+2,J-4,U-4));he.appendChild(gt);var je=lt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);je.appendChild(lt.createTSpan(l+":"+p)),he.appendChild(je);var Ct=je.getBBox();lt.setAttributes(je,[["x",((24-Ct.width)/2).toString()],["y",((24-Ct.height)/2-Ct.y).toString()]]);var Gt=lt.createPath(lt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ct.width))/2,(24-Math.ceil(Ct.height))/2,Math.ceil(Ct.width),Math.ceil(Ct.height)));return tt.appendChild(Gt),lt.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(he),he.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>'},j}(),tr=function(j){function l(p,I,J){var U=j.call(this,p,I)||this;return U.isDropdownOpen=!1,U.onClick=U.dropdownButtonClicked,U.dropdownButtons=J,U}return It(l,j),l.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)},l.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},l.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},l.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},l.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},l.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},l}(yt),Ot=function(){function j(l,p){this.GRIP_SIZE=10,this.color=l,this.fillColor=p,this.visual=lt.createGroup(),this.visual.appendChild(lt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(lt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},j.prototype.setCenter=function(l,p){this.visual.childNodes.forEach(function(I){return lt.setAttributes(I,[["cx",l.toString()],["cy",p.toString()]])})},j}(),ur=function(){function j(l,p,I,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=l,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(j.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(l){this._aspectRatio=l,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(l){this._isGridVisible=l,this.gridContainer&<.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(l){this._zoomFactor=l,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),j.prototype.open=function(){var l=this;this.cropShadeElement=lt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=lt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var p=0;p<this.numberOfGridLines;p++)this.horizontalGridLines.push(lt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(lt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(I){return l.gridContainer.appendChild(I)}),this.verticalGridLines.forEach(function(I){return l.gridContainer.appendChild(I)}),this.cropRectElement=lt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},j.prototype.setCropRectangle=function(l){this.cropRect=l;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),lt.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,he){var _e=p.y+I*(he+1);lt.setAttributes(U,[["x1",""+p.x],["y1",""+_e],["x2",""+(p.x+p.width)],["y2",""+_e]])});var J=p.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(U,he){var _e=p.x+J*(he+1);lt.setAttributes(U,[["x1",""+_e],["y1",""+p.y],["x2",""+_e],["y2",""+(p.y+p.height)]])}),lt.setAttributes(this.cropShadeElement,[["d",lt.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},j.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)},j.prototype.clientToLocalCoordinates=function(l,p){var I=this.container.getBoundingClientRect();return{x:l-I.left+this.margin,y:p-I.top+this.margin}},j.prototype.onPointerDown=function(l){this.container.setPointerCapture(l.pointerId),this.previousPoint=this.clientToLocalCoordinates(l.clientX,l.clientY),this.cropRectElement===l.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(l.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(l.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(l.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(l.target)&&(this.activeGrip=this.bottomRightGrip)},j.prototype.onPointerMove=function(l){if(this.isMoving)this.move(this.clientToLocalCoordinates(l.clientX,l.clientY));else if(this.activeGrip){var p=this.clientToLocalCoordinates(l.clientX,l.clientY);this.resize(p)}l.preventDefault()},j.prototype.onPointerUp=function(l){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(l.pointerId)},j.prototype.move=function(l){var p=l.x-this.previousPoint.x,I=l.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=l},j.prototype.resize=function(l){var p=Object.assign({},this.cropRect),I=l.x-this.previousPoint.x,J=l.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=l,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))},j.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var l=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=l-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)}},j.prototype.getRescaledRect=function(l,p,I,J,U,he){var _e=I/l,tt=J/p;return{x:(U.x-he)*_e+he,y:(U.y-he)*tt+he,width:U.width*_e,height:U.height*tt}},j.prototype.scaleCanvas=function(l,p){var I=this.getRescaledRect(this.canvasWidth,this.canvasHeight,l,p,this.cropRect,this.margin);this.canvasWidth=l,this.canvasHeight=p,this.onCropChange&&this.onCropChange(I),this.setCropRectangle(I)},j}(),bt=function(){function j(l){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=l,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(j.prototype,"angle",{get:function(){return this._angle},set:function(l){this._angle=l,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),j.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},j.prototype.onPointerDown=function(l){this.controlContainer.setPointerCapture(l.pointerId),this.isDragging=!0,this.previousPoint={x:l.clientX,y:l.clientY}},j.prototype.onPointerMove=function(l){this.isDragging&&(this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.previousPoint.x=l.clientX)},j.prototype.onPointerUp=function(l){this.isDragging&&this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(l.pointerId)},j.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var l=this.angleLabelText.getBBox();lt.setAttributes(this.angleLabelElement,[["x",((this.width-l.width)/2).toString()],["y",(this.height/2).toString()]])}},j.prototype.positionScaleShape=function(){if(this.scaleShape){var l=this.scaleShape.transform.baseVal.getItem(0);l.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(l,0)}},j.prototype.getVisual=function(){var l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("xmlns","http://www.w3.org/2000/svg"),l.setAttribute("width",this.width+"px"),l.setAttribute("height",this.height+"px"),l.setAttribute("viewBox","0 0 "+this.width+" "+this.height),l.style.flexShrink="0",document.body.appendChild(l);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=lt.createPath(p);var U=lt.createTransform();this.scaleShape.transform.baseVal.appendItem(U),l.appendChild(this.scaleShape),this.angleLabelElement=lt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=lt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var he=lt.createTSpan("");return he.innerHTML="°",this.angleLabelElement.appendChild(he),l.appendChild(this.angleLabelElement),document.body.removeChild(l),l},j}(),ri=function(){function j(){this.naturalSize=!1,this.imageType="image/png"}return j.prototype.rasterize=function(l,p,I,J,U,he,_e){var tt=this;return new Promise(function(gt){var je=document.createElement("canvas");je.width=l.width.baseVal.value-2*J,je.height=l.height.baseVal.value-2*J;var Ct=1,Gt=1;tt.naturalSize===!0?(Ct=p.naturalWidth/(l.width.baseVal.value-2*J)/he,Gt=p.naturalHeight/(l.height.baseVal.value-2*J)/_e,je.width=p.naturalWidth/he,je.height=p.naturalHeight/_e):tt.width!==void 0&&tt.height!==void 0&&(Ct=tt.width/I.width,Gt=tt.height/I.height,je.width*=Ct,je.height*=Gt);var er=je.getContext("2d");er.translate(je.width/2,je.height/2),er.rotate(U*Math.PI/180),er.scale(he,_e),er.translate(-je.width/2,-je.height/2),er.drawImage(p,0,0,je.width,je.height);var jr=document.createElement("canvas");jr.width=I.width*Ct,jr.height=I.height*Gt,jr.getContext("2d").putImageData(er.getImageData((I.x-J)*Ct,(I.y-J)*Gt,I.width*Ct,I.height*Gt),0,0),gt(jr.toDataURL(tt.imageType,tt.imageQuality))})},j}(),Ge=function(){function j(l){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=j.instanceCounter++,this.styles=new $t(this.instanceNo),this.target=l,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(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(l){this._zoomToCropEnabled=l,l?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(l){this._isGridVisible=l,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"gridLines",{get:function(){return this._gridLines},set:function(l){this._gridLines=l,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(l){this._rotationAngle=l,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"aspectRatio",{get:function(){var l;return(l=this._aspectRatio)!==null&&l!==void 0?l:this.aspectRatios[0]},set:function(l){this._aspectRatio=l},enumerable:!1,configurable:!0}),j.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},j.prototype.show=function(){this.showUI(),this.open()},j.prototype.close=function(l){l===void 0&&(l=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),l||this.closeEventListeners.forEach(function(p){return p()}),this._isOpen=!1)},j.prototype.addRenderEventListener=function(l){this.renderEventListeners.push(l)},j.prototype.removeRenderEventListener=function(l){this.renderEventListeners.indexOf(l)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(l),1)},j.prototype.addCloseEventListener=function(l){this.closeEventListeners.push(l)},j.prototype.removeCloseEventListener=function(l){this.closeEventListeners.indexOf(l)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(l),1)},j.prototype.setupResizeObserver=function(){var l=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){l.resize(l.target.clientWidth,l.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))},j.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var l=1*this.target.clientWidth/this.target.clientHeight,p=this.contentDiv.clientWidth/l>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*l: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)/l;this.resize(p,I)}},j.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},j.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",lt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},j.prototype.resize=function(l,p){this.imageWidth=Math.round(l),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()},j.prototype.setEditingTarget=function(){var l=document.createElement("canvas");l.width=this.target.naturalWidth,l.height=this.target.naturalHeight,l.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var p=l.toDataURL();lt.setAttributes(this.editingTarget,[["href",p]]),this.setEditingTargetSize()},j.prototype.setTopLeft=function(){var l=this.target.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=l.left-p.left-this.CANVAS_MARGIN,this.top=l.top-p.top-this.CANVAS_MARGIN},j.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=lt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=lt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=lt.createGroup(),this.editingTargetRotationScaleContainer=lt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var l=lt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(l);var p=lt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(p),this.editingTargetContainer=lt.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)},j.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},j.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=lt.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()},j.prototype.zoomToCrop=function(){if(this.cropRect){var l=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=l+"px "+p+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-l+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-p+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},j.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)},j.prototype.cropRectChanged=function(l){this.cropRect=l,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},j.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},j.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"},j.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},j.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 l=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,p=this.target.offsetTop>l+this.CANVAS_MARGIN?this.target.offsetTop-(l+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},j.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},j.prototype.addTopToolbar=function(){var l=this;this.topToolbar=new Mr,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 Xt;p.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(p);var I=[];this.aspectRatios.forEach(function(Gt){var er=new yt(wt.getIcon(Gt.horizontal,Gt.vertical),Gt.horizontal===0&&Gt.vertical===0?"FREE":Gt.horizontal+":"+Gt.vertical);er.onClick=function(){return l.ratioButtonClicked(Gt)},I.push(er)}),this.aspectRatioButton=new tr(wt.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 yt('<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(){l.isGridVisible=!l.isGridVisible,J.isActive=l.isGridVisible},p.addButton(J);var U=new yt('<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(){l.zoomToCropEnabled=!l.zoomToCropEnabled,U.isActive=l.zoomToCropEnabled},p.addButton(U),!jt.isLicensed){var he=new ze;this.topToolbar.addElementBlock(he);var _e=document.createElement("div");_e.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var tt=document.createElement("a");tt.style.color="currentColor",tt.href="https://markerjs.com/products/cropro",tt.target="_blank",tt.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>',_e.appendChild(tt),he.addElement(_e)}var gt=new Xt;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var je=new yt('<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");je.onClick=this.startRenderAndClose,gt.addButton(je),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(je.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ct=new yt('<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");Ct.onClick=this.close,gt.addButton(Ct),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ct.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},j.prototype.addBottomToolbar=function(){var l=this;this.bottomToolbar=new Mr,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 Xt;p.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(p);var I=new yt('<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 yt('<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 ze;U.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(U),this.straightener=new bt("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(gt){l.rotateBy(gt),l.straightener.angle=l.rotationAngle},U.addElement(this.straightener.getUI());var he=new Xt;he.minWidth=2*this.toolbarHeight+"px",he.contentAlign="end",this.bottomToolbar.addButtonBlock(he);var _e=new yt('<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");_e.onClick=this.flipHorizontallyButtonClicked,he.addButton(_e);var tt=new yt('<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");tt.onClick=this.flipVerticallyButtonClicked,he.addButton(tt)},j.prototype.ratioButtonClicked=function(l){this.aspectRatio=l,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},j.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=wt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},j.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Kt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},j.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},j.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},j.prototype.restoreState=function(l){if(l){var p=this.cropLayer.getRescaledRect(l.width,l.height,this.imageWidth,this.imageHeight,l.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(p),this.cropRectChanged(p),this.flippedHorizontally=l.flippedHorizontally,this.flippedVertically=l.flippedVertically,this.applyFlip(),this.rotationAngle=l.rotationAngle,this.applyRotation()}},j.prototype.clientToLocalCoordinates=function(l,p){var I=this.cropImage.getBoundingClientRect();return{x:l-I.left,y:p-I.top}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var l=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=l+"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()},j.prototype.rotateLeftButtonClicked=function(){var l=this.rotationAngle-90;this.rotationAngle%90!=0&&(l+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(l)},j.prototype.rotateRightButtonClicked=function(){var l=this.rotationAngle+90;this.rotationAngle%90!=0&&(l-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(l)},j.prototype.rotateTo=function(l){l=(l=l>180?l-360:l)<=-180?l+360:l,this.rotationAngle=l,this.applyRotation()},j.prototype.rotateBy=function(l){this.rotateTo((this.rotationAngle+l)%360)},j.prototype.applyRotation=function(){var l=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=l},j.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},j.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},j.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},j.prototype.startRenderAndClose=function(){return xt(this,void 0,void 0,function(){var l,p;return Mt(this,function(I){switch(I.label){case 0:return[4,this.render()];case 1:return l=I.sent(),p=this.getState(),this.renderEventListeners.forEach(function(J){return J(l,p)}),this.close(!0),[2]}})})},j.prototype.render=function(){return xt(this,void 0,void 0,function(){var l;return Mt(this,function(p){switch(p.label){case 0:return(l=new ri).naturalSize=this.renderAtNaturalSize,l.imageType=this.renderImageType,l.imageQuality=this.renderImageQuality,l.width=this.renderWidth,l.height=this.renderHeight,this.unzoomFromCrop(),lt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,l.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,l.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()]}})})},j.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ir("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 ir("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ir("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var l=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ir("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*l)+`px;
|
|
height: `+(this.toolbarHeight-2*l)+`px;
|
|
padding: `+l+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ir("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ir("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new ar("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ar("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ir("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 ir("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ir("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 ir("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*l)+`px;
|
|
padding: `+l+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ir("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},j.instanceCounter=0,j}(),Dt=Z("8hTe"),pi=Z.n(Dt),mi=/<pre[^>]*>/g;function gi(j){var l=document.createElement("div");return l.innerHTML=j,l.childNodes.length===0?"":l.childNodes[0].nodeValue}var vi=Le.a=function(j){var l=j.value,p=l===void 0?"":l,I=j.edit,J=I===void 0?!1:I,U=j.className,he=j.showTextOnly,_e=j.showLines,tt=j.replaces,gt=j.zoomImg,je=j.hasMask,Ct=j.style,Gt=Ct===void 0?{}:Ct,er=j.stylesPrev,jr=er===void 0?{}:er,Ar=String(p),Tr=Object(M.useRef)(),Yr=Object(M.useRef)(),Ii=Object(M.useState)(""),mr=Object(H.a)(Ii,2),zr=mr[0],li=mr[1],ui=Object(M.useState)("office"),Wr=Object(H.a)(ui,2),Mi=Wr[0],yi=Wr[1],zi=function(){var zt=new Ge(Yr.current);zt.displayMode="popup",zt.addRenderEventListener(function(){var xr=Object(_.a)(O.a.mark(function Bt(dr){var Yt;return O.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return Tr.current.style.display="none",gr.next=3,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr}});case 3:Yt=gr.sent,Yt!=null&&Yt.id&&tt(Yr.current.getAttribute("src").replace(ae.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 5:case"end":return gr.stop()}},Bt)}));return function(Bt){return xr.apply(this,arguments)}}()),zt.show()},Ki=function(){var zt=new kt(Yr.current);zt.settings.displayMode="popup",zt.addEventListener("render",function(){var xr=Object(_.a)(O.a.mark(function Bt(dr){var Yt;return O.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:if(Tr.current.style.display="none",!Yr.current){gr.next=6;break}return gr.next=4,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr.dataUrl}});case 4:Yt=gr.sent,Yt!=null&&Yt.id&&tt(Yr.current.getAttribute("src").replace(ae.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 6:case"end":return gr.stop()}},Bt)}));return function(Bt){return xr.apply(this,arguments)}}()),zt.show(),window.markerArea=zt},Jr=Object(M.useMemo)(function(){Tr.current&&(Tr.current.style.zIndex=-1);try{var sr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,zt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ar=Ar.replace(sr,"("+ae.a.API_SERVER+"/api/attachments/").replace(zt,'"'+ae.a.API_SERVER+"/api/attachments/").replace(xr,'"'+ae.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(ii){}var Bt=$(Ar),dr=b();if(Ar.match(/\[TOC\]/)&&(Bt=Bt.replace("<p>[TOC]</p>",R()),A()),Bt=Bt.replace(/(__special_katext_id_\d+__)/g,function(ii,gr){var Lr=dr[gr],Vi=Lr.type,xi=Lr.expression;return Object(ce.renderToString)(gi(xi)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Bt=Bt.replace(/▁/g,"\u2581\u2581\u2581"),g(),he){var Yt=document.createElement("div");return Yt.innerHTML=Bt,Yt.innerText}return setTimeout(function(){return hn()},500),Bt},[Ar]),Qr=Object(M.useRef)();v.WebkitLineClamp=_e,_e&&(Gt=Object(B.a)(Object(B.a)({},Gt),v));function bi(sr){var zt=sr.target;if(zt.tagName.toUpperCase()==="IMG"){if(gt){var xr=zt.getAttribute("src");li(xr),yi("image")}}else if(zt.tagName.toUpperCase()==="A"){var Bt=zt.getAttribute("href");if(Bt.indexOf("office")>-1)sr.preventDefault(),li(Bt),yi("office");else if(Bt.indexOf("application/pdf")>-1)sr.preventDefault(),li(Bt),yi("pdf");else if(Bt.indexOf("text/html")>-1)sr.preventDefault(),li(Bt),yi("html");else if(Bt.startsWith("#")){sr.preventDefault();var dr=document.getElementById(Bt.replace("#",""));dr&&dr.scrollIntoView(!0)}}}var hn=function(){var zt,xr=(zt=Qr.current)===null||zt===void 0?void 0:zt.querySelectorAll("video");xr==null||xr.forEach(function(Bt){if(Bt.oncontextmenu=function(){return!1},Bt.src.indexOf(".m3u8")>-1&&!Bt.canPlayType("application/vnd.apple.mpegurl")){if(ee.a.isSupported()){var dr=new ee.a;dr.loadSource(Bt.src),dr.attachMedia(Bt)}}})};Object(M.useEffect)(function(){if(Qr.current&&Jr&&(Jr.match(mi)&&window.PR.prettyPrint()),Qr.current)return Qr.current.addEventListener("click",bi),function(){Qr.current.removeEventListener("click",bi),g(),A()}},[Jr,Qr.current,bi]);var Ei=function(zt){if(!J)return;zt.target.nodeName==="IMG"?(Tr.current.style.zIndex=1,Tr.current.style.display="flex",Tr.current.style.width=zt.target.clientWidth+"px",Tr.current.style.height=zt.target.clientHeight+"px",Tr.current.style.top=zt.target.offsetTop+"px",Tr.current.style.left=zt.target.offsetLeft+"px",Yr.current.src=zt.target.getAttribute("src")):Tr.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Qr,style:Object(B.a)({},Gt),className:"".concat(U||""," markdown-body ").concat(pi.a.mdBody),onMouseOver:Ei,dangerouslySetInnerHTML:{__html:Jr}}),y.a.createElement("div",{ref:Tr,className:pi.a.button},y.a.createElement(Y.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:Yr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(ve.a,{close:!0,data:zr,type:zr!=null&&zr.length?Mi:"",style:Object(B.a)({},jr),onClose:function(){return li("")}}))}},"9VGf":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return L});var ie=Z("q1tI"),Y=Z.n(ie);function L(Q,B){var _=Object(ie.useRef)();Object(ie.useEffect)(function(){_.current=Q}),Object(ie.useEffect)(function(){function H(){_.current()}if(B!==null){var W=setInterval(H,B);return function(){return clearInterval(W)}}},[B])}},"A/g1":function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcH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d/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(Pe,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 w={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(w["'/'"]=function(k){return _(k)}),(typeof M!="object"||M.whenOpening!==!1)&&(w["'>'"]=function(k){return Q(k)}),O.addKeyMap(w)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],L=["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=[],w=O.getOption("autoCloseTags"),k=0;k<M.length;k++){if(!M[k].empty())return ie.Pass;var D=M[k].head,T=O.getTokenAt(D),S=ie.innerMode(O.getMode(),T.state),h=S.state,o=S.mode.xmlCurrentTag&&S.mode.xmlCurrentTag(h),u=o&&o.name;if(!u)return ie.Pass;var d=S.mode.configuration=="html",A=typeof w=="object"&&w.dontCloseTags||d&&Y,v=typeof w=="object"&&w.indentTags||d&&L;T.end>D.ch&&(u=u.slice(0,u.length-T.end+D.ch));var m=u.toLowerCase();if(!u||T.type=="string"&&(T.end!=D.ch||!/[\"\']/.test(T.string.charAt(T.string.length-1))||T.string.length==1)||T.type=="tag"&&o.close||T.string.indexOf("/")==D.ch-T.start-1||A&&H(A,m)>-1||W(O,S.mode.xmlCurrentContext&&S.mode.xmlCurrentContext(h)||[],u,D,!0))return ie.Pass;var R=typeof w=="object"&&w.emptyTags;if(R&&H(R,u)>-1){y[k]={text:"/>",newPos:ie.Pos(D.line,D.ch+2)};continue}var x=v&&H(v,m)>-1;y[k]={indent:x,text:">"+(x?`
|
|
|
|
`:"")+"</"+u+">",newPos:x?ie.Pos(D.line+1,0):ie.Pos(D.line,D.ch+1)}}for(var f=typeof w=="object"&&w.dontIndentOnAutoClose,k=M.length-1;k>=0;k--){var c=y[k];O.replaceRange(c.text,M[k].head,M[k].anchor,"+insert");var s=O.listSelections().slice(0);s[k]={head:c.newPos,anchor:c.newPos},O.setSelections(s),!f&&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(),w=[],k=M?"/":"</",D=O.getOption("autoCloseTags"),T=typeof D=="object"&&D.dontIndentOnSlash,S=0;S<y.length;S++){if(!y[S].empty())return ie.Pass;var h=y[S].head,o=O.getTokenAt(h),u=ie.innerMode(O.getMode(),o.state),d=u.state;if(M&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=h.ch-1))return ie.Pass;var A,v=u.mode.name!="xml"&&O.getMode().name=="htmlmixed";if(v&&u.mode.name=="javascript")A=k+"script";else if(v&&u.mode.name=="css")A=k+"style";else{var m=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(d);if(!m||m.length&&W(O,m,m[m.length-1],h))return ie.Pass;A=k+m[m.length-1]}O.getLine(h.line).charAt(o.end)!=">"&&(A+=">"),w[S]=A}if(O.replaceSelections(w),y=O.listSelections(),!T)for(var S=0;S<y.length;S++)(S==y.length-1||y[S].head.line<y[S+1].head.line)&&O.indentLine(y[S].head.line)}function _(O){return O.getOption("disableInput")?ie.Pass:B(O,!0)}ie.commands.closeTag=function(O){return B(O)};function H(O,M){if(O.indexOf)return O.indexOf(M);for(var y=0,w=O.length;y<w;++y)if(O[y]==M)return y;return-1}function W(O,M,y,w,k){if(!ie.scanForClosingTag)return!1;var D=Math.min(O.lastLine()+1,w.line+500),T=ie.scanForClosingTag(O,w,null,D);if(!T||T.tag!=y)return!1;for(var S=k?1:0,h=M.length-1;h>=0&&M[h]==y;h--)++S;w=T.to;for(var h=1;h<S;h++){var o=ie.scanForClosingTag(O,w,null,D);if(!o||o.tag!=y)return!1;w=o.to}return!0}})},BjJ7:function(Pe,Le,Z){"use strict";Z.d(Le,"d",function(){return Y}),Z.d(Le,"c",function(){return L}),Z.d(Le,"e",function(){return Q}),Z.d(Le,"b",function(){return B}),Z.d(Le,"a",function(){return H});var ie=Z("m3rI");function Y(W){var O=!0;if(W.length>0){for(var M=0;M<W.length;M++)if(W[M].compile_success==0||!W[M].compile_success){O=!1;break}}else O=!1;return O}function L(W){for(var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",M=[],y=0;y<W.length;y++){var w=W[y],k=O?"".concat(O,"/").concat(w.name):"".concat(w.name);M.push({title:w.name,isLeaf:!(w.type==="tree"),key:k})}return M}function Q(W,O,M){for(var y=0;y<W.length;y++){var w=W[y];if(w.key===O){w.children=M;break}w.children&&Q(w.children,O,M)}return W}function B(W,O,M){var y;return function(){var w=this,k=arguments,D=function(){y=null,M||W.apply(w,k)},T=M&&!y;clearTimeout(y),y=setTimeout(D,O),T&&W.apply(w,k)}}var _=!0,H=ie.a.API_SERVER},"C+DQ":function(Pe,Le,Z){},CJF0:function(Pe,Le,Z){"use strict";var ie=Z("14J3"),Y=Z("BMrR"),L=Z("+L6B"),Q=Z("2/Rp"),B=Z("jCWc"),_=Z("kPKH"),H=Z("PpiC"),W=Z("q1tI"),O=Z.n(W),M=Z("Ty5D"),y=Z("9kvl"),w=Z("55Ip"),k=Z("lzim"),D=Z("nZ20"),T=Z.n(D),S=function(o){var u,d,A,v,m=o.shixunsDetail,R=o.dispatch,x=o.loading,f=o.match,c=o.data,s=c===void 0?{}:c,a=o.title,b=Object(H.a)(o,["shixunsDetail","dispatch","loading","match","data","title"]),g=Object(M.i)(),E=!(((u=m.detail)===null||u===void 0?void 0:u.identity)>4||((d=m.detail)===null||d===void 0?void 0:d.identity)===void 0||((A=m.detail)===null||A===void 0?void 0:A.shixun_status)===2||((v=m.detail)===null||v===void 0?void 0:v.shixun_status)===1);return O.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(T.a.wrap)},O.a.createElement(Y.a,{gutter:[20,20],align:"middle"},O.a.createElement(_.a,{flex:1},O.a.createElement("span",{className:T.a.icons},O.a.createElement("img",{src:k.d,width:"14"})),O.a.createElement("span",{className:"font16"},"\u7B2C ",s==null?void 0:s.position," \u5173\uFF1A",a)),O.a.createElement(_.a,null,(s==null?void 0:s.prev_challenge)&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var G,V=s.prev_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(g.id,"/challenges/").concat(s==null||((G=s.prev_challenge)===null||G===void 0)?void 0:G.id).concat(V);y.d.replace($)}},"\u4E0A\u4E00\u5173"),s.next_challenge&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var G,V=s.next_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(g.id,"/challenges/").concat(s==null||((G=s.next_challenge)===null||G===void 0)?void 0:G.id).concat(V);y.d.replace($)}},"\u4E0B\u4E00\u5173"),E&&O.a.createElement(Q.a,{type:"primary"},O.a.createElement(w.a,{to:"/shixuns/".concat(g.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),E&&O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(w.a,{to:"/shixuns/".concat(g.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(w.a,{to:"/shixuns/".concat(g.id,"/challenges")},"\u8FD4\u56DE")))))};Le.a=Object(y.a)(function(h){var o=h.shixunsDetail,u=h.newCourse,d=h.loading,A=h.globalSetting;return{shixunsDetail:o,newCourse:u,globalSetting:A,loading:d.effects}})(S)},DlQD:function(Pe,Le,Z){(function(ie,Y){Pe.exports=Y()})(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 Y(ge,de,fe){return de&&ie(ge.prototype,de),fe&&ie(ge,fe),ge}function L(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=L(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 H=_(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}}),W=H.defaults,O=H.getDefaults,M=H.changeDefaults,y=/[&<>"']/,w=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,T={"&":"&","<":"<",">":">",'"':""","'":"'"},S=function(de){return T[de]};function h(ge,de){if(de){if(y.test(ge))return ge.replace(w,S)}else if(k.test(ge))return ge.replace(D,S);return ge}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(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 v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(ge,de,fe){if(ge){var te;try{te=decodeURIComponent(u(fe)).replace(v,"").toLowerCase()}catch(re){return null}if(te.indexOf("javascript:")===0||te.indexOf("vbscript:")===0||te.indexOf("data:")===0)return null}de&&!m.test(fe)&&(fe=a(de,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(re){return null}return fe}var x={},f=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(ge,de){x[" "+ge]||(f.test(ge)?x[" "+ge]=ge+"/":x[" "+ge]=P(ge,"/",!0)),ge=x[" "+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(s,"$1")+de:ge+de}var b={exec:function(){}};function g(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 E(ge,de){var fe=ge.replace(/\|/g,function(ne,le,pe){for(var Ce=!1,Oe=le;--Oe>=0&&pe[Oe]==="\\";)Ce=!Ce;return Ce?"|":" |"}),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 G(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:u,edit:A,cleanUrl:R,resolveUrl:a,noopTest:b,merge:g,splitCells:E,rtrim:P,findClosingBracket:G,checkSanitizeDeprecation:V},z=H.defaults,F=$.rtrim,ee=$.splitCells,ae=$.escape,ce=$.findClosingBracket;function ve(ge,de,fe){var te=de.href,re=de.title?ae(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:ae(ne)}}function Me(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 le=ne[0];return le.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 le=re[re.length-1];if(le&&le.type==="paragraph")return{raw:ne[0],text:ne[0].trimRight()};var pe=ne[0].replace(/^ {4}/gm,"");return{type:"code",raw:ne[0],codeBlockStyle:"indented",text:this.options.pedantic?pe:F(pe,`
|
|
`)}}},de.fences=function(te){var re=this.rules.block.fences.exec(te);if(re){var ne=re[0],le=Me(ne,re[3]||"");return{type:"code",raw:ne,lang:re[2]?re[2].trim():re[2],text:le}}},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 le=ne.align.length,pe;for(pe=0;pe<le;pe++)/^ *-+: *$/.test(ne.align[pe])?ne.align[pe]="right":/^ *:-+: *$/.test(ne.align[pe])?ne.align[pe]="center":/^ *:-+ *$/.test(ne.align[pe])?ne.align[pe]="left":ne.align[pe]=null;for(le=ne.cells.length,pe=0;pe<le;pe++)ne.cells[pe]=ee(ne.cells[pe],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],le=re[2],pe=le.length>1,Ce=le[le.length-1]===")",Oe={type:"list",raw:ne,ordered:pe,start:pe?+le.slice(0,-1):"",loose:!1,items:[]},st=re[0].match(this.rules.block.item),mt=!1,ht,Rt,At,ft,Ft,kt,Ht,It=st.length,xt=0;xt<It;xt++)ht=st[xt],ne=ht,Rt=ht.length,ht=ht.replace(/^ *([*+-]|\d+[.)]) */,""),~ht.indexOf(`
|
|
`)&&(Rt-=ht.length,ht=this.options.pedantic?ht.replace(/^ {1,4}/gm,""):ht.replace(new RegExp("^ {1,"+Rt+"}","gm"),"")),xt!==It-1&&(At=this.rules.block.bullet.exec(st[xt+1])[0],(pe?At.length===1||!Ce&&At[At.length-1]===")":At.length>1||this.options.smartLists&&At!==le)&&(ft=st.slice(xt+1).join(`
|
|
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-ft.length),xt=It-1)),Ft=mt||/\n\n(?!\s*$)/.test(ht),xt!==It-1&&(mt=ht.charAt(ht.length-1)===`
|
|
`,Ft||(Ft=mt)),Ft&&(Oe.loose=!0),kt=/^\[[ xX]\] /.test(ht),Ht=void 0,kt&&(Ht=ht[1]!==" ",ht=ht.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:ne,task:kt,checked:Ht,loose:Ft,text:ht});return Oe}},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]):ae(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 le=ne.align.length,pe;for(pe=0;pe<le;pe++)/^ *-+: *$/.test(ne.align[pe])?ne.align[pe]="right":/^ *:-+: *$/.test(ne.align[pe])?ne.align[pe]="center":/^ *:-+ *$/.test(ne.align[pe])?ne.align[pe]="left":ne.align[pe]=null;for(le=ne.cells.length,pe=0;pe<le;pe++)ne.cells[pe]=ee(ne.cells[pe].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 le=re[re.length-1];return le&&le.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:ae(re[1])}},de.tag=function(te,re,ne){var le=this.rules.inline.tag.exec(te);if(le)return!re&&/^<a /i.test(le[0])?re=!0:re&&/^<\/a>/i.test(le[0])&&(re=!1),!ne&&/^<(pre|code|kbd|script)(\s|>)/i.test(le[0])?ne=!0:ne&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(le[0])&&(ne=!1),{type:this.options.sanitize?"text":"html",raw:le[0],inLink:re,inRawBlock:ne,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ae(le[0]):le[0]}},de.link=function(te){var re=this.rules.inline.link.exec(te);if(re){var ne=ce(re[2],"()");if(ne>-1){var le=re[0].indexOf("!")===0?5:4,pe=le+re[1].length+ne;re[2]=re[2].substring(0,ne),re[0]=re[0].substring(0,pe).trim(),re[3]=""}var Ce=re[2],Oe="";if(this.options.pedantic){var st=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);st?(Ce=st[1],Oe=st[3]):Oe=""}else Oe=re[3]?re[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ve(re,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},re[0]);return mt}},de.reflink=function(te,re){var ne;if((ne=this.rules.inline.reflink.exec(te))||(ne=this.rules.inline.nolink.exec(te))){var le=(ne[2]||ne[1]).replace(/\s+/g," ");if(le=re[le.toLowerCase()],!le||!le.href){var pe=ne[0].charAt(0);return{type:"text",raw:pe,text:pe}}var Ce=ve(ne,le,ne[0]);return Ce}},de.strong=function(te,re,ne){ne===void 0&&(ne="");var le=this.rules.inline.strong.start.exec(te);if(le&&(!le[1]||le[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){re=re.slice(-1*te.length);var pe=le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;pe.lastIndex=0;for(var Ce;(le=pe.exec(re))!=null;)if(Ce=this.rules.inline.strong.middle.exec(re.slice(0,le.index+3)),Ce)return{type:"strong",raw:te.slice(0,Ce[0].length),text:te.slice(2,Ce[0].length-2)}}},de.em=function(te,re,ne){ne===void 0&&(ne="");var le=this.rules.inline.em.start.exec(te);if(le&&(!le[1]||le[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){re=re.slice(-1*te.length);var pe=le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;pe.lastIndex=0;for(var Ce;(le=pe.exec(re))!=null;)if(Ce=this.rules.inline.em.middle.exec(re.slice(0,le.index+2)),Ce)return{type:"em",raw:te.slice(0,Ce[0].length),text:te.slice(1,Ce[0].length-1)}}},de.codespan=function(te){var re=this.rules.inline.code.exec(te);if(re){var ne=re[2].replace(/\n/g," "),le=/[^ ]/.test(ne),pe=ne.startsWith(" ")&&ne.endsWith(" ");return le&&pe&&(ne=ne.substring(1,ne.length-1)),ne=ae(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 le,pe;return ne[2]==="@"?(le=ae(this.options.mangle?re(ne[1]):ne[1]),pe="mailto:"+le):(le=ae(ne[1]),pe=le),{type:"link",raw:ne[0],text:le,href:pe,tokens:[{type:"text",raw:le,text:le}]}}},de.url=function(te,re){var ne;if(ne=this.rules.inline.url.exec(te)){var le,pe;if(ne[2]==="@")le=ae(this.options.mangle?re(ne[0]):ne[0]),pe="mailto:"+le;else{var Ce;do Ce=ne[0],ne[0]=this.rules.inline._backpedal.exec(ne[0])[0];while(Ce!==ne[0]);le=ae(ne[0]),ne[1]==="www."?pe="http://"+le:pe=le}return{type:"link",raw:ne[0],text:le,href:pe,tokens:[{type:"text",raw:le,text:le}]}}},de.inlineText=function(te,re,ne){var le=this.rules.inline.text.exec(te);if(le){var pe;return re?pe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ae(le[0]):le[0]:pe=ae(this.options.smartypants?ne(le[0]):le[0]),{type:"text",raw:le[0],text:pe}}},ge}(),Ee=$.noopTest,Te=$.edit,Se=$.merge,me={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:Ee,table:Ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,me.def=Te(me.def).replace("label",me._label).replace("title",me._title).getRegex(),me.bullet=/(?:[*+-]|\d{1,9}[.)])/,me.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,me.item=Te(me.item,"gm").replace(/bull/g,me.bullet).getRegex(),me.list=Te(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex(),me._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",me._comment=/<!--(?!-?>)[\s\S]*?-->/,me.html=Te(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me.paragraph=Te(me._paragraph).replace("hr",me.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",me._tag).getRegex(),me.blockquote=Te(me.blockquote).replace("paragraph",me.paragraph).getRegex(),me.normal=Se({},me),me.gfm=Se({},me.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*|$)"}),me.gfm.nptable=Te(me.gfm.nptable).replace("hr",me.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",me._tag).getRegex(),me.gfm.table=Te(me.gfm.table).replace("hr",me.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",me._tag).getRegex(),me.pedantic=Se({},me.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._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:Ee,paragraph:Te(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ee,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:Ee,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",me._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 Re={block:me,inline:se},Ve=H.defaults,We=Re.block,Je=Re.inline;function Ze(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 De(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 Ue=function(){function ge(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||Ve,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var te={block:We.normal,inline:Je.normal};this.options.pedantic?(te.block=We.pedantic,te.inline=Je.pedantic):this.options.gfm&&(te.block=We.gfm,this.options.breaks?te.inline=Je.breaks:te.inline=Je.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 le,pe,Ce,Oe;te;){if(le=this.tokenizer.space(te)){te=te.substring(le.raw.length),le.type&&re.push(le);continue}if(le=this.tokenizer.code(te,re)){te=te.substring(le.raw.length),le.type?re.push(le):(Oe=re[re.length-1],Oe.raw+=`
|
|
`+le.raw,Oe.text+=`
|
|
`+le.text);continue}if(le=this.tokenizer.fences(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.heading(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.nptable(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.hr(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.blockquote(te)){te=te.substring(le.raw.length),le.tokens=this.blockTokens(le.text,[],ne),re.push(le);continue}if(le=this.tokenizer.list(te)){for(te=te.substring(le.raw.length),Ce=le.items.length,pe=0;pe<Ce;pe++)le.items[pe].tokens=this.blockTokens(le.items[pe].text,[],!1);re.push(le);continue}if(le=this.tokenizer.html(te)){te=te.substring(le.raw.length),re.push(le);continue}if(ne&&(le=this.tokenizer.def(te))){te=te.substring(le.raw.length),this.tokens.links[le.tag]||(this.tokens.links[le.tag]={href:le.href,title:le.title});continue}if(le=this.tokenizer.table(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.lheading(te)){te=te.substring(le.raw.length),re.push(le);continue}if(ne&&(le=this.tokenizer.paragraph(te))){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.text(te,re)){te=te.substring(le.raw.length),le.type?re.push(le):(Oe=re[re.length-1],Oe.raw+=`
|
|
`+le.raw,Oe.text+=`
|
|
`+le.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,le,pe,Ce,Oe,st=te.length;for(re=0;re<st;re++){Oe=te[re];switch(Oe.type){case"paragraph":case"text":case"heading":{Oe.tokens=[],this.inlineTokens(Oe.text,Oe.tokens);break}case"table":{for(Oe.tokens={header:[],cells:[]},pe=Oe.header.length,ne=0;ne<pe;ne++)Oe.tokens.header[ne]=[],this.inlineTokens(Oe.header[ne],Oe.tokens.header[ne]);for(pe=Oe.cells.length,ne=0;ne<pe;ne++)for(Ce=Oe.cells[ne],Oe.tokens.cells[ne]=[],le=0;le<Ce.length;le++)Oe.tokens.cells[ne][le]=[],this.inlineTokens(Ce[le],Oe.tokens.cells[ne][le]);break}case"blockquote":{this.inline(Oe.tokens);break}case"list":{for(pe=Oe.items.length,ne=0;ne<pe;ne++)this.inline(Oe.items[ne].tokens);break}}}return te},de.inlineTokens=function(te,re,ne,le,pe){re===void 0&&(re=[]),ne===void 0&&(ne=!1),le===void 0&&(le=!1),pe===void 0&&(pe="");var Ce,Oe=te,st;if(this.tokens.links){var mt=Object.keys(this.tokens.links);if(mt.length>0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)mt.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;te;){if(Ce=this.tokenizer.escape(te)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.tag(te,ne,le)){te=te.substring(Ce.raw.length),ne=Ce.inLink,le=Ce.inRawBlock,re.push(Ce);continue}if(Ce=this.tokenizer.link(te)){te=te.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,le)),re.push(Ce);continue}if(Ce=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,le)),re.push(Ce);continue}if(Ce=this.tokenizer.strong(te,Oe,pe)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],ne,le),re.push(Ce);continue}if(Ce=this.tokenizer.em(te,Oe,pe)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],ne,le),re.push(Ce);continue}if(Ce=this.tokenizer.codespan(te)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.br(te)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.del(te)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],ne,le),re.push(Ce);continue}if(Ce=this.tokenizer.autolink(te,De)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(!ne&&(Ce=this.tokenizer.url(te,De))){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.inlineText(te,le,Ze)){te=te.substring(Ce.raw.length),pe=Ce.raw.slice(-1),re.push(Ce);continue}if(te){var ht="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return re},Y(ge,null,[{key:"rules",get:function(){return{block:We,inline:Je}}}]),ge}(),Be=H.defaults,qe=$.cleanUrl,Qe=$.escape,Ie=function(){function ge(fe){this.options=fe||Be}var de=ge.prototype;return de.code=function(te,re,ne){var le=(re||"").match(/\S*/)[0];if(this.options.highlight){var pe=this.options.highlight(te,le);pe!=null&&pe!==te&&(ne=!0,te=pe)}return le?'<pre><code class="'+this.options.langPrefix+Qe(le,!0)+'">'+(ne?te:Qe(te,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ne?te:Qe(te,!0))+`</code></pre>
|
|
`},de.blockquote=function(te){return`<blockquote>
|
|
`+te+`</blockquote>
|
|
`},de.html=function(te){return te},de.heading=function(te,re,ne,le){return this.options.headerIds?"<h"+re+' id="'+this.options.headerPrefix+le.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 le=re?"ol":"ul",pe=re&&ne!==1?' start="'+ne+'"':"";return"<"+le+pe+`>
|
|
`+te+"</"+le+`>
|
|
`},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",le=re.align?"<"+ne+' align="'+re.align+'">':"<"+ne+">";return le+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=qe(this.options.sanitize,this.options.baseUrl,te),te===null)return ne;var le='<a href="'+Qe(te)+'"';return re&&(le+=' title="'+re+'"'),le+=">"+ne+"</a>",le},de.image=function(te,re,ne){if(te=qe(this.options.sanitize,this.options.baseUrl,te),te===null)return ne;var le='<img src="'+te+'" alt="'+ne+'"';return re&&(le+=' title="'+re+'"'),le+=this.options.xhtml?"/>":">",le},de.text=function(te){return te},ge}(),Ne=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}(),$e=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}(),et=H.defaults,Xe=$.unescape,Ke=function(){function ge(fe){this.options=fe||et,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ne,this.slugger=new $e}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="",le,pe,Ce,Oe,st,mt,ht,Rt,At,ft,Ft,kt,Ht,It,xt,Mt,jt,lt,$t=te.length;for(le=0;le<$t;le++){ft=te[le];switch(ft.type){case"space":continue;case"hr":{ne+=this.renderer.hr();continue}case"heading":{ne+=this.renderer.heading(this.parseInline(ft.tokens),ft.depth,Xe(this.parseInline(ft.tokens,this.textRenderer)),this.slugger);continue}case"code":{ne+=this.renderer.code(ft.text,ft.lang,ft.escaped);continue}case"table":{for(Rt="",ht="",Oe=ft.header.length,pe=0;pe<Oe;pe++)ht+=this.renderer.tablecell(this.parseInline(ft.tokens.header[pe]),{header:!0,align:ft.align[pe]});for(Rt+=this.renderer.tablerow(ht),At="",Oe=ft.cells.length,pe=0;pe<Oe;pe++){for(mt=ft.tokens.cells[pe],ht="",st=mt.length,Ce=0;Ce<st;Ce++)ht+=this.renderer.tablecell(this.parseInline(mt[Ce]),{header:!1,align:ft.align[Ce]});At+=this.renderer.tablerow(ht)}ne+=this.renderer.table(Rt,At);continue}case"blockquote":{At=this.parse(ft.tokens),ne+=this.renderer.blockquote(At);continue}case"list":{for(Ft=ft.ordered,kt=ft.start,Ht=ft.loose,Oe=ft.items.length,At="",pe=0;pe<Oe;pe++)xt=ft.items[pe],Mt=xt.checked,jt=xt.task,It="",xt.task&&(lt=this.renderer.checkbox(Mt),Ht?xt.tokens.length>0&&xt.tokens[0].type==="text"?(xt.tokens[0].text=lt+" "+xt.tokens[0].text,xt.tokens[0].tokens&&xt.tokens[0].tokens.length>0&&xt.tokens[0].tokens[0].type==="text"&&(xt.tokens[0].tokens[0].text=lt+" "+xt.tokens[0].tokens[0].text)):xt.tokens.unshift({type:"text",text:lt}):It+=lt),It+=this.parse(xt.tokens,Ht),At+=this.renderer.listitem(It,jt,Mt);ne+=this.renderer.list(At,Ft,kt);continue}case"html":{ne+=this.renderer.html(ft.text);continue}case"paragraph":{ne+=this.renderer.paragraph(this.parseInline(ft.tokens));continue}case"text":{for(At=ft.tokens?this.parseInline(ft.tokens):ft.text;le+1<$t&&te[le+1].type==="text";)ft=te[++le],At+=`
|
|
`+(ft.tokens?this.parseInline(ft.tokens):ft.text);ne+=re?this.renderer.paragraph(At):At;continue}default:{var ar='Token with "'+ft.type+'" type was not found.';if(this.options.silent){console.error(ar);return}else throw new Error(ar)}}}return ne},de.parseInline=function(te,re){re=re||this.renderer;var ne="",le,pe,Ce=te.length;for(le=0;le<Ce;le++){pe=te[le];switch(pe.type){case"escape":{ne+=re.text(pe.text);break}case"html":{ne+=re.html(pe.text);break}case"link":{ne+=re.link(pe.href,pe.title,this.parseInline(pe.tokens,re));break}case"image":{ne+=re.image(pe.href,pe.title,pe.text);break}case"strong":{ne+=re.strong(this.parseInline(pe.tokens,re));break}case"em":{ne+=re.em(this.parseInline(pe.tokens,re));break}case"codespan":{ne+=re.codespan(pe.text);break}case"br":{ne+=re.br();break}case"del":{ne+=re.del(this.parseInline(pe.tokens,re));break}case"text":{ne+=re.text(pe.text);break}default:{var Oe='Token with "'+pe.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return ne},ge}(),ct=$.merge,rt=$.checkSanitizeDeprecation,at=$.escape,Ae=H.getDefaults,dt=H.changeDefaults,ot=H.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=ct({},we.defaults,de||{}),rt(de),fe){var te=de.highlight,re;try{re=Ue.lex(ge,de)}catch(Ce){return fe(Ce)}var ne=function(Oe){var st;if(!Oe)try{st=Ke.parse(re,de)}catch(mt){Oe=mt}return de.highlight=te,Oe?fe(Oe):fe(null,st)};if(!te||te.length<3)return ne();if(delete de.highlight,!re.length)return ne();var le=0;we.walkTokens(re,function(Ce){Ce.type==="code"&&(le++,setTimeout(function(){te(Ce.text,Ce.lang,function(Oe,st){if(Oe)return ne(Oe);st!=null&&st!==Ce.text&&(Ce.text=st,Ce.escaped=!0),le--,le===0&&ne()})},0))}),le===0&&ne();return}try{var pe=Ue.lex(ge,de);return de.walkTokens&&we.walkTokens(pe,de.walkTokens),Ke.parse(pe,de)}catch(Ce){if(Ce.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,de.silent)return"<p>An error occurred:</p><pre>"+at(Ce.message+"",!0)+"</pre>";throw Ce}}we.options=we.setOptions=function(ge){return ct(we.defaults,ge),dt(we.defaults),we},we.getDefaults=Ae,we.defaults=ot,we.use=function(ge){var de=ct({},ge);if(ge.renderer&&function(){var te=we.defaults.renderer||new Ie,re=function(pe){var Ce=te[pe];te[pe]=function(){for(var Oe=arguments.length,st=new Array(Oe),mt=0;mt<Oe;mt++)st[mt]=arguments[mt];var ht=ge.renderer[pe].apply(te,st);return ht===!1&&(ht=Ce.apply(te,st)),ht}};for(var ne in ge.renderer)re(ne);de.renderer=te}(),ge.tokenizer&&function(){var te=we.defaults.tokenizer||new xe,re=function(pe){var Ce=te[pe];te[pe]=function(){for(var Oe=arguments.length,st=new Array(Oe),mt=0;mt<Oe;mt++)st[mt]=arguments[mt];var ht=ge.tokenizer[pe].apply(te,st);return ht===!1&&(ht=Ce.apply(te,st)),ht}};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),le;!(le=ne()).done;){var pe=le.value;we.walkTokens(pe,de)}for(var Ce=B(re.tokens.cells),Oe;!(Oe=Ce()).done;)for(var st=Oe.value,mt=B(st),ht;!(ht=mt()).done;){var Rt=ht.value;we.walkTokens(Rt,de)}break}case"list":{we.walkTokens(re.items,de);break}default:re.tokens&&we.walkTokens(re.tokens,de)}}},we.Parser=Ke,we.parser=Ke.parse,we.Renderer=Ie,we.TextRenderer=Ne,we.Lexer=Ue,we.lexer=Ue.lex,we.Tokenizer=xe,we.Slugger=$e,we.parse=we;var Fe=we;return Fe})},E7E6:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454Dh58iQdPPiJBk0fKN1E9KyU8gehUKjVc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AwikpCNC0MdE4qCU9LEQ4qDf7/+4trb2aN/cRGFpeI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},L=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(T,S,h){h&&h!=ie.Init&&(T.removeKeyMap(B),T.state.closeBrackets=null),S&&(_(Q(S,"pairs")),T.state.closeBrackets=S,T.addKeyMap(B))});function Q(T,S){return S=="pairs"&&typeof T=="string"?T:typeof T=="object"&&T[S]!=null?T[S]:Y[S]}var B={Backspace:O,Enter:M};function _(T){for(var S=0;S<T.length;S++){var h=T.charAt(S),o="'"+h+"'";B[o]||(B[o]=H(h))}}_(Y.pairs+"`");function H(T){return function(S){return w(S,T)}}function W(T){var S=T.state.closeBrackets;if(!S||S.override)return S;var h=T.getModeAt(T.getCursor());return h.closeBrackets||S}function O(T){var S=W(T);if(!S||T.getOption("disableInput"))return ie.Pass;for(var h=Q(S,"pairs"),o=T.listSelections(),u=0;u<o.length;u++){if(!o[u].empty())return ie.Pass;var d=k(T,o[u].head);if(!d||h.indexOf(d)%2!=0)return ie.Pass}for(var u=o.length-1;u>=0;u--){var A=o[u].head;T.replaceRange("",L(A.line,A.ch-1),L(A.line,A.ch+1),"+delete")}}function M(T){var S=W(T),h=S&&Q(S,"explode");if(!h||T.getOption("disableInput"))return ie.Pass;for(var o=T.listSelections(),u=0;u<o.length;u++){if(!o[u].empty())return ie.Pass;var d=k(T,o[u].head);if(!d||h.indexOf(d)%2!=0)return ie.Pass}T.operation(function(){var A=T.lineSeparator()||`
|
|
`;T.replaceSelection(A+A,null),T.execCommand("goCharLeft"),o=T.listSelections();for(var v=0;v<o.length;v++){var m=o[v].head.line;T.indentLine(m,null,!0),T.indentLine(m+1,null,!0)}})}function y(T){var S=ie.cmpPos(T.anchor,T.head)>0;return{anchor:new L(T.anchor.line,T.anchor.ch+(S?-1:1)),head:new L(T.head.line,T.head.ch+(S?1:-1))}}function w(T,S){var h=W(T);if(!h||T.getOption("disableInput"))return ie.Pass;var o=Q(h,"pairs"),u=o.indexOf(S);if(u==-1)return ie.Pass;for(var d=Q(h,"closeBefore"),A=Q(h,"triples"),v=o.charAt(u+1)==S,m=T.listSelections(),R=u%2==0,x,f=0;f<m.length;f++){var c=m[f],s=c.head,a,b=T.getRange(s,L(s.line,s.ch+1));if(R&&!c.empty())a="surround";else if((v||!R)&&b==S)v&&D(T,s)?a="both":A.indexOf(S)>=0&&T.getRange(s,L(s.line,s.ch+3))==S+S+S?a="skipThree":a="skip";else if(v&&s.ch>1&&A.indexOf(S)>=0&&T.getRange(L(s.line,s.ch-2),s)==S+S){if(s.ch>2&&/\bstring/.test(T.getTokenTypeAt(L(s.line,s.ch-2))))return ie.Pass;a="addFour"}else if(v){var g=s.ch==0?" ":T.getRange(L(s.line,s.ch-1),s);if(!ie.isWordChar(b)&&g!=S&&!ie.isWordChar(g))a="both";else return ie.Pass}else if(R&&(b.length===0||/\s/.test(b)||d.indexOf(b)>-1))a="both";else return ie.Pass;if(!x)x=a;else if(x!=a)return ie.Pass}var E=u%2?o.charAt(u-1):S,P=u%2?S:o.charAt(u+1);T.operation(function(){if(x=="skip")T.execCommand("goCharRight");else if(x=="skipThree")for(var G=0;G<3;G++)T.execCommand("goCharRight");else if(x=="surround"){for(var V=T.getSelections(),G=0;G<V.length;G++)V[G]=E+V[G]+P;T.replaceSelections(V,"around"),V=T.listSelections().slice();for(var G=0;G<V.length;G++)V[G]=y(V[G]);T.setSelections(V)}else x=="both"?(T.replaceSelection(E+P,null),T.triggerElectric(E+P),T.execCommand("goCharLeft")):x=="addFour"&&(T.replaceSelection(E+E+E+E,"before"),T.execCommand("goCharRight"))})}function k(T,S){var h=T.getRange(L(S.line,S.ch-1),L(S.line,S.ch+1));return h.length==2?h:null}function D(T,S){var h=T.getTokenAt(L(S.line,S.ch+1));return/\bstring/.test(h.type)&&h.start==S.ch&&(S.ch==0||!/\bstring/.test(T.getTokenTypeAt(S)))}})},FOrL:function(Pe,Le,Z){Pe.exports=Z.p+"static/nodata.a6b3f948.png"},FPkq:function(Pe,Le,Z){Pe.exports=Z.p+"static/qrCode.dd0fe9b2.png"},GABl:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k4b2EFVfTt29NQ8l+zKf4EIUbi4kAnhz7ohuLiH1qCwwo62cf9ccf3l0jibh1DckPy3lKzmTcbYQW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DGdkQsdc6Gpxp/AtTt/2t4c9mghIKJvcU1O0VQVQk084yhjgHxKac9i45I+VZsTj3/SGI/MIyvjF6VqBrbAoTC6vDCjIfulZM/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(Pe,Le){Pe.exports=function(ie,Y,L,Q){var B=L?L.call(Q,ie,Y):void 0;if(B!==void 0)return!!B;if(ie===Y)return!0;if(typeof ie!="object"||!ie||typeof Y!="object"||!Y)return!1;var _=Object.keys(ie),H=Object.keys(Y);if(_.length!==H.length)return!1;for(var W=Object.prototype.hasOwnProperty.bind(Y),O=0;O<_.length;O++){var M=_[O];if(!W(M))return!1;var y=ie[M],w=Y[M];if(B=L?L.call(Q,y,w,M):void 0,B===!1||B===void 0&&y!==w)return!1}return!0}},HmJG:function(Pe,Le,Z){},HpTS:function(Pe,Le,Z){Pe.exports=Z.p+"static/small_program.f74069ec.png"},JWDV:function(Pe,Le,Z){Pe.exports=Z.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(Pe,Le){Pe.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+FEHTwVhc96CoAbzy9txJP7KpAP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Vm4s6Jon6VKzA053dTI46OH8hMARhbwa5OCbboU/9e8//BRH8j9mLdQoDqqNCwAAAABJRU5ErkJggg=="},Jq4h:function(Pe,Le,Z){Pe.exports=Z.p+"static/qrcode.2267e4d5.png"},LdHM:function(Pe,Le,Z){"use strict";Z.d(Le,"b",function(){return d}),Z.d(Le,"a",function(){return v});var ie=Z("1OyB"),Y=Z("vuIU"),L=Z("Ji7U"),Q=Z("LK+K"),B=Z("q1tI"),_=Z("rePB"),H=Z("Ff2n"),W=Z("ODXe"),O=Z("4IlW"),M=Z("bX4T"),y=Z("YrtM"),w=Z("TSYQ"),k=Z.n(w),D=Z("+nKL"),T=Z("8OUc"),S=function(ee,ae){var ce=ee.prefixCls,ve=ee.id,Me=ee.flattenOptions,xe=ee.childrenAsData,Ee=ee.values,Te=ee.searchValue,Se=ee.multiple,me=ee.defaultActiveFirstOption,se=ee.height,Re=ee.itemHeight,Ve=ee.notFoundContent,We=ee.open,Je=ee.menuItemSelectedIcon,Ze=ee.virtual,De=ee.onSelect,Ue=ee.onToggleOpen,Be=ee.onActiveValue,qe=ee.onScroll,Qe=ee.onMouseEnter,Ie="".concat(ce,"-item"),Ne=Object(y.a)(function(){return Me},[We,Me],function(Fe,ge){return ge[0]&&Fe[1]!==ge[1]}),$e=B.useRef(null),et=function(ge){ge.preventDefault()},Xe=function(ge){$e.current&&$e.current.scrollTo({index:ge})},Ke=function(ge){for(var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fe=Ne.length,te=0;te<fe;te+=1){var re=(ge+te*de+fe)%fe,ne=Ne[re],le=ne.group,pe=ne.data;if(!le&&!pe.disabled)return re}return-1},ct=B.useState(function(){return Ke(0)}),rt=Object(W.a)(ct,2),at=rt[0],Ae=rt[1],dt=function(ge){Ae(ge);var de=Ne[ge];if(!de){Be(null,-1);return}Be(de.data.value,ge)};B.useEffect(function(){dt(me!==!1?Ke(0):-1)},[Ne.length,Te]),B.useEffect(function(){var Fe=setTimeout(function(){if(!Se&&We&&Ee.size===1){var ge=Array.from(Ee)[0],de=Ne.findIndex(function(fe){var te=fe.data;return te.value===ge});dt(de),Xe(de)}});return function(){return clearTimeout(Fe)}},[We]);var ot=function(ge){ge!==void 0&&De(ge,{selected:!Ee.has(ge)}),Se||Ue(!1)};if(B.useImperativeHandle(ae,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=Ke(at+fe,fe);Xe(te),dt(te)}break}case O.a.ENTER:{var re=Ne[at];re&&!re.data.disabled?ot(re.data.value):ot(void 0),We&&ge.preventDefault();break}case O.a.ESC:Ue(!1)}},onKeyUp:function(){},scrollTo:function(ge){Xe(ge)}}}),Ne.length===0)return B.createElement("div",{role:"listbox",id:"".concat(ve,"_list"),className:"".concat(Ie,"-empty"),onMouseDown:et},Ve);function we(Fe){var ge=Ne[Fe];if(!ge)return null;var de=ge.data||{},fe=de.value,te=de.label,re=de.children,ne=Object(M.a)(de,!0),le=xe?re:te;return ge?B.createElement("div",Object.assign({"aria-label":typeof le=="string"?le:null},ne,{key:Fe,role:"option",id:"".concat(ve,"_list_").concat(Fe),"aria-selected":Ee.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(at-1),we(at),we(at+1)),B.createElement(D.a,{itemKey:"key",ref:$e,data:Ne,height:se,itemHeight:Re,fullHeight:!1,onMouseDown:et,onScroll:qe,virtual:Ze,onMouseEnter:Qe},function(Fe,ge){var de,fe=Fe.group,te=Fe.groupOption,re=Fe.data,ne=re.label,le=re.key;if(fe)return B.createElement("div",{className:k()(Ie,"".concat(Ie,"-group"))},ne!==void 0?ne:le);var pe=re.disabled,Ce=re.value,Oe=re.title,st=re.children,mt=re.style,ht=re.className,Rt=Object(H.a)(re,["disabled","value","title","children","style","className"]),At=Ee.has(Ce),ft="".concat(Ie,"-option"),Ft=k()(Ie,ft,ht,(de={},Object(_.a)(de,"".concat(ft,"-grouped"),te),Object(_.a)(de,"".concat(ft,"-active"),at===ge&&!pe),Object(_.a)(de,"".concat(ft,"-disabled"),pe),Object(_.a)(de,"".concat(ft,"-selected"),At),de)),kt=xe?st:ne,Ht=!Je||typeof Je=="function"||At;return B.createElement("div",Object.assign({},Rt,{"aria-selected":At,className:Ft,title:Oe,onMouseMove:function(){if(at===ge||pe)return;dt(ge)},onClick:function(){pe||ot(Ce)},style:mt}),B.createElement("div",{className:"".concat(ft,"-content")},kt||Ce),B.isValidElement(Je)||At,Ht&&B.createElement(T.a,{className:"".concat(Ie,"-option-state"),customizeIcon:Je,customizeIconProps:{isSelected:At}},At?"\u2713":null))}))},h=B.forwardRef(S);h.displayName="OptionList";var o=h,u=function(){return null};u.isSelectOption=!0;var d=u,A=function(){return null};A.isSelectOptGroup=!0;var v=A,m=Z("VTBJ"),R=Z("Zm9Q");function x(F){var ee=F.key,ae=F.props,ce=ae.children,ve=ae.value,Me=Object(H.a)(ae,["children","value"]);return Object(m.a)({key:ee,value:ve!==void 0?ve:ee,children:ce},Me)}function f(F){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(F).map(function(ae,ce){if(!B.isValidElement(ae)||!ae.type)return null;var ve=ae.type.isSelectOptGroup,Me=ae.key,xe=ae.props,Ee=xe.children,Te=Object(H.a)(xe,["children"]);return ee||!ve?x(ae):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(Me===null?ce:Me,"__"),label:Me},Te),{},{options:f(Ee)})}).filter(function(ae){return ae})}var c=Z("2Qr1"),s=Z("qNPg"),a=Z("U8pU"),b=Z("Kwbf"),g=Z("WKfj");function E(F){var ee=F.mode,ae=F.options,ce=F.children,ve=F.backfill,Me=F.allowClear,xe=F.placeholder,Ee=F.getInputElement,Te=F.showSearch,Se=F.onSearch,me=F.defaultOpen,se=F.autoFocus,Re=F.labelInValue,Ve=F.value,We=F.inputValue,Je=F.optionLabelProp,Ze=ee==="multiple"||ee==="tags",De=Te!==void 0?Te:Ze||ee==="combobox",Ue=ae||f(ce);if(Object(b.a)(ee!=="tags"||Ue.every(function(Ie){return!Ie.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ee==="tags"||ee==="combobox"){var Be=Ue.some(function(Ie){return Ie.options?Ie.options.some(function(Ne){return typeof("value"in Ne?Ne.value:Ne.key)=="number"}):typeof("value"in Ie?Ie.value:Ie.key)=="number"});Object(b.a)(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(ee!=="combobox"||!Je,"`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"||!Ee,"`getInputElement` only work with `combobox` mode."),Object(b.b)(ee!=="combobox"||!Ee||!Me||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Se&&!De&&ee!=="combobox"&&ee!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!me||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ve!=null){var qe=Object(g.d)(Ve);Object(b.a)(!Re||qe.every(function(Ie){return Object(a.a)(Ie)==="object"&&("key"in Ie||"value"in Ie)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Ze||Array.isArray(Ve),"`value` should be array when `mode` is `multiple` or `tags`")}if(ce){var Qe=null;Object(R.a)(ce).some(function(Ie){if(!B.isValidElement(Ie)||!Ie.type)return!1;var Ne=Ie.type;if(Ne.isSelectOption)return!1;if(Ne.isSelectOptGroup){var $e=Object(R.a)(Ie.props.children).every(function(et){return!B.isValidElement(et)||!Ie.type||et.type.isSelectOption?!0:(Qe=et.type,!1)});return!$e}return Qe=Ne,!0}),Qe&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Qe.displayName||Qe.name||Qe,"`.")),Object(b.a)(We===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=E,G=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:f,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:P,fillOptionsWithMissingValue:c.a}),V=function(F){Object(L.a)(ae,F);var ee=Object(Q.a)(ae);function ae(){var ce;return Object(ie.a)(this,ae),ce=ee.apply(this,arguments),ce.selectRef=B.createRef(),ce.focus=function(){ce.selectRef.current.focus()},ce.blur=function(){ce.selectRef.current.blur()},ce}return Object(Y.a)(ae,[{key:"render",value:function(){return B.createElement(G,Object.assign({ref:this.selectRef},this.props))}}]),ae}(B.Component);V.Option=d,V.OptGroup=v;var $=V,z=Le.c=$},M8RZ:function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return O});var ie=Z("fWQN"),Y=Z("mtLc"),L=Z("yKVA"),Q=Z("879j"),B=Z("q1tI"),_=Z.n(B),H=Z("i8i4"),W=Z.n(H),O=function(M){Object(L.a)(w,M);var y=Object(Q.a)(w);function w(k){var D;Object(ie.a)(this,w),D=y.call(this,k);var T=window.document;return D.node=T.createElement("div"),T.body.appendChild(D.node),D}return Object(Y.a)(w,[{key:"render",value:function(){var D=this.props.children;return Object(H.createPortal)(D,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),w}(_.a.Component)},Nmxd:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/Ldf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9pN89U3GTdn3WKKxpvTmRuWglmPpKOtK91IiQ73vvJFL/YCa5UbLaVaDzXXTP2p4tmjvGREYnbruOgrn7MwKvlEg9gvLpG1E2000ntKNh5O82EznQobvkVF9S732LIgus6rg0RHTNCsdYJA7oWB7jLJdlOIxzfUwwbTHY+zSy+ccldAkbtRjimThroCYAzA46bqUl6JmxOh+IH8mbq1K65NXLuIIAnymqAMQbyNRrhtvT0qkQgqe4lRof7RHKdEe6Y9XEe0NVDBLzsnrMwcmbp/rOs8lXPQtzODHhY+/9LEq0aCcV0M22wX21jge5yiwdwGVW+RuPZnGUVM9FkP+NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},OLES:function(Pe,Le,Z){"use strict";var ie=Z("U8pU"),Y=Z("VTBJ"),L=Z("Ff2n"),Q=Z("q1tI"),B=Z("uciX"),_=Z("7ixt"),H=function(k){var D=k.overlay,T=k.prefixCls,S=k.id,h=k.overlayInnerStyle;return Q.createElement("div",{className:"".concat(T,"-inner"),id:S,role:"tooltip",style:h},typeof D=="function"?D():D)},W=H,O=function(k,D){var T=k.overlayClassName,S=k.trigger,h=S===void 0?["hover"]:S,o=k.mouseEnterDelay,u=o===void 0?0:o,d=k.mouseLeaveDelay,A=d===void 0?.1:d,v=k.overlayStyle,m=k.prefixCls,R=m===void 0?"rc-tooltip":m,x=k.children,f=k.onVisibleChange,c=k.afterVisibleChange,s=k.transitionName,a=k.animation,b=k.placement,g=b===void 0?"right":b,E=k.align,P=E===void 0?{}:E,G=k.destroyTooltipOnHide,V=G===void 0?!1:G,$=k.defaultVisible,z=k.getTooltipContainer,F=k.overlayInnerStyle,ee=Object(L.a)(k,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ae=Object(Q.useRef)(null);Object(Q.useImperativeHandle)(D,function(){return ae.current});var ce=Object(Y.a)({},ee);"visible"in k&&(ce.popupVisible=k.visible);var ve=function(){var Se=k.arrowContent,me=Se===void 0?null:Se,se=k.overlay,Re=k.id;return[Q.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},me),Q.createElement(W,{key:"content",prefixCls:R,id:Re,overlay:se,overlayInnerStyle:F})]},Me=!1,xe=!1;if(typeof V=="boolean")Me=V;else if(V&&Object(ie.a)(V)==="object"){var Ee=V.keepParent;Me=Ee===!0,xe=Ee===!1}return Q.createElement(B.a,Object.assign({popupClassName:T,prefixCls:R,popup:ve,action:h,builtinPlacements:_.a,popupPlacement:g,ref:ae,popupAlign:P,getPopupContainer:z,onPopupVisibleChange:f,afterPopupVisibleChange:c,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:$,destroyPopupOnHide:Me,autoDestroy:xe,mouseLeaveDelay:A,popupStyle:v,mouseEnterDelay:u},ce),x)},M=Object(Q.forwardRef)(O),y=Le.a=M},Ohmc:function(Pe,Le,Z){Pe.exports=Z.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Pe,Le,Z){"use strict";var ie=Z("2qtc"),Y=Z("kLXV"),L=Z("rAM+"),Q=Z("miYZ"),B=Z("tsqr"),_=Z("9og8"),H=Z("tJVT"),W=Z("jrin"),O=Z("WmNS"),M=Z.n(O),y=Z("q1tI"),w=Z.n(y),k=Z("VrN/"),D=Z.n(k),T=Z("bdgK"),S=Z("p77/"),h=Z("Bd2K"),o=Z("ELLl"),u=Z("19Vz"),d=Z("lZu9"),A=Z("+NIl"),v=Z("kSUc"),m=Z("9Bee"),R=function(pe){var Ce=pe.value,Oe=Ce===void 0?"":Ce,st=pe.className,mt=pe.showTextOnly,ht=pe.showLines,Rt=pe.style,At=Rt===void 0?{}:Rt,ft=Object(y.useMemo)(function(){return""},[Oe]);return w.a.createElement(w.a.Fragment,null,w.a.createElement("div",{dangerouslySetInnerHTML:{__html:ft}}))},x=Z("0Owb"),f=Z("dejd"),c=Z("C+DQ"),s=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 g(pe){var Ce=pe.onActionCallback,Oe=pe.title,st=pe.icon,mt=pe.actionName,ht=pe.className,Rt=ht===void 0?"":ht,At=pe.children;function ft(){Ce(mt)}return w.a.createElement("a",{title:Oe,className:Rt,onClick:ft},w.a.createElement("i",{className:"md-iconfont ".concat(st)}),At)}var E=function(pe){var Ce=pe.watch,Oe=pe.showNullButton,st=pe.onActionCallback,mt=pe.fullScreen,ht=pe.insertTemp,Rt=pe.hidetoolBar,At=pe.uuid,ft=pe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.F)("_educoder_session"),"&key=").concat(At,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Ft=[].concat(b,[{title:"".concat(Ce?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ce?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return w.a.createElement("ul",{className:"markdown-toolbar-container"},!Rt&&Ft.map(function(kt,Ht){return w.a.createElement("li",{key:Ht},kt.actionName?w.a.createElement(g,Object(x.a)({},kt,{onActionCallback:st})):w.a.createElement("span",{className:"v-line"}))}),Oe?w.a.createElement("li",null,w.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:st},w.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ht&&w.a.createElement("li",null,w.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ht),onActionCallback:st},w.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),w.a.createElement("li",{className:"btn-full-screen"},w.a.createElement(g,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:st})))},P=Z("M8RZ"),G=Z("+L6B"),V=Z("2/Rp"),$=Z("y8nQ"),z=Z("Vl3Y"),F=Z("5NDa"),ee=Z("5rEg"),ae={labelCol:{span:4},wrapperCol:{span:20}},ce=function(pe){var Ce=pe.callback,Oe=pe.onCancel;function st(mt){Ce(mt)}return w.a.createElement(z.a,Object(x.a)({},ae,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:st}),w.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},w.a.createElement(ee.a,null)),w.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},w.a.createElement(ee.a,null)),w.a.createElement("div",{className:"flex-container flex-end"},w.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(V.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},ve=Z("7ahc"),Me=Z("HmJG"),xe=Z("BjJ7"),Ee=z.a.useForm,Te={width:280,marginRight:10},Se={labelCol:{span:5},wrapperCol:{span:19}},me=function(pe){var Ce=pe.callback,Oe=pe.onCancel,st=Ee(),mt=Object(H.a)(st,1),ht=mt[0];function Rt(Ft){Ce(Ft)}function At(Ft,kt){if(Ft.status===-1){B.b.error(Ft.message);return}ht.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:kt.type})}function ft(Ft){var kt=Ft.target.files[0];Re(kt,At)}return w.a.createElement(z.a,Object(x.a)({form:ht},Se,{className:"upload-image-panel",onFinish:Rt}),w.a.createElement(z.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},w.a.createElement("div",{className:"flex-container"},w.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},w.a.createElement(ee.a,{style:Te})),w.a.createElement(se,{onFileChange:ft}))),w.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},w.a.createElement(ee.a,{style:{width:264}})),w.a.createElement(z.a.Item,{style:{textAlign:"right"}},w.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(V.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))};function se(pe){var Ce=pe.onFileChange;return w.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",w.a.createElement("input",{type:"file",onChange:Ce}))}function Re(pe,Ce){if(!pe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Oe=new FormData;Oe.append("editormd-image-file",pe),Oe.append("file_param_name","editormd-image-file"),Oe.append("byxhr","true");var st=new window.XMLHttpRequest;st.withCredentials=!0,st.addEventListener("load",function(mt){Ce(JSON.parse(mt.target.responseText),pe)},!1),st.addEventListener("error",function(mt){console.error(mt)},!1),st.open("POST","".concat(xe.a,"/api/attachments.json")),st.send(Oe)}var Ve=Z("giR+"),We=Z("fyUT"),Je=Z("7Kak"),Ze=Z("9yH6"),De=Ze.a.Group,Ue={margin:"0 8px"},Be=function(pe){var Ce=pe.callback,Oe=pe.onCancel;function st(mt){Ce(mt)}return w.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:st},w.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},w.a.createElement("span",{style:Ue},"\u5355\u5143\u683C\u6570\uFF1A"),w.a.createElement("span",{style:Ue},"\u884C\u6570"),w.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},w.a.createElement(We.a,null)),w.a.createElement("span",{style:Ue},"\u5217\u6570"),w.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},w.a.createElement(We.a,null))),w.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},w.a.createElement("span",{style:Ue},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),w.a.createElement(z.a.Item,{name:"align"},w.a.createElement(De,null,w.a.createElement(Ze.a,{value:"default"},w.a.createElement("i",{className:"fa fa-align-justify"})),w.a.createElement(Ze.a,{value:"left"},w.a.createElement("i",{className:"fa fa-align-left"})),w.a.createElement(Ze.a,{value:"center"},w.a.createElement("i",{className:"fa fa-align-center"})),w.a.createElement(Ze.a,{value:"right"},w.a.createElement("i",{className:"fa fa-align-right"}))))),w.a.createElement("div",{className:"flex-container flex-end"},w.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(V.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},qe=Z("ErOA"),Qe=Z("7Cbv"),Ie="link",Ne="upload-image",$e="code-block",et="add-table",Xe="------------",Ke={default:Xe,left:":".concat(Xe),center:":".concat(Xe,":"),right:"".concat(Xe,":")},ct=Z("9VGf"),rt,at;function Ae(){}var dt=0,ot=1e4,we="\u2581",Fe=`
|
|
**\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(pe){return/^\d+$/.test(pe)?"".concat(pe,"px"):pe}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(W.a)(rt,fe+"-B","bold"),Object(W.a)(rt,fe+"-I","italic"),rt),ne=(at={},Object(W.a)(at,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(at,$e,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(at,Ne,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(at,et,"\u6DFB\u52A0\u8868\u683C"),at),le=Le.a=function(pe){var Ce=pe.defaultValue,Oe=Ce===void 0?"":Ce,st=pe.onChange,mt=pe.width,ht=mt===void 0?"100%":mt,Rt=pe.height,At=Rt===void 0?400:Rt,ft=pe.miniToolbar,Ft=ft===void 0?!1:ft,kt=pe.isFocus,Ht=kt===void 0?!1:kt,It=pe.watch,xt=pe.insertTemp,Mt=pe.mode,jt=Mt===void 0?"markdown":Mt,lt=pe.id,$t=lt===void 0?"markdown-editor-id":lt,ar=pe.showResizeBar,ir=ar===void 0?!1:ar,Mr=pe.noStorage,ti=Mr===void 0?!1:Mr,Xt=pe.showNullButton,yt=Xt===void 0?!1:Xt,ze=pe.hidetoolBar,Kt=ze===void 0?!1:ze,wt=pe.fullScreen,tr=wt===void 0?!1:wt,Ot=pe.onBlur,ur=pe.onCMBeforeChange,bt=pe.onFullScreen,ri=pe.className,Ge=ri===void 0?"":ri,Dt=pe.disablePaste,pi=Dt===void 0?!1:Dt,mi=pe.placeholder,gi=mi===void 0?"":mi,vi=pe.values,j=vi===void 0?"":vi,l=Object(y.useState)(null),p=Object(H.a)(l,2),I=p[0],J=p[1],U=Object(y.useState)(Oe),he=Object(H.a)(U,2),_e=he[0],tt=he[1],gt=Object(y.useState)(It),je=Object(H.a)(gt,2),Ct=je[0],Gt=je[1],er=Object(y.useState)(tr),jr=Object(H.a)(er,2),Ar=jr[0],Tr=jr[1],Yr=Object(y.useState)(""),Ii=Object(H.a)(Yr,2),mr=Ii[0],zr=Ii[1],li=Object(y.useState)(0),ui=Object(H.a)(li,2),Wr=ui[0],Mi=ui[1],yi=Object(y.useState)(At),zi=Object(H.a)(yi,2),Ki=zi[0],Jr=zi[1],Qr=Object(y.useState)(!1),bi=Object(H.a)(Qr,2),hn=bi[0],Ei=bi[1],sr=Object(y.useRef)(Object(Qe.a)()),zt=Object(y.useRef)(!1),xr=Object(y.useRef)(),Bt=Object(y.useRef)(),dr=Object(y.useRef)(),Yt=Object(y.useRef)(),ii=Object(y.useRef)(),gr=function(){var vt=Object(_.a)(M.a.mark(function Lt(){var St,_t;return M.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(qe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:sr.current}});case 2:_t=Zt.sent,_t!=null&&(St=_t.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",I,Bt),_t.attachments.map(function(Ut){Ut.content_type.indexOf("image")>-1?I.replaceSelection(".concat(Ut.content_type,")")):Ut.content_type.indexOf("video")>-1?I.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ut.content_type.indexOf("pdf")>-1?I.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,'&disposition=inline" target="_blank">').concat(Ut.name,"</a>")):I.replaceSelection("[".concat(Ut.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,")"))}));case 4:case"end":return Zt.stop()}},Lt)}));return function(){return vt.apply(this,arguments)}}();Object(y.useEffect)(function(){tt(j),I==null||I.setValue(j)},[j]),Object(y.useEffect)(function(){bt==null||bt(Ar)},[Ar]),Object(y.useEffect)(function(){if(Bt.current){var vt=D.a.fromTextArea(Bt.current,{mode:jt,lineNumbers:!Ft,lineWrapping:!0,value:Oe,autoCloseTags:!0,autoCloseBrackets:!0});Ht&&vt.focus();function Lt(St,_t){if(pi){_t.preventDefault();return}var Wt=_t.clipboardData;if(Wt){var Zt=Wt.types.toString(),Ut=Wt.items;if(Zt==="Files"||Wt.types.indexOf("Files")>-1){if(_t.preventDefault(),jt=="stex")return;try{var fr,Or=Ut[1];((fr=Ut[0])===null||fr===void 0?void 0:fr.kind)==="file"&&(Or=Ut[0]);var Nt=Or.getAsFile(),di=Nt.name.split(".").pop();Re(Nt,function(Vt){if(Vt.id){var Pr,wr,Xr;(Nt==null||((Pr=Nt.type)===null||Pr===void 0)?void 0:Pr.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Nt==null||((wr=Nt.type)===null||wr===void 0)?void 0:wr.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(Nt==null||((Xr=Nt.type)===null||Xr===void 0)?void 0:Xr.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Nt.type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):te.includes(di)?vt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):vt.replaceSelection("[".concat(Nt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})}catch(Vt){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",Lt),vt.on("dragleave",function(St,_t){dr.current.classList.remove("mouse-hover-md")}),vt.on("dragover",function(St,_t){dr.current.classList.add("mouse-hover-md")}),vt.on("drop",function(St,_t){dr.current.classList.add("mouse-hover-md");var Wt;if(Wt=_t.dataTransfer.files,Wt.length>0){_t.preventDefault(),_t.stopPropagation();for(var Zt=function(Or){var Nt=Wt[Or],di=Nt.name.split(".").pop();Re(Nt,function(Vt){if(Vt.id){var Pr,wr,Xr;(Nt==null||((Pr=Nt.type)===null||Pr===void 0)?void 0:Pr.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Nt==null||((wr=Nt.type)===null||wr===void 0)?void 0:wr.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(Nt==null||((Xr=Nt.type)===null||Xr===void 0)?void 0:Xr.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Nt.type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):te.includes(di)?vt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):vt.replaceSelection("[".concat(Nt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})},Ut=0;Ut<Wt.length;Ut++)Zt(Ut)}}),J(vt),function(){vt.off("paste",Lt)}}},[]);var Lr=Object(y.useCallback)(function(){if(dr.current)try{}catch(vt){console.log(vt,"---- to set md editor body height")}},[Ki,dr,Ar]);Object(y.useEffect)(function(){function vt(){var St=new T.default(function(_t){var Wt=Object(L.a)(_t),Zt;try{for(Wt.s();!(Zt=Wt.n()).done;){var Ut=Zt.value;(Ut.target.offsetHeight>0||Ut.target.offsetWidth>0)&&(Lr(),I.setSize("100%","100%"),I.refresh())}}catch(fr){Wt.e(fr)}finally{Wt.f()}});return St.observe(Bt.current.parentElement),St}if(I){var Lt=vt();return function(){Lt.unobserve(Bt.current.parentElement)}}},[I,Lr]),Object(y.useEffect)(function(){if(I){for(var vt=[],Lt=function(){var Ut=_t[St];Wt=Object(H.a)(Ut,2);var fr=Wt[0],Or=Wt[1],Nt=Object(W.a)({},fr,function(){Vi(Or)});vt.push(Nt),I.addKeyMap(Nt)},St=0,_t=Object.entries(re);St<_t.length;St++){var Wt;Lt()}return xr.current=setInterval(function(){zt.current&&gr()},4e3),function(){clearInterval(xr.current);var Zt=Object(L.a)(vt),Ut;try{for(Zt.s();!(Ut=Zt.n()).done;){var fr=Ut.value;I.removeKeyMap(fr)}}catch(Or){Zt.e(Or)}finally{Zt.f()}}}},[I]),Object(y.useEffect)(function(){tr!==Ar&&Tr(tr)},[tr]),Object(ct.a)(function(){if(!ti&&Wr>0){var vt=new Date().getTime(),Lt=window.sessionStorage.getItem($t);vt>=Wr+ot&&(!Lt||Lt!==_e)&&(window.sessionStorage.setItem($t,_e),Ei(!0))}},ot),Object(y.useEffect)(function(){Gt(It)},[I,It]),Object(y.useEffect)(function(){I&&(Ht&&I.focus())},[I,Ht]),Object(y.useEffect)(function(){if(Ct&&I){var vt=I.getScrollerElement();function Lt(St){var _t=St.target;if(ii.current){var Wt=_t.scrollTop/_t.scrollHeight;ii.current.scrollTop=ii.current.scrollHeight*Wt}}return vt.addEventListener("scroll",Lt),function(){vt.removeEventListener("scroll",Lt)}}},[I,Ct]),Object(y.useEffect)(function(){if(I&&ur){function vt(Lt,St){ur(Lt,St)}return I.on("beforeChange",vt),function(){I.off("beforeChange",vt)}}},[I,ur]),Object(y.useEffect)(function(){if(I&&Ot){function vt(){Ot(I.getValue())}return I.on("blur",vt),function(){I.off("blur",vt)}}},[I,Ot]),Object(y.useEffect)(function(){if(I){function vt(Lt){var St=Lt.getValue();tt(St),Mi(new Date().getTime()),Lt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),st&&st(St)}return I.on("change",vt),function(){I.off("change",vt)}}},[I,st]),Object(y.useEffect)(function(){I&&(Oe==null?(I.setValue(""),tt("")):Oe!==I.getValue()&&(I.setValue(Oe),tt(Oe),I.setCursor(I.lineCount(),0)))},[I,Oe]);var Vi=Object(y.useCallback)(function(vt){var Lt=I.getCursor(),St=I.getSelection(),_t=St.split(`
|
|
`);switch(vt){case"bold":return I.replaceSelection("**"+St+"**"),St===""&&I.setCursor(Lt.line,Lt.ch+2),I.focus();case"italic":return I.replaceSelection("*"+St+"*"),St===""&&I.setCursor(Lt.line,Lt.ch+1),I.focus();case"code":return I.replaceSelection("`"+St+"`"),St===""&&I.setCursor(Lt.line,Lt.ch+1),I.focus();case"inline-latex":return I.replaceSelection("`$$"+St+"$$`"),St===""&&I.setCursor(Lt.line,Lt.ch+3),I.focus();case"latex":return I.replaceSelection("```latex\n"+St+"\n```"),I.setCursor(Lt.line+1,St.length+1),I.focus();case"line-break":return I.replaceSelection(`<br/>
|
|
`),I.focus();case"list-ul":return St===""?I.replaceSelection("- "+St):I.replaceSelection(_t.map(function(Wt){return Wt===""?"":"- ".concat(Wt)}).join(`
|
|
`)),I.focus();case"list-ol":return St===""?I.replaceSelection("1. "+St):I.replaceSelection(_t.map(function(Wt,Zt){return Wt===""?"":"".concat(Zt+1,". ").concat(Wt)}).join(`
|
|
`)),I.focus();case"add-null-ch":return St===""&&I.setCursor(Lt.line,Lt.ch+1),I.replaceSelection(we),I.focus();case"inster-template-1":return St===""&&I.setCursor(Lt.line,Lt.ch),I.replaceSelection(Fe),I.focus();case"eraser":return I.setValue(""),I.focus();case"trigger-watch":return Gt(!Ct),I.focus();case"trigger-full-screen":return Tr(!Ar),I.focus();case Ie:zr(Ie);return;case $e:zr($e);return;case Ne:zr(Ne);return;case et:zr(et);return;default:throw new Error}},[I,Ct,Ar]),xi=Object(y.useCallback)(function(vt){zr("");switch(mr){case Ie:var Lt=vt.title,St=vt.link;return I.replaceSelection("[".concat(Lt,"](").concat(St,")")),I.focus();case $e:var _t=vt.language,Wt=vt.content;return I.replaceSelection(["```"+_t,Wt,"```"].join(`
|
|
`)),I.focus();case Ne:var Zt=vt.src,Ut=vt.alt;return Ut?I.replaceSelection(".concat(Zt,' "').concat(Ut,'" )')):I.replaceSelection("")),I.focus();case et:for(var fr=vt.row,Or=vt.col,Nt=vt.align,di=`
|
|
`,Vt=0;Vt<fr;Vt++){for(var Pr=[],wr=[],Xr=0;Xr<Or;Xr++)Vt===1&&wr.push(Ke[Nt]),Pr.push(" ");Vt===1&&(di+="| ".concat(wr.join(" | "),` |
|
|
`)),di+="| ".concat(Pr.join(Or===1?"":" | "),` |
|
|
`)}return I.replaceSelection(di+`
|
|
`),I.focus();default:throw new Error}},[I,mr]),cn=Object(y.useMemo)(function(){switch(mr){case Ie:return w.a.createElement(ce,{callback:xi,onCancel:Ci});case $e:return w.a.createElement(ve.b,{callback:xi,onCancel:Ci});case Ne:return w.a.createElement(me,{callback:xi,onCancel:Ci});case et:return w.a.createElement(Be,{callback:xi,onCancel:Ci});default:return null}},[mr]);function Ci(){zr("")}Object(y.useEffect)(function(){if(Yt.current){var vt=Yt.current,Lt=!1,St=0;function _t(Ut){Lt=!0,St=Ut.pageY}function Wt(){Lt=!1}function Zt(Ut){if(Lt){var fr=Ut.pageY-St;fr<0&&(fr=0),fr>300&&(fr=300);var Or=At+fr+"px";Jr(Or)}}return vt.addEventListener("mousedown",_t),document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",Wt),function(){vt.removeEventListener("mousedown",_t),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",Wt)}}},[I,Yt]),Object(y.useEffect)(function(){Jr(At)},[At]);var ni=ge(ht),fn=ge(Ki),Zr={width:ni,height:fn},pn=Object(y.useMemo)(function(){if(Wr){var vt=new Date(Wr),Lt=vt.getHours(),St=vt.getMinutes(),_t=vt.getSeconds();return Lt=Lt<10?"0"+Lt:Lt,St=St<10?"0"+St:St,_t=_t<10?"0"+_t:_t,"".concat(Lt,":").concat(St,":").concat(_t)}return 0},[Wr]);function jn(){window.sessionStorage.removeItem($t),Ei(!1),Mi(0)}function Oi(){Ei(!1),Mi(0),I.setValue(window.sessionStorage.getItem($t))}function ua(vt,Lt){var St=I.getValue();St=St.replace(vt,Lt),tt(St),I==null||I.setValue(St)}return w.a.createElement(y.Fragment,null,w.a.createElement("div",{className:"markdown-editor-wrapper",ref:dr},w.a.createElement("div",{className:"markdown-editor-container ".concat(Ge," ").concat(Ct?"on-preview":""," ").concat(Ft?"mini":""," ").concat(Ar?"full-screen":""),style:Zr},w.a.createElement(E,{insertTemp:xt,watch:Ct,fullScreen:Ar,showNullButton:yt,onActionCallback:Vi,hidetoolBar:Kt,uuid:sr.current,setOpenPhones:function(){zt.current=!0}}),w.a.createElement("div",{className:"markdown-editor-body"},w.a.createElement("div",{className:"codemirror-container"},w.a.createElement("textarea",{ref:Bt,placeholder:gi})),Ct?w.a.createElement("div",{ref:ii,className:"preview-container"},jt==="stex"&&w.a.createElement(R,{value:_e}),jt!=="stex"&&w.a.createElement(m.a,{edit:!0,value:_e,replaces:ua})):null))),ir?w.a.createElement("a",{ref:Yt,className:"editor-resize"}):null,w.a.createElement(P.a,null,ne[mr]?w.a.createElement(Y.a,{centered:!0,title:ne[mr],visible:!0,onCancel:Ci,footer:null,className:"markdown-popup-form"},cn):null))}},RMFE:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYaxFgAABgfYNECBAICog0NHDWIsAAQIC7RsgQIBAVECgo4exFgECBATaN0CAAIGogEBHD2MtAgQICLRvgAABAlEBgY4exloECBAQaN8AAQIEogICHT2MtQgQICDQvgECBAhEBQQ6ehhrESBAQKB9AwQIEIgKCHT0MNYiQICAQPsGCBAgEBUQ6OhhrEWAAAGB9g0QIEAgKiDQ0cNYiwABAgLtGyBAgEBUQKCjh7EWAQIEBNo3QIAAgaiAQEcPYy0CBAh8/5Tg6+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wzIECBCYgEDPwkSAAIGUgECnzmEZAgQITECgZ2EiQIBASkCgU+ewDAECBCYg0LMwESBAICUg0KlzWIYAAQITEOhZmAgQIJASEOjUOSxDgACBCQj0LEwECBBICXz/dJvP5/PTP/V3BAgQIHAg4D/oA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Pe,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,Y,L=!1,Q,B;window.PR_SHOULD_USE_CONTINUATION=!0;var _,H;(function(){var W=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"],w=[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"],T="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",S=[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"],u=[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=[w,D,k,S,h,o,u,d],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",R="kwd",x="com",f="typ",c="lit",s="pun",a="pln",b="tag",g="dec",E="src",P="atn",G="atv",V="nocode",$="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(De){for(var Ue=0,Be=!1,qe=!1,Qe=0,Ie=De.length;Qe<Ie;++Qe){var Ne=De[Qe];if(Ne.ignoreCase)qe=!0;else if(/[a-z]/i.test(Ne.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Be=!0,qe=!1;break}}var $e={b:8,t:9,n:10,v:11,f:12,r:13};function et(at){var Ae=at.charCodeAt(0);if(Ae!==92)return Ae;var dt=at.charAt(1);return Ae=$e[dt],Ae||("0"<=dt&&dt<="7"?parseInt(at.substring(1),8):dt==="u"||dt==="x"?parseInt(at.substring(2),16):at.charCodeAt(1))}function Xe(at){if(at<32)return(at<16?"\\x0":"\\x")+at.toString(16);var Ae=String.fromCharCode(at);return Ae==="\\"||Ae==="-"||Ae==="]"||Ae==="^"?"\\"+Ae:Ae}function Ke(at){var Ae=at.substring(1,at.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")),dt=[],ot=Ae[0]==="^",we=["["];ot&&we.push("^");for(var Fe=ot?1:0,ge=Ae.length;Fe<ge;++Fe){var de=Ae[Fe];if(/\\[bdsw]/i.test(de))we.push(de);else{var fe=et(de),te;Fe+2<ge&&Ae[Fe+1]==="-"?(te=et(Ae[Fe+2]),Fe+=2):te=fe,dt.push([fe,te]),te<65||fe>122||(te<65||fe>90||dt.push([Math.max(65,fe)|32,Math.min(te,90)|32]),te<97||fe>122||dt.push([Math.max(97,fe)&~32,Math.min(te,122)&~32]))}}dt.sort(function(pe,Ce){return pe[0]-Ce[0]||Ce[1]-pe[1]});for(var re=[],ne=[],Fe=0;Fe<dt.length;++Fe){var le=dt[Fe];le[0]<=ne[1]+1?ne[1]=Math.max(ne[1],le[1]):re.push(ne=le)}for(var Fe=0;Fe<re.length;++Fe){var le=re[Fe];we.push(Xe(le[0])),le[1]>le[0]&&(le[1]+1>le[0]&&we.push("-"),we.push(Xe(le[1])))}return we.push("]"),we.join("")}function ct(at){for(var Ae=at.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")),dt=Ae.length,ot=[],we=0,Fe=0;we<dt;++we){var ge=Ae[we];if(ge==="(")++Fe;else if(ge.charAt(0)==="\\"){var de=+ge.substring(1);de&&(de<=Fe?ot[de]=-1:Ae[we]=Xe(de))}}for(var we=1;we<ot.length;++we)ot[we]===-1&&(ot[we]=++Ue);for(var we=0,Fe=0;we<dt;++we){var ge=Ae[we];if(ge==="(")++Fe,ot[Fe]||(Ae[we]="(?:");else if(ge.charAt(0)==="\\"){var de=+ge.substring(1);de&&de<=Fe&&(Ae[we]="\\"+ot[de])}}for(var we=0;we<dt;++we)Ae[we]==="^"&&Ae[we+1]!=="^"&&(Ae[we]="");if(at.ignoreCase&&Be)for(var we=0;we<dt;++we){var ge=Ae[we],fe=ge.charAt(0);ge.length>=2&&fe==="["?Ae[we]=Ke(ge):fe!=="\\"&&(Ae[we]=ge.replace(/[a-zA-Z]/g,function(ne){var le=ne.charCodeAt(0);return"["+String.fromCharCode(le&~32,le|32)+"]"}))}return Ae.join("")}for(var rt=[],Qe=0,Ie=De.length;Qe<Ie;++Qe){var Ne=De[Qe];if(Ne.global||Ne.multiline)throw new Error(""+Ne);rt.push("(?:"+ct(Ne)+")")}return new RegExp(rt.join("|"),qe?"gi":"g")}function F(De,Ue){var Be=/(?:^|\s)nocode(?:\s|$)/,qe=[],Qe=0,Ie=[],Ne=0;function $e(et){var Xe=et.nodeType;if(Xe==1){if(Be.test(et.className))return;for(var Ke=et.firstChild;Ke;Ke=Ke.nextSibling)$e(Ke);var ct=et.nodeName.toLowerCase();(ct==="br"||ct==="li")&&(qe[Ne]=`
|
|
`,Ie[Ne<<1]=Qe++,Ie[Ne++<<1|1]=et)}else if(Xe==3||Xe==4){var rt=et.nodeValue;rt.length&&(Ue?rt=rt.replace(/\r\n?/g,`
|
|
`):rt=rt.replace(/[ \t\r\n]+/g," "),qe[Ne]=rt,Ie[Ne<<1]=Qe,Qe+=rt.length,Ie[Ne++<<1|1]=et)}}return $e(De),{sourceCode:qe.join("").replace(/\n$/,""),spans:Ie}}function ee(De,Ue,Be,qe,Qe){if(!Be)return;var Ie={sourceNode:De,pre:1,langExtension:null,numberLines:null,sourceCode:Be,spans:null,basePos:Ue,decorations:null};qe(Ie),Qe.push.apply(Qe,Ie.decorations)}var ae=/\S/;function ce(De){for(var Ue=void 0,Be=De.firstChild;Be;Be=Be.nextSibling){var qe=Be.nodeType;Ue=qe===1?Ue?De:Be:qe===3&&ae.test(Be.nodeValue)?De:Ue}return Ue===De?void 0:Ue}function ve(De,Ue){var Be={},qe;(function(){for(var Ne=De.concat(Ue),$e=[],et={},Xe=0,Ke=Ne.length;Xe<Ke;++Xe){var ct=Ne[Xe],rt=ct[3];if(rt)for(var at=rt.length;--at>=0;)Be[rt.charAt(at)]=ct;var Ae=ct[1],dt=""+Ae;et.hasOwnProperty(dt)||($e.push(Ae),et[dt]=null)}$e.push(/[\0-\uffff]/),qe=z($e)})();var Qe=Ue.length,Ie=function(Ne){for(var $e=Ne.sourceCode,et=Ne.basePos,Xe=Ne.sourceNode,Ke=[et,a],ct=0,rt=$e.match(qe)||[],at={},Ae=0,dt=rt.length;Ae<dt;++Ae){var ot=rt[Ae],we=at[ot],Fe=void 0,ge;if(typeof we=="string")ge=!1;else{var de=Be[ot.charAt(0)];if(de)Fe=ot.match(de[1]),we=de[0];else{for(var fe=0;fe<Qe;++fe)if(de=Ue[fe],Fe=ot.match(de[1]),Fe){we=de[0];break}Fe||(we=a)}ge=we.length>=5&&we.substring(0,5)==="lang-",ge&&!(Fe&&typeof Fe[1]=="string")&&(ge=!1,we=E),ge||(at[ot]=we)}var te=ct;if(ct+=ot.length,!ge)Ke.push(et+te,we);else{var re=Fe[1],ne=ot.indexOf(re),le=ne+re.length;Fe[2]&&(le=ot.length-Fe[2].length,ne=le-re.length);var pe=we.substring(5);ee(Xe,et+te,ot.substring(0,ne),Ie,Ke),ee(Xe,et+te+ne,re,se(pe,re),Ke),ee(Xe,et+te+le,ot.substring(le),Ie,Ke)}}Ne.decorations=Ke};return Ie}function Me(De){var Ue=[],Be=[];De.tripleQuotedStrings?Ue.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):De.multiLineStrings?Ue.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ue.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),De.verbatimStrings&&Be.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var qe=De.hashComments;qe&&(De.cStyleComments?(qe>1?Ue.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ue.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Be.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ue.push([x,/^#[^\r\n]*/,null,"#"])),De.cStyleComments&&(Be.push([x,/^\/\/[^\r\n]*/,null]),Be.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Qe=De.regexLiterals;if(Qe){var Ie=Qe>1?"":`
|
|
\r`,Ne=Ie?".":"[\\S\\s]",$e="/(?=[^/*"+Ie+"])(?:[^/\\x5B\\x5C"+Ie+"]|\\x5C"+Ne+"|\\x5B(?:[^\\x5C\\x5D"+Ie+"]|\\x5C"+Ne+")*(?:\\x5D|$))+/";Be.push(["lang-regex",RegExp("^"+$+"("+$e+")")])}var et=De.types;et&&Be.push([f,et]);var Xe=(""+De.keywords).replace(/^ | $/g,"");Xe.length&&Be.push([R,new RegExp("^(?:"+Xe.replace(/[\s,]+/g,"|")+")\\b"),null]),Ue.push([a,/^\s+/,null,` \r
|
|
\xA0`]);var Ke="^.[^\\s\\w.$@'\"`/\\\\]*";return De.regexLiterals&&(Ke+="(?!s*/)"),Be.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[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],[s,new RegExp(Ke),null]),ve(Ue,Be)}var xe=Me({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ee(De,Ue,Be){for(var qe=/(?:^|\s)nocode(?:\s|$)/,Qe=/\r\n?|\n/,Ie=De.ownerDocument,Ne=Ie.createElement("li");De.firstChild;)Ne.appendChild(De.firstChild);var $e=[Ne];function et(Ae){var dt=Ae.nodeType;if(dt==1&&!qe.test(Ae.className))if(Ae.nodeName==="br")Xe(Ae),Ae.parentNode&&Ae.parentNode.removeChild(Ae);else for(var ot=Ae.firstChild;ot;ot=ot.nextSibling)et(ot);else if((dt==3||dt==4)&&Be){var we=Ae.nodeValue,Fe=we.match(Qe);if(Fe){var ge=we.substring(0,Fe.index);Ae.nodeValue=ge;var de=we.substring(Fe.index+Fe[0].length);if(de){var fe=Ae.parentNode;fe.insertBefore(Ie.createTextNode(de),Ae.nextSibling)}Xe(Ae),ge||Ae.parentNode.removeChild(Ae)}}}function Xe(Ae){for(;!Ae.nextSibling;)if(Ae=Ae.parentNode,!Ae)return;function dt(Fe,ge){var de=ge?Fe.cloneNode(!1):Fe,fe=Fe.parentNode;if(fe){var te=dt(fe,1),re=Fe.nextSibling;te.appendChild(de);for(var ne=re;ne;ne=re)re=ne.nextSibling,te.appendChild(ne)}return de}for(var ot=dt(Ae.nextSibling,0),we;(we=ot.parentNode)&&we.nodeType===1;)ot=we;$e.push(ot)}for(var Ke=0;Ke<$e.length;++Ke)et($e[Ke]);Ue===(Ue|0)&&$e[0].setAttribute("value",Ue);var ct=Ie.createElement("ol");ct.className="linenums";for(var rt=Math.max(0,Ue-1|0)||0,Ke=0,at=$e.length;Ke<at;++Ke)Ne=$e[Ke],Ne.className="L"+(Ke+rt)%10,Ne.firstChild||Ne.appendChild(Ie.createTextNode("\xA0")),ct.appendChild(Ne);De.appendChild(ct)}function Te(De){var Ue=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ue=Ue&&+Ue[1]<=8;var Be=/\n/g,qe=De.sourceCode,Qe=qe.length,Ie=0,Ne=De.spans,$e=Ne.length,et=0,Xe=De.decorations,Ke=Xe.length,ct=0;Xe[Ke]=Qe;var rt,at;for(at=rt=0;at<Ke;)Xe[at]!==Xe[at+2]?(Xe[rt++]=Xe[at++],Xe[rt++]=Xe[at++]):at+=2;for(Ke=rt,at=rt=0;at<Ke;){for(var Ae=Xe[at],dt=Xe[at+1],ot=at+2;ot+2<=Ke&&Xe[ot+1]===dt;)ot+=2;Xe[rt++]=Ae,Xe[rt++]=dt,at=ot}Ke=Xe.length=rt;var we=De.sourceNode,Fe="";we&&(Fe=we.style.display,we.style.display="none");try{for(var ge=null;et<$e;){var de=Ne[et],fe=Ne[et+2]||Qe,te=Xe[ct+2]||Qe,ot=Math.min(fe,te),re=Ne[et+1],ne;if(re.nodeType!==1&&(ne=qe.substring(Ie,ot))){Ue&&(ne=ne.replace(Be,"\r")),re.nodeValue=ne;var le=re.ownerDocument,pe=le.createElement("span");pe.className=Xe[ct+1];var Ce=re.parentNode;Ce.replaceChild(pe,re),pe.appendChild(re),Ie<fe&&(Ne[et+1]=re=le.createTextNode(qe.substring(ot,fe)),Ce.insertBefore(re,pe.nextSibling))}Ie=ot,Ie>=fe&&(et+=2),Ie>=te&&(ct+=2)}}finally{we&&(we.style.display=Fe)}}var Se={};function me(De,Ue){for(var Be=Ue.length;--Be>=0;){var qe=Ue[Be];Se.hasOwnProperty(qe)?W.console&&console.warn("cannot override language handler %s",qe):Se[qe]=De}}function se(De,Ue){return De&&Se.hasOwnProperty(De)||(De=/^\s*</.test(Ue)?"default-markup":"default-code"),Se[De]}me(xe,["default-code"]),me(ve([],[[a,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["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"]),me(ve([[a,/^[\s]+/,null,` \r
|
|
`],[G,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[b,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),me(ve([],[[G,/^[\s\S]+/]]),["uq.val"]),me(Me({keywords:w,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),me(Me({keywords:"null,true,false"}),["json"]),me(Me({keywords:D,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),me(Me({keywords:k,cStyleComments:!0}),["java"]),me(Me({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),me(Me({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),me(Me({keywords:h,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),me(Me({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),me(Me({keywords:S,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),me(Me({keywords:T,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),me(ve([],[[m,/^[\s\S]+/]]),["regex"]);function Re(De){var Ue=De.langExtension;try{var Be=F(De.sourceNode,De.pre),qe=Be.sourceCode;De.sourceCode=qe,De.spans=Be.spans,De.basePos=0,se(Ue,qe)(De),Te(De)}catch(Qe){W.console&&console.log(Qe&&Qe.stack||Qe)}}function Ve(De,Ue,Be){var qe=Be||!1,Qe=Ue||null,Ie=document.createElement("div");Ie.innerHTML="<pre>"+De+"</pre>",Ie=Ie.firstChild,qe&&Ee(Ie,qe,!0);var Ne={langExtension:Qe,numberLines:qe,sourceNode:Ie,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Re(Ne),Ie.innerHTML}function We(De,Ue){var Be=Ue||document.body,qe=Be.ownerDocument||document;function Qe(de){return Be.getElementsByTagName(de)}for(var Ie=[Qe("pre"),Qe("code"),Qe("xmp")],Ne=[],$e=0;$e<Ie.length;++$e)for(var et=0,Xe=Ie[$e].length;et<Xe;++et)Ne.push(Ie[$e][et]);Ie=null;var Ke=Date;Ke.now||(Ke={now:function(){return+new Date}});var ct=0,rt=/\blang(?:uage)?-([\w.]+)(?!\S)/,at=/\bprettyprint\b/,Ae=/\bprettyprinted\b/,dt=/pre|xmp/i,ot=/^code$/i,we=/^(?:pre|code|xmp)$/i,Fe={};function ge(){for(var de=W.PR_SHOULD_USE_CONTINUATION?Ke.now()+250:Infinity;ct<Ne.length&&Ke.now()<de;ct++){for(var fe=Ne[ct],te=Fe,re=fe;re=re.previousSibling;){var ne=re.nodeType,le=(ne===7||ne===8)&&re.nodeValue;if(le?!/^\??prettify\b/.test(le):ne!==3||/\S/.test(re.nodeValue))break;if(le){te={},le.replace(/\b(\w+)=([\w:.%+-]+)/g,function(It,xt,Mt){te[xt]=Mt});break}}var pe=fe.className;if((te!==Fe||at.test(pe))&&!Ae.test(pe)){for(var Ce=!1,Oe=fe.parentNode;Oe;Oe=Oe.parentNode){var st=Oe.tagName;if(we.test(st)&&Oe.className&&at.test(Oe.className)){Ce=!0;break}}if(!Ce){fe.className+=" prettyprinted";var mt=te.lang;if(!mt){mt=pe.match(rt);var ht;!mt&&(ht=ce(fe))&&ot.test(ht.tagName)&&(mt=ht.className.match(rt)),mt&&(mt=mt[1])}var Rt;if(dt.test(fe.tagName))Rt=1;else{var At=fe.currentStyle,ft=qe.defaultView,Ft=At?At.whiteSpace:ft&&ft.getComputedStyle?ft.getComputedStyle(fe,null).getPropertyValue("white-space"):0;Rt=Ft&&Ft.substring(0,3)==="pre"}var kt=te.linenums;(kt=kt==="true"||+kt)||(kt=pe.match(/\blinenums\b(?::(\d+))?/),kt=kt?kt[1]&&kt[1].length?+kt[1]:!0:!1),kt&&Ee(fe,kt,Rt);var Ht={langExtension:mt,sourceNode:fe,numberLines:kt,pre:Rt,sourceCode:null,basePos:null,spans:null,decorations:null};Re(Ht)}}}ct<Ne.length?W.setTimeout(ge,250):typeof De=="function"&&De()}ge()}var Je=W.PR={createSimpleLexer:ve,registerLangHandler:me,sourceDecorator:Me,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:G,PR_COMMENT:x,PR_DECLARATION:g,PR_KEYWORD:R,PR_LITERAL:c,PR_NOCODE:V,PR_PLAIN:a,PR_PUNCTUATION:s,PR_SOURCE:E,PR_STRING:m,PR_TAG:b,PR_TYPE:f,prettyPrintOne:L?W.prettyPrintOne=Ve:_=Ve,prettyPrint:H=L?W.prettyPrint=We:H=We},Ze=W.define;typeof Ze=="function"&&Ze.amd&&Ze("google-code-prettify",[],function(){return Je})})()},SMhR:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3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JwF5UttsgLwJyJPa5gaQG0De0jY3gGza5gaQG22zAXKjbZ4EZAPkTUBuANm0zac6kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjR+ole1zZvaZgPkRtvcAPIkIJu22QDZtM3fCsiNttkAudE2TwKyaZtN22yAbNrmBpAbbbMBsgGyaZu3nEiSpHEiSZLGiSRJGieSJGmcSJKkcSJJksaJJEkaP9FHA3KjbTZAngRk0zafDMiTgPyptrkB5Eltc6Nt3gTkTW1zA8imbZ7UNt/qRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdL4yZdrm28G5JO1zQ0gN9pmA2QDZNM2GyCbtrnRNk8BcqNtNkA2QN7UNhsgTwKyaZsNkE3bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},TGq3:function(Pe,Le,Z){Pe.exports=Z.p+"static/lockclose.365036e8.svg"},"VrN/":function(Pe,Le,Z){(function(ie,Y){Pe.exports=Y()})(this,function(){"use strict";var ie=navigator.userAgent,Y=navigator.platform,L=/gecko\/\d/i.test(ie),Q=/MSIE \d/.test(ie),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),_=/Edge\/(\d+)/.exec(ie),H=Q||B||_,W=H&&(Q?document.documentMode||6:+(_||B)[1]),O=!_&&/WebKit\//.test(ie),M=O&&/Qt\/\d+\.\d+/.test(ie),y=!_&&/Chrome\//.test(ie),w=/Opera\//.test(ie),k=/Apple Computer/.test(navigator.vendor),D=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),T=/PhantomJS/.test(ie),S=!_&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),h=/Android/.test(ie),o=S||h||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),u=S||/Mac/.test(Y),d=/\bCrOS\b/.test(ie),A=/win/i.test(Y),v=w&&ie.match(/Version\/(\d*\.\d*)/);v&&(v=Number(v[1])),v&&v>=15&&(w=!1,O=!0);var m=u&&(M||w&&(v==null||v<12.11)),R=L||H&&W>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var f=function(e,t){var i=e.className,r=x(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 s(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 C=0;C<t.length;++C)n.appendChild(t[C]);return n}function b(e,t,i,r){var n=a(e,t,i,r);return n.setAttribute("role","presentation"),n}var g;document.createRange?g=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:g=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 E(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 G(e,t){var i=e.className;x(t).test(i)||(e.className+=(i?" ":"")+t)}function V(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!x(i[r]).test(t)&&(t+=" "+i[r]);return t}var $=function(e){e.select()};S?$=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&($=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 C=r||0,N=n||0;;){var K=e.indexOf(" ",C);if(K<0||K>=t)return N+(t-C);N+=K-C,N+=i-N%i,C=K+1}}var ae=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};ae.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ae.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 ce(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var ve=50,Me={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Ee={origin:"*mouse"},Te={origin:"+move"};function Se(e,t,i){for(var r=0,n=0;;){var C=e.indexOf(" ",r);C==-1&&(C=e.length);var N=C-r;if(C==e.length||n+N>=t)return r+Math.min(N,t-n);if(n+=C-r,n+=i-n%i,r=C+1,n>=t)return r}}var me=[""];function se(e){for(;me.length<=e;)me.push(Re(me)+" ");return me[e]}function Re(e){return e[e.length-1]}function Ve(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function We(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function Je(){}function Ze(e,t){var i;return Object.create?i=Object.create(e):(Je.prototype=e,i=new Je),t&&F(t,i),i}var De=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ue(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||De.test(e))}function Be(e,t){return t?t.source.indexOf("\\w")>-1&&Ue(e)?!0:t.test(e):Ue(e)}function qe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Qe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ie(e){return e.charCodeAt(0)>=768&&Qe.test(e)}function Ne(e,t,i){for(;(i<0?t>0:t<e.length)&&Ie(e.charAt(t));)t+=i;return t}function $e(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,C=r<0?Math.ceil(n):Math.floor(n);if(C==t)return e(C)?t:i;e(C)?i=C:t=C+r}}function et(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,C=0;C<e.length;++C){var N=e[C];(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",C),n=!0)}n||r(t,i,"ltr")}var Xe=null;function Ke(e,t,i){var r;Xe=null;for(var n=0;n<e.length;++n){var C=e[n];if(C.from<t&&C.to>t)return n;C.to==t&&(C.from!=C.to&&i=="before"?r=n:Xe=n),C.from==t&&(C.from!=C.to&&i!="before"?r=n:Xe=n)}return r!=null?r:Xe}var ct=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]/,C=/[LRr]/,N=/[Lb1n]/,K=/[1n]/;function X(q,oe,ue){this.level=q,this.from=oe,this.to=ue}return function(q,oe){var ue=oe=="ltr"?"L":"R";if(q.length==0||oe=="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 He=0,Ye=ue;He<be;++He){var it=ye[He];it=="m"?ye[He]=Ye:Ye=it}for(var ut=0,nt=ue;ut<be;++ut){var pt=ye[ut];pt=="1"&&nt=="r"?ye[ut]="n":C.test(pt)&&(nt=pt,pt=="r"&&(ye[ut]="R"))}for(var Tt=1,Et=ye[0];Tt<be-1;++Tt){var Pt=ye[Tt];Pt=="+"&&Et=="1"&&ye[Tt+1]=="1"?ye[Tt]="1":Pt==","&&Et==ye[Tt+1]&&(Et=="1"||Et=="n")&&(ye[Tt]=Et),Et=Pt}for(var qt=0;qt<be;++qt){var br=ye[qt];if(br==",")ye[qt]="N";else if(br=="%"){var nr=void 0;for(nr=qt+1;nr<be&&ye[nr]=="%";++nr);for(var Gr=qt&&ye[qt-1]=="!"||nr<be&&ye[nr]=="1"?"1":"N",Nr=qt;Nr<nr;++Nr)ye[Nr]=Gr;qt=nr-1}}for(var hr=0,Ur=ue;hr<be;++hr){var Sr=ye[hr];Ur=="L"&&Sr=="1"?ye[hr]="L":C.test(Sr)&&(Ur=Sr)}for(var pr=0;pr<be;++pr)if(n.test(ye[pr])){var cr=void 0;for(cr=pr+1;cr<be&&n.test(ye[cr]);++cr);for(var or=(pr?ye[pr-1]:ue)=="L",Fr=(cr<be?ye[cr]:ue)=="L",un=or==Fr?or?"L":"R":ue,ki=pr;ki<cr;++ki)ye[ki]=un;pr=cr-1}for(var Rr=[],si,Er=0;Er<be;)if(N.test(ye[Er])){var Va=Er;for(++Er;Er<be&&N.test(ye[Er]);++Er);Rr.push(new X(0,Va,Er))}else{var fi=Er,Hi=Rr.length,Gi=oe=="rtl"?1:0;for(++Er;Er<be&&ye[Er]!="L";++Er);for(var Ir=fi;Ir<Er;)if(K.test(ye[Ir])){fi<Ir&&(Rr.splice(Hi,0,new X(1,fi,Ir)),Hi+=Gi);var dn=Ir;for(++Ir;Ir<Er&&K.test(ye[Ir]);++Ir);Rr.splice(Hi,0,new X(2,dn,Ir)),Hi+=Gi,fi=Ir}else++Ir;fi<Er&&Rr.splice(Hi,0,new X(1,fi,Er))}return oe=="ltr"&&(Rr[0].level==1&&(si=q.match(/^\s+/))&&(Rr[0].from=si[0].length,Rr.unshift(new X(0,0,si[0].length))),Re(Rr).level==1&&(si=q.match(/\s+$/))&&(Re(Rr).to-=si[0].length,Rr.push(new X(0,be-si[0].length,be)))),oe=="rtl"?Rr.reverse():Rr}}();function rt(e,t){var i=e.order;return i==null&&(i=e.order=ct(e.text,t)),i}var at=[],Ae=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]||at).concat(i)}};function dt(e,t){return e._handlers&&e._handlers[t]||at}function ot(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 C=ce(n,i);C>-1&&(r[t]=n.slice(0,C).concat(n.slice(C+1)))}}}function we(e,t){var i=dt(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 Fe(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)ce(i,t[r])==-1&&i.push(t[r])}function de(e,t){return dt(e,t).length>0}function fe(e){e.prototype.on=function(t,i){Ae(this,t,i)},e.prototype.off=function(t,i){ot(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 le(e){te(e),re(e)}function pe(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),u&&e.ctrlKey&&t==1&&(t=3),t}var Oe=function(){if(H&&W<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),st;function mt(e){if(st==null){var t=a("span","\u200B");s(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(st=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&W<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 ht;function Rt(e){if(ht!=null)return ht;var t=s(e,document.createTextNode("A\u062EA")),i=g(t,0,1).getBoundingClientRect(),r=g(t,1,2).getBoundingClientRect();return c(e),!i||i.left==i.right?!1:ht=r.right-i.right<3}var At=`
|
|
|
|
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 C=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),N=C.indexOf("\r");N!=-1?(i.push(C.slice(0,N)),t+=N+1):(i.push(C),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ft=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ft=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),kt=null;function Ht(e){if(kt!=null)return kt;var t=s(e,a("span","x")),i=t.getBoundingClientRect(),r=g(t,0,1).getBoundingClientRect();return kt=Math.abs(i.left-r.left)>1}var It={},xt={};function Mt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),It[e]=t}function jt(e,t){xt[e]=t}function lt(e){if(typeof e=="string"&&xt.hasOwnProperty(e))e=xt[e];else if(e&&typeof e.name=="string"&&xt.hasOwnProperty(e.name)){var t=xt[e.name];typeof t=="string"&&(t={name:t}),e=Ze(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return lt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return lt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $t(e,t){t=lt(t);var i=It[t.name];if(!i)return $t(e,"text/plain");var r=i(e,t);if(ar.hasOwnProperty(t.name)){var n=ar[t.name];for(var C in n){if(!n.hasOwnProperty(C))continue;r.hasOwnProperty(C)&&(r["_"+C]=r[C]),r[C]=n[C]}}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 ar={};function ir(e,t){var i=ar.hasOwnProperty(e)?ar[e]:ar[e]={};F(t,i)}function Mr(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 ti(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 Xt(e,t,i){return e.startState?e.startState(t,i):!0}var yt=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};yt.prototype.eol=function(){return this.pos>=this.string.length},yt.prototype.sol=function(){return this.pos==this.lineStart},yt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},yt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},yt.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},yt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},yt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},yt.prototype.skipToEnd=function(){this.pos=this.string.length},yt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},yt.prototype.backUp=function(e){this.pos-=e},yt.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)},yt.prototype.indentation=function(){return ee(this.string,null,this.tabSize)-(this.lineStart?ee(this.string,this.lineStart,this.tabSize):0)},yt.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 C=this.string.slice(this.pos).match(e);return C&&C.index>0?null:(C&&t!==!1&&(this.pos+=C[0].length),C)}},yt.prototype.current=function(){return this.string.slice(this.start,this.pos)},yt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},yt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},yt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ze(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],C=n.chunkSize();if(t<C){i=n;break}t-=C}return i.lines[t]}function Kt(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(C){var N=C.text;n==i.line&&(N=N.slice(0,i.ch)),n==t.line&&(N=N.slice(t.ch)),r.push(N),++n}),r}function wt(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function tr(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function Ot(e){if(e.parent==null)return null;for(var t=e.parent,i=ce(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],C=n.height;if(t<C){e=n;continue e}t-=C,i+=n.chunkSize()}return i}while(!e.lines);for(var N=0;N<e.lines.length;++N){var K=e.lines[N],X=K.height;if(t<X)break;t-=X}return i+N}function bt(e,t){return t>=e.first&&t<e.first+e.size}function ri(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ge(e,t,i){if(i===void 0&&(i=null),!(this instanceof Ge))return new Ge(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Dt(e,t){return e.line-t.line||e.ch-t.ch}function pi(e,t){return e.sticky==t.sticky&&Dt(e,t)==0}function mi(e){return Ge(e.line,e.ch)}function gi(e,t){return Dt(e,t)<0?t:e}function vi(e,t){return Dt(e,t)<0?e:t}function j(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function l(e,t){if(t.line<e.first)return Ge(e.first,0);var i=e.first+e.size-1;return t.line>i?Ge(i,ze(e,i).text.length):p(t,ze(e,t.line).text.length)}function p(e,t){var i=e.ch;return i==null||i>t?Ge(e.line,t):i<0?Ge(e.line,0):e}function I(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=l(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,Mr(e.mode,t.state),i,t.lookAhead):new U(e,Mr(e.mode,t),i)},U.prototype.save=function(e){var t=e!==!1?Mr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new J(t,this.maxLookAhead):t};function he(e,t,i,r){var n=[e.state.modeGen],C={};Ar(e,t.text,e.doc.mode,i,function(q,oe){return n.push(q,oe)},C,r);for(var N=i.state,K=function(q){i.baseTokens=n;var oe=e.state.overlays[q],ue=1,be=0;i.state=!0,Ar(e,t.text,oe.mode,i,function(ye,ke){for(var He=ue;be<ye;){var Ye=n[ue];Ye>ye&&n.splice(ue,1,ye,n[ue+1],Ye),ue+=2,be=Math.min(ye,Ye)}if(!ke)return;if(oe.opaque)n.splice(He,ue-He,ye,"overlay "+ke),ue=He+2;else for(;He<ue;He+=2){var it=n[He+1];n[He+1]=(it?it+" ":"")+"overlay "+ke}},C),i.state=N,i.baseTokens=null,i.baseTokenPos=1},X=0;X<e.state.overlays.length;++X)K(X);return{styles:n,classes:C.bgClass||C.textClass?C:null}}function _e(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=tt(e,Ot(t)),n=t.text.length>e.options.maxHighlightLength&&Mr(e.doc.mode,r.state),C=he(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=C.styles,C.classes?t.styleClasses=C.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 tt(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new U(r,!0,t);var C=Tr(e,t,i),N=C>r.first&&ze(r,C-1).stateAfter,K=N?U.fromSaved(r,N,C):new U(r,Xt(r.mode),C);return r.iter(C,t,function(X){gt(e,X.text,K);var q=K.line;X.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 gt(e,t,i,r){var n=e.doc.mode,C=new yt(t,e.options.tabSize,i);for(C.start=C.pos=r||0,t==""&&je(n,i.state);!C.eol();)Ct(n,C,i.state),C.start=C.pos}function je(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=ti(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Ct(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=ti(e,i).mode);var C=e.token(t,i);if(t.pos>t.start)return C}throw new Error("Mode "+e.name+" failed to advance stream.")}var Gt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function er(e,t,i,r){var n=e.doc,C=n.mode,N;t=l(n,t);var K=ze(n,t.line),X=tt(e,t.line,i),q=new yt(K.text,e.options.tabSize,X),oe;for(r&&(oe=[]);(r||q.pos<t.ch)&&!q.eol();)q.start=q.pos,N=Ct(C,q,X.state),r&&oe.push(new Gt(q,N,Mr(n.mode,X.state)));return r?oe:new Gt(q,N,X.state)}function jr(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 Ar(e,t,i,r,n,C,N){var K=i.flattenSpans;K==null&&(K=e.options.flattenSpans);var X=0,q=null,oe=new yt(t,e.options.tabSize,r),ue,be=e.options.addModeClass&&[null];for(t==""&&jr(je(i,r.state),C);!oe.eol();){if(oe.pos>e.options.maxHighlightLength?(K=!1,N&>(e,t,r,oe.pos),oe.pos=t.length,ue=null):ue=jr(Ct(i,oe,r.state,be),C),be){var ye=be[0].name;ye&&(ue="m-"+(ue?ye+" "+ue:ye))}if(!K||q!=ue){for(;X<oe.start;)X=Math.min(oe.start,X+5e3),n(X,q);q=ue}oe.start=oe.pos}for(;X<oe.pos;){var ke=Math.min(oe.pos,X+5e3);n(ke,q),X=ke}}function Tr(e,t,i){for(var r,n,C=e.doc,N=i?-1:t-(e.doc.mode.innerMode?1e3:100),K=t;K>N;--K){if(K<=C.first)return C.first;var X=ze(C,K-1),q=X.stateAfter;if(q&&(!i||K+(q instanceof J?q.lookAhead:0)<=C.modeFrontier))return K;var oe=ee(X.text,null,e.options.tabSize);(n==null||r>oe)&&(n=K-1,r=oe)}return n}function Yr(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=ze(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,mr=!1;function zr(){Ii=!0}function li(){mr=!0}function ui(e,t,i){this.marker=e,this.from=t,this.to=i}function Wr(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 C=e[n],N=C.marker,K=C.from==null||(N.inclusiveLeft?C.from<=t:C.from<t);if(K||C.from==t&&N.type=="bookmark"&&(!i||!C.marker.insertLeft)){var X=C.to==null||(N.inclusiveRight?C.to>=t:C.to>t);(r||(r=[])).push(new ui(N,C.from,X?null:C.to))}}return r}function Ki(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var C=e[n],N=C.marker,K=C.to==null||(N.inclusiveRight?C.to>=t:C.to>t);if(K||C.from==t&&N.type=="bookmark"&&(!i||C.marker.insertLeft)){var X=C.from==null||(N.inclusiveLeft?C.from<=t:C.from<t);(r||(r=[])).push(new ui(N,X?null:C.from-t,C.to==null?null:C.to-t))}}return r}function Jr(e,t){if(t.full)return null;var i=bt(e,t.from.line)&&ze(e,t.from.line).markedSpans,r=bt(e,t.to.line)&&ze(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,C=t.to.ch,N=Dt(t.from,t.to)==0,K=zi(i,n,N),X=Ki(r,C,N),q=t.text.length==1,oe=Re(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=Wr(X,be.marker);ye?q&&(be.to=ye.to==null?null:ye.to+oe):be.to=n}}if(X)for(var ke=0;ke<X.length;++ke){var He=X[ke];if(He.to!=null&&(He.to+=oe),He.from==null){var Ye=Wr(K,He.marker);Ye||(He.from=oe,q&&(K||(K=[])).push(He))}else He.from+=oe,q&&(K||(K=[])).push(He)}K&&(K=Qr(K)),X&&X!=K&&(X=Qr(X));var it=[K];if(!q){var ut=t.text.length-2,nt;if(ut>0&&K)for(var pt=0;pt<K.length;++pt)K[pt].to==null&&(nt||(nt=[])).push(new ui(K[pt].marker,null,null));for(var Tt=0;Tt<ut;++Tt)it.push(nt);it.push(X)}return it}function Qr(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 He=ye.markedSpans[ke].marker;He.readOnly&&(!r||ce(r,He)==-1)&&(r||(r=[])).push(He)}}),!r)return null;for(var n=[{from:t,to:i}],C=0;C<r.length;++C)for(var N=r[C],K=N.find(0),X=0;X<n.length;++X){var q=n[X];if(Dt(q.to,K.from)<0||Dt(q.from,K.to)>0)continue;var oe=[X,1],ue=Dt(q.from,K.from),be=Dt(q.to,K.to);(ue<0||!N.inclusiveLeft&&!ue)&&oe.push({from:q.from,to:K.from}),(be>0||!N.inclusiveRight&&!be)&&oe.push({from:K.to,to:q.to}),n.splice.apply(n,oe),X+=oe.length-3}return n}function hn(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 sr(e){return e.inclusiveLeft?-1:0}function zt(e){return e.inclusiveRight?1:0}function xr(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),n=t.find(),C=Dt(r.from,n.from)||sr(e)-sr(t);if(C)return-C;var N=Dt(r.to,n.to)||zt(e)-zt(t);return N||t.id-e.id}function Bt(e,t){var i=mr&&e.markedSpans,r;if(i)for(var n=void 0,C=0;C<i.length;++C)n=i[C],n.marker.collapsed&&(t?n.from:n.to)==null&&(!r||xr(r,n.marker)<0)&&(r=n.marker);return r}function dr(e){return Bt(e,!0)}function Yt(e){return Bt(e,!1)}function ii(e,t){var i=mr&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var C=i[n];C.marker.collapsed&&(C.from==null||C.from<t)&&(C.to==null||C.to>t)&&(!r||xr(r,C.marker)<0)&&(r=C.marker)}return r}function gr(e,t,i,r,n){var C=ze(e,t),N=mr&&C.markedSpans;if(N)for(var K=0;K<N.length;++K){var X=N[K];if(!X.marker.collapsed)continue;var q=X.marker.find(0),oe=Dt(q.from,i)||sr(X.marker)-sr(n),ue=Dt(q.to,r)||zt(X.marker)-zt(n);if(oe>=0&&ue<=0||oe<=0&&ue>=0)continue;if(oe<=0&&(X.marker.inclusiveRight&&n.inclusiveLeft?Dt(q.to,i)>=0:Dt(q.to,i)>0)||oe>=0&&(X.marker.inclusiveRight&&n.inclusiveLeft?Dt(q.from,r)<=0:Dt(q.from,r)<0))return!0}}function Lr(e){for(var t;t=dr(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=Yt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=Yt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function cn(e,t){var i=ze(e,t),r=Lr(i);return i==r?t:Ot(r)}function Ci(e,t){if(t>e.lastLine())return t;var i=ze(e,t),r;if(!ni(e,i))return t;for(;r=Yt(i);)i=r.find(1,!0).line;return Ot(i)+1}function ni(e,t){var i=mr&&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,Wr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,C=0;C<t.markedSpans.length;++C)if(n=t.markedSpans[C],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 Zr(e){e=Lr(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 C=i.parent;C;i=C,C=i.parent)for(var N=0;N<C.children.length;++N){var K=C.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=dr(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=Yt(r);){var C=i.find(0,!0);t-=r.text.length-C.from.ch,r=C.to.line,t+=r.text.length-C.to.ch}return t}function jn(e){var t=e.display,i=e.doc;t.maxLine=ze(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 Ot(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),hn(e),Ei(e,i);var n=r?r(e):1;n!=e.height&&tr(e,n)}function vt(e){e.parent=null,hn(e)}var Lt={},St={};function _t(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?St:Lt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Wt(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 C=n?t.rest[n-1]:t.line,N=void 0;r.pos=0,r.addToken=Ut,Rt(e.display.measure)&&(N=rt(C,e.doc.direction))&&(r.addToken=Or(r.addToken,N)),r.map=[];var K=t!=e.display.externalMeasured&&Ot(C);di(C,r,_e(e,C,K)),C.styleClasses&&(C.styleClasses.bgClass&&(r.bgClass=V(C.styleClasses.bgClass,r.bgClass||"")),C.styleClasses.textClass&&(r.textClass=V(C.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(mt(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 X=r.content.lastChild;(/\bcm-tab\b/.test(X.className)||X.querySelector&&X.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 Zt(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 Ut(e,t,i,r,n,C,N){if(!t)return;var K=e.splitSpaces?fr(t,e.trailingSpace):t,X=e.cm.state.specialChars,q=!1,oe;if(!X.test(t))e.col+=t.length,oe=document.createTextNode(K),e.map.push(e.pos,e.pos+t.length,oe),H&&W<9&&(q=!0),e.pos+=t.length;else{oe=document.createDocumentFragment();for(var ue=0;;){X.lastIndex=ue;var be=X.exec(t),ye=be?be.index-ue:t.length-ue;if(ye){var ke=document.createTextNode(K.slice(ue,ue+ye));H&&W<9?oe.appendChild(a("span",[ke])):oe.appendChild(ke),e.map.push(e.pos,e.pos+ye,ke),e.col+=ye,e.pos+=ye}if(!be)break;ue+=ye+1;var He=void 0;if(be[0]==" "){var Ye=e.cm.options.tabSize,it=Ye-e.col%Ye;He=oe.appendChild(a("span",se(it),"cm-tab")),He.setAttribute("role","presentation"),He.setAttribute("cm-text"," "),e.col+=it}else be[0]=="\r"||be[0]==`
|
|
`?(He=oe.appendChild(a("span",be[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),He.setAttribute("cm-text",be[0]),e.col+=1):(He=e.cm.options.specialCharPlaceholder(be[0]),He.setAttribute("cm-text",be[0]),H&&W<9?oe.appendChild(a("span",[He])):oe.appendChild(He),e.col+=1);e.map.push(e.pos,e.pos+1,He),e.pos++}}if(e.trailingSpace=K.charCodeAt(t.length-1)==32,i||r||n||q||C||N){var ut=i||"";r&&(ut+=r),n&&(ut+=n);var nt=a("span",[oe],ut,C);if(N)for(var pt in N)N.hasOwnProperty(pt)&&pt!="style"&&pt!="class"&&nt.setAttribute(pt,N[pt]);return e.content.appendChild(nt)}e.content.appendChild(oe)}function fr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var C=e.charAt(n);C==" "&&i&&(n==e.length-1||e.charCodeAt(n+1)==32)&&(C="\xA0"),r+=C,i=C==" "}return r}function Or(e,t){return function(i,r,n,C,N,K,X){n=n?n+" cm-force-border":"cm-force-border";for(var q=i.pos,oe=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>=oe)return e(i,r,n,C,N,K,X);e(i,r.slice(0,ue.to-q),n,C,null,K,X),C=null,r=r.slice(ue.to-q),q=ue.to}}}function Nt(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 di(e,t,i){var r=e.markedSpans,n=e.text,C=0;if(!r){for(var N=1;N<i.length;N+=2)t.addToken(t,n.slice(C,C=i[N]),_t(i[N+1],t.cm.options));return}for(var K=n.length,X=0,q=1,oe="",ue,be,ye=0,ke,He,Ye,it,ut;;){if(ye==X){ke=He=Ye=be="",ut=null,it=null,ye=Infinity;for(var nt=[],pt=void 0,Tt=0;Tt<r.length;++Tt){var Et=r[Tt],Pt=Et.marker;if(Pt.type=="bookmark"&&Et.from==X&&Pt.widgetNode)nt.push(Pt);else if(Et.from<=X&&(Et.to==null||Et.to>X||Pt.collapsed&&Et.to==X&&Et.from==X)){if(Et.to!=null&&Et.to!=X&&ye>Et.to&&(ye=Et.to,He=""),Pt.className&&(ke+=" "+Pt.className),Pt.css&&(be=(be?be+";":"")+Pt.css),Pt.startStyle&&Et.from==X&&(Ye+=" "+Pt.startStyle),Pt.endStyle&&Et.to==ye&&(pt||(pt=[])).push(Pt.endStyle,Et.to),Pt.title&&((ut||(ut={})).title=Pt.title),Pt.attributes)for(var qt in Pt.attributes)(ut||(ut={}))[qt]=Pt.attributes[qt];Pt.collapsed&&(!it||xr(it.marker,Pt)<0)&&(it=Et)}else Et.from>X&&ye>Et.from&&(ye=Et.from)}if(pt)for(var br=0;br<pt.length;br+=2)pt[br+1]==ye&&(He+=" "+pt[br]);if(!it||it.from==X)for(var nr=0;nr<nt.length;++nr)Nt(t,0,nt[nr]);if(it&&(it.from||0)==X){if(Nt(t,(it.to==null?K+1:it.to)-X,it.marker,it.from==null),it.to==null)return;it.to==X&&(it=!1)}}if(X>=K)break;for(var Gr=Math.min(K,ye);;){if(oe){var Nr=X+oe.length;if(!it){var hr=Nr>Gr?oe.slice(0,Gr-X):oe;t.addToken(t,hr,ue?ue+ke:ke,Ye,X+hr.length==ye?He:"",be,ut)}if(Nr>=Gr){oe=oe.slice(Gr-X),X=Gr;break}X=Nr,Ye=""}oe=n.slice(C,C=i[q++]),ue=_t(i[q++],t.cm.options)}}}function Vt(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Ot(Re(this.rest))-i+1:1,this.node=this.text=null,this.hidden=ni(e,t)}function Pr(e,t,i){for(var r=[],n,C=t;C<i;C=n){var N=new Vt(e.doc,ze(e.doc,C),C);n=C+N.size,r.push(N)}return r}var wr=null;function Xr(e){wr?wr.ops.push(e):e.ownsGroup=wr={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{wr=null,t(i)}}var mn=null;function Cr(e,t){var i=dt(e,t);if(!i.length)return;var r=Array.prototype.slice.call(arguments,2),n;wr?n=wr.delayedCallbacks:mn?n=mn:(n=mn=[],setTimeout(Ms,0));for(var C=function(K){n.push(function(){return i[K].apply(null,r)})},N=0;N<i.length;++N)C(N)}function Ms(){var e=mn;mn=null;for(var t=0;t<e.length;++t)e[t]()}function Xa(e,t,i,r){for(var n=0;n<t.changes.length;n++){var C=t.changes[n];C=="text"?Ps(e,t):C=="gutter"?Ja(e,t,i,r):C=="class"?da(e,t):C=="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),H&&W<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 Ya(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Wt(e,t)}function Ps(e,t){var i=t.text.className,r=Ya(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,da(e,t)):i&&(t.text.className=i)}function da(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 C=t.line.gutterMarkers;if(e.options.lineNumbers||C){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&&(!C||!C["CodeMirror-linenumbers"])&&(t.lineNumber=K.appendChild(a("div",ri(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),C)for(var X=0;X<e.display.gutterSpecs.length;++X){var q=e.display.gutterSpecs[X].className,oe=C.hasOwnProperty(q)&&C[q];oe&&K.appendChild(a("div",[oe],"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=x("CodeMirror-linewidget"),n=t.node.firstChild,C=void 0;n;n=C)C=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);Za(e,t,i)}function Bs(e,t,i,r){var n=Ya(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),da(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 C=gn(i),N=0,K=t.widgets;N<K.length;++N){var X=K[N],q=a("div",[X.node],"CodeMirror-linewidget"+(X.className?" "+X.className:""));X.handleMouseEvents||q.setAttribute("cm-ignore-events","true"),Ns(X,q,i,r),e.display.input.setUneditable(q),n&&X.above?C.insertBefore(q,i.gutter||i.text):C.appendChild(q),Cr(X,"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(!E(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;"),s(t.display.measure,a("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function hi(e,t){for(var i=pe(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 Wn(e){return e.lineSpace.offsetTop}function ha(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $a(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(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 ai(e){return ve-e.display.nativeBarWidth}function Pi(e){return e.display.scroller.clientWidth-ai(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-ai(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 C=t.measure.heights=[];if(r){t.measure.width=n;for(var N=t.text.firstChild.getClientRects(),K=0;K<N.length-1;K++){var X=N[K],q=N[K+1];Math.abs(X.bottom-q.bottom)>2&&C.push((X.bottom+q.top)/2-i.top)}}C.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(Ot(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Fs(e,t){t=Lr(t);var i=Ot(t),r=e.display.externalMeasured=new Vt(e.doc,t,i);r.lineN=i;var n=r.built=Wt(e,r);return r.text=n.pre,s(e.display.lineMeasure,n.pre),r}function to(e,t,i,r){return oi(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=Ot(t),r=fa(e,i);r&&!r.text?r=null:r&&r.changes&&(Xa(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 oi(e,t,i,r,n){t.before&&(i=-1);var C=i+(r||""),N;return t.cache.hasOwnProperty(C)?N=t.cache[C]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),N=Ws(e,t,i,r),N.bogus||(t.cache[C]=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,C,N,K,X,q=0;q<e.length;q+=3)if(K=e[q],X=e[q+1],t<K?(n=0,C=1,N="left"):t<X?(n=t-K,C=n+1):(q==e.length-3||t==X&&e[q+3]>t)&&(C=X-K,n=C-1,t>=X&&(N="right")),n!=null){if(r=e[q+2],K==X&&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==X-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:C,collapse:N,coverStart:K,coverEnd:X}}function js(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 Ws(e,t,i,r){var n=io(t.map,i,r),C=n.node,N=n.start,K=n.end,X=n.collapse,q;if(C.nodeType==3){for(var oe=0;oe<4;oe++){for(;N&&Ie(t.line.text.charAt(n.coverStart+N));)--N;for(;n.coverStart+K<n.coverEnd&&Ie(t.line.text.charAt(n.coverStart+K));)++K;if(H&&W<9&&N==0&&K==n.coverEnd-n.coverStart?q=C.parentNode.getBoundingClientRect():q=js(g(C,N,K).getClientRects(),r),q.left||q.right||N==0)break;K=N,N=N-1,X="right"}H&&W<11&&(q=Hs(e.display.measure,q))}else{N>0&&(X=r="right");var ue;e.options.lineWrapping&&(ue=C.getClientRects()).length>1?q=ue[r=="right"?ue.length-1:0]:q=C.getBoundingClientRect()}if(H&&W<9&&!N&&(!q||!q.left&&!q.right)){var be=C.parentNode.getClientRects()[0];be?q={left:be.left,right:be.left+Yi(e.display),top:be.top,bottom:be.bottom}:q=ro}for(var ye=q.top-t.rect.top,ke=q.bottom-t.rect.top,He=(ye+ke)/2,Ye=t.view.measure.heights,it=0;it<Ye.length-1&&!(He<Ye[it]);it++);var ut=it?Ye[it-1]:0,nt=Ye[it],pt={left:(X=="right"?q.right:q.left)-t.rect.left,right:(X=="left"?q.left:q.right)-t.rect.left,top:ut,bottom:nt};return!q.left&&!q.right&&(pt.bogus=!0),e.options.singleCursorHeightPerLine||(pt.rtop=ye,pt.rbottom=ke),pt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ht(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 C=pa(t);i.top+=C,i.bottom+=C}if(r=="line")return i;r||(r="local");var N=Zr(t);if(r=="local"?N+=Wn(e.display):N-=e.display.viewOffset,r=="page"||r=="window"){var K=e.display.lineSpace.getBoundingClientRect();N+=K.top+(r=="window"?0:so());var X=K.left+(r=="window"?0:oo());i.left+=X,i.right+=X}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 C=e.display.sizer.getBoundingClientRect();r+=C.left,n+=C.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=ze(e.doc,t.line)),Hn(e,r,to(e,r,t.ch,n),i)}function qr(e,t,i,r,n,C){r=r||ze(e.doc,t.line),n||(n=Qi(e,r));function N(ke,He){var Ye=oi(e,n,ke,He?"right":"left",C);return He?Ye.left=Ye.right:Ye.right=Ye.left,Hn(e,r,Ye,i)}var K=rt(r,e.doc.direction),X=t.ch,q=t.sticky;if(X>=r.text.length?(X=r.text.length,q="before"):X<=0&&(X=0,q="after"),!K)return N(q=="before"?X-1:X,q=="before");function oe(ke,He,Ye){var it=K[He],ut=it.level==1;return N(Ye?ke-1:ke,ut!=Ye)}var ue=Ke(K,X,q),be=Xe,ye=oe(X,ue,q=="before");return be!=null&&(ye.other=oe(X,be,q!="before")),ye}function uo(e,t){var i=0;t=l(e.doc,t),e.options.lineWrapping||(i=Yi(e.display)*t.ch);var r=ze(e.doc,t.line),n=Zr(r)+Wn(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function ga(e,t,i,r,n){var C=Ge(e,t,i);return C.xRel=n,r&&(C.outside=r),C}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),C=r.first+r.size-1;if(n>C)return ga(r.first+r.size-1,ze(r,C).text.length,null,1,1);t<0&&(t=0);for(var N=ze(r,n);;){var K=Gs(e,N,n,t,i),X=ii(N,K.ch+(K.xRel>0||K.outside>0?1:0));if(!X)return K;var q=X.find(1);if(q.line==n)return q;N=ze(r,n=q.line)}}function ho(e,t,i,r){r-=pa(t);var n=t.text.length,C=$e(function(N){return oi(e,i,N-1).bottom<=r},n,0);return n=$e(function(N){return oi(e,i,N).top>r},C,n),{begin:C,end:n}}function co(e,t,i,r){i||(i=Qi(e,t));var n=Hn(e,t,oi(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-=Zr(t);var C=Qi(e,t),N=pa(t),K=0,X=t.text.length,q=!0,oe=rt(t,e.doc.direction);if(oe){var ue=(e.options.lineWrapping?Ks:zs)(e,t,i,C,oe,r,n);q=ue.level!=1,K=q?ue.from:ue.to-1,X=q?ue.to:ue.from-1}var be=null,ye=null,ke=$e(function(Tt){var Et=oi(e,C,Tt);return Et.top+=N,Et.bottom+=N,ya(Et,r,n,!1)?(Et.top<=n&&Et.left<=r&&(be=Tt,ye=Et),!0):!1},K,X),He,Ye,it=!1;if(ye){var ut=r-ye.left<ye.right-r,nt=ut==q;ke=be+(nt?0:1),Ye=nt?"after":"before",He=ut?ye.left:ye.right}else{!q&&(ke==X||ke==K)&&ke++,Ye=ke==0?"after":ke==t.text.length?"before":oi(e,C,ke-(q?1:0)).bottom+N<=n==q?"after":"before";var pt=qr(e,Ge(i,ke,Ye),"line",t,C);He=pt.left,it=n<pt.top?-1:n>=pt.bottom?1:0}return ke=Ne(t.text,ke,1),ga(i,ke,Ye,it,r-He)}function zs(e,t,i,r,n,C,N){var K=$e(function(ue){var be=n[ue],ye=be.level!=1;return ya(qr(e,Ge(i,ye?be.to:be.from,ye?"before":"after"),"line",t,r),C,N,!0)},0,n.length-1),X=n[K];if(K>0){var q=X.level!=1,oe=qr(e,Ge(i,q?X.from:X.to,q?"after":"before"),"line",t,r);ya(oe,C,N,!0)&&oe.top>N&&(X=n[K-1])}return X}function Ks(e,t,i,r,n,C,N){var K=ho(e,t,r,N),X=K.begin,q=K.end;/\s/.test(t.text.charAt(q-1))&&q--;for(var oe=null,ue=null,be=0;be<n.length;be++){var ye=n[be];if(ye.from>=q||ye.to<=X)continue;var ke=ye.level!=1,He=oi(e,r,ke?Math.min(q,ye.to)-1:Math.max(X,ye.from)).right,Ye=He<C?C-He+1e9:He-C;(!oe||ue>Ye)&&(oe=ye,ue=Ye)}return oe||(oe=n[n.length-1]),oe.from<X&&(oe={from:X,to:oe.to,level:oe.level}),oe.to>q&&(oe={from:oe.from,to:q,level:oe.level}),oe}var _i;function Xi(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"))}s(e.measure,_i);var i=_i.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),c(e.measure),i||1}function Yi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),i=a("pre",[t],"CodeMirror-line-like");s(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,C=t.gutters.firstChild,N=0;C;C=C.nextSibling,++N){var K=e.display.gutterSpecs[N].className;i[K]=C.offsetLeft+C.clientLeft+n,r[K]=C.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=Xi(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Yi(e.display)-3);return function(n){if(ni(e.doc,n))return 0;var C=0;if(n.widgets)for(var N=0;N<n.widgets.length;N++)n.widgets[N].height&&(C+=n.widgets[N].height);return i?C+(Math.ceil(n.text.length/r)||1)*t:C+t}}function xa(e){var t=e.doc,i=fo(e);t.iter(function(r){var n=i(r);n!=r.height&&tr(r,n)})}function Bi(e,t,i,r){var n=e.display;if(!i&&pe(t).getAttribute("cm-not-content")=="true")return null;var C,N,K=n.lineSpace.getBoundingClientRect();try{C=t.clientX-K.left,N=t.clientY-K.top}catch(ue){return null}var X=va(e,C,N),q;if(r&&X.xRel>0&&(q=ze(e.doc,X.line).text).length==X.ch){var oe=ee(q,q.length,e.options.tabSize)-q.length;X=Ge(X.line,Math.max(0,Math.round((C-$a(e.display).left)/Yi(e.display))-oe))}return X}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 _r(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)mr&&cn(e.doc,t)<n.viewTo&&Ai(e);else if(i<=n.viewFrom)mr&&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 C=Gn(e,i,i+r,1);C?(n.view=n.view.slice(C.index),n.viewFrom=C.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),X=Gn(e,i,i+r,1);K&&X?(n.view=n.view.slice(0,K.index).concat(Pr(e,K.lineN,X.lineN)).concat(n.view.slice(X.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 C=r.view[Ni(e,t)];if(C.node==null)return;var N=C.changes||(C.changes=[]);ce(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),C,N=e.display.view;if(!mr||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var K=e.display.viewFrom,X=0;X<n;X++)K+=N[X].size;if(K!=t){if(r>0){if(n==N.length-1)return null;C=K+N[n].size-t,n++}else C=K-t;t+=C,i+=C}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=Pr(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Pr(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(Pr(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(),C=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 X=K.empty();(X||e.options.showCursorWhenSelecting)&&go(e,K.head,n),X||Qs(e,K,C)}return r}function go(e,t,i){var r=qr(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 C=i.appendChild(a("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));C.style.display="",C.style.left=r.other.left+"px",C.style.top=r.other.top+"px",C.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,C=document.createDocumentFragment(),N=$a(e.display),K=N.left,X=Math.max(r.sizerWidth,Pi(e)-r.sizer.offsetLeft)-N.right,q=n.direction=="ltr";function oe(nt,pt,Tt,Et){pt<0&&(pt=0),pt=Math.round(pt),Et=Math.round(Et),C.appendChild(a("div",null,"CodeMirror-selected","position: absolute; left: "+nt+`px;
|
|
top: `+pt+"px; width: "+(Tt==null?X-nt:Tt)+`px;
|
|
height: `+(Et-pt)+"px"))}function ue(nt,pt,Tt){var Et=ze(n,nt),Pt=Et.text.length,qt,br;function nr(hr,Ur){return ma(e,Ge(nt,hr),"div",Et,Ur)}function Gr(hr,Ur,Sr){var pr=co(e,Et,null,hr),cr=Ur=="ltr"==(Sr=="after")?"left":"right",or=Sr=="after"?pr.begin:pr.end-(/\s/.test(Et.text.charAt(pr.end-1))?2:1);return nr(or,cr)[cr]}var Nr=rt(Et,n.direction);return et(Nr,pt||0,Tt==null?Pt:Tt,function(hr,Ur,Sr,pr){var cr=Sr=="ltr",or=nr(hr,cr?"left":"right"),Fr=nr(Ur-1,cr?"right":"left"),un=pt==null&&hr==0,ki=Tt==null&&Ur==Pt,Rr=pr==0,si=!Nr||pr==Nr.length-1;if(Fr.top-or.top<=3){var Er=(q?un:ki)&&Rr,Va=(q?ki:un)&&si,fi=Er?K:(cr?or:Fr).left,Hi=Va?X:(cr?Fr:or).right;oe(fi,or.top,Hi-fi,or.bottom)}else{var Gi,Ir,dn,Qa;cr?(Gi=q&&un&&Rr?K:or.left,Ir=q?X:Gr(hr,Sr,"before"),dn=q?K:Gr(Ur,Sr,"after"),Qa=q&&ki&&si?X:Fr.right):(Gi=q?Gr(hr,Sr,"before"):K,Ir=!q&&un&&Rr?X:or.right,dn=!q&&ki&&si?K:Fr.left,Qa=q?Gr(Ur,Sr,"after"):X),oe(Gi,or.top,Ir-Gi,or.bottom),or.bottom<Fr.top&&oe(K,or.bottom,null,Fr.top),oe(dn,Fr.top,Qa-dn,Fr.bottom)}(!qt||zn(or,qt)<0)&&(qt=or),zn(Fr,qt)<0&&(qt=Fr),(!br||zn(or,br)<0)&&(br=or),zn(Fr,br)<0&&(br=Fr)}),{start:qt,end:br}}var be=t.from(),ye=t.to();if(be.line==ye.line)ue(be.line,be.ch,ye.ch);else{var ke=ze(n,be.line),He=ze(n,ye.line),Ye=Lr(ke)==Lr(He),it=ue(be.line,be.ch,Ye?ke.text.length+1:null).end,ut=ue(ye.line,Ye?0:null,ye.ch).start;Ye&&(it.top<ut.top-2?(oe(it.right,it.top,null,it.bottom),oe(K,ut.top,ut.left,ut.bottom)):oe(it.right,it.top,ut.left-it.right,it.bottom)),it.bottom<ut.top&&oe(K,it.bottom,null,ut.top)}i.appendChild(C)}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,G(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,f(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],C=e.options.lineWrapping,N=void 0,K=0;if(n.hidden)continue;if(H&&W<8){var X=n.node.offsetTop+n.node.offsetHeight;N=X-i,i=X}else{var q=n.node.getBoundingClientRect();N=q.bottom-q.top,!C&&n.text.firstChild&&(K=n.text.firstChild.getBoundingClientRect().right-q.left-1)}var oe=n.line.height-N;if((oe>.005||oe<-.005)&&(tr(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/Yi(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-Wn(e));var n=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,C=ur(t,r),N=ur(t,n);if(i&&i.ensure){var K=i.ensure.from.line,X=i.ensure.to.line;K<C?(C=K,N=ur(t,Zr(ze(t,K))+e.wrapper.clientHeight)):Math.min(X,t.lastLine())>=N&&(C=ur(t,Zr(ze(t,X))-e.wrapper.clientHeight),N=X)}return{from:C,to:Math.max(N,C+1)}}function Xs(e,t){if(Fe(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&&!T){var C=a("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Wn(e.display))+`px;
|
|
height: `+(t.bottom-t.top+ai(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(C),C.scrollIntoView(n),e.display.lineSpace.removeChild(C)}}function Ys(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(t=t.ch?Ge(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ge(t.line,t.ch+1,"before"):t);for(var C=0;C<5;C++){var N=!1,K=qr(e,t),X=!i||i==t?K:qr(e,i);n={left:Math.min(K.left,X.left),top:Math.min(K.top,X.top)-r,right:Math.max(K.left,X.left),bottom:Math.max(K.bottom,X.bottom)+r};var q=Aa(e,n),oe=e.doc.scrollTop,ue=e.doc.scrollLeft;if(q.scrollTop!=null&&(xn(e,q.scrollTop),Math.abs(e.doc.scrollTop-oe)>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=Xi(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,C=ca(e),N={};t.bottom-t.top>C&&(t.bottom=t.top+C);var K=e.doc.height+ha(i),X=t.top<r,q=t.bottom>K-r;if(t.top<n)N.scrollTop=X?0:t.top;else if(t.bottom>n+C){var oe=Math.min(t.top,(q?K:t.bottom)-C);oe!=n&&(N.scrollTop=oe)}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;L||Da(e,{top:t}),xo(e,t,!0),L&&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+ha(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+ai(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),Ae(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ae(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&W<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 C=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+C)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(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=u&&!D?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ae,this.disableVert=new ae},Fi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var n=e.getBoundingClientRect(),C=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);C!=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&&f(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),Ae(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&&G(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function ji(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},Xr(e.curOp)}function Wi(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 C=0;C<t.length;C++)il(t[C]);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&&jn(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 Xn(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+ai(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&&La(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=Ys(t,l(r,e.scrollToPos.from),l(r,e.scrollToPos.to),e.scrollToPos.margin);Xs(t,n)}var C=e.maybeHiddenMarkers,N=e.maybeUnhiddenMarkers;if(C)for(var K=0;K<C.length;++K)C[K].lines.length||we(C[K],"hide");if(N)for(var X=0;X<N.length;++X)N[X].lines.length&&we(N[X],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&we(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Hr(e,t){if(e.curOp)return t();ji(e);try{return t()}finally{Wi(e)}}function vr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ji(e);try{return t.apply(e,arguments)}finally{Wi(e)}}}function kr(e){return function(){if(this.curOp)return e.apply(this,arguments);ji(this);try{return e.apply(this,arguments)}finally{Wi(this)}}}function yr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ji(t);try{return e.apply(this,arguments)}finally{Wi(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=tt(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(C){if(r.line>=e.display.viewFrom){var N=C.styles,K=C.text.length>e.options.maxHighlightLength?Mr(t.mode,r.state):null,X=he(e,C,r,!0);K&&(r.state=K),C.styles=X.styles;var q=C.styleClasses,oe=X.classes;oe?C.styleClasses=oe:q&&(C.styleClasses=null);for(var ue=!N||N.length!=C.styles.length||q!=oe&&(!q||!oe||q.bgClass!=oe.bgClass||q.textClass!=oe.textClass),be=0;!ue&&be<N.length;++be)ue=N[be]!=C.styles[be];ue&&n.push(r.line),C.stateAfter=r.save(),r.nextLine()}else C.text.length<=e.options.maxHighlightLength&>(e,C.text,r),C.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&&Hr(e,function(){for(var C=0;C<n.length;C++)Si(e,n[C],"text")})}var Xn=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=[]};Xn.prototype.signal=function(e,t){de(e,t)&&this.events.push(arguments)},Xn.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=ai(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ai(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=P();if(!t||!E(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&E(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&&E(document.body,e.anchorNode)&&E(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,C=Math.max(t.visible.from-e.options.viewportMargin,r.first),N=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<C&&C-i.viewFrom<20&&(C=Math.max(r.first,i.viewFrom)),i.viewTo>N&&i.viewTo-N<20&&(N=Math.min(n,i.viewTo)),mr&&(C=cn(e.doc,C),N=Ci(e.doc,N));var K=C!=i.viewFrom||N!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vs(e,C,N),i.viewOffset=Zr(ze(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var X=po(e);if(!K&&X==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var q=sl(e);return X>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),X>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+ha(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),La(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 Xn(e,t);if(wa(e,i)){Kn(e),To(e,i);var r=Cn(e);bn(e),qi(e,r),La(e,r),i.finish()}}function ul(e,t,i){var r=e.display,n=e.options.lineNumbers,C=r.lineDiv,N=C.firstChild;function K(ke){var He=ke.nextSibling;return O&&u&&e.display.currentWheelTarget==ke?ke.style.display="none":ke.parentNode.removeChild(ke),He}for(var X=r.view,q=r.viewFrom,oe=0;oe<X.length;oe++){var ue=X[oe];if(!ue.hidden)if(!ue.node||ue.node.parentNode!=C){var be=Bs(e,ue,q,i);C.insertBefore(be,N)}else{for(;N!=ue.node;)N=K(N);var ye=n&&t!=null&&t<=q&&ue.lineNumber;ue.changes&&(ce(ue.changes,"gutter")>-1&&(ye=!1),Xa(e,ue,q,i)),ye&&(c(ue.lineNumber),ue.lineNumber.appendChild(document.createTextNode(ri(e.options,q)))),N=ue.node.nextSibling}q+=ue.size}for(;N;)N=K(N)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function La(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+ai(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,C=r+"px",N=0;N<i.length;N++)if(!i[N].hidden){e.options.fixedGutter&&(i[N].gutter&&(i[N].gutter.style.left=C),i[N].gutterBackground&&(i[N].gutterBackground.style.left=C));var K=i[N].alignable;if(K)for(var X=0;X<K.length;X++)K[X].style.left=C}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}function Do(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=ri(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")),C=n.firstChild.offsetWidth,N=n.offsetWidth-C;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(C,r.lineGutter.offsetWidth-N)+1,r.lineNumWidth=r.lineNumInnerWidth+N,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ra(e.display),!0}return!1}function ka(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var C=e[n],N=null;if(typeof C!="string"&&(N=C.style,C=C.className),C=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:C,style:N})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Ro(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],C=n.className,N=n.style,K=t.appendChild(a("div",null,"CodeMirror-gutter "+C));N&&(K.style.cssText=N),C=="CodeMirror-linenumbers"&&(e.lineGutter=K,K.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Ra(e)}function Tn(e){Ro(e.display),_r(e),wo(e)}function dl(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 C=b("div",[n.lineSpace],"CodeMirror-lines");n.mover=a("div",[C],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"),H&&W<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!O&&!(L&&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),Ro(n),i.init(n)}var Yn=0,Kr=null;H?Kr=-.53:L?Kr=15:y?Kr=-.7:k&&(Kr=-1/3);function Lo(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 hl(e){var t=Lo(e);return t.x*=Kr,t.y*=Kr,t}function ko(e,t){var i=Lo(t),r=i.x,n=i.y,C=e.display,N=C.scroller,K=N.scrollWidth>N.clientWidth,X=N.scrollHeight>N.clientHeight;if(!(r&&K||n&&X))return;if(n&&u&&O){e:for(var q=t.target,oe=C.view;q!=N;q=q.parentNode)for(var ue=0;ue<oe.length;ue++)if(oe[ue].node==q){e.display.currentWheelTarget=q;break e}}if(r&&!L&&!w&&Kr!=null){n&&X&&xn(e,Math.max(0,N.scrollTop+n*Kr)),Ui(e,Math.max(0,N.scrollLeft+r*Kr)),(!n||n&&X)&&te(t),C.wheelStartX=null;return}if(n&&Kr!=null){var be=n*Kr,ye=e.doc.scrollTop,ke=ye+C.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})}Yn<20&&(C.wheelStartX==null?(C.wheelStartX=N.scrollLeft,C.wheelStartY=N.scrollTop,C.wheelDX=r,C.wheelDY=n,setTimeout(function(){if(C.wheelStartX==null)return;var He=N.scrollLeft-C.wheelStartX,Ye=N.scrollTop-C.wheelStartY,it=Ye&&C.wheelDY&&Ye/C.wheelDY||He&&C.wheelDX&&He/C.wheelDX;if(C.wheelStartX=C.wheelStartY=null,!it)return;Kr=(Kr*Yn+it)/(Yn+1),++Yn},200)):(C.wheelDX+=r,C.wheelDY+=n))}var Vr=function(e,t){this.ranges=e,this.primIndex=t};Vr.prototype.primary=function(){return this.ranges[this.primIndex]},Vr.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},Vr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Qt(mi(this.ranges[t].anchor),mi(this.ranges[t].head));return new Vr(e,this.primIndex)},Vr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Vr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(Dt(t,r.from())>=0&&Dt(e,r.to())<=0)return i}return-1};var Qt=function(e,t){this.anchor=e,this.head=t};Qt.prototype.from=function(){return vi(this.anchor,this.head)},Qt.prototype.to=function(){return gi(this.anchor,this.head)},Qt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function $r(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(be,ye){return Dt(be.from(),ye.from())}),i=ce(t,n);for(var C=1;C<t.length;C++){var N=t[C],K=t[C-1],X=Dt(K.to(),N.from());if(r&&!N.empty()?X>0:X>=0){var q=vi(K.from(),N.from()),oe=gi(K.to(),N.to()),ue=K.empty()?N.from()==N.head:K.from()==K.head;C<=i&&--i,t.splice(--C,2,new Qt(ue?oe:q,ue?q:oe))}}return new Vr(t,i)}function Ti(e,t){return new Vr([new Qt(e,t||e)],0)}function wi(e){return e.text?Ge(e.from.line+e.text.length-1,Re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Io(e,t){if(Dt(e,t.from)<0)return e;if(Dt(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),Ge(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 Qt(Io(n.anchor,t),Io(n.head,t)))}return $r(e.cm,i,e.sel.primIndex)}function Mo(e,t,i){return e.line==t.line?Ge(i.line,e.ch-t.ch+i.ch):Ge(i.line+(e.line-t.line),e.ch)}function cl(e,t,i){for(var r=[],n=Ge(e.first,0),C=n,N=0;N<t.length;N++){var K=t[N],X=Mo(K.from,n,C),q=Mo(wi(K),n,C);if(n=K.to,C=q,i=="around"){var oe=e.sel.ranges[N],ue=Dt(oe.head,oe.anchor)<0;r[N]=new Qt(ue?q:X,ue?X:q)}else r[N]=new Qt(X,X)}return new Vr(r,e.sel.primIndex)}function Ma(e){e.doc.mode=$t(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&&_r(e)}function Oo(e,t){return t.from.ch==0&&t.to.ch==0&&Re(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Oa(e,t,i,r){function n(ut){return i?i[ut]:null}function C(ut,nt,pt){ua(ut,nt,pt,r),Cr(ut,"change",ut,t)}function N(ut,nt){for(var pt=[],Tt=ut;Tt<nt;++Tt)pt.push(new Oi(q[Tt],n(Tt),r));return pt}var K=t.from,X=t.to,q=t.text,oe=ze(e,K.line),ue=ze(e,X.line),be=Re(q),ye=n(q.length-1),ke=X.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 He=N(0,q.length-1);C(ue,ue.text,ye),ke&&e.remove(K.line,ke),He.length&&e.insert(K.line,He)}else if(oe==ue)if(q.length==1)C(oe,oe.text.slice(0,K.ch)+be+oe.text.slice(X.ch),ye);else{var Ye=N(1,q.length-1);Ye.push(new Oi(be+oe.text.slice(X.ch),ye,r)),C(oe,oe.text.slice(0,K.ch)+q[0],n(0)),e.insert(K.line+1,Ye)}else if(q.length==1)C(oe,oe.text.slice(0,K.ch)+q[0]+ue.text.slice(X.ch),n(0)),e.remove(K.line+1,ke);else{C(oe,oe.text.slice(0,K.ch)+q[0],n(0)),C(ue,be+ue.text.slice(X.ch),ye);var it=N(1,q.length-1);ke>1&&e.remove(K.line+1,ke-1),e.insert(K.line+1,it)}Cr(e,"change",e,t)}function Di(e,t,i){function r(n,C,N){if(n.linked)for(var K=0;K<n.linked.length;++K){var X=n.linked[K];if(X.doc==C)continue;var q=N&&X.sharedHist;if(i&&!q)continue;t(X.doc,q),r(X.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||jn(e),e.options.mode=t.modeOption,_r(e)}function _o(e){(e.doc.direction=="rtl"?G:f)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Hr(e,function(){_o(e),_r(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:Kt(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=Re(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Bo(e.done),Re(e.done);if(e.done.length&&!Re(e.done).ranges)return Re(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Re(e.done)}function No(e,t,i,r){var n=e.history;n.undone.length=0;var C=+new Date,N,K;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>C-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(N=pl(n,n.lastOp==r)))K=Re(N.changes),Dt(t.from,t.to)==0&&Dt(t.from,K.to)==0?K.to=wi(t):N.changes.push(Pa(e,t));else{var X=Re(n.done);for((!X||!X.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=C,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,C=r&&r.origin;i==n.lastSelOp||C&&n.lastSelOrigin==C&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==C||ml(e,C,Re(n.done),t))?n.done[n.done.length-1]=t:Zn(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=C,n.lastSelOp=i,r&&r.clearRedo!==!1&&Bo(n.undone)}function Zn(e,t){var i=Re(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Uo(e,t,i,r){var n=t["spans_"+e.id],C=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]={}))[C]=N.markedSpans),++C})}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=Jr(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var C=i[n],N=r[n];if(C&&N){e:for(var K=0;K<N.length;++K){for(var X=N[K],q=0;q<C.length;++q)if(C[q].marker==X.marker)continue e;C.push(X)}}else N&&(i[n]=N)}return i}function $i(e,t,i){for(var r=[],n=0;n<e.length;++n){var C=e[n];if(C.ranges){r.push(i?Vr.prototype.deepCopy.call(C):C);continue}var N=C.changes,K=[];r.push({changes:K});for(var X=0;X<N.length;++X){var q=N[X],oe=void 0;if(K.push({from:q.from,to:q.to,text:q.text}),t)for(var ue in q)(oe=ue.match(/^spans_(\d+)$/))&&(ce(t,Number(oe[1]))>-1&&(Re(K)[ue]=q[ue],delete q[ue]))}}return r}function _a(e,t,i,r){if(r){var n=e.anchor;if(i){var C=Dt(t,n)<0;C!=Dt(i,n)<0?(n=t,t=i):C!=Dt(t,i)<0&&(t=i)}return new Qt(n,t)}else return new Qt(i||t,t)}function qn(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Dr(e,new Vr([_a(e.sel.primary(),t,i,n)],0),r)}function jo(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),C=0;C<e.sel.ranges.length;C++)r[C]=_a(e.sel.ranges[C],t[C],null,n);var N=$r(e.cm,r,e.sel.primIndex);Dr(e,N,i)}function Ba(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,Dr(e,$r(e.cm,n,e.sel.primIndex),r)}function Wo(e,t,i,r){Dr(e,Ti(t,i),r)}function bl(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var C=0;C<n.length;C++)this.ranges[C]=new Qt(l(e,n[C].anchor),l(e,n[C].head))},origin:i&&i.origin};return we(e,"beforeSelectionChange",e,r),e.cm&&we(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?$r(e.cm,r.ranges,r.ranges.length-1):t}function Ho(e,t,i){var r=e.history.done,n=Re(r);n&&n.ranges?(r[r.length-1]=t,$n(e,t,i)):Dr(e,t,i)}function Dr(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||(Dt(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,C=0;C<t.ranges.length;C++){var N=t.ranges[C],K=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[C],X=ea(e,N.anchor,K&&K.anchor,i,r),q=ea(e,N.head,K&&K.head,i,r);(n||X!=N.anchor||q!=N.head)&&(n||(n=t.ranges.slice(0,C)),n[C]=new Qt(X,q))}return n?$r(e.cm,n,t.primIndex):t}function en(e,t,i,r,n){var C=ze(e,t.line);if(C.markedSpans)for(var N=0;N<C.markedSpans.length;++N){var K=C.markedSpans[N],X=K.marker,q="selectLeft"in X?!X.selectLeft:X.inclusiveLeft,oe="selectRight"in X?!X.selectRight:X.inclusiveRight;if((K.from==null||(q?K.from<=t.ch:K.from<t.ch))&&(K.to==null||(oe?K.to>=t.ch:K.to>t.ch))){if(n&&(we(X,"beforeCursorEnter"),X.explicitlyCleared))if(C.markedSpans){--N;continue}else break;if(!X.atomic)continue;if(i){var ue=X.find(r<0?1:-1),be=void 0;if((r<0?oe:q)&&(ue=Vo(e,ue,-r,ue&&ue.line==t.line?C:null)),ue&&ue.line==t.line&&(be=Dt(ue,i))&&(r<0?be<0:be>0))return en(e,ue,t,r,n)}var ye=X.find(r<0?-1:1);return(r<0?q:oe)&&(ye=Vo(e,ye,r,ye.line==t.line?C:null)),ye?en(e,ye,t,r,n):null}}return t}function ea(e,t,i,r,n){var C=r||1,N=en(e,t,i,C,n)||!n&&en(e,t,i,C,!0)||en(e,t,i,-C,n)||!n&&en(e,t,i,-C,!0);return N||(e.cantEdit=!0,Ge(e.first,0))}function Vo(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?l(e,Ge(t.line-1)):null:i>0&&t.ch==(r||ze(e,t.line)).text.length?t.line<e.first+e.size-1?Ge(t.line+1,0):null:new Ge(t.line,t.ch+i)}function Qo(e){e.setSelection(Ge(e.firstLine(),0),Ge(e.lastLine()),xe)}function Xo(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,C,N,K){n&&(r.from=l(e,n)),C&&(r.to=l(e,C)),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 vr(e.cm,tn)(e,t,i);if(e.cm.state.suppressEdits)return}if((de(e,"beforeChange")||e.cm&&de(e.cm,"beforeChange"))&&(t=Xo(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)Yo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Yo(e,t)}function Yo(e,t){if(t.text.length==1&&t.text[0]==""&&Dt(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,Jr(e,t));var r=[];Di(e,function(n,C){!C&&ce(r,n.history)==-1&&($o(n.history,t),r.push(n.history)),Dn(n,t,null,Jr(n,t))})}function ta(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!i)return;for(var n=e.history,C,N=e.sel,K=t=="undo"?n.done:n.undone,X=t=="undo"?n.undone:n.done,q=0;q<K.length&&!(C=K[q],i?C.ranges&&!C.equals(e.sel):!C.ranges);q++);if(q==K.length)return;for(n.lastOrigin=n.lastSelOrigin=null;;)if(C=K.pop(),C.ranges){if(Zn(C,X),i&&!C.equals(e.sel)){Dr(e,C,{clearRedo:!1});return}N=C}else if(r){K.push(C);return}else break;var oe=[];Zn(N,X),X.push({changes:oe,generation:n.generation}),n.generation=C.generation||++n.maxGeneration;for(var ue=de(e,"beforeChange")||e.cm&&de(e.cm,"beforeChange"),be=function(He){var Ye=C.changes[He];if(Ye.origin=t,ue&&!Xo(e,Ye,!1))return K.length=0,{};oe.push(Pa(e,Ye));var it=He?Ia(e,Ye):Re(K);Dn(e,Ye,it,Fo(e,Ye)),!He&&e.cm&&e.cm.scrollIntoView({from:Ye.from,to:wi(Ye)});var ut=[];Di(e,function(nt,pt){!pt&&ce(ut,nt.history)==-1&&($o(nt.history,Ye),ut.push(nt.history)),Dn(nt,Ye,null,Fo(nt,Ye))})},ye=C.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 Vr(Ve(e.sel.ranges,function(n){return new Qt(Ge(n.anchor.line+t,n.anchor.ch),Ge(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm){_r(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 vr(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:Ge(e.first,0),to:Ge(t.to.line+n,t.to.ch),text:[Re(t.text)],origin:t.origin}}var C=e.lastLine();t.to.line>C&&(t={from:t.from,to:Ge(C,ze(e,C).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Kt(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,Ge(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var r=e.doc,n=e.display,C=t.from,N=t.to,K=!1,X=C.line;e.options.lineWrapping||(X=Ot(Lr(ze(r,C.line))),r.iter(X,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(X,C.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)),Yr(r,C.line),An(e,400);var q=t.text.length-(N.line-C.line)-1;t.full?_r(e):C.line==N.line&&t.text.length==1&&!Oo(e.doc,t)?Si(e,C.line,"text"):_r(e,C.line,N.line+1,q);var oe=de(e,"changes"),ue=de(e,"change");if(ue||oe){var be={from:C,to:N,text:t.text,removed:t.removed,origin:t.origin};ue&&Cr(e,"change",e,be),oe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(be)}e.display.selForContextMenu=null}function rn(e,t,i,r,n){var C;r||(r=i),Dt(r,i)<0&&(C=[r,i],i=C[0],r=C[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 C=e[n],N=!0;if(C.ranges){C.copied||(C=e[n]=C.deepCopy(),C.copied=!0);for(var K=0;K<C.ranges.length;K++)Zo(C.ranges[K].anchor,t,i,r),Zo(C.ranges[K].head,t,i,r);continue}for(var X=0;X<C.changes.length;++X){var q=C.changes[X];if(i<q.from.line)q.from=Ge(q.from.line+r,q.from.ch),q.to=Ge(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 Rn(e,t,i,r){var n=t,C=t;return typeof t=="number"?C=ze(e,j(e,t)):n=Ot(t),n==null?null:(r(C,n)&&e.cm&&Si(e.cm,n,i),C)}function Ln(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}Ln.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,vt(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 C=Math.min(t,n-e),N=r.height;if(r.removeInner(e,C),this.height-=N-r.height,n==C&&(this.children.splice(i--,1),r.parent=null),(t-=C)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ln))){var K=[];this.collapse(K),this.children=[new Ln(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],C=n.chunkSize();if(e<=C){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 X=new Ln(n.lines.slice(K,K+=25));n.height-=X.height,this.children.splice(++r,0,X),X.parent=this}n.lines=n.lines.slice(0,N),this.maybeSpill()}break}e-=C}},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=ce(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],C=n.chunkSize();if(e<C){var N=Math.min(t,C-e);if(n.iterN(e,N,i))return!0;if((t-=N)==0)break;e=0}else e-=C}}};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=Ot(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 C=vn(this);tr(i,Math.max(0,i.height-C)),e&&(Hr(e,function(){es(e,i,-C),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;ni(this.doc,r)||tr(r,r.height+n),i&&Hr(i,function(){i.curOp.forceUpdate=!0,es(i,r,n),Cr(i,"lineWidgetChanged",i,e,Ot(r))})},fe(In);function es(e,t,i){Zr(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),C=e.cm;return C&&n.noHScroll&&(C.display.alignWidgets=!0),Rn(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,C&&!ni(e,N)){var X=Zr(N)<e.scrollTop;tr(N,N.height+vn(n)),X&&Ta(C,n.height),C.curOp.forceUpdate=!0}return!0}),C&&Cr(C,"lineWidgetAdded",C,n,typeof t=="number"?t:Ot(t)),n}var ts=0,Ri=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};Ri.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ji(e),de(this,"clear")){var i=this.find();i&&Cr(this,"clear",i.from,i.to)}for(var r=null,n=null,C=0;C<this.lines.length;++C){var N=this.lines[C],K=Wr(N.markedSpans,this);e&&!this.collapsed?Si(e,Ot(N),"text"):e&&(K.to!=null&&(n=Ot(N)),K.from!=null&&(r=Ot(N))),N.markedSpans=Mi(N.markedSpans,K),K.from==null&&this.collapsed&&!ni(this.doc,N)&&e&&tr(N,Xi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var X=0;X<this.lines.length;++X){var q=Lr(this.lines[X]),oe=pn(q);oe>e.display.maxLineLength&&(e.display.maxLine=q,e.display.maxLineLength=oe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&_r(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&&Wi(e),this.parent&&this.parent.clear()},Ri.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var C=this.lines[n],N=Wr(C.markedSpans,this);if(N.from!=null&&(i=Ge(t?C:Ot(C),N.from),e==-1))return i;if(N.to!=null&&(r=Ge(t?C:Ot(C),N.to),e==1))return r}return i&&{from:i,to:r}},Ri.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;if(!t||!r)return;Hr(r,function(){var n=t.line,C=Ot(t.line),N=fa(r,C);if(N&&(no(N),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ni(i.doc,n)&&i.height!=null){var K=i.height;i.height=null;var X=vn(i)-K;X&&tr(n,n.height+X)}Cr(r,"markerChanged",r,e)})},Ri.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ce(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ri.prototype.detachLine=function(e){if(this.lines.splice(ce(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},fe(Ri);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 vr(e.cm,nn)(e,t,i,r,n);var C=new Ri(e,n),N=Dt(t,i);if(r&&F(r,C,!1),N>0||N==0&&C.clearWhenEmpty!==!1)return C;if(C.replacedWith&&(C.collapsed=!0,C.widgetNode=b("span",[C.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||C.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(C.widgetNode.insertLeft=!0)),C.collapsed){if(gr(e,t.line,t,i,C)||t.line!=i.line&&gr(e,i.line,t,i,C))throw new Error("Inserting collapsed marker partially overlapping an existing one");li()}C.addToHistory&&No(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var K=t.line,X=e.cm,q;if(e.iter(K,i.line+1,function(ue){X&&C.collapsed&&!X.options.lineWrapping&&Lr(ue)==X.display.maxLine&&(q=!0),C.collapsed&&K!=t.line&&tr(ue,0),yi(ue,new ui(C,K==t.line?t.ch:null,K==i.line?i.ch:null)),++K}),C.collapsed&&e.iter(t.line,i.line+1,function(ue){ni(e,ue)&&tr(ue,0)}),C.clearOnEnter&&Ae(C,"beforeCursorEnter",function(){return C.clear()}),C.readOnly&&(zr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),C.collapsed&&(C.id=++ts,C.atomic=!0),X){if(q&&(X.curOp.updateMaxLine=!0),C.collapsed)_r(X,t.line,i.line+1);else if(C.className||C.startStyle||C.endStyle||C.css||C.attributes||C.title)for(var oe=t.line;oe<=i.line;oe++)Si(X,oe,"text");C.atomic&&zo(X.doc),Cr(X,"markerAdded",X,C)}return C}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 C=[nn(e,t,i,r,n)],N=C[0],K=r.widgetNode;return Di(e,function(X){K&&(r.widgetNode=K.cloneNode(!0)),C.push(nn(X,l(X,t),l(X,i),r,n));for(var q=0;q<X.linked.length;++q)if(X.linked[q].isParent)return;N=Re(C)}),new Mn(C,N)}function rs(e){return e.findMarks(Ge(e.first,0),e.clipPos(Ge(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(),C=e.clipPos(n.from),N=e.clipPos(n.to);if(Dt(C,N)){var K=nn(e,C,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],C=[n.primary.doc];Di(n.primary.doc,function(X){return C.push(X)});for(var N=0;N<n.markers.length;N++){var K=n.markers[N];ce(C,K.doc)==-1&&(K.parent=null,n.markers.splice(N--,1))}},i=0;i<e.length;i++)t(i)}var Tl=0,Br=function(e,t,i,r,n){if(!(this instanceof Br))return new Br(e,t,i,r,n);i==null&&(i=0),kn.call(this,[new Ln([new Oi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var C=Ge(i,0);this.sel=Ti(C),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:C,to:C,text:e}),Dr(this,Ti(C),xe)};Br.prototype=Ze(kn.prototype,{constructor:Br,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=wt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:yr(function(e){var t=Ge(this.first,0),i=this.first+this.size-1;tn(this,{from:t,to:Ge(i,ze(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&En(this.cm,0,0),Dr(this,Ti(t),xe)}),replaceRange:function(e,t,i,r){t=l(this,t),i=i?l(this,i):t,rn(this,e,t,i,r)},getRange:function(e,t,i){var r=Kt(this,l(this,e),l(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(bt(this,e))return ze(this,e)},getLineNumber:function(e){return Ot(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ze(this,e)),Lr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return l(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:yr(function(e,t,i){Wo(this,l(this,typeof e=="number"?Ge(e,t||0):e),null,i)}),setSelection:yr(function(e,t,i){Wo(this,l(this,e),l(this,t||e),i)}),extendSelection:yr(function(e,t,i){qn(this,l(this,e),t&&l(this,t),i)}),extendSelections:yr(function(e,t){jo(this,I(this,e),t)}),extendSelectionsBy:yr(function(e,t){var i=Ve(this.sel.ranges,e);jo(this,I(this,i),t)}),setSelections:yr(function(e,t,i){if(!e.length)return;for(var r=[],n=0;n<e.length;n++)r[n]=new Qt(l(this,e[n].anchor),l(this,e[n].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Dr(this,$r(this.cm,r,t),i)}),addSelection:yr(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new Qt(l(this,e),l(this,t||e))),Dr(this,$r(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=Kt(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=Kt(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:yr(function(e,t,i){for(var r=[],n=this.sel,C=0;C<n.ranges.length;C++){var N=n.ranges[C];r[C]={from:N.from(),to:N.to(),text:this.splitLines(e[C]),origin:i}}for(var K=t&&t!="end"&&cl(this,r,t),X=r.length-1;X>=0;X--)tn(this,r[X]);K?Ho(this,K):this.cm&&Zi(this.cm)}),undo:yr(function(){ta(this,"undo")}),redo:yr(function(){ta(this,"redo")}),undoSelection:yr(function(){ta(this,"undo",!0)}),redoSelection:yr(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:yr(function(e,t,i){return Rn(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&qe(n)&&(r.gutterMarkers=null),!0})}),clearGutter:yr(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Rn(t,i,"gutter",function(){return i.gutterMarkers[e]=null,qe(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!bt(this,e))return null;if(t=e,e=ze(this,e),!e)return null}else if(t=Ot(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:yr(function(e,t,i){return Rn(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(x(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:yr(function(e,t,i){return Rn(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",C=r[n];if(C)if(i==null)r[n]=null;else{var N=C.match(x(i));if(!N)return!1;var K=N.index+N[0].length;r[n]=C.slice(0,N.index)+(!N.index||K==C.length?"":" ")+C.slice(K)||null}else return!1;return!0})}),addLineWidget:yr(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return nn(this,l(this,e),l(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=l(this,e),nn(this,e,e,i,"bookmark")},findMarksAt:function(e){e=l(this,e);var t=[],i=ze(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=l(this,e),t=l(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(C){var N=C.markedSpans;if(N)for(var K=0;K<N.length;K++){var X=N[K];!(X.to!=null&&n==e.line&&e.ch>=X.to||X.from==null&&n!=e.line||X.from!=null&&n==t.line&&X.from>=t.ch)&&(!i||i(X.marker))&&r.push(X.marker.parent||X.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 C=n.text.length+r;if(C>e)return t=e,!0;e-=C,++i}),l(this,Ge(i,t))},indexFromPos:function(e){e=l(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 Br(wt(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 Br(wt(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 rr&&(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):At(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:yr(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)})}),Br.prototype.eachLine=Br.prototype.iter;var is=0;function wl(e){var t=this;if(ns(t),Fe(t,e)||hi(t.display,e))return;te(e),H&&(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,C=Array(n),N=0,K=function(){++N==n&&vr(t,function(){i=l(t.doc,i);var ye={from:i,to:i,text:t.doc.splitLines(C.filter(function(ke){return ke!=null}).join(t.doc.lineSeparator())),origin:"paste"};tn(t.doc,ye),Ho(t.doc,Ti(l(t.doc,i),l(t.doc,wi(ye))))})()},X=function(ye,ke){if(t.options.allowDropFileTypes&&ce(t.options.allowDropFileTypes,ye.type)==-1){K();return}var He=new FileReader;He.onerror=function(){return K()},He.onload=function(){var Ye=He.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ye)){K();return}C[ke]=Ye,K()},He.readAsText(ye)},q=0;q<r.length;q++)X(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 oe=e.dataTransfer.getData("Text");if(oe){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(oe,"around","paste"),t.display.input.focus()}}catch(ye){}}}function Dl(e,t){if(H&&(!e.state.draggingText||+new Date-is<100)){le(t);return}if(Fe(e,t)||hi(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==",w&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),w&&i.parentNode.removeChild(i)}}function Rl(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)),s(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 C=0;C<i.length;C++)e(i[C])})}var os=!1;function Ll(){if(os)return;kl(),os=!0}function kl(){var e;Ae(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Il)},100))}),Ae(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 Li={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++)Li[On+48]=Li[On+96]=String(On);for(var ra=65;ra<=90;ra++)Li[ra]=String.fromCharCode(ra);for(var Pn=1;Pn<=12;Pn++)Li[Pn+111]=Li[Pn+63235]="F"+Pn;var ci={};ci.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"},ci.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"},ci.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"},ci.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"]},ci.default=u?ci.macDefault:ci.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,C,N=0;N<t.length-1;N++){var K=t[N];if(/^(cmd|meta|m)$/i.test(K))C=!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),C&&(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=Ve(i.split(" "),Ml),C=0;C<n.length;C++){var N=void 0,K=void 0;C==n.length-1?(K=n.join(" "),N=r):(K=n.slice(0,C+1).join(" "),N="...");var X=t[K];if(!X)t[K]=N;else if(X!=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 C=0;C<t.fallthrough.length;C++){var N=an(e,t.fallthrough[C],i,r);if(N)return N}}}function ss(e){var t=typeof e=="string"?e:Li[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),(m?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(m?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(w&&e.keyCode==34&&e.char)return!1;var i=Li[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"?ci[e]:e}function on(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var C=t(i[n]);r.length&&Dt(C.from,Re(r).to)<=0;){var N=r.pop();if(Dt(N.from,C.from)<0){C.from=N.from;break}}r.push(C)}Hr(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=Ne(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 Ge(t.line,r,i<0?"after":"before")}function Fa(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var C=rt(i,t.doc.direction);if(C){var N=n<0?Re(C):C[0],K=n<0==(N.level==1),X=K?"after":"before",q;if(N.level>0||t.doc.direction=="rtl"){var oe=Qi(t,i);q=n<0?i.text.length-1:0;var ue=oi(t,oe,q).top;q=$e(function(be){return oi(t,oe,be).top==ue},n<0==(N.level==1)?N.from:N.to-1,q),X=="before"&&(q=Na(i,q,1))}else q=n<0?N.to:N.from;return new Ge(r,q,X)}}return new Ge(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 C=Ke(n,i.ch,i.sticky),N=n[C];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(it,ut){return Na(t,it instanceof Ge?it.ch:it,ut)},X,q=function(it){return e.options.lineWrapping?(X=X||Qi(e,t),co(e,t,X,it)):{begin:0,end:t.text.length}},oe=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<=oe.end:be>=N.from&&be>=oe.begin)){var ye=ue?"before":"after";return new Ge(i.line,be,ye)}}var ke=function(it,ut,nt){for(var pt=function(qt,br){return br?new Ge(i.line,K(qt,1),"before"):new Ge(i.line,qt,"after")};it>=0&&it<n.length;it+=ut){var Tt=n[it],Et=ut>0==(Tt.level!=1),Pt=Et?nt.begin:K(nt.end,-1);if(Tt.from<=Pt&&Pt<Tt.to)return pt(Pt,Et);if(Pt=Et?Tt.from:K(Tt.to,-1),nt.begin<=Pt&&Pt<nt.end)return pt(Pt,Et)}},He=ke(C+r,r,oe);if(He)return He;var Ye=r>0?oe.end:K(oe.begin,-1);return Ye!=null&&!(r>0&&Ye==t.text.length)&&(He=ke(r>0?0:n.length-1,r,q(Ye)),He)?He: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=ze(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Ge(t.head.line+1,0)}:{from:t.head,to:Ge(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return on(e,function(t){return{from:Ge(t.from().line,0),to:l(e.doc,Ge(t.to().line+1,0))}})},delLineLeft:function(e){return on(e,function(t){return{from:Ge(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(Ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ge(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return hs(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/)?hs(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 C=i[n].from(),N=ee(e.getLine(C.line),C.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 Hr(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var n=t[r].head,C=ze(e.doc,n.line).text;if(C){if(n.ch==C.length&&(n=new Ge(n.line,n.ch-1)),n.ch>0)n=new Ge(n.line,n.ch+1),e.replaceRange(C.charAt(n.ch-1)+C.charAt(n.ch-2),Ge(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var N=ze(e.doc,n.line-1).text;N&&(n=new Ge(n.line,1),e.replaceRange(C.charAt(0)+e.doc.lineSeparator()+N.charAt(N.length-1),Ge(n.line-1,N.length-1),n,"+transpose"))}}i.push(new Qt(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return Hr(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 ds(e,t){var i=ze(e.doc,t),r=Lr(i);return r!=i&&(t=Ot(r)),Fa(!0,e,r,t,1)}function _l(e,t){var i=ze(e.doc,t),r=Vi(i);return r!=i&&(t=Ot(r)),Fa(!0,e,i,t,-1)}function hs(e,t){var i=ds(e,t.line),r=ze(e.doc,i.line),n=rt(r,e.doc.direction);if(!n||n[0].level==0){var C=Math.max(i.ch,r.text.search(/\S/)),N=t.line==i.line&&t.ch<=C&&t.ch;return Ge(i.line,N?0:C,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)!=Me}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 ae;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 ja=null;function ps(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),Fe(t,e))return;H&&W<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=fs(t,e);w&&(ja=r?i:null,!r&&i==88&&!Ft&&(u?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),L&&!u&&!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;G(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(f(t,"CodeMirror-crosshair"),ot(document,"keyup",i),ot(document,"mouseover",i))}Ae(document,"keyup",i),Ae(document,"mouseover",i)}function ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),Fe(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(hi(t.display,e)||Fe(t,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var i=e.keyCode,r=e.charCode;if(w&&i==ja){ja=null,te(e);return}if(w&&(!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 jl=400,Wa=function(e,t,i){this.time=e,this.pos=t,this.button=i};Wa.prototype.compare=function(e,t,i){return this.time+jl>e&&Dt(t,this.pos)==0&&i==this.button};var Nn,Un;function Wl(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 Wa(i,e,t),Nn=null,"double"):(Nn=new Wa(i,e,t),Un=null,"single")}function vs(e){var t=this,i=t.display;if(Fe(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,hi(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=Ce(e),C=r?Wl(r,n):"single";if(window.focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,n,r,C,e))return;n==1?r?zl(t,r,C,e):pe(e)==i.scroller&&te(e):n==2?(r&&qn(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(R?t.display.input.onContextMenu(e):yo(t))}function Hl(e,t,i,r,n){var C="Click";return r=="double"?C="Double"+C:r=="triple"&&(C="Triple"+C),C=(t==1?"Left":t==2?"Middle":"Right")+C,Bn(e,ls(C,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)!=Me}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 C=d?i.shiftKey&&i.metaKey:i.altKey;n.unit=C?"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=u?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(u?i.altKey:i.ctrlKey)),n}function zl(e,t,i,r){H?setTimeout(z(vo,e),0):e.curOp.focus=P();var n=Gl(e,i,r),C=e.doc.sel,N;e.options.dragDrop&&Oe&&!e.isReadOnly()&&i=="single"&&(N=C.contains(t))>-1&&(Dt((N=C.ranges[N]).from(),t)<0||t.xRel>0)&&(Dt(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,C=!1,N=vr(e,function(q){O&&(n.scroller.draggable=!1),e.state.draggingText=!1,ot(n.wrapper.ownerDocument,"mouseup",N),ot(n.wrapper.ownerDocument,"mousemove",K),ot(n.scroller,"dragstart",X),ot(n.scroller,"drop",N),C||(te(q),r.addNew||qn(e.doc,i,null,null,r.extend),O&&!k||H&&W==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),K=function(q){C=C||Math.abs(t.clientX-q.clientX)+Math.abs(t.clientY-q.clientY)>=10},X=function(){return C=!0};O&&(n.scroller.draggable=!0),e.state.draggingText=N,N.copy=!r.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),Ae(n.wrapper.ownerDocument,"mouseup",N),Ae(n.wrapper.ownerDocument,"mousemove",K),Ae(n.scroller,"dragstart",X),Ae(n.scroller,"drop",N),yo(e),setTimeout(function(){return n.input.focus()},20)}function ys(e,t,i){if(i=="char")return new Qt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Qt(Ge(t.line,0),l(e.doc,Ge(t.line+1,0)));var r=i(e,t);return new Qt(r.from,r.to)}function Vl(e,t,i,r){var n=e.display,C=e.doc;te(t);var N,K,X=C.sel,q=X.ranges;if(r.addNew&&!r.extend?(K=C.sel.contains(i),K>-1?N=q[K]:N=new Qt(i,i)):(N=C.sel.primary(),K=C.sel.primIndex),r.unit=="rectangle")r.addNew||(N=new Qt(i,i)),i=Bi(e,t,!0,!0),K=-1;else{var oe=ys(e,i,r.unit);r.extend?N=_a(N,oe.anchor,oe.head,r.extend):N=oe}r.addNew?K==-1?(K=q.length,Dr(C,$r(e,q.concat([N]),K),{scroll:!1,origin:"*mouse"})):q.length>1&&q[K].empty()&&r.unit=="char"&&!r.extend?(Dr(C,$r(e,q.slice(0,K).concat(q.slice(K+1)),0),{scroll:!1,origin:"*mouse"}),X=C.sel):Ba(C,K,N,Ee):(K=0,Dr(C,new Vr([N],0),Ee),X=C.sel);var ue=i;function be(nt){if(Dt(ue,nt)==0)return;if(ue=nt,r.unit=="rectangle"){for(var pt=[],Tt=e.options.tabSize,Et=ee(ze(C,i.line).text,i.ch,Tt),Pt=ee(ze(C,nt.line).text,nt.ch,Tt),qt=Math.min(Et,Pt),br=Math.max(Et,Pt),nr=Math.min(i.line,nt.line),Gr=Math.min(e.lastLine(),Math.max(i.line,nt.line));nr<=Gr;nr++){var Nr=ze(C,nr).text,hr=Se(Nr,qt,Tt);qt==br?pt.push(new Qt(Ge(nr,hr),Ge(nr,hr))):Nr.length>hr&&pt.push(new Qt(Ge(nr,hr),Ge(nr,Se(Nr,br,Tt))))}pt.length||pt.push(new Qt(i,i)),Dr(C,$r(e,X.ranges.slice(0,K).concat(pt),K),{origin:"*mouse",scroll:!1}),e.scrollIntoView(nt)}else{var Ur=N,Sr=ys(e,nt,r.unit),pr=Ur.anchor,cr;Dt(Sr.anchor,pr)>0?(cr=Sr.head,pr=vi(Ur.from(),Sr.anchor)):(cr=Sr.anchor,pr=gi(Ur.to(),Sr.head));var or=X.ranges.slice(0);or[K]=Ql(e,new Qt(l(C,pr),cr)),Dr(C,$r(e,or,K),Ee)}}var ye=n.wrapper.getBoundingClientRect(),ke=0;function He(nt){var pt=++ke,Tt=Bi(e,nt,!0,r.unit=="rectangle");if(!Tt)return;if(Dt(Tt,ue)!=0){e.curOp.focus=P(),be(Tt);var Et=Vn(n,C);(Tt.line>=Et.to||Tt.line<Et.from)&&setTimeout(vr(e,function(){ke==pt&&He(nt)}),150)}else{var Pt=nt.clientY<ye.top?-20:nt.clientY>ye.bottom?20:0;Pt&&setTimeout(vr(e,function(){if(ke!=pt)return;n.scroller.scrollTop+=Pt,He(nt)}),50)}}function Ye(nt){e.state.selectingText=!1,ke=Infinity,nt&&(te(nt),n.input.focus()),ot(n.wrapper.ownerDocument,"mousemove",it),ot(n.wrapper.ownerDocument,"mouseup",ut),C.history.lastSelOrigin=null}var it=vr(e,function(nt){nt.buttons===0||!Ce(nt)?Ye(nt):He(nt)}),ut=vr(e,Ye);e.state.selectingText=ut,Ae(n.wrapper.ownerDocument,"mousemove",it),Ae(n.wrapper.ownerDocument,"mouseup",ut)}function Ql(e,t){var i=t.anchor,r=t.head,n=ze(e.doc,i.line);if(Dt(i,r)==0&&i.sticky==r.sticky)return t;var C=rt(n);if(!C)return t;var N=Ke(C,i.ch,i.sticky),K=C[N];if(K.from!=i.ch&&K.to!=i.ch)return t;var X=N+(K.from==i.ch==(K.level!=1)?0:1);if(X==0||X==C.length)return t;var q;if(r.line!=i.line)q=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var oe=Ke(C,r.ch,r.sticky),ue=oe-N||(r.ch-i.ch)*(K.level==1?-1:1);oe==X-1||oe==X?q=ue<0:q=ue>0}var be=C[X+(q?-1:0)],ye=q==(be.level==1),ke=ye?be.from:be.to,He=ye?"after":"before";return i.ch==ke&&i.sticky==He?t:new Qt(new Ge(i.line,ke,He),r)}function bs(e,t,i,r){var n,C;if(t.touches)n=t.touches[0].clientX,C=t.touches[0].clientY;else try{n=t.clientX,C=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(C>K.bottom||!de(e,i))return ne(t);C-=K.top-N.viewOffset;for(var X=0;X<e.display.gutterSpecs.length;++X){var q=N.gutters.childNodes[X];if(q&&q.getBoundingClientRect().right>=n){var oe=ur(e.doc,C),ue=e.display.gutterSpecs[X];return we(e,i,e,oe,ue.className,t),ne(t)}}}function Ha(e,t){return bs(e,t,"gutterClick",!0)}function Es(e,t){if(hi(e.display,t)||Xl(e,t))return;if(Fe(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Xl(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 Yl(e){var t=e.optionHandlers;function i(r,n,C,N){e.defaults[r]=n,C&&(t[r]=N?function(K,X,q){q!=sn&&C(K,X,q)}:C)}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),_r(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!n)return;var C=[],N=r.doc.first;r.doc.iter(function(X){for(var q=0;;){var oe=X.text.indexOf(n,q);if(oe==-1)break;q=oe+n.length,C.push(Ge(N,oe))}N++});for(var K=C.length-1;K>=0;K--)rn(r.doc,n,C[K],Ge(C[K].line,C[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,C){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),C!=sn&&r.refresh()}),i("specialCharPlaceholder",Zt,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,C){var N=ia(n),K=C!=sn&&ia(C);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,C=t?Ae:ot;C(e.display.scroller,"dragstart",n.start),C(e.display.scroller,"dragenter",n.enter),C(e.display.scroller,"dragover",n.over),C(e.display.scroller,"dragleave",n.leave),C(e.display.scroller,"drop",n.drop)}}function Zl(e){e.options.lineWrapping?(G(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(f(e.display.wrapper,"CodeMirror-wrap"),jn(e)),xa(e),_r(e),yn(e),setTimeout(function(){return qi(e)},100)}function rr(e,t){var i=this;if(!(this instanceof rr))return new rr(e,t);this.options=t=t?F(t):{},F(Cs,t,!1);var r=t.value;typeof r=="string"?r=new Br(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new rr.inputStyles[t.inputStyle](this),C=this.display=new dl(e,r,n,t);C.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 ae,keySeq:null,specialChars:null},t.autofocus&&!o&&C.input.focus(),H&&W<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Ll(),ji(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);Wi(this),O&&t.lineWrapping&&getComputedStyle(C.lineDiv).textRendering=="optimizelegibility"&&(C.lineDiv.style.textRendering="auto")}rr.defaults=Cs,rr.optionHandlers=aa;function ql(e){var t=e.display;Ae(t.scroller,"mousedown",vr(e,vs)),H&&W<11?Ae(t.scroller,"dblclick",vr(e,function(X){if(Fe(e,X))return;var q=Bi(e,X);if(!q||Ha(e,X)||hi(e.display,X))return;te(X);var oe=e.findWordAt(q);qn(e.doc,oe.anchor,oe.head)})):Ae(t.scroller,"dblclick",function(X){return Fe(e,X)||te(X)}),Ae(t.scroller,"contextmenu",function(X){return Es(e,X)}),Ae(t.input.getField(),"contextmenu",function(X){t.scroller.contains(X.target)||Es(e,X)});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 C(X){if(X.touches.length!=1)return!1;var q=X.touches[0];return q.radiusX<=1&&q.radiusY<=1}function N(X,q){if(q.left==null)return!0;var oe=q.left-X.left,ue=q.top-X.top;return oe*oe+ue*ue>20*20}Ae(t.scroller,"touchstart",function(X){if(!Fe(e,X)&&!C(X)&&!Ha(e,X)){t.input.ensurePolled(),clearTimeout(i);var q=+new Date;t.activeTouch={start:q,moved:!1,prev:q-r.end<=300?r:null},X.touches.length==1&&(t.activeTouch.left=X.touches[0].pageX,t.activeTouch.top=X.touches[0].pageY)}}),Ae(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ae(t.scroller,"touchend",function(X){var q=t.activeTouch;if(q&&!hi(t,X)&&q.left!=null&&!q.moved&&new Date-q.start<300){var oe=e.coordsChar(t.activeTouch,"page"),ue;!q.prev||N(q,q.prev)?ue=new Qt(oe,oe):!q.prev.prev||N(q,q.prev.prev)?ue=e.findWordAt(oe):ue=new Qt(Ge(oe.line,0),l(e.doc,Ge(oe.line+1,0))),e.setSelection(ue.anchor,ue.head),e.focus(),te(X)}n()}),Ae(t.scroller,"touchcancel",n),Ae(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xn(e,t.scroller.scrollTop),Ui(e,t.scroller.scrollLeft,!0),we(e,"scroll",e))}),Ae(t.scroller,"mousewheel",function(X){return ko(e,X)}),Ae(t.scroller,"DOMMouseScroll",function(X){return ko(e,X)}),Ae(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(X){Fe(e,X)||le(X)},over:function(X){Fe(e,X)||(Rl(e,X),le(X))},start:function(X){return Dl(e,X)},drop:vr(e,wl),leave:function(X){Fe(e,X)||ns(e)}};var K=t.input.getField();Ae(K,"keyup",function(X){return ms.call(e,X)}),Ae(K,"keydown",vr(e,ps)),Ae(K,"keypress",vr(e,gs)),Ae(K,"focus",function(X){return Sa(e,X)}),Ae(K,"blur",function(X){return Ji(e,X)})}var Ga=[];rr.defineInitHook=function(e){return Ga.push(e)};function Fn(e,t,i,r){var n=e.doc,C;i==null&&(i="add"),i=="smart"&&(n.mode.indent?C=tt(e,t).state:i="prev");var N=e.options.tabSize,K=ze(n,t),X=ee(K.text,null,N);K.stateAfter&&(K.stateAfter=null);var q=K.text.match(/^\s*/)[0],oe;if(!r&&!/\S/.test(K.text))oe=0,i="not";else if(i=="smart"&&(oe=n.mode.indent(C,K.text.slice(q.length),K.text),oe==Me||oe>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?oe=ee(ze(n,t-1).text,null,N):oe=0:i=="add"?oe=X+e.options.indentUnit:i=="subtract"?oe=X-e.options.indentUnit:typeof i=="number"&&(oe=X+i),oe=Math.max(0,oe);var ue="",be=0;if(e.options.indentWithTabs)for(var ye=Math.floor(oe/N);ye;--ye)be+=N,ue+=" ";if(be<oe&&(ue+=se(oe-be)),ue!=q)return rn(n,ue,Ge(t,0),Ge(t,q.length),"+input"),K.stateAfter=null,!0;for(var ke=0;ke<n.sel.ranges.length;ke++){var He=n.sel.ranges[ke];if(He.head.line==t&&He.head.ch<q.length){var Ye=Ge(t,q.length);Ba(n,ke,new Qt(Ye,Ye));break}}}var ei=null;function oa(e){ei=e}function za(e,t,i,r,n){var C=e.doc;e.display.shift=!1,r||(r=C.sel);var N=+new Date-200,K=n=="paste"||e.state.pasteIncoming>N,X=At(t),q=null;if(K&&r.ranges.length>1)if(ei&&ei.text.join(`
|
|
`)==t){if(r.ranges.length%ei.text.length==0){q=[];for(var oe=0;oe<ei.text.length;oe++)q.push(C.splitLines(ei.text[oe]))}}else X.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(q=Ve(X,function(it){return[it]}));for(var ue=e.curOp.updateInput,be=r.ranges.length-1;be>=0;be--){var ye=r.ranges[be],ke=ye.from(),He=ye.to();ye.empty()&&(i&&i>0?ke=Ge(ke.line,ke.ch-i):e.state.overwrite&&!K?He=Ge(He.line,Math.min(ze(C,He.line).text.length,He.ch+Re(X).length)):K&&ei&&ei.lineWise&&ei.text.join(`
|
|
`)==X.join(`
|
|
`)&&(ke=He=Ge(ke.line,0)));var Ye={from:ke,to:He,text:q?q[be%q.length]:X,origin:n||(K?"paste":e.state.cutIncoming>N?"cut":"+input")};tn(e.doc,Ye),Cr(e,"inputRead",e,Ye)}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&&Hr(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 C=e.getModeAt(n.head),N=!1;if(C.electricChars){for(var K=0;K<C.electricChars.length;K++)if(t.indexOf(C.electricChars.charAt(K))>-1){N=Fn(e,n.head.line,"smart");break}}else C.electricInput&&(C.electricInput.test(ze(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,C={anchor:Ge(n,0),head:Ge(n+1,0)};i.push(C),t.push(e.getRange(C.anchor,C.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"),S&&(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 C=this.options,N=C[r];if(C[r]==n&&r!="mode")return;C[r]=n,t.hasOwnProperty(r)&&vr(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,C=0;C<n.length;++C)if(n[C]==r||n[C].name==r)return n.splice(C,1),!0},addOverlay:kr(function(r,n){var C=r.token?r:e.getMode(this.options,r);if(C.startState)throw new Error("Overlays may not be stateful.");We(this.state.overlays,{mode:C,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(N){return N.priority}),this.state.modeGen++,_r(this)}),removeOverlay:kr(function(r){for(var n=this.state.overlays,C=0;C<n.length;++C){var N=n[C].modeSpec;if(N==r||typeof r=="string"&&N.name==r){n.splice(C,1),this.state.modeGen++,_r(this);return}}}),indentLine:kr(function(r,n,C){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),bt(this.doc,r)&&Fn(this,r,n,C)}),indentSelection:kr(function(r){for(var n=this.doc.sel.ranges,C=-1,N=0;N<n.length;N++){var K=n[N];if(K.empty())K.head.line>C&&(Fn(this,K.head.line,r,!0),C=K.head.line,N==this.doc.sel.primIndex&&Zi(this));else{var X=K.from(),q=K.to(),oe=Math.max(C,X.line);C=Math.min(this.lastLine(),q.line-(q.ch?0:1))+1;for(var ue=oe;ue<C;++ue)Fn(this,ue,r);var be=this.doc.sel.ranges;X.ch==0&&n.length==be.length&&be[N].from().ch>0&&Ba(this.doc,N,new Qt(X,be[N].to()),xe)}}}),getTokenAt:function(r,n){return er(this,r,n)},getLineTokens:function(r,n){return er(this,Ge(r),n,!0)},getTokenTypeAt:function(r){r=l(this.doc,r);var n=_e(this,ze(this.doc,r.line)),C=0,N=(n.length-1)/2,K=r.ch,X;if(K==0)X=n[2];else for(;;){var q=C+N>>1;if((q?n[q*2-1]:0)>=K)N=q;else if(n[q*2+1]<K)C=q+1;else{X=n[q*2+2];break}}var oe=X?X.indexOf("overlay "):-1;return oe<0?X:oe==0?null:X.slice(0,oe-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 C=[];if(!i.hasOwnProperty(n))return C;var N=i[n],K=this.getModeAt(r);if(typeof K[n]=="string")N[K[n]]&&C.push(N[K[n]]);else if(K[n])for(var X=0;X<K[n].length;X++){var q=N[K[n][X]];q&&C.push(q)}else K.helperType&&N[K.helperType]?C.push(N[K.helperType]):N[K.name]&&C.push(N[K.name]);for(var oe=0;oe<N._global.length;oe++){var ue=N._global[oe];ue.pred(K,this)&&ce(C,ue.val)==-1&&C.push(ue.val)}return C},getStateAfter:function(r,n){var C=this.doc;return r=j(C,r==null?C.first+C.size-1:r),tt(this,r+1,n).state},cursorCoords:function(r,n){var C,N=this.doc.sel.primary();return r==null?C=N.head:typeof r=="object"?C=l(this.doc,r):C=r?N.from():N.to(),qr(this,C,n||"page")},charCoords:function(r,n){return ma(this,l(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,C){var N=!1,K;if(typeof r=="number"){var X=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>X&&(r=X,N=!0),K=ze(this.doc,r)}else K=r;return Hn(this,K,{top:0,left:0},n||"page",C||N).top+(N?this.doc.height-Zr(K):0)},defaultTextHeight:function(){return Xi(this.display)},defaultCharWidth:function(){return Yi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,C,N,K){var X=this.display;r=qr(this,l(this.doc,r));var q=r.bottom,oe=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),X.sizer.appendChild(n),N=="over")q=r.top;else if(N=="above"||N=="near"){var ue=Math.max(X.wrapper.clientHeight,this.doc.height),be=Math.max(X.sizer.clientWidth,X.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),oe+n.offsetWidth>be&&(oe=be-n.offsetWidth)}n.style.top=q+"px",n.style.left=n.style.right="",K=="right"?(oe=X.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(K=="left"?oe=0:K=="middle"&&(oe=(X.sizer.clientWidth-n.offsetWidth)/2),n.style.left=oe+"px"),C&&Js(this,{left:oe,top:q,right:oe+n.offsetWidth,bottom:q+n.offsetHeight})},triggerOnKeyDown:kr(ps),triggerOnKeyPress:kr(gs),triggerOnKeyUp:ms,triggerOnMouseDown:kr(vs),execCommand:function(r){if(_n.hasOwnProperty(r))return _n[r].call(null,this)},triggerElectric:kr(function(r){As(this,r)}),findPosH:function(r,n,C,N){var K=1;n<0&&(K=-1,n=-n);for(var X=l(this.doc,r),q=0;q<n&&!(X=Ka(this.doc,X,K,C,N),X.hitSide);++q);return X},moveH:kr(function(r,n){var C=this;this.extendSelectionsBy(function(N){return C.display.shift||C.doc.extend||N.empty()?Ka(C.doc,N.head,r,n,C.options.rtlMoveVisually):r<0?N.from():N.to()},Te)}),deleteH:kr(function(r,n){var C=this.doc.sel,N=this.doc;C.somethingSelected()?N.replaceSelection("",null,"+delete"):on(this,function(K){var X=Ka(N,K.head,r,n,!1);return r<0?{from:X,to:K.head}:{from:K.head,to:X}})}),findPosV:function(r,n,C,N){var K=1,X=N;n<0&&(K=-1,n=-n);for(var q=l(this.doc,r),oe=0;oe<n;++oe){var ue=qr(this,q,"div");if(X==null?X=ue.left:ue.left=X,q=Rs(this,ue,K,C),q.hitSide)break}return q},moveV:kr(function(r,n){var C=this,N=this.doc,K=[],X=!this.display.shift&&!N.extend&&N.sel.somethingSelected();if(N.extendSelectionsBy(function(oe){if(X)return r<0?oe.from():oe.to();var ue=qr(C,oe.head,"div");oe.goalColumn!=null&&(ue.left=oe.goalColumn),K.push(ue.left);var be=Rs(C,ue,r,n);return n=="page"&&oe==N.sel.primary()&&Ta(C,ma(C,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,C=ze(n,r.line).text,N=r.ch,K=r.ch;if(C){var X=this.getHelper(r,"wordChars");(r.sticky=="before"||K==C.length)&&N?--N:++K;for(var q=C.charAt(N),oe=Be(q,X)?function(ue){return Be(ue,X)}:/\s/.test(q)?function(ue){return/\s/.test(ue)}:function(ue){return!/\s/.test(ue)&&!Be(ue)};N>0&&oe(C.charAt(N-1));)--N;for(;K<C.length&&oe(C.charAt(K));)++K}return new Qt(Ge(r.line,N),Ge(r.line,K))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?G(this.display.cursorDiv,"CodeMirror-overwrite"):f(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:kr(function(r,n){En(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-ai(this)-this.display.barHeight,width:r.scrollWidth-ai(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:Pi(this)}},scrollIntoView:kr(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:Ge(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:kr(function(r,n){var C=this,N=function(X){return typeof X=="number"||/^\d+$/.test(String(X))?X+"px":X};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(X){if(X.widgets){for(var q=0;q<X.widgets.length;q++)if(X.widgets[q].noHScroll){Si(C,K,"widget");break}}++K}),this.curOp.forceUpdate=!0,we(this,"refresh",this)}),operation:function(r){return Hr(this,r)},startOperation:function(){return ji(this)},endOperation:function(){return Wi(this)},refresh:kr(function(){var r=this.display.cachedTextHeight;_r(this),this.curOp.forceUpdate=!0,yn(this),En(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(r==null||Math.abs(r-Xi(this.display))>.5||this.options.lineWrapping)&&xa(this),we(this,"refresh",this)}),swapDoc:kr(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,C){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=C},e.registerGlobalHelper=function(r,n,C,N){e.registerHelper(r,n,N),i[r]._global.push({pred:C,val:N})}}function Ka(e,t,i,r,n){var C=t,N=i,K=ze(e,t.line),X=n&&e.direction=="rtl"?-i:i;function q(){var ut=t.line+X;return ut<e.first||ut>=e.first+e.size?!1:(t=new Ge(ut,t.ch,t.sticky),K=ze(e,ut))}function oe(ut){var nt;if(r=="codepoint"){var pt=K.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(pt)?nt=null:nt=new Ge(t.line,Math.max(0,Math.min(K.text.length,t.ch+i*(pt>=55296&&pt<56320?2:1))),-i)}else n?nt=Pl(e.cm,K,t,i):nt=Ua(K,t,i);if(nt==null)if(!ut&&q())t=Fa(n,e.cm,K,t.line,X);else return!1;else t=nt;return!0}if(r=="char"||r=="codepoint")oe();else if(r=="column")oe(!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&&!oe(!ke));ke=!1){var He=K.text.charAt(t.ch)||`
|
|
`,Ye=Be(He,ye)?"w":be&&He==`
|
|
`?"n":!be||/\s/.test(He)?null:"p";if(be&&!ke&&!Ye&&(Ye="s"),ue&&ue!=Ye){i<0&&(i=1,oe(),t.sticky="after");break}if(Ye&&(ue=Ye),i>0&&!oe(!ke))break}var it=ea(e,t,C,N,!0);return pi(C,it)&&(it.hitSide=!0),it}function Rs(e,t,i,r){var n=e.doc,C=t.left,N;if(r=="page"){var K=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),X=Math.max(K-.5*Xi(e.display),3);N=(i>0?t.bottom:t.top)+i*X}else r=="line"&&(N=i>0?t.bottom+3:t.top-3);for(var q;!(q=va(e,C,N),!q.outside);){if(i<0?N<=0:N>=n.height){q.hitSide=!0;break}N+=i*5}return q}var Jt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ae,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Jt.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 C(K){for(var X=K.target;X;X=X.parentNode){if(X==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(X.className))break}return!1}Ae(n,"paste",function(K){if(!C(K)||Fe(r,K)||Ss(K,r))return;W<=11&&setTimeout(vr(r,function(){return t.updateFromDOM()}),20)}),Ae(n,"compositionstart",function(K){t.composing={data:K.data,done:!1}}),Ae(n,"compositionupdate",function(K){t.composing||(t.composing={data:K.data,done:!1})}),Ae(n,"compositionend",function(K){t.composing&&(K.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ae(n,"touchstart",function(){return i.forceCompositionEnd()}),Ae(n,"input",function(){t.composing||t.readFromDOMSoon()});function N(K){if(!C(K)||Fe(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 X=Ts(r);oa({lineWise:!0,text:X.text}),K.type=="cut"&&r.operation(function(){r.setSelections(X.ranges,0,xe),r.replaceSelection("",null,"cut")})}else return;if(K.clipboardData){K.clipboardData.clearData();var q=ei.text.join(`
|
|
`);if(K.clipboardData.setData("Text",q),K.clipboardData.getData("Text")==q){K.preventDefault();return}}var oe=Ds(),ue=oe.firstChild;r.display.lineSpace.insertBefore(oe,r.display.lineSpace.firstChild),ue.value=ei.text.join(`
|
|
`);var be=document.activeElement;$(ue),setTimeout(function(){r.display.lineSpace.removeChild(oe),be.focus(),be==n&&i.showPrimarySelection()},50)}Ae(n,"copy",N),Ae(n,"cut",N)},Jt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Jt.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Jt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Jt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Jt.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 C=sa(t,e.anchorNode,e.anchorOffset),N=sa(t,e.focusNode,e.focusOffset);if(C&&!C.bad&&N&&!N.bad&&Dt(vi(C,N),r)==0&&Dt(gi(C,N),n)==0)return;var K=t.display.view,X=r.line>=t.display.viewFrom&&Ls(t,r)||{node:K[0].measure.map[2],offset:0},q=n.line<t.display.viewTo&&Ls(t,n);if(!q){var oe=K[K.length-1].measure,ue=oe.maps?oe.maps[oe.maps.length-1]:oe.map;q={node:ue[ue.length-1],offset:ue[ue.length-2]-ue[ue.length-3]}}if(!X||!q){e.removeAllRanges();return}var be=e.rangeCount&&e.getRangeAt(0),ye;try{ye=g(X.node,X.offset,q.offset,q.node)}catch(ke){}ye&&(!L&&t.state.focused?(e.collapse(X.node,X.offset),ye.collapsed||(e.removeAllRanges(),e.addRange(ye))):(e.removeAllRanges(),e.addRange(ye)),be&&e.anchorNode==null?e.addRange(be):L&&this.startGracePeriod()),this.rememberSelection()},Jt.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)},Jt.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},Jt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Jt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Jt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Jt.prototype.blur=function(){this.div.blur()},Jt.prototype.getField=function(){return this.div},Jt.prototype.supportsTouch=function(){return!0},Jt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Hr(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)},Jt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Jt.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&&Hr(t,function(){Dr(t.doc,Ti(i,r),xe),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Jt.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=Ge(r.line-1,ze(e.doc,r.line-1).length)),n.ch==ze(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=Ge(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var C,N,K;r.line==t.viewFrom||(C=Ni(e,r.line))==0?(N=Ot(t.view[0].line),K=t.view[0].node):(N=Ot(t.view[C].line),K=t.view[C-1].node.nextSibling);var X=Ni(e,n.line),q,oe;if(X==t.view.length-1?(q=t.viewTo-1,oe=t.lineDiv.lastChild):(q=Ot(t.view[X+1].line)-1,oe=t.view[X+1].node.previousSibling),!K)return!1;for(var ue=e.doc.splitLines(tu(e,K,oe,N,q)),be=Kt(e.doc,Ge(N,0),Ge(q,ze(e.doc,q).text.length));ue.length>1&&be.length>1;)if(Re(ue)==Re(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,He=ue[0],Ye=be[0],it=Math.min(He.length,Ye.length);ye<it&&He.charCodeAt(ye)==Ye.charCodeAt(ye);)++ye;for(var ut=Re(ue),nt=Re(be),pt=Math.min(ut.length-(ue.length==1?ye:0),nt.length-(be.length==1?ye:0));ke<pt&&ut.charCodeAt(ut.length-ke-1)==nt.charCodeAt(nt.length-ke-1);)++ke;if(ue.length==1&&be.length==1&&N==r.line)for(;ye&&ye>r.ch&&ut.charCodeAt(ut.length-ke-1)==nt.charCodeAt(nt.length-ke-1);)ye--,ke++;ue[ue.length-1]=ut.slice(0,ut.length-ke).replace(/^\u200b+/,""),ue[0]=ue[0].slice(ye).replace(/\u200b+$/,"");var Tt=Ge(N,ye),Et=Ge(q,be.length?Re(be).length-ke:0);if(ue.length>1||ue[0]||Dt(Tt,Et))return rn(e.doc,ue,Tt,Et,"+input"),!0},Jt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Jt.prototype.reset=function(){this.forceCompositionEnd()},Jt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Jt.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)},Jt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Hr(this.cm,function(){return _r(e.cm)})},Jt.prototype.setUneditable=function(e){e.contentEditable="false"},Jt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||vr(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Jt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Jt.prototype.onContextMenu=function(){},Jt.prototype.resetPosition=function(){},Jt.prototype.needsContentAttribute=!0;function Ls(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var r=ze(e.doc,t.line),n=eo(i,r,t.line),C=rt(r,e.doc.direction),N="left";if(C){var K=Ke(C,t.ch);N=K%2?"right":"left"}var X=io(n.map,t.ch,N);return X.offset=X.collapse=="right"?X.end:X.start,X}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ln(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,r,n){var C="",N=!1,K=e.doc.lineSeparator(),X=!1;function q(ye){return function(ke){return ke.id==ye}}function oe(){N&&(C+=K,X&&(C+=K),N=X=!1)}function ue(ye){ye&&(oe(),C+=ye)}function be(ye){if(ye.nodeType==1){var ke=ye.getAttribute("cm-text");if(ke){ue(ke);return}var He=ye.getAttribute("cm-marker"),Ye;if(He){var it=e.findMarks(Ge(r,0),Ge(n+1,0),q(+He));it.length&&(Ye=it[0].find(0))&&ue(Kt(e.doc,Ye.from,Ye.to).join(K));return}if(ye.getAttribute("contenteditable")=="false")return;var ut=/^(pre|div|p|li|table|br)$/i.test(ye.nodeName);if(!/^br$/i.test(ye.nodeName)&&ye.textContent.length==0)return;ut&&oe();for(var nt=0;nt<ye.childNodes.length;nt++)be(ye.childNodes[nt]);/^(pre|p)$/i.test(ye.nodeName)&&(X=!0),ut&&(N=!0)}else ye.nodeType==3&&ue(ye.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(be(t),t==i);)t=t.nextSibling,X=!1;return C}function sa(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return ln(e.clipPos(Ge(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 C=e.display.view[n];if(C.node==r)return ru(C,t,i)}}function ru(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!E(r,t))return ln(Ge(Ot(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var C=e.rest?Re(e.rest):e.line;return ln(Ge(Ot(C),C.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 X=e.measure,q=X.maps;function oe(Ye,it,ut){for(var nt=-1;nt<(q?q.length:0);nt++)for(var pt=nt<0?X.map:q[nt],Tt=0;Tt<pt.length;Tt+=3){var Et=pt[Tt+2];if(Et==Ye||Et==it){var Pt=Ot(nt<0?e.line:e.rest[nt]),qt=pt[Tt]+ut;return(ut<0||Et!=Ye)&&(qt=pt[Tt+(ut?1:0)]),Ge(Pt,qt)}}}var ue=oe(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=oe(be,be.firstChild,0),ue)return ln(Ge(ue.line,ue.ch-ye),n);ye+=be.textContent.length}for(var ke=K.previousSibling,He=i;ke;ke=ke.previousSibling){if(ue=oe(ke,ke.firstChild,-1),ue)return ln(Ge(ue.line,ue.ch+He),n);He+=ke.textContent.length}}var lr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ae,this.hasSelection=!1,this.composing=null};lr.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),S&&(n.style.width="0px"),Ae(n,"input",function(){H&&W>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ae(n,"paste",function(N){if(Fe(r,N)||Ss(N,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function C(N){if(Fe(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)}Ae(n,"cut",C),Ae(n,"copy",C),Ae(e.scroller,"paste",function(N){if(hi(e,N)||Fe(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)}),Ae(e.lineSpace,"selectstart",function(N){hi(e,N)||te(N)}),Ae(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"})}}),Ae(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},lr.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},lr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},lr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=mo(e);if(e.options.moveInputWithCursor){var n=qr(e,i.sel.primary().head,"div"),C=t.wrapper.getBoundingClientRect(),N=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+N.top-C.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+N.left-C.left))}return r},lr.prototype.showSelection=function(e){var t=this.cm,i=t.display;s(i.cursorDiv,e.cursors),s(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},lr.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),H&&W>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",H&&W>=9&&(this.hasSelection=null))},lr.prototype.getField=function(){return this.textarea},lr.prototype.supportsTouch=function(){return!1},lr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},lr.prototype.blur=function(){this.textarea.blur()},lr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},lr.prototype.receivedFocus=function(){this.slowPoll()},lr.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()})},lr.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)},lr.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||ft(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(H&&W>=9&&this.hasSelection===n||u&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var C=n.charCodeAt(0);if(C==8203&&!r&&(r="\u200B"),C==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 Hr(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},lr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},lr.prototype.onKeyPress=function(){H&&W>=9&&(this.hasSelection=null),this.fastPoll()},lr.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var C=Bi(i,e),N=r.scroller.scrollTop;if(!C||w)return;var K=i.options.resetSelectionOnContextMenu;K&&i.doc.sel.contains(C)==-1&&vr(i,Dr)(i.doc,Ti(C),xe);var X=n.style.cssText,q=t.wrapper.style.cssText,oe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-oe.top-5)+"px; left: "+(e.clientX-oe.left-5)+`px;
|
|
z-index: 1000; background: `+(H?"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 He=i.somethingSelected(),Ye="\u200B"+(He?n.value:"");n.value="\u21DA",n.value=Ye,t.prevInput=He?"":"\u200B",n.selectionStart=1,n.selectionEnd=Ye.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=X,H&&W<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=N),n.selectionStart!=null){(!H||H&&W<9)&&be();var He=0,Ye=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?vr(i,Qo)(i):He++<10?r.detectingSelectAll=setTimeout(Ye,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Ye,200)}}if(H&&W>=9&&be(),R){le(e);var ke=function(){ot(window,"mouseup",ke),setTimeout(ye,20)};Ae(window,"mouseup",ke)}else setTimeout(ye,50)},lr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},lr.prototype.setUneditable=function(){},lr.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&&(Ae(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var C=e.form;n=C.submit;try{var N=C.submit=function(){r(),C.submit=n,C.submit(),C.submit=N}}catch(X){}}t.finishInit=function(X){X.save=r,X.getTextArea=function(){return e},X.toTextArea=function(){X.toTextArea=isNaN,r(),e.parentNode.removeChild(X.getWrapperElement()),e.style.display="",e.form&&(ot(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var K=rr(function(X){return e.parentNode.insertBefore(X,e.nextSibling)},t);return K}function nu(e){e.off=ot,e.on=Ae,e.wheelEventPixels=hl,e.Doc=Br,e.splitLines=At,e.countColumn=ee,e.findColumn=Se,e.isWordChar=Ue,e.Pass=Me,e.signal=we,e.Line=Oi,e.changeEnd=wi,e.scrollbarModel=So,e.Pos=Ge,e.cmpPos=Dt,e.modes=It,e.mimeModes=xt,e.resolveMode=lt,e.getMode=$t,e.modeExtensions=ar,e.extendMode=ir,e.copyState=Mr,e.startState=Xt,e.innerMode=ti,e.commands=_n,e.keyMap=ci,e.keyName=us,e.isModifierKey=ss,e.lookupKey=an,e.normalizeKeyMap=Ol,e.StringStream=yt,e.SharedTextMarker=Mn,e.TextMarker=Ri,e.LineWidget=In,e.e_preventDefault=te,e.e_stopPropagation=re,e.e_stop=le,e.addClass=G,e.contains=E,e.rmClass=f,e.keyNames=Li}Yl(rr),$l(rr);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Br.prototype)Br.prototype.hasOwnProperty(la)&&ce(au,la)<0&&(rr.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Br.prototype[la]));return fe(Br),rr.inputStyles={textarea:lr,contenteditable:Jt},rr.defineMode=function(e){!rr.defaults.mode&&e!="null"&&(rr.defaults.mode=e),Mt.apply(this,arguments)},rr.defineMIME=jt,rr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),rr.defineMIME("text/plain","null"),rr.defineExtension=function(e,t){rr.prototype[e]=t},rr.defineDocExtension=function(e,t){Br.prototype[e]=t},rr.fromTextArea=iu,nu(rr),rr.version="5.58.2",rr})},W6BS:function(Pe,Le){Pe.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/YIAivrJgjTKA9BKcY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5OrrMeHzIjck+2eiA65OYdrjOPace5NzOw/hO10zW5ZDm27VDUxdLnMtwOctSk+NqtYDNzU3W1tfpdbvm2pc6bgE0u7IvsRUs56M4Yj6dmfJrOhwyGE8YjkaMxkNmszlpLDGbkeUx02RAlC2Y5UeUSZ+pdYyaz1k4Y9OdhE4D5dVoB6dZWbuLlneaXm2DPC1NR5BGCbF0CWVJEAQ0GnXanTb1sE69Xmdzc4uNjQ1ardZy4+dlN3fNF6+4R/9SP5eHJ0nMYhEh8TscDun3+0aoJuMJi8WCJMnRZgRZkJOR5FMKvWBz/QyN2gqqsEjTBE1q7iU5znZsfN83i2+32zSbTXq9HisrK6yurtJoNH4ympf49rYAvhzL1b5JSZqmZqGTyZT+4Jj+cd+4+mg4Yh7F5Kk0xqK4Jb7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(Pe,Le,Z){Pe.exports=Z.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Pe,Le,Z){"use strict";Z.r(Le),Z.d(Le,"ResizableTextArea",function(){return ce});var ie=Z("wx14"),Y=Z("1OyB"),L=Z("vuIU"),Q=Z("Ji7U"),B=Z("LK+K"),_=Z("q1tI"),H=Z("VTBJ"),W=Z("rePB"),O=Z("Zm9Q"),M=Z("Kwbf"),y=Z("c+Xe"),w=Z("m+aA"),k=Z("bdgK"),D=new Map;function T(xe){xe.forEach(function(Ee){var Te,Se=Ee.target;(Te=D.get(Se))===null||Te===void 0||Te.forEach(function(me){return me(Se)})})}var S=new k.default(T),h=null,o=null;function u(xe,Ee){D.has(xe)||(D.set(xe,new Set),S.observe(xe)),D.get(xe).add(Ee)}function d(xe,Ee){D.has(xe)&&(D.get(xe).delete(Ee),D.get(xe).size||(S.unobserve(xe),D.delete(xe)))}var A=function(xe){Object(Q.a)(Te,xe);var Ee=Object(B.a)(Te);function Te(){return Object(Y.a)(this,Te),Ee.apply(this,arguments)}return Object(L.a)(Te,[{key:"render",value:function(){return this.props.children}}]),Te}(_.Component),v=_.createContext(null);function m(xe){var Ee=xe.children,Te=xe.onBatchResize,Se=_.useRef(0),me=_.useRef([]),se=_.useContext(v),Re=_.useCallback(function(Ve,We,Je){Se.current+=1;var Ze=Se.current;me.current.push({size:Ve,element:We,data:Je}),Promise.resolve().then(function(){Ze===Se.current&&(Te==null||Te(me.current),me.current=[])}),se==null||se(Ve,We,Je)},[Te,se]);return _.createElement(v.Provider,{value:Re},Ee)}function R(xe){var Ee=xe.children,Te=xe.disabled,Se=_.useRef(null),me=_.useRef(null),se=_.useContext(v),Re=_.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ve=_.isValidElement(Ee)&&Object(y.c)(Ee),We=Ve?Ee.ref:null,Je=_.useMemo(function(){return Object(y.a)(We,Se)},[We,Se]),Ze=_.useRef(xe);Ze.current=xe;var De=_.useCallback(function(Ue){var Be=Ze.current,qe=Be.onResize,Qe=Be.data,Ie=Ue.getBoundingClientRect(),Ne=Ie.width,$e=Ie.height,et=Ue.offsetWidth,Xe=Ue.offsetHeight,Ke=Math.floor(Ne),ct=Math.floor($e);if(Re.current.width!==Ke||Re.current.height!==ct||Re.current.offsetWidth!==et||Re.current.offsetHeight!==Xe){var rt={width:Ke,height:ct,offsetWidth:et,offsetHeight:Xe};Re.current=rt;var at=et===Math.round(Ne)?Ne:et,Ae=Xe===Math.round($e)?$e:Xe,dt=Object(H.a)(Object(H.a)({},rt),{},{offsetWidth:at,offsetHeight:Ae});se==null||se(dt,Ue,Qe),qe&&Promise.resolve().then(function(){qe(dt,Ue)})}},[]);return _.useEffect(function(){var Ue=Object(w.a)(Se.current)||Object(w.a)(me.current);return Ue&&!Te&&u(Ue,De),function(){return d(Ue,De)}},[Se.current,Te]),_.createElement(A,{ref:me},Ve?_.cloneElement(Ee,{ref:Je}):Ee)}var x="rc-observer-key";function f(xe){var Ee=xe.children,Te=Object(O.a)(Ee);return Te.map(function(Se,me){var se=(Se==null?void 0:Se.key)||"".concat(x,"-").concat(me);return _.createElement(R,Object(ie.a)({},xe,{key:se}),Se)})}f.Collection=m;var c=f,s=Z("bT9E"),a=Z("TSYQ"),b=Z.n(a),g=`
|
|
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
|
|
`,E=["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={},G;function V(xe){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Ee&&P[Te])return P[Te];var Se=window.getComputedStyle(xe),me=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")),Re=parseFloat(Se.getPropertyValue("border-bottom-width"))+parseFloat(Se.getPropertyValue("border-top-width")),Ve=E.map(function(Je){return"".concat(Je,":").concat(Se.getPropertyValue(Je))}).join(";"),We={sizingStyle:Ve,paddingSize:se,borderSize:Re,boxSizing:me};return Ee&&Te&&(P[Te]=We),We}function $(xe){var Ee=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;G||(G=document.createElement("textarea"),G.setAttribute("tab-index","-1"),G.setAttribute("aria-hidden","true"),document.body.appendChild(G)),xe.getAttribute("wrap")?G.setAttribute("wrap",xe.getAttribute("wrap")):G.removeAttribute("wrap");var me=V(xe,Ee),se=me.paddingSize,Re=me.borderSize,Ve=me.boxSizing,We=me.sizingStyle;G.setAttribute("style","".concat(We,";").concat(g)),G.value=xe.value||xe.placeholder||"";var Je=Number.MIN_SAFE_INTEGER,Ze=Number.MAX_SAFE_INTEGER,De=G.scrollHeight,Ue;if(Ve==="border-box"?De+=Re:Ve==="content-box"&&(De-=se),Te!==null||Se!==null){G.value=" ";var Be=G.scrollHeight-se;Te!==null&&(Je=Be*Te,Ve==="border-box"&&(Je=Je+se+Re),De=Math.max(Je,De)),Se!==null&&(Ze=Be*Se,Ve==="border-box"&&(Ze=Ze+se+Re),Ue=De>Ze?"":"hidden",De=Math.min(Ze,De))}return{height:De,minHeight:Je,maxHeight:Ze,overflowY:Ue,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 ae=function(xe){Object(Q.a)(Te,xe);var Ee=Object(B.a)(Te);function Te(Se){var me;return Object(Y.a)(this,Te),me=Ee.call(this,Se),me.nextFrameActionId=void 0,me.resizeFrameId=void 0,me.textArea=void 0,me.saveTextArea=function(se){me.textArea=se},me.handleResize=function(se){var Re=me.state.resizeStatus,Ve=me.props,We=Ve.autoSize,Je=Ve.onResize;if(Re!==ee.NONE)return;typeof Je=="function"&&Je(se),We&&me.resizeOnNextFrame()},me.resizeOnNextFrame=function(){cancelAnimationFrame(me.nextFrameActionId),me.nextFrameActionId=requestAnimationFrame(me.resizeTextarea)},me.resizeTextarea=function(){var se=me.props.autoSize;if(!se||!me.textArea)return;var Re=se.minRows,Ve=se.maxRows,We=$(me.textArea,!1,Re,Ve);me.setState({textareaStyles:We,resizeStatus:ee.RESIZING},function(){cancelAnimationFrame(me.resizeFrameId),me.resizeFrameId=requestAnimationFrame(function(){me.setState({resizeStatus:ee.RESIZED},function(){me.resizeFrameId=requestAnimationFrame(function(){me.setState({resizeStatus:ee.NONE}),me.fixFirefoxAutoScroll()})})})})},me.renderTextArea=function(){var se=me.props,Re=se.prefixCls,Ve=Re===void 0?"rc-textarea":Re,We=se.autoSize,Je=se.onResize,Ze=se.className,De=se.disabled,Ue=me.state,Be=Ue.textareaStyles,qe=Ue.resizeStatus,Qe=Object(s.a)(me.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ie=b()(Ve,Ze,Object(W.a)({},"".concat(Ve,"-disabled"),De));"value"in Qe&&(Qe.value=Qe.value||"");var Ne=Object(H.a)(Object(H.a)(Object(H.a)({},me.props.style),Be),qe===ee.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return _.createElement(c,{onResize:me.handleResize,disabled:!(We||Je)},_.createElement("textarea",Object(ie.a)({},Qe,{className:Ie,style:Ne,ref:me.saveTextArea})))},me.state={textareaStyles:{},resizeStatus:ee.NONE},me}return Object(L.a)(Te,[{key:"componentDidUpdate",value:function(me){(me.value!==this.props.value||!F()(me.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 me=this.textArea.selectionStart,se=this.textArea.selectionEnd;this.textArea.setSelectionRange(me,se)}}catch(Re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Te}(_.Component),ce=ae,ve=function(xe){Object(Q.a)(Te,xe);var Ee=Object(B.a)(Te);function Te(Se){var me;Object(Y.a)(this,Te),me=Ee.call(this,Se),me.resizableTextArea=void 0,me.focus=function(){me.resizableTextArea.textArea.focus()},me.saveTextArea=function(Re){me.resizableTextArea=Re},me.handleChange=function(Re){var Ve=me.props.onChange;me.setValue(Re.target.value,function(){me.resizableTextArea.resizeTextarea()}),Ve&&Ve(Re)},me.handleKeyDown=function(Re){var Ve=me.props,We=Ve.onPressEnter,Je=Ve.onKeyDown;Re.keyCode===13&&We&&We(Re),Je&&Je(Re)};var se=typeof Se.value=="undefined"||Se.value===null?Se.defaultValue:Se.value;return me.state={value:se},me}return Object(L.a)(Te,[{key:"setValue",value:function(me,se){"value"in this.props||this.setState({value:me},se)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return _.createElement(ce,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(me){return"value"in me?{value:me.value}:null}}]),Te}(_.Component),Me=Le.default=ve},ZpRC:function(Pe,Le,Z){"use strict";function ie(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function Y(y,w){return(!w||y!=="hidden")&&y!=="visible"&&y!=="clip"}function L(y,w){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var k=getComputedStyle(y,null);return Y(k.overflowY,w)||Y(k.overflowX,w)||function(D){var T=function(S){if(!S.ownerDocument||!S.ownerDocument.defaultView)return null;try{return S.ownerDocument.defaultView.frameElement}catch(h){return null}}(D);return!!T&&(T.clientHeight<D.scrollHeight||T.clientWidth<D.scrollWidth)}(y)}return!1}function Q(y,w,k,D,T,S,h,o){return S<y&&h>w||S>y&&h<w?0:S<=y&&o<=k||h>=w&&o>=k?S-y-D:h>w&&o<k||S<y&&o>k?h-w+T:0}var B=function(y,w){var k=window,D=w.scrollMode,T=w.block,S=w.inline,h=w.boundary,o=w.skipOverflowHiddenElements,u=typeof h=="function"?h:function(Be){return Be!==h};if(!ie(y))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,A=[],v=y;ie(v)&&u(v);){if((v=v.parentElement)===d){A.push(v);break}v!=null&&v===document.body&&L(v)&&!L(document.documentElement)||v!=null&&L(v,o)&&A.push(v)}for(var m=k.visualViewport?k.visualViewport.width:innerWidth,R=k.visualViewport?k.visualViewport.height:innerHeight,x=window.scrollX||pageXOffset,f=window.scrollY||pageYOffset,c=y.getBoundingClientRect(),s=c.height,a=c.width,b=c.top,g=c.right,E=c.bottom,P=c.left,G=T==="start"||T==="nearest"?b:T==="end"?E:b+s/2,V=S==="center"?P+a/2:S==="end"?g:P,$=[],z=0;z<A.length;z++){var F=A[z],ee=F.getBoundingClientRect(),ae=ee.height,ce=ee.width,ve=ee.top,Me=ee.right,xe=ee.bottom,Ee=ee.left;if(D==="if-needed"&&b>=0&&P>=0&&E<=R&&g<=m&&b>=ve&&E<=xe&&P>=Ee&&g<=Me)return $;var Te=getComputedStyle(F),Se=parseInt(Te.borderLeftWidth,10),me=parseInt(Te.borderTopWidth,10),se=parseInt(Te.borderRightWidth,10),Re=parseInt(Te.borderBottomWidth,10),Ve=0,We=0,Je="offsetWidth"in F?F.offsetWidth-F.clientWidth-Se-se:0,Ze="offsetHeight"in F?F.offsetHeight-F.clientHeight-me-Re:0;if(d===F)Ve=T==="start"?G:T==="end"?G-R:T==="nearest"?Q(f,f+R,R,me,Re,f+G,f+G+s,s):G-R/2,We=S==="start"?V:S==="center"?V-m/2:S==="end"?V-m:Q(x,x+m,m,Se,se,x+V,x+V+a,a),Ve=Math.max(0,Ve+f),We=Math.max(0,We+x);else{Ve=T==="start"?G-ve-me:T==="end"?G-xe+Re+Ze:T==="nearest"?Q(ve,xe,ae,me,Re+Ze,G,G+s,s):G-(ve+ae/2)+Ze/2,We=S==="start"?V-Ee-Se:S==="center"?V-(Ee+ce/2)+Je/2:S==="end"?V-Me+se+Je:Q(Ee,Me,ce,Se,se+Je,V,V+a,a);var De=F.scrollLeft,Ue=F.scrollTop;G+=Ue-(Ve=Math.max(0,Math.min(Ue+Ve,F.scrollHeight-ae+Ze))),V+=De-(We=Math.max(0,Math.min(De+We,F.scrollWidth-ce+Je)))}$.push({el:F,top:Ve,left:We})}return $};function _(y){return y===Object(y)&&Object.keys(y).length!==0}function H(y,w){w===void 0&&(w="auto");var k="scrollBehavior"in document.body.style;y.forEach(function(D){var T=D.el,S=D.top,h=D.left;T.scroll&&k?T.scroll({top:S,left:h,behavior:w}):(T.scrollTop=S,T.scrollLeft=h)})}function W(y){return y===!1?{block:"end",inline:"nearest"}:_(y)?y:{block:"start",inline:"nearest"}}function O(y,w){var k=!y.ownerDocument.documentElement.contains(y);if(_(w)&&typeof w.behavior=="function")return w.behavior(k?[]:B(y,w));if(k)return;var D=W(w);return H(B(y,D),D.behavior)}var M=Le.a=O},bT9E:function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return Y});var ie=Z("VTBJ");function Y(L,Q){var B=Object(ie.a)({},L);return Array.isArray(Q)&&Q.forEach(function(_){delete B[_]}),B}},c5Ni:function(Pe,Le,Z){},cRFk:function(Pe,Le,Z){Pe.exports=Z.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Pe,Le,Z){Pe.exports=Z.p+"static/choose.4ad1045f.svg"},dejd:function(Pe,Le,Z){},djh8:function(Pe,Le,Z){Pe.exports=Z.p+"static/qrCode.d852fdfc.png"},dmUQ:function(Pe,Le,Z){"use strict";var ie=Z("Ff2n"),Y=Z("rePB"),L=Z("1OyB"),Q=Z("vuIU"),B=Z("Ji7U"),_=Z("md7G"),H=Z("foSv"),W=Z("q1tI"),O=Z.n(W),M=Z("TSYQ"),y=Z.n(M),w=Z("4IlW");function k(s,a){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(s);a&&(g=g.filter(function(E){return Object.getOwnPropertyDescriptor(s,E).enumerable})),b.push.apply(b,g)}return b}function D(s){for(var a=1;a<arguments.length;a++){var b=arguments[a]!=null?arguments[a]:{};a%2?k(Object(b),!0).forEach(function(g){Object(Y.a)(s,g,b[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):k(Object(b)).forEach(function(g){Object.defineProperty(s,g,Object.getOwnPropertyDescriptor(b,g))})}return s}function T(s){var a=S();return function(){var g=Object(H.a)(s),E;if(a){var P=Object(H.a)(this).constructor;E=Reflect.construct(g,arguments,P)}else E=g.apply(this,arguments);return Object(_.a)(this,E)}}function S(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function h(){}function o(s){s.preventDefault()}var u=function(a){return a.replace(/[^\w.-]+/g,"")},d=200,A=600,v=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,m=function(a){return a!=null},R=function(a,b){return b===a||typeof b=="number"&&typeof a=="number"&&isNaN(b)&&isNaN(a)},x=function(s){Object(B.a)(b,s);var a=T(b);function b(g){var E;Object(L.a)(this,b),E=a.call(this,g),E.onKeyDown=function(V){var $=E.props,z=$.onKeyDown,F=$.onPressEnter;if(V.keyCode===w.a.UP){var ee=E.getRatio(V);E.up(V,ee,null),E.stop()}else if(V.keyCode===w.a.DOWN){var ae=E.getRatio(V);E.down(V,ae,null),E.stop()}else V.keyCode===w.a.ENTER&&F&&F(V);if(E.recordCursorPosition(),E.lastKeyCode=V.keyCode,z){for(var ce=arguments.length,ve=new Array(ce>1?ce-1:0),Me=1;Me<ce;Me++)ve[Me-1]=arguments[Me];z.apply(void 0,[V].concat(ve))}},E.onKeyUp=function(V){var $=E.props.onKeyUp;if(E.stop(),E.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))}},E.onChange=function(V){var $=E.props.onChange;E.state.focused&&(E.inputting=!0),E.rawInput=E.props.parser(E.getValueFromEvent(V)),E.setState({inputValue:E.rawInput}),$(E.toNumber(E.rawInput))},E.onMouseUp=function(){var V=E.props.onMouseUp;E.recordCursorPosition(),V&&V.apply(void 0,arguments)},E.onFocus=function(){var V;E.setState({focused:!0}),(V=E.props).onFocus.apply(V,arguments)},E.onBlur=function(){var V=E.props.onBlur;E.inputting=!1,E.setState({focused:!1});var $=E.getCurrentValidValue(E.state.inputValue),z=E.setValue($,h);if(V){var F=E.input.value,ee=E.getInputDisplayValue({focus:!1,value:z});E.input.value=ee&&Number(ee),V.apply(void 0,arguments),E.input.value=F}},E.getRatio=function(V){var $=1;return V.metaKey||V.ctrlKey?$=.1:V.shiftKey&&($=10),$},E.getFullNum=function(V){return isNaN(V)?V:/e/i.test(String(V))?Number(V).toFixed(18).replace(/\.?0+$/,""):V},E.getPrecision=function(V){if(m(E.props.precision))return E.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},E.getInputDisplayValue=function(V){var $=V||E.state,z=$.focused,F=$.inputValue,ee=$.value,ae;z?ae=F:ae=E.toPrecisionAsStep(ee),ae==null&&(ae="");var ce=E.formatWrapper(ae);return m(E.props.decimalSeparator)&&(ce=ce.toString().replace(".",E.props.decimalSeparator)),ce},E.recordCursorPosition=function(){try{E.cursorStart=E.input.selectionStart,E.cursorEnd=E.input.selectionEnd,E.currentValue=E.input.value,E.cursorBefore=E.input.value.substring(0,E.cursorStart),E.cursorAfter=E.input.value.substring(E.cursorEnd)}catch(V){}},E.restoreByAfter=function(V){if(V===void 0)return!1;var $=E.input.value,z=$.lastIndexOf(V);if(z===-1)return!1;var F=E.cursorBefore.length;return E.lastKeyCode===w.a.DELETE&&E.cursorBefore.charAt(F-1)===V[0]?(E.fixCaret(F,F),!0):z+V.length===$.length?(E.fixCaret(z,z),!0):!1},E.partRestoreByAfter=function(V){return V===void 0?!1:Array.prototype.some.call(V,function($,z){var F=V.substring(z);return E.restoreByAfter(F)})},E.isNotCompleteNumber=function(V){return isNaN(V)||V===""||V===null||V&&V.toString().indexOf(".")===V.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(V,$,z){E.pressingUpOrDown=!0,E.step("down",V,$,z)},E.up=function(V,$,z){E.pressingUpOrDown=!0,E.step("up",V,$,z)},E.saveInput=function(V){E.input=V};var P=g.value;P===void 0&&(P=g.defaultValue),E.state={focused:g.autoFocus};var G=E.getValidValue(E.toNumber(P));return E.state=D(D({},E.state),{},{inputValue:E.toPrecisionAsStep(G),value:G}),E}return Object(Q.a)(b,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(E){var P=this.props,G=P.value,V=P.onChange,$=P.max,z=P.min,F=this.state.focused;if(E){if(!R(E.value,G)||!R(E.max,$)||!R(E.min,z)){var ee=F?G:this.getValidValue(G),ae;this.pressingUpOrDown?ae=ee:this.inputting?ae=this.rawInput:ae=this.toPrecisionAsStep(ee),this.setState({value:ee,inputValue:ae})}var ce="value"in this.props?G:this.state.value;"max"in this.props&&E.max!==$&&typeof ce=="number"&&ce>$&&V&&V($),"min"in this.props&&E.min!==z&&typeof ce=="number"&&ce<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===w.a.BACKSPACE?ve=this.cursorStart-1:this.lastKeyCode===w.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 w.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case w.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Me){}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(E){var P=E;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(E){var P=E.target.value.trim().replace(/。/g,".");return m(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,V=parseFloat(E);return isNaN(V)?E:(V<P&&(V=P),V>G&&(V=G),V)}},{key:"setValue",value:function(E,P){var G=this.props.precision,V=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),$=this.state.value,z=$===void 0?null:$,F=this.state.inputValue,ee=F===void 0?null:F,ae=typeof V=="number"?V.toFixed(G):"".concat(V),ce=V!==z||ae!=="".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(E)},P),ce&&this.props.onChange(V),V}},{key:"getMaxPrecision",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,G=this.props,V=G.precision,$=G.step;if(m(V))return V;var z=this.getPrecision(P),F=this.getPrecision($),ee=this.getPrecision(E);return E?Math.max(ee,z+F):z+F}},{key:"getPrecisionFactor",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,G=this.getMaxPrecision(E,P);return Math.pow(10,G)}},{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(E){return this.props.formatter?this.props.formatter(E):E}},{key:"toPrecisionAsStep",value:function(E){if(this.isNotCompleteNumber(E)||E==="")return E;var P=Math.abs(this.getMaxPrecision(E));return isNaN(P)?E.toString():Number(E).toFixed(P)}},{key:"toNumber",value:function(E){var P=this.props.precision,G=this.state.focused,V=E&&E.length>16&&G;return this.isNotCompleteNumber(E)||V?E:m(P)?Math.round(E*Math.pow(10,P))/Math.pow(10,P):Number(E)}},{key:"upStep",value:function(E,P){var G=this.props.step,V=this.getPrecisionFactor(E,P),$=Math.abs(this.getMaxPrecision(E,P)),z=((V*E+V*G*P)/V).toFixed($);return this.toNumber(z)}},{key:"downStep",value:function(E,P){var G=this.props.step,V=this.getPrecisionFactor(E,P),$=Math.abs(this.getMaxPrecision(E,P)),z=((V*E-V*G*P)/V).toFixed($);return this.toNumber(z)}},{key:"step",value:function(E,P){var G=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(E,"Step")](F,V),ae=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(){G.pressingUpOrDown=!1}),ae)return;this.autoStepTimer=setTimeout(function(){G[E](P,V,!0)},$?d:A)}},{key:"fixCaret",value:function(E,P){if(E===void 0||P===void 0||!this.input||!this.input.value)return;try{var G=this.input.selectionStart,V=this.input.selectionEnd;(E!==G||P!==V)&&this.input.setSelectionRange(E,P)}catch($){}}},{key:"render",value:function(){var E,P=this.props,G=P.prefixCls,V=P.disabled,$=P.readOnly,z=P.useTouch,F=P.autoComplete,ee=P.upHandler,ae=P.downHandler,ce=P.className,ve=P.max,Me=P.min,xe=P.style,Ee=P.title,Te=P.onMouseEnter,Se=P.onMouseLeave,me=P.onMouseOver,se=P.onMouseOut,Re=P.required,Ve=P.onClick,We=P.tabIndex,Je=P.type,Ze=P.placeholder,De=P.id,Ue=P.inputMode,Be=P.pattern,qe=P.step,Qe=P.maxLength,Ie=P.autoFocus,Ne=P.name,$e=P.onPaste,et=P.onInput,Xe=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"]),Ke=this.state,ct=Ke.value,rt=Ke.focused,at=y()(G,(E={},Object(Y.a)(E,ce,!!ce),Object(Y.a)(E,"".concat(G,"-disabled"),V),Object(Y.a)(E,"".concat(G,"-focused"),rt),E)),Ae={};Object.keys(Xe).forEach(function(le){(le.substr(0,5)==="data-"||le.substr(0,5)==="aria-"||le==="role")&&(Ae[le]=Xe[le])});var dt=!$&&!V,ot=this.getInputDisplayValue(null),we=(ct||ct===0)&&(isNaN(ct)||Number(ct)>=ve),Fe=(ct||ct===0)&&(isNaN(ct)||Number(ct)<=Me),ge=we||V||$,de=Fe||V||$,fe=y()("".concat(G,"-handler"),"".concat(G,"-handler-up"),Object(Y.a)({},"".concat(G,"-handler-up-disabled"),ge)),te=y()("".concat(G,"-handler"),"".concat(G,"-handler-down"),Object(Y.a)({},"".concat(G,"-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:at,style:xe,title:Ee,onMouseEnter:Te,onMouseLeave:Se,onMouseOver:me,onMouseOut:se,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(G,"-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(G,"-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}),ae||O.a.createElement("span",{unselectable:"on",className:"".concat(G,"-handler-down-inner"),onClick:o}))),O.a.createElement("div",{className:"".concat(G,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Me,"aria-valuemax":ve,"aria-valuenow":ct,required:Re,type:Je,placeholder:Ze,onPaste:$e,onClick:Ve,onMouseUp:this.onMouseUp,className:"".concat(G,"-input"),tabIndex:We,autoComplete:F,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:dt?this.onKeyDown:h,onKeyUp:dt?this.onKeyUp:h,autoFocus:Ie,maxLength:Qe,readOnly:$,disabled:V,max:ve,min:Me,step:qe,name:Ne,title:Ee,id:De,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ot),pattern:Be,inputMode:Ue,onInput:et},Ae))))}}]),b}(O.a.Component);x.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:h,onKeyDown:h,onPressEnter:h,onFocus:h,onBlur:h,parser:u,required:!1,autoComplete:"off"};var f=x,c=Le.a=f},is8o:function(Pe,Le,Z){Pe.exports={flex_box_center:"flex_box_center___45jij",flex_space_between:"flex_space_between___2rBtS",flex_box_vertical_center:"flex_box_vertical_center___B3dEI",flex_box_center_end:"flex_box_center_end___1hlbx",flex_box_column:"flex_box_column___n3oa5",wrap:"wrap___2Ebga",modal:"modal___37ZgF",titleWrap:"titleWrap___dEwT4",required:"required___4a1a5",title:"title___1MHB3",colorGray:"colorGray___1tQ38",choiceWrap:"choiceWrap___2Ik_w",answer:"answer___3N5FQ",activeAnswer:"activeAnswer___3zdHK",deleteIcon:"deleteIcon___U7nIS",addIcon:"addIcon___2tuSF",editorWrap:"editorWrap___ZOK2K",htmlWrap:"htmlWrap___3X_dl",radio:"radio___wS7N0",color333:"color333___S1zDX",color999:"color999___VJwGv",questionType:"questionType___BHDve",questionChoices:"questionChoices___3YAfc"}},ji0R:function(Pe,Le,Z){Pe.exports=Z.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Pe,Le,Z){Pe.exports=Z.p+"static/question.cb52bef9.gif"},kPYp:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUG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VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(Pe,Le,Z){},kvPc:function(Pe,Le,Z){"use strict";Z.r(Le);var ie=Z("5Dmo"),Y=Z("3S7+"),L=Z("P2fV"),Q=Z("NJEC"),B=Z("14J3"),_=Z("BMrR"),H=Z("jCWc"),W=Z("kPKH"),O=Z("OaEy"),M=Z("2fM7"),y=Z("7Kak"),w=Z("9yH6"),k=Z("+L6B"),D=Z("2/Rp"),T=Z("5NDa"),S=Z("5rEg"),h=Z("miYZ"),o=Z("tsqr"),u=Z("k1fw"),d=Z("9og8"),A=Z("y8nQ"),v=Z("Vl3Y"),m=Z("tJVT"),R=Z("PpiC"),x=Z("WmNS"),f=Z.n(x),c=Z("q1tI"),s=Z.n(c),a=Z("9kvl"),b=Z("Ot1p"),g=Z("HBuW"),E=Z("oBTY"),P=Z("2qtc"),G=Z("kLXV"),V=Z("Ty5D"),$=Z("V0Rq"),z=Z("9Bee"),F=Z("is8o"),ee=Z.n(F),ae=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ce=function(We,Je){var Ze=We.problemset,De=We.globalSetting,Ue=We.loading,Be=We.dispatch,qe=We.onRef,Qe=qe===void 0?function(){}:qe,Ie=We.editData,Ne=Object(R.a)(We,["problemset","globalSetting","loading","dispatch","onRef","editData"]),$e=Object(c.useState)([]),et=Object(m.a)($e,2),Xe=et[0],Ke=et[1],ct=Object(c.useState)(),rt=Object(m.a)(ct,2),at=rt[0],Ae=rt[1],dt=Object(c.useState)([]),ot=Object(m.a)(dt,2),we=ot[0],Fe=ot[1],ge=Object(c.useState)(""),de=Object(m.a)(ge,2),fe=de[0],te=de[1],re=Object(c.useState)(5),ne=Object(m.a)(re,2),le=ne[0],pe=ne[1],Ce=Object(c.useState)(!1),Oe=Object(m.a)(Ce,2),st=Oe[0],mt=Oe[1],ht=Object(V.i)();Object(c.useEffect)(function(){Ke(["","","",""])},[]),Object(c.useEffect)(function(){var Ht,It;if(!(Ie!=null&&Ie.challenge_id)){mt(!0);return}te(Ie==null?void 0:Ie.subject),pe(parseInt(Ie==null?void 0:Ie.question_score)),Ke(Ie==null||((Ht=Ie.choose_contents)===null||Ht===void 0)?void 0:Ht.map(function(Mt){return Mt.option_name}));var xt=[];Ie==null||((It=Ie.standard_answer)===null||It===void 0)||It.split("").map(function(Mt,jt){xt.push(ae.indexOf(Mt))}),Fe(xt)},[Ie]),Object(c.useImperativeHandle)(Je,function(){return{onSave:At,onReset:Rt,isEdit:st}});var Rt=function(){Ke(["","","",""]),te(""),Fe([])},At=function(){var Ht=Object(d.a)(f.a.mark(function It(){var xt,Mt;return f.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(fe){lt.next=3;break}return o.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),lt.abrupt("return",!1);case 3:if(xt=Xe.findIndex(function($t){return!$t}),!(xt>-1)){lt.next=7;break}return o.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ae[xt]," \u9009\u9879\u7684\u5185\u5BB9")),lt.abrupt("return",!1);case 7:if(we.length){lt.next=10;break}return o.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),lt.abrupt("return",!1);case 10:if(!(we.length<1)){lt.next=13;break}return o.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),lt.abrupt("return",!1);case 13:return Mt=Xe.map(function($t,ar){return{choice_text:$t,is_answer:!!we.includes(ar)}}),lt.abrupt("return",{subject:fe,question:{cnt:Mt.map(function($t){return $t.choice_text})},choice:{answer:Mt.map(function($t){return $t.is_answer})}});case 15:case"end":return lt.stop()}},It)}));return function(){return Ht.apply(this,arguments)}}(),ft=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Ft=function(){var Ht=Object(d.a)(f.a.mark(function It(xt){return f.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:jt.t0=xt.id,jt.next=jt.t0==="del"?3:jt.t0==="up"||jt.t0==="down"?5:jt.t0==="edit"?9:11;break;case 3:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(d.a)(f.a.mark(function $t(){return f.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:return ir.next=2,Object($.n)({id:Ie.question_id});case 2:Be({type:"exercise/editExercise",payload:Object(u.a)({},ht)});case 3:case"end":return ir.stop()}},$t)}))()}}),jt.abrupt("break",11);case 5:return jt.next=7,Be({type:"exercise/exeriseMoveUpDown",payload:{id:Ie.question_id,opr:xt.id}});case 7:return Be({type:"exercise/editExercise",payload:Object(u.a)({},ht)}),jt.abrupt("break",11);case 9:return mt(!0),jt.abrupt("break",11);case 11:case"end":return jt.stop()}},It)}));return function(xt){return Ht.apply(this,arguments)}}(),kt=function(){var It;return s.a.createElement("aside",null,s.a.createElement("p",{className:ee.a.titleWrap},s.a.createElement("span",{className:ee.a.required},"*"),s.a.createElement("span",{className:ee.a.title},"\u9898\u5E72\uFF1A")),s.a.createElement(b.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:fe,onChange:function(Mt){return te(Mt)}}),s.a.createElement("p",{className:ee.a.titleWrap},s.a.createElement("span",{className:ee.a.required},"*"),s.a.createElement("span",{className:ee.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",s.a.createElement("span",{className:ee.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Xe.map(function(xt,Mt){return s.a.createElement("div",{className:ee.a.choiceWrap,key:Mt},s.a.createElement(Y.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},s.a.createElement("div",{className:"".concat(ee.a.answer," ").concat(we.includes(Mt)?ee.a.activeAnswer:""),onClick:function(){we.includes(Mt)?Fe(we.filter(function(lt){return lt!==Mt})):Fe([].concat(Object(E.a)(we),[Mt]))}},ae[Mt])),s.a.createElement("div",{className:ee.a.editorWrap},at===Mt?s.a.createElement(b.a,{id:"single-question-option-".concat(Mt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:xt,onChange:function(lt){Xe[Mt]=lt,Ke(Xe)}}):s.a.createElement("div",{className:ee.a.htmlWrap,onClick:function(){return Ae(Mt)}},s.a.createElement(z.a,{value:xt}))),Mt>1&&s.a.createElement(Y.a,{title:"\u5220\u9664"},s.a.createElement("i",{className:"".concat(ee.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Ke(Xe.filter(function(lt,$t){return $t!==Mt}))}})),Mt<7&&Mt===Xe.length-1&&s.a.createElement(Y.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},s.a.createElement("i",{className:"".concat(ee.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Ke([].concat(Object(E.a)(Xe),[""]))}})))}),s.a.createElement(_.a,{className:"mt10"},s.a.createElement(W.a,{flex:"1"},s.a.createElement("p",{className:"c-grey-999"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898")),s.a.createElement(W.a,null,"\u6807\u51C6\u7B54\u6848\uFF1A",s.a.createElement("span",{className:"c-orange"},we==null||((It=we.sort(function(xt,Mt){return xt-Mt}))===null||It===void 0)?void 0:It.map(function(xt){return ae[xt]})))))};return s.a.createElement("section",{className:ee.a.wrap},kt())},ve=Object(a.a)(function(Ve){var We=Ve.problemset,Je=Ve.loading,Ze=Ve.globalSetting;return{problemset:We,globalSetting:Ze,loading:Je.effects}},null,null,{forwardRef:!0})(Object(c.forwardRef)(ce)),Me=Z("1vsH"),xe=Z("zEei"),Ee=Z.n(xe),Te=Z("CJF0"),Se=Z("2RCv"),me={1:[10,20],2:[30,40,50,60],3:[70,80,90,100]},se=function(We){var Je,Ze=We.shixunsDetail,De=We.dispatch,Ue=We.loading,Be=We.match,qe=We.location,Qe=Object(R.a)(We,["shixunsDetail","dispatch","loading","match","location"]),Ie=v.a.useForm(),Ne=Object(m.a)(Ie,1),$e=Ne[0],et=Object(c.useState)({}),Xe=Object(m.a)(et,2),Ke=Xe[0],ct=Xe[1],rt=Object(c.useState)(!1),at=Object(m.a)(rt,2),Ae=at[0],dt=at[1],ot=Object(c.useState)(!0),we=Object(m.a)(ot,2),Fe=we[0],ge=we[1],de=Object(c.useState)(),fe=Object(m.a)(de,2),te=fe[0],re=fe[1],ne=Object(c.useState)([10,20]),le=Object(m.a)(ne,2),pe=le[0],Ce=le[1],Oe=Object(c.useState)(!1),st=Object(m.a)(Oe,2),mt=st[0],ht=st[1],Rt=Object(c.useState)({}),At=Object(m.a)(Rt,2),ft=At[0],Ft=At[1],kt=Ze.challengesEdit,Ht=Ze.editChallengesQuestion,It=Object(c.useRef)(),xt=function(){var Xt=Object(d.a)(f.a.mark(function yt(){var ze;return f.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,De({type:"shixunsDetail/getChallengesEdit",payload:Object(u.a)({},Be.params)});case 2:ze=wt.sent,$e.setFieldsValue(Object(u.a)({},ze));case 4:case"end":return wt.stop()}},yt)}));return function(){return Xt.apply(this,arguments)}}(),Mt=function(){var Xt=Object(d.a)(f.a.mark(function yt(){var ze;return f.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!Be.params.questionId){wt.next=7;break}return wt.next=3,De({type:"shixunsDetail/getEditChallengesQuestion",payload:Object(u.a)({},Be.params)});case 3:ze=wt.sent,$e.setFieldsValue({challenge_tag:ze.tags,difficult:ze.difficult,score:ze.score,answer:ze.answer}),Ce(me[ze.difficult]),Ft(ze);case 7:case"end":return wt.stop()}},yt)}));return function(){return Xt.apply(this,arguments)}}();Object(c.useEffect)(function(){xt(),Be.params.questionId&&(re(!0),Mt(),dt(!0))},[qe.pathname]);var jt=function(){var Xt=Object(d.a)(f.a.mark(function yt(){var ze,Kt,wt,tr;return f.a.wrap(function(ur){for(;;)switch(ur.prev=ur.next){case 0:return Kt="",wt=Object(u.a)({},Ke),ur.next=4,It.current.onSave();case 4:return tr=ur.sent,(ze=tr.choice)===null||ze===void 0||ze.answer.map(function(bt,ri){bt&&(Kt+=Me.o[ri])}),ur.abrupt("return",{challenge_choose:{subject:tr.subject,answer:Ke.task_pass,standard_answer:Kt,score:Ke.score,difficult:Ke.difficult},challenge_tag:Ke.challenge_tag,question:tr.question,choice:tr.choice});case 7:case"end":return ur.stop()}},yt)}));return function(){return Xt.apply(this,arguments)}}(),lt=function(yt){var ze=me[yt],Kt=ze==null?void 0:ze[0];Ce(ze),$e.setFieldsValue({score:Kt}),ct(Object(u.a)(Object(u.a)({},$e.getFieldsValue()),{score:Kt}))},$t=function(yt,ze){ct(Object(u.a)({},$e.getFieldsValue())),"difficult"in yt&<(yt.difficult)},ar=function(){var Xt=Object(d.a)(f.a.mark(function yt(){var ze;return f.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.t0=g.w,wt.t1=u.a,wt.t2=u.a,wt.t3={},wt.next=6,jt();case 6:return wt.t4=wt.sent,wt.t5=(0,wt.t2)(wt.t3,wt.t4),wt.t6=Be.params,wt.t7=(0,wt.t1)(wt.t5,wt.t6),wt.next=12,(0,wt.t0)(wt.t7);case 12:ze=wt.sent,(ze==null?void 0:ze.status)===1&&o.b.success("\u5220\u9664\u6210\u529F"),Qe.history.replace("/shixuns/".concat(Be.params.id,"/challenges/").concat(Be.params.challengesId,"/editquestion"));case 15:case"end":return wt.stop()}},yt)}));return function(){return Xt.apply(this,arguments)}}(),ir=function(){var Xt=Object(d.a)(f.a.mark(function yt(ze){var Kt,wt,tr,Ot;return f.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:if(Kt=Object(u.a)({},Ke),ht(!0),Fe){bt.next=20;break}return bt.t0=g.c,bt.t1=u.a,bt.t2=u.a,bt.t3={},bt.next=9,jt();case 9:return bt.t4=bt.sent,bt.t5=(0,bt.t2)(bt.t3,bt.t4),bt.t6=Be.params,bt.t7=(0,bt.t1)(bt.t5,bt.t6),bt.next=15,(0,bt.t0)(bt.t7);case 15:wt=bt.sent,ht(!1),wt.challenge_choose_id&&(o.b.success("\u64CD\u4F5C\u6210\u529F"),Qe.history.replace("/shixuns/".concat(Be.params.id,"/challenges/").concat(Be.params.challengesId,"/editquestion/").concat(wt.challenge_choose_id))),bt.next=45;break;case 20:if(!Be.params.questionId){bt.next=38;break}return bt.t8=g.Nb,bt.t9=u.a,bt.t10=u.a,bt.t11={},bt.next=27,jt();case 27:return bt.t12=bt.sent,bt.t13=(0,bt.t10)(bt.t11,bt.t12),bt.t14=Be.params,bt.t15=(0,bt.t9)(bt.t13,bt.t14),bt.next=33,(0,bt.t8)(bt.t15);case 33:tr=bt.sent,ht(!1),tr.challenge_choose_id&&o.b.success("\u64CD\u4F5C\u6210\u529F"),bt.next=45;break;case 38:return Kt.identifier=Be.params.id,Kt.st=1,bt.next=42,Object(g.Mb)(Object(u.a)(Object(u.a)({},Kt),Be.params));case 42:Ot=bt.sent,ht(!1),Ot.challenge_id&&o.b.success("\u64CD\u4F5C\u6210\u529F");case 45:case"end":return bt.stop()}},yt)}));return function(ze){return Xt.apply(this,arguments)}}(),Mr=function(){var yt;return s.a.createElement("div",null,s.a.createElement("div",{className:Ee.a.fieldWrap},s.a.createElement(v.a.Item,{name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},s.a.createElement(S.a,{maxLength:60,suffix:"".concat(((yt=Ke.subject)===null||yt===void 0?void 0:yt.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),s.a.createElement("div",{className:Ee.a.mdWrap},s.a.createElement(v.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:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},s.a.createElement(b.a,{watch:!0,defaultValue:kt.task_pass}))),s.a.createElement("div",{className:Ee.a.backgroundFa},s.a.createElement("div",{className:"pt40 mb30"},s.a.createElement(v.a.Item,null,s.a.createElement(D.a,{size:"large",type:"primary",className:"".concat(Ee.a.button," mr20"),htmlType:"submit",loading:mt},"\u63D0\u4EA4"),s.a.createElement(D.a,{size:"large",type:"primary",ghost:!0,className:Ee.a.button,onClick:function(){return a.d.push("/shixuns/".concat(Be.params.id,"/challenges"))}},"\u53D6\u6D88")))))},ti=function(){var yt,ze;return s.a.createElement("div",null,s.a.createElement("div",{className:"bg-white"},s.a.createElement(ve,{ref:It,editData:ft})),s.a.createElement("div",{className:Ee.a.mdWrap},s.a.createElement(v.a.Item,{name:"task_pass",label:"\u53C2\u8003\u7B54\u6848:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},s.a.createElement(b.a,{watch:!0,defaultValue:Fe?Ht.answer:""})),s.a.createElement(v.a.Item,{name:"difficult",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},s.a.createElement(w.a.Group,{disabled:((yt=Ze.detail)===null||yt===void 0?void 0:yt.shixun_status)===2},s.a.createElement(w.a,{value:1},"\u7B80\u5355"),s.a.createElement(w.a,{value:2},"\u4E2D\u7B49"),s.a.createElement(w.a,{value:3},"\u56F0\u96BE"))),s.a.createElement(_.a,null,s.a.createElement(W.a,null,s.a.createElement(v.a.Item,{name:"score",label:"\u5956\u52B1\u7ECF\u9A8C\u503C:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},s.a.createElement(M.a,{disabled:((ze=Ze.detail)===null||ze===void 0?void 0:ze.shixun_status)===2},pe.map(function(Kt){return s.a.createElement(M.a.Option,{key:Kt,value:Kt},Kt)})))),s.a.createElement(W.a,{flex:1},s.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",s.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"))),s.a.createElement(v.a.Item,{name:"challenge_tag",label:s.a.createElement("div",null,"\u6280\u80FD\u6807\u7B7E"," ",s.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\u8F93\u5165\u6280\u80FD\u6807\u7B7E"}]},s.a.createElement(Se.a,{placeholder:"\u6DFB\u52A0\u6807\u7B7E"}))),s.a.createElement("div",{className:Ee.a.backgroundFa},s.a.createElement(_.a,{className:"pt40 mb30"},s.a.createElement(W.a,{flex:1},s.a.createElement(v.a.Item,null,s.a.createElement(D.a,{size:"large",type:"primary",className:"".concat(Ee.a.button," mr20"),htmlType:"submit",loading:mt},"\u63D0\u4EA4"),s.a.createElement(D.a,{size:"large",type:"primary",ghost:!0,className:Ee.a.button,onClick:function(){return a.d.push("/shixuns/".concat(Be.params.id,"/challenges"))}},"\u53D6\u6D88"))),s.a.createElement(W.a,null,te&&s.a.createElement(D.a,{size:"large",ghost:!0,className:"".concat(Ee.a.button," ").concat(Ee.a.deleteButton),onClick:ar},"\u5220\u9664")))))};return s.a.createElement("section",{className:Ee.a.bg},s.a.createElement(Te.a,{data:kt,title:"\u9009\u62E9\u9898"}),s.a.createElement(v.a,{form:$e,className:Ee.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:$t,onFinish:ir,initialValues:{difficult:1,score:10}},s.a.createElement("aside",{className:["bg-white",Ee.a.navBar].join(" ")},s.a.createElement(Q.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){a.d.replace("/shixuns/".concat(Be.params.id,"/challenges/").concat(Be.params.challengesId,"/editquestion"))}},s.a.createElement("strong",{className:"current"},"\u672C\u5173\u4EFB\u52A1")),kt==null||((Je=kt.chooses)===null||Je===void 0)?void 0:Je.map(function(Xt,yt){return s.a.createElement(Q.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){a.d.replace("/shixuns/".concat(Be.params.id,"/challenges/").concat(Be.params.challengesId,"/editquestion/").concat(Xt.choose_id))}},s.a.createElement("strong",{className:"current ".concat(Be.params.questionId==Xt.choose_id&&Fe?Ee.a.actived:"")},Xt.type===1?"\u5355\u9009\u9898":"\u591A\u9009\u9898"))}),Fe&&s.a.createElement(Q.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){dt(!0),ge(!1),Ft({}),It.current&&It.current.onReset(),$e.resetFields()}},s.a.createElement(Y.a,{title:"\u65B0\u589E\u9009\u62E9\u9898"},s.a.createElement("span",{className:Ee.a.addButton,onClick:function(){}},"+"))),!Fe&&s.a.createElement("strong",{className:Ee.a.actived},"\u9009\u62E9\u9898")),!Ae&&Mr(),Ae&&ti()))},Re=Le.default=Object(a.a)(function(Ve){var We=Ve.shixunsDetail,Je=Ve.newCourse,Ze=Ve.loading,De=Ve.globalSetting;return{shixunsDetail:We,newCourse:Je,globalSetting:De,loading:Ze.effects}})(se)},l2Kq:function(Pe,Le,Z){Pe.exports=Z.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Pe,Le,Z){(function(ie){ie(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function(Y,L){var Q=ie.getMode(Y,"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(Y,z);return ee.name=="null"?null:ee}L.highlightFormatting===void 0&&(L.highlightFormatting=!1),L.maxBlockquoteDepth===void 0&&(L.maxBlockquoteDepth=0),L.taskLists===void 0&&(L.taskLists=!1),L.strikethrough===void 0&&(L.strikethrough=!1),L.emoji===void 0&&(L.emoji=!1),L.fencedCodeBlockHighlighting===void 0&&(L.fencedCodeBlockHighlighting=!0),L.fencedCodeBlockDefaultMode===void 0&&(L.fencedCodeBlockDefaultMode="text/plain"),L.xml===void 0&&(L.xml=!0),L.tokenTypeOverrides===void 0&&(L.tokenTypeOverrides={});var H={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 W in H)H.hasOwnProperty(W)&&L.tokenTypeOverrides[W]&&(H[W]=L.tokenTypeOverrides[W]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,w=L.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,k=/^ {0,3}(?:\={1,}|-{2,})\s*$/,D=/^[^#!\[\]*_\\<>` "'(~:]+/,T=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,S=/^\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 u(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 v(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==R){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=s,z.block=m,z.htmlState=null)}return z.trailingSpace=0,z.trailingSpaceNewLine=!1,z.prevLine=z.thisLine,z.thisLine={stream:null},null}function m(z,F){var ee=z.column()===F.indentation,ae=A(F.prevLine.stream),ce=F.indentedCode,ve=F.prevLine.hr,Me=F.list!==!1,xe=(F.listStack[F.listStack.length-1]||0)+3;F.indentedCode=!1;var Ee=F.indentation;if(F.indentationDiff===null&&(F.indentationDiff=F.indentation,Me)){for(F.list=null;Ee<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=Ee-F.listStack[F.listStack.length-1])}var Te=!ae&&!ve&&!F.prevLine.header&&(!Me||!ce)&&!F.prevLine.fencedCodeEnd,Se=(F.list===!1||ve||ae)&&F.indentation<=xe&&z.match(O),me=null;if(F.indentationDiff>=4&&(ce||F.prevLine.fencedCodeEnd||F.prevLine.header||ae))return z.skipToEnd(),F.indentedCode=!0,H.code;if(z.eatSpace())return null;if(ee&&F.indentation<=xe&&(me=z.match(w))&&me[1].length<=6)return F.quote=0,F.header=me[1].length,F.thisLine.header=!0,L.highlightFormatting&&(F.formatting="header"),F.f=F.inline,f(F);if(F.indentation<=xe&&z.eat(">"))return F.quote=ee?1:F.quote+1,L.highlightFormatting&&(F.formatting="quote"),z.eatSpace(),f(F);if(!Se&&!F.setext&&ee&&F.indentation<=xe&&(me=z.match(M))){var se=me[1]?"ol":"ul";return F.indentation=Ee+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,L.taskLists&&z.match(y,!1)&&(F.taskList=!0),F.f=F.inline,L.highlightFormatting&&(F.formatting=["list","list-"+se]),f(F)}else{if(ee&&F.indentation<=xe&&(me=z.match(T,!0)))return F.quote=0,F.fencedEndRE=new RegExp(me[1]+"+ *$"),F.localMode=L.fencedCodeBlockHighlighting&&_(me[2]||L.fencedCodeBlockDefaultMode),F.localMode&&(F.localState=ie.startState(F.localMode)),F.f=F.block=x,L.highlightFormatting&&(F.formatting="code-block"),F.code=-1,f(F);if(F.setext||(!Te||!Me)&&!F.quote&&F.list===!1&&!F.code&&!Se&&!S.test(z.string)&&(me=z.lookAhead(1))&&(me=me.match(k)))return F.setext?(F.header=F.setext,F.setext=0,z.skipToEnd(),L.highlightFormatting&&(F.formatting="header")):(F.header=me[0].charAt(0)=="="?1:2,F.setext=F.header),F.thisLine.header=!0,F.f=F.inline,f(F);if(Se)return z.skipToEnd(),F.hr=!0,F.thisLine.hr=!0,H.hr;if(z.peek()==="[")return u(z,F,P)}return u(z,F,F.inline)}function R(z,F){var ee=Q.token(z,F.htmlState);if(!B){var ae=ie.innerMode(Q,F.htmlState);(ae.mode.name=="xml"&&ae.state.tagStart===null&&!ae.state.context&&ae.state.tokenize.isInText||F.md_inside&&z.current().indexOf(">")>-1)&&(F.f=s,F.block=m,F.htmlState=null)}return ee}function x(z,F){var ee=F.listStack[F.listStack.length-1]||0,ae=F.indentation<ee,ce=ee+3;if(F.fencedEndRE&&F.indentation<=ce&&(ae||z.match(F.fencedEndRE))){L.highlightFormatting&&(F.formatting="code-block");var ve;return ae||(ve=f(F)),F.localMode=F.localState=null,F.block=m,F.f=s,F.fencedEndRE=null,F.code=0,F.thisLine.fencedCodeEnd=!0,ae?d(z,F,F.block):ve}else return F.localMode?F.localMode.token(z,F.localState):(z.skipToEnd(),H.code)}function f(z){var F=[];if(z.formatting){F.push(H.formatting),typeof z.formatting=="string"&&(z.formatting=[z.formatting]);for(var ee=0;ee<z.formatting.length;ee++)F.push(H.formatting+"-"+z.formatting[ee]),z.formatting[ee]==="header"&&F.push(H.formatting+"-"+z.formatting[ee]+"-"+z.header),z.formatting[ee]==="quote"&&(!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=z.quote?F.push(H.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(H.linkHref,"url"):(z.strong&&F.push(H.strong),z.em&&F.push(H.em),z.strikethrough&&F.push(H.strikethrough),z.emoji&&F.push(H.emoji),z.linkText&&F.push(H.linkText),z.code&&F.push(H.code),z.image&&F.push(H.image),z.imageAltText&&F.push(H.imageAltText,"link"),z.imageMarker&&F.push(H.imageMarker)),z.header&&F.push(H.header,H.header+"-"+z.header),z.quote&&(F.push(H.quote),!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=z.quote?F.push(H.quote+"-"+z.quote):F.push(H.quote+"-"+L.maxBlockquoteDepth)),z.list!==!1){var ae=(z.listStack.length-1)%3;ae?ae===1?F.push(H.list2):F.push(H.list3):F.push(H.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)?f(F):void 0}function s(z,F){var ee=F.text(z,F);if(typeof ee!="undefined")return ee;if(F.list)return F.list=null,f(F);if(F.taskList){var ae=z.match(y,!0)[1]===" ";return ae?F.taskOpen=!0:F.taskClosed=!0,L.highlightFormatting&&(F.formatting="task"),F.taskList=!1,f(F)}if(F.taskOpen=!1,F.taskClosed=!1,F.header&&z.match(/^#+$/,!0))return L.highlightFormatting&&(F.formatting="header"),f(F);var ce=z.next();if(F.linkTitle){F.linkTitle=!1;var ve=ce;ce==="("&&(ve=")"),ve=(ve+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Me="^\\s*(?:[^"+ve+"\\\\]+|\\\\\\\\|\\\\.)"+ve;if(z.match(new RegExp(Me),!0))return H.linkHref}if(ce==="`"){var xe=F.formatting;L.highlightFormatting&&(F.formatting="code"),z.eatWhile("`");var Ee=z.current().length;if(F.code==0&&(!F.quote||Ee==1))return F.code=Ee,f(F);if(Ee==F.code){var Te=f(F);return F.code=0,Te}else return F.formatting=xe,f(F)}else if(F.code)return f(F);if(ce==="\\"&&(z.next(),L.highlightFormatting)){var Se=f(F),me=H.formatting+"-escape";return Se?Se+" "+me:me}if(ce==="!"&&z.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return F.imageMarker=!0,F.image=!0,L.highlightFormatting&&(F.formatting="image"),f(F);if(ce==="["&&F.imageMarker&&z.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return F.imageMarker=!1,F.imageAltText=!0,L.highlightFormatting&&(F.formatting="image"),f(F);if(ce==="]"&&F.imageAltText){L.highlightFormatting&&(F.formatting="image");var Se=f(F);return F.imageAltText=!1,F.image=!1,F.inline=F.f=b,Se}if(ce==="["&&!F.image)return F.linkText&&z.match(/^.*?\]/)||(F.linkText=!0,L.highlightFormatting&&(F.formatting="link")),f(F);if(ce==="]"&&F.linkText){L.highlightFormatting&&(F.formatting="link");var Se=f(F);return F.linkText=!1,F.inline=F.f=z.match(/\(.*?\)| ?\[.*?\]/,!1)?b:s,Se}if(ce==="<"&&z.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=a,L.highlightFormatting&&(F.formatting="link");var Se=f(F);return Se?Se+=" ":Se="",Se+H.linkInline}if(ce==="<"&&z.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=a,L.highlightFormatting&&(F.formatting="link");var Se=f(F);return Se?Se+=" ":Se="",Se+H.linkEmail}if(L.xml&&ce==="<"&&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 Re=z.string.substring(z.start,se);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Re)&&(F.md_inside=!0)}return z.backUp(1),F.htmlState=ie.startState(Q),d(z,F,R)}if(L.xml&&ce==="<"&&z.match(/^\/\w*?>/))return F.md_inside=!1,"tag";if(ce==="*"||ce==="_"){for(var Ve=1,We=z.pos==1?" ":z.string.charAt(z.pos-2);Ve<3&&z.eat(ce);)Ve++;var Je=z.peek()||" ",Ze=!/\s/.test(Je)&&(!h.test(Je)||/\s/.test(We)||h.test(We)),De=!/\s/.test(We)&&(!h.test(We)||/\s/.test(Je)||h.test(Je)),Ue=null,Be=null;if(Ve%2&&(!F.em&&Ze&&(ce==="*"||!De||h.test(We))?Ue=!0:F.em==ce&&De&&(ce==="*"||!Ze||h.test(Je))&&(Ue=!1)),Ve>1&&(!F.strong&&Ze&&(ce==="*"||!De||h.test(We))?Be=!0:F.strong==ce&&De&&(ce==="*"||!Ze||h.test(Je))&&(Be=!1)),Be!=null||Ue!=null){L.highlightFormatting&&(F.formatting=Ue==null?"strong":Be==null?"em":"strong em"),Ue===!0&&(F.em=ce),Be===!0&&(F.strong=ce);var Te=f(F);return Ue===!1&&(F.em=!1),Be===!1&&(F.strong=!1),Te}}else if(ce===" "&&(z.eat("*")||z.eat("_"))){if(z.peek()===" ")return f(F);z.backUp(1)}if(L.strikethrough){if(ce==="~"&&z.eatWhile(ce)){if(F.strikethrough){L.highlightFormatting&&(F.formatting="strikethrough");var Te=f(F);return F.strikethrough=!1,Te}else if(z.match(/^[^\s]/,!1))return F.strikethrough=!0,L.highlightFormatting&&(F.formatting="strikethrough"),f(F)}else if(ce===" "&&z.match(/^~~/,!0)){if(z.peek()===" ")return f(F);z.backUp(2)}}if(L.emoji&&ce===":"&&z.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){F.emoji=!0,L.highlightFormatting&&(F.formatting="emoji");var qe=f(F);return F.emoji=!1,qe}return ce===" "&&(z.match(/^ +$/,!1)?F.trailingSpace++:F.trailingSpace&&(F.trailingSpaceNewLine=!0)),f(F)}function a(z,F){var ee=z.next();if(ee===">"){F.f=F.inline=s,L.highlightFormatting&&(F.formatting="link");var ae=f(F);return ae?ae+=" ":ae="",ae+H.linkInline}return z.match(/^[^>]+/,!0),H.linkInline}function b(z,F){if(z.eatSpace())return null;var ee=z.next();return ee==="("||ee==="["?(F.f=F.inline=E(ee==="("?")":"]"),L.highlightFormatting&&(F.formatting="link-string"),F.linkHref=!0,f(F)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(z){return function(F,ee){var ae=F.next();if(ae===z){ee.f=ee.inline=s,L.highlightFormatting&&(ee.formatting="link-string");var ce=f(ee);return ee.linkHref=!1,ce}return F.match(g[z]),ee.linkHref=!0,f(ee)}}function P(z,F){return z.match(/^([^\]\\]|\\.)*\]:/,!1)?(F.f=G,z.next(),L.highlightFormatting&&(F.formatting="link"),F.linkText=!0,f(F)):u(z,F,s)}function G(z,F){if(z.match(/^\]:/,!0)){F.f=F.inline=V,L.highlightFormatting&&(F.formatting="link");var ee=f(F);return F.linkText=!1,ee}return z.match(/^([^\]\\]|\\.)+/,!0),H.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=s,H.linkHref+" url")}var $={startState:function(){return{f:m,prevLine:{stream:null},thisLine:{stream:null},block:m,htmlState:null,indentation:0,inline:s,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 v(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!=R)){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==R?{state:z.htmlState,mode:Q}:z.localState?{state:z.localState,mode:z.localMode}:{state:z,mode:$}},indent:function(z,F,ee){return z.block==R&&Q.indent?Q.indent(z.htmlState,F,ee):z.localState&&z.localMode.indent?z.localMode.indent(z.localState,F,ee):ie.Pass},blankLine:v,getType:f,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return $},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},lzim:function(Pe,Le,Z){"use strict";var ie=Z("E7E6"),Y=Z.n(ie);Z.d(Le,"w",function(){return Y.a});var L=Z("/GNS"),Q=Z.n(L);Z.d(Le,"v",function(){return Q.a});var B=Z("FOrL"),_=Z.n(B);Z.d(Le,"q",function(){return _.a});var H=Z("HpTS"),W=Z.n(H);Z.d(Le,"x",function(){return W.a});var O=Z("tWlo"),M=Z.n(O);Z.d(Le,"a",function(){return M.a});var y=Z("7ZXX"),w=Z.n(y);Z.d(Le,"l",function(){return w.a});var k=Z("GABl"),D=Z.n(k);Z.d(Le,"e",function(){return D.a});var T=Z("onxn"),S=Z.n(T);Z.d(Le,"n",function(){return S.a});var h=Z("nKGa"),o=Z.n(h);Z.d(Le,"m",function(){return o.a});var u=Z("4qgm"),d=Z.n(u);Z.d(Le,"y",function(){return d.a});var A=Z("JeFH"),v=Z.n(A);Z.d(Le,"b",function(){return v.a});var m=Z("ji0R"),R=Z.n(m);Z.d(Le,"i",function(){return R.a});var x=Z("W6BS"),f=Z.n(x);Z.d(Le,"z",function(){return f.a});var c=Z("kPYp"),s=Z.n(c);Z.d(Le,"A",function(){return s.a});var a=Z("nukY"),b=Z.n(a),g=Z("4u4S"),E=Z.n(g),P=Z("yslc"),G=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"),ae=Z.n(ee),ce=Z("SMhR"),ve=Z.n(ce),Me=Z("8/bI"),xe=Z.n(Me);Z.d(Le,"j",function(){return xe.a});var Ee=Z("JWDV"),Te=Z.n(Ee),Se=Z("Xsq0"),me=Z.n(Se);Z.d(Le,"p",function(){return me.a});var se=Z("Ohmc"),Re=Z.n(se);Z.d(Le,"c",function(){return Re.a});var Ve=Z("csWT"),We=Z.n(Ve);Z.d(Le,"d",function(){return We.a});var Je=Z("7v3h"),Ze=Z.n(Je);Z.d(Le,"k",function(){return Ze.a});var De=Z("cRFk"),Ue=Z.n(De);Z.d(Le,"u",function(){return Ue.a});var Be=Z("kPWJ"),qe=Z.n(Be);Z.d(Le,"t",function(){return qe.a});var Qe=Z("qgvg"),Ie=Z.n(Qe);Z.d(Le,"r",function(){return Ie.a});var Ne=Z("FPkq"),$e=Z.n(Ne);Z.d(Le,"s",function(){return $e.a});var et=Z("A/g1"),Xe=Z.n(et);Z.d(Le,"f",function(){return Xe.a});var Ke=Z("Nmxd"),ct=Z.n(Ke);Z.d(Le,"g",function(){return ct.a});var rt=Z("5D2P"),at=Z.n(rt);Z.d(Le,"h",function(){return at.a});var Ae=Z("djh8"),dt=Z.n(Ae),ot=Z("Jq4h"),we=Z.n(ot)},nKGa:function(Pe,Le,Z){Pe.exports=Z.p+"static/export_exercise-template.f7655c19.png"},nZ20:function(Pe,Le,Z){Pe.exports={icons:"icons___3O80F"}},nukY:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EX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49OtbYGZlepehMpyXnZdKKvbop+2IXUwrKpjDHR93OdTeicVLgi6VwUJ7t89ijK4sQ2HP6dGrDm2PhLotetiNpgPVZXi741I8aN0t80R9Pv/VU4P9kJi0VLnm8iU5cvsOAu1Y//8jLZMlF3SBN0ZrRNFnBG8RRxza2utYf3syDjWVoIjV30Z8kzc7aR6579BgYRl30tvXLH7rPLn+7h8bjlZ5mFP9MDt8EMxD13lt4lpb2ZQc0qegnTeyyKOv2QE5FO3OSgzvFjjporyX6qKNwdMU/6UxpWTfmsuOFCrtZT8WKMKqyJkdbfSPpn5nql4XamMamN5GB0TvUK4KE6HbTqS5ma+eahgtO2ZY9fx2TlKtVziZp3Zl/FigUiZ3wOIYWZ/52pLR35oOU6oPtuw+dNdl6QfsAHmYlMZcEpiXsak6tnQY70bWubrUepjkNJTKTbGv8s8SSlOaD5Z0LwhL4XWmQvSa42rWrgf7+Fn7byVVV5KX6mLbTWcKueEa6etz+M+OphwqlZtmnSUME1bjJyb6vOmm8tc3PvrCeMIJZTLt5zBb1i59tUxuvDeRm+14RscbD1IB9Uo6ZnHRfp2XsX4489Ujy8eT08YTAjSg6Plf333p9HDLpzPlpnEvg4kYH83TrZrxcugy7IkU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var Y=ie.Pos;function L(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 H(h,o,u,d){this.line=o,this.ch=u,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 W(h,o){var u=h.cm.getTokenTypeAt(Y(h.line,o));return u&&/\btag\b/.test(u)}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(!W(h,o+1)){h.ch=o+1;continue}var u=h.text.lastIndexOf("/",o),d=u>-1&&!/\S/.test(h.text.slice(u+1,o));return h.ch=o+1,d?"selfClose":"regular"}}function w(h){for(;;){var o=h.ch?h.text.lastIndexOf("<",h.ch-1):-1;if(o==-1){if(M(h))continue;return}if(!W(h,o+1)){h.ch=o;continue}_.lastIndex=o,h.ch=o;var u=_.exec(h.text);if(u&&u.index==o)return u}}function k(h){for(;;){_.lastIndex=h.ch;var o=_.exec(h.text);if(!o){if(O(h))continue;return}if(!W(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(!W(h,o+1)){h.ch=o;continue}var u=h.text.lastIndexOf("/",o),d=u>-1&&!/\S/.test(h.text.slice(u+1,o));return h.ch=o+1,d?"selfClose":"regular"}}function T(h,o){for(var u=[];;){var d=k(h),A,v=h.line,m=h.ch-(d?d[0].length:0);if(!d||!(A=y(h)))return;if(A=="selfClose")continue;if(d[1]){for(var R=u.length-1;R>=0;--R)if(u[R]==d[2]){u.length=R;break}if(R<0&&(!o||o==d[2]))return{tag:d[2],from:Y(v,m),to:Y(h.line,h.ch)}}else u.push(d[2])}}function S(h,o){for(var u=[];;){var d=D(h);if(!d)return;if(d=="selfClose"){w(h);continue}var A=h.line,v=h.ch,m=w(h);if(!m)return;if(m[1])u.push(m[2]);else{for(var R=u.length-1;R>=0;--R)if(u[R]==m[2]){u.length=R;break}if(R<0&&(!o||o==m[2]))return{tag:m[2],from:Y(h.line,h.ch),to:Y(A,v)}}}}ie.registerHelper("fold","xml",function(h,o){for(var u=new H(h,o.line,0);;){var d=k(u);if(!d||u.line!=o.line)return;var A=y(u);if(!A)return;if(!d[1]&&A!="selfClose"){var v=Y(u.line,u.ch),m=T(u,d[2]);return m&&L(m.from,v)>0?{from:v,to:m.from}:null}}}),ie.findMatchingTag=function(h,o,u){var d=new H(h,o.line,o.ch,u);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var A=y(d),v=A&&Y(d.line,d.ch),m=A&&w(d);if(!A||!m||L(d,o)>0)return;var R={from:Y(d.line,d.ch),to:v,tag:m[2]};return A=="selfClose"?{open:R,close:null,at:"open"}:m[1]?{open:S(d,m[2]),close:R,at:"close"}:(d=new H(h,v.line,v.ch,u),{open:R,close:T(d,m[2]),at:"open"})},ie.findEnclosingTag=function(h,o,u,d){for(var A=new H(h,o.line,o.ch,u);;){var v=S(A,d);if(!v)break;var m=new H(h,o.line,o.ch,u),R=T(m,v.tag);if(R)return{open:v,close:R}}},ie.scanForClosingTag=function(h,o,u,d){var A=new H(h,o.line,o.ch,d?{from:0,to:d}:null);return T(A,u)}})},p5ED:function(Pe,Le,Z){"use strict";var ie=Z("+L6B"),Y=Z("2/Rp"),L=Z("5Dmo"),Q=Z("3S7+"),B=Z("k1fw"),_=Z("9og8"),H=Z("tJVT"),W=Z("WmNS"),O=Z.n(W),M=Z("q1tI"),y=Z.n(M),w=Z("vHTk"),k=Z.n(w),D=Z("yEEn"),T=Z("ZW9T"),S=Z("1vsH"),h=Z("V0Rq"),o=Z("m3rI");Le.a=function(u){var d,A,v,m,R,x,f,c=u.editOffice,s=c===void 0?"view":c,a=u.data,b=u.theme,g=u.type,E=u.filename,P=u.monacoEditor,G=u.className,V=u.style,$=u.close,z=u.onClose,F=u.hasMask,ee=u.disabledDownload,ae=Object(M.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ce=Object(H.a)(ae,2),ve=ce[0],Me=ce[1],xe=Object(M.useState)(""),Ee=Object(H.a)(xe,2),Te=Ee[0],Se=Ee[1],me=Object(M.useState)(),se=Object(H.a)(me,2),Re=se[0],Ve=se[1],We=window.ENV==="build"?"/react/build":"",Je=o.a.PROXY_SERVER||location.origin,Ze,De=1024*1024,Ue=10*De,Be=Object(M.useRef)();(d=a)!==null&&d!==void 0&&d.startsWith("/api")&&g!=="txt"&&(a=o.a.API_SERVER+a),g==="office"&&(Ze=Object(S.T)(a).filesize,Ze>Ue&&(g="other")),E&&P&&(P.filename=E),Object(M.useEffect)(function(){var Ne,$e,et=(Ne=document.cookie)===null||Ne===void 0||(($e=Ne.replace(/\s/g,""))===null||$e===void 0)?void 0:$e.split(";");et==null||et.map(function(Xe){var Ke=Xe.split("=");Ke[0]==="_educoder_session"&&Se(Ke[1])})},[]),Object(M.useEffect)(function(){g==="office"&&qe()},[g,a]);var qe=function(){var Ne=Object(_.a)(O.a.mark(function $e(){var et,Xe,Ke;return O.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return console.log("data:",a),et=a,a.startsWith("http")||(et=location.origin+et),Xe=new URL(et).pathname.split("/").pop(),rt.next=6,Object(h.V)({attachment_id:Xe});case 6:Ke=rt.sent,Ve(Ke);case 8:case"end":return rt.stop()}},$e)}));return function(){return Ne.apply(this,arguments)}}(),Qe=function(){if(a.startsWith("http")||a.startsWith("blob:")){Ie();return}Object(S.z)(E||"educoder",a,E)},Ie=function(){Object(S.x)(E||"educoder",decodeURIComponent(a))};return y.a.createElement("div",{style:Object(B.a)({},V||{}),className:"".concat(F&&k.a.bgBlack," ").concat(g?k.a.wrp:"hide")},$&&y.a.createElement("div",{className:k.a.close,ref:Be},!ee&&y.a.createElement(Q.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Be.current}},y.a.createElement("span",{onClick:Ie},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(Q.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Be.current}},y.a.createElement("span",{className:"",onClick:z},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(k.a[G]," ").concat(G," ").concat(k.a.monaco," ").concat(g==="txt"?"show":"hide")},g==="txt"&&y.a.createElement(T.b,P)),g==="audio"&&y.a.createElement("audio",{src:"".concat(((A=a)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((v=a)===null||v===void 0?void 0:v.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(a),autoPlay:!0}),g==="video"&&y.a.createElement(y.a.Fragment,null,((m=a)===null||m===void 0?void 0:m.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})),g==="office"&&Re&&y.a.createElement("iframe",{src:"".concat(We,"/office.html?key=").concat(Re.key,"&url=").concat(Je+Re.url,"&callbackUrl=").concat(Je+Re.callbackUrl,"&fileType=").concat(Re.fileType,"&title=").concat(Re.title,"&model=").concat(s,"&officeServer=").concat(o.a.OFFICE_SERVER,"&disabledDownload=").concat(!!ee)}),g==="html"&&y.a.createElement("iframe",{src:a+"&disposition=inline"}),g==="pdf"&&y.a.createElement("iframe",{src:"".concat(We,"/js/pdfview/index.html?url=").concat(a,"&disabledDownload=").concat(!!ee)}),g==="image"&&y.a.createElement("img",{src:"".concat(((R=a)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((x=a)===null||x===void 0?void 0:x.indexOf("https://"))>-1||(f=a)!==null&&f!==void 0&&f.startsWith("/api")?"":"data:image/png;base64,").concat(a)}),g==="other"&&y.a.createElement("div",null,y.a.createElement(Y.a,{type:"primary",size:"large",onClick:Qe},y.a.createElement(D.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),g==="download"&&y.a.createElement(Y.a,{type:"primary",size:"large",onClick:Qe},y.a.createElement(D.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Pe,Le,Z){},qgvg:function(Pe,Le){Pe.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwE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cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(Pe,Le){const Z=/[&<>"']/,ie=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},B=x=>Q[x];function _(x,f){if(f){if(Z.test(x))return x.replace(ie,B)}else if(Y.test(x))return x.replace(L,B);return x}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(x){return x.replace(H,(f,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(x,f){x=x.source||x,f=f||"";const c={replace:(s,a)=>(a=a.source||a,a=a.replace(O,"$1"),x=x.replace(s,a),c),getRegex:()=>new RegExp(x,f)};return c}const y=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(x,f,c){if(x){let s;try{s=decodeURIComponent(W(c)).replace(y,"").toLowerCase()}catch(a){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}f&&!w.test(c)&&(c=o(f,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(s){return null}return c}const D={},T=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(x,f){D[" "+x]||(T.test(x)?D[" "+x]=x+"/":D[" "+x]=v(x,"/",!0)),x=D[" "+x];const c=x.indexOf(":")===-1;return f.substring(0,2)==="//"?c?f:x.replace(S,"$1")+f:f.charAt(0)==="/"?c?f:x.replace(h,"$1")+f:x+f}const u={exec:function(){}};function d(x){let f=1,c,s;for(;f<arguments.length;f++){c=arguments[f];for(s in c)Object.prototype.hasOwnProperty.call(c,s)&&(x[s]=c[s])}return x}function A(x,f){const c=x.replace(/\|/g,(b,g,E)=>{let P=!1,G=g;for(;--G>=0&&E[G]==="\\";)P=!P;return P?"|":" |"}),s=c.split(/ \|/);let a=0;if(s.length>f)s.splice(f);else for(;s.length<f;)s.push("");for(;a<s.length;a++)s[a]=s[a].trim().replace(/\\\|/g,"|");return s}function v(x,f,c){const s=x.length;if(s===0)return"";let a=0;for(;a<s;){const b=x.charAt(s-a-1);if(b===f&&!c)a++;else if(b!==f&&c)a++;else break}return x.substr(0,s-a)}function m(x,f){if(x.indexOf(f[1])===-1)return-1;const c=x.length;let s=0,a=0;for(;a<c;a++)if(x[a]==="\\")a++;else if(x[a]===f[0])s++;else if(x[a]===f[1]&&(s--,s<0))return a;return-1}function R(x){x&&x.sanitize&&!x.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")}Pe.exports={escape:_,unescape:W,edit:M,cleanUrl:k,resolveUrl:o,noopTest:u,merge:d,splitCells:A,rtrim:v,findClosingBracket:m,checkSanitizeDeprecation:R}},tWlo:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkVCNENBMTM0OENGMTExRTk4NzNCRkMxMzdB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L5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(Pe,Le,Z){typeof window!="undefined"&&function(Y,L){Pe.exports=L()}(this,function(){return function(ie){var Y={};function L(Q){if(Y[Q])return Y[Q].exports;var B=Y[Q]={i:Q,l:!1,exports:{}};return ie[Q].call(B.exports,B,B.exports,L),B.l=!0,B.exports}return L.m=ie,L.c=Y,L.d=function(Q,B,_){L.o(Q,B)||Object.defineProperty(Q,B,{enumerable:!0,get:_})},L.r=function(Q){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Q,"__esModule",{value:!0})},L.t=function(Q,B){if(B&1&&(Q=L(Q)),B&8)return Q;if(B&4&&typeof Q=="object"&&Q&&Q.__esModule)return Q;var _=Object.create(null);if(L.r(_),Object.defineProperty(_,"default",{enumerable:!0,value:Q}),B&2&&typeof Q!="string")for(var H in Q)L.d(_,H,function(W){return Q[W]}.bind(null,H));return _},L.n=function(Q){var B=Q&&Q.__esModule?function(){return Q.default}:function(){return Q};return L.d(B,"a",B),B},L.o=function(Q,B){return Object.prototype.hasOwnProperty.call(Q,B)},L.p="/dist/",L(L.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,Y,L){"use strict";var Q=Object.prototype.hasOwnProperty,B="~";function _(){}Object.create&&(_.prototype=Object.create(null),new _().__proto__||(B=!1));function H(y,w,k){this.fn=y,this.context=w,this.once=k||!1}function W(y,w,k,D,T){if(typeof k!="function")throw new TypeError("The listener must be a function");var S=new H(k,D||y,T),h=B?B+w:w;return y._events[h]?y._events[h].fn?y._events[h]=[y._events[h],S]:y._events[h].push(S):(y._events[h]=S,y._eventsCount++),y}function O(y,w){--y._eventsCount===0?y._events=new _:delete y._events[w]}function M(){this._events=new _,this._eventsCount=0}M.prototype.eventNames=function(){var w=[],k,D;if(this._eventsCount===0)return w;for(D in k=this._events)Q.call(k,D)&&w.push(B?D.slice(1):D);return Object.getOwnPropertySymbols?w.concat(Object.getOwnPropertySymbols(k)):w},M.prototype.listeners=function(w){var k=B?B+w:w,D=this._events[k];if(!D)return[];if(D.fn)return[D.fn];for(var T=0,S=D.length,h=new Array(S);T<S;T++)h[T]=D[T].fn;return h},M.prototype.listenerCount=function(w){var k=B?B+w:w,D=this._events[k];return D?D.fn?1:D.length:0},M.prototype.emit=function(w,k,D,T,S,h){var o=B?B+w:w;if(!this._events[o])return!1;var u=this._events[o],d=arguments.length,A,v;if(u.fn){u.once&&this.removeListener(w,u.fn,void 0,!0);switch(d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,k),!0;case 3:return u.fn.call(u.context,k,D),!0;case 4:return u.fn.call(u.context,k,D,T),!0;case 5:return u.fn.call(u.context,k,D,T,S),!0;case 6:return u.fn.call(u.context,k,D,T,S,h),!0}for(v=1,A=new Array(d-1);v<d;v++)A[v-1]=arguments[v];u.fn.apply(u.context,A)}else{var m=u.length,R;for(v=0;v<m;v++){u[v].once&&this.removeListener(w,u[v].fn,void 0,!0);switch(d){case 1:u[v].fn.call(u[v].context);break;case 2:u[v].fn.call(u[v].context,k);break;case 3:u[v].fn.call(u[v].context,k,D);break;case 4:u[v].fn.call(u[v].context,k,D,T);break;default:if(!A)for(R=1,A=new Array(d-1);R<d;R++)A[R-1]=arguments[R];u[v].fn.apply(u[v].context,A)}}}return!0},M.prototype.on=function(w,k,D){return W(this,w,k,D,!1)},M.prototype.once=function(w,k,D){return W(this,w,k,D,!0)},M.prototype.removeListener=function(w,k,D,T){var S=B?B+w:w;if(!this._events[S])return this;if(!k)return O(this,S),this;var h=this._events[S];if(h.fn)h.fn===k&&(!T||h.once)&&(!D||h.context===D)&&O(this,S);else{for(var o=0,u=[],d=h.length;o<d;o++)(h[o].fn!==k||T&&!h[o].once||D&&h[o].context!==D)&&u.push(h[o]);u.length?this._events[S]=u.length===1?u[0]:u:O(this,S)}return this},M.prototype.removeAllListeners=function(w){var k;return w?(k=B?B+w:w,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,Y,L){(function(Q){var B=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,_=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,O={buildAbsoluteURL:function(M,y,w){if(w=w||{},M=M.trim(),y=y.trim(),!y){if(!w.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 w.alwaysNormalize?(D.path=O.normalizePath(D.path),O.buildURLFromParts(D)):y;var T=O.parseURL(M);if(!T)throw new Error("Error trying to parse base URL.");if(!T.netLoc&&T.path&&T.path[0]!=="/"){var S=_.exec(T.path);T.netLoc=S[1],T.path=S[2]}T.netLoc&&!T.path&&(T.path="/");var h={scheme:T.scheme,netLoc:D.netLoc,path:null,params:D.params,query:D.query,fragment:D.fragment};if(!D.netLoc&&(h.netLoc=T.netLoc,D.path[0]!=="/"))if(!D.path)h.path=T.path,D.params||(h.params=T.params,D.query||(h.query=T.query));else{var o=T.path,u=o.substring(0,o.lastIndexOf("/")+1)+D.path;h.path=O.normalizePath(u)}return h.path===null&&(h.path=w.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(H,"");M.length!==(M=M.replace(W,"")).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,Y,L){function Q(w){var k={};function D(S){if(k[S])return k[S].exports;var h=k[S]={i:S,l:!1,exports:{}};return w[S].call(h.exports,h,h.exports,D),h.l=!0,h.exports}D.m=w,D.c=k,D.i=function(S){return S},D.d=function(S,h,o){D.o(S,h)||Object.defineProperty(S,h,{configurable:!1,enumerable:!0,get:o})},D.r=function(S){Object.defineProperty(S,"__esModule",{value:!0})},D.n=function(S){var h=S&&S.__esModule?function(){return S.default}:function(){return S};return D.d(h,"a",h),h},D.o=function(S,h){return Object.prototype.hasOwnProperty.call(S,h)},D.p="/",D.oe=function(S){throw console.error(S),S};var T=D(D.s=ENTRY_MODULE);return T.default||T}var B="[\\.|\\-|\\+|\\w|/|@]+",_="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+B+").*?\\)";function H(w){return(w+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(w){return!isNaN(1*w)}function O(w,k,D){var T={};T[D]=[];var S=k.toString(),h=S.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!h)return T;for(var o=h[1],u=new RegExp("(\\\\n|\\W)"+H(o)+_,"g"),d;d=u.exec(S);){if(d[3]==="dll-reference")continue;T[D].push(d[3])}for(u=new RegExp("\\("+H(o)+'\\("(dll-reference\\s('+B+'))"\\)\\)'+_,"g");d=u.exec(S);)w[d[2]]||(T[D].push(d[1]),w[d[2]]=L(d[1]).m),T[d[2]]=T[d[2]]||[],T[d[2]].push(d[4]);for(var A=Object.keys(T),v=0;v<A.length;v++)for(var m=0;m<T[A[v]].length;m++)W(T[A[v]][m])&&(T[A[v]][m]=1*T[A[v]][m]);return T}function M(w){var k=Object.keys(w);return k.reduce(function(D,T){return D||w[T].length>0},!1)}function y(w,k){for(var D={main:[k]},T={main:[]},S={main:{}};M(D);)for(var h=Object.keys(D),o=0;o<h.length;o++){var u=h[o],d=D[u],A=d.pop();if(S[u]=S[u]||{},S[u][A]||!w[u][A])continue;S[u][A]=!0,T[u]=T[u]||[],T[u].push(A);for(var v=O(w,w[u][A],u),m=Object.keys(v),R=0;R<m.length;R++)D[m[R]]=D[m[R]]||[],D[m[R]]=D[m[R]].concat(v[m[R]])}return T}ie.exports=function(w,k){k=k||{};var D={main:L.m},T=k.all?{main:Object.keys(D.main)}:y(D,w),S="";Object.keys(T).filter(function(A){return A!=="main"}).forEach(function(A){for(var v=0;T[A][v];)v++;T[A].push(v),D[A][v]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",S=S+"var "+A+" = ("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+T[A].map(function(m){return""+JSON.stringify(m)+": "+D[A][m].toString()}).join(",")+`});
|
|
`}),S=S+"new (("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+T.main.map(function(A){return""+JSON.stringify(A)+": "+D.main[A].toString()}).join(",")+"}))(self);";var h=new window.Blob([S],{type:"text/javascript"});if(k.bare)return h;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,u=o.createObjectURL(h),d=new window.Worker(u);return d.objectURL=u,d}},"./src/config.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"hlsDefaultConfig",function(){return R}),L.d(Y,"mergeConfig",function(){return f}),L.d(Y,"enableStreamingMode",function(){return c});var Q=L("./src/controller/abr-controller.ts"),B=L("./src/controller/audio-stream-controller.ts"),_=L("./src/controller/audio-track-controller.ts"),H=L("./src/controller/subtitle-stream-controller.ts"),W=L("./src/controller/subtitle-track-controller.ts"),O=L("./src/controller/buffer-controller.ts"),M=L("./src/controller/timeline-controller.ts"),y=L("./src/controller/cap-level-controller.ts"),w=L("./src/controller/fps-controller.ts"),k=L("./src/controller/eme-controller.ts"),D=L("./src/controller/cmcd-controller.ts"),T=L("./src/utils/xhr-loader.ts"),S=L("./src/utils/fetch-loader.ts"),h=L("./src/utils/cues.ts"),o=L("./src/utils/mediakeys-helper.ts"),u=L("./src/utils/logger.ts");function d(){return d=Object.assign||function(s){for(var a=1;a<arguments.length;a++){var b=arguments[a];for(var g in b)Object.prototype.hasOwnProperty.call(b,g)&&(s[g]=b[g])}return s},d.apply(this,arguments)}function A(s,a){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(s);a&&(g=g.filter(function(E){return Object.getOwnPropertyDescriptor(s,E).enumerable})),b.push.apply(b,g)}return b}function v(s){for(var a=1;a<arguments.length;a++){var b=arguments[a]!=null?arguments[a]:{};a%2?A(Object(b),!0).forEach(function(g){m(s,g,b[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):A(Object(b)).forEach(function(g){Object.defineProperty(s,g,Object.getOwnPropertyDescriptor(b,g))})}return s}function m(s,a,b){return a in s?Object.defineProperty(s,a,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[a]=b,s}var R=v(v({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:T.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:w.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},x()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:W.default,timelineController:M.TimelineController,audioStreamController:B.default,audioTrackController:_.default,emeController:k.default,cmcdController:D.default});function x(){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 f(s,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({},s,a)}function c(s){var a=s.loader;if(a!==S.default&&a!==T.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var b=Object(S.fetchSupported)();b&&(s.loader=S.default,s.progressive=!0,s.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/polyfills/number.ts"),B=L("./src/utils/ewma-bandwidth-estimator.ts"),_=L("./src/events.ts"),H=L("./src/utils/buffer-helper.ts"),W=L("./src/errors.ts"),O=L("./src/types/loader.ts"),M=L("./src/utils/logger.ts");function y(D,T){for(var S=0;S<T.length;S++){var h=T[S];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function w(D,T,S){return T&&y(D.prototype,T),S&&y(D,S),D}var k=function(){function D(S){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=S;var h=S.config;this.bwEstimator=new B.default(h.abrEwmaSlowVoD,h.abrEwmaFastVoD,h.abrEwmaDefaultEstimate),this.registerListeners()}var T=D.prototype;return T.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)},T.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)},T.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},T.onFragLoading=function(h,o){var u=o.frag;if(u.type===O.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=u,this.partCurrent=(d=o.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},T.onLevelLoaded=function(h,o){var u=this.hls.config;o.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},T._abandonRulesCheck=function(){var h=this.fragCurrent,o=this.partCurrent,u=this.hls,d=u.autoLevelEnabled,A=u.config,v=u.media;if(!h||!v)return;var m=o?o.stats:h.stats,R=o?o.duration:h.duration;if(m.aborted){M.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||v.paused||!v.playbackRate||!v.readyState)return;var x=performance.now()-m.loading.start,f=Math.abs(v.playbackRate);if(x<=500*R/f)return;var c=u.levels,s=u.minAutoLevel,a=c[h.level],b=m.total||Math.max(m.loaded,Math.round(R*a.maxBitrate/8)),g=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/x),E=(b-m.loaded)/g,P=v.currentTime,G=(H.BufferHelper.bufferInfo(v,P,A.maxBufferHole).end-P)/f;if(G>=2*R/f||E<=G)return;var V=Number.POSITIVE_INFINITY,$;for($=h.level-1;$>s;$--){var z=c[$].maxBitrate;if(V=R*z/(8*.8*g),V<G)break}if(V>=E)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: `+E.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+V.toFixed(3)+` s
|
|
Time to underbuffer: `+G.toFixed(3)+" s"),u.nextLoadLevel=$,this.bwEstimator.sample(x,m.loaded),this.clearTimer(),h.loader&&(this.fragCurrent=this.partCurrent=null,h.loader.abort()),u.trigger(_.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:h,part:o,stats:m})},T.onFragLoaded=function(h,o){var u=o.frag,d=o.part;if(u.type===O.PlaylistLevelType.MAIN&&Object(Q.isFiniteNumber)(u.sn)){var A=d?d.stats:u.stats,v=d?d.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[u.level],R=(m.loaded?m.loaded.bytes:0)+A.loaded,x=(m.loaded?m.loaded.duration:0)+v;m.loaded={bytes:R,duration:x},m.realBitrate=Math.round(8*R/x)}if(u.bitrateTest){var f={stats:A,frag:u,part:d,id:u.type};this.onFragBuffered(_.Events.FRAG_BUFFERED,f),u.bitrateTest=!1}}},T.onFragBuffered=function(h,o){var u=o.frag,d=o.part,A=d?d.stats:u.stats;if(A.aborted)return;if(u.type!==O.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var v=A.parsing.end-A.loading.start;this.bwEstimator.sample(v,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},T.onError=function(h,o){switch(o.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},T.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},T.getNextABRAutoLevel=function(){var h=this.fragCurrent,o=this.partCurrent,u=this.hls,d=u.maxAutoLevel,A=u.config,v=u.minAutoLevel,m=u.media,R=o?o.duration:h?h.duration:0,x=m?m.currentTime:0,f=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,s=(H.BufferHelper.bufferInfo(m,x,A.maxBufferHole).end-x)/f,a=this.findBestLevel(c,v,d,s,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(a>=0)return a;M.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var b=R?Math.min(R,A.maxStarvationDelay):A.maxStarvationDelay,g=A.abrBandWidthFactor,E=A.abrBandWidthUpFactor;if(!s){var P=this.bitrateTestDelay;if(P){var G=R?Math.min(R,A.maxLoadingDelay):A.maxLoadingDelay;b=G-P,M.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*b)+" ms"),g=E=1}}return a=this.findBestLevel(c,v,d,s+b,g,E),Math.max(a,0)},T.findBestLevel=function(h,o,u,d,A,v){for(var m,R=this.fragCurrent,x=this.partCurrent,f=this.lastLoadedFragLevel,c=this.hls.levels,s=c[f],a=!!(s!=null&&(m=s.details)!==null&&m!==void 0&&m.live),b=s==null?void 0:s.codecSet,g=x?x.duration:R?R.duration:0,E=u;E>=o;E--){var P=c[E];if(!P||b&&P.codecSet!==b)continue;var G=P.details,V=(x?G==null?void 0:G.partTarget:G==null?void 0:G.averagetargetduration)||g,$=void 0;E<=f?$=A*h:$=v*h;var z=c[E].maxBitrate,F=z*V/$;if(M.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+E+"/"+Math.round($)+"/"+z+"/"+V+"/"+d+"/"+F),$>z&&(!F||a&&!this.bitrateTestDelay||F<d))return E}return-1},w(D,[{key:"nextAutoLevel",get:function(){var h=this._nextAutoLevel,o=this.bwEstimator;if(h!==-1&&(!o||!o.canEstimate()))return h;var u=this.getNextABRAutoLevel();return h!==-1&&(u=Math.min(h,u)),u},set:function(h){this._nextAutoLevel=h}}]),D}();Y.default=k},"./src/controller/audio-stream-controller.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/polyfills/number.ts"),B=L("./src/controller/base-stream-controller.ts"),_=L("./src/events.ts"),H=L("./src/utils/buffer-helper.ts"),W=L("./src/controller/fragment-tracker.ts"),O=L("./src/types/level.ts"),M=L("./src/types/loader.ts"),y=L("./src/loader/fragment.ts"),w=L("./src/demux/chunk-cache.ts"),k=L("./src/demux/transmuxer-interface.ts"),D=L("./src/types/transmuxer.ts"),T=L("./src/controller/fragment-finders.ts"),S=L("./src/utils/discontinuities.ts"),h=L("./src/errors.ts"),o=L("./src/utils/logger.ts");function u(){return u=Object.assign||function(R){for(var x=1;x<arguments.length;x++){var f=arguments[x];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(R[c]=f[c])}return R},u.apply(this,arguments)}function d(R,x){R.prototype=Object.create(x.prototype),R.prototype.constructor=R,A(R,x)}function A(R,x){return A=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},A(R,x)}var v=100,m=function(R){d(x,R);function x(c,s){var a;return a=R.call(this,c,s,"[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 f=x.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var s=this.hls;s.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(_.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(_.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(_.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(_.Events.ERROR,this.onError,this),s.on(_.Events.BUFFER_RESET,this.onBufferReset,this),s.on(_.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(_.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(_.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var s=this.hls;s.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(_.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(_.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(_.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(_.Events.ERROR,this.onError,this),s.off(_.Events.BUFFER_RESET,this.onBufferReset,this),s.off(_.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(_.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(_.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f.onInitPtsFound=function(s,a){var b=a.frag,g=a.id,E=a.initPTS;if(g==="main"){var P=b.cc;this.initPTS[b.cc]=E,this.log("InitPTS for cc: "+P+" found from main: "+E),this.videoTrackCC=P,this.state===B.State.WAITING_INIT_PTS&&this.tick()}},f.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=B.State.STOPPED;return}var a=this.lastCurrentTime;this.stopLoad(),this.setInterval(v),this.fragLoadError=0,a>0&&s===-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=s,this.tick()},f.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_TRACK:{var s,a=this.levels,b=this.trackId,g=a==null||((s=a[b])===null||s===void 0)?void 0:s.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=B.State.WAITING_INIT_PTS}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var E,P=performance.now(),G=this.retryDate;(!G||P>=G||(E=this.media)!==null&&E!==void 0&&E.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 ae=F.flush(),ce={frag:$,part:z,payload:ae,networkDetails:null};this._handleFragmentLoadProgress(ce),ee&&R.prototype._handleFragmentLoadComplete.call(this,ce)}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(),Me=H.BufferHelper.bufferInfo(this.mediaBuffer,ve,this.config.maxBufferHole),xe=Object(T.fragmentWithinToleranceTest)(Me.end,this.config.maxFragLookUpTolerance,$);xe<0&&(o.logger.log("Waiting fragment cc ("+$.cc+") @ "+$.start+" cancelled because another fragment at "+Me.end+" is needed"),this.clearWaitingFragment())}}else this.state=B.State.IDLE}}this.onTickEnd()},f.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.IDLE)},f.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:s,b=a.buffered;!this.loadedmetadata&&b.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},f.doTickIdle=function(){var s,a,b=this.hls,g=this.levels,E=this.media,P=this.trackId,G=b.config;if(!g||!g[P])return;if(!E&&(this.startFragRequested||!G.startFragPrefetch))return;var V=g[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(),ae=this.audioSwitch;if(F>=ee&&!ae)return;if(!ae&&this._streamEnded(z,$)){b.trigger(_.Events.BUFFER_EOS,{type:"audio"}),this.state=B.State.ENDED;return}var ce=$.fragments,ve=ce[0].start,Me=z.end;if(ae){var xe=this.getLoadPosition();Me=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"),E.currentTime=ve+.05))}var Ee=this.getNextFragment(Me,$);if(!Ee){this.bufferFlushed=!0;return}((s=Ee.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((a=Ee.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Ee,$):this.loadFragment(Ee,$,Me)},f.getMaxBufferLength=function(){var s=R.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,M.PlaylistLevelType.MAIN);return a===null?s:Math.max(s,a.len)},f.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(s,a){var b=a.audioTracks;this.resetTransmuxer(),this.levels=b.map(function(g){return new O.Level(g)})},f.onAudioTrackSwitching=function(s,a){var b=!!a.url;this.trackId=a.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),b?this.setInterval(v):this.resetTransmuxer(),b?(this.audioSwitch=!0,this.state=B.State.IDLE):this.state=B.State.STOPPED,this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},f.onLevelLoaded=function(s,a){this.mainDetails=a.details},f.onAudioTrackLoaded=function(s,a){var b,g=this.levels,E=a.details,P=a.id;if(!g){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+E.startSN+","+E.endSN+"],duration:"+E.totalduration);var G=g[P],V=0;if(E.live||(b=G.details)!==null&&b!==void 0&&b.live){var $=this.mainDetails;if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed||!$)return;!G.details&&E.hasProgramDateTime&&$.hasProgramDateTime?(Object(S.alignMediaPlaylistByPDT)(E,$),V=E.fragments[0].start):V=this.alignPlaylists(E,G.details)}G.details=E,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!E.live)&&this.setStartPosition(G.details,V),this.state===B.State.WAITING_TRACK&&!this.waitForCdnTuneIn(E)&&(this.state=B.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(s){var a,b=s.frag,g=s.part,E=s.payload,P=this.config,G=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[G];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 ae=this.initPTS[b.cc],ce=(a=b.initSegment)===null||a===void 0?void 0:a.data;if(ae!==void 0){var ve=!1,Me=g?g.index:-1,xe=Me!==-1,Ee=new D.ChunkMetadata(b.level,b.sn,b.stats.chunkCount,E.byteLength,Me,xe);ee.push(E,ce,F,"",b,g,z.totalduration,ve,Ee,ae)}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 "+G);var Te=this.waitingData=this.waitingData||{frag:b,part:g,cache:new w.default,complete:!1},Se=Te.cache;Se.push(new Uint8Array(E)),this.waitingVideoCC=this.videoTrackCC,this.state=B.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,s)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(s,a){var b=a.tracks.audio;b&&(this.mediaBuffer=b.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},f.onFragBuffered=function(s,a){var b=a.frag,g=a.part;if(b.type!==M.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(b)){this.warn("Fragment "+b.sn+(g?" p: "+g.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,g)},f.onError=function(s,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,g=this.getFwdBufferInfo(this.mediaBuffer,M.PlaylistLevelType.AUDIO);g&&g.len>.5&&(b=!this.reduceMaxBufferLength(g.len)),b&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},f.onBufferFlushed=function(s,a){var b=a.type;b===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(s){var a,b="audio",g=this.hls,E=s.remuxResult,P=s.chunkMeta,G=this.getCurrentContext(P);if(!G){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=G.frag,$=G.part,z=E.audio,F=E.text,ee=E.id3,ae=E.initSegment;if(this.fragContextChanged(V))return;if(this.state=B.State.PARSING,this.audioSwitch&&z&&this.completeAudioSwitch(),ae!=null&&ae.tracks&&(this._bufferInitSegment(ae.tracks,V,P),g.trigger(_.Events.FRAG_PARSING_INIT_SEGMENT,{frag:V,id:b,tracks:ae.tracks})),z){var ce=z.startPTS,ve=z.endPTS,Me=z.startDTS,xe=z.endDTS;$&&($.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:ve,startDTS:Me,endDTS:xe}),V.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,ce,ve,Me,xe),this.bufferFragmentData(z,V,$,P)}if(ee!=null&&(a=ee.samples)!==null&&a!==void 0&&a.length){var Ee=u({frag:V,id:b},ee);g.trigger(_.Events.FRAG_PARSING_METADATA,Ee)}if(F){var Te=u({frag:V,id:b},F);g.trigger(_.Events.FRAG_PARSING_USERDATA,Te)}},f._bufferInitSegment=function(s,a,b){if(this.state!==B.State.PARSING)return;s.video&&delete s.video;var g=s.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(_.Events.BUFFER_CODECS,s);var E=g.initSegment;if(E!=null&&E.byteLength){var P={type:"audio",frag:a,part:null,chunkMeta:b,parent:a.type,data:E};this.hls.trigger(_.Events.BUFFER_APPENDING,P)}this.tick()},f.loadFragment=function(s,a,b){var g=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||g===W.FragmentState.NOT_LOADED||g===W.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):a.live&&!Object(Q.isFiniteNumber)(this.initPTS[s.cc])?(this.log("Waiting for video PTS in continuity counter "+s.cc+" of live stream before loading audio fragment "+s.sn+" of level "+this.trackId),this.state=B.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,s,a,b)))},f.completeAudioSwitch=function(){var s=this.hls,a=this.media,b=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:b})},x}(B.default);Y.default=m},"./src/controller/audio-track-controller.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/events.ts"),B=L("./src/errors.ts"),_=L("./src/controller/base-playlist-controller.ts"),H=L("./src/types/loader.ts");function W(k,D){for(var T=0;T<D.length;T++){var S=D[T];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(k,S.key,S)}}function O(k,D,T){return D&&W(k.prototype,D),T&&W(k,T),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(S,h){return S.__proto__=h,S},y(k,D)}var w=function(k){M(D,k);function D(S){var h;return h=k.call(this,S,"[audio-track-controller]")||this,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.trackName="",h.selectDefaultTrack=!0,h.registerListeners(),h}var T=D.prototype;return T.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)},T.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)},T.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,k.prototype.destroy.call(this)},T.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},T.onManifestParsed=function(h,o){this.tracks=o.audioTracks||[]},T.onAudioTrackLoaded=function(h,o){var u=o.id,d=o.details,A=this.tracksInGroup[u];if(!A){this.warn("Invalid audio track id "+u);return}var v=A.details;A.details=o.details,this.log("audioTrack "+u+" loaded ["+d.startSN+"-"+d.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,o,v))},T.onLevelLoading=function(h,o){this.switchLevel(o.level)},T.onLevelSwitching=function(h,o){this.switchLevel(o.level)},T.switchLevel=function(h){var o=this.hls.levels[h];if(!(o!=null&&o.audioGroupIds))return;var u=o.audioGroupIds[o.urlId];if(this.groupId!==u){this.groupId=u;var d=this.tracks.filter(function(v){return!u||v.groupId===u});this.selectDefaultTrack&&!d.some(function(v){return v.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var A={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(Q.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},T.onError=function(h,o){if(k.prototype.onError.call(this,h,o),o.fatal||!o.context)return;o.context.type===H.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},T.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 u=o[this.trackId];this.log("Now switching to audio-track index "+h);var d=o[h],A=d.id,v=d.groupId,m=v===void 0?"":v,R=d.name,x=d.type,f=d.url;if(this.trackId=h,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(Q.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:m,name:R,type:x,url:f}),d.details&&!d.details.live)return;var c=this.switchParams(d.url,u==null?void 0:u.details);this.loadPlaylist(c)},T.selectInitialTrack=function(){var h=this.tracksInGroup;console.assert(h.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,u=this.findTrackId(o)||this.findTrackId();u!==-1?this.setAudioTrack(u):(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}))},T.findTrackId=function(h){for(var o=this.tracksInGroup,u=0;u<o.length;u++){var d=o[u];if((!this.selectDefaultTrack||d.default)&&(!h||h===d.name))return d.id}return-1},T.loadPlaylist=function(h){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var u=o.id,d=o.groupId,A=o.url;if(h)try{A=h.addDirectives(A)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(Q.Events.AUDIO_TRACK_LOADING,{url:A,id:u,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);Y.default=w},"./src/controller/base-playlist-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return O});var Q=L("./src/polyfills/number.ts"),B=L("./src/types/level.ts"),_=L("./src/controller/level-helper.ts"),H=L("./src/utils/logger.ts"),W=L("./src/errors.ts"),O=function(){function M(w,k){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,k+":"),this.warn=H.logger.warn.bind(H.logger,k+":"),this.hls=w}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===W.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 T=D==null?void 0:D.renditionReports;if(T)for(var S=0;S<T.length;S++){var h=T[S],o=""+h.URI;if(o===k.substr(-o.length)){var u=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)(u))return new B.HlsUrlParameters(u,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,T){var S=this,h=D.details,o=D.stats,u=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(h.advancedDateTime=Date.now()-u,h.live||T!=null&&T.live){if(h.reloaded(T),T&&this.log("live playlist "+k+" "+(h.advanced?"REFRESHED "+h.lastPartSn+"-"+h.lastPartIndex:"MISSED")),T&&h.fragments.length>0&&Object(_.mergeDetails)(T,h),!this.canLoad||!h.live)return;var d,A=void 0,v=void 0;if(h.canBlockReload&&h.endSN&&h.advanced){var m=this.hls.config.lowLatencyMode,R=h.lastPartSn,x=h.endSN,f=h.lastPartIndex,c=f!==-1,s=R===x,a=m?0:f;c?(A=s?x+1:R,v=s?a:f+1):A=x+1;var b=h.age,g=b+h.ageHeader,E=Math.min(g-h.partTarget,h.targetduration*1.5);if(E>0){if(T&&E>T.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+T.tuneInGoal+" to: "+E+" with playlist age: "+h.age),E=0;else{var P=Math.floor(E/h.targetduration);if(A+=P,v!==void 0){var G=Math.round(E%h.targetduration/h.partTarget);v+=G}this.log("CDN Tune-in age: "+h.ageHeader+"s last advanced "+b.toFixed(2)+"s goal: "+E+" skip sn "+P+" to part "+v)}h.tuneInGoal=E}if(d=this.getDeliveryDirectives(h,D.deliveryDirectives,A,v),m||!s){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(h,D.deliveryDirectives,A,v);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 S.loadPlaylist(d)},V)}else this.clearTimer()},y.getDeliveryDirectives=function(k,D,T,S){var h=Object(B.getSkipValue)(k,T);return D!=null&&D.skip&&k.deltaUpdateFailed&&(T=D.msn,S=D.part,h=B.HlsSkip.No),new B.HlsUrlParameters(T,S,h)},y.retryLoadingOrFail=function(k){var D=this,T=this.hls.config,S=this.retryCount<T.levelLoadingMaxRetry;if(S){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)*T.levelLoadingRetryDelay,T.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 S},M}()},"./src/controller/base-stream-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"State",function(){return x}),L.d(Y,"default",function(){return f});var Q=L("./src/polyfills/number.ts"),B=L("./src/task-loop.ts"),_=L("./src/controller/fragment-tracker.ts"),H=L("./src/utils/buffer-helper.ts"),W=L("./src/utils/logger.ts"),O=L("./src/events.ts"),M=L("./src/errors.ts"),y=L("./src/types/transmuxer.ts"),w=L("./src/utils/mp4-tools.ts"),k=L("./src/utils/discontinuities.ts"),D=L("./src/controller/fragment-finders.ts"),T=L("./src/controller/level-helper.ts"),S=L("./src/loader/fragment-loader.ts"),h=L("./src/crypt/decrypter.ts"),o=L("./src/utils/time-ranges.ts"),u=L("./src/types/loader.ts");function d(c,s){for(var a=0;a<s.length;a++){var b=s[a];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}function A(c,s,a){return s&&d(c.prototype,s),a&&d(c,a),c}function v(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function m(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,R(c,s)}function R(c,s){return R=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},R(c,s)}var x={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"},f=function(c){m(s,c);function s(b,g,E){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=x.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=E,P.log=W.logger.log.bind(W.logger,E+":"),P.warn=W.logger.warn.bind(W.logger,E+":"),P.hls=b,P.fragmentLoader=new S.default(b.config),P.fragmentTracker=g,P.config=b.config,P.decrypter=new h.default(b,b.config),b.on(O.Events.KEY_LOADED,P.onKeyLoaded,v(P)),P}var a=s.prototype;return a.doTick=function(){this.onTickEnd()},a.onTickEnd=function(){},a.startLoad=function(g){},a.stopLoad=function(){this.fragmentLoader.abort();var g=this.fragCurrent;g&&this.fragmentTracker.removeFragment(g),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=x.STOPPED},a._streamEnded=function(g,E){var P=this.fragCurrent,G=this.fragmentTracker;if(!E.live&&P&&P.sn===E.endSN&&!g.nextStart){var V=G.getState(P);return V===_.FragmentState.PARTIAL||V===_.FragmentState.OK}return!1},a.onMediaAttached=function(g,E){var P=this.media=this.mediaBuffer=E.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var G=this.config;this.levels&&G.autoStartLoad&&this.state===x.STOPPED&&this.startLoad(G.startPosition)},a.onMediaDetaching=function(){var g=this.media;g!=null&&g.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),g&&(g.removeEventListener("seeking",this.onvseeking),g.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 g=this.config,E=this.fragCurrent,P=this.media,G=this.mediaBuffer,V=this.state,$=P?P.currentTime:0,z=H.BufferHelper.bufferInfo(G||P,$,g.maxBufferHole);if(this.log("media seeking to "+(Object(Q.isFiniteNumber)($)?$.toFixed(3):$)+", state: "+V),V===x.ENDED)this.resetLoadingState();else if(E&&!z.len){var F=g.maxFragLookUpTolerance,ee=E.start-F,ae=E.start+E.duration+F,ce=$>ae;($<ee||ce)&&(ce&&E.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),E.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(g,E){if(this.state!==x.KEY_LOADING||E.frag!==this.fragCurrent||!this.levels)return;this.state=x.IDLE;var P=this.levels[E.frag.level].details;P&&this.loadFragment(E.frag,P,E.frag.start)},a.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},a.onHandlerDestroyed=function(){this.state=x.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(g,E){this.log("Loading key for "+g.sn+" of ["+E.startSN+"-"+E.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=x.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(O.Events.KEY_LOADING,{frag:g})},a.loadFragment=function(g,E,P){this._loadFragForPlayback(g,E,P)},a._loadFragForPlayback=function(g,E,P){var G=this,V=function(z){if(G.fragContextChanged(g)){G.warn("Fragment "+g.sn+(z.part?" p: "+z.part.index:"")+" of level "+g.level+" was dropped during download."),G.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,G._handleFragmentLoadProgress(z)};this._doFragLoad(g,E,P,V).then(function($){if(!$)return;G.fragLoadError=0;var z=G.state;if(G.fragContextChanged(g)){(z===x.FRAG_LOADING||z===x.BACKTRACKING||!G.fragCurrent&&z===x.PARSING)&&(G.fragmentTracker.removeFragment(g),G.state=x.IDLE);return}if("payload"in $&&(G.log("Loaded fragment "+g.sn+" of level "+g.level),G.hls.trigger(O.Events.FRAG_LOADED,$),G.state===x.BACKTRACKING)){G.fragmentTracker.backtrack(g,$),G.resetFragmentLoading(g);return}G._handleFragmentLoadComplete($)}).catch(function($){G.warn($),G.resetFragmentLoading(g)})},a.flushMainBuffer=function(g,E,P){if(P===void 0&&(P=null),!(g-E))return;var G={startOffset:g,endOffset:E,type:P};this.fragLoadError=0,this.hls.trigger(O.Events.BUFFER_FLUSHING,G)},a._loadInitSegment=function(g){var E=this;this._doFragLoad(g).then(function(P){if(!P||E.fragContextChanged(g)||!E.levels)throw new Error("init load aborted");return P}).then(function(P){var G=E.hls,V=P.payload,$=g.decryptdata;if(V&&V.byteLength>0&&$&&$.key&&$.iv&&$.method==="AES-128"){var z=self.performance.now();return E.decrypter.webCryptoDecrypt(new Uint8Array(V),$.key.buffer,$.iv.buffer).then(function(F){var ee=self.performance.now();return G.trigger(O.Events.FRAG_DECRYPTED,{frag:g,payload:F,stats:{tstart:z,tdecrypt:ee}}),P.payload=F,P})}return P}).then(function(P){var G=E.fragCurrent,V=E.hls,$=E.levels;if(!$)throw new Error("init load aborted, missing levels");var z=$[g.level].details;console.assert(z,"Level details are defined when init segment is loaded");var F=g.stats;E.state=x.IDLE,E.fragLoadError=0,g.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===G&&V.trigger(O.Events.FRAG_BUFFERED,{stats:F,frag:G,part:null,id:g.type}),E.tick()}).catch(function(P){E.warn(P),E.resetFragmentLoading(g)})},a.fragContextChanged=function(g){var E=this.fragCurrent;return!g||!E||g.level!==E.level||g.sn!==E.sn||g.urlId!==E.urlId},a.fragBufferedComplete=function(g,E){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(E?" part: "+E.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+o.default.toString(H.BufferHelper.getBuffered(P))),this.state=x.IDLE,this.tick()},a._handleFragmentLoadComplete=function(g){var E=this.transmuxer;if(!E)return;var P=g.frag,G=g.part,V=g.partsLoaded,$=!V||V.length===0||V.some(function(F){return!F}),z=new y.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,G?G.index:-1,!$);E.flush(z)},a._handleFragmentLoadProgress=function(g){},a._doFragLoad=function(g,E,P,G){var V=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(g.start,P||0),this.config.lowLatencyMode&&E){var $=E.partList;if($&&G){P>g.end&&E.fragmentHint&&(g=E.fragmentHint);var z=this.getNextPart($,g,P);if(z>-1){var F=$[z];return this.log("Loading part sn: "+g.sn+" p: "+F.index+" cc: "+g.cc+" of playlist ["+E.startSN+"-"+E.endSN+"] parts [0-"+z+"-"+($.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=F.start+F.duration,this.state=x.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:g,part:$[z],targetBufferTime:P}),this.doFragPartsLoad(g,$,z,G).catch(function(ee){return V.handleFragLoadError(ee)})}else if(!g.url||this.loadedEndOfParts($,P))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(E?"of ["+E.startSN+"-"+E.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(P.toFixed(3))),Object(Q.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=x.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:g,targetBufferTime:P}),this.fragmentLoader.load(g,G).catch(function(ee){return V.handleFragLoadError(ee)})},a.doFragPartsLoad=function(g,E,P,G){var V=this;return new Promise(function($,z){var F=[],ee=function ae(ce){var ve=E[ce];V.fragmentLoader.loadPart(g,ve,G).then(function(Me){F[ve.index]=Me;var xe=Me.part;V.hls.trigger(O.Events.FRAG_LOADED,Me);var Ee=E[ce+1];if(Ee&&Ee.fragment===g)ae(ce+1);else return $({frag:g,part:xe,partsLoaded:F})}).catch(z)};ee(P)})},a.handleFragLoadError=function(g){var E=g.data;return E&&E.details===M.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(E.frag,E.part):this.hls.trigger(O.Events.ERROR,E),null},a._handleTransmuxerFlush=function(g){var E=this.getCurrentContext(g);if(!E||this.state!==x.PARSING){this.fragCurrent||(this.state=x.IDLE);return}var P=E.frag,G=E.part,V=E.level,$=self.performance.now();P.stats.parsing.end=$,G&&(G.stats.parsing.end=$),this.updateLevelTiming(P,G,V,g.partial)},a.getCurrentContext=function(g){var E=this.levels,P=g.level,G=g.sn,V=g.part;if(!E||!E[P])return this.warn("Levels object was unset while buffering fragment "+G+" of level "+P+". The current chunk will not be buffered."),null;var $=E[P],z=V>-1?Object(T.getPartWith)($,G,V):null,F=z?z.fragment:Object(T.getFragmentWithSN)($,G,this.fragCurrent);return F?{frag:F,part:z,level:$}:null},a.bufferFragmentData=function(g,E,P,G){if(!g||this.state!==x.PARSING)return;var V=g.data1,$=g.data2,z=V;if(V&&$&&(z=Object(w.appendUint8Array)(V,$)),!z||!z.length)return;var F={type:g.type,frag:E,part:P,chunkMeta:G,parent:E.type,data:z};this.hls.trigger(O.Events.BUFFER_APPENDING,F),g.dropped&&g.independent&&!P&&this.flushBufferGap(E)},a.flushBufferGap=function(g){var E=this.media;if(!E)return;if(!H.BufferHelper.isBuffered(E,E.currentTime)){this.flushMainBuffer(0,g.start);return}var P=E.currentTime,G=H.BufferHelper.bufferInfo(E,P,0),V=g.duration,$=Math.min(this.config.maxFragLookUpTolerance*2,V*.25),z=Math.max(Math.min(g.start-$,G.end-$),P+$);g.start-z>$&&this.flushMainBuffer(z,g.start)},a.getFwdBufferInfo=function(g,E){var P=this.config,G=this.getLoadPosition();if(!Object(Q.isFiniteNumber)(G))return null;var V=H.BufferHelper.bufferInfo(g,G,P.maxBufferHole);if(V.len===0&&V.nextStart!==void 0){var $=this.fragmentTracker.getBufferedFrag(G,E);if($&&V.nextStart<$.end)return H.BufferHelper.bufferInfo(g,G,Math.max(V.nextStart,P.maxBufferHole))}return V},a.getMaxBufferLength=function(g){var E=this.config,P;return g?P=Math.max(8*E.maxBufferSize/g,E.maxBufferLength):P=E.maxBufferLength,Math.min(P,E.maxMaxBufferLength)},a.reduceMaxBufferLength=function(g){var E=this.config,P=g||E.maxBufferLength;return E.maxMaxBufferLength>=P?(E.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+E.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(g,E){var P,G,V=E.fragments,$=V.length;if(!$)return null;var z=this.config,F=V[0].start,ee;if(E.live){var ae=z.initialLiveManifestSize;if($<ae)return this.warn("Not enough fragments to start playback (have: "+$+", need: "+ae+")"),null;!E.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(ee=this.getInitialLiveFragment(E,V),this.startPosition=ee?this.hls.liveSyncPosition||ee.start:g)}else g<=F&&(ee=V[0]);if(!ee){var ce=z.lowLatencyMode?E.partEnd:E.fragmentEnd;ee=this.getFragmentAtPosition(g,ce,E)}return(P=ee)!==null&&P!==void 0&&P.initSegment&&!((G=ee)!==null&&G!==void 0&&G.initSegment.data)&&!this.bitrateTest&&(ee=ee.initSegment),ee},a.getNextPart=function(g,E,P){for(var G=-1,V=!1,$=!0,z=0,F=g.length;z<F;z++){var ee=g[z];if($=$&&!ee.independent,G>-1&&P<ee.start)break;var ae=ee.loaded;!ae&&(V||ee.independent||$)&&ee.fragment===E&&(G=z),V=ae}return G},a.loadedEndOfParts=function(g,E){var P=g[g.length-1];return P&&E>P.start&&P.loaded},a.getInitialLiveFragment=function(g,E){var P=this.fragPrevious,G=null;if(P){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),G=Object(D.findFragmentByPDT)(E,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!G){var V=P.sn+1;if(V>=g.startSN&&V<=g.endSN){var $=E[V-g.startSN];P.cc===$.cc&&(G=$,this.log("Live playlist, switching playlist, load frag with next SN: "+G.sn))}G||(G=Object(D.findFragWithCC)(E,P.cc),G&&this.log("Live playlist, switching playlist, load frag with same CC: "+G.sn))}}else{var z=this.hls.liveSyncPosition;z!==null&&(G=this.getFragmentAtPosition(z,this.bitrateTest?g.fragmentEnd:g.edge,g))}return G},a.getFragmentAtPosition=function(g,E,P){var G=this.config,V=this.fragPrevious,$=P.fragments,z=P.endSN,F=P.fragmentHint,ee=G.maxFragLookUpTolerance,ae=!!(G.lowLatencyMode&&P.partList&&F);ae&&F&&!this.bitrateTest&&($=$.concat(F),z=F.sn);var ce;if(g<E){var ve=g>E-ee?0:ee;ce=Object(D.findFragmentByPTS)(V,$,g,ve)}else ce=$[$.length-1];if(ce){var Me=ce.sn-P.startSN,xe=V&&ce.level===V.level,Ee=$[Me+1],Te=this.fragmentTracker.getState(ce);if(Te===_.FragmentState.BACKTRACKED){ce=null;for(var Se=Me;$[Se]&&this.fragmentTracker.getState($[Se])===_.FragmentState.BACKTRACKED;)V?ce=$[Se--]:ce=$[--Se];ce||(ce=Ee)}else V&&ce.sn===V.sn&&!ae&&(xe&&(ce.sn<z&&this.fragmentTracker.getState(Ee)!==_.FragmentState.OK?(this.log("SN "+ce.sn+" just loaded, load next one: "+Ee.sn),ce=Ee):ce=null))}return ce},a.synchronizeToLiveEdge=function(g){var E=this.config,P=this.media;if(!P)return;var G=this.hls.liveSyncPosition,V=P.currentTime,$=g.fragments[0].start,z=g.edge,F=V>=$-E.maxFragLookUpTolerance&&V<=z;if(G!==null&&P.duration>G&&(V<G||!F)){var ee=E.liveMaxLatencyDuration!==void 0?E.liveMaxLatencyDuration:E.liveMaxLatencyDurationCount*g.targetduration;(!F&&P.readyState<4||V<z-ee)&&(this.loadedmetadata||(this.nextLoadPosition=G),P.readyState&&(this.warn("Playback: "+V.toFixed(3)+" is located too far from the end of live sliding playlist: "+z+", reset currentTime to : "+G.toFixed(3)),P.currentTime=G))}},a.alignPlaylists=function(g,E){var P=this.levels,G=this.levelLastLoaded,V=this.fragPrevious,$=G!==null?P[G]:null,z=g.fragments.length;if(!z)return this.warn("No fragments in live playlist"),0;var F=g.fragments[0].start,ee=!E,ae=g.alignedSliding&&Object(Q.isFiniteNumber)(F);if(ee||!ae&&!F){Object(k.alignStream)(V,$,g);var ce=g.fragments[0].start;return this.log("Live playlist sliding: "+ce.toFixed(2)+" start-sn: "+(E?E.startSN:"na")+"->"+g.startSN+" prev-sn: "+(V?V.sn:"na")+" fragments: "+z),ce}return F},a.waitForCdnTuneIn=function(g){var E=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*E)},a.setStartPosition=function(g,E){var P=this.startPosition;if(P<E&&(P=-1),P===-1||this.lastCurrentTime===-1){var G=g.startTimeOffset;Object(Q.isFiniteNumber)(G)?(P=E+G,G<0&&(P+=g.totalduration),P=Math.min(Math.max(E,P),E+g.totalduration),this.log("Start time offset "+G+" found in playlist, adjust startPosition to "+P),this.startPosition=P):g.live?P=this.hls.liveSyncPosition||E:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},a.getLoadPosition=function(){var g=this.media,E=0;return this.loadedmetadata&&g?E=g.currentTime:this.nextLoadPosition&&(E=this.nextLoadPosition),E},a.handleFragLoadAborted=function(g,E){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(E?" part"+E.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},a.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=x.IDLE)},a.onFragmentOrKeyLoadError=function(g,E){if(E.fatal)return;var P=E.frag;if(!P||P.type!==g)return;var G=this.fragCurrent;console.assert(G&&P.sn===G.sn&&P.level===G.level&&P.urlId===G.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 "+g+" "+P.level+" failed to load, retrying in "+$+"ms"),this.retryDate=self.performance.now()+$,this.fragLoadError++,this.state=x.FRAG_LOADING_WAITING_RETRY}else E.levelRetry?(g===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=x.IDLE):(W.logger.error(E.details+" reaches max retry, redispatch as fatal ..."),E.fatal=!0,this.hls.stopLoad(),this.state=x.ERROR)},a.afterBufferFlushed=function(g,E,P){if(!g)return;var G=H.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(E,G,P),this.state===x.ENDED&&this.resetLoadingState()},a.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=x.IDLE},a.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var E=this.levels?this.levels[g].details:null;if(E!=null&&E.live)return this.startPosition=-1,this.setStartPosition(E,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},a.updateLevelTiming=function(g,E,P,G){var V=this,$=P.details;console.assert(!!$,"level.details must be defined");var z=Object.keys(g.elementaryStreams).reduce(function(F,ee){var ae=g.elementaryStreams[ee];if(ae){var ce=ae.endPTS-ae.startPTS;if(ce<=0)return V.warn("Could not parse fragment "+g.sn+" "+ee+" duration reliably ("+ce+") resetting transmuxer to fallback to playlist timing"),V.resetTransmuxer(),F||!1;var ve=G?0:Object(T.updateFragPTSDTS)($,g,ae.startPTS,ae.endPTS,ae.startDTS,ae.endDTS);return V.hls.trigger(O.Events.LEVEL_PTS_UPDATED,{details:$,level:P,drift:ve,type:ee,frag:g,start:ae.startPTS,end:ae.endPTS}),!0}return F},!1);z?(this.state=x.PARSED,this.hls.trigger(O.Events.FRAG_PARSED,{frag:g,part:E})):this.resetLoadingState()},a.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(s,[{key:"state",get:function(){return this._state},set:function(g){var E=this._state;E!==g&&(this._state=g,this.log(E+"->"+g))}}]),s}(B.default)},"./src/controller/buffer-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return D});var Q=L("./src/polyfills/number.ts"),B=L("./src/events.ts"),_=L("./src/utils/logger.ts"),H=L("./src/errors.ts"),W=L("./src/utils/buffer-helper.ts"),O=L("./src/utils/mediasource-helper.ts"),M=L("./src/loader/fragment.ts"),y=L("./src/controller/buffer-operation-queue.ts"),w=Object(O.getMediaSource)(),k=/([ha]vc.)(?:\.[^.,]+)+/,D=function(){function T(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 u=o.hls,d=o.media,A=o.mediaSource;_.logger.log("[buffer-controller]: Media source opened"),d&&(o.updateMediaElementDuration(),u.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 S=T.prototype;return S.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},S.destroy=function(){this.unregisterListeners(),this.details=null},S.registerListeners=function(){var 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)},S.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)},S._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},S.onManifestParsed=function(o,u){var d=2;(u.audio&&!u.video||!u.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,_.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},S.onMediaAttaching=function(o,u){var d=this.media=u.media;if(d&&w){var A=this.mediaSource=new w;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}},S.onMediaDetaching=function(){var o=this.media,u=this.mediaSource,d=this._objectUrl;if(u){if(_.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(A){_.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.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)},S.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(u){var d=o.sourceBuffer[u];try{d&&(o.removeBufferListeners(u),o.mediaSource&&o.mediaSource.removeSourceBuffer(d),o.sourceBuffer[u]=void 0)}catch(A){_.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",A)}}),this._initSourceBuffer()},S.onBufferCodecs=function(o,u){var d=this,A=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(v){if(A){var m=d.tracks[v];if(m&&typeof m.buffer.changeType=="function"){var R=u[v],x=R.codec,f=R.levelCodec,c=R.container,s=(m.levelCodec||m.codec).replace(k,"$1"),a=(f||x).replace(k,"$1");if(s!==a){var b=c+";codecs="+(f||x);d.appendChangeType(v,b)}}}else d.pendingTracks[v]=u[v]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},S.appendChangeType=function(o,u){var d=this,A=this.operationQueue,v={execute:function(){var R=d.sourceBuffer[o];R&&(_.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+u),R.changeType(u)),A.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(R){_.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",R)}};A.append(v,o)},S.onBufferAppending=function(o,u){var d=this,A=this.hls,v=this.operationQueue,m=this.tracks,R=u.data,x=u.type,f=u.frag,c=u.part,s=u.chunkMeta,a=s.buffering[x],b=self.performance.now();a.start=b;var g=f.stats.buffering,E=c?c.stats.buffering:null;g.start===0&&(g.start=b),E&&E.start===0&&(E.start=b);var P=m.audio,G=x==="audio"&&s.id===1&&(P==null?void 0:P.container)==="audio/mpeg",V={execute:function(){if(a.executeStart=self.performance.now(),G){var z=d.sourceBuffer[x];if(z){var F=f.start-z.timestampOffset;Math.abs(F)>=.1&&(_.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+F+") sn: "+f.sn+")"),z.timestampOffset=f.start)}}d.appendExecutor(R,x)},onStart:function(){},onComplete:function(){var z=self.performance.now();a.executeEnd=a.end=z,g.first===0&&(g.first=z),E&&E.first===0&&(E.first=z);var F=d.sourceBuffer,ee={};for(var ae in F)ee[ae]=W.BufferHelper.getBuffered(F[ae]);d.appendError=0,d.hls.trigger(B.Events.BUFFER_APPENDED,{type:x,frag:f,part:c,chunkMeta:s,parent:f.type,timeRanges:ee})},onError:function(z){_.logger.error("[buffer-controller]: Error encountered while trying to append to the "+x+" SourceBuffer",z);var F={type:H.ErrorTypes.MEDIA_ERROR,parent:f.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:z,fatal:!1};z.code===DOMException.QUOTA_EXCEEDED_ERR?F.details=H.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,F.details=H.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)}};v.append(V,x)},S.onBufferFlushing=function(o,u){var d=this,A=this.operationQueue,v=function(R){return{execute:d.removeExecutor.bind(d,R,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(B.Events.BUFFER_FLUSHED,{type:R})},onError:function(f){_.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",f)}}};u.type?A.append(v(u.type),u.type):this.getSourceBufferTypes().forEach(function(m){A.append(v(m),m)})},S.onFragParsed=function(o,u){var d=this,A=u.frag,v=u.part,m=[],R=v?v.elementaryStreams:A.elementaryStreams;R[M.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(R[M.ElementaryStreamTypes.AUDIO]&&m.push("audio"),R[M.ElementaryStreamTypes.VIDEO]&&m.push("video"));var x=function(){var c=self.performance.now();A.stats.buffering.end=c,v&&(v.stats.buffering.end=c);var s=v?v.stats:A.stats;d.hls.trigger(B.Events.FRAG_BUFFERED,{frag:A,part:v,stats:s,id:A.type})};m.length===0&&_.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(x,m)},S.onFragChanged=function(o,u){this.flushBackBuffer()},S.onBufferEos=function(o,u){var d=this,A=this.getSourceBufferTypes().reduce(function(v,m){var R=d.sourceBuffer[m];return(!u.type||u.type===m)&&(R&&!R.ended&&(R.ended=!0,_.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),v&&!!(!R||R.ended)},!0);A&&this.blockBuffers(function(){var v=d.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},S.onLevelUpdated=function(o,u){var d=u.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},S.flushBackBuffer=function(){var o=this.hls,u=this.details,d=this.media,A=this.sourceBuffer;if(!d||u===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var m=u.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(Q.isFiniteNumber)(m)||m<0)return;var R=d.currentTime,x=u.levelTargetDuration,f=Math.max(m,x),c=Math.floor(R/x)*x-f;v.forEach(function(s){var a=A[s];if(a){var b=W.BufferHelper.getBuffered(a);b.length>0&&c>b.start(0)&&(o.trigger(B.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),u.live&&o.trigger(B.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),o.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:s}))}})},S.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,u=this.hls,d=this.media,A=this.mediaSource,v=o.fragments[0].start+o.totalduration,m=d.duration,R=Object(Q.isFiniteNumber)(A.duration)?A.duration:0;o.live&&u.config.liveDurationInfinity?(_.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(o)):(v>R&&v>m||!Object(Q.isFiniteNumber)(m))&&(_.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),A.duration=v)},S.updateSeekableRange=function(o){var u=this.mediaSource,d=o.fragments,A=d.length;if(A&&o.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var v=Math.max(0,d[0].start),m=Math.max(v,v+o.totalduration);u.setLiveSeekableRange(v,m)}},S.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,u=this.operationQueue,d=this.pendingTracks,A=Object.keys(d).length;if(A&&!o||A===2){this.createSourceBuffers(d),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(B.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(m){u.executeNext(m)})}},S.createSourceBuffers=function(o){var u=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var v in o)if(!u[v]){var m=o[v];if(!m)throw Error("source buffer exists for track "+v+", however track does not");var R=m.levelCodec||m.codec,x=m.container+";codecs="+R;_.logger.log("[buffer-controller]: creating sourceBuffer("+x+")");try{var f=u[v]=d.addSourceBuffer(x),c=v;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[v]={buffer:f,codec:R,container:m.container,levelCodec:m.levelCodec,id:m.id},A++}catch(s){_.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(B.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:x})}}A&&this.hls.trigger(B.Events.BUFFER_CREATED,{tracks:this.tracks})},S._onSBUpdateStart=function(o){var u=this.operationQueue,d=u.current(o);d.onStart()},S._onSBUpdateEnd=function(o){var u=this.operationQueue,d=u.current(o);d.onComplete(),u.shiftAndExecuteNext(o)},S._onSBUpdateError=function(o,u){_.logger.error("[buffer-controller]: "+o+" SourceBuffer error",u),this.hls.trigger(B.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(o);d&&d.onError(u)},S.removeExecutor=function(o,u,d){var A=this.media,v=this.mediaSource,m=this.operationQueue,R=this.sourceBuffer,x=R[o];if(!A||!v||!x){_.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(o);return}var f=Object(Q.isFiniteNumber)(A.duration)?A.duration:Infinity,c=Object(Q.isFiniteNumber)(v.duration)?v.duration:Infinity,s=Math.max(0,u),a=Math.min(d,f,c);a>s?(_.logger.log("[buffer-controller]: Removing ["+s+","+a+"] from the "+o+" SourceBuffer"),console.assert(!x.updating,o+" sourceBuffer must not be updating"),x.remove(s,a)):m.shiftAndExecuteNext(o)},S.appendExecutor=function(o,u){var d=this.operationQueue,A=this.sourceBuffer,v=A[u];if(!v){_.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(u);return}v.ended=!1,console.assert(!v.updating,u+" sourceBuffer must not be updating"),v.appendBuffer(o)},S.blockBuffers=function(o,u){var d=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){_.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var A=this.operationQueue,v=u.map(function(m){return A.appendBlocker(m)});Promise.all(v).then(function(){o(),u.forEach(function(m){var R=d.sourceBuffer[m];(!R||!R.updating)&&A.shiftAndExecuteNext(m)})})},S.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},S.addBufferListener=function(o,u,d){var A=this.sourceBuffer[o];if(!A)return;var v=d.bind(this,o);this.listeners[o].push({event:u,listener:v}),A.addEventListener(u,v)},S.removeBufferListeners=function(o){var u=this.sourceBuffer[o];if(!u)return;this.listeners[o].forEach(function(d){u.removeEventListener(d.event,d.listener)})},T}()},"./src/controller/buffer-operation-queue.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return B});var Q=L("./src/utils/logger.ts"),B=function(){function _(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var H=_.prototype;return H.append=function(O,M){var y=this.queues[M];y.push(O),y.length===1&&this.buffers[M]&&this.executeNext(M)},H.insertAbort=function(O,M){var y=this.queues[M];y.unshift(O),this.executeNext(M)},H.appendBlocker=function(O){var M,y=new Promise(function(k){M=k}),w={execute:M,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(w,O),y},H.executeNext=function(O){var M=this.buffers,y=this.queues,w=M[O],k=y[O];if(k.length){var D=k[0];try{D.execute()}catch(T){Q.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),D.onError(T),(!w||!w.updating)&&(k.shift(),this.executeNext(O))}}},H.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},H.current=function(O){return this.queues[O][0]},_}()},"./src/controller/cap-level-controller.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/events.ts");function B(W,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(W,y.key,y)}}function _(W,O,M){return O&&B(W.prototype,O),M&&B(W,M),W}var H=function(){function W(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=W.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,w){W.isLevelAllowed(w.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(w.droppedLevel)},O.onMediaAttaching=function(y,w){this.media=w.media instanceof HTMLVideoElement?w.media:null},O.onManifestParsed=function(y,w){var k=this.hls;this.restrictedLevels=[],this.firstLevel=w.firstLevel,k.config.capLevelToPlayerSize&&w.video&&this.startCapping()},O.onBufferCodecs=function(y,w){var k=this.hls;k.config.capLevelToPlayerSize&&w.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 w=this.hls;w.autoLevelCapping=this.getMaxLevel(y.length-1),w.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=w.autoLevelCapping}}},O.getMaxLevel=function(y){var w=this,k=this.hls.levels;if(!k.length)return-1;var D=k.filter(function(T,S){return W.isLevelAllowed(S,w.restrictedLevels)&&S<=y});return this.clientRect=null,W.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,w={width:0,height:0};if(y){var k=y.getBoundingClientRect();w.width=k.width,w.height=k.height,!w.width&&!w.height&&(w.width=k.right-k.left||y.width||0,w.height=k.bottom-k.top||y.height||0)}return this.clientRect=w,w},W.isLevelAllowed=function(y,w){return w===void 0&&(w=[]),w.indexOf(y)===-1},W.getMaxLevelByMediaSize=function(y,w,k){if(!y||!y.length)return-1;for(var D=function(u,d){return d?u.width!==d.width||u.height!==d.height:!0},T=y.length-1,S=0;S<y.length;S+=1){var h=y[S];if((h.width>=w||h.height>=k)&&D(h,y[S+1])){T=S;break}}return T},_(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(w){}return y}}]),W}();Y.default=H},"./src/controller/cmcd-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return D});var Q=L("./src/events.ts"),B=L("./src/types/cmcd.ts"),_=L("./src/utils/buffer-helper.ts"),H=L("./src/utils/logger.ts");function W(T,S){for(var h=0;h<S.length;h++){var o=S[h];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(T,o.key,o)}}function O(T,S,h){return S&&W(T.prototype,S),h&&W(T,h),T}function M(T,S){var h=typeof Symbol!="undefined"&&T[Symbol.iterator]||T["@@iterator"];if(h)return(h=h.call(T)).next.bind(h);if(Array.isArray(T)||(h=y(T))||S&&T&&typeof T.length=="number"){h&&(T=h);var o=0;return function(){return o>=T.length?{done:!0}:{done:!1,value:T[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(T,S){if(!T)return;if(typeof T=="string")return w(T,S);var h=Object.prototype.toString.call(T).slice(8,-1);if(h==="Object"&&T.constructor&&(h=T.constructor.name),h==="Map"||h==="Set")return Array.from(T);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return w(T,S)}function w(T,S){(S==null||S>T.length)&&(S=T.length);for(var h=0,o=new Array(S);h<S;h++)o[h]=T[h];return o}function k(){return k=Object.assign||function(T){for(var S=1;S<arguments.length;S++){var h=arguments[S];for(var o in h)Object.prototype.hasOwnProperty.call(h,o)&&(T[o]=h[o])}return T},k.apply(this,arguments)}var D=function(){function T(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(v){H.logger.warn("Could not generate manifest CMCD data.",v)}},this.applyFragmentData=function(A){try{var v=A.frag,m=o.hls.levels[v.level],R=o.getObjectType(v),x={d:v.duration*1e3,ot:R};(R===B.CMCDObjectType.VIDEO||R===B.CMCDObjectType.AUDIO||R==B.CMCDObjectType.MUXED)&&(x.br=m.bitrate/1e3,x.tb=o.getTopBandwidth(R),x.bl=o.getBufferLength(R)),o.apply(A,x)}catch(f){H.logger.warn("Could not generate segment CMCD data.",f)}},this.hls=h;var u=this.config=h.config,d=u.cmcd;d!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||T.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var S=T.prototype;return S.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)},S.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()},S.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},S.onMediaAttached=function(o,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},S.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},S.onBufferCreated=function(o,u){var d,A;this.audioBuffer=(d=u.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(A=u.tracks.video)===null||A===void 0?void 0:A.buffer},S.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}},S.apply=function(o,u){u===void 0&&(u={}),k(u,this.createData());var d=u.ot===B.CMCDObjectType.INIT||u.ot===B.CMCDObjectType.VIDEO||u.ot===B.CMCDObjectType.MUXED;if(this.starved&&d&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var A=T.toHeaders(u);if(!Object.keys(A).length)return;o.headers||(o.headers={}),k(o.headers,A)}else{var v=T.toQuery(u);if(!v)return;o.url=T.appendQueryToUri(o.url,v)}},S.getObjectType=function(o){var u=o.type;return u==="subtitle"?B.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?B.CMCDObjectType.INIT:u==="audio"?B.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?B.CMCDObjectType.VIDEO:B.CMCDObjectType.MUXED:void 0},S.getTopBandwidth=function(o){for(var u=0,d=o===B.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=M(d),v;!(v=A()).done;){var m=v.value;m.bitrate>u&&(u=m.bitrate)}return u>0?u:NaN},S.getBufferLength=function(o){var u=this.hls.media,d=o===B.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!u)return NaN;var A=_.BufferHelper.bufferInfo(d,u.currentTime,this.config.maxBufferHole);return A.len*1e3},S.createPlaylistLoader=function(){var o=this.config.pLoader,u=this.applyPlaylistData,d=o||this.config.loader;return function(){function A(m){this.loader=void 0,this.loader=new d(m)}var v=A.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(R,x,f){u(R),this.loader.load(R,x,f)},O(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},S.createFragmentLoader=function(){var o=this.config.fLoader,u=this.applyFragmentData,d=o||this.config.loader;return function(){function A(m){this.loader=void 0,this.loader=new d(m)}var v=A.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(R,x,f){u(R),this.loader.load(R,x,f)},O(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},T.uuid=function(){var o=URL.createObjectURL(new Blob),u=o.toString();return URL.revokeObjectURL(o),u.substr(u.lastIndexOf("/")+1)},T.serialize=function(o){for(var u=[],d=function(G){return!Number.isNaN(G)&&G!=null&&G!==""&&G!==!1},A=function(G){return Math.round(G)},v=function(G){return A(G/100)*100},m=function(G){return encodeURIComponent(G)},R={br:A,d:A,bl:v,dl:v,mtp:v,nor:m,rtp:v,tb:A},x=Object.keys(o||{}).sort(),f=M(x),c;!(c=f()).done;){var s=c.value,a=o[s];if(!d(a))continue;if(s==="v"&&a===1)continue;if(s=="pr"&&a===1)continue;var b=R[s];b&&(a=b(a));var g=typeof a,E=void 0;s==="ot"||s==="sf"||s==="st"?E=s+"="+a:g==="boolean"?E=s:g==="number"?E=s+"="+a:E=s+"="+JSON.stringify(a),u.push(E)}return u.join(",")},T.toHeaders=function(o){for(var u=Object.keys(o),d={},A=["Object","Request","Session","Status"],v=[{},{},{},{}],m={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},R=0,x=u;R<x.length;R++){var f=x[R],c=m[f]!=null?m[f]:1;v[c][f]=o[f]}for(var s=0;s<v.length;s++){var a=T.serialize(v[s]);a&&(d["CMCD-"+A[s]]=a)}return d},T.toQuery=function(o){return"CMCD="+encodeURIComponent(T.serialize(o))},T.appendQueryToUri=function(o,u){if(!u)return o;var d=o.includes("?")?"&":"?";return""+o+d+u},T}()},"./src/controller/eme-controller.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/events.ts"),B=L("./src/errors.ts"),_=L("./src/utils/logger.ts"),H=L("./src/utils/mediakeys-helper.ts");function W(D,T){for(var S=0;S<T.length;S++){var h=T[S];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function O(D,T,S){return T&&W(D.prototype,T),S&&W(D,S),D}var M=3,y=function(T,S,h){var o={audioCapabilities:[],videoCapabilities:[]};return T.forEach(function(u){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:h.audioRobustness||""})}),S.forEach(function(u){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:h.videoRobustness||""})}),[o]},w=function(T,S,h,o){switch(T){case H.KeySystems.WIDEVINE:return y(S,h,o);default:throw new Error("Unknown key-system: "+T)}},k=function(){function D(S){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=S,this._config=S.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var T=D.prototype;return T.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},T._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)},T._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)},T.getLicenseServerUrl=function(h){switch(h){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+h+'"')},T._attemptKeySystemAccess=function(h,o,u){var d=this,A=w(h,o,u,this._drmSystemOptions);_.logger.log("Requesting encrypted media key-system access");var v=this.requestMediaKeySystemAccess(h,A);this.mediaKeysPromise=v.then(function(m){return d._onMediaKeySystemAccessObtained(h,m)}),v.catch(function(m){_.logger.error('Failed to obtain key-system "'+h+'" access:',m)})},T._onMediaKeySystemAccessObtained=function(h,o){var u=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(v){return d.mediaKeys=v,_.logger.log('Media-keys created for key-system "'+h+'"'),u._onMediaKeysCreated(),v});return A.catch(function(v){_.logger.error("Failed to create media-keys:",v)}),A},T._onMediaKeysCreated=function(){var h=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),h._onNewMediaKeySession(o.mediaKeysSession))})},T._onNewMediaKeySession=function(h){var o=this;_.logger.log("New key-system session "+h.sessionId),h.addEventListener("message",function(u){o._onKeySessionMessage(h,u.message)},!1)},T._onKeySessionMessage=function(h,o){_.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(u){_.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),h.update(u)})},T.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 u=function(A){if(!o._media)return;o._attemptSetMediaKeys(A),o._generateRequestWithPreferredKeySession(h.initDataType,h.initData)};this.mediaKeysPromise.then(u).catch(u)},T._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}},T._generateRequestWithPreferredKeySession=function(h,o){var u=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(v){_.logger.error("Error generating key-session request:",v),u.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},T._createLicenseXhr=function(h,o,u){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,h,o,u);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,d,h),A=void 0}catch(v){_.logger.error(v)}try{d.readyState||d.open("POST",h,!0),A&&A.call(this.hls,d,h)}catch(v){throw new Error("issue setting up KeySystem license XHR "+v)}return d},T._onLicenseRequestReadyStageChange=function(h,o,u,d){switch(h.readyState){case 4:if(h.status===200){this._requestLicenseFailureCount=0,_.logger.log("License request succeeded");var A=h.response,v=this._licenseResponseCallback;if(v)try{A=v.call(this.hls,h,o)}catch(R){_.logger.error(R)}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 m=M-this._requestLicenseFailureCount+1;_.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(u,d)}break}},T._generateLicenseRequestChallenge=function(h,o){switch(h.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+h.mediaKeySystemDomain)},T._requestLicense=function(h,o){_.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){_.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(u.mediaKeySystemDomain),A=this._createLicenseXhr(d,h,o);_.logger.log("Sending license request to URL: "+d);var v=this._generateLicenseRequestChallenge(u,h);A.send(v)}catch(m){_.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},T.onMediaAttached=function(h,o){if(!this._emeEnabled)return;var u=o.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},T.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(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return h.setMediaKeys(null)}).catch(function(){})},T.onManifestParsed=function(h,o){if(!this._emeEnabled)return;var u=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(H.KeySystems.WIDEVINE,u,d)},O(D,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),D}();Y.default=k},"./src/controller/fps-controller.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/events.ts"),B=L("./src/utils/logger.ts"),_=function(){function H(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 W=H.prototype;return W.setStreamController=function(M){this.streamController=M},W.registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(M,y){var w=this.hls.config;if(w.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),w.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(M,y,w){var k=performance.now();if(y){if(this.lastTime){var D=k-this.lastTime,T=w-this.lastDroppedFrames,S=y-this.lastDecodedFrames,h=1e3*T/D,o=this.hls;if(o.trigger(Q.Events.FPS_DROP,{currentDropped:T,currentDecoded:S,totalDroppedFrames:w}),h>0&&T>o.config.fpsDroppedMonitoringThreshold*S){var u=o.currentLevel;B.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=u)&&(u=u-1,o.trigger(Q.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:o.currentLevel}),o.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=k,this.lastDroppedFrames=w,this.lastDecodedFrames=y}},W.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)},H}();Y.default=_},"./src/controller/fragment-finders.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"findFragmentByPDT",function(){return _}),L.d(Y,"findFragmentByPTS",function(){return H}),L.d(Y,"fragmentWithinToleranceTest",function(){return W}),L.d(Y,"pdtWithinToleranceTest",function(){return O}),L.d(Y,"findFragWithCC",function(){return M});var Q=L("./src/polyfills/number.ts"),B=L("./src/utils/binary-search.ts");function _(y,w,k){if(w===null||!Array.isArray(y)||!y.length||!Object(Q.isFiniteNumber)(w))return null;var D=y[0].programDateTime;if(w<(D||0))return null;var T=y[y.length-1].endProgramDateTime;if(w>=(T||0))return null;k=k||0;for(var S=0;S<y.length;++S){var h=y[S];if(O(w,k,h))return h}return null}function H(y,w,k,D){k===void 0&&(k=0),D===void 0&&(D=0);var T=null;if(y?T=w[y.sn-w[0].sn+1]||null:k===0&&w[0].start===0&&(T=w[0]),T&&W(k,D,T)===0)return T;var S=B.default.search(w,W.bind(null,k,D));return S||T}function W(y,w,k){y===void 0&&(y=0),w===void 0&&(w=0);var D=Math.min(w,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,w,k){var D=Math.min(w,k.duration+(k.deltaPTS?k.deltaPTS:0))*1e3,T=k.endProgramDateTime||0;return T-D>y}function M(y,w){return B.default.search(y,function(k){return k.cc<w?1:k.cc>w?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"FragmentState",function(){return _}),L.d(Y,"FragmentTracker",function(){return H});var Q=L("./src/events.ts"),B=L("./src/types/loader.ts"),_;(function(M){M.NOT_LOADED="NOT_LOADED",M.BACKTRACKED="BACKTRACKED",M.APPENDING="APPENDING",M.PARTIAL="PARTIAL",M.OK="OK"})(_||(_={}));var H=function(){function M(w){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=w,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 T=this.activeFragment,S=this.activeParts;if(!T)return null;if(S)for(var h=S.length;h--;){var o=S[h],u=o?o.end:T.appendedPTS;if(o.start<=k&&u!==void 0&&k<=u)return h>9&&(this.activeParts=S.slice(h-9)),o}else if(T.start<=k&&T.appendedPTS!==void 0&&k<=T.appendedPTS)return T}return this.getBufferedFrag(k,D)},y.getBufferedFrag=function(k,D){for(var T=this.fragments,S=Object.keys(T),h=S.length;h--;){var o=T[S[h]];if((o==null?void 0:o.body.type)===D&&o.buffered){var u=o.body;if(u.start<=k&&k<=u.end)return u}}return null},y.detectEvictedFragments=function(k,D,T){var S=this;Object.keys(this.fragments).forEach(function(h){var o=S.fragments[h];if(!o)return;if(!o.buffered){o.body.type===T&&S.removeFragment(o.body);return}var u=o.range[k];if(!u)return;u.time.some(function(d){var A=!S.isTimeBuffered(d.startPTS,d.endPTS,D);return A&&S.removeFragment(o.body),A})})},y.detectPartialFragments=function(k){var D=this,T=this.timeRanges,S=k.frag,h=k.part;if(!T||S.sn==="initSegment")return;var o=O(S),u=this.fragments[o];if(!u)return;Object.keys(T).forEach(function(d){var A=S.elementaryStreams[d];if(!A)return;var v=T[d],m=h!==null||A.partial===!0;u.range[d]=D.getBufferedTimes(S,h,m,v)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},y.fragBuffered=function(k){var D=O(k),T=this.fragments[D];T&&(T.backtrack=T.loaded=null,T.buffered=!0)},y.getBufferedTimes=function(k,D,T,S){for(var h={time:[],partial:T},o=D?D.start:k.start,u=D?D.end:k.end,d=k.minEndPTS||u,A=k.maxStartPTS||o,v=0;v<S.length;v++){var m=S.start(v)-this.bufferPadding,R=S.end(v)+this.bufferPadding;if(A>=m&&d<=R){h.time.push({startPTS:Math.max(o,S.start(v)),endPTS:Math.min(u,S.end(v))});break}else if(o<R&&u>m)h.partial=!0,h.time.push({startPTS:Math.max(o,S.start(v)),endPTS:Math.min(u,S.end(v))});else if(u<=m)break}return h},y.getPartialFragment=function(k){var D=null,T,S,h,o=0,u=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(A){var v=d[A];if(!v)return;W(v)&&(S=v.body.start-u,h=v.body.end+u,k>=S&&k<=h&&(T=Math.min(k-S,h-k),o<=T&&(D=v.body,o=T)))}),D},y.getState=function(k){var D=O(k),T=this.fragments[D];return T?T.buffered?W(T)?_.PARTIAL:_.OK:T.backtrack?_.BACKTRACKED:_.APPENDING:_.NOT_LOADED},y.backtrack=function(k,D){var T=O(k),S=this.fragments[T];if(!S||S.backtrack)return null;var h=S.backtrack=D||S.loaded;return S.loaded=null,h},y.getBacktrackData=function(k){var D=O(k),T=this.fragments[D];if(T){var S,h=T.backtrack;if(h!=null&&(S=h.payload)!==null&&S!==void 0&&S.byteLength)return h;this.removeFragment(k)}return null},y.isTimeBuffered=function(k,D,T){for(var S,h,o=0;o<T.length;o++){if(S=T.start(o)-this.bufferPadding,h=T.end(o)+this.bufferPadding,k>=S&&D<=h)return!0;if(D<=S)return!1}return!1},y.onFragLoaded=function(k,D){var T=D.frag,S=D.part;if(T.sn==="initSegment"||T.bitrateTest||S)return;var h=O(T);this.fragments[h]={body:T,loaded:D,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(k,D){var T=this,S=D.frag,h=D.part,o=D.timeRanges;if(S.type===B.PlaylistLevelType.MAIN)if(this.activeFragment=S,h){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(h)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(d){var A=o[d];if(T.detectEvictedFragments(d,A),!h)for(var v=0;v<A.length;v++)S.appendedPTS=Math.max(A.end(v),S.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,T){var S=this;Object.keys(this.fragments).forEach(function(h){var o=S.fragments[h];if(!o)return;if(o.buffered){var u=o.body;u.type===T&&u.start<D&&u.end>k&&S.removeFragment(u)}})},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 W(M){var y,w;return M.buffered&&(((y=M.range.video)===null||y===void 0?void 0:y.partial)||((w=M.range.audio)===null||w===void 0?void 0:w.partial))}function O(M){return M.type+"_"+M.level+"_"+M.urlId+"_"+M.sn}},"./src/controller/gap-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return W}),L.d(Y,"MAX_START_GAP_JUMP",function(){return O}),L.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return M}),L.d(Y,"SKIP_BUFFER_RANGE_START",function(){return y}),L.d(Y,"default",function(){return w});var Q=L("./src/utils/buffer-helper.ts"),B=L("./src/errors.ts"),_=L("./src/events.ts"),H=L("./src/utils/logger.ts"),W=250,O=2,M=.1,y=.05,w=function(){function k(T,S,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=T,this.media=S,this.fragmentTracker=h,this.hls=o}var D=k.prototype;return D.destroy=function(){this.hls=this.fragmentTracker=this.media=null},D.poll=function(S){var h=this.config,o=this.media,u=this.stalled,d=o.currentTime,A=o.seeking,v=this.seeking&&!A,m=!this.seeking&&A;if(this.seeking=A,d!==S){if(this.moved=!0,u!==null){if(this.stallReported){var R=self.performance.now()-u;H.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||v)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!Q.BufferHelper.getBuffered(o).length)return;var x=Q.BufferHelper.bufferInfo(o,d,0),f=x.len>0,c=x.nextStart||0;if(!f&&!c)return;if(A){var s=x.len>O,a=!c||c-d>O&&!this.fragmentTracker.getPartialFragment(d);if(s||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var b,g=Math.max(c,x.start||0)-d,E=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=E==null||((b=E.details)===null||b===void 0)?void 0:b.live,G=P?E.details.targetduration*2:O;if(g>0&&g<=G){this._trySkipBufferHole(null);return}}var V=self.performance.now();if(u===null){this.stalled=V;return}var $=V-u;!A&&$>=W&&this._reportStall(x.len);var z=Q.BufferHelper.bufferInfo(o,d,h.maxBufferHole);this._tryFixBufferStall(z,$)},D._tryFixBufferStall=function(S,h){var o=this.config,u=this.fragmentTracker,d=this.media,A=d.currentTime,v=u.getPartialFragment(A);if(v){var m=this._trySkipBufferHole(v);if(m)return}S.len>o.maxBufferHole&&h>o.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},D._reportStall=function(S){var h=this.hls,o=this.media,u=this.stallReported;u||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+S+")"),h.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:S}))},D._trySkipBufferHole=function(S){for(var h=this.config,o=this.hls,u=this.media,d=u.currentTime,A=0,v=Q.BufferHelper.getBuffered(u),m=0;m<v.length;m++){var R=v.start(m);if(d+h.maxBufferHole>=A&&d<R){var x=Math.max(R+y,u.currentTime+M);return H.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+x),this.moved=!0,this.stalled=null,u.currentTime=x,S&&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 "+x,frag:S}),x}A=v.end(m)}return 0},D._tryNudgeBuffer=function(){var S=this.config,h=this.hls,o=this.media,u=o.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<S.nudgeMaxRetry){var A=u+d*S.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+u+" to "+A),o.currentTime=A,h.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+S.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,Y,L){"use strict";L.r(Y);var Q=L("./src/events.ts"),B=L("./src/utils/texttrack-utils.ts"),_=L("./src/demux/id3.ts"),H=.25,W=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 w=this.hls;w.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),w.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M._unregisterListeners=function(){var w=this.hls;w.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),w.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M.onMediaAttached=function(w,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(w){if(!this.media)return;for(var k=0;k<w.length;k++){var D=w[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(w,k){if(!this.media)return;var D=k.frag,T=k.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var S=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,h=0;h<T.length;h++){var o=_.getID3Frames(T[h].data);if(o){var u=T[h].pts,d=h<T.length-1?T[h+1].pts:D.end,A=d-u;A<=0&&(d=u+H);for(var v=0;v<o.length;v++){var m=o[v];if(!_.isTimeStampFrame(m)){var R=new S(u,d,"");R.value=m,this.id3Track.addCue(R)}}}}},M.onBufferFlushing=function(w,k){var D=k.startOffset,T=k.endOffset,S=k.type;if(!S||S==="audio"){var h=this.id3Track;h&&Object(B.removeCuesInRange)(h,D,T)}},O}();Y.default=W},"./src/controller/latency-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return O});var Q=L("./src/errors.ts"),B=L("./src/events.ts"),_=L("./src/utils/logger.ts");function H(M,y){for(var w=0;w<y.length;w++){var k=y[w];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(M,k.key,k)}}function W(M,y,w){return y&&H(M.prototype,y),w&&H(M,w),M}var O=function(){function M(w){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=w,this.config=w.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 T=D.details;this.levelDetails=T,T.advanced&&this.timeupdate(),!T.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 T=this.computeLatency();if(T===null)return;this._latency=T;var S=this.config,h=S.lowLatencyMode,o=S.maxLiveSyncPlaybackRate;if(!h||o===1)return;var u=this.targetLatency;if(u===null)return;var d=T-u,A=Math.min(this.maxLatency,u+D.targetduration),v=d<A;if(D.live&&v&&d>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,o)),R=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;k.playbackRate=Math.min(m,Math.max(1,R))}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},W(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,T=k.partHoldBack,S=k.targetduration,h=this.config,o=h.liveSyncDuration,u=h.liveSyncDurationCount,d=h.lowLatencyMode,A=this.hls.userConfig,v=d&&T||D;(A.liveSyncDuration||A.liveSyncDurationCount||v===0)&&(v=o!==void 0?o:u*S);var m=S,R=1;return v+Math.min(this.stallCount*R,m)}},{key:"liveSyncPosition",get:function(){var k=this.estimateLiveEdge(),D=this.targetLatency,T=this.levelDetails;if(k===null||D===null||T===null)return null;var S=T.edge,h=k-D-this.edgeStalled,o=S-T.totalduration,u=S-(this.config.lowLatencyMode&&T.partTarget||T.targetduration);return Math.min(Math.max(o,h),u)}},{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 T=k.buffered.length;return T?k.buffered.end(T-1):D.edge-this.currentTime}}]),M}()},"./src/controller/level-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return h});var Q=L("./src/types/level.ts"),B=L("./src/events.ts"),_=L("./src/errors.ts"),H=L("./src/utils/codecs.ts"),W=L("./src/controller/level-helper.ts"),O=L("./src/controller/base-playlist-controller.ts"),M=L("./src/types/loader.ts");function y(){return y=Object.assign||function(o){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var A in d)Object.prototype.hasOwnProperty.call(d,A)&&(o[A]=d[A])}return o},y.apply(this,arguments)}function w(o,u){for(var d=0;d<u.length;d++){var A=u[d];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(o,A.key,A)}}function k(o,u,d){return u&&w(o.prototype,u),d&&w(o,d),o}function D(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,T(o,u)}function T(o,u){return T=Object.setPrototypeOf||function(A,v){return A.__proto__=v,A},T(o,u)}var S=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),h=function(o){D(u,o);function u(A){var v;return v=o.call(this,A,"[level-controller]")||this,v._levels=[],v._firstLevel=-1,v._startLevel=void 0,v.currentLevelIndex=-1,v.manualLevelIndex=-1,v.onParsedComplete=void 0,v._registerListeners(),v}var d=u.prototype;return d._registerListeners=function(){var v=this.hls;v.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),v.on(B.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var v=this.hls;v.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),v.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 v=this._levels;v.forEach(function(m){m.loadError=0}),o.prototype.startLoad.call(this)},d.onManifestLoaded=function(v,m){var R=[],x=[],f=[],c,s={},a,b=!1,g=!1,E=!1;if(m.levels.forEach(function($){var z=$.attrs;b=b||!!($.width&&$.height),g=g||!!$.videoCodec,E=E||!!$.audioCodec,S&&$.audioCodec&&$.audioCodec.indexOf("mp4a.40.34")!==-1&&($.audioCodec=void 0);var F=$.bitrate+"-"+$.attrs.RESOLUTION+"-"+$.attrs.CODECS;a=s[F],a?a.url.push($.url):(a=new Q.Level($),s[F]=a,R.push(a)),z&&(z.AUDIO&&Object(W.addGroupId)(a,"audio",z.AUDIO),z.SUBTITLES&&Object(W.addGroupId)(a,"text",z.SUBTITLES))}),(b||g)&&E&&(R=R.filter(function($){var z=$.videoCodec,F=$.width,ee=$.height;return!!z||!!(F&&ee)})),R=R.filter(function($){var z=$.audioCodec,F=$.videoCodec;return(!z||Object(H.isCodecSupportedInMp4)(z,"audio"))&&(!F||Object(H.isCodecSupportedInMp4)(F,"video"))}),m.audioTracks&&(x=m.audioTracks.filter(function($){return!$.audioCodec||Object(H.isCodecSupportedInMp4)($.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(x)),m.subtitles&&(f=m.subtitles,Object(W.assignTrackIdsByGroup)(f)),R.length>0){c=R[0].bitrate,R.sort(function($,z){return $.bitrate-z.bitrate}),this._levels=R;for(var P=0;P<R.length;P++)if(R[P].bitrate===c){this._firstLevel=P,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+c);break}var G=E&&!g,V={levels:R,audioTracks:x,subtitleTracks:f,firstLevel:this._firstLevel,stats:m.stats,audio:E,video:g,altAudio:!G&&x.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:m.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(v,m){if(o.prototype.onError.call(this,v,m),m.fatal)return;var R=m.context,x=this._levels[this.currentLevelIndex];if(R&&(R.type===M.PlaylistContextType.AUDIO_TRACK&&x.audioGroupIds&&R.groupId===x.audioGroupIds[x.urlId]||R.type===M.PlaylistContextType.SUBTITLE_TRACK&&x.textGroupIds&&R.groupId===x.textGroupIds[x.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,c=!0,s;switch(m.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:if(m.frag){var a=this._levels[m.frag.level];a?(a.fragmentError++,a.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=m.frag.level)):s=m.frag.level}break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(c=!1),s=R.level),f=!0;break;case _.ErrorDetails.REMUX_ALLOC_ERROR:s=m.level,f=!0;break}s!==void 0&&this.recoverLevel(m,s,f,c)},d.recoverLevel=function(v,m,R,x){var f=v.details,c=this._levels[m];if(c.loadError++,R){var s=this.retryLoadingOrFail(v);if(s)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(x){var a=c.url.length;if(a>1&&c.loadError<a)v.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var b=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==b&&this._levels[b].loadError===0&&(this.warn(f+": switch to "+b),v.levelRetry=!0,this.hls.nextAutoLevel=b)}}},d.redundantFailover=function(v){var m=this._levels[v],R=m.url.length;if(R>1){var x=(m.urlId+1)%R;this.warn("Switching to redundant URL-id "+x),this._levels.forEach(function(f){f.urlId=x}),this.level=v}},d.onFragLoaded=function(v,m){var R=m.frag;if(R!==void 0&&R.type===M.PlaylistLevelType.MAIN){var x=this._levels[R.level];x!==void 0&&(x.fragmentError=0,x.loadError=0)}},d.onLevelLoaded=function(v,m){var R,x=m.level,f=m.details,c=this._levels[x];if(!c){var s;this.warn("Invalid level index "+x),(s=m.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(f.deltaUpdateFailed=!0);return}x===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(x,m,c.details)):(R=m.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(f.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(v,m){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var x=-1,f=this.hls.audioTracks[m.id].groupId,c=0;c<R.audioGroupIds.length;c++)if(R.audioGroupIds[c]===f){x=c;break}x!==R.urlId&&(R.urlId=x,this.startLoad())}},d.loadPlaylist=function(v){var m=this.currentLevelIndex,R=this._levels[m];if(this.canLoad&&R&&R.url.length>0){var x=R.urlId,f=R.url[x];if(v)try{f=v.addDirectives(f)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+m+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+x+" "+f),this.clearTimer(),this.hls.trigger(B.Events.LEVEL_LOADING,{url:f,level:m,id:x,deliveryDirectives:v||null})}},d.removeLevel=function(v,m){var R=function(c,s){return s!==m},x=this._levels.filter(function(f,c){return c!==v?!0:f.url.length>1&&m!==void 0?(f.url=f.url.filter(R),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(R)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(R)),f.urlId=0,!0):!1}).map(function(f,c){var s=f.details;return s!=null&&s.fragments&&s.fragments.forEach(function(a){a.level=c}),f});this._levels=x,this.hls.trigger(B.Events.LEVELS_UPDATED,{levels:x})},k(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var m,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===v&&(m=R[v])!==null&&m!==void 0&&m.details)return;if(v<0||v>=R.length){var x=v<0;if(this.hls.trigger(B.Events.ERROR,{type:_.ErrorTypes.OTHER_ERROR,details:_.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:x,reason:"invalid level idx"}),x)return;v=Math.min(v,R.length-1)}this.clearTimer();var f=this.currentLevelIndex,c=R[f],s=R[v];this.log("switching to level "+v+" from "+f),this.currentLevelIndex=v;var a=y({},s,{level:v,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete a._urlId,this.hls.trigger(B.Events.LEVEL_SWITCHING,a);var b=s.details;if(!b||b.live){var g=this.switchParams(s.uri,c==null?void 0:c.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),u}(O.default)},"./src/controller/level-helper.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"addGroupId",function(){return _}),L.d(Y,"assignTrackIdsByGroup",function(){return H}),L.d(Y,"updatePTS",function(){return W}),L.d(Y,"updateFragPTSDTS",function(){return M}),L.d(Y,"mergeDetails",function(){return y}),L.d(Y,"mapPartIntersection",function(){return w}),L.d(Y,"mapFragmentIntersection",function(){return k}),L.d(Y,"adjustSliding",function(){return D}),L.d(Y,"addSliding",function(){return T}),L.d(Y,"computeReloadInterval",function(){return S}),L.d(Y,"getFragmentWithSN",function(){return h}),L.d(Y,"getPartWith",function(){return o});var Q=L("./src/polyfills/number.ts"),B=L("./src/utils/logger.ts");function _(u,d,A){switch(d){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(A);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(A);break}}function H(u){var d={};u.forEach(function(A){var v=A.groupId||"";A.id=d[v]=d[v]||0,d[v]++})}function W(u,d,A){var v=u[d],m=u[A];O(v,m)}function O(u,d){var A=d.startPTS;if(Object(Q.isFiniteNumber)(A)){var v=0,m;d.sn>u.sn?(v=A-u.start,m=u):(v=u.start-A,m=d),m.duration!==v&&(m.duration=v)}else if(d.sn>u.sn){var R=u.cc===d.cc;R&&u.minEndPTS?d.start=u.start+(u.minEndPTS-u.start):d.start=u.start+u.duration}else d.start=Math.max(u.start-d.duration,0)}function M(u,d,A,v,m,R){var x=v-A;x<=0&&(B.logger.warn("Fragment should have a positive duration",d),v=A+d.duration,R=m+d.duration);var f=A,c=v,s=d.startPTS,a=d.endPTS;if(Object(Q.isFiniteNumber)(s)){var b=Math.abs(s-A);Object(Q.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(b,d.deltaPTS):d.deltaPTS=b,f=Math.max(A,s),A=Math.min(A,s),m=Math.min(m,d.startDTS),c=Math.min(v,a),v=Math.max(v,a),R=Math.max(R,d.endDTS)}d.duration=v-A;var g=A-d.start;d.appendedPTS=v,d.start=d.startPTS=A,d.maxStartPTS=f,d.startDTS=m,d.endPTS=v,d.minEndPTS=c,d.endDTS=R;var E=d.sn;if(!u||E<u.startSN||E>u.endSN)return 0;var P,G=E-u.startSN,V=u.fragments;for(V[G]=d,P=G;P>0;P--)O(V[P],V[P-1]);for(P=G;P<V.length-1;P++)O(V[P],V[P+1]);return u.fragmentHint&&O(V[V.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,g}function y(u,d){for(var A=null,v=u.fragments,m=v.length-1;m>=0;m--){var R=v[m].initSegment;if(R){A=R;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var x=0,f;if(k(u,d,function(P,G){P.relurl&&(x=P.cc-G.cc),Object(Q.isFiniteNumber)(P.startPTS)&&Object(Q.isFiniteNumber)(P.endPTS)&&(G.start=G.startPTS=P.startPTS,G.startDTS=P.startDTS,G.appendedPTS=P.appendedPTS,G.maxStartPTS=P.maxStartPTS,G.endPTS=P.endPTS,G.endDTS=P.endDTS,G.minEndPTS=P.minEndPTS,G.duration=P.endPTS-P.startPTS,G.duration&&(f=G),d.PTSKnown=d.alignedSliding=!0),G.elementaryStreams=P.elementaryStreams,G.loader=P.loader,G.stats=P.stats,G.urlId=P.urlId,P.initSegment&&(G.initSegment=P.initSegment,A=P.initSegment)}),A){var c=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;c.forEach(function(P){var G;(!P.initSegment||P.initSegment.relurl===((G=A)===null||G===void 0?void 0:G.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 s=d.skippedSegments;s--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var a=d.fragments;if(x){B.logger.warn("discontinuity sliding from playlist, take drift into account");for(var b=0;b<a.length;b++)a[b].cc+=x}d.skippedSegments&&(d.startCC=d.fragments[0].cc),w(u.partList,d.partList,function(P,G){G.elementaryStreams=P.elementaryStreams,G.stats=P.stats}),f?M(d,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):D(u,d),a.length&&(d.totalduration=d.edge-a[0].start),d.driftStartTime=u.driftStartTime,d.driftStart=u.driftStart;var g=d.advancedDateTime;if(d.advanced&&g){var E=d.edge;d.driftStart||(d.driftStartTime=g,d.driftStart=E),d.driftEndTime=g,d.driftEnd=E}else d.driftEndTime=u.driftEndTime,d.driftEnd=u.driftEnd,d.advancedDateTime=u.advancedDateTime}function w(u,d,A){if(u&&d)for(var v=0,m=0,R=u.length;m<=R;m++){var x=u[m],f=d[m+v];x&&f&&x.index===f.index&&x.fragment.sn===f.fragment.sn?A(x,f):v--}}function k(u,d,A){for(var v=d.skippedSegments,m=Math.max(u.startSN,d.startSN)-d.startSN,R=(u.fragmentHint?1:0)+(v?d.endSN:Math.min(u.endSN,d.endSN))-d.startSN,x=d.startSN-u.startSN,f=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,c=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,s=m;s<=R;s++){var a=c[x+s],b=f[s];v&&!b&&s<v&&(b=d.fragments[s]=a),a&&b&&A(a,b)}}function D(u,d){var A=d.startSN+d.skippedSegments-u.startSN,v=u.fragments;if(A<0||A>=v.length)return;T(d,v[A].start)}function T(u,d){if(d){for(var A=u.fragments,v=u.skippedSegments;v<A.length;v++)A[v].start+=d;u.fragmentHint&&(u.fragmentHint.start+=d)}}function S(u,d){var A=1e3*u.levelTargetDuration,v=A/2,m=u.age,R=m>0&&m<A*3,x=d.loading.end-d.loading.start,f,c=u.availabilityDelay;if(u.updated===!1)if(R){var s=333*u.misses;f=Math.max(Math.min(v,x*2),s),u.availabilityDelay=(u.availabilityDelay||0)+f}else f=v;else R?(c=Math.min(c||A/2,m),u.availabilityDelay=c,f=c+A-m):f=A-x;return Math.round(f)}function h(u,d,A){if(!u||!u.details)return null;var v=u.details,m=v.fragments[d-v.startSN];return m||(m=v.fragmentHint,m&&m.sn===d?m:d<v.startSN&&A&&A.sn===d?A:null)}function o(u,d,A){if(!u||!u.details)return null;var v=u.details.partList;if(v)for(var m=v.length;m--;){var R=v[m];if(R.index===A&&R.fragment.sn===d)return R}return null}},"./src/controller/stream-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return v});var Q=L("./src/polyfills/number.ts"),B=L("./src/controller/base-stream-controller.ts"),_=L("./src/is-supported.ts"),H=L("./src/events.ts"),W=L("./src/utils/buffer-helper.ts"),O=L("./src/controller/fragment-tracker.ts"),M=L("./src/types/loader.ts"),y=L("./src/loader/fragment.ts"),w=L("./src/demux/transmuxer-interface.ts"),k=L("./src/types/transmuxer.ts"),D=L("./src/controller/gap-controller.ts"),T=L("./src/errors.ts"),S=L("./src/utils/logger.ts");function h(m,R){for(var x=0;x<R.length;x++){var f=R[x];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function o(m,R,x){return R&&h(m.prototype,R),x&&h(m,x),m}function u(m,R){m.prototype=Object.create(R.prototype),m.prototype.constructor=m,d(m,R)}function d(m,R){return d=Object.setPrototypeOf||function(f,c){return f.__proto__=c,f},d(m,R)}var A=100,v=function(m){u(R,m);function R(f,c){var s;return s=m.call(this,f,c,"[stream-controller]")||this,s.audioCodecSwap=!1,s.gapController=null,s.level=-1,s._forceStartLoad=!1,s.altAudio=!1,s.audioOnly=!1,s.fragPlaying=null,s.onvplaying=null,s.onvseeked=null,s.fragLastKbps=0,s.stalled=!1,s.couldBacktrack=!1,s.audioCodecSwitch=!1,s.videoBuffer=null,s._registerListeners(),s}var x=R.prototype;return x._registerListeners=function(){var c=this.hls;c.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.on(H.Events.ERROR,this.onError,this),c.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x._unregisterListeners=function(){var c=this.hls;c.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.off(H.Events.ERROR,this.onError,this),c.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},x.startLoad=function(c){if(this.levels){var s=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}s>0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),c=s),this.state=B.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=B.State.STOPPED},x.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},x.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_LEVEL:{var c,s=this.levels,a=this.level,b=s==null||((c=s[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 g,E=self.performance.now(),P=this.retryDate;(!P||E>=P||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=B.State.IDLE)}break;default:break}this.onTickEnd()},x.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},x.doTickIdle=function(){var c,s,a=this.hls,b=this.levelLastLoaded,g=this.levels,E=this.media,P=a.config,G=a.nextLoadLevel;if(b===null||!E&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[G])return;var V=g[G];this.level=a.nextLoadLevel=G;var $=V.details;if(!$||this.state===B.State.WAITING_LEVEL||$.live&&this.levelLastLoaded!==G){this.state=B.State.WAITING_LEVEL;return}var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:E,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 ae={};this.altAudio&&(ae.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,ae),this.state=B.State.ENDED;return}var ce=z.end,ve=this.getNextFragment(ce,$);if(this.couldBacktrack&&!this.fragPrevious&&ve&&ve.sn!=="initSegment"){var Me=ve.sn-$.startSN;Me>1&&(ve=$.fragments[Me-1],this.fragmentTracker.removeFragment(ve))}if(ve&&this.fragmentTracker.getState(ve)===O.FragmentState.OK&&this.nextLoadPosition>ce){var xe=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(E,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"&&!((s=ve.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(ve,$):this.loadFragment(ve,$,ce)},x.loadFragment=function(c,s,a){var b,g=this.fragmentTracker.getState(c);if(this.fragCurrent=c,g===O.FragmentState.BACKTRACKED){var E=this.fragmentTracker.getBacktrackData(c);if(E){this._handleFragmentLoadProgress(E),this._handleFragmentLoadComplete(E);return}else g=O.FragmentState.NOT_LOADED}g===O.FragmentState.NOT_LOADED||g===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,m.prototype.loadFragment.call(this,c,s,a)):g===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()},x.getAppendedFrag=function(c){var s=this.fragmentTracker.getAppendedFrag(c,M.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},x.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,M.PlaylistLevelType.MAIN)},x.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},x.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},x.nextLevelSwitch=function(){var c=this.levels,s=this.media;if(s!=null&&s.readyState){var a,b=this.getAppendedFrag(s.currentTime);if(b&&b.start>1&&this.flushMainBuffer(0,b.start-1),!s.paused&&c){var g=this.hls.nextLoadLevel,E=c[g],P=this.fragLastKbps;P&&this.fragCurrent?a=this.fragCurrent.duration*E.maxBitrate/(1e3*P)+1:a=0}else a=0;var G=this.getBufferedFrag(s.currentTime+a);if(G){var V=this.followingBufferedFrag(G);if(V){this.abortCurrentFrag();var $=V.maxStartPTS?V.maxStartPTS:V.start,z=V.duration,F=Math.max(G.end,$+Math.min(Math.max(z-this.config.maxFragLookUpTolerance,z*.5),z*.75));this.flushMainBuffer(F,Number.POSITIVE_INFINITY)}}}},x.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()},x.flushMainBuffer=function(c,s){m.prototype.flushMainBuffer.call(this,c,s,this.altAudio?"video":null)},x.onMediaAttached=function(c,s){m.prototype.onMediaAttached.call(this,c,s);var a=s.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)},x.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),m.prototype.onMediaDetaching.call(this)},x.onMediaPlaying=function(){this.tick()},x.onMediaSeeked=function(){var c=this.media,s=c?c.currentTime:null;Object(Q.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},x.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},x.onManifestParsed=function(c,s){var a=!1,b=!1,g;s.levels.forEach(function(E){g=E.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(a=!0),g.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=s.levels,this.startFragRequested=!1},x.onLevelLoading=function(c,s){var a=this.levels;if(!a||this.state!==B.State.IDLE)return;var b=a[s.level];(!b.details||b.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(b.details))&&(this.state=B.State.WAITING_LEVEL)},x.onLevelLoaded=function(c,s){var a,b=this.levels,g=s.level,E=s.details,P=E.totalduration;if(!b){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+E.startSN+","+E.endSN+"], cc ["+E.startCC+", "+E.endCC+"] duration:"+P);var G=this.fragCurrent;G&&(this.state===B.State.FRAG_LOADING||this.state===B.State.FRAG_LOADING_WAITING_RETRY)&&(G.level!==s.level&&G.loader&&(this.state=B.State.IDLE,G.loader.abort()));var V=b[g],$=0;if(E.live||(a=V.details)!==null&&a!==void 0&&a.live){if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed)return;$=this.alignPlaylists(E,V.details)}if(V.details=E,this.levelLastLoaded=g,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:E,level:g}),this.state===B.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(E))return;this.state=B.State.IDLE}this.startFragRequested?E.live&&this.synchronizeToLiveEdge(E):this.setStartPosition(E,$),this.tick()},x._handleFragmentLoadProgress=function(c){var s,a=c.frag,b=c.part,g=c.payload,E=this.levels;if(!E){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=E[a.level],G=P.details;if(!G){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var V=P.videoCodec,$=G.PTSKnown||!G.live,z=(s=a.initSegment)===null||s===void 0?void 0:s.data,F=this._getAudioCodec(P),ee=this.transmuxer=this.transmuxer||new w.default(this.hls,M.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ae=b?b.index:-1,ce=ae!==-1,ve=new k.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,g.byteLength,ae,ce),Me=this.initPTS[a.cc];ee.push(g,z,F,V,a,b,G.totalduration,$,ve,Me)},x.onAudioTrackSwitching=function(c,s){var a=this.altAudio,b=!!s.url,g=s.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 E=this.fragCurrent;E!=null&&E.loader&&(this.log("Switching to main audio track, cancel main fragment load"),E.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;a&&P.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:g})}},x.onAudioTrackSwitched=function(c,s){var a=s.id,b=!!this.hls.audioTracks[a].url;if(b){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=b,this.tick()},x.onBufferCreated=function(c,s){var a=s.tracks,b,g,E=!1;for(var P in a){var G=a[P];if(G.id==="main"){if(g=P,b=G,P==="video"){var V=a[P];V&&(this.videoBuffer=V.buffer)}}else E=!0}E&&b?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=b.buffer):this.mediaBuffer=this.media},x.onFragBuffered=function(c,s){var a=s.frag,b=s.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 g=b?b.stats:a.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,b)},x.onError=function(c,s){switch(s.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.MAIN,s);break;case T.ErrorDetails.LEVEL_LOAD_ERROR:case T.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==B.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=B.State.ERROR):!s.levelRetry&&this.state===B.State.WAITING_LEVEL&&(this.state=B.State.IDLE));break;case T.ErrorDetails.BUFFER_FULL_ERROR:if(s.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}},x.checkBuffer=function(){var c=this.media,s=this.gapController;if(!c||!s||!c.readyState)return;var a=W.BufferHelper.getBuffered(c);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},x.onFragLoadEmergencyAborted=function(){this.state=B.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},x.onBufferFlushed=function(c,s){var a=s.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)}},x.onLevelsUpdated=function(c,s){this.levels=s.levels},x.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},x.seekToStartPos=function(){var c=this.media,s=c.currentTime,a=this.startPosition;if(a>=0&&s<a){if(c.seeking){S.logger.log("could not seek to "+a+", already seeking at "+s);return}var b=W.BufferHelper.getBuffered(c),g=b.length?b.start(0):0,E=g-a;E>0&&(E<this.config.maxBufferHole||E<this.config.maxFragLookUpTolerance)&&(S.logger.log("adjusting start position by "+E+" to match buffer start"),a+=E,this.startPosition=a),this.log("seek to target start position "+a+" from current time "+s),c.currentTime=a}},x._getAudioCodec=function(c){var s=this.config.defaultAudioCodec||c.audioCodec;return this.audioCodecSwap&&s&&(this.log("Swapping audio codec"),s.indexOf("mp4a.40.5")!==-1?s="mp4a.40.2":s="mp4a.40.5"),s},x._loadBitrateTestFrag=function(c){var s=this;this._doFragLoad(c).then(function(a){var b=s.hls;if(!a||b.nextLoadLevel||s.fragContextChanged(c))return;s.fragLoadError=0,s.state=B.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var g=c.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),b.trigger(H.Events.FRAG_LOADED,a)})},x._handleTransmuxComplete=function(c){var s,a="main",b=this.hls,g=c.remuxResult,E=c.chunkMeta,P=this.getCurrentContext(E);if(!P){this.warn("The loading context changed while buffering fragment "+E.sn+" of level "+E.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(E.level);return}var G=P.frag,V=P.part,$=P.level,z=g.video,F=g.text,ee=g.id3,ae=g.initSegment,ce=this.altAudio?void 0:g.audio;if(this.fragContextChanged(G))return;if(this.state=B.State.PARSING,ae){ae.tracks&&(this._bufferInitSegment($,ae.tracks,G,E),b.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:G,id:a,tracks:ae.tracks}));var ve=ae.initPTS,Me=ae.timescale;Object(Q.isFiniteNumber)(ve)&&(this.initPTS[G.cc]=ve,b.trigger(H.Events.INIT_PTS_FOUND,{frag:G,id:a,initPTS:ve,timescale:Me}))}if(z&&g.independent!==!1){if($.details){var xe=z.startPTS,Ee=z.endPTS,Te=z.startDTS,Se=z.endDTS;if(V)V.elementaryStreams[z.type]={startPTS:xe,endPTS:Ee,startDTS:Te,endDTS:Se};else if(z.firstKeyFrame&&z.independent&&(this.couldBacktrack=!0),z.dropped&&z.independent){var me=this.getLoadPosition()+this.config.maxBufferHole;if(me<xe){this.backtrack(G);return}G.setElementaryStreamInfo(z.type,G.start,Ee,G.start,Se,!0)}G.setElementaryStreamInfo(z.type,xe,Ee,Te,Se),this.bufferFragmentData(z,G,V,E)}}else if(g.independent===!1){this.backtrack(G);return}if(ce){var se=ce.startPTS,Re=ce.endPTS,Ve=ce.startDTS,We=ce.endDTS;V&&(V.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:Re,startDTS:Ve,endDTS:We}),G.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,se,Re,Ve,We),this.bufferFragmentData(ce,G,V,E)}if(ee!=null&&(s=ee.samples)!==null&&s!==void 0&&s.length){var Je={frag:G,id:a,samples:ee.samples};b.trigger(H.Events.FRAG_PARSING_METADATA,Je)}if(F){var Ze={frag:G,id:a,samples:F.samples};b.trigger(H.Events.FRAG_PARSING_USERDATA,Ze)}},x._bufferInitSegment=function(c,s,a,b){var g=this;if(this.state!==B.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var E=s.audio,P=s.video,G=s.audiovideo;if(E){var V=c.audioCodec,$=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(V&&(V.indexOf("mp4a.40.5")!==-1?V="mp4a.40.2":V="mp4a.40.5"),E.metadata.channelCount!==1&&$.indexOf("firefox")===-1&&(V="mp4a.40.5")),$.indexOf("android")!==-1&&E.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+'"'),E.levelCodec=V,E.id="main",this.log("Init audio buffer, container:"+E.container+", codecs[selected/level/parsed]=["+(V||"")+"/"+(c.audioCodec||"")+"/"+E.codec+"]")}P&&(P.levelCodec=c.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(c.videoCodec||"")+"/"+P.codec+"]")),G&&this.log("Init audiovideo buffer, container:"+G.container+", codecs[level/parsed]=["+(c.attrs.CODECS||"")+"/"+G.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(z){var F=s[z],ee=F.initSegment;ee!=null&&ee.byteLength&&g.hls.trigger(H.Events.BUFFER_APPENDING,{type:z,data:ee,frag:a,part:null,chunkMeta:b,parent:a.type})}),this.tick()},x.backtrack=function(c){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(c);var s=this.fragmentTracker.backtrack(c);this.fragPrevious=null,this.nextLoadPosition=c.start,s?this.resetFragmentLoading(c):this.state=B.State.BACKTRACKING},x.checkFragmentChanged=function(){var c=this.media,s=null;if(c&&c.readyState>1&&c.seeking===!1){var a=c.currentTime;if(W.BufferHelper.isBuffered(c,a)?s=this.getAppendedFrag(a):W.BufferHelper.isBuffered(c,a+.1)&&(s=this.getAppendedFrag(a+.1)),s){var b=this.fragPlaying,g=s.level;(!b||s.sn!==b.sn||b.level!==g||s.urlId!==b.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:s}),(!b||b.level!==g)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=s)}}},o(R,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var s=this.getAppendedFrag(c.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var s=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(B.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"SubtitleStreamController",function(){return u});var Q=L("./src/events.ts"),B=L("./src/utils/logger.ts"),_=L("./src/utils/buffer-helper.ts"),H=L("./src/controller/fragment-finders.ts"),W=L("./src/utils/discontinuities.ts"),O=L("./src/controller/level-helper.ts"),M=L("./src/controller/fragment-tracker.ts"),y=L("./src/controller/base-stream-controller.ts"),w=L("./src/types/loader.ts"),k=L("./src/types/level.ts");function D(d,A){for(var v=0;v<A.length;v++){var m=A[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}function T(d,A,v){return A&&D(d.prototype,A),v&&D(d,v),d}function S(d,A){d.prototype=Object.create(A.prototype),d.prototype.constructor=d,h(d,A)}function h(d,A){return h=Object.setPrototypeOf||function(m,R){return m.__proto__=R,m},h(d,A)}var o=500,u=function(d){S(A,d);function A(m,R){var x;return x=d.call(this,m,R,"[subtitle-stream-controller]")||this,x.levels=[],x.currentTrackId=-1,x.tracksBuffered=[],x.mainDetails=null,x._registerListeners(),x}var v=A.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var R=this.hls;R.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(Q.Events.ERROR,this.onError,this),R.on(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v._unregisterListeners=function(){var R=this.hls;R.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(Q.Events.ERROR,this.onError,this),R.off(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(o),this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},v.onLevelLoaded=function(R,x){this.mainDetails=x.details},v.onSubtitleFragProcessed=function(R,x){var f=x.frag,c=x.success;if(this.fragPrevious=f,this.state=y.State.IDLE,!c)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var a,b=f.start,g=0;g<s.length;g++)if(b>=s[g].start&&b<=s[g].end){a=s[g];break}var E=f.start+f.duration;a?a.end=E:(a={start:b,end:E},s.push(a)),this.fragmentTracker.fragBuffered(f)},v.onBufferFlushing=function(R,x){var f=x.startOffset,c=x.endOffset;if(f===0&&c!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,a=this.levels;if(!a.length||!a[s]||!a[s].details)return;var b=a[s].details,g=b.targetduration,E=c-g;if(E<=0)return;x.endOffsetSubtitles=Math.max(0,E),this.tracksBuffered.forEach(function(P){for(var G=0;G<P.length;){if(P[G].end<=E){P.shift();continue}else if(P[G].start<E)P[G].start=E;else break;G++}}),this.fragmentTracker.removeFragmentsInRange(f,E,w.PlaylistLevelType.SUBTITLE)}},v.onError=function(R,x){var f,c=x.frag;if(!c||c.type!==w.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},v.onSubtitleTracksUpdated=function(R,x){var f=this,c=x.subtitleTracks;this.tracksBuffered=[],this.levels=c.map(function(s){return new k.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){f.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},v.onSubtitleTrackSwitch=function(R,x){if(this.currentTrackId=x.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var f=this.levels[this.currentTrackId];f!=null&&f.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,f&&this.setInterval(o)},v.onSubtitleTrackLoaded=function(R,x){var f,c=x.details,s=x.id,a=this.currentTrackId,b=this.levels;if(!b.length)return;var g=b[a];if(s>=b.length||s!==a||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(f=g.details)!==null&&f!==void 0&&f.live){var E=this.mainDetails;if(c.deltaUpdateFailed||!E)return;var P=E.fragments[0];if(!g.details)c.hasProgramDateTime&&E.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(c,E):P&&Object(O.addSliding)(c,P.start);else{var G=this.alignPlaylists(c,g.details);G===0&&P&&Object(O.addSliding)(c,P.start)}}if(g.details=c,this.levelLastLoaded=s,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var V=Object(H.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);V||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},v._handleFragmentLoadComplete=function(R){var x=R.frag,f=R.payload,c=x.decryptdata,s=this.hls;if(this.fragContextChanged(x))return;if(f&&f.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),c.key.buffer,c.iv.buffer).then(function(b){var g=performance.now();s.trigger(Q.Events.FRAG_DECRYPTED,{frag:x,payload:b,stats:{tstart:a,tdecrypt:g}})})}},v.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var R,x=this.currentTrackId,f=this.levels;if(!f.length||!f[x]||!f[x].details)return;var c=f[x].details,s=c.targetduration,a=this.config,b=this.media,g=_.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,b.currentTime-s,a.maxBufferHole),E=g.end,P=g.len,G=this.getMaxBufferLength()+s;if(P>G)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(E<z){var ae=a.maxFragLookUpTolerance;ee&&c.hasProgramDateTime&&(F=Object(H.findFragmentByPDT)(V,ee.endProgramDateTime,ae)),F||(F=Object(H.findFragmentByPTS)(ee,V,E,ae),!F&&ee&&ee.start<V[0].start&&(F=V[0]))}else F=V[$-1];(R=F)!==null&&R!==void 0&&R.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,E)}},v.loadFragment=function(R,x,f){this.fragCurrent=R,d.prototype.loadFragment.call(this,R,x,f)},T(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(y.default)},"./src/controller/subtitle-track-controller.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/events.ts"),B=L("./src/utils/texttrack-utils.ts"),_=L("./src/controller/base-playlist-controller.ts"),H=L("./src/types/loader.ts");function W(D,T){for(var S=0;S<T.length;S++){var h=T[S];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function O(D,T,S){return T&&W(D.prototype,T),S&&W(D,S),D}function M(D,T){D.prototype=Object.create(T.prototype),D.prototype.constructor=D,y(D,T)}function y(D,T){return y=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},y(D,T)}var w=function(D){M(T,D);function T(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 S=T.prototype;return S.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,D.prototype.destroy.call(this)},S.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)},S.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)},S.onMediaAttached=function(o,u){if(this.media=u.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},S.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},S.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var o=k(this.media.textTracks);o.forEach(function(u){Object(B.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},S.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},S.onManifestParsed=function(o,u){this.tracks=u.subtitleTracks},S.onSubtitleTrackLoaded=function(o,u){var d=u.id,A=u.details,v=this.trackId,m=this.tracksInGroup[v];if(!m){this.warn("Invalid subtitle track id "+d);return}var R=m.details;m.details=u.details,this.log("subtitle track "+d+" loaded ["+A.startSN+"-"+A.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,u,R))},S.onLevelLoading=function(o,u){this.switchLevel(u.level)},S.onLevelSwitching=function(o,u){this.switchLevel(u.level)},S.switchLevel=function(o){var u=this.hls.levels[o];if(!(u!=null&&u.textGroupIds))return;var d=u.textGroupIds[u.urlId];if(this.groupId!==d){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(x){return!d||x.groupId===d});this.tracksInGroup=v;var m=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=d;var R={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(Q.Events.SUBTITLE_TRACKS_UPDATED,R),m!==-1&&this.setSubtitleTrack(m,A)}},S.findTrackId=function(o){for(var u=this.tracksInGroup,d=0;d<u.length;d++){var A=u[d];if((!this.selectDefaultTrack||A.default)&&(!o||o===A.name))return A.id}return-1},S.onError=function(o,u){if(D.prototype.onError.call(this,o,u),u.fatal||!u.context)return;u.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},S.loadPlaylist=function(o){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var d=u.id,A=u.groupId,v=u.url;if(o)try{v=o.addDirectives(v)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(Q.Events.SUBTITLE_TRACK_LOADING,{url:v,id:d,groupId:A,deliveryDirectives:o||null})}},S.toggleTrackModes=function(o){var u=this,d=this.media,A=this.subtitleDisplay,v=this.trackId;if(!d)return;var m=k(d.textTracks),R=m.filter(function(c){return c.groupId===u.groupId});if(o===-1)[].slice.call(m).forEach(function(c){c.mode="disabled"});else{var x=R[v];x&&(x.mode="disabled")}var f=R[o];f&&(f.mode=A?"showing":"hidden")},S.setSubtitleTrack=function(o,u){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 v=A[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,v){var m=v.id,R=v.groupId,x=R===void 0?"":R,f=v.name,c=v.type,s=v.url;this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:x,name:f,type:c,url:s});var a=this.switchParams(v.url,u==null?void 0:u.details);this.loadPlaylist(a)}else this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:o})},S.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,u=k(this.media.textTracks),d=0;d<u.length;d++)if(u[d].mode==="hidden")o=d;else if(u[d].mode==="showing"){o=d;break}this.subtitleTrack!==o&&(this.subtitleTrack=o)},O(T,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,u)}}]),T}(_.default);function k(D){for(var T=[],S=0;S<D.length;S++){var h=D[S];h.kind==="subtitles"&&h.label&&T.push(D[S])}return T}Y.default=w},"./src/controller/timeline-controller.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"TimelineController",function(){return k});var Q=L("./src/polyfills/number.ts"),B=L("./src/events.ts"),_=L("./src/utils/cea-608-parser.ts"),H=L("./src/utils/output-filter.ts"),W=L("./src/utils/webvtt-parser.ts"),O=L("./src/utils/texttrack-utils.ts"),M=L("./src/utils/imsc1-ttml-parser.ts"),y=L("./src/types/loader.ts"),w=L("./src/utils/logger.ts"),k=function(){function h(u){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=S(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.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 H.default(this,"textTrack1"),A=new H.default(this,"textTrack2"),v=new H.default(this,"textTrack3"),m=new H.default(this,"textTrack4");this.cea608Parser1=new _.default(1,d,A),this.cea608Parser2=new _.default(3,v,m)}u.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(B.Events.FRAG_LOADING,this.onFragLoading,this),u.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.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,v,m,R){for(var x=!1,f=R.length;f--;){var c=R[f],s=T(c[0],c[1],A,v);if(s>=0&&(c[0]=Math.min(c[0],A),c[1]=Math.max(c[1],v),x=!0,s/(v-A)>.5))return}if(x||R.push([A,v]),this.config.renderTextTracksNatively){var a=this.captionsTracks[d];this.Cues.newCue(a,A,v,m)}else{var b=this.Cues.newCue(null,A,v,m);this.hls.trigger(B.Events.CUES_PARSED,{type:"captions",cues:b,track:d})}},o.onInitPtsFound=function(d,A){var v=this,m=A.frag,R=A.id,x=A.initPTS,f=A.timescale,c=this.unparsedVttFrags;R==="main"&&(this.initPTS[m.cc]=x,this.timescale[m.cc]=f),c.length&&(this.unparsedVttFrags=[],c.forEach(function(s){v.onFragLoaded(B.Events.FRAG_LOADED,s)}))},o.getExistingTrack=function(d){var A=this.media;if(A)for(var v=0;v<A.textTracks.length;v++){var m=A.textTracks[v];if(m[d])return m}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,v=this.captionsTracks,m=this.media,R=A[d],x=R.label,f=R.languageCode,c=this.getExistingTrack(d);if(c)v[d]=c,Object(O.clearCurrentCues)(v[d]),Object(O.sendAddTrackEvent)(v[d],m);else{var s=this.createTextTrack("captions",x,f);s&&(s[d]=!0,v[d]=s)}},o.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var A=this.captionsProperties[d];if(!A)return;var v=A.label,m={_id:d,label:v,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[d]=m,this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},o.createTextTrack=function(d,A,v){var m=this.media;return m?m.addTextTrack(d,A,v):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=S(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},o._cleanTracks=function(){var d=this.media;if(!d)return;var A=d.textTracks;if(A)for(var v=0;v<A.length;v++)Object(O.clearCurrentCues)(A[v])},o.onSubtitleTracksUpdated=function(d,A){var v=this;this.textTracks=[];var m=A.subtitleTracks||[],R=m.some(function(s){return s.textCodec===M.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var x=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var f=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,a){var b;if(a<f.length){for(var g=null,E=0;E<f.length;E++)if(D(f[E],s)){g=f[E];break}g&&(b=g)}b?Object(O.clearCurrentCues)(b):(b=v.createTextTrack("subtitles",s.name,s.lang),b&&(b.mode="disabled")),b&&(b.groupId=s.groupId,v.textTracks.push(b))})}else if(!x&&this.tracks&&this.tracks.length){var c=this.tracks.map(function(s){return{label:s.name,kind:s.type.toLowerCase(),default:s.default,subtitleTrack:s}});this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},o.onManifestLoaded=function(d,A){var v=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(m){var R=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!R)return;var x="textTrack"+R[1],f=v.captionsProperties[x];if(!f)return;f.label=m.name,m.lang&&(f.languageCode=m.lang),f.media=m})},o.onFragLoading=function(d,A){var v=this.cea608Parser1,m=this.cea608Parser2,R=this.lastSn,x=this.lastPartIndex;if(!this.enabled||!(v&&m))return;if(A.frag.type===y.PlaylistLevelType.MAIN){var f,c,s=A.frag.sn,a=(f=A==null||((c=A.part)===null||c===void 0)?void 0:c.index)!=null?f:-1;s===R+1||s===R&&a===x+1||(v.reset(),m.reset()),this.lastSn=s,this.lastPartIndex=a}},o.onFragLoaded=function(d,A){var v=A.frag,m=A.payload,R=this.initPTS,x=this.unparsedVttFrags;if(v.type===y.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(Q.isFiniteNumber)(R[v.cc])){x.push(A),R.length&&this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Missing initial subtitle PTS")});return}var f=v.decryptdata;if(f==null||f.key==null||f.method!=="AES-128"){var c=this.tracks[v.level],s=this.vttCCs;s[v.cc]||(s[v.cc]={start:v.start,prevCC:this.prevCC,new:!0},this.prevCC=v.cc),c&&c.textCodec===M.IMSC1_CODEC?this._parseIMSC1(v,m):this._parseVTTs(v,m,s)}}else this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(d,A){var v=this,m=this.hls;Object(M.parseIMSC1)(A,this.initPTS[d.cc],this.timescale[d.cc],function(R){v._appendCues(R,d.level),m.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(R){w.logger.log("Failed to parse IMSC1: "+R),m.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:R})})},o._parseVTTs=function(d,A,v){var m=this,R=this.hls;Object(W.parseWebVTT)(A,this.initPTS[d.cc],this.timescale[d.cc],v,d.cc,d.start,function(x){m._appendCues(x,d.level),R.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(x){m._fallbackToIMSC1(d,A),w.logger.log("Failed to parse VTT cue: "+x),R.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:x})})},o._fallbackToIMSC1=function(d,A){var v=this,m=this.tracks[d.level];m.textCodec||Object(M.parseIMSC1)(A,this.initPTS[d.cc],this.timescale[d.cc],function(){m.textCodec=M.IMSC1_CODEC,v._parseIMSC1(d,A)},function(){m.textCodec="wvtt"})},o._appendCues=function(d,A){var v=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[A];if(m.mode==="disabled")return;d.forEach(function(f){return Object(O.addCueToTrack)(m,f)})}else{var R=this.tracks[A],x=R.default?"default":"subtitles"+A;v.trigger(B.Events.CUES_PARSED,{type:"subtitles",cues:d,track:x})}},o.onFragDecrypted=function(d,A){var v=A.frag;if(v.type===y.PlaylistLevelType.SUBTITLE){if(!Object(Q.isFiniteNumber)(this.initPTS[v.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 v=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(v&&m))return;for(var R=0;R<A.samples.length;R++){var x=A.samples[R].bytes;if(x){var f=this.extractCea608Data(x);v.addData(A.samples[R].pts,f[0]),m.addData(A.samples[R].pts,f[1])}}},o.onBufferFlushing=function(d,A){var v=A.startOffset,m=A.endOffset,R=A.endOffsetSubtitles,x=A.type,f=this.media;if(!f||f.currentTime<m)return;if(!x||x==="video"){var c=this.captionsTracks;Object.keys(c).forEach(function(a){return Object(O.removeCuesInRange)(c[a],v,m)})}if(this.config.renderTextTracksNatively&&(v===0&&R!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(a){return Object(O.removeCuesInRange)(s[a],v,R)})}},o.extractCea608Data=function(d){for(var A=d[0]&31,v=2,m=[[],[]],R=0;R<A;R++){var x=d[v++],f=127&d[v++],c=127&d[v++],s=(4&x)!==0,a=3&x;if(f===0&&c===0)continue;s&&((a===0||a===1)&&(m[a].push(f),m[a].push(c)))}return m},h}();function D(h,o){return h&&h.label===o.name&&!(h.textTrack1||h.textTrack2)}function T(h,o,u,d){return Math.min(o,d)-Math.max(h,u)}function S(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return Q});var Q=function(){function B(H,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=W}var _=B.prototype;return _.decrypt=function(W,O){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},O,W)},B}()},"./src/crypt/aes-decryptor.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"removePadding",function(){return B}),L.d(Y,"default",function(){return _});var Q=L("./src/utils/typed-array.ts");function B(H){var W=H.byteLength,O=W&&new DataView(H.buffer).getUint8(W-1);return O?Object(Q.sliceUint8)(H,0,W-O):H}var _=function(){function H(){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 W=H.prototype;return W.uint8ArrayToUint32Array_=function(M){for(var y=new DataView(M),w=new Uint32Array(4),k=0;k<4;k++)w[k]=y.getUint32(k*4);return w},W.initTable=function(){var M=this.sBox,y=this.invSBox,w=this.subMix,k=w[0],D=w[1],T=w[2],S=w[3],h=this.invSubMix,o=h[0],u=h[1],d=h[2],A=h[3],v=new Uint32Array(256),m=0,R=0,x=0;for(x=0;x<256;x++)x<128?v[x]=x<<1:v[x]=x<<1^283;for(x=0;x<256;x++){var f=R^R<<1^R<<2^R<<3^R<<4;f=f>>>8^f&255^99,M[m]=f,y[f]=m;var c=v[m],s=v[c],a=v[s],b=v[f]*257^f*16843008;k[m]=b<<24|b>>>8,D[m]=b<<16|b>>>16,T[m]=b<<8|b>>>24,S[m]=b,b=a*16843009^s*65537^c*257^m*16843008,o[f]=b<<24|b>>>8,u[f]=b<<16|b>>>16,d[f]=b<<8|b>>>24,A[f]=b,m?(m=c^v[v[v[a^c]]],R^=v[v[R]]):m=R=1}},W.expandKey=function(M){for(var y=this.uint8ArrayToUint32Array_(M),w=!0,k=0;k<y.length&&w;)w=y[k]===this.key[k],k++;if(w)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 T=this.ksRows=(D+6+1)*4,S,h,o=this.keySchedule=new Uint32Array(T),u=this.invKeySchedule=new Uint32Array(T),d=this.sBox,A=this.rcon,v=this.invSubMix,m=v[0],R=v[1],x=v[2],f=v[3],c,s;for(S=0;S<T;S++){if(S<D){c=o[S]=y[S];continue}s=c,S%D===0?(s=s<<8|s>>>24,s=d[s>>>24]<<24|d[s>>>16&255]<<16|d[s>>>8&255]<<8|d[s&255],s^=A[S/D|0]<<24):D>6&&S%D===4&&(s=d[s>>>24]<<24|d[s>>>16&255]<<16|d[s>>>8&255]<<8|d[s&255]),o[S]=c=(o[S-D]^s)>>>0}for(h=0;h<T;h++)S=T-h,h&3?s=o[S]:s=o[S-4],h<4||S<=4?u[h]=s:u[h]=m[d[s>>>24]]^R[d[s>>>16&255]]^x[d[s>>>8&255]]^f[d[s&255]],u[h]=u[h]>>>0},W.networkToHostOrderSwap=function(M){return M<<24|(M&65280)<<8|(M&16711680)>>8|M>>>24},W.decrypt=function(M,y,w){for(var k=this.keySize+6,D=this.invKeySchedule,T=this.invSBox,S=this.invSubMix,h=S[0],o=S[1],u=S[2],d=S[3],A=this.uint8ArrayToUint32Array_(w),v=A[0],m=A[1],R=A[2],x=A[3],f=new Int32Array(M),c=new Int32Array(f.length),s,a,b,g,E,P,G,V,$,z,F,ee,ae,ce,ve=this.networkToHostOrderSwap;y<f.length;){for($=ve(f[y]),z=ve(f[y+1]),F=ve(f[y+2]),ee=ve(f[y+3]),E=$^D[0],P=ee^D[1],G=F^D[2],V=z^D[3],ae=4,ce=1;ce<k;ce++)s=h[E>>>24]^o[P>>16&255]^u[G>>8&255]^d[V&255]^D[ae],a=h[P>>>24]^o[G>>16&255]^u[V>>8&255]^d[E&255]^D[ae+1],b=h[G>>>24]^o[V>>16&255]^u[E>>8&255]^d[P&255]^D[ae+2],g=h[V>>>24]^o[E>>16&255]^u[P>>8&255]^d[G&255]^D[ae+3],E=s,P=a,G=b,V=g,ae=ae+4;s=T[E>>>24]<<24^T[P>>16&255]<<16^T[G>>8&255]<<8^T[V&255]^D[ae],a=T[P>>>24]<<24^T[G>>16&255]<<16^T[V>>8&255]<<8^T[E&255]^D[ae+1],b=T[G>>>24]<<24^T[V>>16&255]<<16^T[E>>8&255]<<8^T[P&255]^D[ae+2],g=T[V>>>24]<<24^T[E>>16&255]<<16^T[P>>8&255]<<8^T[G&255]^D[ae+3],c[y]=ve(s^v),c[y+1]=ve(g^m),c[y+2]=ve(b^R),c[y+3]=ve(a^x),v=$,m=z,R=F,x=ee,y=y+4}return c.buffer},H}()},"./src/crypt/decrypter.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return y});var Q=L("./src/crypt/aes-crypto.ts"),B=L("./src/crypt/fast-aes-key.ts"),_=L("./src/crypt/aes-decryptor.ts"),H=L("./src/utils/logger.ts"),W=L("./src/utils/mp4-tools.ts"),O=L("./src/utils/typed-array.ts"),M=16,y=function(){function w(D,T,S){var h=S===void 0?{}:S,o=h.removePKCS7Padding,u=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=T,this.removePKCS7Padding=u,u)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var k=w.prototype;return k.destroy=function(){this.observer=null},k.isSync=function(){return this.config.enableSoftwareAES},k.flush=function(){var T=this.currentResult;if(!T){this.reset();return}var S=new Uint8Array(T);return this.reset(),this.removePKCS7Padding?Object(_.removePadding)(S):S},k.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},k.decrypt=function(T,S,h,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(T),S,h);var u=this.flush();u&&o(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(T),S,h).then(o)},k.softwareDecrypt=function(T,S,h){var o=this.currentIV,u=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(T=Object(W.appendUint8Array)(d,T),this.remainderData=null);var A=this.getValidChunk(T);if(!A.length)return null;o&&(h=o);var v=this.softwareDecrypter;v||(v=this.softwareDecrypter=new _.default),v.expandKey(S);var m=u;return this.currentResult=v.decrypt(A.buffer,0,h),this.currentIV=Object(O.sliceUint8)(A,-16).buffer,m||null},k.webCryptoDecrypt=function(T,S,h){var o=this,u=this.subtle;return(this.key!==S||!this.fastAesKey)&&(this.key=S,this.fastAesKey=new B.default(u,S)),this.fastAesKey.expandKey().then(function(d){if(!u)return Promise.reject(new Error("web crypto not initialized"));var A=new Q.default(u,h);return A.decrypt(T.buffer,d)}).catch(function(d){return o.onWebCryptoError(d,T,S,h)})},k.onWebCryptoError=function(T,S,h,o){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",T),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(S,h,o)},k.getValidChunk=function(T){var S=T,h=T.length-T.length%M;return h!==T.length&&(S=Object(O.sliceUint8)(T,0,h),this.remainderData=Object(O.sliceUint8)(T,h)),S},k.logOnce=function(T){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+T),this.logEnabled=!1},w}()},"./src/crypt/fast-aes-key.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return Q});var Q=function(){function B(H,W){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=W}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,Y,L){"use strict";L.r(Y);var Q=L("./src/demux/base-audio-demuxer.ts"),B=L("./src/demux/adts.ts"),_=L("./src/utils/logger.ts"),H=L("./src/demux/id3.ts");function W(y,w){y.prototype=Object.create(w.prototype),y.prototype.constructor=y,O(y,w)}function O(y,w){return O=Object.setPrototypeOf||function(D,T){return D.__proto__=T,D},O(y,w)}var M=function(y){W(w,y);function w(D,T){var S;return S=y.call(this)||this,S.observer=void 0,S.config=void 0,S.observer=D,S.config=T,S}var k=w.prototype;return k.resetInitSegment=function(T,S,h){y.prototype.resetInitSegment.call(this,T,S,h),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:T,duration:h,inputTimeScale:9e4,dropped:0}},w.probe=function(T){if(!T)return!1;for(var S=H.getID3Data(T,0)||[],h=S.length,o=T.length;h<o;h++)if(B.probe(T,h))return _.logger.log("ADTS sync word found !"),!0;return!1},k.canParse=function(T,S){return B.canParse(T,S)},k.appendFrame=function(T,S,h){B.initTrackConfig(T,this.observer,S,h,T.manifestCodec);var o=B.appendFrame(T,S,h,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},w}(Q.default);M.minProbeByteLength=9,Y.default=M},"./src/demux/adts.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"getAudioConfig",function(){return H}),L.d(Y,"isHeaderPattern",function(){return W}),L.d(Y,"getHeaderLength",function(){return O}),L.d(Y,"getFullFrameLength",function(){return M}),L.d(Y,"canGetFrameLength",function(){return y}),L.d(Y,"isHeader",function(){return w}),L.d(Y,"canParse",function(){return k}),L.d(Y,"probe",function(){return D}),L.d(Y,"initTrackConfig",function(){return T}),L.d(Y,"getFrameDuration",function(){return S}),L.d(Y,"parseFrameHeader",function(){return h}),L.d(Y,"appendFrame",function(){return o});var Q=L("./src/utils/logger.ts"),B=L("./src/errors.ts"),_=L("./src/events.ts");function H(u,d,A,v){var m,R,x,f,c=navigator.userAgent.toLowerCase(),s=v,a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((d[A+2]&192)>>>6)+1;var b=(d[A+2]&60)>>>2;if(b>a.length-1){u.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+b});return}return x=(d[A+2]&1)<<2,x|=(d[A+3]&192)>>>6,Q.logger.log("manifest codec:"+v+", ADTS type:"+m+", samplingIndex:"+b),/firefox/i.test(c)?b>=6?(m=5,f=new Array(4),R=b-3):(m=2,f=new Array(2),R=b):c.indexOf("android")!==-1?(m=2,f=new Array(2),R=b):(m=5,f=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&b>=6?R=b-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(b>=6&&x===1||/vivaldi/i.test(c))||!v&&x===1)&&(m=2,f=new Array(2)),R=b)),f[0]=m<<3,f[0]|=(b&14)>>1,f[1]|=(b&1)<<7,f[1]|=x<<3,m===5&&(f[1]|=(R&14)>>1,f[2]=(R&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:a[b],channelCount:x,codec:"mp4a.40."+m,manifestCodec:s}}function W(u,d){return u[d]===255&&(u[d+1]&246)===240}function O(u,d){return u[d+1]&1?7:9}function M(u,d){return(u[d+3]&3)<<11|u[d+4]<<3|(u[d+5]&224)>>>5}function y(u,d){return d+5<u.length}function w(u,d){return d+1<u.length&&W(u,d)}function k(u,d){return y(u,d)&&W(u,d)&&M(u,d)<=u.length-d}function D(u,d){if(w(u,d)){var A=O(u,d);if(d+A>=u.length)return!1;var v=M(u,d);if(v<=A)return!1;var m=d+v;return m===u.length||w(u,m)}return!1}function T(u,d,A,v,m){if(!u.samplerate){var R=H(d,A,v,m);if(!R)return;u.config=R.config,u.samplerate=R.samplerate,u.channelCount=R.channelCount,u.codec=R.codec,u.manifestCodec=R.manifestCodec,Q.logger.log("parsed codec:"+u.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function S(u){return 1024*9e4/u}function h(u,d,A,v,m){var R=O(u,d),x=M(u,d);if(x-=R,x>0){var f=A+v*m;return{headerLength:R,frameLength:x,stamp:f}}}function o(u,d,A,v,m){var R=S(u.samplerate),x=h(d,A,v,m,R);if(x){var f=x.frameLength,c=x.headerLength,s=x.stamp,a=c+f,b=Math.max(0,A+a-d.length),g;b?(g=new Uint8Array(a-c),g.set(d.subarray(A+c,d.length),0)):g=d.subarray(A+c,A+a);var E={unit:g,pts:s};return b||u.samples.push(E),{sample:E,length:a,missing:b}}}},"./src/demux/base-audio-demuxer.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"initPTSFn",function(){return M});var Q=L("./src/polyfills/number.ts"),B=L("./src/demux/id3.ts"),_=L("./src/demux/dummy-demuxed-track.ts"),H=L("./src/utils/mp4-tools.ts"),W=L("./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 w=y.prototype;return w.resetInitSegment=function(D,T,S){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},w.resetTimeStamp=function(){},w.resetContiguity=function(){},w.canParse=function(D,T){return!1},w.appendFrame=function(D,T,S){},w.demux=function(D,T){this.cachedData&&(D=Object(H.appendUint8Array)(this.cachedData,D),this.cachedData=null);var S=B.getID3Data(D,0),h=S?S.length:0,o,u,d=this._audioTrack,A=this._id3Track,v=S?B.getTimeStamp(S):void 0,m=D.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=M(v,T)),S&&S.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:S}),u=this.initPTS;h<m;){if(this.canParse(D,h)){var R=this.appendFrame(d,D,h);R?(this.frameIndex++,u=R.sample.pts,h+=R.length,o=h):h=m}else B.canParse(D,h)?(S=B.getID3Data(D,h),A.samples.push({pts:u,dts:u,data:S}),h+=S.length,o=h):h++;if(h===m&&o!==m){var x=Object(W.sliceUint8)(D,o);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,x):this.cachedData=x}}return{audioTrack:d,avcTrack:Object(_.dummyTrack)(),id3Track:A,textTrack:Object(_.dummyTrack)()}},w.demuxSampleAes=function(D,T,S){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},w.flush=function(D){var T=this.cachedData;return T&&(this.cachedData=null,this.demux(T,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(_.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(_.dummyTrack)()}},w.destroy=function(){},y}(),M=function(w,k){return Object(Q.isFiniteNumber)(w)?w*90:k*9e4};Y.default=O},"./src/demux/chunk-cache.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return Q});var Q=function(){function _(){this.chunks=[],this.dataLength=0}var H=_.prototype;return H.push=function(O){this.chunks.push(O),this.dataLength+=O.length},H.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},H.reset=function(){this.chunks.length=0,this.dataLength=0},_}();function B(_,H){for(var W=new Uint8Array(H),O=0,M=0;M<_.length;M++){var y=_[M];W.set(y,O),O+=y.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"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,Y,L){"use strict";L.r(Y);var Q=L("./src/utils/logger.ts"),B=function(){function _(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var H=_.prototype;return H.loadWord=function(){var O=this.data,M=this.bytesAvailable,y=O.byteLength-M,w=new Uint8Array(4),k=Math.min(4,M);if(k===0)throw new Error("no bytes available");w.set(O.subarray(y,y+k)),this.word=new DataView(w.buffer).getUint32(0),this.bitsAvailable=k*8,this.bytesAvailable-=k},H.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)},H.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},H.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()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},H.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(O){for(var M=8,y=8,w,k=0;k<O;k++)y!==0&&(w=this.readEG(),y=(M+w+256)%256),M=y===0?M:y},H.readSPS=function(){var O=0,M=0,y=0,w=0,k,D,T,S=this.readUByte.bind(this),h=this.readBits.bind(this),o=this.readUEG.bind(this),u=this.readBoolean.bind(this),d=this.skipBits.bind(this),A=this.skipEG.bind(this),v=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);S();var R=S();if(h(5),d(3),S(),v(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var x=o();if(x===3&&d(1),v(),v(),d(1),u())for(D=x!==3?8:12,T=0;T<D;T++)u()&&(T<6?m(16):m(64))}v();var f=o();if(f===0)o();else if(f===1)for(d(1),A(),A(),k=o(),T=0;T<k;T++)A();v(),d(1);var c=o(),s=o(),a=h(1);a===0&&d(1),d(1),u()&&(O=o(),M=o(),y=o(),w=o());var b=[1,1];if(u()&&u()){var g=S();switch(g){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=[S()<<8|S(),S()<<8|S()];break}}}return{width:Math.ceil((c+1)*16-O*2-M*2),height:(2-a)*(s+1)*16-(a?2:4)*(y+w),pixelRatio:b}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},_}();Y.default=B},"./src/demux/id3.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"isHeader",function(){return Q}),L.d(Y,"isFooter",function(){return B}),L.d(Y,"getID3Data",function(){return _}),L.d(Y,"canParse",function(){return W}),L.d(Y,"getTimeStamp",function(){return O}),L.d(Y,"isTimeStampFrame",function(){return M}),L.d(Y,"getID3Frames",function(){return w}),L.d(Y,"decodeFrame",function(){return k}),L.d(Y,"utf8ArrayToStr",function(){return o}),L.d(Y,"testables",function(){return u});var Q=function(m,R){return R+10<=m.length&&(m[R]===73&&m[R+1]===68&&m[R+2]===51&&(m[R+3]<255&&m[R+4]<255&&(m[R+6]<128&&m[R+7]<128&&m[R+8]<128&&m[R+9]<128)))},B=function(m,R){return R+10<=m.length&&(m[R]===51&&m[R+1]===68&&m[R+2]===73&&(m[R+3]<255&&m[R+4]<255&&(m[R+6]<128&&m[R+7]<128&&m[R+8]<128&&m[R+9]<128)))},_=function(m,R){for(var x=R,f=0;Q(m,R);){f+=10;var c=H(m,R+6);f+=c,B(m,R+10)&&(f+=10),R+=f}return f>0?m.subarray(x,x+f):void 0},H=function(m,R){var x=0;return x=(m[R]&127)<<21,x|=(m[R+1]&127)<<14,x|=(m[R+2]&127)<<7,x|=m[R+3]&127,x},W=function(m,R){return Q(m,R)&&H(m,R+6)+10<=m.length-R},O=function(m){for(var R=w(m),x=0;x<R.length;x++){var f=R[x];if(M(f))return h(f)}return},M=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},y=function(m){var R=String.fromCharCode(m[0],m[1],m[2],m[3]),x=H(m,4),f=10;return{type:R,size:x,data:m.subarray(f,f+x)}},w=function(m){for(var R=0,x=[];Q(m,R);){var f=H(m,R+6);R+=10;for(var c=R+f;R+8<c;){var s=y(m.subarray(R)),a=k(s);a&&x.push(a),R+=s.size+10}B(m,R)&&(R+=10)}return x},k=function(m){return m.type==="PRIV"?D(m):m.type[0]==="W"?S(m):T(m)},D=function(m){if(m.size<2)return;var R=o(m.data,!0),x=new Uint8Array(m.data.subarray(R.length+1));return{key:m.type,info:R,data:x.buffer}},T=function(m){if(m.size<2)return;if(m.type==="TXXX"){var R=1,x=o(m.data.subarray(R),!0);R+=x.length+1;var f=o(m.data.subarray(R));return{key:m.type,info:x,data:f}}var c=o(m.data.subarray(1));return{key:m.type,data:c}},S=function(m){if(m.type==="WXXX"){if(m.size<2)return;var R=1,x=o(m.data.subarray(R),!0);R+=x.length+1;var f=o(m.data.subarray(R));return{key:m.type,info:x,data:f}}var c=o(m.data);return{key:m.type,data:c}},h=function(m){if(m.data.byteLength===8){var R=new Uint8Array(m.data),x=R[3]&1,f=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return f/=45,x&&(f+=4772185884e-2),Math.round(f)}return},o=function(m,R){R===void 0&&(R=!1);var x=A();if(x){var f=x.decode(m);if(R){var c=f.indexOf("\0");return c!==-1?f.substring(0,c):f}return f.replace(/\0/g,"")}for(var s=m.length,a,b,g,E="",P=0;P<s;){if(a=m[P++],a===0&&R)return E;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:E+=String.fromCharCode(a);break;case 12:case 13:b=m[P++],E+=String.fromCharCode((a&31)<<6|b&63);break;case 14:b=m[P++],g=m[P++],E+=String.fromCharCode((a&15)<<12|(b&63)<<6|(g&63)<<0);break;default:}}return E},u={decodeTextFrame:T},d;function A(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/demux/base-audio-demuxer.ts"),B=L("./src/demux/id3.ts"),_=L("./src/utils/logger.ts"),H=L("./src/demux/mpegaudio.ts");function W(y,w){y.prototype=Object.create(w.prototype),y.prototype.constructor=y,O(y,w)}function O(y,w){return O=Object.setPrototypeOf||function(D,T){return D.__proto__=T,D},O(y,w)}var M=function(y){W(w,y);function w(){return y.apply(this,arguments)||this}var k=w.prototype;return k.resetInitSegment=function(T,S,h){y.prototype.resetInitSegment.call(this,T,S,h),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:T,duration:h,inputTimeScale:9e4,dropped:0}},w.probe=function(T){if(!T)return!1;for(var S=B.getID3Data(T,0)||[],h=S.length,o=T.length;h<o;h++)if(H.probe(T,h))return _.logger.log("MPEG Audio sync word found !"),!0;return!1},k.canParse=function(T,S){return H.canParse(T,S)},k.appendFrame=function(T,S,h){return this.initPTS===null?void 0:H.appendFrame(T,S,h,this.initPTS,this.frameIndex)},w}(Q.default);M.minProbeByteLength=4,Y.default=M},"./src/demux/mp4demuxer.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/utils/mp4-tools.ts"),B=L("./src/demux/dummy-demuxed-track.ts"),_=function(){function H(O,M){this.remainderData=null,this.config=void 0,this.config=M}var W=H.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},H.probe=function(M){return Object(Q.findBox)({data:M,start:0,end:Math.min(M.length,16384)},["moof"]).length>0},W.demux=function(M){var y=M,w=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,w.samples=k.valid||new Uint8Array}else w.samples=y;return{audioTrack:Object(B.dummyTrack)(),avcTrack:w,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},W.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)()}},W.demuxSampleAes=function(M,y,w){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},H}();_.minProbeByteLength=1024,Y.default=_},"./src/demux/mpegaudio.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"appendFrame",function(){return O}),L.d(Y,"parseHeader",function(){return M}),L.d(Y,"isHeaderPattern",function(){return y}),L.d(Y,"isHeader",function(){return w}),L.d(Y,"canParse",function(){return k}),L.d(Y,"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],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function O(T,S,h,o,u){if(h+24>S.length)return;var d=M(S,h);if(d&&h+d.frameLength<=S.length){var A=d.samplesPerFrame*9e4/d.sampleRate,v=o+u*A,m={unit:S.subarray(h,h+d.frameLength),pts:v,dts:v};return T.config=[],T.channelCount=d.channelCount,T.samplerate=d.sampleRate,T.samples.push(m),{sample:m,length:d.frameLength,missing:0}}}function M(T,S){var h=T[S+1]>>3&3,o=T[S+1]>>1&3,u=T[S+2]>>4&15,d=T[S+2]>>2&3;if(h!==1&&u!==0&&u!==15&&d!==3){var A=T[S+2]>>1&1,v=T[S+3]>>6,m=h===3?3-o:o===3?3:4,R=B[m*14+u-1]*1e3,x=h===3?0:h===2?1:2,f=_[x*3+d],c=v===3?1:2,s=H[h][o],a=W[o],b=s*8*a,g=Math.floor(s*R/f+A)*a;if(Q===null){var E=navigator.userAgent||"",P=E.match(/Chrome\/(\d+)/i);Q=P?parseInt(P[1]):0}var G=!!Q&&Q<=87;return G&&o===2&&R>=224e3&&v===0&&(T[S+3]=T[S+3]|128),{sampleRate:f,channelCount:c,frameLength:g,samplesPerFrame:b}}}function y(T,S){return T[S]===255&&(T[S+1]&224)===224&&(T[S+1]&6)!==0}function w(T,S){return S+1<T.length&&y(T,S)}function k(T,S){var h=4;return y(T,S)&&h<=T.length-S}function D(T,S){if(S+1<T.length&&y(T,S)){var h=4,o=M(T,S),u=h;o!=null&&o.frameLength&&(u=o.frameLength);var d=S+u;return d===T.length||w(T,d)}return!1}},"./src/demux/sample-aes.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/crypt/decrypter.ts"),B=L("./src/demux/tsdemuxer.ts"),_=function(){function H(O,M,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new Q.default(O,M,{removePKCS7Padding:!1})}var W=H.prototype;return W.decryptBuffer=function(M,y){this.decrypter.decrypt(M,this.keyData.key.buffer,this.keyData.iv.buffer,y)},W.decryptAacSample=function(M,y,w,k){var D=M[y].unit,T=D.subarray(16,D.length-D.length%16),S=T.buffer.slice(T.byteOffset,T.byteOffset+T.length),h=this;this.decryptBuffer(S,function(o){var u=new Uint8Array(o);D.set(u,16),k||h.decryptAacSamples(M,y+1,w)})},W.decryptAacSamples=function(M,y,w){for(;;y++){if(y>=M.length){w();return}if(M[y].unit.length<32)continue;var k=this.decrypter.isSync();if(this.decryptAacSample(M,y,w,k),!k)return}},W.getAvcEncryptedData=function(M){for(var y=Math.floor((M.length-48)/160)*16+16,w=new Int8Array(y),k=0,D=32;D<=M.length-16;D+=160,k+=16)w.set(M.subarray(D,D+16),k);return w},W.getAvcDecryptedUnit=function(M,y){for(var w=new Uint8Array(y),k=0,D=32;D<=M.length-16;D+=160,k+=16)M.set(w.subarray(k,k+16),D);return M},W.decryptAvcSample=function(M,y,w,k,D,T){var S=Object(B.discardEPB)(D.data),h=this.getAvcEncryptedData(S),o=this;this.decryptBuffer(h.buffer,function(u){D.data=o.getAvcDecryptedUnit(S,u),T||o.decryptAvcSamples(M,y,w+1,k)})},W.decryptAvcSamples=function(M,y,w,k){if(M instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,w=0){if(y>=M.length){k();return}for(var D=M[y].units;!(w>=D.length);w++){var T=D[w];if(T.data.length<=48||T.type!==1&&T.type!==5)continue;var S=this.decrypter.isSync();if(this.decryptAvcSample(M,y,w,k,T,S),!S)return}}},H}();Y.default=_},"./src/demux/transmuxer-interface.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return D});var Q=L("./node_modules/webworkify-webpack/index.js"),B=L.n(Q),_=L("./src/events.ts"),H=L("./src/demux/transmuxer.ts"),W=L("./src/utils/logger.ts"),O=L("./src/errors.ts"),M=L("./src/utils/mediasource-helper.ts"),y=L("./node_modules/eventemitter3/index.js"),w=L.n(y),k=Object(M.getMediaSource)()||{isTypeSupported:function(){return!1}},D=function(){function T(h,o,u,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=u,this.onFlush=d;var v=h.config,m=function(s,a){a=a||{},a.frag=A.frag,a.id=A.id,h.trigger(s,a)};this.observer=new y.EventEmitter,this.observer.on(_.Events.FRAG_DECRYPTED,m),this.observer.on(_.Events.ERROR,m);var R={mp4:k.isTypeSupported("video/mp4"),mpeg:k.isTypeSupported("audio/mpeg"),mp3:k.isTypeSupported('audio/mp4; codecs="mp3"')},x=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var f;try{f=this.worker=Q("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.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+")")})},f.postMessage({cmd:"init",typeSupported:R,vendor:x,id:o,config:JSON.stringify(v)})}catch(c){W.logger.warn("Error in worker:",c),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new H.default(this.observer,R,v,x,o),this.worker=null}}else this.transmuxer=new H.default(this.observer,R,v,x,o)}var S=T.prototype;return S.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},S.push=function(o,u,d,A,v,m,R,x,f,c){var s=this;f.transmuxing.start=self.performance.now();var a=this.transmuxer,b=this.worker,g=m?m.start:v.start,E=v.decryptdata,P=this.frag,G=!(P&&v.cc===P.cc),V=!(P&&f.level===P.level),$=P?f.sn-P.sn:-1,z=this.part?f.part-this.part.index:1,F=!V&&($===1||$===0&&z===1),ee=self.performance.now();(V||$||v.stats.parsing.start===0)&&(v.stats.parsing.start=ee),m&&(z||!F)&&(m.stats.parsing.start=ee);var ae=new H.TransmuxState(G,F,x,V,g);if(!F||G){W.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+`
|
|
discontinuity: `+G+`
|
|
trackSwitch: `+V+`
|
|
contiguous: `+F+`
|
|
accurateTimeOffset: `+x+`
|
|
timeOffset: `+g);var ce=new H.TransmuxConfig(d,A,u,R,c);this.configureTransmuxer(ce)}if(this.frag=v,this.part=m,b)b.postMessage({cmd:"demux",data:o,decryptdata:E,chunkMeta:f,state:ae},o instanceof ArrayBuffer?[o]:[]);else if(a){var ve=a.push(o,E,f,ae);Object(H.isPromise)(ve)?ve.then(function(Me){s.handleTransmuxComplete(Me)}):this.handleTransmuxComplete(ve)}},S.flush=function(o){var u=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 v=d.flush(o);Object(H.isPromise)(v)?v.then(function(m){u.handleFlushResult(m,o)}):this.handleFlushResult(v,o)}},S.handleFlushResult=function(o,u){var d=this;o.forEach(function(A){d.handleTransmuxComplete(A)}),this.onFlush(u)},S.onWorkerMessage=function(o){var u=o.data,d=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,d.trigger(u.event,u.data);break}}},S.configureTransmuxer=function(o){var u=this.worker,d=this.transmuxer;u?u.postMessage({cmd:"configure",config:o}):d&&d.configure(o)},S.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},T}()},"./src/demux/transmuxer-worker.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return O});var Q=L("./src/demux/transmuxer.ts"),B=L("./src/events.ts"),_=L("./src/utils/logger.ts"),H=L("./node_modules/eventemitter3/index.js"),W=L.n(H);function O(D){var T=new H.EventEmitter,S=function(o,u){D.postMessage({event:o,data:u})};T.on(B.Events.FRAG_DECRYPTED,S),T.on(B.Events.ERROR,S),D.addEventListener("message",function(h){var o=h.data;switch(o.cmd){case"init":{var u=JSON.parse(o.config);D.transmuxer=new Q.default(T,o.typeSupported,u,o.vendor,o.id),Object(_.enableLogs)(u.debug),S("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(m){M(D,m)}):M(D,d);break}case"flush":{var A=o.chunkMeta,v=D.transmuxer.flush(A);Object(Q.isPromise)(v)?v.then(function(m){w(D,m,A)}):w(D,v,A);break}default:break}})}function M(D,T){if(k(T.remuxResult))return;var S=[],h=T.remuxResult,o=h.audio,u=h.video;o&&y(S,o),u&&y(S,u),D.postMessage({event:"transmuxComplete",data:T},S)}function y(D,T){T.data1&&D.push(T.data1.buffer),T.data2&&D.push(T.data2.buffer)}function w(D,T,S){T.forEach(function(h){M(D,h)}),D.postMessage({event:"flush",data:S})}function k(D){return!D.audio&&!D.video&&!D.text&&!D.id3&&!D.initSegment}},"./src/demux/transmuxer.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return u}),L.d(Y,"isPromise",function(){return v}),L.d(Y,"TransmuxConfig",function(){return m}),L.d(Y,"TransmuxState",function(){return R});var Q=L("./src/events.ts"),B=L("./src/errors.ts"),_=L("./src/crypt/decrypter.ts"),H=L("./src/demux/aacdemuxer.ts"),W=L("./src/demux/mp4demuxer.ts"),O=L("./src/demux/tsdemuxer.ts"),M=L("./src/demux/mp3demuxer.ts"),y=L("./src/remux/mp4-remuxer.ts"),w=L("./src/remux/passthrough-remuxer.ts"),k=L("./src/demux/chunk-cache.ts"),D=L("./src/utils/mp4-tools.ts"),T=L("./src/utils/logger.ts"),S;try{S=self.performance.now.bind(self.performance)}catch(x){T.logger.debug("Unable to use Performance API on this environment"),S=self.Date.now}var h=[{demux:O.default,remux:y.default},{demux:W.default,remux:w.default},{demux:H.default,remux:y.default},{demux:M.default,remux:y.default}],o=1024;h.forEach(function(x){var f=x.demux;o=Math.max(o,f.minProbeByteLength)});var u=function(){function x(c,s,a,b,g){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=s,this.config=a,this.vendor=b,this.id=g}var f=x.prototype;return f.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},f.push=function(s,a,b,g){var E=this,P=b.transmuxing;P.executeStart=S();var G=new Uint8Array(s),V=this.cache,$=this.config,z=this.currentTransmuxState,F=this.transmuxConfig;g&&(this.currentTransmuxState=g);var ee=d(G,a);if(ee&&ee.method==="AES-128"){var ae=this.getDecrypter();if($.enableSoftwareAES){var ce=ae.softwareDecrypt(G,ee.key.buffer,ee.iv.buffer);if(!ce)return P.executeEnd=S(),A(b);G=new Uint8Array(ce)}else return this.decryptionPromise=ae.webCryptoDecrypt(G,ee.key.buffer,ee.iv.buffer).then(function(Ue){var Be=E.push(Ue,null,b);return E.decryptionPromise=null,Be}),this.decryptionPromise}var ve=g||z,Me=ve.contiguous,xe=ve.discontinuity,Ee=ve.trackSwitch,Te=ve.accurateTimeOffset,Se=ve.timeOffset,me=F.audioCodec,se=F.videoCodec,Re=F.defaultInitPts,Ve=F.duration,We=F.initSegmentData;if((xe||Ee)&&this.resetInitSegment(We,me,se,Ve),xe&&this.resetInitialTimestamp(Re),Me||this.resetContiguity(),this.needsProbing(G,xe,Ee)){if(V.dataLength){var Je=V.flush();G=Object(D.appendUint8Array)(Je,G)}this.configureTransmuxer(G,F)}var Ze=this.transmux(G,ee,Se,Te,b),De=this.currentTransmuxState;return De.contiguous=!0,De.discontinuity=!1,De.trackSwitch=!1,P.executeEnd=S(),Ze},f.flush=function(s){var a=this,b=s.transmuxing;b.executeStart=S();var g=this.decrypter,E=this.cache,P=this.currentTransmuxState,G=this.decryptionPromise;if(G)return G.then(function(){return a.flush(s)});var V=[],$=P.timeOffset;if(g){var z=g.flush();z&&V.push(this.push(z,null,s))}var F=E.dataLength;E.reset();var ee=this.demuxer,ae=this.remuxer;if(!ee||!ae)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=S(),[A(s)];var ce=ee.flush($);return v(ce)?ce.then(function(ve){return a.flushRemux(V,ve,s),V}):(this.flushRemux(V,ce,s),V)},f.flushRemux=function(s,a,b){var g=a.audioTrack,E=a.avcTrack,P=a.id3Track,G=a.textTrack,V=this.currentTransmuxState,$=V.accurateTimeOffset,z=V.timeOffset;T.logger.log("[transmuxer.ts]: Flushed fragment "+b.sn+(b.part>-1?" p: "+b.part:"")+" of level "+b.level);var F=this.remuxer.remux(g,E,P,G,z,$,!0,this.id);s.push({remuxResult:F,chunkMeta:b}),b.transmuxing.executeEnd=S()},f.resetInitialTimestamp=function(s){var a=this.demuxer,b=this.remuxer;if(!a||!b)return;a.resetTimeStamp(s),b.resetTimeStamp(s)},f.resetContiguity=function(){var s=this.demuxer,a=this.remuxer;if(!s||!a)return;s.resetContiguity(),a.resetNextTimestamp()},f.resetInitSegment=function(s,a,b,g){var E=this.demuxer,P=this.remuxer;if(!E||!P)return;E.resetInitSegment(a,b,g),P.resetInitSegment(s,a,b)},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(s,a,b,g,E){var P;return a&&a.method==="SAMPLE-AES"?P=this.transmuxSampleAes(s,a,b,g,E):P=this.transmuxUnencrypted(s,b,g,E),P},f.transmuxUnencrypted=function(s,a,b,g){var E=this.demuxer.demux(s,a,!1,!this.config.progressive),P=E.audioTrack,G=E.avcTrack,V=E.id3Track,$=E.textTrack,z=this.remuxer.remux(P,G,V,$,a,b,!1,this.id);return{remuxResult:z,chunkMeta:g}},f.transmuxSampleAes=function(s,a,b,g,E){var P=this;return this.demuxer.demuxSampleAes(s,a,b).then(function(G){var V=P.remuxer.remux(G.audioTrack,G.avcTrack,G.id3Track,G.textTrack,b,g,!1,P.id);return{remuxResult:V,chunkMeta:E}})},f.configureTransmuxer=function(s,a){for(var b=this.config,g=this.observer,E=this.typeSupported,P=this.vendor,G=a.audioCodec,V=a.defaultInitPts,$=a.duration,z=a.initSegmentData,F=a.videoCodec,ee,ae=0,ce=h.length;ae<ce;ae++)if(h[ae].demux.probe(s)){ee=h[ae];break}ee||(T.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),ee={demux:W.default,remux:w.default});var ve=this.demuxer,Me=this.remuxer,xe=ee.remux,Ee=ee.demux;(!Me||!(Me instanceof xe))&&(this.remuxer=new xe(g,b,E,P)),(!ve||!(ve instanceof Ee))&&(this.demuxer=new Ee(g,b,E),this.probe=Ee.probe),this.resetInitSegment(z,G,F,$),this.resetInitialTimestamp(V)},f.needsProbing=function(s,a,b){return!this.demuxer||!this.remuxer||a||b},f.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new _.default(this.observer,this.config)),s},x}();function d(x,f){var c=null;return x.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(c=f),c}var A=function(f){return{remuxResult:{},chunkMeta:f}};function v(x){return"then"in x&&x.then instanceof Function}var m=function(f,c,s,a,b){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=c,this.initSegmentData=s,this.duration=a,this.defaultInitPts=b},R=function(f,c,s,a,b){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=f,this.contiguous=c,this.accurateTimeOffset=s,this.trackSwitch=a,this.timeOffset=b}},"./src/demux/tsdemuxer.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"discardEPB",function(){return A});var Q=L("./src/demux/adts.ts"),B=L("./src/demux/mpegaudio.ts"),_=L("./src/demux/exp-golomb.ts"),H=L("./src/demux/id3.ts"),W=L("./src/demux/sample-aes.ts"),O=L("./src/events.ts"),M=L("./src/utils/mp4-tools.ts"),y=L("./src/utils/logger.ts"),w=L("./src/errors.ts"),k={video:1,audio:2,id3:3,text:4},D=function(){function v(R,x,f){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=R,this.config=x,this.typeSupported=f}v.probe=function(x){var f=v.syncOffset(x);return f<0?!1:(f&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},v.syncOffset=function(x){for(var f=Math.min(1e3,x.length-3*188),c=0;c<f;){if(x[c]===71&&x[c+188]===71&&x[c+2*188]===71)return c;c++}return-1},v.createTrack=function(x,f){return{container:x==="video"||x==="audio"?"video/mp2t":void 0,type:x,id:k[x],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:x==="audio"?f:void 0}};var m=v.prototype;return m.resetInitSegment=function(x,f,c){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=v.createTrack("video",c),this._audioTrack=v.createTrack("audio",c),this._id3Track=v.createTrack("id3",c),this._txtTrack=v.createTrack("text",c),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=x,this.videoCodec=f,this._duration=c},m.resetTimeStamp=function(){},m.resetContiguity=function(){var x=this._audioTrack,f=this._avcTrack,c=this._id3Track;x&&(x.pesData=null),f&&(f.pesData=null),c&&(c.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(x,f,c,s){c===void 0&&(c=!1),s===void 0&&(s=!1),c||(this.sampleAes=null);var a,b=this._avcTrack,g=this._audioTrack,E=this._id3Track,P=b.pid,G=b.pesData,V=g.pid,$=E.pid,z=g.pesData,F=E.pesData,ee=!1,ae=this.pmtParsed,ce=this._pmtId,ve=x.length;if(this.remainderData&&(x=Object(M.appendUint8Array)(this.remainderData,x),ve=x.length,this.remainderData=null),ve<188&&!s)return this.remainderData=x,{audioTrack:g,avcTrack:b,id3Track:E,textTrack:this._txtTrack};var Me=Math.max(0,v.syncOffset(x));ve-=(ve+Me)%188,ve<x.byteLength&&!s&&(this.remainderData=new Uint8Array(x.buffer,ve,x.buffer.byteLength-ve));for(var xe=Me;xe<ve;xe+=188)if(x[xe]===71){var Ee=!!(x[xe+1]&64),Te=((x[xe+1]&31)<<8)+x[xe+2],Se=(x[xe+3]&48)>>4,me=void 0;if(Se>1){if(me=xe+5+x[xe+4],me===xe+188)continue}else me=xe+4;switch(Te){case P:Ee&&(G&&(a=o(G))&&this.parseAVCPES(a,!1),G={data:[],size:0}),G&&(G.data.push(x.subarray(me,xe+188)),G.size+=xe+188-me);break;case V:Ee&&(z&&(a=o(z))&&(g.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),z={data:[],size:0}),z&&(z.data.push(x.subarray(me,xe+188)),z.size+=xe+188-me);break;case $:Ee&&(F&&(a=o(F))&&this.parseID3PES(a),F={data:[],size:0}),F&&(F.data.push(x.subarray(me,xe+188)),F.size+=xe+188-me);break;case 0:Ee&&(me+=x[me]+1),ce=this._pmtId=S(x,me);break;case ce:{Ee&&(me+=x[me]+1);var se=h(x,me,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);P=se.avc,P>0&&(b.pid=P),V=se.audio,V>0&&(g.pid=V,g.isAAC=se.isAAC),$=se.id3,$>0&&(E.pid=$),ee&&!ae&&(y.logger.log("reparse from beginning"),ee=!1,xe=Me-188),ae=this.pmtParsed=!0;break}case 17:case 8191:break;default:ee=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});b.pesData=G,g.pesData=z,E.pesData=F;var Re={audioTrack:g,avcTrack:b,id3Track:E,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(Re),Re},m.flush=function(){var x=this.remainderData;this.remainderData=null;var f;return x?f=this.demux(x,-1,!1,!0):f={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(f),this.sampleAes?this.decrypt(f,this.sampleAes):f},m.extractRemainingSamples=function(x){var f=x.audioTrack,c=x.avcTrack,s=x.id3Track,a=c.pesData,b=f.pesData,g=s.pesData,E;a&&(E=o(a))?(this.parseAVCPES(E,!0),c.pesData=null):c.pesData=a,b&&(E=o(b))?(f.isAAC?this.parseAACPES(E):this.parseMPEGPES(E),f.pesData=null):(b!=null&&b.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=b),g&&(E=o(g))?(this.parseID3PES(E),s.pesData=null):s.pesData=g},m.demuxSampleAes=function(x,f,c){var s=this.demux(x,c,!0,!this.config.progressive),a=this.sampleAes=new W.default(this.observer,this.config,f);return this.decrypt(s,a)},m.decrypt=function(x,f){return new Promise(function(c){var s=x.audioTrack,a=x.avcTrack;s.samples&&s.isAAC?f.decryptAacSamples(s.samples,0,function(){a.samples?f.decryptAvcSamples(a.samples,0,0,function(){c(x)}):c(x)}):a.samples&&f.decryptAvcSamples(a.samples,0,0,function(){c(x)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(x,f){var c=this,s=this._avcTrack,a=this.parseAVCNALu(x.data),b=!1,g=this.avcSample,E,P=!1;x.data=null,g&&a.length&&!s.audFound&&(u(g,s),g=this.avcSample=T(!1,x.pts,x.dts,"")),a.forEach(function(G){switch(G.type){case 1:{E=!0,g||(g=c.avcSample=T(!0,x.pts,x.dts,"")),b&&(g.debug+="NDR "),g.frame=!0;var V=G.data;if(P&&V.length>4){var $=new _.default(V).readSliceType();($===2||$===4||$===7||$===9)&&(g.key=!0)}break}case 5:E=!0,g||(g=c.avcSample=T(!0,x.pts,x.dts,"")),b&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{E=!0,b&&g&&(g.debug+="SEI ");var z=new _.default(A(G.data));z.readUByte();for(var F=0,ee=0,ae=!1,ce=0;!ae&&z.bytesAvailable>1;){F=0;do ce=z.readUByte(),F+=ce;while(ce===255);ee=0;do ce=z.readUByte(),ee+=ce;while(ce===255);if(F===4&&z.bytesAvailable!==0){ae=!0;var ve=z.readUByte();if(ve===181){var Me=z.readUShort();if(Me===49){var xe=z.readUInt();if(xe===1195456820){var Ee=z.readUByte();if(Ee===3){for(var Te=z.readUByte(),Se=z.readUByte(),me=31&Te,se=[Te,Se],Re=0;Re<me;Re++)se.push(z.readUByte()),se.push(z.readUByte()),se.push(z.readUByte());d(c._txtTrack.samples,{type:3,pts:x.pts,bytes:se})}}}}}else if(F===5&&z.bytesAvailable!==0){if(ae=!0,ee>16){for(var Ve=[],We=0;We<16;We++)Ve.push(z.readUByte().toString(16)),(We===3||We===5||We===7||We===9)&&Ve.push("-");for(var Je=ee-16,Ze=new Uint8Array(Je),De=0;De<Je;De++)Ze[De]=z.readUByte();d(c._txtTrack.samples,{pts:x.pts,payloadType:F,uuid:Ve.join(""),userData:Object(H.utf8ArrayToStr)(Ze),userDataBytes:Ze})}}else if(ee<z.bytesAvailable)for(var Ue=0;Ue<ee;Ue++)z.readUByte()}break}case 7:if(E=!0,P=!0,b&&g&&(g.debug+="SPS "),!s.sps){var Be=new _.default(G.data),qe=Be.readSPS();s.width=qe.width,s.height=qe.height,s.pixelRatio=qe.pixelRatio,s.sps=[G.data],s.duration=c._duration;for(var Qe=G.data.subarray(1,4),Ie="avc1.",Ne=0;Ne<3;Ne++){var $e=Qe[Ne].toString(16);$e.length<2&&($e="0"+$e),Ie+=$e}s.codec=Ie}break;case 8:E=!0,b&&g&&(g.debug+="PPS "),s.pps||(s.pps=[G.data]);break;case 9:E=!1,s.audFound=!0,g&&u(g,s),g=c.avcSample=T(!1,x.pts,x.dts,b?"AUD ":"");break;case 12:E=!1;break;default:E=!1,g&&(g.debug+="unknown NAL "+G.type+" ");break}if(g&&E){var et=g.units;et.push(G)}}),f&&g&&(u(g,s),this.avcSample=null)},m.getLastNalUnit=function(){var x,f=this.avcSample,c;if(!f||f.units.length===0){var s=this._avcTrack.samples;f=s[s.length-1]}if((x=f)!==null&&x!==void 0&&x.units){var a=f.units;c=a[a.length-1]}return c},m.parseAVCNALu=function(x){var f=x.byteLength,c=this._avcTrack,s=c.naluState||0,a=s,b=[],g=0,E,P,G,V=-1,$=0;for(s===-1&&(V=0,$=x[0]&31,s=0,g=1);g<f;){if(E=x[g++],!s){s=E?0:1;continue}if(s===1){s=E?0:2;continue}if(!E)s=3;else if(E===1){if(V>=0){var z={data:x.subarray(V,g-s-1),type:$};b.push(z)}else{var F=this.getLastNalUnit();if(F&&(a&&g<=4-a&&(F.state&&(F.data=F.data.subarray(0,F.data.byteLength-a))),P=g-s-1,P>0)){var ee=new Uint8Array(F.data.byteLength+P);ee.set(F.data,0),ee.set(x.subarray(0,P),F.data.byteLength),F.data=ee,F.state=0}}g<f?(G=x[g]&31,V=g,$=G,s=0):s=-1}else s=0}if(V>=0&&s>=0){var ae={data:x.subarray(V,f),type:$,state:s};b.push(ae)}if(b.length===0){var ce=this.getLastNalUnit();if(ce){var ve=new Uint8Array(ce.data.byteLength+x.byteLength);ve.set(ce.data,0),ve.set(x,ce.data.byteLength),ce.data=ve}}return c.naluState=s,b},m.parseAACPES=function(x){var f=0,c=this._audioTrack,s=this.aacOverFlow,a=x.data;if(s){this.aacOverFlow=null;var b=s.sample.unit.byteLength,g=Math.min(s.missing,b),E=b-g;s.sample.unit.set(a.subarray(0,g),E),c.samples.push(s.sample),f=s.missing}var P,G;for(P=f,G=a.length;P<G-1&&!Q.isHeader(a,P);P++);if(P!==f){var V,$;if(P<G-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:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:$,reason:V}),$)return}Q.initTrackConfig(c,this.observer,a,P,this.audioCodec);var z;if(x.pts!==void 0)z=x.pts;else if(s){var F=Q.getFrameDuration(c.samplerate);z=s.sample.pts+F}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var ee=0;P<G;)if(Q.isHeader(a,P)){if(P+5<G){var ae=Q.appendFrame(c,a,P,z,ee);if(ae)if(ae.missing)this.aacOverFlow=ae;else{P+=ae.length,ee++;continue}}break}else P++},m.parseMPEGPES=function(x){var f=x.data,c=f.length,s=0,a=0,b=x.pts;if(b===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<c;)if(B.isHeader(f,a)){var g=B.appendFrame(this._audioTrack,f,a,b,s);if(g)a+=g.length,s++;else break}else a++},m.parseID3PES=function(x){if(x.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(x)},v}();D.minProbeByteLength=188;function T(v,m,R,x){return{key:v,frame:!1,pts:m,dts:R,units:[],debug:x,length:0}}function S(v,m){return(v[m+10]&31)<<8|v[m+11]}function h(v,m,R,x){var f={audio:-1,avc:-1,id3:-1,isAAC:!0},c=(v[m+1]&15)<<8|v[m+2],s=m+3+c-4,a=(v[m+10]&15)<<8|v[m+11];for(m+=12+a;m<s;){var b=(v[m+1]&31)<<8|v[m+2];switch(v[m]){case 207:if(!x){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:f.audio===-1&&(f.audio=b);break;case 21:f.id3===-1&&(f.id3=b);break;case 219:if(!x){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:f.avc===-1&&(f.avc=b);break;case 3:case 4:R?f.audio===-1&&(f.audio=b,f.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}m+=((v[m+3]&15)<<8|v[m+4])+5}return f}function o(v){var m=0,R,x,f,c,s,a=v.data;if(!v||v.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)}R=a[0];var g=(R[0]<<16)+(R[1]<<8)+R[2];if(g===1){if(x=(R[4]<<8)+R[5],x&&x>v.size-6)return null;var E=R[7];E&192&&(c=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,E&64?(s=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,c-s>60*9e4&&(y.logger.warn(Math.round((c-s)/9e4)+"s delta between PTS and DTS, align them"),c=s)):s=c),f=R[8];var P=f+9;if(v.size<=P)return null;v.size-=P;for(var G=new Uint8Array(v.size),V=0,$=a.length;V<$;V++){R=a[V];var z=R.byteLength;if(P)if(P>z){P-=z;continue}else R=R.subarray(P),z-=P,P=0;G.set(R,m),m+=z}return x&&(x-=f+3),{data:G,pts:c,dts:s,len:x}}return null}function u(v,m){if(v.units.length&&v.frame){if(v.pts===void 0){var R=m.samples,x=R.length;if(x){var f=R[x-1];v.pts=f.pts,v.dts=f.dts}else{m.dropped++;return}}m.samples.push(v)}v.debug.length&&y.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function d(v,m){var R=v.length;if(R>0){if(m.pts>=v[R-1].pts)v.push(m);else for(var x=R-1;x>=0;x--)if(m.pts<v[x].pts){v.splice(x,0,m);break}}else v.push(m)}function A(v){for(var m=v.byteLength,R=[],x=1;x<m-2;)v[x]===0&&v[x+1]===0&&v[x+2]===3?(R.push(x+2),x+=2):x++;if(R.length===0)return v;var f=m-R.length,c=new Uint8Array(f),s=0;for(x=0;x<f;s++,x++)s===R[0]&&(s++,R.shift()),c[x]=v[s];return c}Y.default=D},"./src/errors.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"ErrorTypes",function(){return Q}),L.d(Y,"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,Y,L){"use strict";L.r(Y),L.d(Y,"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,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return v});var Q=L("./node_modules/url-toolkit/src/url-toolkit.js"),B=L.n(Q),_=L("./src/loader/playlist-loader.ts"),H=L("./src/loader/key-loader.ts"),W=L("./src/controller/id3-track-controller.ts"),O=L("./src/controller/latency-controller.ts"),M=L("./src/controller/level-controller.ts"),y=L("./src/controller/fragment-tracker.ts"),w=L("./src/controller/stream-controller.ts"),k=L("./src/is-supported.ts"),D=L("./src/utils/logger.ts"),T=L("./src/config.ts"),S=L("./node_modules/eventemitter3/index.js"),h=L.n(S),o=L("./src/events.ts"),u=L("./src/errors.ts");function d(m,R){for(var x=0;x<R.length;x++){var f=R[x];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function A(m,R,x){return R&&d(m.prototype,R),x&&d(m,x),m}var v=function(){m.isSupported=function(){return Object(k.isSupported)()};function m(x){x===void 0&&(x={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new S.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var f=this.config=Object(T.mergeConfig)(m.DefaultConfig,x);this.userConfig=x,Object(D.enableLogs)(f.debug),this._autoLevelCapping=-1,f.progressive&&Object(T.enableStreamingMode)(f);var c=f.abrController,s=f.bufferController,a=f.capLevelController,b=f.fpsController,g=this.abrController=new c(this),E=this.bufferController=new s(this),P=this.capLevelController=new a(this),G=new b(this),V=new _.default(this),$=new H.default(this),z=new W.default(this),F=this.levelController=new M.default(this),ee=new y.FragmentTracker(this),ae=this.streamController=new w.default(this,ee);P.setStreamController(ae),G.setStreamController(ae);var ce=[F,ae];this.networkControllers=ce;var ve=[V,$,g,E,P,G,z,ee];this.audioTrackController=this.createController(f.audioTrackController,null,ce),this.createController(f.audioStreamController,ee,ce),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,ce),this.createController(f.subtitleStreamController,ee,ce),this.createController(f.timelineController,null,ve),this.emeController=this.createController(f.emeController,null,ve),this.cmcdController=this.createController(f.cmcdController,null,ve),this.latencyController=this.createController(O.default,null,ve),this.coreComponents=ve}var R=m.prototype;return R.createController=function(f,c,s){if(f){var a=c?new f(this,c):new f(this);return s&&s.push(a),a}return null},R.on=function(f,c,s){s===void 0&&(s=this),this._emitter.on(f,c,s)},R.once=function(f,c,s){s===void 0&&(s=this),this._emitter.once(f,c,s)},R.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},R.off=function(f,c,s,a){s===void 0&&(s=this),this._emitter.off(f,c,s,a)},R.listeners=function(f){return this._emitter.listeners(f)},R.emit=function(f,c,s){return this._emitter.emit(f,c,s)},R.trigger=function(f,c){if(this.config.debug)return this.emit(f,f,c);try{return this.emit(f,f,c)}catch(s){D.logger.error("An internal error happened while handling event "+f+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(o.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:s})}return!1},R.listenerCount=function(f){return this._emitter.listenerCount(f)},R.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(f){return f.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(f){return f.destroy()}),this.coreComponents.length=0},R.attachMedia=function(f){D.logger.log("attachMedia"),this._media=f,this.trigger(o.Events.MEDIA_ATTACHING,{media:f})},R.detachMedia=function(){D.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(f){this.stopLoad();var c=this.media,s=this.url,a=this.url=Q.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});D.logger.log("loadSource:"+a),c&&s&&s!==a&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(c)),this.trigger(o.Events.MANIFEST_LOADING,{url:f})},R.startLoad=function(f){f===void 0&&(f=-1),D.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(c){c.startLoad(f)})},R.stopLoad=function(){D.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},R.swapAudioCodec=function(){D.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){D.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},R.removeLevel=function(f,c){c===void 0&&(c=0),this.levelController.removeLevel(f,c)},A(m,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){D.logger.log("set currentLevel:"+f),this.loadLevel=f,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(f){D.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){D.logger.log("set loadLevel:"+f),this.levelController.manualLevel=f}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(f){this.levelController.nextLoadLevel=f}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(f){D.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){D.logger.log("set startLevel:"+f),f!==-1&&(f=Math.max(f,this.minAutoLevel)),this.levelController.startLevel=f}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(f){var c=!!f;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(f){this._autoLevelCapping!==f&&(D.logger.log("set autoLevelCapping:"+f),this._autoLevelCapping=f)}},{key:"bandwidthEstimate",get:function(){var f=this.abrController.bwEstimator;return f?f.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var f=this.levels,c=this.config.minAutoBitrate;if(!f)return 0;for(var s=f.length,a=0;a<s;a++)if(f[a].maxBitrate>c)return a;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,c=this.autoLevelCapping,s;return c===-1&&f&&f.length?s=f.length-1:s=c,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var c=this.audioTrackController;c&&(c.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var c=this.subtitleTrackController;c&&(c.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{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 u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:T.hlsDefaultConfig},set:function(f){m.defaultConfig=f}}]),m}();v.defaultConfig=void 0},"./src/is-supported.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"isSupported",function(){return _}),L.d(Y,"changeTypeSupported",function(){return H});var Q=L("./src/utils/mediasource-helper.ts");function B(){return self.SourceBuffer||self.WebKitSourceBuffer}function _(){var W=Object(Q.getMediaSource)();if(!W)return!1;var O=B(),M=W&&typeof W.isTypeSupported=="function"&&W.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 H(){var W,O=B();return typeof(O==null||((W=O.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return D}),L.d(Y,"LoadError",function(){return S});var Q=L("./src/polyfills/number.ts"),B=L("./src/errors.ts");function _(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,y(h,o)}function H(h){var o=typeof Map=="function"?new Map:void 0;return H=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 W(d,arguments,w(this).constructor)}return A.prototype=Object.create(d.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),y(A,d)},H(h)}function W(h,o,u){return O()?W=Reflect.construct:W=function(A,v,m){var R=[null];R.push.apply(R,v);var x=Function.bind.apply(A,R),f=new x;return m&&y(f,m.prototype),f},W.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 w(h){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},w(h)}var k=Math.pow(2,17),D=function(){function h(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}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 v=this,m=d.url;if(!m)return Promise.reject(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var R=this.config,x=R.fLoader,f=R.loader;return new Promise(function(c,s){v.loader&&v.loader.destroy();var a=v.loader=d.loader=x?new x(R):new f(R),b=T(d),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:k};d.stats=a.stats,a.load(b,g,{onSuccess:function(P,G,V,$){v.resetLoader(d,a),c({frag:d,part:null,payload:P.data,networkDetails:$})},onError:function(P,G,V){v.resetLoader(d,a),s(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:P,networkDetails:V}))},onAbort:function(P,G,V){v.resetLoader(d,a),s(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:V}))},onTimeout:function(P,G,V){v.resetLoader(d,a),s(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:V}))},onProgress:function(P,G,V,$){A&&A({frag:d,part:null,payload:V,networkDetails:$})}})})},o.loadPart=function(d,A,v){var m=this;this.abort();var R=this.config,x=R.fLoader,f=R.loader;return new Promise(function(c,s){m.loader&&m.loader.destroy();var a=m.loader=d.loader=x?new x(R):new f(R),b=T(d,A),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:k};A.stats=a.stats,a.load(b,g,{onSuccess:function(P,G,V,$){m.resetLoader(d,a),m.updateStatsFromPart(d,A);var z={frag:d,part:A,payload:P.data,networkDetails:$};v(z),c(z)},onError:function(P,G,V){m.resetLoader(d,a),s(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:A,response:P,networkDetails:V}))},onAbort:function(P,G,V){d.stats.aborted=A.stats.aborted,m.resetLoader(d,a),s(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:A,networkDetails:V}))},onTimeout:function(P,G,V){m.resetLoader(d,a),s(new S({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 v=d.stats,m=A.stats,R=m.total;if(v.loaded+=m.loaded,R){var x=Math.round(d.duration/A.duration),f=Math.min(Math.round(v.loaded/R),x),c=x-f,s=c*Math.round(v.loaded/f);v.total=v.loaded+s}else v.total=Math.max(v.loaded,v.total);var a=v.loading,b=m.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 T(h,o){o===void 0&&(o=null);var u=o||h,d={frag:h,part:o,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},A=u.byteRangeStartOffset,v=u.byteRangeEndOffset;return Object(Q.isFiniteNumber)(A)&&Object(Q.isFiniteNumber)(v)&&(d.rangeStart=A,d.rangeEnd=v),d}var S=function(h){_(o,h);function o(u){for(var d,A=arguments.length,v=new Array(A>1?A-1:0),m=1;m<A;m++)v[m-1]=arguments[m];return d=h.call.apply(h,[this].concat(v))||this,d.data=void 0,d.data=u,d}return o}(H(Error))},"./src/loader/fragment.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"ElementaryStreamTypes",function(){return D}),L.d(Y,"BaseSegment",function(){return T}),L.d(Y,"Fragment",function(){return S}),L.d(Y,"Part",function(){return h});var Q=L("./src/polyfills/number.ts"),B=L("./node_modules/url-toolkit/src/url-toolkit.js"),_=L.n(B),H=L("./src/utils/logger.ts"),W=L("./src/loader/level-key.ts"),O=L("./src/loader/load-stats.ts");function M(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,y(o,u)}function y(o,u){return y=Object.setPrototypeOf||function(A,v){return A.__proto__=v,A},y(o,u)}function w(o,u){for(var d=0;d<u.length;d++){var A=u[d];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(o,A.key,A)}}function k(o,u,d){return u&&w(o.prototype,u),d&&w(o,d),o}var D;(function(o){o.AUDIO="audio",o.VIDEO="video",o.AUDIOVIDEO="audiovideo"})(D||(D={}));var T=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 u=o.prototype;return u.setByteRange=function(A,v){var m=A.split("@",2),R=[];m.length===1?R[0]=v?v.byteRangeEndOffset:0:R[0]=parseInt(m[1]),R[1]=parseInt(m[0])+R[0],this._byteRange=R},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}(),S=function(o){M(u,o);function u(A,v){var m;return m=o.call(this,v)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkey=void 0,m.type=void 0,m.loader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new O.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.type=A,m}var d=u.prototype;return d.createInitializationVector=function(v){for(var m=new Uint8Array(16),R=12;R<16;R++)m[R]=v>>8*(15-R)&255;return m},d.setDecryptDataFromLevelKey=function(v,m){var R=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(R=W.LevelKey.fromURI(v.uri),R.method=v.method,R.iv=this.createInitializationVector(m),R.keyFormat="identity"),R},d.setElementaryStreamInfo=function(v,m,R,x,f,c){c===void 0&&(c=!1);var s=this.elementaryStreams,a=s[v];if(!a){s[v]={startPTS:m,endPTS:R,startDTS:x,endDTS:f,partial:c};return}a.startPTS=Math.min(a.startPTS,m),a.endPTS=Math.max(a.endPTS,R),a.startDTS=Math.min(a.startDTS,x),a.endDTS=Math.max(a.endDTS,f)},d.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[D.AUDIO]=null,v[D.VIDEO]=null,v[D.AUDIOVIDEO]=null},k(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}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 v=Object(Q.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),u}(T),h=function(o){M(u,o);function u(d,A,v,m,R){var x;x=o.call(this,v)||this,x.fragOffset=0,x.duration=0,x.gap=!1,x.independent=!1,x.relurl=void 0,x.fragment=void 0,x.index=void 0,x.stats=new O.LoadStats,x.duration=d.decimalFloatingPoint("DURATION"),x.gap=d.bool("GAP"),x.independent=d.bool("INDEPENDENT"),x.relurl=d.enumeratedString("URI"),x.fragment=A,x.index=m;var f=d.enumeratedString("BYTERANGE");return f&&x.setByteRange(f,R),R&&(x.fragOffset=R.fragOffset+R.duration),x}return k(u,[{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)}}]),u}(T)},"./src/loader/key-loader.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return H});var Q=L("./src/events.ts"),B=L("./src/errors.ts"),_=L("./src/utils/logger.ts"),H=function(){function W(M){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=M,this._registerListeners()}var O=W.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 w=this.loaders[y];w&&w.destroy()}this.loaders={}},O.onKeyLoading=function(y,w){var k=w.frag,D=k.type,T=this.loaders[D];if(!k.decryptdata){_.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var S=k.decryptdata.uri;if(S!==this.decrypturl||this.decryptkey===null){var h=this.hls.config;if(T&&(_.logger.warn("abort previous key loader for type:"+D),T.abort()),!S){_.logger.warn("key uri is falsy");return}var o=h.loader,u=k.loader=this.loaders[D]=new o(h);this.decrypturl=S,this.decryptkey=null;var d={url:S,frag:k,responseType:"arraybuffer"},A={timeout:h.fragLoadingTimeOut,maxRetry:0,retryDelay:h.fragLoadingRetryDelay,maxRetryDelay:h.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(d,A,v)}else this.decryptkey&&(k.decryptdata.key=this.decryptkey,this.hls.trigger(Q.Events.KEY_LOADED,{frag:k}))},O.loadsuccess=function(y,w,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,w){var k=w.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,w){var k=w.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})},W}()},"./src/loader/level-details.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"LevelDetails",function(){return W});var Q=L("./src/polyfills/number.ts");function B(O,M){for(var y=0;y<M.length;y++){var w=M[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(O,w.key,w)}}function _(O,M,y){return M&&B(O.prototype,M),y&&B(O,y),O}var H=10,W=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(w){if(!w){this.advanced=!0,this.updated=!0;return}var k=this.lastPartSn-w.lastPartSn,D=this.lastPartIndex-w.lastPartIndex;this.updated=this.endSN!==w.endSN||!!D||!!k,this.advanced=this.endSN>w.endSN||k>0||k===0&&D>0,this.updated||this.advanced?this.misses=Math.floor(w.misses*.6):this.misses=w.misses+1,this.availabilityDelay=w.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||H}},{key:"drift",get:function(){var w=this.driftEndTime-this.driftStartTime;if(w>0){var k=this.driftEnd-this.driftStart;return k*1e3/w}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var w;return(w=this.fragments)!==null&&w!==void 0&&w.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 w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"LevelKey",function(){return W});var Q=L("./node_modules/url-toolkit/src/url-toolkit.js"),B=L.n(Q);function _(O,M){for(var y=0;y<M.length;y++){var w=M[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(O,w.key,w)}}function H(O,M,y){return M&&_(O.prototype,M),y&&_(O,y),O}var W=function(){O.fromURL=function(y,w){return new O(y,w)},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 H(O,[{key:"uri",get:function(){return this._uri}}]),O}()},"./src/loader/load-stats.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"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,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return u});var Q=L("./src/polyfills/number.ts"),B=L("./node_modules/url-toolkit/src/url-toolkit.js"),_=L.n(B),H=L("./src/loader/fragment.ts"),W=L("./src/loader/level-details.ts"),O=L("./src/loader/level-key.ts"),M=L("./src/utils/attr-list.ts"),y=L("./src/utils/logger.ts"),w=L("./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,T=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),S=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),h=/\.(mp4|m4s|m4v|m4a)$/i;function o(R){var x,f;return h.test((x=(f=B.parseURL(R))===null||f===void 0?void 0:f.path)!=null?x:"")}var u=function(){function R(){}return R.findGroup=function(f,c){for(var s=0;s<f.length;s++){var a=f[s];if(a.id===c)return a}},R.convertAVC1ToAVCOTI=function(f){var c=f.split(".");if(c.length>2){var s=c.shift()+".";return s+=parseInt(c.shift()).toString(16),s+=("000"+parseInt(c.shift()).toString(16)).substr(-4),s}return f},R.resolve=function(f,c){return B.buildAbsoluteURL(c,f,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(f,c){var s=[],a={},b=!1;k.lastIndex=0;for(var g;(g=k.exec(f))!=null;)if(g[1]){var E=new M.AttrList(g[1]),P={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:R.resolve(g[2],c)},G=E.decimalResolution("RESOLUTION");G&&(P.width=G.width,P.height=G.height),d((E.CODECS||"").split(/[ ,]+/).filter(function($){return $}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=R.convertAVC1ToAVCOTI(P.videoCodec)),s.push(P)}else if(g[3]){var V=new M.AttrList(g[3]);V["DATA-ID"]&&(b=!0,a[V["DATA-ID"]]=V)}return{levels:s,sessionData:b?a:null}},R.parseMasterPlaylistMedia=function(f,c,s,a){a===void 0&&(a=[]);var b,g=[],E=0;for(D.lastIndex=0;(b=D.exec(f))!==null;){var P=new M.AttrList(b[1]);if(P.TYPE===s){var G={attrs:P,bitrate:0,id:E++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:s,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?R.resolve(P.URI,c):""};if(a.length){var V=R.findGroup(a,G.groupId)||a[0];A(G,V,"audioCodec"),A(G,V,"textCodec")}g.push(G)}}return g},R.parseLevelPlaylist=function(f,c,s,a,b){var g=new W.LevelDetails(c),E=g.fragments,P=null,G=0,V=0,$=0,z=0,F=null,ee=new H.Fragment(a,c),ae,ce,ve,Me=-1,xe=!1;for(T.lastIndex=0,g.m3u8=f;(ae=T.exec(f))!==null;){xe&&(xe=!1,ee=new H.Fragment(a,c),ee.start=$,ee.sn=G,ee.cc=z,ee.level=s,P&&(ee.initSegment=P,ee.rawProgramDateTime=P.rawProgramDateTime));var Ee=ae[1];if(Ee){ee.duration=parseFloat(Ee);var Te=(" "+ae[2]).slice(1);ee.title=Te||null,ee.tagList.push(Te?["INF",Ee,Te]:["INF",Ee])}else if(ae[3])Object(Q.isFiniteNumber)(ee.duration)&&(ee.start=$,ve&&(ee.levelkey=ve),ee.sn=G,ee.level=s,ee.cc=z,ee.urlId=b,E.push(ee),ee.relurl=(" "+ae[3]).slice(1),m(ee,F),F=ee,$+=ee.duration,G++,V=0,xe=!0);else if(ae[4]){var Se=(" "+ae[4]).slice(1);F?ee.setByteRange(Se,F):ee.setByteRange(Se)}else if(ae[5])ee.rawProgramDateTime=(" "+ae[5]).slice(1),ee.tagList.push(["PROGRAM-DATE-TIME",ee.rawProgramDateTime]),Me===-1&&(Me=E.length);else{if(ae=ae[0].match(S),!ae){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(ce=1;ce<ae.length&&!(typeof ae[ce]!="undefined");ce++);var me=(" "+ae[ce]).slice(1),se=(" "+ae[ce+1]).slice(1),Re=ae[ce+2]?(" "+ae[ce+2]).slice(1):"";switch(me){case"PLAYLIST-TYPE":g.type=se.toUpperCase();break;case"MEDIA-SEQUENCE":G=g.startSN=parseInt(se);break;case"SKIP":{var Ve=new M.AttrList(se),We=Ve.decimalInteger("SKIPPED-SEGMENTS");if(Object(Q.isFiniteNumber)(We)){g.skippedSegments=We;for(var Je=We;Je--;)E.unshift(null);G+=We}var Ze=Ve.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ze&&(g.recentlyRemovedDateranges=Ze.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(se);break;case"VERSION":g.version=parseInt(se);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(se||Re)&&ee.tagList.push(Re?[se,Re]:[se]);break;case"DIS":z++;case"GAP":ee.tagList.push([me]);break;case"BITRATE":ee.tagList.push([me,se]);break;case"DISCONTINUITY-SEQ":z=parseInt(se);break;case"KEY":{var De,Ue=new M.AttrList(se),Be=Ue.enumeratedString("METHOD"),qe=Ue.URI,Qe=Ue.hexadecimalInteger("IV"),Ie=Ue.enumeratedString("KEYFORMATVERSIONS"),Ne=Ue.enumeratedString("KEYID"),$e=(De=Ue.enumeratedString("KEYFORMAT"))!=null?De:"identity",et=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(et.indexOf($e)>-1){y.logger.warn("Keyformat "+$e+" is not supported from the manifest");continue}else if($e!=="identity")continue;Be&&(ve=O.LevelKey.fromURL(c,qe),qe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Be)>=0&&(ve.method=Be,ve.keyFormat=$e,Ne&&(ve.keyID=Ne),Ie&&(ve.keyFormatVersions=Ie),ve.iv=Qe));break}case"START":{var Xe=new M.AttrList(se),Ke=Xe.decimalFloatingPoint("TIME-OFFSET");Object(Q.isFiniteNumber)(Ke)&&(g.startTimeOffset=Ke);break}case"MAP":{var ct=new M.AttrList(se);ee.relurl=ct.URI,ct.BYTERANGE&&ee.setByteRange(ct.BYTERANGE),ee.level=s,ee.sn="initSegment",ve&&(ee.levelkey=ve),ee.initSegment=null,P=ee,xe=!0;break}case"SERVER-CONTROL":{var rt=new M.AttrList(se);g.canBlockReload=rt.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=rt.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&rt.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=rt.optionalFloat("PART-HOLD-BACK",0),g.holdBack=rt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var at=new M.AttrList(se);g.partTarget=at.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ae=g.partList;Ae||(Ae=g.partList=[]);var dt=V>0?Ae[Ae.length-1]:void 0,ot=V++,we=new H.Part(new M.AttrList(se),ee,c,ot,dt);Ae.push(we),ee.duration+=we.duration;break}case"PRELOAD-HINT":{var Fe=new M.AttrList(se);g.preloadHint=Fe;break}case"RENDITION-REPORT":{var ge=new M.AttrList(se);g.renditionReports=g.renditionReports||[],g.renditionReports.push(ge);break}default:y.logger.warn("line parsed but not handled: "+ae);break}}}F&&!F.relurl?(E.pop(),$-=F.duration,g.partList&&(g.fragmentHint=F)):g.partList&&(m(ee,F),ee.cc=z,g.fragmentHint=ee);var de=E.length,fe=E[0],te=E[de-1];if($+=g.skippedSegments*g.targetduration,$>0&&de&&te){g.averagetargetduration=$/de;var re=te.sn;g.endSN=re!=="initSegment"?re:0,fe&&(g.startCC=fe.cc,fe.initSegment||g.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 H.Fragment(a,c),ee.relurl=te.relurl,ee.level=s,ee.sn="initSegment",fe.initSegment=ee,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&($+=g.fragmentHint.duration),g.totalduration=$,g.endCC=z,Me>0&&v(E,Me),g},R}();function d(R,x){["video","audio","text"].forEach(function(f){var c=R.filter(function(a){return Object(w.isCodecType)(a,f)});if(c.length){var s=c.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});x[f+"Codec"]=s.length>0?s[0]:c[0],R=R.filter(function(a){return c.indexOf(a)===-1})}}),x.unknownCodecs=R}function A(R,x,f){var c=x[f];c&&(R[f]=c)}function v(R,x){for(var f=R[x],c=x;c--;){var s=R[c];if(!s)return;s.programDateTime=f.programDateTime-s.duration*1e3,f=s}}function m(R,x){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):x!=null&&x.programDateTime&&(R.programDateTime=x.endProgramDateTime),Object(Q.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/polyfills/number.ts"),B=L("./src/events.ts"),_=L("./src/errors.ts"),H=L("./src/utils/logger.ts"),W=L("./src/utils/mp4-tools.ts"),O=L("./src/loader/m3u8-parser.ts"),M=L("./src/types/loader.ts"),y=L("./src/utils/attr-list.ts");function w(T){var S=T.type;switch(S){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(T,S){var h=T.url;return(h===void 0||h.indexOf("data:")===0)&&(h=S.url),h}var D=function(){function T(h){this.hls=void 0,this.loaders=Object.create(null),this.hls=h,this.registerListeners()}var S=T.prototype;return S.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)},S.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)},S.createInternalLoader=function(o){var u=this.hls.config,d=u.pLoader,A=u.loader,v=d||A,m=new v(u);return o.loader=m,this.loaders[o.type]=m,m},S.getInternalLoader=function(o){return this.loaders[o.type]},S.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},S.destroyInternalLoaders=function(){for(var o in this.loaders){var u=this.loaders[o];u&&u.destroy(),this.resetInternalLoader(o)}},S.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},S.onManifestLoading=function(o,u){var d=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:M.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},S.onLevelLoading=function(o,u){var d=u.id,A=u.level,v=u.url,m=u.deliveryDirectives;this.load({id:d,groupId:null,level:A,responseType:"text",type:M.PlaylistContextType.LEVEL,url:v,deliveryDirectives:m})},S.onAudioTrackLoading=function(o,u){var d=u.id,A=u.groupId,v=u.url,m=u.deliveryDirectives;this.load({id:d,groupId:A,level:null,responseType:"text",type:M.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:m})},S.onSubtitleTrackLoading=function(o,u){var d=u.id,A=u.groupId,v=u.url,m=u.deliveryDirectives;this.load({id:d,groupId:A,level:null,responseType:"text",type:M.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:m})},S.load=function(o){var u,d=this.hls.config,A=this.getInternalLoader(o);if(A){var v=A.context;if(v&&v.url===o.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),A.abort()}var m,R,x,f;switch(o.type){case M.PlaylistContextType.MANIFEST:m=d.manifestLoadingMaxRetry,R=d.manifestLoadingTimeOut,x=d.manifestLoadingRetryDelay,f=d.manifestLoadingMaxRetryTimeout;break;case M.PlaylistContextType.LEVEL:case M.PlaylistContextType.AUDIO_TRACK:case M.PlaylistContextType.SUBTITLE_TRACK:m=0,R=d.levelLoadingTimeOut;break;default:m=d.levelLoadingMaxRetry,R=d.levelLoadingTimeOut,x=d.levelLoadingRetryDelay,f=d.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(o),(u=o.deliveryDirectives)!==null&&u!==void 0&&u.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 s=c.partTarget,a=c.targetduration;s&&a&&(R=Math.min(Math.max(s*3,a*.8)*1e3,R))}}var b={timeout:R,maxRetry:m,retryDelay:x,maxRetryDelay:f,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(o,b,g)},S.loadsuccess=function(o,u,d,A){if(A===void 0&&(A=null),d.isSidxRequest){this.handleSidxRequest(o,d),this.handlePlaylistLoaded(o,u,d,A);return}this.resetInternalLoader(d.type);var v=o.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,d,"no EXTM3U delimiter",A);return}u.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,u,d,A):this.handleMasterPlaylist(o,u,d,A)},S.loaderror=function(o,u,d){d===void 0&&(d=null),this.handleNetworkError(u,d,!1,o)},S.loadtimeout=function(o,u,d){d===void 0&&(d=null),this.handleNetworkError(u,d,!0)},S.handleMasterPlaylist=function(o,u,d,A){var v=this.hls,m=o.data,R=k(o,d),x=O.default.parseMasterPlaylist(m,R),f=x.levels,c=x.sessionData;if(!f.length){this.handleManifestParsingError(o,d,"no level found in manifest",A);return}var s=f.map(function(G){return{id:G.attrs.AUDIO,audioCodec:G.audioCodec}}),a=f.map(function(G){return{id:G.attrs.SUBTITLES,textCodec:G.textCodec}}),b=O.default.parseMasterPlaylistMedia(m,R,"AUDIO",s),g=O.default.parseMasterPlaylistMedia(m,R,"SUBTITLES",a),E=O.default.parseMasterPlaylistMedia(m,R,"CLOSED-CAPTIONS");if(b.length){var P=b.some(function(G){return!G.url});!P&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(H.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:""}))}v.trigger(B.Events.MANIFEST_LOADED,{levels:f,audioTracks:b,subtitles:g,captions:E,url:R,stats:u,networkDetails:A,sessionData:c})},S.handleTrackOrLevelPlaylist=function(o,u,d,A){var v=this.hls,m=d.id,R=d.level,x=d.type,f=k(o,d),c=Object(Q.isFiniteNumber)(m)?m:0,s=Object(Q.isFiniteNumber)(R)?R:c,a=w(d),b=O.default.parseLevelPlaylist(o.data,f,s,a,c);if(!b.fragments.length){v.trigger(B.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:f,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(x===M.PlaylistContextType.MANIFEST){var g={attrs:new y.AttrList({}),bitrate:0,details:b,name:"",url:f};v.trigger(B.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:f,stats:u,networkDetails:A,sessionData:null})}if(u.parsing.end=performance.now(),b.needSidxRanges){var E,P=(E=b.fragments[0].initSegment)===null||E===void 0?void 0:E.url;this.load({url:P,isSidxRequest:!0,type:x,level:R,levelDetails:b,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=b,this.handlePlaylistLoaded(o,u,d,A)},S.handleSidxRequest=function(o,u){var d=Object(W.parseSegmentIndex)(new Uint8Array(o.data));if(!d)return;var A=d.references,v=u.levelDetails;A.forEach(function(m,R){var x=m.info,f=v.fragments[R];f.byteRange.length===0&&f.setByteRange(String(1+x.end-x.start)+"@"+String(x.start)),f.initSegment&&f.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},S.handleManifestParsingError=function(o,u,d,A){this.hls.trigger(B.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===M.PlaylistContextType.MANIFEST,url:o.url,reason:d,response:o,context:u,networkDetails:A})},S.handleNetworkError=function(o,u,d,A){d===void 0&&(d=!1),H.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 v=_.ErrorDetails.UNKNOWN,m=!1,R=this.getInternalLoader(o);switch(o.type){case M.PlaylistContextType.MANIFEST:v=d?_.ErrorDetails.MANIFEST_LOAD_TIMEOUT:_.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case M.PlaylistContextType.LEVEL:v=d?_.ErrorDetails.LEVEL_LOAD_TIMEOUT:_.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case M.PlaylistContextType.AUDIO_TRACK:v=d?_.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case M.PlaylistContextType.SUBTITLE_TRACK:v=d?_.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:_.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}R&&this.resetInternalLoader(o.type);var x={type:_.ErrorTypes.NETWORK_ERROR,details:v,fatal:m,url:o.url,loader:R,context:o,networkDetails:u};A&&(x.response=A),this.hls.trigger(B.Events.ERROR,x)},S.handlePlaylistLoaded=function(o,u,d,A){var v=d.type,m=d.level,R=d.id,x=d.groupId,f=d.loader,c=d.levelDetails,s=d.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(o,d,"invalid target duration",A);return}if(!f)return;c.live&&(f.getCacheAge&&(c.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(v){case M.PlaylistContextType.MANIFEST:case M.PlaylistContextType.LEVEL:this.hls.trigger(B.Events.LEVEL_LOADED,{details:c,level:m||0,id:R||0,stats:u,networkDetails:A,deliveryDirectives:s});break;case M.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,{details:c,id:R||0,groupId:x||"",stats:u,networkDetails:A,deliveryDirectives:s});break;case M.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADED,{details:c,id:R||0,groupId:x||"",stats:u,networkDetails:A,deliveryDirectives:s});break}},T}();Y.default=D},"./src/polyfills/number.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"isFiniteNumber",function(){return Q}),L.d(Y,"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,Y,L){"use strict";L.r(Y);var Q=function(){function B(){}return B.getSilentFrame=function(H,W){switch(H){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===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(W===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(W===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(W===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(W===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}();Y.default=Q},"./src/remux/mp4-generator.ts":function(ie,Y,L){"use strict";L.r(Y);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 W;for(W in _.types)_.types.hasOwnProperty(W)&&(_.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.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]),w=new Uint8Array([0,0,0,0,0,0,0,0]);_.STTS=_.STSC=_.STCO=w,_.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]),T=new Uint8Array([0,0,0,1]);_.FTYP=_.box(_.types.ftyp,k,T,k,D),_.DINF=_.box(_.types.dinf,_.box(_.types.dref,y))},_.box=function(W){for(var O=8,M=arguments.length,y=new Array(M>1?M-1:0),w=1;w<M;w++)y[w-1]=arguments[w];for(var k=y.length,D=k;k--;)O+=y[k].byteLength;var T=new Uint8Array(O);for(T[0]=O>>24&255,T[1]=O>>16&255,T[2]=O>>8&255,T[3]=O&255,T.set(W,4),k=0,O=8;k<D;k++)T.set(y[k],O),O+=y[k].byteLength;return T},_.hdlr=function(W){return _.box(_.types.hdlr,_.HDLR_TYPES[W])},_.mdat=function(W){return _.box(_.types.mdat,W)},_.mdhd=function(W,O){O*=W;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,W>>24&255,W>>16&255,W>>8&255,W&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(W){return _.box(_.types.mdia,_.mdhd(W.timescale,W.duration),_.hdlr(W.type),_.minf(W))},_.mfhd=function(W){return _.box(_.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},_.minf=function(W){return W.type==="audio"?_.box(_.types.minf,_.box(_.types.smhd,_.SMHD),_.DINF,_.stbl(W)):_.box(_.types.minf,_.box(_.types.vmhd,_.VMHD),_.DINF,_.stbl(W))},_.moof=function(W,O,M){return _.box(_.types.moof,_.mfhd(W),_.traf(M,O))},_.moov=function(W){for(var O=W.length,M=[];O--;)M[O]=_.trak(W[O]);return _.box.apply(null,[_.types.moov,_.mvhd(W[0].timescale,W[0].duration)].concat(M).concat(_.mvex(W)))},_.mvex=function(W){for(var O=W.length,M=[];O--;)M[O]=_.trex(W[O]);return _.box.apply(null,[_.types.mvex].concat(M))},_.mvhd=function(W,O){O*=W;var M=Math.floor(O/(Q+1)),y=Math.floor(O%(Q+1)),w=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&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,w)},_.sdtp=function(W){var O=W.samples||[],M=new Uint8Array(4+O.length),y,w;for(y=0;y<O.length;y++)w=O[y].flags,M[y+4]=w.dependsOn<<4|w.isDependedOn<<2|w.hasRedundancy;return _.box(_.types.sdtp,M)},_.stbl=function(W){return _.box(_.types.stbl,_.stsd(W),_.box(_.types.stts,_.STTS),_.box(_.types.stsc,_.STSC),_.box(_.types.stsz,_.STSZ),_.box(_.types.stco,_.STCO))},_.avc1=function(W){var O=[],M=[],y,w,k;for(y=0;y<W.sps.length;y++)w=W.sps[y],k=w.byteLength,O.push(k>>>8&255),O.push(k&255),O=O.concat(Array.prototype.slice.call(w));for(y=0;y<W.pps.length;y++)w=W.pps[y],k=w.byteLength,M.push(k>>>8&255),M.push(k&255),M=M.concat(Array.prototype.slice.call(w));var D=_.box(_.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|W.sps.length].concat(O).concat([W.pps.length]).concat(M))),T=W.width,S=W.height,h=W.pixelRatio[0],o=W.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,T>>8&255,T&255,S>>8&255,S&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),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(W){var O=W.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(W.config).concat([6,1,2]))},_.mp4a=function(W){var O=W.samplerate;return _.box(_.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),_.box(_.types.esds,_.esds(W)))},_.mp3=function(W){var O=W.samplerate;return _.box(_.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},_.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?_.box(_.types.stsd,_.STSD,_.mp3(W)):_.box(_.types.stsd,_.STSD,_.mp4a(W)):_.box(_.types.stsd,_.STSD,_.avc1(W))},_.tkhd=function(W){var O=W.id,M=W.duration*W.timescale,y=W.width,w=W.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,w>>8&255,w&255,0,0]))},_.traf=function(W,O){var M=_.sdtp(W),y=W.id,w=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,w>>24,w>>16&255,w>>8&255,w&255,k>>24,k>>16&255,k>>8&255,k&255])),_.trun(W,M.length+16+20+8+16+8+8),M)},_.trak=function(W){return W.duration=W.duration||4294967295,_.box(_.types.trak,_.tkhd(W),_.mdia(W))},_.trex=function(W){var O=W.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(W,O){var M=W.samples||[],y=M.length,w=12+16*y,k=new Uint8Array(w),D,T,S,h,o,u;for(O+=8+w,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++)T=M[D],S=T.duration,h=T.size,o=T.flags,u=T.cts,k.set([S>>>24&255,S>>>16&255,S>>>8&255,S&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,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*D);return _.box(_.types.trun,k)},_.initSegment=function(W){_.types||_.init();var O=_.moov(W),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,Y.default=B},"./src/remux/mp4-remuxer.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return u}),L.d(Y,"normalizePts",function(){return d});var Q=L("./src/polyfills/number.ts"),B=L("./src/remux/aac-helper.ts"),_=L("./src/remux/mp4-generator.ts"),H=L("./src/events.ts"),W=L("./src/errors.ts"),O=L("./src/utils/logger.ts"),M=L("./src/types/loader.ts"),y=L("./src/utils/timescale-conversion.ts");function w(){return w=Object.assign||function(R){for(var x=1;x<arguments.length;x++){var f=arguments[x];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(R[c]=f[c])}return R},w.apply(this,arguments)}var k=10*1e3,D=1024,T=1152,S=null,h=null,o=!1,u=function(){function R(f,c,s,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=f,this.config=c,this.typeSupported=s,this.ISGenerated=!1,S===null){var b=navigator.userAgent||"",g=b.match(/Chrome\/(\d+)/i);S=g?parseInt(g[1]):0}if(h===null){var E=navigator.userAgent.match(/Safari\/(\d+)/i);h=E?parseInt(E[1]):0}o=!!S&&S<75||!!h&&h<600}var x=R.prototype;return x.destroy=function(){},x.resetTimeStamp=function(c){O.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=c},x.resetNextTimestamp=function(){O.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},x.resetInitSegment=function(){O.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},x.getVideoStartPts=function(c){var s=!1,a=c.reduce(function(b,g){var E=g.pts-b;return E<-4294967296?(s=!0,d(b,g.pts)):E>0?b:g.pts},c[0].pts);return s&&O.logger.debug("PTS rollover detected"),a},x.remux=function(c,s,a,b,g,E,P,G){var V,$,z,F,ee,ae,ce=g,ve=g,Me=c.pid>-1,xe=s.pid>-1,Ee=s.samples.length,Te=c.samples.length>0,Se=Ee>1,me=(!Me||Te)&&(!xe||Se)||this.ISGenerated||P;if(me){this.ISGenerated||(z=this.generateIS(c,s,g));var se=this.isVideoContiguous,Re=-1;if(Se&&(Re=A(s.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if(ae=!0,Re>0){O.logger.warn("[mp4-remuxer]: Dropped "+Re+" out of "+Ee+" video samples due to a missing keyframe");var Ve=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(Re),s.dropped+=Re,ve+=(s.samples[0].pts-Ve)/(s.timescale||9e4)}else Re===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ee+" video samples"),ae=!1);if(this.ISGenerated){if(Te&&Se){var We=this.getVideoStartPts(s.samples),Je=d(c.samples[0].pts,We)-We,Ze=Je/s.inputTimeScale;ce+=Math.max(0,Ze),ve+=Math.max(0,-Ze)}if(Te){if(c.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),z=this.generateIS(c,s,g)),$=this.remuxAudio(c,ce,this.isAudioContiguous,E,xe||Se||G===M.PlaylistLevelType.AUDIO?ve:void 0),Se){var De=$?$.endPTS-$.startPTS:0;s.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),z=this.generateIS(c,s,g)),V=this.remuxVideo(s,ve,se,De)}}else Se&&(V=this.remuxVideo(s,ve,se,0));V&&(V.firstKeyFrame=Re,V.independent=Re!==-1)}}return this.ISGenerated&&(a.samples.length&&(ee=this.remuxID3(a,g)),b.samples.length&&(F=this.remuxText(b,g))),{audio:$,video:V,initSegment:z,independent:ae,text:F,id3:ee}},x.generateIS=function(c,s,a){var b=c.samples,g=s.samples,E=this.typeSupported,P={},G=!Object(Q.isFiniteNumber)(this._initPTS),V="audio/mp4",$,z,F;if(G&&($=z=Infinity),c.config&&b.length&&(c.timescale=c.samplerate,c.isAAC||(E.mpeg?(V="audio/mpeg",c.codec=""):E.mp3&&(c.codec="mp3")),P.audio={id:"audio",container:V,codec:c.codec,initSegment:!c.isAAC&&E.mpeg?new Uint8Array(0):_.default.initSegment([c]),metadata:{channelCount:c.channelCount}},G&&(F=c.inputTimeScale,$=z=b[0].pts-Math.round(F*a))),s.sps&&s.pps&&g.length&&(s.timescale=s.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:_.default.initSegment([s]),metadata:{width:s.width,height:s.height}},G)){F=s.inputTimeScale;var ee=this.getVideoStartPts(g),ae=Math.round(F*a);z=Math.min(z,d(g[0].dts,ee)-ae),$=Math.min($,ee-ae)}if(Object.keys(P).length)return this.ISGenerated=!0,G&&(this._initPTS=$,this._initDTS=z),{tracks:P,initPTS:$,timescale:F}},x.remuxVideo=function(c,s,a,b){var g=c.inputTimeScale,E=c.samples,P=[],G=E.length,V=this._initPTS,$=this.nextAvcDts,z=8,F,ee,ae,ce=Number.POSITIVE_INFINITY,ve=Number.NEGATIVE_INFINITY,Me=0,xe=!1;if(!a||$===null){var Ee=s*g,Te=E[0].pts-d(E[0].dts,E[0].pts);$=Ee-Te}for(var Se=0;Se<G;Se++){var me=E[Se];if(me.pts=d(me.pts-V,$),me.dts=d(me.dts-V,$),me.dts>me.pts){var se=9e4*.2;Me=Math.max(Math.min(Me,me.pts-me.dts),-1*se)}me.dts<E[Se>0?Se-1:Se].dts&&(xe=!0)}xe&&E.sort(function(Rt,At){var ft=Rt.dts-At.dts,Ft=Rt.pts-At.pts;return ft||Ft}),ee=E[0].dts,ae=E[E.length-1].dts;var Re=Math.round((ae-ee)/(G-1));if(Me<0){if(Me<Re*-2){O.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-Re,!0)+" ms");for(var Ve=Me,We=0;We<G;We++)E[We].dts=Ve=Math.max(Ve,E[We].pts-Re),E[We].pts=Math.max(Ve,E[We].pts)}else{O.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(Me,!0)+" ms to overcome this issue");for(var Je=0;Je<G;Je++)E[Je].dts=E[Je].dts+Me}ee=E[0].dts}if(a){var Ze=ee-$,De=Ze>Re,Ue=Ze<-1;if(De||Ue){De?O.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(Ze,!0)+" ms ("+Ze+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-Ze,!0)+" ms ("+Ze+"dts) overlapping between fragments detected"),ee=$;var Be=E[0].pts-Ze;E[0].dts=ee,E[0].pts=Be,O.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(Be,!0)+"/"+Object(y.toMsFromMpegTsClock)(ee,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(Ze,!0)+" ms")}}o&&(ee=Math.max(0,ee));for(var qe=0,Qe=0,Ie=0;Ie<G;Ie++){for(var Ne=E[Ie],$e=Ne.units,et=$e.length,Xe=0,Ke=0;Ke<et;Ke++)Xe+=$e[Ke].data.length;Qe+=Xe,qe+=et,Ne.length=Xe,Ne.dts=Math.max(Ne.dts,ee),Ne.pts=Math.max(Ne.pts,Ne.dts,0),ce=Math.min(Ne.pts,ce),ve=Math.max(Ne.pts,ve)}ae=E[G-1].dts;var ct=Qe+4*qe+8,rt;try{rt=new Uint8Array(ct)}catch(Rt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ct,reason:"fail allocating video mdat "+ct});return}var at=new DataView(rt.buffer);at.setUint32(0,ct),rt.set(_.default.types.mdat,4);for(var Ae=0;Ae<G;Ae++){for(var dt=E[Ae],ot=dt.units,we=0,Fe=0,ge=ot.length;Fe<ge;Fe++){var de=ot[Fe],fe=de.data,te=de.data.byteLength;at.setUint32(z,te),z+=4,rt.set(fe,z),z+=te,we+=4+te}if(Ae<G-1)F=E[Ae+1].dts-dt.dts;else{var re=this.config,ne=dt.dts-E[Ae>0?Ae-1:Ae].dts;if(re.stretchShortVideoTrack&&this.nextAudioPts!==null){var le=Math.floor(re.maxBufferHole*g),pe=(b?ce+b*g:this.nextAudioPts)-dt.pts;pe>le?(F=pe-ne,F<0&&(F=ne),O.logger.log("[mp4-remuxer]: It is approximately "+pe/90+" ms to the next segment; using duration "+F/90+" ms for the last video frame.")):F=ne}else F=ne}var Ce=Math.round(dt.pts-dt.dts);P.push(new v(dt.key,F,we,Ce))}if(P.length&&S&&S<70){var Oe=P[0].flags;Oe.dependsOn=2,Oe.isNonSync=0}console.assert(F!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=$=ae+F,this.isVideoContiguous=!0;var st=_.default.moof(c.sequenceNumber++,ee,w({},c,{samples:P})),mt="video",ht={data1:st,data2:rt,startPTS:ce/g,endPTS:(ve+F)/g,startDTS:ee/g,endDTS:$/g,type:mt,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"),ht},x.remuxAudio=function(c,s,a,b,g){var E=c.inputTimeScale,P=c.samplerate?c.samplerate:E,G=E/P,V=c.isAAC?D:T,$=V*G,z=this._initPTS,F=!c.isAAC&&this.typeSupported.mpeg,ee=[],ae=c.samples,ce=F?0:8,ve=this.nextAudioPts||-1,Me=s*E;if(this.isAudioContiguous=a=a||ae.length&&ve>0&&(b&&Math.abs(Me-ve)<9e3||Math.abs(d(ae[0].pts-z,Me)-ve)<20*$),ae.forEach(function(fe){fe.pts=d(fe.pts-z,Me)}),!a||ve<0){if(ae=ae.filter(function(fe){return fe.pts>=0}),!ae.length)return;g===0?ve=0:b?ve=Math.max(0,Me):ve=ae[0].pts}if(c.isAAC)for(var xe=g!==void 0,Ee=this.config.maxAudioFramesDrift,Te=0,Se=ve;Te<ae.length;Te++){var me=ae[Te],se=me.pts,Re=se-Se,Ve=Math.abs(1e3*Re/E);if(Re<=-Ee*$&&xe)Te===0&&(O.logger.warn("Audio frame @ "+(se/E).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Re/E)+" ms."),this.nextAudioPts=ve=Se=se);else if(Re>=Ee*$&&Ve<k&&xe){var We=Math.round(Re/$);Se=se-We*$,Se<0&&(We--,Se+=$),Te===0&&(this.nextAudioPts=ve=Se),O.logger.warn("[mp4-remuxer]: Injecting "+We+" audio frame @ "+(Se/E).toFixed(3)+"s due to "+Math.round(1e3*Re/E)+" ms gap.");for(var Je=0;Je<We;Je++){var Ze=Math.max(Se,0),De=B.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);De||(O.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),De=me.unit.subarray()),ae.splice(Te,0,{unit:De,pts:Ze}),Se+=$,Te++}}me.pts=Se,Se+=$}for(var Ue=null,Be=null,qe,Qe=0,Ie=ae.length;Ie--;)Qe+=ae[Ie].unit.byteLength;for(var Ne=0,$e=ae.length;Ne<$e;Ne++){var et=ae[Ne],Xe=et.unit,Ke=et.pts;if(Be!==null){var ct=ee[Ne-1];ct.duration=Math.round((Ke-Be)/G)}else if(a&&c.isAAC&&(Ke=ve),Ue=Ke,Qe>0){Qe+=ce;try{qe=new Uint8Array(Qe)}catch(fe){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Qe,reason:"fail allocating audio mdat "+Qe});return}if(!F){var rt=new DataView(qe.buffer);rt.setUint32(0,Qe),qe.set(_.default.types.mdat,4)}}else return;qe.set(Xe,ce);var at=Xe.byteLength;ce+=at,ee.push(new v(!0,V,at,0)),Be=Ke}var Ae=ee.length;if(!Ae)return;var dt=ee[ee.length-1];this.nextAudioPts=ve=Be+G*dt.duration;var ot=F?new Uint8Array(0):_.default.moof(c.sequenceNumber++,Ue/G,w({},c,{samples:ee}));c.samples=[];var we=Ue/E,Fe=ve/E,ge="audio",de={data1:ot,data2:qe,startPTS:we,endPTS:Fe,startDTS:we,endDTS:Fe,type:ge,hasAudio:!0,hasVideo:!1,nb:Ae};return this.isAudioContiguous=!0,console.assert(qe.length,"MDAT length must not be zero"),de},x.remuxEmptyAudio=function(c,s,a,b){var g=c.inputTimeScale,E=c.samplerate?c.samplerate:g,P=g/E,G=this.nextAudioPts,V=(G!==null?G:b.startDTS*g)+this._initDTS,$=b.endDTS*g+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 ae=[],ce=0;ce<F;ce++){var ve=V+ce*z;ae.push({unit:ee,pts:ve,dts:ve})}return c.samples=ae,this.remuxAudio(c,s,a,!1)},x.remuxID3=function(c,s){var a=c.samples.length;if(!a)return;for(var b=c.inputTimeScale,g=this._initPTS,E=this._initDTS,P=0;P<a;P++){var G=c.samples[P];G.pts=d(G.pts-g,s*b)/b,G.dts=d(G.dts-E,s*b)/b}var V=c.samples;return c.samples=[],{samples:V}},x.remuxText=function(c,s){var a=c.samples.length;if(!a)return;for(var b=c.inputTimeScale,g=this._initPTS,E=0;E<a;E++){var P=c.samples[E];P.pts=d(P.pts-g,s*b)/b}c.samples.sort(function(V,$){return V.pts-$.pts});var G=c.samples;return c.samples=[],{samples:G}},R}();function d(R,x){var f;if(x===null)return R;for(x<R?f=-8589934592:f=8589934592;Math.abs(R-x)>4294967296;)R+=f;return R}function A(R){for(var x=0;x<R.length;x++)if(R[x].key)return x;return-1}var v=function(x,f,c,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=f,this.size=c,this.cts=s,this.flags=new m(x)},m=function(x){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=x?2:1,this.isNonSync=x?0:1}},"./src/remux/passthrough-remuxer.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/polyfills/number.ts"),B=L("./src/utils/mp4-tools.ts"),_=L("./src/loader/fragment.ts"),H=L("./src/utils/logger.ts"),W=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 w=y.prototype;return w.destroy=function(){},w.resetTimeStamp=function(D){this.initPTS=D,this.lastEndDTS=null},w.resetNextTimestamp=function(){this.lastEndDTS=null},w.resetInitSegment=function(D,T,S){this.audioCodec=T,this.videoCodec=S,this.generateInitSegment(D),this.emitInitSegment=!0},w.generateInitSegment=function(D){var T=this.audioCodec,S=this.videoCodec;if(!D||!D.byteLength){this.initTracks=void 0,this.initData=void 0;return}var h=this.initData=Object(B.parseInitSegment)(D);T||(T=M(h.audio,_.ElementaryStreamTypes.AUDIO)),S||(S=M(h.video,_.ElementaryStreamTypes.VIDEO));var o={};h.audio&&h.video?o.audiovideo={container:"video/mp4",codec:T+","+S,initSegment:D,id:"main"}:h.audio?o.audio={container:"audio/mp4",codec:T,initSegment:D,id:"audio"}:h.video?o.video={container:"video/mp4",codec:S,initSegment:D,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},w.remux=function(D,T,S,h,o){var u=this.initPTS,d=this.lastEndDTS,A={audio:void 0,video:void 0,text:h,id3:S,initSegment:void 0};Object(Q.isFiniteNumber)(d)||(d=this.lastEndDTS=o||0);var v=T.samples;if(!v||!v.length)return A;var m={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(v),R=this.initData),!R||!R.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(Q.isFiniteNumber)(u)||(this.initPTS=m.initPTS=u=O(R,v,d));var x=Object(B.getDuration)(v,R),f=d,c=x+f;Object(B.offsetStartDTS)(R,v,u),x>0?this.lastEndDTS=c:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!R.audio,a=!!R.video,b="";s&&(b+="audio"),a&&(b+="video");var g={data1:v,startPTS:f,startDTS:f,endPTS:c,endDTS:c,type:b,hasAudio:s,hasVideo:a,nb:1,dropped:0};return A.audio=g.type==="audio"?g:void 0,A.video=g.type!=="audio"?g:void 0,A.text=h,A.id3=S,A.initSegment=m,A},y}(),O=function(w,k,D){return Object(B.getStartDTS)(w,k)-D};function M(y,w){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"||w===_.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=W},"./src/task-loop.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"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(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!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,Y,L){"use strict";L.r(Y),L.d(Y,"CMCDVersion",function(){return Q}),L.d(Y,"CMCDObjectType",function(){return B}),L.d(Y,"CMCDStreamingFormat",function(){return _}),L.d(Y,"CMCDStreamType",function(){return H});var Q=1,B;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(B||(B={}));var _;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(_||(_={}));var H;(function(W){W.VOD="v",W.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"HlsSkip",function(){return _}),L.d(Y,"getSkipValue",function(){return H}),L.d(Y,"HlsUrlParameters",function(){return W}),L.d(Y,"Level",function(){return O});function Q(M,y){for(var w=0;w<y.length;w++){var k=y[w];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(M,k.key,k)}}function B(M,y,w){return y&&Q(M.prototype,y),w&&Q(M,w),M}var _;(function(M){M.No="",M.Yes="YES",M.v2="v2"})(_||(_={}));function H(M,y){var w=M.canSkipUntil,k=M.canSkipDateRanges,D=M.endSN,T=y!==void 0?y-D:0;return w&&T<w?k?_.v2:_.Yes:_.No}var W=function(){function M(w,k,D){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=w,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(w){return w}).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(w){var k=w%this.url.length;this._urlId!==k&&(this.details=void 0,this._urlId=k)}}]),M}()},"./src/types/loader.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"PlaylistContextType",function(){return Q}),L.d(Y,"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,Y,L){"use strict";L.r(Y),L.d(Y,"ChunkMetadata",function(){return Q});var Q=function(H,W,O,M,y,w){M===void 0&&(M=0),y===void 0&&(y=-1),w===void 0&&(w=!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=H,this.sn=W,this.id=O,this.size=M,this.part=y,this.partial=w};function B(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"AttrList",function(){return _});var Q=/^(\d+)x(\d+)$/,B=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,_=function(){function H(O){typeof O=="string"&&(O=H.parseAttrList(O));for(var M in O)O.hasOwnProperty(M)&&(this[M]=O[M])}var W=H.prototype;return W.decimalInteger=function(M){var y=parseInt(this[M],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},W.hexadecimalInteger=function(M){if(this[M]){var y=(this[M]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var w=new Uint8Array(y.length/2),k=0;k<y.length/2;k++)w[k]=parseInt(y.slice(k*2,k*2+2),16);return w}else return null},W.hexadecimalIntegerAsNumber=function(M){var y=parseInt(this[M],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},W.decimalFloatingPoint=function(M){return parseFloat(this[M])},W.optionalFloat=function(M,y){var w=this[M];return w?parseFloat(w):y},W.enumeratedString=function(M){return this[M]},W.bool=function(M){return this[M]==="YES"},W.decimalResolution=function(M){var y=Q.exec(this[M]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},H.parseAttrList=function(M){var y,w={},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)),w[y[1]]=D}return w},H}()},"./src/utils/binary-search.ts":function(ie,Y,L){"use strict";L.r(Y);var Q={search:function(_,H){for(var W=0,O=_.length-1,M=null,y=null;W<=O;){M=(W+O)/2|0,y=_[M];var w=H(y);if(w>0)W=M+1;else if(w<0)O=M-1;else return y}return null}};Y.default=Q},"./src/utils/buffer-helper.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"BufferHelper",function(){return _});var Q=L("./src/utils/logger.ts"),B={length:0,start:function(){return 0},end:function(){return 0}},_=function(){function H(){}return H.isBuffered=function(O,M){try{if(O){for(var y=H.getBuffered(O),w=0;w<y.length;w++)if(M>=y.start(w)&&M<=y.end(w))return!0}}catch(k){}return!1},H.bufferInfo=function(O,M,y){try{if(O){var w=H.getBuffered(O),k=[],D;for(D=0;D<w.length;D++)k.push({start:w.start(D),end:w.end(D)});return this.bufferedInfo(k,M,y)}}catch(T){}return{len:0,start:M,end:M,nextStart:void 0}},H.bufferedInfo=function(O,M,y){M=Math.max(0,M),O.sort(function(m,R){var x=m.start-R.start;return x||R.end-m.end});var w=[];if(y)for(var k=0;k<O.length;k++){var D=w.length;if(D){var T=w[D-1].end;O[k].start-T<y?O[k].end>T&&(w[D-1].end=O[k].end):w.push(O[k])}else w.push(O[k])}else w=O;for(var S=0,h,o=M,u=M,d=0;d<w.length;d++){var A=w[d].start,v=w[d].end;if(M+y>=A&&M<v)o=A,u=v,S=u-M;else if(M+y<A){h=A;break}}return{len:S,start:o||0,end:u||0,nextStart:h}},H.getBuffered=function(O){try{return O.buffered}catch(M){return Q.logger.log("failed to get media.buffered",M),B}},H}()},"./src/utils/cea-608-parser.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"Row",function(){return u}),L.d(Y,"CaptionScreen",function(){return d});var Q=L("./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 s=c;return B.hasOwnProperty(c)&&(s=B[c]),String.fromCharCode(s)},H=15,W=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},w={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(f){f[f.ERROR=0]="ERROR",f[f.TEXT=1]="TEXT",f[f.WARNING=2]="WARNING",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f[f.DATA=3]="DATA"})(D||(D={}));var T=function(){function f(){this.time=null,this.verboseLevel=D.ERROR}var c=f.prototype;return c.log=function(a,b){this.verboseLevel>=a&&Q.logger.log(this.time+" ["+a+"] "+b)},f}(),S=function(c){for(var s=[],a=0;a<c.length;a++)s.push(c[a].toString(16));return s},h=function(){function f(s,a,b,g,E){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=s||"white",this.underline=a||!1,this.italics=b||!1,this.background=g||"black",this.flash=E||!1}var c=f.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"],g=0;g<b.length;g++){var E=b[g];a.hasOwnProperty(E)&&(this[E]=a[E])}},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},f}(),o=function(){function f(s,a,b,g,E,P){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new h(a,b,g,E,P)}var c=f.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()},f}(),u=function(){function f(s){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<W;a++)this.chars.push(new o);this.logger=s,this.pos=0,this.currPenState=new h}var c=f.prototype;return c.equals=function(a){for(var b=!0,g=0;g<W;g++)if(!this.chars[g].equals(a.chars[g])){b=!1;break}return b},c.copy=function(a){for(var b=0;b<W;b++)this.chars[b].copy(a.chars[b])},c.isEmpty=function(){for(var a=!0,b=0;b<W;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>W&&(this.logger.log(D.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},c.moveCursor=function(a){var b=this.pos+a;if(a>1)for(var g=this.pos+1;g<b+1;g++)this.chars[g].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>=W){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<W;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,g=0;g<W;g++){var E=this.chars[g].uchar;E!==" "&&(b=!1),a.push(E)}return b?"":a.join("")},c.setPenStyles=function(a){this.currPenState.setStyles(a);var b=this.chars[this.pos];b.setPenState(this.currPenState)},f}(),d=function(){function f(s){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<H;a++)this.rows.push(new u(s));this.logger=s,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var c=f.prototype;return c.reset=function(){for(var a=0;a<H;a++)this.rows[a].clear();this.currRow=H-1},c.equals=function(a){for(var b=!0,g=0;g<H;g++)if(!this.rows[g].equals(a.rows[g])){b=!1;break}return b},c.copy=function(a){for(var b=0;b<H;b++)this.rows[b].copy(a.rows[b])},c.isEmpty=function(){for(var a=!0,b=0;b<H;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 g=0;g<H;g++)this.rows[g].clear();var E=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var G=P.rows[E].cueStartTime,V=this.logger.time;if(G&&V!==null&&G<V)for(var $=0;$<this.nrRollUpRows;$++)this.rows[b-this.nrRollUpRows+$+1].copy(P.rows[E+$])}}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 ae={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(ae)},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=[],g="",E=-1,P=0;P<H;P++){var G=this.rows[P].getTextString();G&&(E=P+1,a?b.push("Row "+E+": '"+G+"'"):b.push(G.trim()))}return b.length>0&&(a?g="["+b.join(" | ")+"]":g=b.join(`
|
|
`)),g},c.getTextAndFormat=function(){return this.rows},f}(),A=function(){function f(s,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=s,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[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=b}var c=f.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[H-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 g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(D.INFO,g+": "+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 g=Math.floor(a/2)-16,E=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=E[g]}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))},f}(),v=function(){function f(s,a,b){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new T;this.channels=[null,new A(s,a,g),new A(s+1,b,g)],this.cmdHistory=x(),this.logger=g}var c=f.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 g,E,P,G=!1;this.logger.time=a;for(var V=0;V<b.length;V+=2){if(E=b[V]&127,P=b[V+1]&127,E===0&&P===0)continue;if(this.logger.log(D.DATA,"["+S([b[V],b[V+1]])+"] -> ("+S([E,P])+")"),g=this.parseCmd(E,P),g||(g=this.parseMidrow(E,P)),g||(g=this.parsePAC(E,P)),g||(g=this.parseBackgroundAttributes(E,P)),!g&&(G=this.parseChars(E,P),G)){var $=this.currentChannel;if($&&$>0){var z=this.channels[$];z.insertChars(G)}else this.logger.log(D.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!G&&this.logger.log(D.WARNING,"Couldn't parse cleaned data "+S([E,P])+" orig: "+S([b[V],b[V+1]]))}},c.parseCmd=function(a,b){var g=this.cmdHistory,E=(a===20||a===28||a===21||a===29)&&b>=32&&b<=47,P=(a===23||a===31)&&b>=33&&b<=35;if(!(E||P))return!1;if(R(a,b,g))return m(null,null,g),this.logger.log(D.DEBUG,"Repeated command ("+S([a,b])+") is dropped"),!0;var G=a===20||a===21||a===23?1:2,V=this.channels[G];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),m(a,b,g),this.currentChannel=G,!0},c.parseMidrow=function(a,b){var g=0;if((a===17||a===25)&&b>=32&&b<=47){if(a===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(D.ERROR,"Mismatch channel in midrow parsing"),!1;var E=this.channels[g];return E?(E.ccMIDROW(b),this.logger.log(D.DEBUG,"MIDROW ("+S([a,b])+")"),!0):!1}return!1},c.parsePAC=function(a,b){var g,E=this.cmdHistory,P=(a>=17&&a<=23||a>=25&&a<=31)&&b>=64&&b<=127,G=(a===16||a===24)&&b>=64&&b<=95;if(!(P||G))return!1;if(R(a,b,E))return m(null,null,E),!0;var V=a<=23?1:2;b>=64&&b<=95?g=V===1?O[a]:y[a]:g=V===1?M[a]:w[a];var $=this.channels[V];return $?($.setPAC(this.interpretPAC(g,b)),m(a,b,E),this.currentChannel=V,!0):!1},c.interpretPAC=function(a,b){var g,E={color:null,italics:!1,indent:null,underline:!1,row:a};return b>95?g=b-96:g=b-64,E.underline=(g&1)===1,g<=13?E.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(E.italics=!0,E.color="white"):E.indent=Math.floor((g-16)/2)*4,E},c.parseChars=function(a,b){var g,E=null,P=null;if(a>=25?(g=2,P=a-8):(g=1,P=a),P>=17&&P<=19){var G;P===17?G=b+80:P===18?G=b+112:G=b+144,this.logger.log(D.INFO,"Special char '"+_(G)+"' in channel "+g),E=[G]}else a>=32&&a<=127&&(E=b===0?[a]:[a,b]);if(E){var V=S(E);this.logger.log(D.DEBUG,"Char codes = "+V.join(",")),m(a,b,this.cmdHistory)}return E},c.parseBackgroundAttributes=function(a,b){var g=(a===16||a===24)&&b>=32&&b<=47,E=(a===23||a===31)&&b>=45&&b<=47;if(!(g||E))return!1;var P,G={};a===16||a===24?(P=Math.floor((b-32)/2),G.background=k[P],b%2===1&&(G.background=G.background+"_semi")):b===45?G.background="transparent":(G.foreground="black",b===47&&(G.underline=!0));var V=a<=23?1:2,$=this.channels[V];return $.setBkgData(G),m(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=x()},c.cueSplitAtTime=function(a){for(var b=0;b<this.channels.length;b++){var g=this.channels[b];g&&g.cueSplitAtTime(a)}},f}();function m(f,c,s){s.a=f,s.b=c}function R(f,c,s){return s.a===f&&s.b===c}function x(){return{a:null,b:null}}Y.default=v},"./src/utils/codecs.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"isCodecType",function(){return B}),L.d(Y,"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(H,W){var O=Q[W];return!!O&&O[H.slice(0,4)]===!0}function _(H,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/utils/vttparser.ts"),B=L("./src/utils/webvtt-parser.ts"),_=L("./src/utils/texttrack-utils.ts"),H=/\s/,W={newCue:function(M,y,w,k){for(var D=[],T,S,h,o,u,d=self.VTTCue||self.TextTrackCue,A=0;A<k.rows.length;A++)if(T=k.rows[A],h=!0,o=0,u="",!T.isEmpty()){for(var v=0;v<T.chars.length;v++)H.test(T.chars[v].uchar)&&h?o++:(u+=T.chars[v].uchar,h=!1);T.cueStartTime=y,y===w&&(w+=1e-4),o>=16?o--:o++;var m=Object(Q.fixLineBreaks)(u.trim()),R=Object(B.generateCueId)(y,w,m);(!M||!M.cues||!M.cues.getCueById(R))&&(S=new d(y,w,m),S.id=R,S.line=A+1,S.align="left",S.position=10+Math.min(80,Math.floor(o*8/32)*10),D.push(S))}return M&&D.length&&(D.sort(function(x,f){return x.line==="auto"||f.line==="auto"?0:x.line>8&&f.line>8?f.line-x.line:x.line-f.line}),D.forEach(function(x){return Object(_.addCueToTrack)(M,x)})),D}};Y.default=W},"./src/utils/discontinuities.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"findFirstFragWithCC",function(){return H}),L.d(Y,"shouldAlignOnDiscontinuities",function(){return W}),L.d(Y,"findDiscontinuousReferenceFrag",function(){return O}),L.d(Y,"adjustSlidingStart",function(){return y}),L.d(Y,"alignStream",function(){return w}),L.d(Y,"alignPDT",function(){return D}),L.d(Y,"alignFragmentByPDTDelta",function(){return T}),L.d(Y,"alignMediaPlaylistByPDT",function(){return S});var Q=L("./src/polyfills/number.ts"),B=L("./src/utils/logger.ts"),_=L("./src/controller/level-helper.ts");function H(h,o){for(var u=null,d=0,A=h.length;d<A;d++){var v=h[d];if(v&&v.cc===o){u=v;break}}return u}function W(h,o,u){return!!(o.details&&(u.endCC>u.startCC||h&&h.cc<u.startCC))}function O(h,o){var u=h.fragments,d=o.fragments;if(!d.length||!u.length){B.logger.log("No fragments to align");return}var A=H(u,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 u=h.start+o;h.start=h.startPTS=u,h.endPTS=u+h.duration}}function y(h,o){for(var u=o.fragments,d=0,A=u.length;d<A;d++)M(u[d],h);o.fragmentHint&&M(o.fragmentHint,h),o.alignedSliding=!0}function w(h,o,u){if(!o)return;k(h,u,o),!u.alignedSliding&&o.details&&D(u,o.details),!u.alignedSliding&&o.details&&!u.skippedSegments&&Object(_.adjustSliding)(o.details,u)}function k(h,o,u){if(W(h,u,o)){var d=O(u.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 u=o.fragments[0].programDateTime,d=h.fragments[0].programDateTime,A=(d-u)/1e3+o.fragments[0].start;A&&Object(Q.isFiniteNumber)(A)&&(B.logger.log("Adjusting PTS using programDateTime delta "+(d-u)+"ms, sliding:"+A.toFixed(3)+" "+h.url+" "),y(A,h))}function T(h,o){var u=h.programDateTime;if(!u)return;var d=(u-o)/1e3;h.start=h.startPTS=d,h.endPTS=d+h.duration}function S(h,o){if(!o.fragments.length||!h.hasProgramDateTime||!o.hasProgramDateTime)return;var u=o.fragments[0].programDateTime,d=o.fragments[0].start,A=u-d*1e3;h.fragments.forEach(function(v){T(v,A)}),h.fragmentHint&&T(h.fragmentHint,A),h.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/utils/ewma.ts"),B=function(){function _(W,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(W),this.fast_=new Q.default(O)}var H=_.prototype;return H.update=function(O,M){var y=this.slow_,w=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,w.getEstimate(),w.getTotalWeight()))},H.sample=function(O,M){O=Math.max(O,this.minDelayMs_);var y=8*M,w=O/1e3,k=y/w;this.fast_.sample(w,k),this.slow_.sample(w,k)},H.canEstimate=function(){var O=this.fast_;return O&&O.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},_}();Y.default=B},"./src/utils/ewma.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=function(){function B(H,W,O){W===void 0&&(W=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=W,this.totalWeight_=O}var _=B.prototype;return _.sample=function(W,O){var M=Math.pow(this.alpha_,W);this.estimate_=O*(1-M)+M*this.estimate_,this.totalWeight_+=W},_.getTotalWeight=function(){return this.totalWeight_},_.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},B}();Y.default=Q},"./src/utils/fetch-loader.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"fetchSupported",function(){return T});var Q=L("./src/polyfills/number.ts"),B=L("./src/loader/load-stats.ts"),_=L("./src/demux/chunk-cache.ts");function H(d,A){d.prototype=Object.create(A.prototype),d.prototype.constructor=d,w(d,A)}function W(d){var A=typeof Map=="function"?new Map:void 0;return W=function(m){if(m===null||!y(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(m))return A.get(m);A.set(m,R)}function R(){return O(m,arguments,k(this).constructor)}return R.prototype=Object.create(m.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),w(R,m)},W(d)}function O(d,A,v){return M()?O=Reflect.construct:O=function(R,x,f){var c=[null];c.push.apply(c,x);var s=Function.bind.apply(R,c),a=new s;return f&&w(a,f.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 w(d,A){return w=Object.setPrototypeOf||function(m,R){return m.__proto__=R,m},w(d,A)}function k(d){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},k(d)}function D(){return D=Object.assign||function(d){for(var A=1;A<arguments.length;A++){var v=arguments[A];for(var m in v)Object.prototype.hasOwnProperty.call(v,m)&&(d[m]=v[m])}return d},D.apply(this,arguments)}function T(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var S=function(){function d(v){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=v.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 m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(m,R,x){var f=this,c=this.stats;if(c.loading.start)throw new Error("Loader can only be used once.");c.loading.start=self.performance.now();var s=h(m,this.controller.signal),a=x.onProgress,b=m.responseType==="arraybuffer",g=b?"byteLength":"length";this.context=m,this.config=R,this.callbacks=x,this.request=this.fetchSetup(m,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){f.abortInternal(),x.onTimeout(c,m,f.response)},R.timeout),self.fetch(this.request).then(function(E){if(f.response=f.loader=E,!E.ok){var P=E.status,G=E.statusText;throw new u(G||"fetch, bad network response",P,E)}return c.loading.first=Math.max(self.performance.now(),c.loading.start),c.total=parseInt(E.headers.get("Content-Length")||"0"),a&&Object(Q.isFiniteNumber)(R.highWaterMark)?f.loadProgressively(E,c,m,R.highWaterMark,a):b?E.arrayBuffer():E.text()}).then(function(E){var P=f.response;self.clearTimeout(f.requestTimeout),c.loading.end=Math.max(self.performance.now(),c.loading.first),c.loaded=c.total=E[g];var G={url:P.url,data:E};a&&!Object(Q.isFiniteNumber)(R.highWaterMark)&&a(c,m,E,P),x.onSuccess(G,c,m,P)}).catch(function(E){if(self.clearTimeout(f.requestTimeout),c.aborted)return;var P=E.code||0;x.onError({code:P,text:E.message},m,E.details)})},A.getCacheAge=function(){var m=null;if(this.response){var R=this.response.headers.get("age");m=R?parseFloat(R):null}return m},A.loadProgressively=function(m,R,x,f,c){f===void 0&&(f=0);var s=new _.default,a=m.body.getReader(),b=function g(){return a.read().then(function(E){if(E.done)return s.dataLength&&c(R,x,s.flush(),m),Promise.resolve(new ArrayBuffer(0));var P=E.value,G=P.length;return R.loaded+=G,G<f||s.dataLength?(s.push(P),s.dataLength>=f&&c(R,x,s.flush(),m)):c(R,x,P,m),g()}).catch(function(){return Promise.reject()})};return b()},d}();function h(d,A){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(D({},d.headers))};return d.rangeEnd&&v.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),v}function o(d,A){return new self.Request(d.url,A)}var u=function(d){H(A,d);function A(v,m,R){var x;return x=d.call(this,v)||this,x.code=void 0,x.details=void 0,x.code=m,x.details=R,x}return A}(W(Error));Y.default=S},"./src/utils/imsc1-ttml-parser.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"IMSC1_CODEC",function(){return y}),L.d(Y,"parseIMSC1",function(){return T});var Q=L("./src/utils/mp4-tools.ts"),B=L("./src/utils/vttparser.ts"),_=L("./src/utils/vttcue.ts"),H=L("./src/demux/id3.ts"),W=L("./src/utils/timescale-conversion.ts"),O=L("./src/utils/webvtt-parser.ts");function M(){return M=Object.assign||function(f){for(var c=1;c<arguments.length;c++){var s=arguments[c];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(f[a]=s[a])}return f},M.apply(this,arguments)}var y="stpp.ttml.im1t",w=/^(\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 T(f,c,s,a,b){var g=Object(Q.findBox)(new Uint8Array(f),["mdat"]);if(g.length===0){b(new Error("Could not parse IMSC1 mdat"));return}var E=g[0],P=Object(H.utf8ArrayToStr)(new Uint8Array(f,E.start,E.end-E.start)),G=Object(W.toTimescaleFromScale)(c,1,s);try{a(S(P,G))}catch(V){b(V)}}function S(f,c){var s=new DOMParser,a=s.parseFromString(f,"text/xml"),b=a.getElementsByTagName("tt")[0];if(!b)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},E=Object.keys(g).reduce(function(z,F){return z[F]=b.getAttribute("ttp:"+F)||g[F],z},{}),P=b.getAttribute("xml:space")!=="preserve",G=o(h(b,"styling","style")),V=o(h(b,"layout","region")),$=h(b,"body","[begin]");return[].map.call($,function(z){var F=u(z,P);if(!F||!z.hasAttribute("begin"))return null;var ee=m(z.getAttribute("begin"),E),ae=m(z.getAttribute("dur"),E),ce=m(z.getAttribute("end"),E);if(ee===null)throw v(z);if(ce===null){if(ae===null)throw v(z);ce=ee+ae}var ve=new _.default(ee-c,ce-c,F);ve.id=Object(O.generateCueId)(ve.startTime,ve.endTime,ve.text);var Me=V[z.getAttribute("region")],xe=G[z.getAttribute("style")];ve.position=10,ve.size=80;var Ee=d(Me,xe),Te=Ee.textAlign;if(Te){var Se=D[Te];Se&&(ve.lineAlign=Se),ve.align=Te}return M(ve,Ee),ve}).filter(function(z){return z!==null})}function h(f,c,s){var a=f.getElementsByTagName(c)[0];return a?[].slice.call(a.querySelectorAll(s)):[]}function o(f){return f.reduce(function(c,s){var a=s.getAttribute("xml:id");return a&&(c[a]=s),c},{})}function u(f,c){return[].slice.call(f.childNodes).reduce(function(s,a,b){var g;return a.nodeName==="br"&&b?s+`
|
|
`:(g=a.childNodes)!==null&&g!==void 0&&g.length?u(a,c):c?s+a.textContent.trim().replace(/\s+/g," "):s+a.textContent},"")}function d(f,c){var s="http://www.w3.org/ns/ttml#styling",a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return a.reduce(function(b,g){var E=A(c,s,g)||A(f,s,g);return E&&(b[g]=E),b},{})}function A(f,c,s){return f.hasAttributeNS(c,s)?f.getAttributeNS(c,s):null}function v(f){return new Error("Could not parse ttml timestamp "+f)}function m(f,c){if(!f)return null;var s=Object(B.parseTimeStamp)(f);return s===null&&(w.test(f)?s=R(f,c):k.test(f)&&(s=x(f,c))),s}function R(f,c){var s=w.exec(f),a=(s[4]|0)+(s[5]|0)/c.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+a/c.frameRate}function x(f,c){var s=k.exec(f),a=Number(s[1]),b=s[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,Y,L){"use strict";L.r(Y),L.d(Y,"enableLogs",function(){return O}),L.d(Y,"logger",function(){return M});var Q=function(){},B={trace:Q,debug:Q,log:Q,warn:Q,info:Q,error:Q},_=B;function H(y){var w=self.console[y];return w?w.bind(self.console,"["+y+"] >"):Q}function W(y){for(var w=arguments.length,k=new Array(w>1?w-1:0),D=1;D<w;D++)k[D-1]=arguments[D];k.forEach(function(T){_[T]=y[T]?y[T].bind(y):H(T)})}function O(y){if(self.console&&y===!0||typeof y=="object"){W(y,"debug","log","info","warn","error");try{_.log()}catch(w){_=B}}else _=B}var M=_},"./src/utils/mediakeys-helper.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"KeySystems",function(){return Q}),L.d(Y,"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,Y,L){"use strict";L.r(Y),L.d(Y,"getMediaSource",function(){return Q});function Q(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"bin2str",function(){return W}),L.d(Y,"readUint16",function(){return O}),L.d(Y,"readUint32",function(){return M}),L.d(Y,"writeUint32",function(){return y}),L.d(Y,"findBox",function(){return w}),L.d(Y,"parseSegmentIndex",function(){return k}),L.d(Y,"parseInitSegment",function(){return D}),L.d(Y,"getStartDTS",function(){return T}),L.d(Y,"getDuration",function(){return S}),L.d(Y,"computeRawDurationFromSamples",function(){return h}),L.d(Y,"offsetStartDTS",function(){return o}),L.d(Y,"segmentValidRange",function(){return u}),L.d(Y,"appendUint8Array",function(){return d});var Q=L("./src/utils/typed-array.ts"),B=L("./src/loader/fragment.ts"),_=Math.pow(2,32)-1,H=[].push;function W(A){return String.fromCharCode.apply(null,A)}function O(A,v){"data"in A&&(v+=A.start,A=A.data);var m=A[v]<<8|A[v+1];return m<0?65536+m:m}function M(A,v){"data"in A&&(v+=A.start,A=A.data);var m=A[v]<<24|A[v+1]<<16|A[v+2]<<8|A[v+3];return m<0?4294967296+m:m}function y(A,v,m){"data"in A&&(v+=A.start,A=A.data),A[v]=m>>24,A[v+1]=m>>16&255,A[v+2]=m>>8&255,A[v+3]=m&255}function w(A,v){var m=[];if(!v.length)return m;var R,x,f;"data"in A?(R=A.data,x=A.start,f=A.end):(R=A,x=0,f=R.byteLength);for(var c=x;c<f;){var s=M(R,c),a=W(R.subarray(c+4,c+8)),b=s>1?c+s:f;if(a===v[0])if(v.length===1)m.push({data:R,start:c+8,end:b});else{var g=w({data:R,start:c+8,end:b},v.slice(1));g.length&&H.apply(m,g)}c=b}return m}function k(A){var v=w(A,["moov"]),m=v[0],R=m?m.end:null,x=w(A,["sidx"]);if(!x||!x[0])return null;var f=[],c=x[0],s=c.data[0],a=s===0?8:16,b=M(c,a);a+=4;var g=0,E=0;s===0?a+=8:a+=16,a+=2;var P=c.end+E,G=O(c,a);a+=2;for(var V=0;V<G;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 ae=M(c,$);$+=4,f.push({referenceSize:F,subsegmentDuration:ae,info:{duration:ae/b,start:P,end:P+F-1}}),P+=F,$+=4,a=$}return{earliestPresentationTime:g,timescale:b,version:s,referencesCount:G,references:f,moovEndOffset:R}}function D(A){for(var v=[],m=w(A,["moov","trak"]),R=0;R<m.length;R++){var x=m[R],f=w(x,["tkhd"])[0];if(f){var c=f.data[f.start],s=c===0?12:20,a=M(f,s),b=w(x,["mdia","mdhd"])[0];if(b){c=b.data[b.start],s=c===0?12:20;var g=M(b,s),E=w(x,["mdia","hdlr"])[0];if(E){var P=W(E.data.subarray(E.start+8,E.start+12)),G={soun:B.ElementaryStreamTypes.AUDIO,vide:B.ElementaryStreamTypes.VIDEO}[P];if(G){var V=w(x,["mdia","minf","stbl","stsd"])[0],$=void 0;V&&($=W(V.data.subarray(V.start+12,V.start+16))),v[a]={timescale:g,type:G},v[G]={timescale:g,id:a,codec:$}}}}}}var z=w(A,["moov","mvex","trex"]);return z.forEach(function(F){var ee=M(F,4),ae=v[ee];ae&&(ae.default={duration:M(F,12),flags:M(F,20)})}),v}function T(A,v){return w(v,["moof","traf"]).reduce(function(m,R){var x=w(R,["tfdt"])[0],f=x.data[x.start],c=w(R,["tfhd"]).reduce(function(s,a){var b=M(a,4),g=A[b];if(g){var E=M(x,4);f===1&&(E*=Math.pow(2,32),E+=M(x,8));var P=g.timescale||9e4,G=E/P;if(isFinite(G)&&(s===null||G<s))return G}return s},null);return c!==null&&isFinite(c)&&(m===null||c<m)?c:m},null)||0}function S(A,v){for(var m=0,R=0,x=0,f=w(A,["moof","traf"]),c=0;c<f.length;c++){var s=f[c],a=w(s,["tfhd"])[0],b=M(a,4),g=v[b];if(!g)continue;var E=g.default,P=M(a,0)|(E==null?void 0:E.flags),G=E==null?void 0:E.duration;P&8&&(P&2?G=M(a,12):G=M(a,8));for(var V=g.timescale||9e4,$=w(s,["trun"]),z=0;z<$.length;z++){if(G){var F=M($[z],4);m=G*F}else m=h($[z]);g.type===B.ElementaryStreamTypes.VIDEO?R+=m/V:g.type===B.ElementaryStreamTypes.AUDIO&&(x+=m/V)}}if(R===0&&x===0){var ee=k(A);if(ee!=null&&ee.references)return ee.references.reduce(function(ae,ce){return ae+ce.info.duration||0},0)}return R||x}function h(A){var v=M(A,0),m=8;v&1&&(m+=4),v&4&&(m+=4);for(var R=0,x=M(A,4),f=0;f<x;f++){if(v&256){var c=M(A,m);R+=c,m+=4}v&512&&(m+=4),v&1024&&(m+=4),v&2048&&(m+=4)}return R}function o(A,v,m){w(v,["moof","traf"]).forEach(function(R){w(R,["tfhd"]).forEach(function(x){var f=M(x,4),c=A[f];if(!c)return;var s=c.timescale||9e4;w(R,["tfdt"]).forEach(function(a){var b=a.data[a.start],g=M(a,4);if(b===0)y(a,4,g-m*s);else{g*=Math.pow(2,32),g+=M(a,8),g-=m*s,g=Math.max(g,0);var E=Math.floor(g/(_+1)),P=Math.floor(g%(_+1));y(a,4,E),y(a,8,P)}})})})}function u(A){var v={valid:null,remainder:null},m=w(A,["moof"]);if(m){if(m.length<2)return v.remainder=A,v}else return v;var R=m[m.length-1];return v.valid=Object(Q.sliceUint8)(A,0,R.start-8),v.remainder=Object(Q.sliceUint8)(A,R.start-8),v}function d(A,v){var m=new Uint8Array(A.length+v.length);return m.set(A),m.set(v,A.length),m}},"./src/utils/output-filter.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return Q});var Q=function(){function B(H,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=W}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(W,O,M){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=O,this.screen=M,this.timelineController.createCaptionsTrack(this.trackName)},_.reset=function(){this.cueRanges=[]},B}()},"./src/utils/texttrack-utils.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"sendAddTrackEvent",function(){return B}),L.d(Y,"addCueToTrack",function(){return _}),L.d(Y,"clearCurrentCues",function(){return H}),L.d(Y,"removeCuesInRange",function(){return W}),L.d(Y,"getCuesInRange",function(){return M});var Q=L("./src/utils/logger.ts");function B(y,w){var k;try{k=new Event("addtrack")}catch(D){k=document.createEvent("Event"),k.initEvent("addtrack",!1,!1)}k.track=y,w.dispatchEvent(k)}function _(y,w){var k=y.mode;if(k==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(w.id))try{if(y.addCue(w),!y.cues.getCueById(w.id))throw new Error("addCue is failed for: "+w)}catch(T){Q.logger.debug("[texttrack-utils]: "+T);var D=new self.TextTrackCue(w.startTime,w.endTime,w.text);D.id=w.id,y.addCue(D)}k==="disabled"&&(y.mode=k)}function H(y){var w=y.mode;if(w==="disabled"&&(y.mode="hidden"),y.cues)for(var k=y.cues.length;k--;)y.removeCue(y.cues[k]);w==="disabled"&&(y.mode=w)}function W(y,w,k){var D=y.mode;if(D==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var T=M(y.cues,w,k),S=0;S<T.length;S++)y.removeCue(T[S]);D==="disabled"&&(y.mode=D)}function O(y,w){if(w<y[0].startTime)return 0;var k=y.length-1;if(w>y[k].endTime)return-1;for(var D=0,T=k;D<=T;){var S=Math.floor((T+D)/2);if(w<y[S].startTime)T=S-1;else if(w>y[S].startTime&&D<k)D=S+1;else return S}return y[D].startTime-w<w-y[T].startTime?D:T}function M(y,w,k){var D=[],T=O(y,w);if(T>-1)for(var S=T,h=y.length;S<h;S++){var o=y[S];if(o.startTime>=w&&o.endTime<=k)D.push(o);else if(o.startTime>k)return D}return D}},"./src/utils/time-ranges.ts":function(ie,Y,L){"use strict";L.r(Y);var Q={toString:function(_){for(var H="",W=_.length,O=0;O<W;O++)H+="["+_.start(O).toFixed(3)+","+_.end(O).toFixed(3)+"]";return H}};Y.default=Q},"./src/utils/timescale-conversion.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"toTimescaleFromBase",function(){return B}),L.d(Y,"toTimescaleFromScale",function(){return _}),L.d(Y,"toMsFromMpegTsClock",function(){return H}),L.d(Y,"toMpegTsClockFromTimescale",function(){return W});var Q=9e4;function B(O,M,y,w){y===void 0&&(y=1),w===void 0&&(w=!1);var k=O*M*y;return w?Math.round(k):k}function _(O,M,y,w){return y===void 0&&(y=1),w===void 0&&(w=!1),B(O,M,1/y,w)}function H(O,M){return M===void 0&&(M=!1),B(O,1e3,1/Q,M)}function W(O,M){return M===void 0&&(M=1),B(O,Q,1/M)}},"./src/utils/typed-array.ts":function(ie,Y,L){"use strict";L.r(Y),L.d(Y,"sliceUint8",function(){return Q});function Q(B,_,H){return Uint8Array.prototype.slice?B.slice(_,H):new Uint8Array(Array.prototype.slice.call(B,_,H))}},"./src/utils/vttcue.ts":function(ie,Y,L){"use strict";L.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Q=["","lr","rl"],B=["start","middle","end","left","right"];function _(y,w){if(typeof w!="string")return!1;if(!Array.isArray(y))return!1;var k=w.toLowerCase();return~y.indexOf(k)?k:!1}function H(y){return _(Q,y)}function W(y){return _(B,y)}function O(y){for(var w=arguments.length,k=new Array(w>1?w-1:0),D=1;D<w;D++)k[D-1]=arguments[D];for(var T=1;T<arguments.length;T++){var S=arguments[T];for(var h in S)y[h]=S[h]}return y}function M(y,w,k){var D=this,T={enumerable:!0};D.hasBeenReset=!1;var S="",h=!1,o=y,u=w,d=k,A=null,v="",m=!0,R="auto",x="start",f=50,c="middle",s=50,a="middle";Object.defineProperty(D,"id",O({},T,{get:function(){return S},set:function(g){S=""+g}})),Object.defineProperty(D,"pauseOnExit",O({},T,{get:function(){return h},set:function(g){h=!!g}})),Object.defineProperty(D,"startTime",O({},T,{get:function(){return o},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");o=g,this.hasBeenReset=!0}})),Object.defineProperty(D,"endTime",O({},T,{get:function(){return u},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");u=g,this.hasBeenReset=!0}})),Object.defineProperty(D,"text",O({},T,{get:function(){return d},set:function(g){d=""+g,this.hasBeenReset=!0}})),Object.defineProperty(D,"region",O({},T,{get:function(){return A},set:function(g){A=g,this.hasBeenReset=!0}})),Object.defineProperty(D,"vertical",O({},T,{get:function(){return v},set:function(g){var E=H(g);if(E===!1)throw new SyntaxError("An invalid or illegal string was specified.");v=E,this.hasBeenReset=!0}})),Object.defineProperty(D,"snapToLines",O({},T,{get:function(){return m},set:function(g){m=!!g,this.hasBeenReset=!0}})),Object.defineProperty(D,"line",O({},T,{get:function(){return R},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=g,this.hasBeenReset=!0}})),Object.defineProperty(D,"lineAlign",O({},T,{get:function(){return x},set:function(g){var E=W(g);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");x=E,this.hasBeenReset=!0}})),Object.defineProperty(D,"position",O({},T,{get:function(){return f},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");f=g,this.hasBeenReset=!0}})),Object.defineProperty(D,"positionAlign",O({},T,{get:function(){return c},set:function(g){var E=W(g);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");c=E,this.hasBeenReset=!0}})),Object.defineProperty(D,"size",O({},T,{get:function(){return s},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");s=g,this.hasBeenReset=!0}})),Object.defineProperty(D,"align",O({},T,{get:function(){return a},set:function(g){var E=W(g);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");a=E,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,Y,L){"use strict";L.r(Y),L.d(Y,"parseTimeStamp",function(){return _}),L.d(Y,"fixLineBreaks",function(){return w}),L.d(Y,"VTTParser",function(){return k});var Q=L("./src/utils/vttcue.ts"),B=function(){function D(){}var T=D.prototype;return T.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 T(h,o,u,d){return(h|0)*3600+(o|0)*60+(u|0)+parseFloat(d||0)}var S=D.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return S?parseFloat(S[2])>59?T(S[2],S[3],0,S[4]):T(S[1],S[2],S[3],S[4]):null}var H=function(){function D(){this.values=Object.create(null)}var T=D.prototype;return T.set=function(h,o){!this.get(h)&&o!==""&&(this.values[h]=o)},T.get=function(h,o,u){return u?this.has(h)?this.values[h]:o[u]:this.has(h)?this.values[h]:o},T.has=function(h){return h in this.values},T.alt=function(h,o,u){for(var d=0;d<u.length;++d)if(o===u[d]){this.set(h,o);break}},T.integer=function(h,o){/^-?\d+$/.test(o)&&this.set(h,parseInt(o,10))},T.percent=function(h,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var u=parseFloat(o);if(u>=0&&u<=100)return this.set(h,u),!0}return!1},D}();function W(D,T,S,h){var o=h?D.split(h):[D];for(var u in o){if(typeof o[u]!="string")continue;var d=o[u].split(S);if(d.length!==2)continue;var A=d[0],v=d[1];T(A,v)}}var O=new Q.default(0,0,""),M=O.align==="middle"?"middle":"center";function y(D,T,S){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 u(A,v){var m=new H;W(A,function(f,c){var s;switch(f){case"region":for(var a=S.length-1;a>=0;a--)if(S[a].id===c){m.set(f,S[a].region);break}break;case"vertical":m.alt(f,c,["rl","lr"]);break;case"line":s=c.split(","),m.integer(f,s[0]),m.percent(f,s[0])&&m.set("snapToLines",!1),m.alt(f,s[0],["auto"]),s.length===2&&m.alt("lineAlign",s[1],["start",M,"end"]);break;case"position":s=c.split(","),m.percent(f,s[0]),s.length===2&&m.alt("positionAlign",s[1],["start",M,"end","line-left","line-right","auto"]);break;case"size":m.percent(f,c);break;case"align":m.alt(f,c,["start",M,"end","left","right"]);break}},/:/,/\s/),v.region=m.get("region",null),v.vertical=m.get("vertical","");var R=m.get("line","auto");R==="auto"&&O.line===-1&&(R=-1),v.line=R,v.lineAlign=m.get("lineAlign","start"),v.snapToLines=m.get("snapToLines",!0),v.size=m.get("size",100),v.align=m.get("align",M);var x=m.get("position","auto");x==="auto"&&O.position===50&&(x=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=x}function d(){D=D.replace(/^\s+/,"")}if(d(),T.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(),T.endTime=o(),d(),u(D,T)}function w(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 T=D.prototype;return T.parse=function(h){var o=this;h&&(o.buffer+=o.decoder.decode(h,{stream:!0}));function u(){var x=o.buffer,f=0;for(x=w(x);f<x.length&&x[f]!=="\r"&&x[f]!==`
|
|
`;)++f;var c=x.substr(0,f);return x[f]==="\r"&&++f,x[f]===`
|
|
`&&++f,o.buffer=x.substr(f),c}function d(x){W(x,function(f,c){},/:/)}try{var A="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;A=u();var v=A.match(/^()?WEBVTT([ \t].*)?$/);if(!v||!v[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var m=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;m?m=!1:A=u();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(x){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var R=A.indexOf("-->")!==-1;if(!A||R&&(m=!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(x){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},T.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,Y,L){"use strict";L.r(Y),L.d(Y,"generateCueId",function(){return k}),L.d(Y,"parseWebVTT",function(){return T});var Q=L("./src/polyfills/number.ts"),B=L("./src/utils/vttparser.ts"),_=L("./src/demux/id3.ts"),H=L("./src/utils/timescale-conversion.ts"),W=L("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,M=function(h,o,u){return u===void 0&&(u=0),h.substr(u,o.length)===o},y=function(h){var o=parseInt(h.substr(-3)),u=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)(u)||!Object(Q.isFiniteNumber)(d)||!Object(Q.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+h);return o+=1e3*u,o+=60*1e3*d,o+=60*60*1e3*A,o},w=function(h){for(var o=5381,u=h.length;u;)o=o*33^h.charCodeAt(--u);return(o>>>0).toString()};function k(S,h,o){return w(S.toString())+w(h.toString())+w(o)}var D=function(h,o,u){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(;(v=A)!==null&&v!==void 0&&v.new;){var v;h.ccOffset+=d.start-A.start,d.new=!1,d=A,A=h[d.prevCC]}h.presentationOffset=u};function T(S,h,o,u,d,A,v,m){var R=new B.VTTParser,x=Object(_.utf8ArrayToStr)(new Uint8Array(S)).trim().replace(O,`
|
|
`).split(`
|
|
`),f=[],c=Object(H.toMpegTsClockFromTimescale)(h,o),s="00:00.000",a=0,b=0,g,E=!0,P=!1;R.oncue=function(G){var V=u[d],$=u.ccOffset,z=(a-c)/9e4;if(V!=null&&V.new&&(b!==void 0?$=u.ccOffset=V.start:D(u,d,z)),z&&($=z-u.presentationOffset),P){var F=G.endTime-G.startTime,ee=Object(W.normalizePts)((G.startTime+$-b)*9e4,A*9e4)/9e4;G.startTime=ee,G.endTime=ee+F}var ae=G.text.trim();G.text=decodeURIComponent(encodeURIComponent(ae)),G.id||(G.id=k(G.startTime,G.endTime,ae)),G.endTime>0&&f.push(G)},R.onparsingerror=function(G){g=G},R.onflush=function(){if(g){m(g);return}v(f)},x.forEach(function(G){if(E)if(M(G,"X-TIMESTAMP-MAP=")){E=!1,P=!0,G.substr(16).split(",").forEach(function(V){M(V,"LOCAL:")?s=V.substr(6):M(V,"MPEGTS:")&&(a=parseInt(V.substr(7)))});try{b=y(s)/1e3}catch(V){P=!1,g=V}return}else G===""&&(E=!1);R.parse(G+`
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(ie,Y,L){"use strict";L.r(Y);var Q=L("./src/utils/logger.ts"),B=L("./src/loader/load-stats.ts"),_=/^age:\s*[\d.]+\s*$/m,H=function(){function W(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=W.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,w,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=w,this.callbacks=k,this.retryDelay=w.retryDelay,this.loadInternal()},O.loadInternal=function(){var y=this.config,w=this.context;if(!y)return;var k=this.loader=new self.XMLHttpRequest,D=this.stats;D.loading.first=0,D.loaded=0;var T=this.xhrSetup;try{if(T)try{T(k,w.url)}catch(o){k.open("GET",w.url,!0),T(k,w.url)}k.readyState||k.open("GET",w.url,!0);var S=this.context.headers;if(S)for(var h in S)k.setRequestHeader(h,S[h])}catch(o){this.callbacks.onError({code:k.status,text:o.message},w,k);return}w.rangeEnd&&k.setRequestHeader("Range","bytes="+w.rangeStart+"-"+(w.rangeEnd-1)),k.onreadystatechange=this.readystatechange.bind(this),k.onprogress=this.loadprogress.bind(this),k.responseType=w.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),k.send()},O.readystatechange=function(){var y=this.context,w=this.loader,k=this.stats;if(!y||!w)return;var D=w.readyState,T=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){w.onreadystatechange=null,w.onprogress=null;var S=w.status;if(S>=200&&S<300){k.loading.end=Math.max(self.performance.now(),k.loading.first);var h,o;if(y.responseType==="arraybuffer"?(h=w.response,o=h.byteLength):(h=w.responseText,o=h.length),k.loaded=k.total=o,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(k,y,h,w),!this.callbacks)return;var d={url:w.responseURL,data:h};this.callbacks.onSuccess(d,k,y,w)}else k.retry>=T.maxRetry||S>=400&&S<499?(Q.logger.error(S+" while loading "+y.url),this.callbacks.onError({code:S,text:w.statusText},y,w)):(Q.logger.warn(S+" 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,T.maxRetryDelay),k.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),T.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 w=this.stats;w.loaded=y.loaded,y.lengthComputable&&(w.total=y.total)},O.getCacheAge=function(){var y=null;if(this.loader&&_.test(this.loader.getAllResponseHeaders())){var w=this.loader.getResponseHeader("age");y=w?parseFloat(w):null}return y},W}();Y.default=H}}).default})},vHTk:function(Pe,Le,Z){Pe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yslc:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD4nC4RfIhPsDIaCGBAndEHsujwQMkdBHDGoMmBAvNAtPvZlAMmUAX4GQSEMeCf0wrxgmCu+ASF3K4QnBrOVM+Cd0Cnoorw4mIw/guD6Vs4Ba74CGPBe6IInJicDZn4PgDYK4IpBbMUM+CZ0Qey5t4M3bwUhoa2YB4dNT1CHIzkoEkZzDYrrLtvkCeU0aBsULTw7WntRbtARoQrGbWHtBVw/Vpaggq9t1Rh9F7qwOM0ZA45fDgJp7PmJ0i4hCegU3AabjAc9qmF24r14JeXP+MZ4GEN+/69NmVvD0rGn8zThWYghF7XE7JFN+0wL0x5BQfVZLL60D1XE5JUNfxTqEZqC/C7Zgumeh96EvvqMP6ppNpvSCTM/ZxbAz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gMu1jb5P2bwcx69Iw4J3QaegKk5G+uyhgI+ZKQw+zIhcGxAudEA56Hd1tscRaYIkx0AoYEC90vW4OCMlrBdhYExkDDQyIE7oQHZesDfSXcrH+ZQzYM+C50Atm3gBeiLLVrIGHWJcxBqRgwDOhH8+LQXnFPoB0lqJSZoMx0NwMuBc6yVPBULERhAxt7sax+hgDUjHgXuiG7LngMUuqCpkdxkBLMOBa6AW60TCTlS3RMFYnY0BKBpwLnUa9NZl3B/LLtqQkgtmSNwOOhX7whXjU1NKz5e4DdcubH4ZOJgw0Fbrl7c9fg5B7ZYKRwWAMOLgio89+CwTTGTeMATkxYDui63OyQPglcgLIsDAGKAPXhF6YfQvM3HeBENKZdQ1jQGoGLEIvmJ0EvnZ/c79ES2owzB5jwBkDHGhIZ/2R7QC5g9HEGJArAxzyde8D5Gm5AmS4GAO2c3TGB2OgFTLALR1KA6e5SByvUpEp7s+6tELwrMnKYcCl0DmYVOCyzOM3L2dCV44mZInUhdBrVFCPMmdt3MCmLrLsemWBcih0DlfVBMNNWVu2WdlgI7qydCE7tE2FzpVpVOqhdZkbaJSKhsSELruuVxYgG6FzOK+Bekjd+I16exaY0JWlC9mhbRA6h5PBCBpUM369w1jdTOiy63plAaoX+rEQNTewetzmEmfomdCVpQvZoeWWDi3UctrBlePXnHHpTZcdcgZIUQxErnk43vjI2ovuQP8faDGikjbF4FsAAAAASUVORK5CYII="},zEei:function(Pe,Le,Z){Pe.exports={flex_box_center:"flex_box_center___3trsE",flex_space_between:"flex_space_between___vYNfG",flex_box_vertical_center:"flex_box_vertical_center___267W4",flex_box_center_end:"flex_box_center_end___35F4i",flex_box_column:"flex_box_column___1cLWS",bg:"bg___13rUr",flexRow:"flexRow___geim6",flexJustifyCenter:"flexJustifyCenter___2SLQ2",flexAlignEnd:"flexAlignEnd___2-3OH",flexAlignCenter:"flexAlignCenter___2PK_9",flexColumn:"flexColumn___pc_D1",formWrap:"formWrap___3ozw6",titleWrap:"titleWrap___3JSLu",fieldWrap:"fieldWrap___1M8-z",mdWrap:"mdWrap___3iPl2",backgroundFa:"backgroundFa___2Wd1f",button:"button___3ie7q",icons:"icons___-WSHu",addButton:"addButton___1qx7n",navBar:"navBar___xDlWA",actived:"actived___dZNDy",deleteButton:"deleteButton___3Ethm"}}}]);
|