(window.webpackJsonp=window.webpackJsonp||[]).push([[222,7,9],{"+NIl":function(Ie,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(X,R){"use strict";function Q(D,w){D.cmdState.push(w)}function B(D){return D.cmdState.length>0?D.cmdState[D.cmdState.length-1]:null}function _(D){var w=D.cmdState.pop();w&&w.closeBracket()}function G(D){for(var w=D.cmdState,A=w.length-1;A>=0;A--){var d=w[A];if(d.name=="DEFAULT")continue;return d}return{styleIdentifier:function(){return null}}}function j(D,w,A){return function(){this.name=D,this.bracketNo=0,this.style=w,this.styles=A,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=j("importmodule","tag",["string","builtin"]),O.documentclass=j("documentclass","tag",["","atom"]),O.usepackage=j("usepackage","tag",["atom"]),O.begin=j("begin","tag",["atom"]),O.end=j("end","tag",["atom"]),O.label=j("label","tag",["atom"]),O.ref=j("ref","tag",["atom"]),O.eqref=j("eqref","tag",["atom"]),O.cite=j("cite","tag",["atom"]),O.bibitem=j("bibitem","tag",["atom"]),O.Bibitem=j("Bibitem","tag",["atom"]),O.RBibitem=j("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(D,w){D.f=w}function y(D,w){var A;if(D.match(/^\\[a-zA-Z@]+/)){var d=D.current().slice(1);return A=O.hasOwnProperty(d)?O[d]:O.DEFAULT,A=new A,Q(w,A),I(w,k),A.style}if(D.match(/^\\[$&%#{}_]/))return"tag";if(D.match(/^\\[,;!\/\\]/))return"tag";if(D.match("\\["))return I(w,function(l,h){return T(l,h,"\\]")}),"keyword";if(D.match("\\("))return I(w,function(l,h){return T(l,h,"\\)")}),"keyword";if(D.match("$$"))return I(w,function(l,h){return T(l,h,"$$")}),"keyword";if(D.match("$"))return I(w,function(l,h){return T(l,h,"$")}),"keyword";var o=D.next();if(o=="%")return D.skipToEnd(),"comment";if(o=="}"||o=="]"){if(A=B(w),A)A.closeBracket(o),I(w,k);else return"error";return"bracket"}else return o=="{"||o=="["?(A=O.DEFAULT,A=new A,Q(w,A),"bracket"):/\d/.test(o)?(D.eatWhile(/[\w.%]/),"atom"):(D.eatWhile(/[\w\-_]/),A=G(w),A.name=="begin"&&(A.argument=D.current()),A.styleIdentifier())}function T(D,w,A){if(D.eatSpace())return null;if(A&&D.match(A))return I(w,y),"keyword";if(D.match(/^\\[a-zA-Z@]+/))return"tag";if(D.match(/^[a-zA-Z]+/))return"variable-2";if(D.match(/^\\[$&%#{}_]/))return"tag";if(D.match(/^\\[,;!\/]/))return"tag";if(D.match(/^[\^_&]/))return"tag";if(D.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(D.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=D.next();return d=="{"||d=="}"||d=="["||d=="]"||d=="("||d==")"?"bracket":d=="%"?(D.skipToEnd(),"comment"):"error"}function k(D,w){var A=D.peek(),d;return A=="{"||A=="["?(d=B(w),d.openBracket(A),D.eat(A),I(w,y),"bracket"):/[ \t\r]/.test(A)?(D.eat(A),null):(I(w,y),_(w),y(D,w))}return{startState:function(){var D=R.inMathMode?function(w,A){return T(w,A)}:y;return{cmdState:[],f:D}},copyState:function(D){return{cmdState:D.cmdState.slice(),f:D.f}},token:function(D,w){return w.f(D,w)},blankLine:function(D){D.f=y,D.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"/GNS":function(Ie,Le,Z){Ie.exports=Z.p+"static/search1.c4136dd4.png"},"19Vz":function(Ie,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(j,O,I){var y=I&&I!=ie.Init;if(O&&!y)j.on("blur",B),j.on("change",_),j.on("swapDoc",_),ie.on(j.getInputField(),"compositionupdate",j.state.placeholderCompose=function(){Q(j)}),_(j);else if(!O&&y){j.off("blur",B),j.off("change",_),j.off("swapDoc",_),ie.off(j.getInputField(),"compositionupdate",j.state.placeholderCompose),X(j);var T=j.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}O&&!j.hasFocus()&&B(j)});function X(j){j.state.placeholder&&(j.state.placeholder.parentNode.removeChild(j.state.placeholder),j.state.placeholder=null)}function R(j){X(j);var O=j.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=j.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var I=j.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),O.appendChild(I),j.display.lineSpace.insertBefore(O,j.display.lineSpace.firstChild)}function Q(j){setTimeout(function(){var O=!1,I=j.getInputField();I.nodeName=="TEXTAREA"?O=!I.value:j.lineCount()==1&&(O=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),O?R(j):X(j)},20)}function B(j){G(j)&&R(j)}function _(j){var O=j.getWrapperElement(),I=G(j);O.className=O.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?R(j):X(j)}function G(j){return j.lineCount()===1&&j.getLine(0)===""}})},"1eCo":function(Ie,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var X={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Q,B){var _=Q.indentUnit,G={},j=B.htmlMode?X:R;for(var O in j)G[O]=j[O];for(var O in B)G[O]=B[O];var I,y;function T(a,b){function m(H){return b.tokenize=H,H(a,b)}var C=a.next();if(C=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?m(w("atom","]]>")):null:a.match("--")?m(w("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),m(A(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=w("meta","?>"),"meta"):(I=a.eat("/")?"closeTag":"openTag",b.tokenize=k,"tag bracket");if(C=="&"){var P;return a.eat("#")?a.eat("x")?P=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):P=a.eatWhile(/[\d]/)&&a.eat(";"):P=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),P?"atom":"error"}else return a.eatWhile(/[^&<]/),null}T.isInText=!0;function k(a,b){var m=a.next();if(m==">"||m=="/"&&a.eat(">"))return b.tokenize=T,I=m==">"?"endTag":"selfcloseTag","tag bracket";if(m=="=")return I="equals",null;if(m=="<"){b.tokenize=T,b.state=h,b.tagName=b.tagStart=null;var C=b.tokenize(a,b);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(m)?(b.tokenize=D(m),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function D(a){var b=function(m,C){for(;!m.eol();)if(m.next()==a){C.tokenize=k;break}return"string"};return b.isInAttribute=!0,b}function w(a,b){return function(m,C){for(;!m.eol();){if(m.match(b)){C.tokenize=T;break}m.next()}return a}}function A(a){return function(b,m){for(var C;(C=b.next())!=null;){if(C=="<")return m.tokenize=A(a+1),m.tokenize(b,m);if(C==">")if(a==1){m.tokenize=T;break}else return m.tokenize=A(a-1),m.tokenize(b,m)}return"meta"}}function d(a,b,m){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=m,(G.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function l(a,b){for(var m;;){if(!a.context)return;if(m=a.context.tagName,!G.contextGrabbers.hasOwnProperty(m)||!G.contextGrabbers[m].hasOwnProperty(b))return;o(a)}}function h(a,b,m){return a=="openTag"?(m.tagStart=b.column(),E):a=="closeTag"?v:h}function E(a,b,m){return a=="word"?(m.tagName=b.current(),y="tag",x):G.allowMissingTagName&&a=="endTag"?(y="tag bracket",x(a,b,m)):(y="error",E)}function v(a,b,m){if(a=="word"){var C=b.current();return m.context&&m.context.tagName!=C&&G.implicitlyClosed.hasOwnProperty(m.context.tagName)&&o(m),m.context&&m.context.tagName==C||G.matchClosing===!1?(y="tag",g):(y="tag error",L)}else return G.allowMissingTagName&&a=="endTag"?(y="tag bracket",g(a,b,m)):(y="error",L)}function g(a,b,m){return a!="endTag"?(y="error",g):(o(m),h)}function L(a,b,m){return y="error",g(a,b,m)}function x(a,b,m){if(a=="word")return y="attribute",p;if(a=="endTag"||a=="selfcloseTag"){var C=m.tagName,P=m.tagStart;return m.tagName=m.tagStart=null,a=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(C)?l(m,C):(l(m,C),m.context=new d(m,C,P==m.indented)),h}return y="error",x}function p(a,b,m){return a=="equals"?c:(G.allowMissing||(y="error"),x(a,b,m))}function c(a,b,m){return a=="string"?u:a=="word"&&G.allowUnquoted?(y="string",x):(y="error",x(a,b,m))}function u(a,b,m){return a=="string"?u:x(a,b,m)}return{startState:function(a){var b={tokenize:T,state:h,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;I=null;var m=b.tokenize(a,b);return(m||I)&&m!="comment"&&(y=null,b.state=b.state(I||m,a,b),y&&(m=y=="error"?m+" error":y)),m},indent:function(a,b,m){var C=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+_;if(C&&C.noIndent)return ie.Pass;if(a.tokenize!=k&&a.tokenize!=T)return m?m.match(/^(\s*)/)[0].length:0;if(a.tagName)return G.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+_*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/$/,blockCommentStart:"",configuration:G.htmlMode?"html":"xml",helperType:G.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=[],m=a.context;m;m=m.prev)m.tagName&&b.push(m.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})})},"4YB9":function(Ie,Le,Z){"use strict";var ie=Z("q1tI"),X=Z.n(ie),R=Z("Ty5D"),Q=Z("55Ip"),B=Z("W1YM"),_=Z.n(B);Le.a=function(G){var j=G.activeIndex,O=Object(R.i)(),I=O.id,y=O.challengesId,T=Object(ie.useMemo)(function(){return[{name:"1\u3001\u672C\u5173\u4EFB\u52A1",url:"/shixuns/".concat(I,"/challenges/").concat(y,"/editcheckpoint")},{name:"2\u3001\u8BC4\u6D4B\u8BBE\u7F6E",url:"/shixuns/".concat(I,"/challenges/").concat(y,"/tab=2")},{name:"3\u3001\u53C2\u8003\u7B54\u6848",url:"/shixuns/".concat(I,"/challenges/").concat(y,"/tab=3")},{name:"4\u3001\u5173\u5361\u6392\u884C\u699C",url:"/shixuns/".concat(I,"/challenges/").concat(y,"/tab=4")}]},[I,y]);return X.a.createElement("ul",{className:"challenge-nav"},T.map(function(k,D){return j===D?X.a.createElement("li",{key:k.url}," ",X.a.createElement("a",{className:"active"},k.name)," "):X.a.createElement("li",{key:k.url}," ",X.a.createElement(Q.a,{to:k.url},k.name)," ")}))}},"4qgm":function(Ie,Le){Ie.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1PTckKN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nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(Ie,Le,Z){"use strict";Z.d(Le,"a",function(){return l});var ie=Z("Ty5D"),X=Z("dI71"),R=Z("q1tI"),Q=Z.n(R),B=Z("YS25"),_=Z("17x9"),G=Z.n(_),j=Z("wx14"),O=Z("zLVn"),I=Z("9R94"),y=function(c){Object(X.a)(u,c);function u(){for(var b,m=arguments.length,C=new Array(m),P=0;P1&&arguments[1]!==void 0?arguments[1]:0,w=(G[k[D+0]]+G[k[D+1]]+G[k[D+2]]+G[k[D+3]]+"-"+G[k[D+4]]+G[k[D+5]]+"-"+G[k[D+6]]+G[k[D+7]]+"-"+G[k[D+8]]+G[k[D+9]]+"-"+G[k[D+10]]+G[k[D+11]]+G[k[D+12]]+G[k[D+13]]+G[k[D+14]]+G[k[D+15]]).toLowerCase();if(!_(w))throw TypeError("Stringified UUID is invalid");return w}var I=O;function y(k,D,w){k=k||{};var A=k.random||(k.rng||R)();if(A[6]=A[6]&15|64,A[8]=A[8]&63|128,D){w=w||0;for(var d=0;d<16;++d)D[w+d]=A[d];return D}return I(A)}var T=Le.a=y},"7ZXX":function(Ie,Le,Z){Ie.exports=Z.p+"static/err.6e7c5817.png"},"7ahc":function(Ie,Le,Z){"use strict";Z.d(Le,"a",function(){return E});var ie=Z("k1fw"),X=Z("0Owb"),R=Z("+L6B"),Q=Z("2/Rp"),B=Z("y8nQ"),_=Z("Vl3Y"),G=Z("tJVT"),j=Z("OaEy"),O=Z("2fM7"),I=Z("q1tI"),y=Z.n(I),T=Z("VrN/"),k=Z.n(T),D=Z("p77/"),w=Z.n(D),A=Z("c5Ni"),d=Z.n(A),o=O.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},h={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 g=v.callback,L=v.onCancel,x=Object(I.useState)("python"),p=Object(G.a)(x,2),c=p[0],u=p[1];function a(m){u(h[m][1])}function b(m){g(m)}return y.a.createElement(_.a,Object(X.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),y.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(O.a,{onChange:a},Object.keys(h).map(function(m){return y.a.createElement(o,{key:m,value:m},h[m][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(E,{mode:c})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(Q.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function E(v){var g=v.value,L=v.onChange,x=v.mode,p=v.options,c=p===void 0?{}:p,u=Object(I.useRef)(),a=Object(I.useState)(),b=Object(G.a)(a,2),m=b[0],C=b[1];return Object(I.useEffect)(function(){if(m){function P(H){var V=H.getValue();L&&L(V)}return m.on("change",P),function(){m.off("change",P)}}},[m,L]),Object(I.useEffect)(function(){m&&m.setOption("mode",x)},[m,x]),Object(I.useEffect)(function(){m&&((g!==m.getValue()||g==="")&&setTimeout(function(){m.setValue(g||" ")},300))},[m,g]),Object(I.useEffect)(function(){if(u.current&&!m){var P=k.a.fromTextArea(u.current,Object(ie.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));C(P)}},[u.current,m]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:u}))}},"7ixt":function(Ie,Le,Z){"use strict";Z.d(Le,"a",function(){return R});var ie={adjustX:1,adjustY:1},X=[0,0],R={left:{points:["cr","cl"],overflow:ie,offset:[-4,0],targetOffset:X},right:{points:["cl","cr"],overflow:ie,offset:[4,0],targetOffset:X},top:{points:["bc","tc"],overflow:ie,offset:[0,-4],targetOffset:X},bottom:{points:["tc","bc"],overflow:ie,offset:[0,4],targetOffset:X},topLeft:{points:["bl","tl"],overflow:ie,offset:[0,-4],targetOffset:X},leftTop:{points:["tr","tl"],overflow:ie,offset:[-4,0],targetOffset:X},topRight:{points:["br","tr"],overflow:ie,offset:[0,-4],targetOffset:X},rightTop:{points:["tl","tr"],overflow:ie,offset:[4,0],targetOffset:X},bottomRight:{points:["tr","br"],overflow:ie,offset:[0,4],targetOffset:X},rightBottom:{points:["bl","br"],overflow:ie,offset:[4,0],targetOffset:X},bottomLeft:{points:["tl","bl"],overflow:ie,offset:[0,4],targetOffset:X},leftBottom:{points:["br","bl"],overflow:ie,offset:[-4,0],targetOffset:X}},Q=R},"7v3h":function(Ie,Le,Z){Ie.exports=Z.p+"static/empty2.dd73f390.png"},"8/bI":function(Ie,Le,Z){Ie.exports=Z.p+"static/empty.8918e228.png"},"8EBN":function(Ie,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var X=0;X-1&&Q.substring(G+1,Q.length);if(j)return ie.findModeByExtension(j)},ie.findModeByName=function(Q){Q=Q.toLowerCase();for(var B=0;B=M.length?J.slice(M.length):J}).join(` `)}var d=[],o=["
    "],l=new D.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function E(){d.length=0,o=["
      "]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function g(W,s,f,M){if(s>=W.length||W[s].level<=f)return s;var J=W[s];M.push("
    • "+J.text+""),s++;var F=[];return s=g(W,s,J.level,F),F.length>0&&(M.push("
        "),F.forEach(function(he){M.push(he)}),M.push("
      ")),M.push("
    • "),s=g(W,s,f,M),s}function L(){return g(d,0,0,o),o.push("
    "),o.join("")}var x={heading:function(s){var f=h.exec(s);if(f)return{type:"heading",raw:f[0],depth:f[1].length,text:f[2]}},fences:function(s){var f=this.rules.block.fences.exec(s);if(f){var M=f[0],J=A(M,f[3]||""),F=f[2]?f[2].trim():f[2];if(["latex","katex","math"].indexOf(F)>=0){var he=u(),Pe=J;J=he,a[he]={type:"block",expression:Pe}}return{type:"code",raw:M,lang:F,text:J}}}},p=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,u=function(){return"__special_katext_id_".concat(c++,"__")},a={};function b(){return a}function m(){c=0,a={}}function C(W){return W=W.replace(p,function(s,f){var M=u();return a[M]={type:"inline",expression:f},M}),W}var P=l.listitem;l.listitem=function(W){return P(C(W))};var H=l.paragraph;l.paragraph=function(W){return H(C(W))};var V=l.tablecell;l.tablecell=function(W,s){return V(C(W),s)},l.code=function(W,s,f){var M=(s||"").match(/\S*/)[0];return M?["latex","katex","math"].indexOf(M)>=0?"

    ".concat(W,"

    "):'
    ').concat(f?W:Object(w.escape)(W,!0),`
    `):'
    '+(f?W:Object(w.escape)(W,!0))+"
    "},l.heading=function(W,s,f){var M=this.options.headerPrefix+f.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:M,level:s,text:W}),"'+W+""},D.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),D.a.use({tokenizer:x,renderer:l});var $=D.a,z=Z("SJMd"),U=Z("ulZh"),ee=Z.n(U),oe=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(W,s){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,M){f.__proto__=M}||function(f,M){for(var J in M)Object.prototype.hasOwnProperty.call(M,J)&&(f[J]=M[J])})(W,s)};function Ae(W,s){function f(){this.constructor=W}xe(W,s),W.prototype=s===null?Object.create(s):(f.prototype=s.prototype,new f)}function Ee(W,s,f,M){return new(f||(f=Promise))(function(J,F){function he(ft){try{Je(M.next(ft))}catch(Ne){F(Ne)}}function Pe(ft){try{Je(M.throw(ft))}catch(Ne){F(Ne)}}function Je(ft){var Ne;ft.done?J(ft.value):(Ne=ft.value,Ne instanceof f?Ne:new f(function(yt){yt(Ne)})).then(he,Pe)}Je((M=M.apply(W,s||[])).next())})}function Ce(W,s){var f,M,J,F,he={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return F={next:Pe(0),throw:Pe(1),return:Pe(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Pe(Je){return function(ft){return function(Ne){if(f)throw new TypeError("Generator is already executing.");for(;he;)try{if(f=1,M&&(J=2&Ne[0]?M.return:Ne[0]?M.throw||((J=M.return)&&J.call(M),0):M.next)&&!(J=J.call(M,Ne[1])).done)return J;switch(M=0,J&&(Ne=[2&Ne[0],J.value]),Ne[0]){case 0:case 1:J=Ne;break;case 4:return he.label++,{value:Ne[1],done:!1};case 5:he.label++,M=Ne[1],Ne=[0];continue;case 7:Ne=he.ops.pop(),he.trys.pop();continue;default:if(!(J=he.trys,(J=J.length>0&&J[J.length-1])||Ne[0]!==6&&Ne[0]!==2)){he=0;continue}if(Ne[0]===3&&(!J||Ne[1]>J[0]&&Ne[1]',"select"),this.addActionButton(M,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(M,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(M,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(M,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(M,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(M,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(M,'',"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(F){var he=document.createElement("div");he.className=""+f.toolbarButtonStyleClass.name,he.setAttribute("data-type-name",F.typeName),he.innerHTML=F.icon,he.addEventListener("click",function(){f.markerToolbarButtonClicked(he,F)}),f.buttons.push(he),f.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='',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,'',"render"),this.addActionButton(J,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},W.prototype.addButtonClickListener=function(s){this.buttonClickListeners.push(s)},W.prototype.removeButtonClickListener=function(s){this.buttonClickListeners.indexOf(s)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(s),1)},W.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},W.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var s=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var f=0;f0&&this.buttonClickListeners.forEach(function(M){return M("marker",f)}),this.markerButtonOverflowBlock.style.display="none"},W.prototype.actionToolbarButtonClicked=function(s,f){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(M){return M("action",f)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},W.prototype.setActiveButton=function(s){this.resetButtonStyles(),s.className=s.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),s.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},W.prototype.setActiveMarkerButton=function(s){var f=this.markerButtons.find(function(M){return M.getAttribute("data-type-name")===s});f&&this.setActiveButton(f)},W.prototype.setCurrentMarker=function(s){var f=this;this.currentMarker=s,this.buttons.filter(function(M){return/delete|notes/.test(M.getAttribute("data-action"))}).forEach(function(M){f.currentMarker===void 0?(M.style.fillOpacity="0.4",M.style.pointerEvents="none"):(M.style.fillOpacity="1",M.style.pointerEvents="all")})},W}(),Ue=function(){function W(s,f,M,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=s,this.displayMode=f,this.uiStyleSettings=M,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return W.prototype.addStyles=function(){var s;this.toolboxStyleClass=this.styles.addClass(new Se("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 Se("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var f=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Se("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Se("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Se("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 Se("toolbox-panel-row_colors",` background-color: `+((s=this.uiStyleSettings.toolboxBackgroundColor)!==null&&s!==void 0?s:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new Se("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*f)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*f)+`px; padding: `+f+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new Ye("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new Ye("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},W.prototype.show=function(s){var f;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=s,this.uiContainer.className=this.toolboxStyleClass.name+" "+((f=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&f!==void 0?f:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},W.prototype.setPanelButtons=function(s){var f,M,J=this;this.panels=s,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((f=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&f!==void 0?f:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(F){var he;F.uiStyleSettings=J.uiStyleSettings;var Pe=document.createElement("div");Pe.className=J.toolboxButtonStyleClass.name+" "+((he=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:J.toolboxButtonStyleColorsClass.name),Pe.innerHTML=F.icon,Pe.title=F.title,Pe.addEventListener("click",function(){J.panelButtonClick(F)}),J.panelButtons.push(Pe),J.buttonRow.appendChild(Pe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},W.prototype.panelButtonClick=function(s){var f=this,M=-1;if(s!==this.activePanel){M=this.panels.indexOf(s),this.panelRow.innerHTML="";var J=s.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=s}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){f.displayMode==="inline"?f.panelRow.style.display="none":f.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(F,he){var Pe,Je;F.className=f.toolboxButtonStyleClass.name+" "+(he===M?""+((Pe=f.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:f.toolboxActiveButtonStyleColorsClass.name):""+((Je=f.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Je!==void 0?Je:f.toolboxButtonStyleColorsClass.name))})},W}(),Xe=function(W,s){this.title=W,this.icon=s},Qe=function(W){function s(f,M,J,F){var he=W.call(this,f,F||'')||this;return he.colors=[],he.addTransparent=!1,he.colorBoxes=[],he.colors=M,he.currentColor=J,he.setCurrentColor=he.setCurrentColor.bind(he),he.getColorBox=he.getColorBox.bind(he),he}return Ae(s,W),s.prototype.getUi=function(){var f=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.whiteSpace="nowrap",this.colors.forEach(function(J){var F=f.getColorBox(J);M.appendChild(F),f.colorBoxes.push(F)}),M},s.prototype.getColorBox=function(f){var M=this,J=this.uiStyleSettings.toolbarHeight/4,F=this.uiStyleSettings.toolbarHeight-J,he=document.createElement("div");he.style.display="inline-block",he.style.boxSizing="content-box",he.style.width=F-2+"px",he.style.height=F-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=(F+2)/2+"px",he.style.borderColor=f===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",he.addEventListener("click",function(){M.setCurrentColor(f,he)});var Pe=document.createElement("div");return Pe.style.display="inline-block",Pe.style.width=F-2+"px",Pe.style.height=F-2+"px",Pe.style.backgroundColor=f,Pe.style.borderRadius=F/2+"px",f==="transparent"&&(Pe.style.fill=this.uiStyleSettings.toolboxAccentColor,Pe.innerHTML=` `),he.appendChild(Pe),he},s.prototype.setCurrentColor=function(f,M){var J=this;this.currentColor=f,this.colorBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(f)},s}(Xe),je=function(){function W(s,f,M){this._state="new",this._isSelected=!1,this._container=s,this._overlayContainer=f,this.globalSettings=M,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(W.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),W.prototype.ownsTarget=function(s){return!1},Object.defineProperty(W.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),W.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},W.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},W.prototype.pointerDown=function(s,f){},W.prototype.dblClick=function(s,f){},W.prototype.manipulate=function(s){},W.prototype.pointerUp=function(s){this.stateChanged()},W.prototype.dispose=function(){},W.prototype.addMarkerVisualToContainer=function(s){this.container.childNodes.length>0?this.container.insertBefore(s,this.container.childNodes[0]):this.container.appendChild(s)},W.prototype.getState=function(){return{typeName:W.typeName,state:this.state,notes:this.notes}},W.prototype.restoreState=function(s){this._state=s.state,this.notes=s.notes},W.prototype.scale=function(s,f){},W.prototype.colorChanged=function(s){this.onColorChanged&&this.onColorChanged(s),this.stateChanged()},W.prototype.fillColorChanged=function(s){this.onFillColorChanged&&this.onFillColorChanged(s),this.stateChanged()},W.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var s=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),s.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(s)&&this.onStateChanged(this)}},W.typeName="MarkerBase",W}(),Be=function(){function W(){this.findGripByVisual=this.findGripByVisual.bind(this)}return W.prototype.findGripByVisual=function(s){return this.topLeft.ownsTarget(s)?this.topLeft:this.topCenter.ownsTarget(s)?this.topCenter:this.topRight.ownsTarget(s)?this.topRight:this.centerLeft.ownsTarget(s)?this.centerLeft:this.centerRight.ownsTarget(s)?this.centerRight:this.bottomLeft.ownsTarget(s)?this.bottomLeft:this.bottomCenter.ownsTarget(s)?this.bottomCenter:this.bottomRight.ownsTarget(s)?this.bottomRight:void 0},W}(),it=function(){function W(){this.GRIP_SIZE=10,this.visual=se.createGroup(),this.visual.appendChild(se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return W.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},W}(),Ze=function(){function W(){}return W.toITransformMatrix=function(s){return{a:s.a,b:s.b,c:s.c,d:s.d,e:s.e,f:s.f}},W.toSVGMatrix=function(s,f){return s.a=f.a,s.b=f.b,s.c=f.c,s.d=f.d,s.e=f.e,s.f=f.f,s},W}(),qe=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.left=0,F.top=0,F.width=0,F.height=0,F.defaultSize={x:50,y:20},F.offsetX=0,F.offsetY=0,F.rotationAngle=0,F.CB_DISTANCE=10,F._suppressMarkerCreateEvent=!1,F.container.transform.baseVal.appendItem(se.createTransform()),F.setupControlBox(),F}return Ae(s,W),Object.defineProperty(s.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"visual",{get:function(){return this._visual},set:function(f){this._visual=f;var M=se.createTransform();this._visual.transform.baseVal.appendItem(M)},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(f){return!!W.prototype.ownsTarget.call(this,f)||!!(this.controlGrips.findGripByVisual(f)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(f))},s.prototype.pointerDown=function(f,M){W.prototype.pointerDown.call(this,f,M),this.state==="new"&&(this.left=f.x,this.top=f.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(f);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(M),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M)){this.activeGrip=this.rotatorGrip;var F=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=F.x-this.width/2,this.top=F.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"},s.prototype.pointerUp=function(f){var M=this.state;W.prototype.pointerUp.call(this,f),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(f),this._state="select",M==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},s.prototype.moveVisual=function(f){this.visual.style.transform="translate("+f.x+"px, "+f.y+"px)"},s.prototype.manipulate=function(f){var M=this.unrotatePoint(f);this.state==="creating"?this.resize(f):this.state==="move"?(this.left=this.manipulationStartLeft+(M.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(M.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(M):this.state==="rotate"&&this.rotate(f)},s.prototype.resize=function(f){var M=this.manipulationStartLeft,J=this.manipulationStartWidth,F=this.manipulationStartTop,he=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:M=this.manipulationStartLeft+f.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-M;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+f.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:F=this.manipulationStartTop+f.y-this.manipulationStartY,he=this.manipulationStartHeight+this.manipulationStartTop-F;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:he=this.manipulationStartHeight+f.y-this.manipulationStartY}J>=0?(this.left=M,this.width=J):(this.left=M+J,this.width=-J),he>=0?(this.top=F,this.height=he):(this.top=F+he,this.height=-he),this.setSize()},s.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},s.prototype.rotate=function(f){if(Math.abs(f.x-this.centerX)>.1){var M=Math.sign(f.x-this.centerX);this.rotationAngle=180*Math.atan((f.y-this.centerY)/(f.x-this.centerX))/Math.PI+90*M,this.applyRotation()}},s.prototype.applyRotation=function(){var f=this.container.transform.baseVal.getItem(0);f.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(f,0)},s.prototype.rotatePoint=function(f){if(this.rotationAngle===0)return f;var M=this.container.getCTM(),J=se.createPoint(f.x,f.y);return{x:(J=J.matrixTransform(M)).x,y:J.y}},s.prototype.unrotatePoint=function(f){if(this.rotationAngle===0)return f;var M=this.container.getCTM();M=M.inverse();var J=se.createPoint(f.x,f.y);return{x:(J=J.matrixTransform(M)).x,y:J.y}},s.prototype.select=function(){W.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){W.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var f=se.createTransform();f.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(f),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 Be,this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){var f=this.controlBox.transform.baseVal.getItem(0);f.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(f,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},s.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},s.prototype.createGrip=function(){var f=new it;return f.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(f.visual),f},s.prototype.positionGrips=function(){var f=this.controlGrips.topLeft.GRIP_SIZE,M=-f/2,J=M,F=(this.width+this.CB_DISTANCE)/2-f/2,he=(this.height+this.CB_DISTANCE)/2-f/2,Pe=this.height+this.CB_DISTANCE-f/2,Je=this.width+this.CB_DISTANCE-f/2;this.positionGrip(this.controlGrips.topLeft.visual,M,J),this.positionGrip(this.controlGrips.topCenter.visual,F,J),this.positionGrip(this.controlGrips.topRight.visual,Je,J),this.positionGrip(this.controlGrips.centerLeft.visual,M,he),this.positionGrip(this.controlGrips.centerRight.visual,Je,he),this.positionGrip(this.controlGrips.bottomLeft.visual,M,Pe),this.positionGrip(this.controlGrips.bottomCenter.visual,F,Pe),this.positionGrip(this.controlGrips.bottomRight.visual,Je,Pe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,F,J-3*this.CB_DISTANCE)},s.prototype.positionGrip=function(f,M,J){var F=f.transform.baseVal.getItem(0);F.setTranslate(M,J),f.transform.baseVal.replaceItem(F,0)},s.prototype.hideControlBox=function(){this.controlBox.style.display="none"},s.prototype.showControlBox=function(){this.controlBox.style.display=""},s.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ze.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ze.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},W.prototype.getState.call(this))},s.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var M=f;this.left=M.left,this.top=M.top,this.width=M.width,this.height=M.height,this.rotationAngle=M.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,M.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,M.containerTransformMatrix))},s.prototype.scale=function(f,M){W.prototype.scale.call(this,f,M);var J=this.rotatePoint({x:this.left,y:this.top}),F=this.unrotatePoint({x:J.x*f,y:J.y*M});this.left=F.x,this.top=F.y,this.width=this.width*f,this.height=this.height*M,this.adjustControlBox()},s}(je),tt=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.fillColor="transparent",F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.opacity=1,F.setStrokeColor=F.setStrokeColor.bind(F),F.setFillColor=F.setFillColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.createVisual=F.createVisual.bind(F),F}return Ae(s,W),s.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.visual)},s.prototype.createVisual=function(){this.visual=se.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(f,M){W.prototype.pointerDown.call(this,f,M),this.state==="new"&&(this.createVisual(),this.moveVisual(f),this._state="creating")},s.prototype.manipulate=function(f){W.prototype.manipulate.call(this,f)},s.prototype.resize=function(f){W.prototype.resize.call(this,f),this.setSize()},s.prototype.setSize=function(){W.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(f){W.prototype.pointerUp.call(this,f),this.setSize()},s.prototype.setStrokeColor=function(f){this.strokeColor=f,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(f),this.stateChanged()},s.prototype.setFillColor=function(f){this.fillColor=f,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},s.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},W.prototype.getState.call(this))},s.prototype.restoreState=function(f){var M=f;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),W.prototype.restoreState.call(this,f),this.setSize()},s.prototype.scale=function(f,M){W.prototype.scale.call(this,f,M),this.setSize()},s.title="Rectangle marker",s}(qe),dt=function(W){function s(f,M,J,F){var he=W.call(this,f,F||'')||this;return he.widths=[],he.widthBoxes=[],he.widths=M,he.currentWidth=J,he.setCurrentWidth=he.setCurrentWidth.bind(he),he}return Ae(s,W),s.prototype.getUi=function(){var f=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.widths.forEach(function(J){var F=document.createElement("div");F.style.display="flex",F.style.flexGrow="2",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=J===f.currentWidth?f.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){f.setCurrentWidth(J,F)}),M.appendChild(F);var he=document.createElement("div");he.innerText=J.toString(),he.style.marginRight="5px",F.appendChild(he);var Pe=document.createElement("div");Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.display="flex",Pe.style.alignItems="center";var Je=document.createElement("hr");Je.style.minWidth="20px",Je.style.border="0px",Je.style.borderTop=J+"px solid "+f.uiStyleSettings.toolboxColor,Je.style.flexGrow="2",Pe.appendChild(Je),F.appendChild(Pe),f.widthBoxes.push(F)}),M},s.prototype.setCurrentWidth=function(f,M){var J=this;this.currentWidth=f,this.widthBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},s}(Xe),rt=function(W){function s(f,M,J,F){var he=W.call(this,f,F||'')||this;return he.styles=[],he.styleBoxes=[],he.styles=M,he.currentStyle=J,he.setCurrentStyle=he.setCurrentStyle.bind(he),he}return Ae(s,W),s.prototype.getUi=function(){var f=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.styles.forEach(function(J){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/f.styles.length-5+"%",F.style.borderColor=J===f.currentStyle?f.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){f.setCurrentStyle(J,F)}),M.appendChild(F);var he=document.createElement("div");he.style.minHeight="20px",he.style.flexGrow="2",he.style.overflow="hidden";var Pe=` `;he.innerHTML=Pe,F.appendChild(he),f.styleBoxes.push(F)}),M},s.prototype.setCurrentStyle=function(f,M){var J=this;this.currentStyle=f,this.styleBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},s}(Xe),nt=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new dt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return Ae(s,W),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=W.prototype.getState.call(this);return f.typeName=s.typeName,f},s.typeName="FrameMarker",s.title="Frame marker",s.icon='',s}(tt),we=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},ut=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.x1=0,F.y1=0,F.x2=0,F.y2=0,F.defaultLength=50,F.manipulationStartX=0,F.manipulationStartY=0,F.manipulationStartX1=0,F.manipulationStartY1=0,F.manipulationStartX2=0,F.manipulationStartY2=0,F.setupControlBox(),F}return Ae(s,W),s.prototype.ownsTarget=function(f){return!!W.prototype.ownsTarget.call(this,f)||!(!this.grip1.ownsTarget(f)&&!this.grip2.ownsTarget(f))},s.prototype.pointerDown=function(f,M){W.prototype.pointerDown.call(this,f,M),this.manipulationStartX=f.x,this.manipulationStartY=f.y,this.state==="new"&&(this.x1=f.x,this.y1=f.y,this.x2=f.x,this.y2=f.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(M)?this.activeGrip=this.grip1:this.grip2.ownsTarget(M)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},s.prototype.pointerUp=function(f){var M=this.state;W.prototype.pointerUp.call(this,f),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(f),this._state="select",M==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},s.prototype.adjustVisual=function(){},s.prototype.manipulate=function(f){this.state==="creating"?this.resize(f):this.state==="move"?(this.x1=this.manipulationStartX1+f.x-this.manipulationStartX,this.y1=this.manipulationStartY1+f.y-this.manipulationStartY,this.x2=this.manipulationStartX2+f.x-this.manipulationStartX,this.y2=this.manipulationStartY2+f.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(f)},s.prototype.resize=function(f){switch(this.activeGrip){case this.grip1:this.x1=f.x,this.y1=f.y;break;case this.grip2:case void 0:this.x2=f.x,this.y2=f.y}this.adjustVisual(),this.adjustControlBox()},s.prototype.select=function(){W.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){W.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){this.positionGrips()},s.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},s.prototype.createGrip=function(){var f=new it;return f.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(f.visual),f},s.prototype.positionGrips=function(){var f=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-f/2,this.y1-f/2),this.positionGrip(this.grip2.visual,this.x2-f/2,this.y2-f/2)},s.prototype.positionGrip=function(f,M,J){var F=f.transform.baseVal.getItem(0);F.setTranslate(M,J),f.transform.baseVal.replaceItem(F,0)},s.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},W.prototype.getState.call(this))},s.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var M=f;this.x1=M.x1,this.y1=M.y1,this.x2=M.x2,this.y2=M.y2},s.prototype.scale=function(f,M){W.prototype.scale.call(this,f,M),this.x1=this.x1*f,this.y1=this.y1*M,this.x2=this.x2*f,this.y2=this.y2*M,this.adjustVisual(),this.adjustControlBox()},s}(je),at=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new dt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return Ae(s,W),s.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.visual&&f!==this.selectorLine&&f!==this.visibleLine)},s.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(f,M){W.prototype.pointerDown.call(this,f,M),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},s.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setStrokeColor=function(f){this.strokeColor=f,this.adjustVisual(),this.colorChanged(f)},s.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.adjustVisual()},s.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},W.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var M=f;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.createVisual(),this.adjustVisual()},s.typeName="LineMarker",s.title="Line marker",s.icon='',s}(ut),Re=function(W){function s(f,M,J,F){var he=W.call(this,f,F||'')||this;return he.fonts=[],he.fontBoxes=[],he.fonts=M,he.currentFont=J,he.setCurrentFont=he.setCurrentFont.bind(he),he}return Ae(s,W),s.prototype.getUi=function(){var f=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.flexGrow="2",this.fonts.forEach(function(J){var F=document.createElement("div");F.style.display="inline-block",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/f.fonts.length-5+"%",F.style.borderColor=J===f.currentFont?f.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){f.setCurrentFont(J,F)}),M.appendChild(F);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 Pe=document.createElement("div");Pe.style.whiteSpace="nowrap",Pe.style.overflow="hidden",Pe.style.textOverflow="ellipsis",Pe.innerHTML="The quick brown fox jumps over the lazy dog",he.appendChild(Pe),F.appendChild(he),f.fontBoxes.push(F)}),M},s.prototype.setCurrentFont=function(f,M){var J=this;this.currentFont=f,this.fontBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},s}(Xe),He=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.color="transparent",F.padding=5,F.DEFAULT_TEXT="your text here",F.text=F.DEFAULT_TEXT,F.isMoved=!1,F.color=J.defaultColor,F.fontFamily=J.defaultFontFamily,F.defaultSize={x:100,y:30},F.setColor=F.setColor.bind(F),F.setFont=F.setFont.bind(F),F.renderText=F.renderText.bind(F),F.sizeText=F.sizeText.bind(F),F.textEditDivClicked=F.textEditDivClicked.bind(F),F.showTextEditor=F.showTextEditor.bind(F),F.setSize=F.setSize.bind(F),F.positionTextEditor=F.positionTextEditor.bind(F),F.colorPanel=new Qe("Color",J.defaultColorSet,J.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.fontFamilyPanel=new Re("Font",J.defaultFontFamilies,J.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F}return Ae(s,W),s.prototype.ownsTarget=function(f){if(W.prototype.ownsTarget.call(this,f)||f===this.visual||f===this.textElement||f===this.bgRectangle)return!0;var M=!1;return this.textElement.childNodes.forEach(function(J){J===f&&(M=!0)}),M},s.prototype.createVisual=function(){this.visual=se.createGroup(),this.bgRectangle=se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},s.prototype.pointerDown=function(f,M){W.prototype.pointerDown.call(this,f,M),this.isMoved=!1,this.pointerDownPoint=f,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(f),this._state="creating")},s.prototype.renderText=function(){var f=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(M){f.textElement.appendChild(se.createTSpan(M.trim()===""?" ":M.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},s.prototype.getTextScale=function(){var f=this.textElement.getBBox(),M=1;if(f.width>0&&f.height>0){var J=(1*this.width-this.width*this.padding*2/100)/f.width,F=(1*this.height-this.height*this.padding*2/100)/f.height;M=Math.min(J,F)}return M},s.prototype.getTextPosition=function(f){var M=this.textElement.getBBox(),J=0,F=0;return M.width>0&&M.height>0&&(J=(this.width-M.width*f)/2,F=this.height/2-M.height*f/2),{x:J,y:F}},s.prototype.sizeText=function(){var f=this.textElement.getBBox(),M=this.getTextScale(),J=this.getTextPosition(M);J.y-=f.y*M,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+M+", "+M+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(M,M))},s.prototype.manipulate=function(f){W.prototype.manipulate.call(this,f),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(f.x-this.pointerDownPoint.x)>5||Math.abs(f.y-this.pointerDownPoint.y)>5)},s.prototype.resize=function(f){W.prototype.resize.call(this,f),this.isMoved=!0,this.setSize(),this.sizeText()},s.prototype.setSize=function(){W.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},s.prototype.pointerUp=function(f){var M=this.state;M==="creating"&&(this._suppressMarkerCreateEvent=!0),W.prototype.pointerUp.call(this,f),this.setSize(),(M==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},s.prototype.showTextEditor=function(){var f=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(M){M.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var M=Number.parseFloat(f.textEditor.style.fontSize);f.textEditor.clientWidth>=Number.parseInt(f.textEditor.style.maxWidth)&&M>.9;)M-=.1,f.textEditor.style.fontSize=Math.max(M,.9)+"em"}),this.textEditor.addEventListener("keyup",function(M){M.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(M){if(M.clipboardData){var J=M.clipboardData.getData("text"),F=window.getSelection();if(!F.rangeCount)return!1;F.deleteFromDocument(),F.getRangeAt(0).insertNode(document.createTextNode(J)),M.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){f.textEditDivClicked(f.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},s.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var f=this.getTextScale(),M=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),F={x:J.width*f,y:J.height*f};M.x-=F.x/2,M.y-=F.y/2,this.textEditor.style.top=M.y+"px",this.textEditor.style.left=M.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-M.x+"px",this.textEditor.style.fontSize=Math.max(16*f,12)+"px",this.textElement.style.display="none"}},s.prototype.textEditDivClicked=function(f){this.text=f.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},s.prototype.select=function(){W.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},s.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),W.prototype.deselect.call(this)},s.prototype.dblClick=function(f,M){W.prototype.dblClick.call(this,f,M),this.showTextEditor()},s.prototype.setColor=function(f){this.textElement&&se.setAttributes(this.textElement,[["fill",f]]),this.color=f,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(f)},s.prototype.setFont=function(f){this.textElement&&se.setAttributes(this.textElement,[["font-family",f]]),this.fontFamily=f,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},s.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},s.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},W.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){var M=f;this.color=M.color,this.fontFamily=M.fontFamily,this.padding=M.padding,this.text=M.text,this.createVisual(),W.prototype.restoreState.call(this,f),this.setSize()},s.prototype.scale=function(f,M){W.prototype.scale.call(this,f,M),this.setSize(),this.sizeText(),this.positionTextEditor()},s.typeName="TextMarker",s.title="Text marker",s.icon='',s}(qe),ge=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.color="transparent",F.lineWidth=3,F.drawing=!1,F.pixelRatio=1,F.color=J.defaultColor,F.lineWidth=J.defaultStrokeWidth,F.pixelRatio=J.freehandPixelRatio,F.setColor=F.setColor.bind(F),F.addCanvas=F.addCanvas.bind(F),F.finishCreation=F.finishCreation.bind(F),F.setLineWidth=F.setLineWidth.bind(F),F.colorPanel=new Qe("Color",J.defaultColorSet,J.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.lineWidthPanel=new dt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.lineWidthPanel.onWidthChanged=F.setLineWidth,F}return Ae(s,W),s.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.visual&&f!==this.drawingImage)},s.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var f=se.createTransform();this.visual.transform.baseVal.appendItem(f),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(f,M){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(f.x,f.y),this.drawing=!0):W.prototype.pointerDown.call(this,f,M)},s.prototype.manipulate=function(f){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(f.x,f.y),this.canvasContext.stroke()):W.prototype.manipulate.call(this,f)},s.prototype.resize=function(f){W.prototype.resize.call(this,f),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(f){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):W.prototype.pointerUp.call(this,f)},s.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},s.prototype.select=function(){this.state==="creating"&&this.finishCreation(),W.prototype.select.call(this)},s.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),W.prototype.deselect.call(this)},s.prototype.finishCreation=function(){for(var f=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),M=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=M[0],F=M[1],he=M[2],Pe=M[3],Je=!1,ft=0;ft0&&(Je=!0,ftPe&&(Pe=ft),Ne>he&&(he=Ne));if(Je){this.left=J/this.pixelRatio,this.top=F/this.pixelRatio,this.width=(he-J)/this.pixelRatio,this.height=(Pe-F)/this.pixelRatio;var yt=document.createElement("canvas");yt.width=he-J,yt.height=Pe-F,yt.getContext("2d").putImageData(this.canvasContext.getImageData(J,F,he-J,Pe-F),0,0),this.drawingImgUrl=yt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},s.prototype.setDrawingImage=function(){se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},s.prototype.setColor=function(f){this.color=f,this.colorChanged(f)},s.prototype.setLineWidth=function(f){this.lineWidth=f},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({drawingImgUrl:this.drawingImgUrl},W.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){this.createVisual(),W.prototype.restoreState.call(this,f),this.drawingImgUrl=f.drawingImgUrl,this.setDrawingImage()},s.prototype.scale=function(f,M){W.prototype.scale.call(this,f,M),this.setDrawingImage()},s.typeName="FreehandMarker",s.title="Freehand marker",s.icon='',s}(qe),de=function(W){function s(f,M,J){var F=W.call(this,f,J||'')||this;return F.typeBoxes=[],F.currentType=M,F.setCurrentType=F.setCurrentType.bind(F),F}return Ae(s,W),s.prototype.getUi=function(){var f=this,M=document.createElement("div");M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2";for(var J=function(Pe){var Je="both";switch(Pe){case 0:Je="both";break;case 1:Je="start";break;case 2:Je="end";break;case 3:Je="none"}var ft=document.createElement("div");if(ft.style.display="flex",ft.style.flexGrow="2",ft.style.alignItems="center",ft.style.justifyContent="space-between",ft.style.padding="5px",ft.style.borderWidth="2px",ft.style.borderStyle="solid",ft.style.borderColor=Je===F.currentType?F.uiStyleSettings.toolboxAccentColor:"transparent",ft.addEventListener("click",function(){f.setCurrentType(Je,ft)}),M.appendChild(ft),Je==="both"||Je==="start"){var Ne=document.createElement("div");Ne.style.display="flex",Ne.style.alignItems="center",Ne.style.minHeight="20px",Ne.innerHTML=` `,Ne.style.marginLeft="5px",ft.appendChild(Ne)}var yt=document.createElement("div");yt.style.display="flex",yt.style.alignItems="center",yt.style.minHeight="20px",yt.style.flexGrow="2";var Bt=document.createElement("hr");if(Bt.style.minWidth="20px",Bt.style.border="0px",Bt.style.borderTop="3px solid "+(F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxColor:"#eeeeee"),Bt.style.flexGrow="2",yt.appendChild(Bt),ft.appendChild(yt),Je==="both"||Je==="end"){var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.alignItems="center",Kt.style.minHeight="20px",Kt.innerHTML=` `,Kt.style.marginRight="5px",ft.appendChild(Kt)}F.typeBoxes.push(ft)},F=this,he=0;he<4;he++)J(he);return M},s.prototype.setCurrentType=function(f,M){var J=this;this.currentType=f,this.typeBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},s}(Xe),fe=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.arrowType="end",F.arrowBaseHeight=10,F.arrowBaseWidth=10,F.getArrowPoints=F.getArrowPoints.bind(F),F.setArrowType=F.setArrowType.bind(F),F.arrowTypePanel=new de("Arrow type","end"),F.arrowTypePanel.onArrowTypeChanged=F.setArrowType,F}return Ae(s,W),s.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.arrow1&&f!==this.arrow2)},s.prototype.getArrowPoints=function(f,M){var J=this.arrowBaseWidth+2*this.strokeWidth,F=this.arrowBaseHeight+2*this.strokeWidth;return f-J/2+","+(M+F/2)+" "+f+","+(M-F/2)+" "+(f+J/2)+","+(M+F/2)},s.prototype.createTips=function(){this.arrow1=se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow2)},s.prototype.pointerDown=function(f,M){W.prototype.pointerDown.call(this,f,M),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(W.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var f=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),M=this.arrow1.transform.baseVal.getItem(0);M.setRotate(f,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(M,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(f+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},s.prototype.setArrowType=function(f){this.arrowType=f,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({arrowType:this.arrowType},W.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var M=f;this.arrowType=M.arrowType,this.createTips(),this.adjustVisual()},s.typeName="ArrowMarker",s.title="Arrow marker",s.icon='',s}(at),te=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.fillColor=J.defaultFillColor,F.strokeWidth=0,F.fillPanel=new Qe("Color",J.defaultColorSet,J.defaultFillColor),F.fillPanel.onColorChanged=F.setFillColor,F}return Ae(s,W),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=W.prototype.getState.call(this);return f.typeName=s.typeName,f},s.typeName="CoverMarker",s.title="Cover marker",s.icon='',s}(tt),re=function(W){function s(f,M,J,F){var he=W.call(this,f,F||'')||this;return he.opacities=[],he.opacityBoxes=[],he.opacities=M,he.currentOpacity=J,he.setCurrentOpacity=he.setCurrentOpacity.bind(he),he}return Ae(s,W),s.prototype.getUi=function(){var f=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",M.style.justifyContent="space-between",this.opacities.forEach(function(J){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="center",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=J===f.currentOpacity?f.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){f.setCurrentOpacity(J,F)}),M.appendChild(F);var he=document.createElement("div");he.innerText=100*J+"%",F.appendChild(he),f.opacityBoxes.push(F)}),M},s.prototype.setCurrentOpacity=function(f,M){var J=this;this.currentOpacity=f,this.opacityBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},s}(Xe),ne=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.setOpacity=F.setOpacity.bind(F),F.fillColor=J.defaultHighlightColor,F.strokeWidth=0,F.opacity=J.defaultHighlightOpacity,F.fillPanel=new Qe("Color",J.defaultColorSet,F.fillColor),F.fillPanel.onColorChanged=F.setFillColor,F.opacityPanel=new re("Opacity",J.defaultOpacitySteps,F.opacity),F.opacityPanel.onOpacityChanged=F.setOpacity,F}return Ae(s,W),s.prototype.setOpacity=function(f){this.opacity=f,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=W.prototype.getState.call(this);return f.typeName=s.typeName,f},s.typeName="HighlightMarker",s.title="Highlight marker",s.icon='',s}(te),ue='',me=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.bgColor="transparent",F.tipPosition={x:0,y:0},F.tipBase1Position={x:0,y:0},F.tipBase2Position={x:0,y:0},F.tipMoving=!1,F.color=J.defaultStrokeColor,F.bgColor=J.defaultFillColor,F.fontFamily=J.defaultFontFamily,F.defaultSize={x:100,y:30},F.setBgColor=F.setBgColor.bind(F),F.getTipPoints=F.getTipPoints.bind(F),F.positionTip=F.positionTip.bind(F),F.setTipPoints=F.setTipPoints.bind(F),F.colorPanel=new Qe("Text color",J.defaultColorSet,F.color,''),F.colorPanel.onColorChanged=F.setColor,F.bgColorPanel=new Qe("Fill color",J.defaultColorSet,F.bgColor,ue),F.bgColorPanel.onColorChanged=F.setBgColor,F.fontFamilyPanel=new Re("Font",J.defaultFontFamilies,J.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F.tipGrip=new it,F.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),F.controlBox.appendChild(F.tipGrip.visual),F}return Ae(s,W),s.prototype.ownsTarget=function(f){return W.prototype.ownsTarget.call(this,f)||this.tipGrip.ownsTarget(f)||this.tip===f},s.prototype.createTip=function(){se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},s.prototype.pointerDown=function(f,M){this.state==="new"&&W.prototype.pointerDown.call(this,f,M),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(M)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):W.prototype.pointerDown.call(this,f,M)},s.prototype.pointerUp=function(f){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,W.prototype.pointerUp.call(this,f);else{var M=this.state==="creating";W.prototype.pointerUp.call(this,f),this.setTipPoints(M),this.positionTip()}},s.prototype.manipulate=function(f){if(this.tipMoving){var M=this.unrotatePoint(f);this.tipPosition={x:M.x-this.manipulationStartLeft,y:M.y-this.manipulationStartTop},this.positionTip()}else W.prototype.manipulate.call(this,f)},s.prototype.setBgColor=function(f){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",f]]),se.setAttributes(this.tip,[["fill",f]])),this.bgColor=f,this.fillColorChanged(f)},s.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},s.prototype.setTipPoints=function(f){f===void 0&&(f=!1);var M=Math.min(this.height/2,15),J=this.height/5;f&&(this.tipPosition={x:M+J/2,y:this.height+20});var F=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?F.1)){var f=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),M=this.tip1.transform.baseVal.getItem(0);M.setRotate(f,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(M,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(f+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=W.prototype.getState.call(this);return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f),this.createTips(),this.adjustVisual()},s.typeName="MeasurementMarker",s.title="Measurement marker",s.icon='',s}(at),ot=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.strokePanel.colors=J.defaultColorSet,F.fillColor="transparent",F}return Ae(s,W),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=W.prototype.getState.call(this);return f.typeName=s.typeName,f},s.typeName="EllipseFrameMarker",s.title="Ellipse frame marker",s.icon='',s}(Te),gt=function(){function W(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(W.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),W.prototype.addUndoStep=function(s){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(s)||(this.undoStack.push(s),JSON.stringify(this.lastRedoStep)!==JSON.stringify(s)&&this.redoStack.splice(0,this.redoStack.length))},W.prototype.replaceLastUndoStep=function(s){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=s)},W.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},W.prototype.undo=function(){if(this.undoStack.length>1){var s=this.undoStack.pop();return s!==void 0&&this.redoStack.push(s),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},W.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},W}(),pt=function(W){function s(f,M,J){var F=W.call(this,f,M,J)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.curveX=0,F.curveY=0,F.manipulationStartCurveX=0,F.manipulationStartCurveY=0,F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.positionGrips=F.positionGrips.bind(F),F.addControlGrips=F.addControlGrips.bind(F),F.adjustVisual=F.adjustVisual.bind(F),F.setupControlBox=F.setupControlBox.bind(F),F.resize=F.resize.bind(F),F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new dt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return Ae(s,W),s.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.visual&&f!==this.selectorCurve&&f!==this.visibleCurve&&!this.curveGrip.ownsTarget(f))},s.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},s.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorCurve=se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=se.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(f,M){W.prototype.pointerDown.call(this,f,M),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=f.x,this.curveY=f.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(M)&&(this.activeGrip=this.curveGrip,this._state="resize")},s.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setupControlBox=function(){W.prototype.setupControlBox.call(this),this.curveControlLine1=se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=se.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},s.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,W.prototype.addControlGrips.call(this)},s.prototype.positionGrips=function(){W.prototype.positionGrips.call(this);var f=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-f/2,this.curveY-f/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},s.prototype.manipulate=function(f){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+f.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+f.y-this.manipulationStartY),W.prototype.manipulate.call(this,f)},s.prototype.resize=function(f){this.activeGrip===this.curveGrip&&(this.curveX=f.x,this.curveY=f.y),W.prototype.resize.call(this,f),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},s.prototype.setStrokeColor=function(f){this.strokeColor=f,this.adjustVisual(),this.colorChanged(f)},s.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.adjustVisual()},s.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,this.adjustVisual()},s.prototype.scale=function(f,M){this.curveX=this.curveX*f,this.curveY=this.curveY*M,W.prototype.scale.call(this,f,M)},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},W.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var M=f;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.curveX=M.curveX,this.curveY=M.curveY,this.createVisual(),this.adjustVisual()},s.typeName="CurveMarker",s.title="Curve marker",s.icon='',s}(ut),Tt=function(){function W(s,f){f===void 0&&(f=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=s,this.cancelable=f}return Object.defineProperty(W.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),W.prototype.preventDefault=function(){this._defaultPrevented=!0},W}(),St=function(W){function s(f,M,J){var F=W.call(this,f,!1)||this;return F.dataUrl=M,F.state=J,F}return Ae(s,W),s}(Tt),ht=function(W){function s(f,M,J){J===void 0&&(J=!1);var F=W.call(this,f,J)||this;return F.marker=M,F}return Ae(s,W),s}(Tt),Ut=function(){function W(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return W.prototype.addEventListener=function(s,f){this[s].push(f)},W.prototype.removeEventListener=function(s,f){var M=this[s].indexOf(f);M>-1&&this[s].splice(M,1)},W}(),Mt=function(){function W(s){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new we,this._isOpen=!1,this.undoRedoManager=new gt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=W.instanceCounter++,this.styles=new Ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=s,this.targetRoot=document.body,this.width=s.clientWidth,this.height=s.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(W.prototype,"ALL_MARKER_TYPES",{get:function(){return[nt,ge,fe,He,ot,Te,ne,me,_e,te,at,pt]},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[nt,ge,fe,He,Te,ne,me]},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"BASIC_MARKER_TYPES",{get:function(){return[nt,ge,fe,He,ne]},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(s){var f=this;this._availableMarkerTypes.splice(0),s.forEach(function(M){if(typeof M=="string"){var J=f.ALL_MARKER_TYPES.find(function(F){return F.typeName===M});J!==void 0&&f._availableMarkerTypes.push(J)}else f._availableMarkerTypes.push(M)})},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(s){this._zoomLevel=s,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),W.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),De.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},W.prototype.show=function(){var s=this;this.styles.styleSheetRoot===void 0&&We.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=We.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(f){return f(new Tt(s))})},W.prototype.render=function(){return Ee(this,void 0,void 0,function(){var s;return Ce(this,function(f){switch(f.label){case 0:return this.setCurrentMarker(),(s=new ze).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.markersOnly=this.renderMarkersOnly,s.width=this.renderWidth,s.height=this.renderHeight,[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return f.sent(),[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,f.sent()]}})})},W.prototype.close=function(s){var f=this;if(s===void 0&&(s=!1),this.isOpen){var M=!1;s||this.eventListeners.beforeclose.forEach(function(J){var F=new Tt(f,!0);J(F),F.defaultPrevented&&(M=!0)}),M||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(J){return J(new Tt(f))}),this.detachEvents(),this._isOpen=!1)}},W.prototype.addMarkersToToolbar=function(){for(var s,f=[],M=0;Mthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*s:this.editorCanvas.clientWidth,M=f',s.title="Powered by marker.js",s.style.display="grid",s.style.alignItems="center",s.style.justifyItems="center",s.style.padding="3px",s.style.width="20px",s.style.height="20px",this.logoUI.appendChild(s),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},W.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},W.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},W.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},W.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Oe(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-1&&this.markers.splice(this.markers.indexOf(s),1),s.dispose()},W.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},W.prototype.toolbarButtonClicked=function(s,f){if(s==="marker"&&f!==void 0)this.createNewMarker(f);else if(s==="action")switch(f){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},W.prototype.deleteSelectedMarker=function(){var s=this;if(this._currentMarker!==void 0){var f=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var F=new ht(s,s._currentMarker,!0);J(F),F.defaultPrevented&&(f=!0)}),!f){var M=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(J){return J(new ht(s,M))})}}},W.prototype.clear=function(){var s=this,f=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(he){var Pe=new ht(s,void 0,!0);he(Pe),Pe.defaultPrevented&&(f=!0)}),!f)){this.setCurrentMarker();for(var M=function(he){var Pe=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(Je){return Je(new ht(s,Pe))})},J=this,F=this.markers.length-1;F>=0;F--)M(F);this.addUndoStep()}},Object.defineProperty(W.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),W.prototype.showNotesEditor=function(){var s;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(s=this._currentMarker.notes)!==null&&s!==void 0?s:"",this.overlayContainer.appendChild(this.notesArea))},W.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},W.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},W.prototype.addUndoStep=function(){var s=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var f=this.getState(),M=this.undoRedoManager.getLastUndoStep();if(!M||M.width===f.width&&M.height===f.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(f),J1&&this.panTo({x:s.clientX,y:s.clientY}))},W.prototype.onPointerUp=function(s){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(s.clientX,s.clientY)),this.isDragging=!1,this.addUndoStep()},W.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},W.prototype.onKeyUp=function(s){this._currentMarker===void 0||this.notesArea!==void 0||s.key!=="Delete"&&s.key!=="Backspace"||this.deleteSelectedMarker()},W.prototype.clientToLocalCoordinates=function(s,f){var M=this.markerImage.getBoundingClientRect();return{x:(s-M.left)/this.zoomLevel,y:(f-M.top)/this.zoomLevel}},W.prototype.onWindowResize=function(){this.positionUI()},W.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},W.prototype.addLicenseKey=function(s){De.addKey(s)},W.prototype.addEventListener=function(s,f){this.eventListeners.addEventListener(s,f)},W.prototype.removeEventListener=function(s,f){this.eventListeners.removeEventListener(s,f)},W.prototype.renderState=function(s){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(s),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(W.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),W.prototype.focus=function(){var s=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(f){return f(new Tt(s))}))},W.prototype.blur=function(){var s=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(f){return f(new Tt(s))}))},W.instanceCounter=0,W}();/* ********************************** cropro version 1.2.0 @license SEE LICENSE IN LICENSE copyright Alan Mendelevich see README and LICENSE for details ********************************** *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Jt=function(W,s){return(Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,M){f.__proto__=M}||function(f,M){for(var J in M)Object.prototype.hasOwnProperty.call(M,J)&&(f[J]=M[J])})(W,s)};function Qt(W,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function f(){this.constructor=W}Jt(W,s),W.prototype=s===null?Object.create(s):(f.prototype=s.prototype,new f)}function It(W,s,f,M){return new(f||(f=Promise))(function(J,F){function he(ft){try{Je(M.next(ft))}catch(Ne){F(Ne)}}function Pe(ft){try{Je(M.throw(ft))}catch(Ne){F(Ne)}}function Je(ft){var Ne;ft.done?J(ft.value):(Ne=ft.value,Ne instanceof f?Ne:new f(function(yt){yt(Ne)})).then(he,Pe)}Je((M=M.apply(W,s||[])).next())})}function _r(W,s){var f,M,J,F,he={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return F={next:Pe(0),throw:Pe(1),return:Pe(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Pe(Je){return function(ft){return function(Ne){if(f)throw new TypeError("Generator is already executing.");for(;he;)try{if(f=1,M&&(J=2&Ne[0]?M.return:Ne[0]?M.throw||((J=M.return)&&J.call(M),0):M.next)&&!(J=J.call(M,Ne[1])).done)return J;switch(M=0,J&&(Ne=[2&Ne[0],J.value]),Ne[0]){case 0:case 1:J=Ne;break;case 4:return he.label++,{value:Ne[1],done:!1};case 5:he.label++,M=Ne[1],Ne=[0];continue;case 7:Ne=he.ops.pop(),he.trys.pop();continue;default:if(!(J=he.trys,(J=J.length>0&&J[J.length-1])||Ne[0]!==6&&Ne[0]!==2)){he=0;continue}if(Ne[0]===3&&(!J||Ne[1]>J[0]&&Ne[1]0&&f>0){var M=new Hr(s,f),J=M.ratio>=1?20:M.getHorizontalLength(20),F=M.ratio<1?20:M.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 Pe=Et.createDefs();he.appendChild(Pe);var Je=Et.createElement("clipPath",[["id","text-bg-clip"]]);Pe.appendChild(Je);var ft=Et.createPath(Et.getHollowRectanglePath((24-J)/2,(24-F)/2,J,F,(24-J)/2+2,(24-F)/2+2,J-4,F-4));he.appendChild(ft);var Ne=Et.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ne.appendChild(Et.createTSpan(s+":"+f)),he.appendChild(Ne);var yt=Ne.getBBox();Et.setAttributes(Ne,[["x",((24-yt.width)/2).toString()],["y",((24-yt.height)/2-yt.y).toString()]]);var Bt=Et.createPath(Et.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(yt.width))/2,(24-Math.ceil(yt.height))/2,Math.ceil(yt.width),Math.ceil(yt.height)));return Je.appendChild(Bt),Et.setAttributes(ft,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(he),he.outerHTML}return''},W}(),mr=function(W){function s(f,M,J){var F=W.call(this,f,M)||this;return F.isDropdownOpen=!1,F.onClick=F.dropdownButtonClicked,F.dropdownButtons=J,F}return Qt(s,W),s.prototype.setupDropdown=function(){var f=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(M){M.className=f.className,M.colorsClassName=f.colorsClassName,f.dropdownBlock.appendChild(M.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},s.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},s.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},s.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},s.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},s.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},s}(_t),Lt=function(){function W(s,f){this.GRIP_SIZE=10,this.color=s,this.fillColor=f,this.visual=Et.createGroup(),this.visual.appendChild(Et.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Et.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return W.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},W.prototype.setCenter=function(s,f){this.visual.childNodes.forEach(function(M){return Et.setAttributes(M,[["cx",s.toString()],["cy",f.toString()]])})},W}(),Ur=function(){function W(s,f,M,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=s,this.canvasHeight=f,this.margin=M,this.container=J,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(W.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(s){this._aspectRatio=s,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.gridContainer&&Et.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(s){this._zoomFactor=s,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),W.prototype.open=function(){var s=this;this.cropShadeElement=Et.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Et.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var f=0;fthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-f.height/2),Et.setAttributes(this.cropRectElement,[["x",f.x.toString()],["y",f.y.toString()],["width",f.width.toString()],["height",f.height.toString()]]);var M=f.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(F,he){var Pe=f.y+M*(he+1);Et.setAttributes(F,[["x1",""+f.x],["y1",""+Pe],["x2",""+(f.x+f.width)],["y2",""+Pe]])});var J=f.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(F,he){var Pe=f.x+J*(he+1);Et.setAttributes(F,[["x1",""+Pe],["y1",""+f.y],["x2",""+Pe],["y2",""+(f.y+f.height)]])}),Et.setAttributes(this.cropShadeElement,[["d",Et.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,f.x,f.y,f.width,f.height)]]),this.topLeftGrip.setCenter(f.x,f.y),this.topRightGrip.setCenter(f.x+f.width,f.y),this.bottomLeftGrip.setCenter(f.x,f.y+f.height),this.bottomRightGrip.setCenter(f.x+f.width,f.y+f.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},W.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},W.prototype.clientToLocalCoordinates=function(s,f){var M=this.container.getBoundingClientRect();return{x:s-M.left+this.margin,y:f-M.top+this.margin}},W.prototype.onPointerDown=function(s){this.container.setPointerCapture(s.pointerId),this.previousPoint=this.clientToLocalCoordinates(s.clientX,s.clientY),this.cropRectElement===s.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(s.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(s.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(s.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(s.target)&&(this.activeGrip=this.bottomRightGrip)},W.prototype.onPointerMove=function(s){if(this.isMoving)this.move(this.clientToLocalCoordinates(s.clientX,s.clientY));else if(this.activeGrip){var f=this.clientToLocalCoordinates(s.clientX,s.clientY);this.resize(f)}s.preventDefault()},W.prototype.onPointerUp=function(s){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(s.pointerId)},W.prototype.move=function(s){var f=s.x-this.previousPoint.x,M=s.y-this.previousPoint.y;this.zoomFactor!==1&&(f=-f/this.zoomFactor,M=-M/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+f),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+M),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=s},W.prototype.resize=function(s){var f=Object.assign({},this.cropRect),M=s.x-this.previousPoint.x,J=s.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:f.x+Mthis.canvasWidth*this.zoomFactor&&(M=this.canvasWidth*this.zoomFactor-f.width),f.width+=M}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(f.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(M),f.height=this.aspectRatio.getVerticalLength(f.width)):(f.y+=J,f.height=this.cropRect.y+this.cropRect.height-f.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?f.height=this.aspectRatio.getVerticalLength(f.width):f.height+=J}f.width<10&&(f.x=this.cropRect.x,f.width=10),f.height<10&&(f.y=this.cropRect.y,f.height=10),this.previousPoint=s,f.x>=this.margin&&f.y>=this.margin&&f.x-this.margin+f.width<=this.canvasWidth&&f.y-this.margin+f.height<=this.canvasHeight&&(this.cropRect=f,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},W.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var s=this.cropRect.x+this.cropRect.width/2,f=this.cropRect.y+this.cropRect.height/2,M=this.aspectRatio.getHorizontalLength(this.cropRect.height),J=this.aspectRatio.getVerticalLength(this.cropRect.width);M/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=s-this.cropRect.width/2,this.cropRect.y=f-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},W.prototype.getRescaledRect=function(s,f,M,J,F,he){var Pe=M/s,Je=J/f;return{x:(F.x-he)*Pe+he,y:(F.y-he)*Je+he,width:F.width*Pe,height:F.height*Je}},W.prototype.scaleCanvas=function(s,f){var M=this.getRescaledRect(this.canvasWidth,this.canvasHeight,s,f,this.cropRect,this.margin);this.canvasWidth=s,this.canvasHeight=f,this.onCropChange&&this.onCropChange(M),this.setCropRectangle(M)},W}(),Vr=function(){function W(s){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=s,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(W.prototype,"angle",{get:function(){return this._angle},set:function(s){this._angle=s,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),W.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},W.prototype.onPointerDown=function(s){this.controlContainer.setPointerCapture(s.pointerId),this.isDragging=!0,this.previousPoint={x:s.clientX,y:s.clientY}},W.prototype.onPointerMove=function(s){this.isDragging&&(this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.previousPoint.x=s.clientX)},W.prototype.onPointerUp=function(s){this.isDragging&&this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(s.pointerId)},W.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var s=this.angleLabelText.getBBox();Et.setAttributes(this.angleLabelElement,[["x",((this.width-s.width)/2).toString()],["y",(this.height/2).toString()]])}},W.prototype.positionScaleShape=function(){if(this.scaleShape){var s=this.scaleShape.transform.baseVal.getItem(0);s.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(s,0)}},W.prototype.getVisual=function(){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("width",this.width+"px"),s.setAttribute("height",this.height+"px"),s.setAttribute("viewBox","0 0 "+this.width+" "+this.height),s.style.flexShrink="0",document.body.appendChild(s);for(var f="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,M=1;M<=this.width/5+10;M++){var J=M%5==0?this.height/3:this.height/6;f+="h4v"+-J+"h1v"+J}f+="v1H0Z",this.scaleShape=Et.createPath(f);var F=Et.createTransform();this.scaleShape.transform.baseVal.appendItem(F),s.appendChild(this.scaleShape),this.angleLabelElement=Et.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Et.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var he=Et.createTSpan("");return he.innerHTML="°",this.angleLabelElement.appendChild(he),s.appendChild(this.angleLabelElement),document.body.removeChild(s),s},W}(),fi=function(){function W(){this.naturalSize=!1,this.imageType="image/png"}return W.prototype.rasterize=function(s,f,M,J,F,he,Pe){var Je=this;return new Promise(function(ft){var Ne=document.createElement("canvas");Ne.width=s.width.baseVal.value-2*J,Ne.height=s.height.baseVal.value-2*J;var yt=1,Bt=1;Je.naturalSize===!0?(yt=f.naturalWidth/(s.width.baseVal.value-2*J)/he,Bt=f.naturalHeight/(s.height.baseVal.value-2*J)/Pe,Ne.width=f.naturalWidth/he,Ne.height=f.naturalHeight/Pe):Je.width!==void 0&&Je.height!==void 0&&(yt=Je.width/M.width,Bt=Je.height/M.height,Ne.width*=yt,Ne.height*=Bt);var Kt=Ne.getContext("2d");Kt.translate(Ne.width/2,Ne.height/2),Kt.rotate(F*Math.PI/180),Kt.scale(he,Pe),Kt.translate(-Ne.width/2,-Ne.height/2),Kt.drawImage(f,0,0,Ne.width,Ne.height);var Ir=document.createElement("canvas");Ir.width=M.width*yt,Ir.height=M.height*Bt,Ir.getContext("2d").putImageData(Kt.getImageData((M.x-J)*yt,(M.y-J)*Bt,M.width*yt,M.height*Bt),0,0),ft(Ir.toDataURL(Je.imageType,Je.imageQuality))})},W}(),Ge=function(){function W(s){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=W.instanceCounter++,this.styles=new Br(this.instanceNo),this.target=s,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(W.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(s){this._zoomToCropEnabled=s,s?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"gridLines",{get:function(){return this._gridLines},set:function(s){this._gridLines=s,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(s){this._rotationAngle=s,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"aspectRatio",{get:function(){var s;return(s=this._aspectRatio)!==null&&s!==void 0?s:this.aspectRatios[0]},set:function(s){this._aspectRatio=s},enumerable:!1,configurable:!0}),W.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},W.prototype.show=function(){this.showUI(),this.open()},W.prototype.close=function(s){s===void 0&&(s=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),s||this.closeEventListeners.forEach(function(f){return f()}),this._isOpen=!1)},W.prototype.addRenderEventListener=function(s){this.renderEventListeners.push(s)},W.prototype.removeRenderEventListener=function(s){this.renderEventListeners.indexOf(s)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(s),1)},W.prototype.addCloseEventListener=function(s){this.closeEventListeners.push(s)},W.prototype.removeCloseEventListener=function(s){this.closeEventListeners.indexOf(s)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(s),1)},W.prototype.setupResizeObserver=function(){var s=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){s.resize(s.target.clientWidth,s.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},W.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var s=1*this.target.clientWidth/this.target.clientHeight,f=this.contentDiv.clientWidth/s>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*s:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,M=f+2*this.CANVAS_MARGINs+this.CANVAS_MARGIN?this.target.offsetTop-(s+this.CANVAS_MARGIN):0;this.coverDiv.style.top=f+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},W.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},W.prototype.addTopToolbar=function(){var s=this;this.topToolbar=new Nr,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var f=new $r;f.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(f);var M=[];this.aspectRatios.forEach(function(Bt){var Kt=new _t(ei.getIcon(Bt.horizontal,Bt.vertical),Bt.horizontal===0&&Bt.vertical===0?"FREE":Bt.horizontal+":"+Bt.vertical);Kt.onClick=function(){return s.ratioButtonClicked(Bt)},M.push(Kt)}),this.aspectRatioButton=new mr(ei.getIcon(0,0),"Aspect ratio",M),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,f.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new _t('',"Toggle grid");J.isActive=this.isGridVisible,J.onClick=function(){s.isGridVisible=!s.isGridVisible,J.isActive=s.isGridVisible},f.addButton(J);var F=new _t('',"Zoom to selection");if(F.isActive=this.zoomToCropEnabled,F.onClick=function(){s.zoomToCropEnabled=!s.zoomToCropEnabled,F.isActive=s.zoomToCropEnabled},f.addButton(F),!Kr.isLicensed){var he=new ct;this.topToolbar.addElementBlock(he);var Pe=document.createElement("div");Pe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Je=document.createElement("a");Je.style.color="currentColor",Je.href="https://markerjs.com/products/cropro",Je.target="_blank",Je.innerHTML='',Pe.appendChild(Je),he.addElement(Pe)}var ft=new $r;ft.minWidth=3*this.toolbarHeight+"px",ft.contentAlign="end",this.topToolbar.addButtonBlock(ft);var Ne=new _t('',"OK");Ne.onClick=this.startRenderAndClose,ft.addButton(Ne),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ne.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var yt=new _t('',"Close");yt.onClick=this.close,ft.addButton(yt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(yt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},W.prototype.addBottomToolbar=function(){var s=this;this.bottomToolbar=new Nr,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var f=new $r;f.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(f);var M=new _t('',"Rotate left");M.onClick=this.rotateLeftButtonClicked,f.addButton(M);var J=new _t('',"Rotate right");J.onClick=this.rotateRightButtonClicked,f.addButton(J);var F=new ct;F.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(F),this.straightener=new Vr("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(ft){s.rotateBy(ft),s.straightener.angle=s.rotationAngle},F.addElement(this.straightener.getUI());var he=new $r;he.minWidth=2*this.toolbarHeight+"px",he.contentAlign="end",this.bottomToolbar.addButtonBlock(he);var Pe=new _t('',"Flip horizontal");Pe.onClick=this.flipHorizontallyButtonClicked,he.addButton(Pe);var Je=new _t('',"Flip vertical");Je.onClick=this.flipVerticallyButtonClicked,he.addButton(Je)},W.prototype.ratioButtonClicked=function(s){this.aspectRatio=s,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},W.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ei.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},W.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Hr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},W.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},W.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},W.prototype.restoreState=function(s){if(s){var f=this.cropLayer.getRescaledRect(s.width,s.height,this.imageWidth,this.imageHeight,s.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(f),this.cropRectChanged(f),this.flippedHorizontally=s.flippedHorizontally,this.flippedVertically=s.flippedVertically,this.applyFlip(),this.rotationAngle=s.rotationAngle,this.applyRotation()}},W.prototype.clientToLocalCoordinates=function(s,f){var M=this.cropImage.getBoundingClientRect();return{x:s-M.left,y:f-M.top}},W.prototype.onWindowResize=function(){this.positionUI()},W.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var s=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=s+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},W.prototype.rotateLeftButtonClicked=function(){var s=this.rotationAngle-90;this.rotationAngle%90!=0&&(s+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(s)},W.prototype.rotateRightButtonClicked=function(){var s=this.rotationAngle+90;this.rotationAngle%90!=0&&(s-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(s)},W.prototype.rotateTo=function(s){s=(s=s>180?s-360:s)<=-180?s+360:s,this.rotationAngle=s,this.applyRotation()},W.prototype.rotateBy=function(s){this.rotateTo((this.rotationAngle+s)%360)},W.prototype.applyRotation=function(){var s=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var f=this.editingTargetRotationContainer.transform.baseVal.getItem(0);f.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(f,0);var M=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/M.width,this.imageHeight/M.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=s},W.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},W.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},W.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},W.prototype.startRenderAndClose=function(){return It(this,void 0,void 0,function(){var s,f;return _r(this,function(M){switch(M.label){case 0:return[4,this.render()];case 1:return s=M.sent(),f=this.getState(),this.renderEventListeners.forEach(function(J){return J(s,f)}),this.close(!0),[2]}})})},W.prototype.render=function(){return It(this,void 0,void 0,function(){var s;return _r(this,function(f){switch(f.label){case 0:return(s=new fi).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.width=this.renderWidth,s.height=this.renderHeight,this.unzoomFromCrop(),Et.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,s.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return f.sent(),[4,s.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,f.sent()]}})})},W.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new pr("toolbar",` width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`; flex-shrink: 0; display: flex; flex-direction: row; justify-content: space-between; height: `+this.toolbarHeight+`px; box-sizing: content-box; overflow: hidden; line-height: 0px; `)),this.toolbarStyleColorsClass=this.styles.addClass(new pr("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new pr("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var s=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pr("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*s)+`px; height: `+(this.toolbarHeight-2*s)+`px; padding: `+s+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new pr("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pr("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new hr("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new hr("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new pr("toolbar_dropdown",` position: absolute; max-width: `+4*this.toolbarHeight+`px; z-index: 20; white-space: normal; box-sizing: content-box; box-shadow: 3px 3px rgba(33, 33, 33, 0.1); margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px; line-height: 0px; `)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new pr("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new pr("toolbar_straightener_block",` display: flex; overflow: hidden; justify-content: center; -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%); `)),this.toolbarStraightenerStyleClass=this.styles.addClass(new pr("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*s)+`px; padding: `+s+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new pr("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},W.instanceCounter=0,W}(),Ct=Z("8hTe"),pi=Z.n(Ct),mi=/]*>/g;function gi(W){var s=document.createElement("div");return s.innerHTML=W,s.childNodes.length===0?"":s.childNodes[0].nodeValue}var vi=Le.a=function(W){var s=W.value,f=s===void 0?"":s,M=W.edit,J=M===void 0?!1:M,F=W.className,he=W.showTextOnly,Pe=W.showLines,Je=W.replaces,ft=W.zoomImg,Ne=W.hasMask,yt=W.style,Bt=yt===void 0?{}:yt,Kt=W.stylesPrev,Ir=Kt===void 0?{}:Kt,gr=String(f),vr=Object(I.useRef)(),Qr=Object(I.useRef)(),Ii=Object(I.useState)(""),nr=Object(G.a)(Ii,2),Fr=nr[0],oi=nr[1],si=Object(I.useState)("office"),Mr=Object(G.a)(si,2),Mi=Mr[0],yi=Mr[1],zi=function(){var Nt=new Ge(Qr.current);Nt.displayMode="popup",Nt.addRenderEventListener(function(){var dr=Object(_.a)(O.a.mark(function Rt($t){var jt;return O.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:return vr.current.style.display="none",ar.next=3,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:$t}});case 3:jt=ar.sent,jt!=null&&jt.id&&Je(Qr.current.getAttribute("src").replace(oe.a.API_SERVER,""),"/api/attachments/".concat(jt==null?void 0:jt.id,"?type=").concat(jt.content_type));case 5:case"end":return ar.stop()}},Rt)}));return function(Rt){return dr.apply(this,arguments)}}()),Nt.show()},Ki=function(){var Nt=new Mt(Qr.current);Nt.settings.displayMode="popup",Nt.addEventListener("render",function(){var dr=Object(_.a)(O.a.mark(function Rt($t){var jt;return O.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:if(vr.current.style.display="none",!Qr.current){ar.next=6;break}return ar.next=4,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:$t.dataUrl}});case 4:jt=ar.sent,jt!=null&&jt.id&&Je(Qr.current.getAttribute("src").replace(oe.a.API_SERVER,""),"/api/attachments/".concat(jt==null?void 0:jt.id,"?type=").concat(jt.content_type));case 6:case"end":return ar.stop()}},Rt)}));return function(Rt){return dr.apply(this,arguments)}}()),Nt.show(),window.markerArea=Nt},Yr=Object(I.useMemo)(function(){vr.current&&(vr.current.style.zIndex=-1);try{var Zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Nt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,dr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;gr=gr.replace(Zt,"("+oe.a.API_SERVER+"/api/attachments/").replace(Nt,'"'+oe.a.API_SERVER+"/api/attachments/").replace(dr,'"'+oe.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `)}catch(ti){}var Rt=$(gr),$t=b();if(gr.match(/\[TOC\]/)&&(Rt=Rt.replace("

    [TOC]

    ",L()),E()),Rt=Rt.replace(/(__special_katext_id_\d+__)/g,function(ti,ar){var xr=$t[ar],Vi=xr.type,xi=xr.expression;return Object(ce.renderToString)(gi(xi)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Rt=Rt.replace(/▁/g,"\u2581\u2581\u2581"),m(),he){var jt=document.createElement("div");return jt.innerHTML=Rt,jt.innerText}return setTimeout(function(){return dn()},500),Rt},[gr]),Gr=Object(I.useRef)();v.WebkitLineClamp=Pe,Pe&&(Bt=Object(B.a)(Object(B.a)({},Bt),v));function bi(Zt){var Nt=Zt.target;if(Nt.tagName.toUpperCase()==="IMG"){if(ft){var dr=Nt.getAttribute("src");oi(dr),yi("image")}}else if(Nt.tagName.toUpperCase()==="A"){var Rt=Nt.getAttribute("href");if(Rt.indexOf("office")>-1)Zt.preventDefault(),oi(Rt),yi("office");else if(Rt.indexOf("application/pdf")>-1)Zt.preventDefault(),oi(Rt),yi("pdf");else if(Rt.indexOf("text/html")>-1)Zt.preventDefault(),oi(Rt),yi("html");else if(Rt.startsWith("#")){Zt.preventDefault();var $t=document.getElementById(Rt.replace("#",""));$t&&$t.scrollIntoView(!0)}}}var dn=function(){var Nt,dr=(Nt=Gr.current)===null||Nt===void 0?void 0:Nt.querySelectorAll("video");dr==null||dr.forEach(function(Rt){if(Rt.oncontextmenu=function(){return!1},Rt.src.indexOf(".m3u8")>-1&&!Rt.canPlayType("application/vnd.apple.mpegurl")){if(ee.a.isSupported()){var $t=new ee.a;$t.loadSource(Rt.src),$t.attachMedia(Rt)}}})};Object(I.useEffect)(function(){if(Gr.current&&Yr&&(Yr.match(mi)&&window.PR.prettyPrint()),Gr.current)return Gr.current.addEventListener("click",bi),function(){Gr.current.removeEventListener("click",bi),m(),E()}},[Yr,Gr.current,bi]);var Ei=function(Nt){if(!J)return;Nt.target.nodeName==="IMG"?(vr.current.style.zIndex=1,vr.current.style.display="flex",vr.current.style.width=Nt.target.clientWidth+"px",vr.current.style.height=Nt.target.clientHeight+"px",vr.current.style.top=Nt.target.offsetTop+"px",vr.current.style.left=Nt.target.offsetLeft+"px",Qr.current.src=Nt.target.getAttribute("src")):vr.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Gr,style:Object(B.a)({},Bt),className:"".concat(F||""," markdown-body ").concat(pi.a.mdBody),onMouseOver:Ei,dangerouslySetInnerHTML:{__html:Yr}}),y.a.createElement("div",{ref:vr,className:pi.a.button},y.a.createElement(X.a,null,y.a.createElement(Q.a,{onClick:function(){return zi()}},"\u88C1\u526A"),y.a.createElement(Q.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(ve.a,{close:!0,data:Fr,type:Fr!=null&&Fr.length?Mi:"",style:Object(B.a)({},Ir),onClose:function(){return oi("")}}))}},"9VGf":function(Ie,Le,Z){"use strict";Z.d(Le,"a",function(){return R});var ie=Z("q1tI"),X=Z.n(ie);function R(Q,B){var _=Object(ie.useRef)();Object(ie.useEffect)(function(){_.current=Q}),Object(ie.useEffect)(function(){function G(){_.current()}if(B!==null){var j=setInterval(G,B);return function(){return clearInterval(j)}}},[B])}},"9ZNV":function(Ie,Le,Z){"use strict";Z.d(Le,"a",function(){return I});var ie=Z("0Owb"),X=Z("+L6B"),R=Z("2/Rp"),Q=Z("q1tI"),B=Z.n(Q),_=Z("UUDw"),G=Z.n(_),j=Z("TSYQ"),O=Z.n(j),I=function(T){var k=T.cancelText,D=k===void 0?"\u53D6\u6D88":k,w=T.okText,A=w===void 0?"\u786E\u5B9A":w,d=T.loading,o=d===void 0?!1:d,l=T.hasOkBtn,h=l===void 0?!0:l,E=T.okButtonProps,v=E===void 0?{}:E,g=T.onCancel,L=g===void 0?function(){}:g,x=T.onOk,p=x===void 0?function(){}:x,c=T.className,u=c===void 0?"":c;return B.a.createElement("div",{className:O()(G.a.buttonFixed,u)},B.a.createElement("div",{className:G.a.buttonWrap},B.a.createElement(R.a,{size:"large",className:"".concat(G.a.button," mr20"),onClick:L},D),h&&B.a.createElement(R.a,Object(ie.a)({size:"large",type:"primary",className:"".concat(G.a.button," mr20"),loading:o,onClick:p},v),A)))}},"A/g1":function(Ie,Le){Ie.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6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a3XwurL9tp4kN7fsUQz5fTnxbGH8GFt7DcwpecTuMFmlIaZ+bjOgvF2u7d/gnIWZR+Q1KPowcIIaAhQSarqmH/xE0TpQbb92M9uT7kdz+/HqfDB0EcF/ZRi1ggYFER/cYcMtMOO3jzlmVjXKDrkt5uv9are9ZLJ8L6UcJ+HplVotygVRlYLFwM4GWf2njl/ymq1fqrSgM3J1Sfz5Rnd15ulp/tiGtPV6h0aIwaCDxUPc/F8sfOQdqTKnbrvjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(Ie,Le,Z){(function(ie){ie(Z("VrN/"),Z("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(O,I,y){if(y!=ie.Init&&y&&O.removeKeyMap("autoCloseTags"),!I)return;var T={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(T["'/'"]=function(k){return _(k)}),(typeof I!="object"||I.whenOpening!==!1)&&(T["'>'"]=function(k){return Q(k)}),O.addKeyMap(T)});var X=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Q(O){if(O.getOption("disableInput"))return ie.Pass;for(var I=O.listSelections(),y=[],T=O.getOption("autoCloseTags"),k=0;kD.ch&&(l=l.slice(0,l.length-w.end+D.ch));var g=l.toLowerCase();if(!l||w.type=="string"&&(w.end!=D.ch||!/[\"\']/.test(w.string.charAt(w.string.length-1))||w.string.length==1)||w.type=="tag"&&o.close||w.string.indexOf("/")==D.ch-w.start-1||E&&G(E,g)>-1||j(O,A.mode.xmlCurrentContext&&A.mode.xmlCurrentContext(d)||[],l,D,!0))return ie.Pass;var L=typeof T=="object"&&T.emptyTags;if(L&&G(L,l)>-1){y[k]={text:"/>",newPos:ie.Pos(D.line,D.ch+2)};continue}var x=v&&G(v,g)>-1;y[k]={indent:x,text:">"+(x?` `:"")+"",newPos:x?ie.Pos(D.line+1,0):ie.Pos(D.line,D.ch+1)}}for(var p=typeof T=="object"&&T.dontIndentOnAutoClose,k=I.length-1;k>=0;k--){var c=y[k];O.replaceRange(c.text,I[k].head,I[k].anchor,"+insert");var u=O.listSelections().slice(0);u[k]={head:c.newPos,anchor:c.newPos},O.setSelections(u),!p&&c.indent&&(O.indentLine(c.newPos.line,null,!0),O.indentLine(c.newPos.line+1,null,!0))}}function B(O,I){for(var y=O.listSelections(),T=[],k=I?"/":""&&(E+=">"),T[A]=E}if(O.replaceSelections(T),y=O.listSelections(),!w)for(var A=0;A=0&&I[d]==y;d--)++A;T=w.to;for(var d=1;d0){for(var I=0;I1&&arguments[1]!==void 0?arguments[1]:"",I=[],y=0;y4||((h=g.detail)===null||h===void 0?void 0:h.identity)===void 0||((E=g.detail)===null||E===void 0?void 0:E.shixun_status)===2||((v=g.detail)===null||v===void 0?void 0:v.shixun_status)===1);return O.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(w.a.wrap)},O.a.createElement(X.a,{gutter:[20,20],align:"middle"},O.a.createElement(_.a,{flex:1},O.a.createElement("span",{className:w.a.icons},O.a.createElement("img",{src:k.d,width:"14"})),O.a.createElement("span",{className:"font16"},"\u7B2C ",u==null?void 0:u.position," \u5173\uFF1A",a)),O.a.createElement(_.a,null,(u==null?void 0:u.prev_challenge)&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var H,V=u.prev_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(m.id,"/challenges/").concat(u==null||((H=u.prev_challenge)===null||H===void 0)?void 0:H.id).concat(V);y.d.replace($)}},"\u4E0A\u4E00\u5173"),u.next_challenge&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var H,V=u.next_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(m.id,"/challenges/").concat(u==null||((H=u.next_challenge)===null||H===void 0)?void 0:H.id).concat(V);y.d.replace($)}},"\u4E0B\u4E00\u5173"),C&&O.a.createElement(Q.a,{type:"primary"},O.a.createElement(T.a,{to:"/shixuns/".concat(m.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),C&&O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(T.a,{to:"/shixuns/".concat(m.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(T.a,{to:"/shixuns/".concat(m.id,"/challenges")},"\u8FD4\u56DE")))))};Le.a=Object(y.a)(function(d){var o=d.shixunsDetail,l=d.newCourse,h=d.loading,E=d.globalSetting;return{shixunsDetail:o,newCourse:l,globalSetting:E,loading:h.effects}})(A)},DlQD:function(Ie,Le,Z){(function(ie,X){Ie.exports=X()})(this,function(){"use strict";function ie(ge,de){for(var fe=0;fege.length)&&(de=ge.length);for(var fe=0,te=new Array(de);fe=ge.length?{done:!0}:{done:!1,value:ge[te++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return fe=ge[Symbol.iterator](),fe.next.bind(fe)}function _(ge,de){return de={exports:{}},ge(de,de.exports),de.exports}var G=_(function(ge){function de(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function fe(te){ge.exports.defaults=te}ge.exports={defaults:de(),getDefaults:de,changeDefaults:fe}}),j=G.defaults,O=G.getDefaults,I=G.changeDefaults,y=/[&<>"']/,T=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},A=function(de){return w[de]};function d(ge,de){if(de){if(y.test(ge))return ge.replace(T,A)}else if(k.test(ge))return ge.replace(D,A);return ge}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(ge){return ge.replace(o,function(de,fe){return fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""})}var h=/(^|[^\[])\^/g;function E(ge,de){ge=ge.source||ge,de=de||"";var fe={replace:function(re,ne){return ne=ne.source||ne,ne=ne.replace(h,"$1"),ge=ge.replace(re,ne),fe},getRegex:function(){return new RegExp(ge,de)}};return fe}var v=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(ge,de,fe){if(ge){var te;try{te=decodeURIComponent(l(fe)).replace(v,"").toLowerCase()}catch(re){return null}if(te.indexOf("javascript:")===0||te.indexOf("vbscript:")===0||te.indexOf("data:")===0)return null}de&&!g.test(fe)&&(fe=a(de,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(re){return null}return fe}var x={},p=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(ge,de){x[" "+ge]||(p.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(u,"$1")+de:ge+de}var b={exec:function(){}};function m(ge){for(var de=1,fe,te;de=0&&me[_e]==="\\";)Te=!Te;return Te?"|":" |"}),te=fe.split(/ \|/),re=0;if(te.length>de)te.splice(de);else for(;te.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 ue=re[re.length-1];if(ue&&ue.type==="paragraph")return{raw:ne[0],text:ne[0].trimRight()};var me=ne[0].replace(/^ {4}/gm,"");return{type:"code",raw:ne[0],codeBlockStyle:"indented",text:this.options.pedantic?me:U(me,` `)}}},de.fences=function(te){var re=this.rules.block.fences.exec(te);if(re){var ne=re[0],ue=Me(ne,re[3]||"");return{type:"code",raw:ne,lang:re[2]?re[2].trim():re[2],text:ue}}},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 ue=ne.align.length,me;for(me=0;me ?/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],ue=re[2],me=ue.length>1,Te=ue[ue.length-1]===")",_e={type:"list",raw:ne,ordered:me,start:me?+ue.slice(0,-1):"",loose:!1,items:[]},ot=re[0].match(this.rules.block.item),gt=!1,pt,Tt,St,ht,Ut,Mt,Jt,Qt=ot.length,It=0;It1||this.options.smartLists&&St!==ue)&&(ht=ot.slice(It+1).join(` `),_e.raw=_e.raw.substring(0,_e.raw.length-ht.length),It=Qt-1)),Ut=gt||/\n\n(?!\s*$)/.test(pt),It!==Qt-1&&(gt=pt.charAt(pt.length-1)===` `,Ut||(Ut=gt)),Ut&&(_e.loose=!0),Mt=/^\[[ xX]\] /.test(pt),Jt=void 0,Mt&&(Jt=pt[1]!==" ",pt=pt.replace(/^\[[ xX]\] +/,"")),_e.items.push({type:"list_item",raw:ne,task:Mt,checked:Jt,loose:Ut,text:pt});return _e}},de.html=function(te){var re=this.rules.block.html.exec(te);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):oe(re[0]):re[0]}},de.def=function(te){var re=this.rules.block.def.exec(te);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var ne=re[1].toLowerCase().replace(/\s+/g," ");return{tag:ne,raw:re[0],href:re[2],title:re[3]}}},de.table=function(te){var re=this.rules.block.table.exec(te);if(re){var ne={type:"table",header:ee(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(` `):[]};if(ne.header.length===ne.align.length){ne.raw=re[0];var ue=ne.align.length,me;for(me=0;me/i.test(ue[0])&&(re=!1),!ne&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?ne=!0:ne&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(ne=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:re,inRawBlock:ne,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):oe(ue[0]):ue[0]}},de.link=function(te){var re=this.rules.inline.link.exec(te);if(re){var ne=ce(re[2],"()");if(ne>-1){var ue=re[0].indexOf("!")===0?5:4,me=ue+re[1].length+ne;re[2]=re[2].substring(0,ne),re[0]=re[0].substring(0,me).trim(),re[3]=""}var Te=re[2],_e="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Te);ot?(Te=ot[1],_e=ot[3]):_e=""}else _e=re[3]?re[3].slice(1,-1):"";Te=Te.trim().replace(/^<([\s\S]*)>$/,"$1");var gt=ve(re,{href:Te&&Te.replace(this.rules.inline._escapes,"$1"),title:_e&&_e.replace(this.rules.inline._escapes,"$1")},re[0]);return gt}},de.reflink=function(te,re){var ne;if((ne=this.rules.inline.reflink.exec(te))||(ne=this.rules.inline.nolink.exec(te))){var ue=(ne[2]||ne[1]).replace(/\s+/g," ");if(ue=re[ue.toLowerCase()],!ue||!ue.href){var me=ne[0].charAt(0);return{type:"text",raw:me,text:me}}var Te=ve(ne,ue,ne[0]);return Te}},de.strong=function(te,re,ne){ne===void 0&&(ne="");var ue=this.rules.inline.strong.start.exec(te);if(ue&&(!ue[1]||ue[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){re=re.slice(-1*te.length);var me=ue[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;me.lastIndex=0;for(var Te;(ue=me.exec(re))!=null;)if(Te=this.rules.inline.strong.middle.exec(re.slice(0,ue.index+3)),Te)return{type:"strong",raw:te.slice(0,Te[0].length),text:te.slice(2,Te[0].length-2)}}},de.em=function(te,re,ne){ne===void 0&&(ne="");var ue=this.rules.inline.em.start.exec(te);if(ue&&(!ue[1]||ue[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){re=re.slice(-1*te.length);var me=ue[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;me.lastIndex=0;for(var Te;(ue=me.exec(re))!=null;)if(Te=this.rules.inline.em.middle.exec(re.slice(0,ue.index+2)),Te)return{type:"em",raw:te.slice(0,Te[0].length),text:te.slice(1,Te[0].length-1)}}},de.codespan=function(te){var re=this.rules.inline.code.exec(te);if(re){var ne=re[2].replace(/\n/g," "),ue=/[^ ]/.test(ne),me=ne.startsWith(" ")&&ne.endsWith(" ");return ue&&me&&(ne=ne.substring(1,ne.length-1)),ne=oe(ne,!0),{type:"codespan",raw:re[0],text:ne}}},de.br=function(te){var re=this.rules.inline.br.exec(te);if(re)return{type:"br",raw:re[0]}},de.del=function(te){var re=this.rules.inline.del.exec(te);if(re)return{type:"del",raw:re[0],text:re[1]}},de.autolink=function(te,re){var ne=this.rules.inline.autolink.exec(te);if(ne){var ue,me;return ne[2]==="@"?(ue=oe(this.options.mangle?re(ne[1]):ne[1]),me="mailto:"+ue):(ue=oe(ne[1]),me=ue),{type:"link",raw:ne[0],text:ue,href:me,tokens:[{type:"text",raw:ue,text:ue}]}}},de.url=function(te,re){var ne;if(ne=this.rules.inline.url.exec(te)){var ue,me;if(ne[2]==="@")ue=oe(this.options.mangle?re(ne[0]):ne[0]),me="mailto:"+ue;else{var Te;do Te=ne[0],ne[0]=this.rules.inline._backpedal.exec(ne[0])[0];while(Te!==ne[0]);ue=oe(ne[0]),ne[1]==="www."?me="http://"+ue:me=ue}return{type:"link",raw:ne[0],text:ue,href:me,tokens:[{type:"text",raw:ue,text:ue}]}}},de.inlineText=function(te,re,ne){var ue=this.rules.inline.text.exec(te);if(ue){var me;return re?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):oe(ue[0]):ue[0]:me=oe(this.options.smartypants?ne(ue[0]):ue[0]),{type:"text",raw:ue[0],text:me}}},ge}(),Ae=$.noopTest,Ee=$.edit,Ce=$.merge,pe={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ae,table:Ae,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Ee(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Ee(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Ee(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pe._comment=//,pe.html=Ee(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Ee(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.blockquote=Ee(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Ce({},pe),pe.gfm=Ce({},pe.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),pe.gfm.nptable=Ee(pe.gfm.nptable).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.gfm.table=Ee(pe.gfm.table).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.pedantic=Ce({},pe.normal,{html:Ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ae,paragraph:Ee(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ae,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:Ae,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",se.punctuation=Ee(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=Ee(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=Ee(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=Ee(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=Ee(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=Ee(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=Ee(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=Ee(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=Ee(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=Ee(se._blockSkip,"g").getRegex(),se.overlapSkip=Ee(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=Ee(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=Ee(se.tag).replace("comment",pe._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=Ee(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=Ee(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=Ee(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=Ce({},se),se.pedantic=Ce({},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:Ee(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:Ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=Ce({},se.normal,{escape:Ee(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]*?(?:(?=[\\.5&&(te="x"+te.toString(16)),de+="&#"+te+";";return de}var Oe=function(){function ge(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||ze,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var te={block:We.normal,inline:Ke.normal};this.options.pedantic?(te.block=We.pedantic,te.inline=Ke.pedantic):this.options.gfm&&(te.block=We.gfm,this.options.breaks?te.inline=Ke.breaks:te.inline=Ke.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 ue,me,Te,_e;te;){if(ue=this.tokenizer.space(te)){te=te.substring(ue.raw.length),ue.type&&re.push(ue);continue}if(ue=this.tokenizer.code(te,re)){te=te.substring(ue.raw.length),ue.type?re.push(ue):(_e=re[re.length-1],_e.raw+=` `+ue.raw,_e.text+=` `+ue.text);continue}if(ue=this.tokenizer.fences(te)){te=te.substring(ue.raw.length),re.push(ue);continue}if(ue=this.tokenizer.heading(te)){te=te.substring(ue.raw.length),re.push(ue);continue}if(ue=this.tokenizer.nptable(te)){te=te.substring(ue.raw.length),re.push(ue);continue}if(ue=this.tokenizer.hr(te)){te=te.substring(ue.raw.length),re.push(ue);continue}if(ue=this.tokenizer.blockquote(te)){te=te.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],ne),re.push(ue);continue}if(ue=this.tokenizer.list(te)){for(te=te.substring(ue.raw.length),Te=ue.items.length,me=0;me0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(_e))!=null;)gt.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(_e=_e.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+_e.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(_e))!=null;)_e=_e.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+_e.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;te;){if(Te=this.tokenizer.escape(te)){te=te.substring(Te.raw.length),re.push(Te);continue}if(Te=this.tokenizer.tag(te,ne,ue)){te=te.substring(Te.raw.length),ne=Te.inLink,ue=Te.inRawBlock,re.push(Te);continue}if(Te=this.tokenizer.link(te)){te=te.substring(Te.raw.length),Te.type==="link"&&(Te.tokens=this.inlineTokens(Te.text,[],!0,ue)),re.push(Te);continue}if(Te=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(Te.raw.length),Te.type==="link"&&(Te.tokens=this.inlineTokens(Te.text,[],!0,ue)),re.push(Te);continue}if(Te=this.tokenizer.strong(te,_e,me)){te=te.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],ne,ue),re.push(Te);continue}if(Te=this.tokenizer.em(te,_e,me)){te=te.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],ne,ue),re.push(Te);continue}if(Te=this.tokenizer.codespan(te)){te=te.substring(Te.raw.length),re.push(Te);continue}if(Te=this.tokenizer.br(te)){te=te.substring(Te.raw.length),re.push(Te);continue}if(Te=this.tokenizer.del(te)){te=te.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],ne,ue),re.push(Te);continue}if(Te=this.tokenizer.autolink(te,Se)){te=te.substring(Te.raw.length),re.push(Te);continue}if(!ne&&(Te=this.tokenizer.url(te,Se))){te=te.substring(Te.raw.length),re.push(Te);continue}if(Te=this.tokenizer.inlineText(te,ue,Ye)){te=te.substring(Te.raw.length),me=Te.raw.slice(-1),re.push(Te);continue}if(te){var pt="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(pt);break}else throw new Error(pt)}}return re},X(ge,null,[{key:"rules",get:function(){return{block:We,inline:Ke}}}]),ge}(),Ue=G.defaults,Xe=$.cleanUrl,Qe=$.escape,je=function(){function ge(fe){this.options=fe||Ue}var de=ge.prototype;return de.code=function(te,re,ne){var ue=(re||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(te,ue);me!=null&&me!==te&&(ne=!0,te=me)}return ue?'
    '+(ne?te:Qe(te,!0))+`
    `:"
    "+(ne?te:Qe(te,!0))+`
    `},de.blockquote=function(te){return`
    `+te+`
    `},de.html=function(te){return te},de.heading=function(te,re,ne,ue){return this.options.headerIds?"'+te+" `:""+te+" `},de.hr=function(){return this.options.xhtml?`
    `:`
    `},de.list=function(te,re,ne){var ue=re?"ol":"ul",me=re&&ne!==1?' start="'+ne+'"':"";return"<"+ue+me+`> `+te+" `},de.listitem=function(te){return"
  • "+te+`
  • `},de.checkbox=function(te){return" "},de.paragraph=function(te){return"

    "+te+`

    `},de.table=function(te,re){return re&&(re=""+re+""),` `+te+` `+re+`
    `},de.tablerow=function(te){return` `+te+` `},de.tablecell=function(te,re){var ne=re.header?"th":"td",ue=re.align?"<"+ne+' align="'+re.align+'">':"<"+ne+">";return ue+te+" `},de.strong=function(te){return""+te+""},de.em=function(te){return""+te+""},de.codespan=function(te){return""+te+""},de.br=function(){return this.options.xhtml?"
    ":"
    "},de.del=function(te){return""+te+""},de.link=function(te,re,ne){if(te=Xe(this.options.sanitize,this.options.baseUrl,te),te===null)return ne;var ue='",ue},de.image=function(te,re,ne){if(te=Xe(this.options.sanitize,this.options.baseUrl,te),te===null)return ne;var ue=''+ne+'":">",ue},de.text=function(te){return te},ge}(),Be=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}(),it=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}(),Ze=G.defaults,qe=$.unescape,tt=function(){function ge(fe){this.options=fe||Ze,this.options.renderer=this.options.renderer||new je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new it}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="",ue,me,Te,_e,ot,gt,pt,Tt,St,ht,Ut,Mt,Jt,Qt,It,_r,Kr,Et,Br=te.length;for(ue=0;ue0&&It.tokens[0].type==="text"?(It.tokens[0].text=Et+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=Et+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:Et}):Qt+=Et),Qt+=this.parse(It.tokens,Jt),St+=this.renderer.listitem(Qt,Kr,_r);ne+=this.renderer.list(St,Ut,Mt);continue}case"html":{ne+=this.renderer.html(ht.text);continue}case"paragraph":{ne+=this.renderer.paragraph(this.parseInline(ht.tokens));continue}case"text":{for(St=ht.tokens?this.parseInline(ht.tokens):ht.text;ue+1An error occurred:

    "+nt(Te.message+"",!0)+"
    ";throw Te}}Re.options=Re.setOptions=function(ge){return dt(Re.defaults,ge),ut(Re.defaults),Re},Re.getDefaults=we,Re.defaults=at,Re.use=function(ge){var de=dt({},ge);if(ge.renderer&&function(){var te=Re.defaults.renderer||new je,re=function(me){var Te=te[me];te[me]=function(){for(var _e=arguments.length,ot=new Array(_e),gt=0;gt<_e;gt++)ot[gt]=arguments[gt];var pt=ge.renderer[me].apply(te,ot);return pt===!1&&(pt=Te.apply(te,ot)),pt}};for(var ne in ge.renderer)re(ne);de.renderer=te}(),ge.tokenizer&&function(){var te=Re.defaults.tokenizer||new xe,re=function(me){var Te=te[me];te[me]=function(){for(var _e=arguments.length,ot=new Array(_e),gt=0;gt<_e;gt++)ot[gt]=arguments[gt];var pt=ge.tokenizer[me].apply(te,ot);return pt===!1&&(pt=Te.apply(te,ot)),pt}};for(var ne in ge.tokenizer)re(ne);de.tokenizer=te}(),ge.walkTokens){var fe=Re.defaults.walkTokens;de.walkTokens=function(te){ge.walkTokens(te),fe&&fe(te)}}Re.setOptions(de)},Re.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),ue;!(ue=ne()).done;){var me=ue.value;Re.walkTokens(me,de)}for(var Te=B(re.tokens.cells),_e;!(_e=Te()).done;)for(var ot=_e.value,gt=B(ot),pt;!(pt=gt()).done;){var Tt=pt.value;Re.walkTokens(Tt,de)}break}case"list":{Re.walkTokens(re.items,de);break}default:re.tokens&&Re.walkTokens(re.tokens,de)}}},Re.Parser=tt,Re.parser=tt.parse,Re.Renderer=je,Re.TextRenderer=Be,Re.Lexer=Oe,Re.lexer=Oe.lex,Re.Tokenizer=xe,Re.Slugger=it,Re.parse=Re;var He=Re;return He})},E3HF:function(Ie,Le,Z){Ie.exports={flex_box_center:"flex_box_center___9yD0l",flex_space_between:"flex_space_between___12_t1",flex_box_vertical_center:"flex_box_vertical_center____RzXy",flex_box_center_end:"flex_box_center_end___w5V55",flex_box_column:"flex_box_column___1O69H",bg:"bg___1SAB4",flexRow:"flexRow___TGonw",flexJustifyCenter:"flexJustifyCenter___FdZYv",flexAlignEnd:"flexAlignEnd___2MQGW",flexAlingCenter:"flexAlingCenter___HR4pS",flexAlignCenter:"flexAlignCenter___2tpRP",flexColumn:"flexColumn___2x5QM",formWrap:"formWrap___3nPVX",titleWrap:"titleWrap___2I_px",fieldWrap:"fieldWrap___q51w8",mdWrap:"mdWrap___1_3Z7",backgroundFa:"backgroundFa___3eVc8",button:"button___BK_yA",icons:"icons___FzVfz",navBar:"navBar___3G5De",active:"active___15cJu",tipWrap:"tipWrap___20yI4",tip:"tip___2Y6MS",width300:"width300___-1o3l",popover:"popover___2-F6L",groupWrap:"groupWrap___2_3AK"}},E7E6:function(Ie,Le){Ie.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW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ZYLp4DRF9snLQSjUZvjsViS4Wg26SUVi++NiYNjuWKBIQQR6Wkl30+3/q6urq3hBBXb+J3pSTZM/E0IMnFj0Qi10kp/4QotphILJJSjs1eRY6RbwkIIU4SyRYi32YhxBv19fUD9yLku3BZ8i8oQJLrcurUiWt6e8Wi3l7CyBiO8JvicXkXS/EOEokWv582+/2ypaZm3IFCrXhBA5Is9La2trqenp6biGi2lJhv0eZcxhVq4xRIuU8Qid1CCKyB31VSUrK1trY2WiBlz1rMQQVIqtpeuHBidEcHzZIy/iLSXtfyWrGsupEQIb7WiT4iot1CxF9Dh9LuESPGnTGXUmHFHvSApGoOzLm0tbU19vb2TpVSThGCphLJKVLSVCFoYrHCAwikpCNC0MdE4qCU9LEQ4qDf7/+4trb2aN/cRGFpeI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(Ie,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){var X={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},R=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(w,A,d){d&&d!=ie.Init&&(w.removeKeyMap(B),w.state.closeBrackets=null),A&&(_(Q(A,"pairs")),w.state.closeBrackets=A,w.addKeyMap(B))});function Q(w,A){return A=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[A]!=null?w[A]:X[A]}var B={Backspace:O,Enter:I};function _(w){for(var A=0;A=0;l--){var E=o[l].head;w.replaceRange("",R(E.line,E.ch-1),R(E.line,E.ch+1),"+delete")}}function I(w){var A=j(w),d=A&&Q(A,"explode");if(!d||w.getOption("disableInput"))return ie.Pass;for(var o=w.listSelections(),l=0;l0;return{anchor:new R(w.anchor.line,w.anchor.ch+(A?-1:1)),head:new R(w.head.line,w.head.ch+(A?1:-1))}}function T(w,A){var d=j(w);if(!d||w.getOption("disableInput"))return ie.Pass;var o=Q(d,"pairs"),l=o.indexOf(A);if(l==-1)return ie.Pass;for(var h=Q(d,"closeBefore"),E=Q(d,"triples"),v=o.charAt(l+1)==A,g=w.listSelections(),L=l%2==0,x,p=0;p=0&&w.getRange(u,R(u.line,u.ch+3))==A+A+A?a="skipThree":a="skip";else if(v&&u.ch>1&&E.indexOf(A)>=0&&w.getRange(R(u.line,u.ch-2),u)==A+A){if(u.ch>2&&/\bstring/.test(w.getTokenTypeAt(R(u.line,u.ch-2))))return ie.Pass;a="addFour"}else if(v){var m=u.ch==0?" ":w.getRange(R(u.line,u.ch-1),u);if(!ie.isWordChar(b)&&m!=A&&!ie.isWordChar(m))a="both";else return ie.Pass}else if(L&&(b.length===0||/\s/.test(b)||h.indexOf(b)>-1))a="both";else return ie.Pass;if(!x)x=a;else if(x!=a)return ie.Pass}var C=l%2?o.charAt(l-1):A,P=l%2?A:o.charAt(l+1);w.operation(function(){if(x=="skip")w.execCommand("goCharRight");else if(x=="skipThree")for(var H=0;H<3;H++)w.execCommand("goCharRight");else if(x=="surround"){for(var V=w.getSelections(),H=0;H1&&arguments[1]!==void 0?arguments[1]:1,fe=Be.length,te=0;te1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(U).map(function(oe,ce){if(!B.isValidElement(oe)||!oe.type)return null;var ve=oe.type.isSelectOptGroup,Me=oe.key,xe=oe.props,Ae=xe.children,Ee=Object(G.a)(xe,["children"]);return ee||!ve?x(oe):Object(g.a)(Object(g.a)({key:"__RC_SELECT_GRP__".concat(Me===null?ce:Me,"__"),label:Me},Ee),{},{options:p(Ae)})}).filter(function(oe){return oe})}var c=Z("2Qr1"),u=Z("qNPg"),a=Z("U8pU"),b=Z("Kwbf"),m=Z("WKfj");function C(U){var ee=U.mode,oe=U.options,ce=U.children,ve=U.backfill,Me=U.allowClear,xe=U.placeholder,Ae=U.getInputElement,Ee=U.showSearch,Ce=U.onSearch,pe=U.defaultOpen,se=U.autoFocus,De=U.labelInValue,ze=U.value,We=U.inputValue,Ke=U.optionLabelProp,Ye=ee==="multiple"||ee==="tags",Se=Ee!==void 0?Ee:Ye||ee==="combobox",Oe=oe||p(ce);if(Object(b.a)(ee!=="tags"||Oe.every(function(je){return!je.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ee==="tags"||ee==="combobox"){var Ue=Oe.some(function(je){return je.options?je.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in je?je.value:je.key)=="number"});Object(b.a)(!Ue,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(ee!=="combobox"||!Ke,"`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"||!Ae,"`getInputElement` only work with `combobox` mode."),Object(b.b)(ee!=="combobox"||!Ae||!Me||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ce&&!Se&&ee!=="combobox"&&ee!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!pe||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ze!=null){var Xe=Object(m.d)(ze);Object(b.a)(!De||Xe.every(function(je){return Object(a.a)(je)==="object"&&("key"in je||"value"in je)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Ye||Array.isArray(ze),"`value` should be array when `mode` is `multiple` or `tags`")}if(ce){var Qe=null;Object(L.a)(ce).some(function(je){if(!B.isValidElement(je)||!je.type)return!1;var Be=je.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var it=Object(L.a)(je.props.children).every(function(Ze){return!B.isValidElement(Ze)||!je.type||Ze.type.isSelectOption?!0:(Qe=Ze.type,!1)});return!it}return Qe=Be,!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=C,H=Object(u.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:p,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:P,fillOptionsWithMissingValue:c.a}),V=function(U){Object(R.a)(oe,U);var ee=Object(Q.a)(oe);function oe(){var ce;return Object(ie.a)(this,oe),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(X.a)(oe,[{key:"render",value:function(){return B.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),oe}(B.Component);V.Option=h,V.OptGroup=v;var $=V,z=Le.c=$},M8RZ:function(Ie,Le,Z){"use strict";Z.d(Le,"a",function(){return O});var ie=Z("fWQN"),X=Z("mtLc"),R=Z("yKVA"),Q=Z("879j"),B=Z("q1tI"),_=Z.n(B),G=Z("i8i4"),j=Z.n(G),O=function(I){Object(R.a)(T,I);var y=Object(Q.a)(T);function T(k){var D;Object(ie.a)(this,T),D=y.call(this,k);var w=window.document;return D.node=w.createElement("div"),w.body.appendChild(D.node),D}return Object(X.a)(T,[{key:"render",value:function(){var D=this.props.children;return Object(G.createPortal)(D,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),T}(_.a.Component)},Nmxd:function(Ie,Le){Ie.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthg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YFJ7jUDnC7UHU1iz7qurxBlmDlrxlb5Pl5z8iC8LIVuHmjoueEtqjvddBwDa6JWHCQlnwyjjAu7wtxjPRK+4Ta7Y6XPskpvDqJLUdoMdTWTJOX9kWs+2bL9pN89U3GTdn3WKKxpvTmRuWglmPpKOtK91IiQ73vvJFL/YCa5UbLaVaDzXXTP2p4tmjvGREYnbruOgrn7MwKvlEg9gvLpG1E2000ntKNh5O82EznQobvkVF9S732LIgus6rg0RHTNCsdYJA7oWB7jLJdlOIxzfUwwbTHY+zSy+ccldAkbtRjimThroCYAzA46bqUl6JmxOh+IH8mbq1K65NXLuIIAnymqAMQbyNRrhtvT0qkQgqe4lRof7RHKdEe6Y9XEe0NVDBLzsnrMwcmbp/rOs8lXPQtzODHhY+/9LEq0aCcV0M22wX21jge5yiwdwGVW+RuPZnGUVM9FkP+NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},OLES:function(Ie,Le,Z){"use strict";var ie=Z("U8pU"),X=Z("VTBJ"),R=Z("Ff2n"),Q=Z("q1tI"),B=Z("uciX"),_=Z("7ixt"),G=function(k){var D=k.overlay,w=k.prefixCls,A=k.id,d=k.overlayInnerStyle;return Q.createElement("div",{className:"".concat(w,"-inner"),id:A,role:"tooltip",style:d},typeof D=="function"?D():D)},j=G,O=function(k,D){var w=k.overlayClassName,A=k.trigger,d=A===void 0?["hover"]:A,o=k.mouseEnterDelay,l=o===void 0?0:o,h=k.mouseLeaveDelay,E=h===void 0?.1:h,v=k.overlayStyle,g=k.prefixCls,L=g===void 0?"rc-tooltip":g,x=k.children,p=k.onVisibleChange,c=k.afterVisibleChange,u=k.transitionName,a=k.animation,b=k.placement,m=b===void 0?"right":b,C=k.align,P=C===void 0?{}:C,H=k.destroyTooltipOnHide,V=H===void 0?!1:H,$=k.defaultVisible,z=k.getTooltipContainer,U=k.overlayInnerStyle,ee=Object(R.a)(k,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),oe=Object(Q.useRef)(null);Object(Q.useImperativeHandle)(D,function(){return oe.current});var ce=Object(X.a)({},ee);"visible"in k&&(ce.popupVisible=k.visible);var ve=function(){var Ce=k.arrowContent,pe=Ce===void 0?null:Ce,se=k.overlay,De=k.id;return[Q.createElement("div",{className:"".concat(L,"-arrow"),key:"arrow"},pe),Q.createElement(j,{key:"content",prefixCls:L,id:De,overlay:se,overlayInnerStyle:U})]},Me=!1,xe=!1;if(typeof V=="boolean")Me=V;else if(V&&Object(ie.a)(V)==="object"){var Ae=V.keepParent;Me=Ae===!0,xe=Ae===!1}return Q.createElement(B.a,Object.assign({popupClassName:w,prefixCls:L,popup:ve,action:d,builtinPlacements:_.a,popupPlacement:m,ref:oe,popupAlign:P,getPopupContainer:z,onPopupVisibleChange:p,afterPopupVisibleChange:c,popupTransitionName:u,popupAnimation:a,defaultPopupVisible:$,destroyPopupOnHide:Me,autoDestroy:xe,mouseLeaveDelay:E,popupStyle:v,mouseEnterDelay:l},ce),x)},I=Object(Q.forwardRef)(O),y=Le.a=I},Ohmc:function(Ie,Le,Z){Ie.exports=Z.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Ie,Le,Z){"use strict";var ie=Z("2qtc"),X=Z("kLXV"),R=Z("rAM+"),Q=Z("miYZ"),B=Z("tsqr"),_=Z("9og8"),G=Z("tJVT"),j=Z("jrin"),O=Z("WmNS"),I=Z.n(O),y=Z("q1tI"),T=Z.n(y),k=Z("VrN/"),D=Z.n(k),w=Z("bdgK"),A=Z("p77/"),d=Z("Bd2K"),o=Z("ELLl"),l=Z("19Vz"),h=Z("lZu9"),E=Z("+NIl"),v=Z("kSUc"),g=Z("9Bee"),L=function(me){var Te=me.value,_e=Te===void 0?"":Te,ot=me.className,gt=me.showTextOnly,pt=me.showLines,Tt=me.style,St=Tt===void 0?{}:Tt,ht=Object(y.useMemo)(function(){return""},[_e]);return T.a.createElement(T.a.Fragment,null,T.a.createElement("div",{dangerouslySetInnerHTML:{__html:ht}}))},x=Z("0Owb"),p=Z("dejd"),c=Z("C+DQ"),u=Z("1vsH"),a=Z("m3rI"),b=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function m(me){var Te=me.onActionCallback,_e=me.title,ot=me.icon,gt=me.actionName,pt=me.className,Tt=pt===void 0?"":pt,St=me.children;function ht(){Te(gt)}return T.a.createElement("a",{title:_e,className:Tt,onClick:ht},T.a.createElement("i",{className:"md-iconfont ".concat(ot)}),St)}var C=function(me){var Te=me.watch,_e=me.showNullButton,ot=me.onActionCallback,gt=me.fullScreen,pt=me.insertTemp,Tt=me.hidetoolBar,St=me.uuid,ht=me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(u.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(u.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Ut=[].concat(b,[{title:"".concat(Te?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Te?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return T.a.createElement("ul",{className:"markdown-toolbar-container"},!Tt&&Ut.map(function(Mt,Jt){return T.a.createElement("li",{key:Jt},Mt.actionName?T.a.createElement(m,Object(x.a)({},Mt,{onActionCallback:ot})):T.a.createElement("span",{className:"v-line"}))}),_e?T.a.createElement("li",null,T.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},T.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,pt&&T.a.createElement("li",null,T.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(pt),onActionCallback:ot},T.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),T.a.createElement("li",{className:"btn-full-screen"},T.a.createElement(m,{icon:"".concat(gt?"icon-shrink":"icon-enlarge"),title:gt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},P=Z("M8RZ"),H=Z("+L6B"),V=Z("2/Rp"),$=Z("y8nQ"),z=Z("Vl3Y"),U=Z("5NDa"),ee=Z("5rEg"),oe={labelCol:{span:4},wrapperCol:{span:20}},ce=function(me){var Te=me.callback,_e=me.onCancel;function ot(gt){Te(gt)}return T.a.createElement(z.a,Object(x.a)({},oe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),T.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},T.a.createElement(ee.a,null)),T.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},T.a.createElement(ee.a,null)),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(V.a,{type:"ghost",onClick:_e},"\u53D6\u6D88")))},ve=Z("7ahc"),Me=Z("HmJG"),xe=Z("BjJ7"),Ae=z.a.useForm,Ee={width:280,marginRight:10},Ce={labelCol:{span:5},wrapperCol:{span:19}},pe=function(me){var Te=me.callback,_e=me.onCancel,ot=Ae(),gt=Object(G.a)(ot,1),pt=gt[0];function Tt(Ut){Te(Ut)}function St(Ut,Mt){if(Ut.status===-1){B.b.error(Ut.message);return}pt.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Mt.type})}function ht(Ut){var Mt=Ut.target.files[0];De(Mt,St)}return T.a.createElement(z.a,Object(x.a)({form:pt},Ce,{className:"upload-image-panel",onFinish:Tt}),T.a.createElement(z.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},T.a.createElement("div",{className:"flex-container"},T.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},T.a.createElement(ee.a,{style:Ee})),T.a.createElement(se,{onFileChange:ht}))),T.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},T.a.createElement(ee.a,{style:{width:264}})),T.a.createElement(z.a.Item,{style:{textAlign:"right"}},T.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(V.a,{type:"ghost",onClick:_e},"\u53D6\u6D88")))};function se(me){var Te=me.onFileChange;return T.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",T.a.createElement("input",{type:"file",onChange:Te}))}function De(me,Te){if(!me)throw new String("\u6CA1\u6709\u6587\u4EF6");var _e=new FormData;_e.append("editormd-image-file",me),_e.append("file_param_name","editormd-image-file"),_e.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(gt){Te(JSON.parse(gt.target.responseText),me)},!1),ot.addEventListener("error",function(gt){console.error(gt)},!1),ot.open("POST","".concat(xe.a,"/api/attachments.json")),ot.send(_e)}var ze=Z("giR+"),We=Z("fyUT"),Ke=Z("7Kak"),Ye=Z("9yH6"),Se=Ye.a.Group,Oe={margin:"0 8px"},Ue=function(me){var Te=me.callback,_e=me.onCancel;function ot(gt){Te(gt)}return T.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},T.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},T.a.createElement("span",{style:Oe},"\u5355\u5143\u683C\u6570\uFF1A"),T.a.createElement("span",{style:Oe},"\u884C\u6570"),T.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},T.a.createElement(We.a,null)),T.a.createElement("span",{style:Oe},"\u5217\u6570"),T.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},T.a.createElement(We.a,null))),T.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},T.a.createElement("span",{style:Oe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),T.a.createElement(z.a.Item,{name:"align"},T.a.createElement(Se,null,T.a.createElement(Ye.a,{value:"default"},T.a.createElement("i",{className:"fa fa-align-justify"})),T.a.createElement(Ye.a,{value:"left"},T.a.createElement("i",{className:"fa fa-align-left"})),T.a.createElement(Ye.a,{value:"center"},T.a.createElement("i",{className:"fa fa-align-center"})),T.a.createElement(Ye.a,{value:"right"},T.a.createElement("i",{className:"fa fa-align-right"}))))),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(V.a,{type:"ghost",onClick:_e},"\u53D6\u6D88")))},Xe=Z("ErOA"),Qe=Z("7Cbv"),je="link",Be="upload-image",it="code-block",Ze="add-table",qe="------------",tt={default:qe,left:":".concat(qe),center:":".concat(qe,":"),right:"".concat(qe,":")},dt=Z("9VGf"),rt,nt;function we(){}var ut=0,at=1e4,Re="\u2581",He=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function ge(me){return/^\d+$/.test(me)?"".concat(me,"px"):me}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=de?"Cmd":"Ctrl",te=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],re=(rt={},Object(j.a)(rt,fe+"-B","bold"),Object(j.a)(rt,fe+"-I","italic"),rt),ne=(nt={},Object(j.a)(nt,je,"\u6DFB\u52A0\u94FE\u63A5"),Object(j.a)(nt,it,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(j.a)(nt,Be,"\u6DFB\u52A0\u6587\u4EF6"),Object(j.a)(nt,Ze,"\u6DFB\u52A0\u8868\u683C"),nt),ue=Le.a=function(me){var Te=me.defaultValue,_e=Te===void 0?"":Te,ot=me.onChange,gt=me.width,pt=gt===void 0?"100%":gt,Tt=me.height,St=Tt===void 0?400:Tt,ht=me.miniToolbar,Ut=ht===void 0?!1:ht,Mt=me.isFocus,Jt=Mt===void 0?!1:Mt,Qt=me.watch,It=me.insertTemp,_r=me.mode,Kr=_r===void 0?"markdown":_r,Et=me.id,Br=Et===void 0?"markdown-editor-id":Et,hr=me.showResizeBar,pr=hr===void 0?!1:hr,Nr=me.noStorage,ci=Nr===void 0?!1:Nr,$r=me.showNullButton,_t=$r===void 0?!1:$r,ct=me.hidetoolBar,Hr=ct===void 0?!1:ct,ei=me.fullScreen,mr=ei===void 0?!1:ei,Lt=me.onBlur,Ur=me.onCMBeforeChange,Vr=me.onFullScreen,fi=me.className,Ge=fi===void 0?"":fi,Ct=me.disablePaste,pi=Ct===void 0?!1:Ct,mi=me.placeholder,gi=mi===void 0?"":mi,vi=me.values,W=vi===void 0?"":vi,s=Object(y.useState)(null),f=Object(G.a)(s,2),M=f[0],J=f[1],F=Object(y.useState)(_e),he=Object(G.a)(F,2),Pe=he[0],Je=he[1],ft=Object(y.useState)(Qt),Ne=Object(G.a)(ft,2),yt=Ne[0],Bt=Ne[1],Kt=Object(y.useState)(mr),Ir=Object(G.a)(Kt,2),gr=Ir[0],vr=Ir[1],Qr=Object(y.useState)(""),Ii=Object(G.a)(Qr,2),nr=Ii[0],Fr=Ii[1],oi=Object(y.useState)(0),si=Object(G.a)(oi,2),Mr=si[0],Mi=si[1],yi=Object(y.useState)(St),zi=Object(G.a)(yi,2),Ki=zi[0],Yr=zi[1],Gr=Object(y.useState)(!1),bi=Object(G.a)(Gr,2),dn=bi[0],Ei=bi[1],Zt=Object(y.useRef)(Object(Qe.a)()),Nt=Object(y.useRef)(!1),dr=Object(y.useRef)(),Rt=Object(y.useRef)(),$t=Object(y.useRef)(),jt=Object(y.useRef)(),ti=Object(y.useRef)(),ar=function(){var mt=Object(_.a)(I.a.mark(function At(){var bt,Dt;return I.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(Xe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Zt.current}});case 2:Dt=Gt.sent,Dt!=null&&(bt=Dt.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",M,Rt),Dt.attachments.map(function(Ot){Ot.content_type.indexOf("image")>-1?M.replaceSelection("![,](/api/attachments/".concat(Ot.id,"?type=").concat(Ot.content_type,")")):Ot.content_type.indexOf("video")>-1?M.replaceSelection('')):Ot.content_type.indexOf("pdf")>-1?M.replaceSelection('
    ').concat(Ot.name,"")):M.replaceSelection("[".concat(Ot.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ot.id,"?type=").concat(Ot.content_type,")"))}));case 4:case"end":return Gt.stop()}},At)}));return function(){return mt.apply(this,arguments)}}();Object(y.useEffect)(function(){Je(W),M==null||M.setValue(W)},[W]),Object(y.useEffect)(function(){Vr==null||Vr(gr)},[gr]),Object(y.useEffect)(function(){if(Rt.current){var mt=D.a.fromTextArea(Rt.current,{mode:Kr,lineNumbers:!Ut,lineWrapping:!0,value:_e,autoCloseTags:!0,autoCloseBrackets:!0});Jt&&mt.focus();function At(bt,Dt){if(pi){Dt.preventDefault();return}var Pt=Dt.clipboardData;if(Pt){var Gt=Pt.types.toString(),Ot=Pt.items;if(Gt==="Files"||Pt.types.indexOf("Files")>-1){if(Dt.preventDefault(),Kr=="stex")return;try{var rr,Ar=Ot[1];((rr=Ot[0])===null||rr===void 0?void 0:rr.kind)==="file"&&(Ar=Ot[0]);var kt=Ar.getAsFile(),li=kt.name.split(".").pop();De(kt,function(Ft){if(Ft.id){var Tr,yr,zr;(kt==null||((Tr=kt.type)===null||Tr===void 0)?void 0:Tr.indexOf("image"))>-1?mt.replaceSelection("![,](/api/attachments/".concat(Ft.id,"?type=").concat(Ft.content_type,")")):(kt==null||((yr=kt.type)===null||yr===void 0)?void 0:yr.indexOf("video"))>-1?mt.replaceSelection('')):(kt==null||((zr=kt.type)===null||zr===void 0)?void 0:zr.indexOf("pdf"))>-1?mt.replaceSelection('').concat(kt.name,"")):te.includes(li)?mt.replaceSelection('').concat(kt.name,"")):mt.replaceSelection("[".concat(kt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Ft.content_type,")"))}else(Ft==null?void 0:Ft.status)===401&&(document.location.href="/user/login")})}catch(Ft){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return mt.on("paste",At),mt.on("dragleave",function(bt,Dt){$t.current.classList.remove("mouse-hover-md")}),mt.on("dragover",function(bt,Dt){$t.current.classList.add("mouse-hover-md")}),mt.on("drop",function(bt,Dt){$t.current.classList.add("mouse-hover-md");var Pt;if(Pt=Dt.dataTransfer.files,Pt.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Gt=function(Ar){var kt=Pt[Ar],li=kt.name.split(".").pop();De(kt,function(Ft){if(Ft.id){var Tr,yr,zr;(kt==null||((Tr=kt.type)===null||Tr===void 0)?void 0:Tr.indexOf("image"))>-1?mt.replaceSelection("![,](/api/attachments/".concat(Ft.id,"?type=").concat(Ft.content_type,")")):(kt==null||((yr=kt.type)===null||yr===void 0)?void 0:yr.indexOf("video"))>-1?mt.replaceSelection('')):(kt==null||((zr=kt.type)===null||zr===void 0)?void 0:zr.indexOf("pdf"))>-1?mt.replaceSelection('').concat(kt.name,"")):te.includes(li)?mt.replaceSelection('').concat(kt.name,"")):mt.replaceSelection("[".concat(kt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Ft.content_type,")"))}else(Ft==null?void 0:Ft.status)===401&&(document.location.href="/user/login")})},Ot=0;Ot0||Ot.target.offsetWidth>0)&&(xr(),M.setSize("100%","100%"),M.refresh())}}catch(rr){Pt.e(rr)}finally{Pt.f()}});return bt.observe(Rt.current.parentElement),bt}if(M){var At=mt();return function(){At.unobserve(Rt.current.parentElement)}}},[M,xr]),Object(y.useEffect)(function(){if(M){for(var mt=[],At=function(){var Ot=Dt[bt];Pt=Object(G.a)(Ot,2);var rr=Pt[0],Ar=Pt[1],kt=Object(j.a)({},rr,function(){Vi(Ar)});mt.push(kt),M.addKeyMap(kt)},bt=0,Dt=Object.entries(re);bt0){var mt=new Date().getTime(),At=window.sessionStorage.getItem(Br);mt>=Mr+at&&(!At||At!==Pe)&&(window.sessionStorage.setItem(Br,Pe),Ei(!0))}},at),Object(y.useEffect)(function(){Bt(Qt)},[M,Qt]),Object(y.useEffect)(function(){M&&(Jt&&M.focus())},[M,Jt]),Object(y.useEffect)(function(){if(yt&&M){var mt=M.getScrollerElement();function At(bt){var Dt=bt.target;if(ti.current){var Pt=Dt.scrollTop/Dt.scrollHeight;ti.current.scrollTop=ti.current.scrollHeight*Pt}}return mt.addEventListener("scroll",At),function(){mt.removeEventListener("scroll",At)}}},[M,yt]),Object(y.useEffect)(function(){if(M&&Ur){function mt(At,bt){Ur(At,bt)}return M.on("beforeChange",mt),function(){M.off("beforeChange",mt)}}},[M,Ur]),Object(y.useEffect)(function(){if(M&&Lt){function mt(){Lt(M.getValue())}return M.on("blur",mt),function(){M.off("blur",mt)}}},[M,Lt]),Object(y.useEffect)(function(){if(M){function mt(At){var bt=At.getValue();Je(bt),Mi(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(bt)}return M.on("change",mt),function(){M.off("change",mt)}}},[M,ot]),Object(y.useEffect)(function(){M&&(_e==null?(M.setValue(""),Je("")):_e!==M.getValue()&&(M.setValue(_e),Je(_e),M.setCursor(M.lineCount(),0)))},[M,_e]);var Vi=Object(y.useCallback)(function(mt){var At=M.getCursor(),bt=M.getSelection(),Dt=bt.split(` `);switch(mt){case"bold":return M.replaceSelection("**"+bt+"**"),bt===""&&M.setCursor(At.line,At.ch+2),M.focus();case"italic":return M.replaceSelection("*"+bt+"*"),bt===""&&M.setCursor(At.line,At.ch+1),M.focus();case"code":return M.replaceSelection("`"+bt+"`"),bt===""&&M.setCursor(At.line,At.ch+1),M.focus();case"inline-latex":return M.replaceSelection("`$$"+bt+"$$`"),bt===""&&M.setCursor(At.line,At.ch+3),M.focus();case"latex":return M.replaceSelection("```latex\n"+bt+"\n```"),M.setCursor(At.line+1,bt.length+1),M.focus();case"line-break":return M.replaceSelection(`
    `),M.focus();case"list-ul":return bt===""?M.replaceSelection("- "+bt):M.replaceSelection(Dt.map(function(Pt){return Pt===""?"":"- ".concat(Pt)}).join(` `)),M.focus();case"list-ol":return bt===""?M.replaceSelection("1. "+bt):M.replaceSelection(Dt.map(function(Pt,Gt){return Pt===""?"":"".concat(Gt+1,". ").concat(Pt)}).join(` `)),M.focus();case"add-null-ch":return bt===""&&M.setCursor(At.line,At.ch+1),M.replaceSelection(Re),M.focus();case"inster-template-1":return bt===""&&M.setCursor(At.line,At.ch),M.replaceSelection(He),M.focus();case"eraser":return M.setValue(""),M.focus();case"trigger-watch":return Bt(!yt),M.focus();case"trigger-full-screen":return vr(!gr),M.focus();case je:Fr(je);return;case it:Fr(it);return;case Be:Fr(Be);return;case Ze:Fr(Ze);return;default:throw new Error}},[M,yt,gr]),xi=Object(y.useCallback)(function(mt){Fr("");switch(nr){case je:var At=mt.title,bt=mt.link;return M.replaceSelection("[".concat(At,"](").concat(bt,")")),M.focus();case it:var Dt=mt.language,Pt=mt.content;return M.replaceSelection(["```"+Dt,Pt,"```"].join(` `)),M.focus();case Be:var Gt=mt.src,Ot=mt.alt;return Ot?M.replaceSelection("![ ".concat(Ot," ]( ").concat(Gt,' "').concat(Ot,'" )')):M.replaceSelection("![,](".concat(Gt,")")),M.focus();case Ze:for(var rr=mt.row,Ar=mt.col,kt=mt.align,li=` `,Ft=0;Ft300&&(rr=300);var Ar=St+rr+"px";Yr(Ar)}}return mt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Gt),document.addEventListener("mouseup",Pt),function(){mt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Gt),document.removeEventListener("mouseup",Pt)}}},[M,jt]),Object(y.useEffect)(function(){Yr(St)},[St]);var ri=ge(pt),fn=ge(Ki),Xr={width:ri,height:fn},pn=Object(y.useMemo)(function(){if(Mr){var mt=new Date(Mr),At=mt.getHours(),bt=mt.getMinutes(),Dt=mt.getSeconds();return At=At<10?"0"+At:At,bt=bt<10?"0"+bt:bt,Dt=Dt<10?"0"+Dt:Dt,"".concat(At,":").concat(bt,":").concat(Dt)}return 0},[Mr]);function Wn(){window.sessionStorage.removeItem(Br),Ei(!1),Mi(0)}function Oi(){Ei(!1),Mi(0),M.setValue(window.sessionStorage.getItem(Br))}function ua(mt,At){var bt=M.getValue();bt=bt.replace(mt,At),Je(bt),M==null||M.setValue(bt)}return T.a.createElement(y.Fragment,null,T.a.createElement("div",{className:"markdown-editor-wrapper",ref:$t},T.a.createElement("div",{className:"markdown-editor-container ".concat(Ge," ").concat(yt?"on-preview":""," ").concat(Ut?"mini":""," ").concat(gr?"full-screen":""),style:Xr},T.a.createElement(C,{insertTemp:It,watch:yt,fullScreen:gr,showNullButton:_t,onActionCallback:Vi,hidetoolBar:Hr,uuid:Zt.current,setOpenPhones:function(){Nt.current=!0}}),T.a.createElement("div",{className:"markdown-editor-body"},T.a.createElement("div",{className:"codemirror-container"},T.a.createElement("textarea",{ref:Rt,placeholder:gi})),yt?T.a.createElement("div",{ref:ti,className:"preview-container"},Kr==="stex"&&T.a.createElement(L,{value:Pe}),Kr!=="stex"&&T.a.createElement(g.a,{edit:!0,value:Pe,replaces:ua})):null))),pr?T.a.createElement("a",{ref:jt,className:"editor-resize"}):null,T.a.createElement(P.a,null,ne[nr]?T.a.createElement(X.a,{centered:!0,title:ne[nr],visible:!0,onCancel:Ci,footer:null,className:"markdown-popup-form"},cn):null))}},RMFE:function(Ie,Le){Ie.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYaxFgAABgfYNECBAICog0NHDWIsAAQIC7RsgQIBAVECgo4exFgECBATaN0CAAIGogEBHD2MtAgQICLRvgAABAlEBgY4exloECBAQaN8AAQIEogICHT2MtQgQICDQvgECBAhEBQQ6ehhrESBAQKB9AwQIEIgKCHT0MNYiQICAQPsGCBAgEBUQ6OhhrEWAAAGB9g0QIEAgKiDQ0cNYiwABAgLtGyBAgEBUQKCjh7EWAQIEBNo3QIAAgaiAQEcPYy0CBAh8/5Tg6+vrp3/q7wgQIEDgPwKfz+c/v92v/Ac9CxMBAgRSAgKdOodlCBAgMAGBnoWJAAECKQGBTp3DMgQIEJiAQM/CRIAAgZSAQKfOYRkCBAhMQKBnYSJAgEBKQKBT57AMAQIEJiDQszARIEAgJSDQqXNYhgABAhMQ6FmYCBAgkBIQ6NQ5LEOAAIEJCPQsTAQIEEgJCHTqHJYhQIDABAR6FiYCBAikBAQ6dQ7LECBAYAICPQsTAQIEUgICnTqHZQgQIDABgZ6FiQABAikBgU6dwzIECBCYgEDPwkSAAIGUgECnzmEZAgQITECg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T5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Ie,Le){/** * @license * Copyright (C) 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var Z,ie,X,R=!1,Q,B;window.PR_SHOULD_USE_CONTINUATION=!0;var _,G;(function(){var j=window,O=["break,continue,do,else,for,if,return,while"],I=[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=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],T=[y,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],k=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],D=[y,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],w="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",A=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],d="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",o=[O,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],l=[O,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],h=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],E=[T,D,k,A,d,o,l,h],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,g="str",L="kwd",x="com",p="typ",c="lit",u="pun",a="pln",b="tag",m="dec",C="src",P="atn",H="atv",V="nocode",$="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(Se){for(var Oe=0,Ue=!1,Xe=!1,Qe=0,je=Se.length;Qe122||(te<65||fe>90||ut.push([Math.max(65,fe)|32,Math.min(te,90)|32]),te<97||fe>122||ut.push([Math.max(97,fe)&~32,Math.min(te,122)&~32]))}}ut.sort(function(me,Te){return me[0]-Te[0]||Te[1]-me[1]});for(var re=[],ne=[],He=0;Heue[0]&&(ue[1]+1>ue[0]&&Re.push("-"),Re.push(qe(ue[1])))}return Re.push("]"),Re.join("")}function dt(nt){for(var we=nt.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")),ut=we.length,at=[],Re=0,He=0;Re=2&&fe==="["?we[Re]=tt(ge):fe!=="\\"&&(we[Re]=ge.replace(/[a-zA-Z]/g,function(ne){var ue=ne.charCodeAt(0);return"["+String.fromCharCode(ue&~32,ue|32)+"]"}))}return we.join("")}for(var rt=[],Qe=0,je=Se.length;Qe=0;)Ue[rt.charAt(nt)]=dt;var we=dt[1],ut=""+we;Ze.hasOwnProperty(ut)||(it.push(we),Ze[ut]=null)}it.push(/[\0-\uffff]/),Xe=z(it)})();var Qe=Oe.length,je=function(Be){for(var it=Be.sourceCode,Ze=Be.basePos,qe=Be.sourceNode,tt=[Ze,a],dt=0,rt=it.match(Xe)||[],nt={},we=0,ut=rt.length;we=5&&Re.substring(0,5)==="lang-",ge&&!(He&&typeof He[1]=="string")&&(ge=!1,Re=C),ge||(nt[at]=Re)}var te=dt;if(dt+=at.length,!ge)tt.push(Ze+te,Re);else{var re=He[1],ne=at.indexOf(re),ue=ne+re.length;He[2]&&(ue=at.length-He[2].length,ne=ue-re.length);var me=Re.substring(5);ee(qe,Ze+te,at.substring(0,ne),je,tt),ee(qe,Ze+te+ne,re,se(me,re),tt),ee(qe,Ze+te+ue,at.substring(ue),je,tt)}}Be.decorations=tt};return je}function Me(Se){var Oe=[],Ue=[];Se.tripleQuotedStrings?Oe.push([g,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Se.multiLineStrings?Oe.push([g,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Oe.push([g,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Se.verbatimStrings&&Ue.push([g,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Xe=Se.hashComments;Xe&&(Se.cStyleComments?(Xe>1?Oe.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Oe.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ue.push([g,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Oe.push([x,/^#[^\r\n]*/,null,"#"])),Se.cStyleComments&&(Ue.push([x,/^\/\/[^\r\n]*/,null]),Ue.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Qe=Se.regexLiterals;if(Qe){var je=Qe>1?"":` \r`,Be=je?".":"[\\S\\s]",it="/(?=[^/*"+je+"])(?:[^/\\x5B\\x5C"+je+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+je+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";Ue.push(["lang-regex",RegExp("^"+$+"("+it+")")])}var Ze=Se.types;Ze&&Ue.push([p,Ze]);var qe=(""+Se.keywords).replace(/^ | $/g,"");qe.length&&Ue.push([L,new RegExp("^(?:"+qe.replace(/[\s,]+/g,"|")+")\\b"),null]),Oe.push([a,/^\s+/,null,` \r \xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return Se.regexLiterals&&(tt+="(?!s*/)"),Ue.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[p,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[u,new RegExp(tt),null]),ve(Oe,Ue)}var xe=Me({keywords:E,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ae(Se,Oe,Ue){for(var Xe=/(?:^|\s)nocode(?:\s|$)/,Qe=/\r\n?|\n/,je=Se.ownerDocument,Be=je.createElement("li");Se.firstChild;)Be.appendChild(Se.firstChild);var it=[Be];function Ze(we){var ut=we.nodeType;if(ut==1&&!Xe.test(we.className))if(we.nodeName==="br")qe(we),we.parentNode&&we.parentNode.removeChild(we);else for(var at=we.firstChild;at;at=at.nextSibling)Ze(at);else if((ut==3||ut==4)&&Ue){var Re=we.nodeValue,He=Re.match(Qe);if(He){var ge=Re.substring(0,He.index);we.nodeValue=ge;var de=Re.substring(He.index+He[0].length);if(de){var fe=we.parentNode;fe.insertBefore(je.createTextNode(de),we.nextSibling)}qe(we),ge||we.parentNode.removeChild(we)}}}function qe(we){for(;!we.nextSibling;)if(we=we.parentNode,!we)return;function ut(He,ge){var de=ge?He.cloneNode(!1):He,fe=He.parentNode;if(fe){var te=ut(fe,1),re=He.nextSibling;te.appendChild(de);for(var ne=re;ne;ne=re)re=ne.nextSibling,te.appendChild(ne)}return de}for(var at=ut(we.nextSibling,0),Re;(Re=at.parentNode)&&Re.nodeType===1;)at=Re;it.push(at)}for(var tt=0;tt=fe&&(Ze+=2),je>=te&&(dt+=2)}}finally{Re&&(Re.style.display=He)}}var Ce={};function pe(Se,Oe){for(var Ue=Oe.length;--Ue>=0;){var Xe=Oe[Ue];Ce.hasOwnProperty(Xe)?j.console&&console.warn("cannot override language handler %s",Xe):Ce[Xe]=Se}}function se(Se,Oe){return Se&&Ce.hasOwnProperty(Se)||(Se=/^\s*]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),pe(ve([[a,/^[\s]+/,null,` \r `],[H,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[b,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[u,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),pe(ve([],[[H,/^[\s\S]+/]]),["uq.val"]),pe(Me({keywords:T,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),pe(Me({keywords:"null,true,false"}),["json"]),pe(Me({keywords:D,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),pe(Me({keywords:k,cStyleComments:!0}),["java"]),pe(Me({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(Me({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(Me({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(Me({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(Me({keywords:A,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(Me({keywords:w,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(ve([],[[g,/^[\s\S]+/]]),["regex"]);function De(Se){var Oe=Se.langExtension;try{var Ue=U(Se.sourceNode,Se.pre),Xe=Ue.sourceCode;Se.sourceCode=Xe,Se.spans=Ue.spans,Se.basePos=0,se(Oe,Xe)(Se),Ee(Se)}catch(Qe){j.console&&console.log(Qe&&Qe.stack||Qe)}}function ze(Se,Oe,Ue){var Xe=Ue||!1,Qe=Oe||null,je=document.createElement("div");je.innerHTML="
    "+Se+"
    ",je=je.firstChild,Xe&&Ae(je,Xe,!0);var Be={langExtension:Qe,numberLines:Xe,sourceNode:je,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return De(Be),je.innerHTML}function We(Se,Oe){var Ue=Oe||document.body,Xe=Ue.ownerDocument||document;function Qe(de){return Ue.getElementsByTagName(de)}for(var je=[Qe("pre"),Qe("code"),Qe("xmp")],Be=[],it=0;it=15&&(T=!1,O=!0);var g=l&&(I||T&&(v==null||v<12.11)),L=R||G&&j>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var p=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 u(e,t){return c(e).appendChild(t)}function a(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var S=0;S=t)return N+(t-S);N+=K-S,N+=i-N%i,S=K+1}}var oe=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};oe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},oe.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(N,t-n);if(n+=S-r,n+=i-n%i,r=S+1,n>=t)return r}}var pe=[""];function se(e){for(;pe.length<=e;)pe.push(De(pe)+" ");return pe[e]}function De(e){return e[e.length-1]}function ze(e,t){for(var i=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Se.test(e))}function Ue(e,t){return t?t.source.indexOf("\\w")>-1&&Oe(e)?!0:t.test(e):Oe(e)}function Xe(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 je(e){return e.charCodeAt(0)>=768&&Qe.test(e)}function Be(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var n=(t+i)/2,S=r<0?Math.ceil(n):Math.floor(n);if(S==t)return e(S)?t:i;e(S)?i=S:t=S+r}}function Ze(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,S=0;St||t==i&&N.to==t)&&(r(Math.max(N.from,t),Math.min(N.to,i),N.level==1?"rtl":"ltr",S),n=!0)}n||r(t,i,"ltr")}var qe=null;function tt(e,t,i){var r;qe=null;for(var n=0;nt)return n;S.to==t&&(S.from!=S.to&&i=="before"?r=n:qe=n),S.from==t&&(S.from!=S.to&&i!="before"?r=n:qe=n)}return r!=null?r:qe}var dt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(q){return q<=247?e.charAt(q):1424<=q&&q<=1524?"R":1536<=q&&q<=1785?t.charAt(q-1536):1774<=q&&q<=2220?"r":8192<=q&&q<=8203?"w":q==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,S=/[LRr]/,N=/[Lb1n]/,K=/[1n]/;function Y(q,ae,le){this.level=q,this.from=ae,this.to=le}return function(q,ae){var le=ae=="ltr"?"L":"R";if(q.length==0||ae=="ltr"&&!r.test(q))return!1;for(var be=q.length,ye=[],ke=0;ke-1&&(r[t]=n.slice(0,S).concat(n.slice(S+1)))}}}function Re(e,t){var i=ut(e,t);if(!i.length)return;for(var r=Array.prototype.slice.call(arguments,2),n=0;n0}function fe(e){e.prototype.on=function(t,i){we(this,t,i)},e.prototype.off=function(t,i){at(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 ue(e){te(e),re(e)}function me(e){return e.target||e.srcElement}function Te(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),l&&e.ctrlKey&&t==1&&(t=3),t}var _e=function(){if(G&&j<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),ot;function gt(e){if(ot==null){var t=a("span","\u200B");u(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ot=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&j<8))}var i=ot?a("span","\u200B"):a("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var pt;function Tt(e){if(pt!=null)return pt;var t=u(e,document.createTextNode("A\u062EA")),i=m(t,0,1).getBoundingClientRect(),r=m(t,1,2).getBoundingClientRect();return c(e),!i||i.left==i.right?!1:pt=r.right-i.right<3}var St=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(` `,t);n==-1&&(n=e.length);var S=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),N=S.indexOf("\r");N!=-1?(i.push(S.slice(0,N)),t+=N+1):(i.push(S),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ht=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ut=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Mt=null;function Jt(e){if(Mt!=null)return Mt;var t=u(e,a("span","x")),i=t.getBoundingClientRect(),r=m(t,0,1).getBoundingClientRect();return Mt=Math.abs(i.left-r.left)>1}var Qt={},It={};function _r(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qt[e]=t}function Kr(e,t){It[e]=t}function Et(e){if(typeof e=="string"&&It.hasOwnProperty(e))e=It[e];else if(e&&typeof e.name=="string"&&It.hasOwnProperty(e.name)){var t=It[e.name];typeof t=="string"&&(t={name:t}),e=Ye(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Et("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Et("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Br(e,t){t=Et(t);var i=Qt[t.name];if(!i)return Br(e,"text/plain");var r=i(e,t);if(hr.hasOwnProperty(t.name)){var n=hr[t.name];for(var S in n){if(!n.hasOwnProperty(S))continue;r.hasOwnProperty(S)&&(r["_"+S]=r[S]),r[S]=n[S]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var N in t.modeProps)r[N]=t.modeProps[N];return r}var hr={};function pr(e,t){var i=hr.hasOwnProperty(e)?hr[e]:hr[e]={};U(t,i)}function Nr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function ci(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function $r(e,t,i){return e.startState?e.startState(t,i):!0}var _t=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};_t.prototype.eol=function(){return this.pos>=this.string.length},_t.prototype.sol=function(){return this.pos==this.lineStart},_t.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},_t.prototype.next=function(){if(this.post},_t.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},_t.prototype.skipToEnd=function(){this.pos=this.string.length},_t.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},_t.prototype.backUp=function(e){this.pos-=e},_t.prototype.column=function(){return this.lastColumnPos0?null:(S&&t!==!1&&(this.pos+=S[0].length),S)}},_t.prototype.current=function(){return this.string.slice(this.start,this.pos)},_t.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},_t.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},_t.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],S=n.chunkSize();if(t=e.first&&ti?Ge(i,ct(e,i).text.length):f(t,ct(e,t.line).text.length)}function f(e,t){var i=e.ch;return i==null||i>t?Ge(e.line,t):i<0?Ge(e.line,0):e}function M(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},F.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}},F.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},F.fromSaved=function(e,t,i){return t instanceof J?new F(e,Nr(e.mode,t.state),i,t.lookAhead):new F(e,Nr(e.mode,t),i)},F.prototype.save=function(e){var t=e!==!1?Nr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new J(t,this.maxLookAhead):t};function he(e,t,i,r){var n=[e.state.modeGen],S={};gr(e,t.text,e.doc.mode,i,function(q,ae){return n.push(q,ae)},S,r);for(var N=i.state,K=function(q){i.baseTokens=n;var ae=e.state.overlays[q],le=1,be=0;i.state=!0,gr(e,t.text,ae.mode,i,function(ye,ke){for(var Fe=le;beye&&n.splice(le,1,ye,n[le+1],Ve),le+=2,be=Math.min(ye,Ve)}if(!ke)return;if(ae.opaque)n.splice(Fe,le-Fe,ye,"overlay "+ke),le=Fe+2;else for(;Fee.options.maxHighlightLength&&Nr(e.doc.mode,r.state),S=he(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=S.styles,S.classes?t.styleClasses=S.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Je(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new F(r,!0,t);var S=vr(e,t,i),N=S>r.first&&ct(r,S-1).stateAfter,K=N?F.fromSaved(r,N,S):new F(r,$r(r.mode),S);return r.iter(S,t,function(Y){ft(e,Y.text,K);var q=K.line;Y.stateAfter=q==t-1||q%5==0||q>=n.viewFrom&&qt.start)return S}throw new Error("Mode "+e.name+" failed to advance stream.")}var Bt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Kt(e,t,i,r){var n=e.doc,S=n.mode,N;t=s(n,t);var K=ct(n,t.line),Y=Je(e,t.line,i),q=new _t(K.text,e.options.tabSize,Y),ae;for(r&&(ae=[]);(r||q.pose.options.maxHighlightLength?(K=!1,N&&ft(e,t,r,ae.pos),ae.pos=t.length,le=null):le=Ir(yt(i,ae,r.state,be),S),be){var ye=be[0].name;ye&&(le="m-"+(le?ye+" "+le:ye))}if(!K||q!=le){for(;YN;--K){if(K<=S.first)return S.first;var Y=ct(S,K-1),q=Y.stateAfter;if(q&&(!i||K+(q instanceof J?q.lookAhead:0)<=S.modeFrontier))return K;var ae=ee(Y.text,null,e.options.tabSize);(n==null||r>ae)&&(n=K-1,r=ae)}return n}function Qr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontieri;r--){var n=ct(e,r).stateAfter;if(n&&(!(n instanceof J)||r+n.lookAhead=t:S.to>t);(r||(r=[])).push(new si(N,S.from,Y?null:S.to))}}return r}function Ki(e,t,i){var r;if(e)for(var n=0;n=t:S.to>t);if(K||S.from==t&&N.type=="bookmark"&&(!i||S.marker.insertLeft)){var Y=S.from==null||(N.inclusiveLeft?S.from<=t:S.from0&&K)for(var lt=0;lt0)continue;var ae=[Y,1],le=Ct(q.from,K.from),be=Ct(q.to,K.to);(le<0||!N.inclusiveLeft&&!le)&&ae.push({from:q.from,to:K.from}),(be>0||!N.inclusiveRight&&!be)&&ae.push({from:K.to,to:q.to}),n.splice.apply(n,ae),Y+=ae.length-3}return n}function dn(e){var t=e.markedSpans;if(!t)return;for(var i=0;it)&&(!r||dr(r,S.marker)<0)&&(r=S.marker)}return r}function ar(e,t,i,r,n){var S=ct(e,t),N=nr&&S.markedSpans;if(N)for(var K=0;K=0&&le<=0||ae<=0&&le>=0)continue;if(ae<=0&&(Y.marker.inclusiveRight&&n.inclusiveLeft?Ct(q.to,i)>=0:Ct(q.to,i)>0)||ae>=0&&(Y.marker.inclusiveRight&&n.inclusiveLeft?Ct(q.from,r)<=0:Ct(q.from,r)<0))return!0}}function xr(e){for(var t;t=$t(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=jt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=jt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function cn(e,t){var i=ct(e,t),r=xr(i);return i==r?t:Lt(r)}function Ci(e,t){if(t>e.lastLine())return t;var i=ct(e,t),r;if(!ri(e,i))return t;for(;r=jt(i);)i=r.find(1,!0).line;return Lt(i)+1}function ri(e,t){var i=nr&&t.markedSpans;if(i)for(var r=void 0,n=0;nt.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var Oi=function(e,t,i){this.text=e,Ei(this,t),this.height=i?i(this):1};Oi.prototype.lineNo=function(){return Lt(this)},fe(Oi);function ua(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dn(e),Ei(e,i);var n=r?r(e):1;n!=e.height&&mr(e,n)}function mt(e){e.parent=null,dn(e)}var At={},bt={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?bt:At;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Pt(e,t){var i=b("span",null,null,O?"padding-right: .1px":null),r={pre:b("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var S=n?t.rest[n-1]:t.line,N=void 0;r.pos=0,r.addToken=Ot,Tt(e.display.measure)&&(N=rt(S,e.doc.direction))&&(r.addToken=Ar(r.addToken,N)),r.map=[];var K=t!=e.display.externalMeasured&&Lt(S);li(S,r,Pe(e,S,K)),S.styleClasses&&(S.styleClasses.bgClass&&(r.bgClass=V(S.styleClasses.bgClass,r.bgClass||"")),S.styleClasses.textClass&&(r.textClass=V(S.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(gt(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(O){var Y=r.content.lastChild;(/\bcm-tab\b/.test(Y.className)||Y.querySelector&&Y.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Re(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=V(r.pre.className,r.textClass||"")),r}function Gt(e){var t=a("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ot(e,t,i,r,n,S,N){if(!t)return;var K=e.splitSpaces?rr(t,e.trailingSpace):t,Y=e.cm.state.specialChars,q=!1,ae;if(!Y.test(t))e.col+=t.length,ae=document.createTextNode(K),e.map.push(e.pos,e.pos+t.length,ae),G&&j<9&&(q=!0),e.pos+=t.length;else{ae=document.createDocumentFragment();for(var le=0;;){Y.lastIndex=le;var be=Y.exec(t),ye=be?be.index-le:t.length-le;if(ye){var ke=document.createTextNode(K.slice(le,le+ye));G&&j<9?ae.appendChild(a("span",[ke])):ae.appendChild(ke),e.map.push(e.pos,e.pos+ye,ke),e.col+=ye,e.pos+=ye}if(!be)break;le+=ye+1;var Fe=void 0;if(be[0]==" "){var Ve=e.cm.options.tabSize,$e=Ve-e.col%Ve;Fe=ae.appendChild(a("span",se($e),"cm-tab")),Fe.setAttribute("role","presentation"),Fe.setAttribute("cm-text"," "),e.col+=$e}else be[0]=="\r"||be[0]==` `?(Fe=ae.appendChild(a("span",be[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Fe.setAttribute("cm-text",be[0]),e.col+=1):(Fe=e.cm.options.specialCharPlaceholder(be[0]),Fe.setAttribute("cm-text",be[0]),G&&j<9?ae.appendChild(a("span",[Fe])):ae.appendChild(Fe),e.col+=1);e.map.push(e.pos,e.pos+1,Fe),e.pos++}}if(e.trailingSpace=K.charCodeAt(t.length-1)==32,i||r||n||q||S||N){var st=i||"";r&&(st+=r),n&&(st+=n);var et=a("span",[ae],st,S);if(N)for(var lt in N)N.hasOwnProperty(lt)&<!="style"&<!="class"&&et.setAttribute(lt,N[lt]);return e.content.appendChild(et)}e.content.appendChild(ae)}function rr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;nq&&le.from<=q);be++);if(le.to>=ae)return e(i,r,n,S,N,K,Y);e(i,r.slice(0,le.to-q),n,S,null,K,Y),S=null,r=r.slice(le.to-q),q=le.to}}}function kt(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function li(e,t,i){var r=e.markedSpans,n=e.text,S=0;if(!r){for(var N=1;NY||wt.collapsed&&vt.to==Y&&vt.from==Y)){if(vt.to!=null&&vt.to!=Y&&ye>vt.to&&(ye=vt.to,Fe=""),wt.className&&(ke+=" "+wt.className),wt.css&&(be=(be?be+";":"")+wt.css),wt.startStyle&&vt.from==Y&&(Ve+=" "+wt.startStyle),wt.endStyle&&vt.to==ye&&(lt||(lt=[])).push(wt.endStyle,vt.to),wt.title&&((st||(st={})).title=wt.title),wt.attributes)for(var zt in wt.attributes)(st||(st={}))[zt]=wt.attributes[zt];wt.collapsed&&(!$e||dr($e.marker,wt)<0)&&($e=vt)}else vt.from>Y&&ye>vt.from&&(ye=vt.from)}if(lt)for(var lr=0;lr=K)break;for(var Pr=Math.min(K,ye);;){if(ae){var Lr=Y+ae.length;if(!$e){var er=Lr>Pr?ae.slice(0,Pr-Y):ae;t.addToken(t,er,le?le+ke:ke,Ve,Y+er.length==ye?Fe:"",be,st)}if(Lr>=Pr){ae=ae.slice(Pr-Y),Y=Pr;break}Y=Lr,Ve=""}ae=n.slice(S,S=i[q++]),le=Dt(i[q++],t.cm.options)}}}function Ft(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Lt(De(this.rest))-i+1:1,this.node=this.text=null,this.hidden=ri(e,t)}function Tr(e,t,i){for(var r=[],n,S=t;S2&&S.push((Y.bottom+q.top)/2-i.top)}}S.push(i.bottom-i.top)}}function eo(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;ri)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Fs(e,t){t=xr(t);var i=Lt(t),r=e.display.externalMeasured=new Ft(e.doc,t,i);r.lineN=i;var n=r.built=Pt(e,r);return r.text=n.pre,u(e.display.lineMeasure,n.pre),r}function to(e,t,i,r){return ni(e,Qi(e,t),i,r)}function fa(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(S=Y-K,n=S-1,t>=Y&&(N="right")),n!=null){if(r=e[q+2],K==Y&&i==(r.insertLeft?"left":"right")&&(N=i),i=="left"&&n==0)for(;q&&e[q-2]==e[q-3]&&e[q-1].insertLeft;)r=e[(q-=3)+2],N="left";if(i=="right"&&n==Y-K)for(;q=0&&!((i=e[n]).left!=i.right);n--);return i}function js(e,t,i,r){var n=io(t.map,i,r),S=n.node,N=n.start,K=n.end,Y=n.collapse,q;if(S.nodeType==3){for(var ae=0;ae<4;ae++){for(;N&&je(t.line.text.charAt(n.coverStart+N));)--N;for(;n.coverStart+K0&&(Y=r="right");var le;e.options.lineWrapping&&(le=S.getClientRects()).length>1?q=le[r=="right"?le.length-1:0]:q=S.getBoundingClientRect()}if(G&&j<9&&!N&&(!q||!q.left&&!q.right)){var be=S.parentNode.getClientRects()[0];be?q={left:be.left,right:be.left+Xi(e.display),top:be.top,bottom:be.bottom}:q=ro}for(var ye=q.top-t.rect.top,ke=q.bottom-t.rect.top,Fe=(ye+ke)/2,Ve=t.view.measure.heights,$e=0;$e=r.text.length?(Y=r.text.length,q="before"):Y<=0&&(Y=0,q="after"),!K)return N(q=="before"?Y-1:Y,q=="before");function ae(ke,Fe,Ve){var $e=K[Fe],st=$e.level==1;return N(Ve?ke-1:ke,st!=Ve)}var le=tt(K,Y,q),be=qe,ye=ae(Y,le,q=="before");return be!=null&&(ye.other=ae(Y,be,q!="before")),ye}function uo(e,t){var i=0;t=s(e.doc,t),e.options.lineWrapping||(i=Xi(e.display)*t.ch);var r=ct(e.doc,t.line),n=Xr(r)+jn(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function ga(e,t,i,r,n){var S=Ge(e,t,i);return S.xRel=n,r&&(S.outside=r),S}function va(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return ga(r.first,0,null,-1,-1);var n=Ur(r,i),S=r.first+r.size-1;if(n>S)return ga(r.first+r.size-1,ct(r,S).text.length,null,1,1);t<0&&(t=0);for(var N=ct(r,n);;){var K=Gs(e,N,n,t,i),Y=ti(N,K.ch+(K.xRel>0||K.outside>0?1:0));if(!Y)return K;var q=Y.find(1);if(q.line==n)return q;N=ct(r,n=q.line)}}function ho(e,t,i,r){r-=pa(t);var n=t.text.length,S=it(function(N){return ni(e,i,N-1).bottom<=r},n,0);return n=it(function(N){return ni(e,i,N).top>r},S,n),{begin:S,end:n}}function co(e,t,i,r){i||(i=Qi(e,t));var n=Hn(e,t,ni(e,i,r),"line").top;return ho(e,t,i,n)}function ya(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Gs(e,t,i,r,n){n-=Xr(t);var S=Qi(e,t),N=pa(t),K=0,Y=t.text.length,q=!0,ae=rt(t,e.doc.direction);if(ae){var le=(e.options.lineWrapping?Ks:zs)(e,t,i,S,ae,r,n);q=le.level!=1,K=q?le.from:le.to-1,Y=q?le.to:le.from-1}var be=null,ye=null,ke=it(function(xt){var vt=ni(e,S,xt);return vt.top+=N,vt.bottom+=N,ya(vt,r,n,!1)?(vt.top<=n&&vt.left<=r&&(be=xt,ye=vt),!0):!1},K,Y),Fe,Ve,$e=!1;if(ye){var st=r-ye.left=lt.bottom?1:0}return ke=Be(t.text,ke,1),ga(i,ke,Ve,$e,r-Fe)}function zs(e,t,i,r,n,S,N){var K=it(function(le){var be=n[le],ye=be.level!=1;return ya(Jr(e,Ge(i,ye?be.to:be.from,ye?"before":"after"),"line",t,r),S,N,!0)},0,n.length-1),Y=n[K];if(K>0){var q=Y.level!=1,ae=Jr(e,Ge(i,q?Y.from:Y.to,q?"after":"before"),"line",t,r);ya(ae,S,N,!0)&&ae.top>N&&(Y=n[K-1])}return Y}function Ks(e,t,i,r,n,S,N){var K=ho(e,t,r,N),Y=K.begin,q=K.end;/\s/.test(t.text.charAt(q-1))&&q--;for(var ae=null,le=null,be=0;be=q||ye.to<=Y)continue;var ke=ye.level!=1,Fe=ni(e,r,ke?Math.min(q,ye.to)-1:Math.max(Y,ye.from)).right,Ve=FeVe)&&(ae=ye,le=Ve)}return ae||(ae=n[n.length-1]),ae.fromq&&(ae={from:ae.from,to:q,level:ae.level}),ae}var _i;function Yi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(_i==null){_i=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)_i.appendChild(document.createTextNode("x")),_i.appendChild(a("br"));_i.appendChild(document.createTextNode("x"))}u(e.measure,_i);var i=_i.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),c(e.measure),i||1}function Xi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),i=a("pre",[t],"CodeMirror-line-like");u(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function ba(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,S=t.gutters.firstChild,N=0;S;S=S.nextSibling,++N){var K=e.display.gutterSpecs[N].className;i[K]=S.offsetLeft+S.clientLeft+n,r[K]=S.clientWidth}return{fixedPos:Ea(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ea(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function fo(e){var t=Yi(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Xi(e.display)-3);return function(n){if(ri(e.doc,n))return 0;var S=0;if(n.widgets)for(var N=0;N0&&(q=ct(e.doc,Y.line).text).length==Y.ch){var ae=ee(q,q.length,e.options.tabSize)-q.length;Y=Ge(Y.line,Math.max(0,Math.round((S-$a(e.display).left)/Xi(e.display))-ae))}return Y}function Ni(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,r=0;rt)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)nr&&cn(e.doc,t)n.viewFrom?Ai(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ai(e);else if(t<=n.viewFrom){var S=Gn(e,i,i+r,1);S?(n.view=n.view.slice(S.index),n.viewFrom=S.lineN,n.viewTo+=r):Ai(e)}else if(i>=n.viewTo){var N=Gn(e,t,t,-1);N?(n.view=n.view.slice(0,N.index),n.viewTo=N.lineN):Ai(e)}else{var K=Gn(e,t,t,-1),Y=Gn(e,i,i+r,1);K&&Y?(n.view=n.view.slice(0,K.index).concat(Tr(e,K.lineN,Y.lineN)).concat(n.view.slice(Y.index)),n.viewTo+=r):Ai(e)}var q=n.externalMeasured;q&&(i=n.lineN&&t=r.viewTo)return;var S=r.view[Ni(e,t)];if(S.node==null)return;var N=S.changes||(S.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),S,N=e.display.view;if(!nr||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var K=e.display.viewFrom,Y=0;Y0){if(n==N.length-1)return null;S=K+N[n].size-t,n++}else S=K-t;t+=S,i+=S}for(;cn(e.doc,i)!=i;){if(n==(r<0?0:N.length-1))return null;i+=r*N[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Vs(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Tr(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Tr(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(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=e.display.viewTo||K.to().line0?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||(Re(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),O&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ca(e)}function Ji(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Re(e,"blur",e,t),e.state.focused=!1,p(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.005||ae<-.005)&&(mr(n.line,N),bo(n.line),n.rest))for(var le=0;lee.display.sizerWidth){var be=Math.ceil(K/Xi(e.display));be>e.display.maxLineLength&&(e.display.maxLineLength=be,e.display.maxLine=n.line,e.display.maxLineChanged=!0)}}}function bo(e){if(e.widgets)for(var t=0;t=N&&(S=Ur(t,Xr(ct(t,Y))-e.wrapper.clientHeight),N=Y)}return{from:S,to:Math.max(N,S+1)}}function Ys(e,t){if(He(e,"scrollCursorIntoView"))return;var i=e.display,r=i.sizer.getBoundingClientRect(),n=null;if(t.top+r.top<0?n=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1),n!=null&&!w){var S=a("div","\u200B",null,`position: absolute; top: `+(t.top-i.viewOffset-jn(e.display))+`px; height: `+(t.bottom-t.top+ii(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(S),S.scrollIntoView(n),e.display.lineSpace.removeChild(S)}}function Xs(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(t=t.ch?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 S=0;S<5;S++){var N=!1,K=Jr(e,t),Y=!i||i==t?K:Jr(e,i);n={left:Math.min(K.left,Y.left),top:Math.min(K.top,Y.top)-r,right:Math.max(K.left,Y.left),bottom:Math.max(K.bottom,Y.bottom)+r};var q=Aa(e,n),ae=e.doc.scrollTop,le=e.doc.scrollLeft;if(q.scrollTop!=null&&(xn(e,q.scrollTop),Math.abs(e.doc.scrollTop-ae)>1&&(N=!0)),q.scrollLeft!=null&&(Ui(e,q.scrollLeft),Math.abs(e.doc.scrollLeft-le)>1&&(N=!0)),!N)break}return n}function Js(e,t){var i=Aa(e,t);i.scrollTop!=null&&xn(e,i.scrollTop),i.scrollLeft!=null&&Ui(e,i.scrollLeft)}function Aa(e,t){var i=e.display,r=Yi(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,S=ca(e),N={};t.bottom-t.top>S&&(t.bottom=t.top+S);var K=e.doc.height+da(i),Y=t.topK-r;if(t.topn+S){var ae=Math.min(t.top,(q?K:t.bottom)-S);ae!=n&&(N.scrollTop=ae)}var le=e.options.fixedGutter?0:i.gutters.offsetWidth,be=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-le,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.leftye+be-3&&(N.scrollLeft=t.right+(ke?0:10)-ye),N}function Ta(e,t){if(t==null)return;Qn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Zi(e){Qn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function En(e,t,i){(t!=null||i!=null)&&Qn(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Qn(e),e.curOp.scrollToPos=t}function Qn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=uo(e,t.from),r=uo(e,t.to);Eo(e,i,r,t.margin)}}function Eo(e,t,i,r){var n=Aa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});En(e,n.scrollLeft,n.scrollTop)}function xn(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;R||Da(e,{top:t}),xo(e,t,!0),R&&Da(e),An(e,100)}function xo(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ui(e,t,i,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,wo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cn(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+ii(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Fi=function(e,t,i){this.cm=i;var r=this.vert=a("div",[a("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=a("div",[a("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),we(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),we(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&j<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var S=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+S)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},Fi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fi.prototype.zeroWidthHack=function(){var e=l&&!D?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new oe,this.disableVert=new oe},Fi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var n=e.getBoundingClientRect(),S=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);S!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Fi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sn=function(){};Sn.prototype.update=function(){return{bottom:0,right:0}},Sn.prototype.setScrollLeft=function(){},Sn.prototype.setScrollTop=function(){},Sn.prototype.clear=function(){};function qi(e,t){t||(t=Cn(e));var i=e.display.barWidth,r=e.display.barHeight;Co(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Kn(e),Co(e,Cn(e)),i=e.display.barWidth,r=e.display.barHeight}function Co(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var So={native:Fi,null:Sn};function Ao(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&p(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),we(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Ui(e,t):xn(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function Wi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs},zr(e.curOp)}function ji(e){var t=e.curOp;t&&Is(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&wa(e.cm,e.update)}function rl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Kn(t),e.barMeasure=Cn(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+ii(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Pi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var i=+new Date+e.options.workTime,r=Je(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(S){if(r.line>=e.display.viewFrom){var N=S.styles,K=S.text.length>e.options.maxHighlightLength?Nr(t.mode,r.state):null,Y=he(e,S,r,!0);K&&(r.state=K),S.styles=Y.styles;var q=S.styleClasses,ae=Y.classes;ae?S.styleClasses=ae:q&&(S.styleClasses=null);for(var le=!N||N.length!=S.styles.length||q!=ae&&(!q||!ae||q.bgClass!=ae.bgClass||q.textClass!=ae.textClass),be=0;!le&&bei)return An(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&Or(e,function(){for(var S=0;S=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&po(e)==0)return!1;Do(e)&&(Ai(e),t.dims=ba(e));var n=r.first+r.size,S=Math.max(t.visible.from-e.options.viewportMargin,r.first),N=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFromN&&i.viewTo-N<20&&(N=Math.min(n,i.viewTo)),nr&&(S=cn(e.doc,S),N=Ci(e.doc,N));var K=S!=i.viewFrom||N!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vs(e,S,N),i.viewOffset=Xr(ct(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var Y=po(e);if(!K&&Y==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var q=sl(e);return Y>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),Y>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(q),c(i.cursorDiv),c(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,K&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,An(e,400)),i.updateLineNumbers=null,!0}function To(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Pi(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+da(e.display)-ca(e),i.top)}),t.visible=Vn(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,i));if(!wa(e,t))break;Kn(e);var n=Cn(e);bn(e),qi(e,n),Ra(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Da(e,t){var i=new Yn(e,t);if(wa(e,i)){Kn(e),To(e,i);var r=Cn(e);bn(e),qi(e,r),Ra(e,r),i.finish()}}function ul(e,t,i){var r=e.display,n=e.options.lineNumbers,S=r.lineDiv,N=S.firstChild;function K(ke){var Fe=ke.nextSibling;return O&&l&&e.display.currentWheelTarget==ke?ke.style.display="none":ke.parentNode.removeChild(ke),Fe}for(var Y=r.view,q=r.viewFrom,ae=0;ae-1&&(ye=!1),Ya(e,le,q,i)),ye&&(c(le.lineNumber),le.lineNumber.appendChild(document.createTextNode(fi(e.options,q)))),N=le.node.nextSibling}q+=le.size}for(;N;)N=K(N)}function La(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+ii(e)+"px"}function wo(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ea(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,S=r+"px",N=0;NN.clientWidth,Y=N.scrollHeight>N.clientHeight;if(!(r&&K||n&&Y))return;if(n&&l&&O){e:for(var q=t.target,ae=S.view;q!=N;q=q.parentNode)for(var le=0;le=0&&Ct(e,r.to())<=0)return i}return-1};var Wt=function(e,t){this.anchor=e,this.head=t};Wt.prototype.from=function(){return vi(this.anchor,this.head)},Wt.prototype.to=function(){return gi(this.anchor,this.head)},Wt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Zr(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(be,ye){return Ct(be.from(),ye.from())}),i=ce(t,n);for(var S=1;S0:Y>=0){var q=vi(K.from(),N.from()),ae=gi(K.to(),N.to()),le=K.empty()?N.from()==N.head:K.from()==K.head;S<=i&&--i,t.splice(--S,2,new Wt(le?ae:q,le?q:ae))}}return new jr(t,i)}function Ti(e,t){return new jr([new Wt(e,t||e)],0)}function wi(e){return e.text?Ge(e.from.line+e.text.length-1,De(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Io(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return wi(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wi(t).ch-t.to.ch),Ge(i,r)}function Ia(e,t){for(var i=[],r=0;r1&&e.remove(K.line+1,ke-1),e.insert(K.line+1,$e)}cr(e,"change",e,t)}function Di(e,t,i){function r(n,S,N){if(n.linked)for(var K=0;K1&&!e.done[e.done.length-2].ranges)return e.done.pop(),De(e.done)}function No(e,t,i,r){var n=e.history;n.undone.length=0;var S=+new Date,N,K;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>S-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(N=pl(n,n.lastOp==r)))K=De(N.changes),Ct(t.from,t.to)==0&&Ct(t.from,K.to)==0?K.to=wi(t):N.changes.push(Pa(e,t));else{var Y=De(n.done);for((!Y||!Y.ranges)&&Zn(e.sel,n.done),N={changes:[Pa(e,t)],generation:n.generation},n.done.push(N);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=S,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,K||Re(e,"historyAdded")}function ml(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,r){var n=e.history,S=r&&r.origin;i==n.lastSelOp||S&&n.lastSelOrigin==S&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==S||ml(e,S,De(n.done),t))?n.done[n.done.length-1]=t:Zn(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=S,n.lastSelOp=i,r&&r.clearRedo!==!1&&Bo(n.undone)}function Zn(e,t){var i=De(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Uo(e,t,i,r){var n=t["spans_"+e.id],S=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(N){N.markedSpans&&((n||(n=t["spans_"+e.id]={}))[S]=N.markedSpans),++S})}function vl(e){if(!e)return null;for(var t,i=0;i-1&&(De(K)[le]=q[le],delete q[le]))}}return r}function _a(e,t,i,r){if(r){var n=e.anchor;if(i){var S=Ct(t,n)<0;S!=Ct(i,n)<0?(n=t,t=i):S!=Ct(t,i)<0&&(t=i)}return new Wt(n,t)}else return new Wt(i||t,t)}function qn(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),br(e,new jr([_a(e.sel.primary(),t,i,n)],0),r)}function Wo(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),S=0;S=t.ch:K.to>t.ch))){if(n&&(Re(Y,"beforeCursorEnter"),Y.explicitlyCleared))if(S.markedSpans){--N;continue}else break;if(!Y.atomic)continue;if(i){var le=Y.find(r<0?1:-1),be=void 0;if((r<0?ae:q)&&(le=Vo(e,le,-r,le&&le.line==t.line?S:null)),le&&le.line==t.line&&(be=Ct(le,i))&&(r<0?be<0:be>0))return en(e,le,t,r,n)}var ye=Y.find(r<0?-1:1);return(r<0?q:ae)&&(ye=Vo(e,ye,r,ye.line==t.line?S:null)),ye?en(e,ye,t,r,n):null}}return t}function ea(e,t,i,r,n){var S=r||1,N=en(e,t,i,S,n)||!n&&en(e,t,i,S,!0)||en(e,t,i,-S,n)||!n&&en(e,t,i,-S,!0);return N||(e.cantEdit=!0,Ge(e.first,0))}function Vo(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?s(e,Ge(t.line-1)):null:i>0&&t.ch==(r||ct(e,t.line)).text.length?t.line=0;--n)Xo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Xo(e,t)}function Xo(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var i=Ia(e,t);No(e,t,i,e.cm?e.cm.curOp.id:NaN),Dn(e,t,i,Yr(e,t));var r=[];Di(e,function(n,S){!S&&ce(r,n.history)==-1&&($o(n.history,t),r.push(n.history)),Dn(n,t,null,Yr(n,t))})}function ta(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!i)return;for(var n=e.history,S,N=e.sel,K=t=="undo"?n.done:n.undone,Y=t=="undo"?n.undone:n.done,q=0;q=0;--ye){var ke=be(ye);if(ke)return ke.v}}function Jo(e,t){if(t==0)return;if(e.first+=t,e.sel=new jr(ze(e.sel.ranges,function(n){return new Wt(Ge(n.anchor.line+t,n.anchor.ch),Ge(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm){wr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())return;if(t.from.lineS&&(t={from:t.from,to:Ge(S,ct(e,S).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Hr(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?El(e.cm,t,r):Oa(e,t,r),$n(e,i,xe),e.cantEdit&&ea(e,Ge(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var r=e.doc,n=e.display,S=t.from,N=t.to,K=!1,Y=S.line;e.options.lineWrapping||(Y=Lt(xr(ct(r,S.line))),r.iter(Y,N.line+1,function(ye){if(ye==n.maxLine)return K=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ge(e),Oa(r,t,i,fo(e)),e.options.lineWrapping||(r.iter(Y,S.line+t.text.length,function(ye){var ke=pn(ye);ke>n.maxLineLength&&(n.maxLine=ye,n.maxLineLength=ke,n.maxLineChanged=!0,K=!1)}),K&&(e.curOp.updateMaxLine=!0)),Qr(r,S.line),An(e,400);var q=t.text.length-(N.line-S.line)-1;t.full?wr(e):S.line==N.line&&t.text.length==1&&!Oo(e.doc,t)?Si(e,S.line,"text"):wr(e,S.line,N.line+1,q);var ae=de(e,"changes"),le=de(e,"change");if(le||ae){var be={from:S,to:N,text:t.text,removed:t.removed,origin:t.origin};le&&cr(e,"change",e,be),ae&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(be)}e.display.selForContextMenu=null}function rn(e,t,i,r,n){var S;r||(r=i),Ct(r,i)<0&&(S=[r,i],i=S[0],r=S[1]),typeof t=="string"&&(t=e.splitLines(t)),tn(e,{from:i,to:r,text:t,origin:n})}function Zo(e,t,i,r){i1||!(this.children[0]instanceof Rn))){var K=[];this.collapse(K),this.children=[new Rn(K)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var N=n.lines.length%25+25,K=N;K10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=q,e.display.maxLineLength=ae,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&wr(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&zo(e.doc)),e&&cr(e,"markerCleared",e,this,r,n),t&&ji(e),this.parent&&this.parent.clear()},Li.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n0||N==0&&S.clearWhenEmpty!==!1)return S;if(S.replacedWith&&(S.collapsed=!0,S.widgetNode=b("span",[S.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||S.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(S.widgetNode.insertLeft=!0)),S.collapsed){if(ar(e,t.line,t,i,S)||t.line!=i.line&&ar(e,i.line,t,i,S))throw new Error("Inserting collapsed marker partially overlapping an existing one");oi()}S.addToHistory&&No(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var K=t.line,Y=e.cm,q;if(e.iter(K,i.line+1,function(le){Y&&S.collapsed&&!Y.options.lineWrapping&&xr(le)==Y.display.maxLine&&(q=!0),S.collapsed&&K!=t.line&&mr(le,0),yi(le,new si(S,K==t.line?t.ch:null,K==i.line?i.ch:null)),++K}),S.collapsed&&e.iter(t.line,i.line+1,function(le){ri(e,le)&&mr(le,0)}),S.clearOnEnter&&we(S,"beforeCursorEnter",function(){return S.clear()}),S.readOnly&&(Fr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),S.collapsed&&(S.id=++ts,S.atomic=!0),Y){if(q&&(Y.curOp.updateMaxLine=!0),S.collapsed)wr(Y,t.line,i.line+1);else if(S.className||S.startStyle||S.endStyle||S.css||S.attributes||S.title)for(var ae=t.line;ae<=i.line;ae++)Si(Y,ae,"text");S.atomic&&zo(Y.doc),cr(Y,"markerAdded",Y,S)}return S}var Mn=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;Y--)tn(this,r[Y]);K?Ho(this,K):this.cm&&Zi(this.cm)}),undo:sr(function(){ta(this,"undo")}),redo:sr(function(){ta(this,"redo")}),undoSelection:sr(function(){ta(this,"undo",!0)}),redoSelection:sr(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=s(this,e),t=s(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(S){var N=S.markedSpans;if(N)for(var K=0;K=Y.to||Y.from==null&&n!=e.line||Y.from!=null&&n==t.line&&Y.from>=t.ch)&&(!i||i(Y.marker))&&r.push(Y.marker.parent||Y.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=S,++i}),s(this,Ge(i,t))},indexFromPos:function(e){e=s(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ae=e.dataTransfer.getData("Text");if(ae){var le;if(t.state.draggingText&&!t.state.draggingText.copy&&(le=t.listSelections()),$n(t.doc,Ti(i,i)),le)for(var be=0;be=0;K--)rn(e.doc,"",r[K].from,r[K].to,"+delete");Zi(e)})}function Na(e,t,i){var r=Be(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 S=rt(i,t.doc.direction);if(S){var N=n<0?De(S):S[0],K=n<0==(N.level==1),Y=K?"after":"before",q;if(N.level>0||t.doc.direction=="rtl"){var ae=Qi(t,i);q=n<0?i.text.length-1:0;var le=ni(t,ae,q).top;q=it(function(be){return ni(t,ae,be).top==le},n<0==(N.level==1)?N.from:N.to-1,q),Y=="before"&&(q=Na(i,q,1))}else q=n<0?N.to:N.from;return new Ge(r,q,Y)}}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 S=tt(n,i.ch,i.sticky),N=n[S];if(e.doc.direction=="ltr"&&N.level%2==0&&(r>0?N.to>i.ch:N.from=N.from&&be>=ae.begin)){var ye=le?"before":"after";return new Ge(i.line,be,ye)}}var ke=function($e,st,et){for(var lt=function(zt,lr){return lr?new Ge(i.line,K(zt,1),"before"):new Ge(i.line,zt,"after")};$e>=0&&$e0==(xt.level!=1),wt=vt?et.begin:K(et.end,-1);if(xt.from<=wt&&wt0?ae.end:K(ae.begin,-1);return Ve!=null&&!(r>0&&Ve==t.text.length)&&(Fe=ke(r>0?0:n.length-1,r,q(Ve)),Fe)?Fe:null}var _n={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return on(e,function(t){if(t.empty()){var i=ct(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)n=new Ge(n.line,n.ch+1),e.replaceRange(S.charAt(n.ch-1)+S.charAt(n.ch-2),Ge(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var N=ct(e.doc,n.line-1).text;N&&(n=new Ge(n.line,1),e.replaceRange(S.charAt(0)+e.doc.lineSeparator()+N.charAt(N.length-1),Ge(n.line-1,N.length-1),n,"+transpose"))}}i.push(new Wt(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return Or(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&Ct(t,this.pos)==0&&i==this.button};var Nn,Un;function jl(e,t){var i=+new Date;return Un&&Un.compare(i,e,t)?(Nn=Un=null,"triple"):Nn&&Nn.compare(i,e,t)?(Un=new ja(i,e,t),Nn=null,"double"):(Nn=new ja(i,e,t),Un=null,"single")}function vs(e){var t=this,i=t.display;if(He(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,ui(i,e)){O||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Ha(t,e))return;var r=Bi(t,e),n=Te(e),S=r?jl(r,n):"single";if(window.focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,n,r,S,e))return;n==1?r?zl(t,r,S,e):me(e)==i.scroller&&te(e):n==2?(r&&qn(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(L?t.display.input.onContextMenu(e):yo(t))}function Hl(e,t,i,r,n){var S="Click";return r=="double"?S="Double"+S:r=="triple"&&(S="Triple"+S),S=(t==1?"Left":t==2?"Middle":"Right")+S,Bn(e,ls(S,n),n,function(N){if(typeof N=="string"&&(N=_n[N]),!N)return!1;var K=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),K=N(e,i)!=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 S=h?i.shiftKey&&i.metaKey:i.altKey;n.unit=S?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=l?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(l?i.altKey:i.ctrlKey)),n}function zl(e,t,i,r){G?setTimeout(z(vo,e),0):e.curOp.focus=P();var n=Gl(e,i,r),S=e.doc.sel,N;e.options.dragDrop&&_e&&!e.isReadOnly()&&i=="single"&&(N=S.contains(t))>-1&&(Ct((N=S.ranges[N]).from(),t)<0||t.xRel>0)&&(Ct(N.to(),t)>0||t.xRel<0)?Kl(e,r,t,n):Vl(e,r,t,n)}function Kl(e,t,i,r){var n=e.display,S=!1,N=or(e,function(q){O&&(n.scroller.draggable=!1),e.state.draggingText=!1,at(n.wrapper.ownerDocument,"mouseup",N),at(n.wrapper.ownerDocument,"mousemove",K),at(n.scroller,"dragstart",Y),at(n.scroller,"drop",N),S||(te(q),r.addNew||qn(e.doc,i,null,null,r.extend),O&&!k||G&&j==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),K=function(q){S=S||Math.abs(t.clientX-q.clientX)+Math.abs(t.clientY-q.clientY)>=10},Y=function(){return S=!0};O&&(n.scroller.draggable=!0),e.state.draggingText=N,N.copy=!r.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),we(n.wrapper.ownerDocument,"mouseup",N),we(n.wrapper.ownerDocument,"mousemove",K),we(n.scroller,"dragstart",Y),we(n.scroller,"drop",N),yo(e),setTimeout(function(){return n.input.focus()},20)}function ys(e,t,i){if(i=="char")return new Wt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Wt(Ge(t.line,0),s(e.doc,Ge(t.line+1,0)));var r=i(e,t);return new Wt(r.from,r.to)}function Vl(e,t,i,r){var n=e.display,S=e.doc;te(t);var N,K,Y=S.sel,q=Y.ranges;if(r.addNew&&!r.extend?(K=S.sel.contains(i),K>-1?N=q[K]:N=new Wt(i,i)):(N=S.sel.primary(),K=S.sel.primIndex),r.unit=="rectangle")r.addNew||(N=new Wt(i,i)),i=Bi(e,t,!0,!0),K=-1;else{var ae=ys(e,i,r.unit);r.extend?N=_a(N,ae.anchor,ae.head,r.extend):N=ae}r.addNew?K==-1?(K=q.length,br(S,Zr(e,q.concat([N]),K),{scroll:!1,origin:"*mouse"})):q.length>1&&q[K].empty()&&r.unit=="char"&&!r.extend?(br(S,Zr(e,q.slice(0,K).concat(q.slice(K+1)),0),{scroll:!1,origin:"*mouse"}),Y=S.sel):Ba(S,K,N,Ae):(K=0,br(S,new jr([N],0),Ae),Y=S.sel);var le=i;function be(et){if(Ct(le,et)==0)return;if(le=et,r.unit=="rectangle"){for(var lt=[],xt=e.options.tabSize,vt=ee(ct(S,i.line).text,i.ch,xt),wt=ee(ct(S,et.line).text,et.ch,xt),zt=Math.min(vt,wt),lr=Math.max(vt,wt),Yt=Math.min(i.line,et.line),Pr=Math.min(e.lastLine(),Math.max(i.line,et.line));Yt<=Pr;Yt++){var Lr=ct(S,Yt).text,er=Ce(Lr,zt,xt);zt==lr?lt.push(new Wt(Ge(Yt,er),Ge(Yt,er))):Lr.length>er&<.push(new Wt(Ge(Yt,er),Ge(Yt,Ce(Lr,lr,xt))))}lt.length||lt.push(new Wt(i,i)),br(S,Zr(e,Y.ranges.slice(0,K).concat(lt),K),{origin:"*mouse",scroll:!1}),e.scrollIntoView(et)}else{var Rr=N,fr=ys(e,et,r.unit),ir=Rr.anchor,tr;Ct(fr.anchor,ir)>0?(tr=fr.head,ir=vi(Rr.from(),fr.anchor)):(tr=fr.anchor,ir=gi(Rr.to(),fr.head));var Xt=Y.ranges.slice(0);Xt[K]=Ql(e,new Wt(s(S,ir),tr)),br(S,Zr(e,Xt,K),Ae)}}var ye=n.wrapper.getBoundingClientRect(),ke=0;function Fe(et){var lt=++ke,xt=Bi(e,et,!0,r.unit=="rectangle");if(!xt)return;if(Ct(xt,le)!=0){e.curOp.focus=P(),be(xt);var vt=Vn(n,S);(xt.line>=vt.to||xt.lineye.bottom?20:0;wt&&setTimeout(or(e,function(){if(ke!=lt)return;n.scroller.scrollTop+=wt,Fe(et)}),50)}}function Ve(et){e.state.selectingText=!1,ke=Infinity,et&&(te(et),n.input.focus()),at(n.wrapper.ownerDocument,"mousemove",$e),at(n.wrapper.ownerDocument,"mouseup",st),S.history.lastSelOrigin=null}var $e=or(e,function(et){et.buttons===0||!Te(et)?Ve(et):Fe(et)}),st=or(e,Ve);e.state.selectingText=st,we(n.wrapper.ownerDocument,"mousemove",$e),we(n.wrapper.ownerDocument,"mouseup",st)}function Ql(e,t){var i=t.anchor,r=t.head,n=ct(e.doc,i.line);if(Ct(i,r)==0&&i.sticky==r.sticky)return t;var S=rt(n);if(!S)return t;var N=tt(S,i.ch,i.sticky),K=S[N];if(K.from!=i.ch&&K.to!=i.ch)return t;var Y=N+(K.from==i.ch==(K.level!=1)?0:1);if(Y==0||Y==S.length)return t;var q;if(r.line!=i.line)q=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ae=tt(S,r.ch,r.sticky),le=ae-N||(r.ch-i.ch)*(K.level==1?-1:1);ae==Y-1||ae==Y?q=le<0:q=le>0}var be=S[Y+(q?-1:0)],ye=q==(be.level==1),ke=ye?be.from:be.to,Fe=ye?"after":"before";return i.ch==ke&&i.sticky==Fe?t:new Wt(new Ge(i.line,ke,Fe),r)}function bs(e,t,i,r){var n,S;if(t.touches)n=t.touches[0].clientX,S=t.touches[0].clientY;else try{n=t.clientX,S=t.clientY}catch(be){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&te(t);var N=e.display,K=N.lineDiv.getBoundingClientRect();if(S>K.bottom||!de(e,i))return ne(t);S-=K.top-N.viewOffset;for(var Y=0;Y=n){var ae=Ur(e.doc,S),le=e.display.gutterSpecs[Y];return Re(e,i,e,ae,le.className,t),ne(t)}}}function Ha(e,t){return bs(e,t,"gutterClick",!0)}function Es(e,t){if(ui(e.display,t)||Yl(e,t))return;if(He(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return de(e,"gutterContextMenu")?bs(e,t,"gutterContextMenu",!1):!1}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yn(e)}var sn={toString:function(){return"CodeMirror.Init"}},Cs={},aa={};function Xl(e){var t=e.optionHandlers;function i(r,n,S,N){e.defaults[r]=n,S&&(t[r]=N?function(K,Y,q){q!=sn&&S(K,Y,q)}:S)}e.defineOption=i,e.Init=sn,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Ma(r)},!0),i("indentUnit",2,Ma,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){wn(r),yn(r),wr(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!n)return;var S=[],N=r.doc.first;r.doc.iter(function(Y){for(var q=0;;){var ae=Y.text.indexOf(n,q);if(ae==-1)break;q=ae+n.length,S.push(Ge(N,ae))}N++});for(var K=S.length-1;K>=0;K--)rn(r.doc,n,S[K],Ge(S[K].line,S[K].ch+n.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,n,S){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),S!=sn&&r.refresh()}),i("specialCharPlaceholder",Gt,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!E),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){xs(r),Tn(r)},!0),i("keyMap","default",function(r,n,S){var N=ia(n),K=S!=sn&&ia(S);K&&K.detach&&K.detach(r,N),N.attach&&N.attach(r,K||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=ka(n,r.options.lineNumbers),Tn(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?Ea(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return qi(r)},!0),i("scrollbarStyle","native",function(r){Ao(r),qi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=ka(r.options.gutters,n),Tn(r)},!0),i("firstLineNumber",1,Tn,!0),i("lineNumberFormatter",function(r){return r},Tn,!0),i("showCursorWhenSelecting",!1,bn,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Ji(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,bn,!0),i("singleCursorHeightPerLine",!0,bn,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,wn,!0),i("addModeClass",!1,wn,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,wn,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Jl(e,t,i){var r=i&&i!=sn;if(!t!=!r){var n=e.display.dragFunctions,S=t?we:at;S(e.display.scroller,"dragstart",n.start),S(e.display.scroller,"dragenter",n.enter),S(e.display.scroller,"dragover",n.over),S(e.display.scroller,"dragleave",n.leave),S(e.display.scroller,"drop",n.drop)}}function Zl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(p(e.display.wrapper,"CodeMirror-wrap"),Wn(e)),xa(e),wr(e),yn(e),setTimeout(function(){return qi(e)},100)}function Vt(e,t){var i=this;if(!(this instanceof Vt))return new Vt(e,t);this.options=t=t?U(t):{},U(Cs,t,!1);var r=t.value;typeof r=="string"?r=new Dr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Vt.inputStyles[t.inputStyle](this),S=this.display=new hl(e,r,n,t);S.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ao(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new oe,keySeq:null,specialChars:null},t.autofocus&&!o&&S.input.focus(),G&&j<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Rl(),Wi(this),this.curOp.forceUpdate=!0,Po(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Sa(i)},20):Ji(this);for(var N in aa)aa.hasOwnProperty(N)&&aa[N](this,t[N],sn);Do(this),t.finishInit&&t.finishInit(this);for(var K=0;K20*20}we(t.scroller,"touchstart",function(Y){if(!He(e,Y)&&!S(Y)&&!Ha(e,Y)){t.input.ensurePolled(),clearTimeout(i);var q=+new Date;t.activeTouch={start:q,moved:!1,prev:q-r.end<=300?r:null},Y.touches.length==1&&(t.activeTouch.left=Y.touches[0].pageX,t.activeTouch.top=Y.touches[0].pageY)}}),we(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),we(t.scroller,"touchend",function(Y){var q=t.activeTouch;if(q&&!ui(t,Y)&&q.left!=null&&!q.moved&&new Date-q.start<300){var ae=e.coordsChar(t.activeTouch,"page"),le;!q.prev||N(q,q.prev)?le=new Wt(ae,ae):!q.prev.prev||N(q,q.prev.prev)?le=e.findWordAt(ae):le=new Wt(Ge(ae.line,0),s(e.doc,Ge(ae.line+1,0))),e.setSelection(le.anchor,le.head),e.focus(),te(Y)}n()}),we(t.scroller,"touchcancel",n),we(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xn(e,t.scroller.scrollTop),Ui(e,t.scroller.scrollLeft,!0),Re(e,"scroll",e))}),we(t.scroller,"mousewheel",function(Y){return ko(e,Y)}),we(t.scroller,"DOMMouseScroll",function(Y){return ko(e,Y)}),we(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Y){He(e,Y)||ue(Y)},over:function(Y){He(e,Y)||(Ll(e,Y),ue(Y))},start:function(Y){return Dl(e,Y)},drop:or(e,wl),leave:function(Y){He(e,Y)||ns(e)}};var K=t.input.getField();we(K,"keyup",function(Y){return ms.call(e,Y)}),we(K,"keydown",or(e,ps)),we(K,"keypress",or(e,gs)),we(K,"focus",function(Y){return Sa(e,Y)}),we(K,"blur",function(Y){return Ji(e,Y)})}var Ga=[];Vt.defineInitHook=function(e){return Ga.push(e)};function Fn(e,t,i,r){var n=e.doc,S;i==null&&(i="add"),i=="smart"&&(n.mode.indent?S=Je(e,t).state:i="prev");var N=e.options.tabSize,K=ct(n,t),Y=ee(K.text,null,N);K.stateAfter&&(K.stateAfter=null);var q=K.text.match(/^\s*/)[0],ae;if(!r&&!/\S/.test(K.text))ae=0,i="not";else if(i=="smart"&&(ae=n.mode.indent(S,K.text.slice(q.length),K.text),ae==Me||ae>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?ae=ee(ct(n,t-1).text,null,N):ae=0:i=="add"?ae=Y+e.options.indentUnit:i=="subtract"?ae=Y-e.options.indentUnit:typeof i=="number"&&(ae=Y+i),ae=Math.max(0,ae);var le="",be=0;if(e.options.indentWithTabs)for(var ye=Math.floor(ae/N);ye;--ye)be+=N,le+=" ";if(beN,Y=St(t),q=null;if(K&&r.ranges.length>1)if(qr&&qr.text.join(` `)==t){if(r.ranges.length%qr.text.length==0){q=[];for(var ae=0;ae=0;be--){var ye=r.ranges[be],ke=ye.from(),Fe=ye.to();ye.empty()&&(i&&i>0?ke=Ge(ke.line,ke.ch-i):e.state.overwrite&&!K?Fe=Ge(Fe.line,Math.min(ct(S,Fe.line).text.length,Fe.ch+De(Y).length)):K&&qr&&qr.lineWise&&qr.text.join(` `)==Y.join(` `)&&(ke=Fe=Ge(ke.line,0)));var Ve={from:ke,to:Fe,text:q?q[be%q.length]:Y,origin:n||(K?"paste":e.state.cutIncoming>N?"cut":"+input")};tn(e.doc,Ve),cr(e,"inputRead",e,Ve)}t&&!K&&As(e,t),Zi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=le),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ss(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Or(t,function(){return za(t,i,0,null,"paste")}),!0}function As(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)continue;var S=e.getModeAt(n.head),N=!1;if(S.electricChars){for(var K=0;K-1){N=Fn(e,n.head.line,"smart");break}}else S.electricInput&&(S.electricInput.test(ct(e.doc,n.head.line).text.slice(0,n.head.ch))&&(N=Fn(e,n.head.line,"smart")));N&&cr(e,"electricInput",e,n.head.line)}}function Ts(e){for(var t=[],i=[],r=0;rS&&(Fn(this,K.head.line,r,!0),S=K.head.line,N==this.doc.sel.primIndex&&Zi(this));else{var Y=K.from(),q=K.to(),ae=Math.max(S,Y.line);S=Math.min(this.lastLine(),q.line-(q.ch?0:1))+1;for(var le=ae;le0&&Ba(this.doc,N,new Wt(Y,be[N].to()),xe)}}}),getTokenAt:function(r,n){return Kt(this,r,n)},getLineTokens:function(r,n){return Kt(this,Ge(r),n,!0)},getTokenTypeAt:function(r){r=s(this.doc,r);var n=Pe(this,ct(this.doc,r.line)),S=0,N=(n.length-1)/2,K=r.ch,Y;if(K==0)Y=n[2];else for(;;){var q=S+N>>1;if((q?n[q*2-1]:0)>=K)N=q;else if(n[q*2+1]Y&&(r=Y,N=!0),K=ct(this.doc,r)}else K=r;return Hn(this,K,{top:0,left:0},n||"page",S||N).top+(N?this.doc.height-Xr(K):0)},defaultTextHeight:function(){return Yi(this.display)},defaultCharWidth:function(){return Xi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,S,N,K){var Y=this.display;r=Jr(this,s(this.doc,r));var q=r.bottom,ae=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),Y.sizer.appendChild(n),N=="over")q=r.top;else if(N=="above"||N=="near"){var le=Math.max(Y.wrapper.clientHeight,this.doc.height),be=Math.max(Y.sizer.clientWidth,Y.lineSpace.clientWidth);(N=="above"||r.bottom+n.offsetHeight>le)&&r.top>n.offsetHeight?q=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=le&&(q=r.bottom),ae+n.offsetWidth>be&&(ae=be-n.offsetWidth)}n.style.top=q+"px",n.style.left=n.style.right="",K=="right"?(ae=Y.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(K=="left"?ae=0:K=="middle"&&(ae=(Y.sizer.clientWidth-n.offsetWidth)/2),n.style.left=ae+"px"),S&&Js(this,{left:ae,top:q,right:ae+n.offsetWidth,bottom:q+n.offsetHeight})},triggerOnKeyDown:Cr(ps),triggerOnKeyPress:Cr(gs),triggerOnKeyUp:ms,triggerOnMouseDown:Cr(vs),execCommand:function(r){if(_n.hasOwnProperty(r))return _n[r].call(null,this)},triggerElectric:Cr(function(r){As(this,r)}),findPosH:function(r,n,S,N){var K=1;n<0&&(K=-1,n=-n);for(var Y=s(this.doc,r),q=0;q0&&ae(S.charAt(N-1));)--N;for(;K.5||this.options.lineWrapping)&&xa(this),Re(this,"refresh",this)}),swapDoc:Cr(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Po(this,r),yn(this),this.display.input.reset(),En(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,cr(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},fe(e),e.registerHelper=function(r,n,S){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=S},e.registerGlobalHelper=function(r,n,S,N){e.registerHelper(r,n,N),i[r]._global.push({pred:S,val:N})}}function Ka(e,t,i,r,n){var S=t,N=i,K=ct(e,t.line),Y=n&&e.direction=="rtl"?-i:i;function q(){var st=t.line+Y;return st=e.first+e.size?!1:(t=new Ge(st,t.ch,t.sticky),K=ct(e,st))}function ae(st){var et;if(r=="codepoint"){var lt=K.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(lt)?et=null:et=new Ge(t.line,Math.max(0,Math.min(K.text.length,t.ch+i*(lt>=55296&<<56320?2:1))),-i)}else n?et=Pl(e.cm,K,t,i):et=Ua(K,t,i);if(et==null)if(!st&&q())t=Fa(n,e.cm,K,t.line,Y);else return!1;else t=et;return!0}if(r=="char"||r=="codepoint")ae();else if(r=="column")ae(!0);else if(r=="word"||r=="group")for(var le=null,be=r=="group",ye=e.cm&&e.cm.getHelper(t,"wordChars"),ke=!0;!(i<0&&!ae(!ke));ke=!1){var Fe=K.text.charAt(t.ch)||` `,Ve=Ue(Fe,ye)?"w":be&&Fe==` `?"n":!be||/\s/.test(Fe)?null:"p";if(be&&!ke&&!Ve&&(Ve="s"),le&&le!=Ve){i<0&&(i=1,ae(),t.sticky="after");break}if(Ve&&(le=Ve),i>0&&!ae(!ke))break}var $e=ea(e,t,S,N,!0);return pi(S,$e)&&($e.hitSide=!0),$e}function Ls(e,t,i,r){var n=e.doc,S=t.left,N;if(r=="page"){var K=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Y=Math.max(K-.5*Yi(e.display),3);N=(i>0?t.bottom:t.top)+i*Y}else r=="line"&&(N=i>0?t.bottom+3:t.top-3);for(var q;!(q=va(e,S,N),!q.outside);){if(i<0?N<=0:N>=n.height){q.hitSide=!0;break}N+=i*5}return q}var Ht=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new oe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ht.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;ws(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function S(K){for(var Y=K.target;Y;Y=Y.parentNode){if(Y==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Y.className))break}return!1}we(n,"paste",function(K){if(!S(K)||He(r,K)||Ss(K,r))return;j<=11&&setTimeout(or(r,function(){return t.updateFromDOM()}),20)}),we(n,"compositionstart",function(K){t.composing={data:K.data,done:!1}}),we(n,"compositionupdate",function(K){t.composing||(t.composing={data:K.data,done:!1})}),we(n,"compositionend",function(K){t.composing&&(K.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),we(n,"touchstart",function(){return i.forceCompositionEnd()}),we(n,"input",function(){t.composing||t.readFromDOMSoon()});function N(K){if(!S(K)||He(r,K))return;if(r.somethingSelected())oa({lineWise:!1,text:r.getSelections()}),K.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var Y=Ts(r);oa({lineWise:!0,text:Y.text}),K.type=="cut"&&r.operation(function(){r.setSelections(Y.ranges,0,xe),r.replaceSelection("",null,"cut")})}else return;if(K.clipboardData){K.clipboardData.clearData();var q=qr.text.join(` `);if(K.clipboardData.setData("Text",q),K.clipboardData.getData("Text")==q){K.preventDefault();return}}var ae=Ds(),le=ae.firstChild;r.display.lineSpace.insertBefore(ae,r.display.lineSpace.firstChild),le.value=qr.text.join(` `);var be=document.activeElement;$(le),setTimeout(function(){r.display.lineSpace.removeChild(ae),be.focus(),be==n&&i.showPrimarySelection()},50)}we(n,"copy",N),we(n,"cut",N)},Ht.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ht.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ht.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ht.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ht.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line=t.display.viewFrom&&Rs(t,r)||{node:K[0].measure.map[2],offset:0},q=n.linee.firstLine()&&(r=Ge(r.line-1,ct(e.doc,r.line-1).length)),n.ch==ct(e.doc,n.line).text.length&&n.linet.viewTo-1)return!1;var S,N,K;r.line==t.viewFrom||(S=Ni(e,r.line))==0?(N=Lt(t.view[0].line),K=t.view[0].node):(N=Lt(t.view[S].line),K=t.view[S-1].node.nextSibling);var Y=Ni(e,n.line),q,ae;if(Y==t.view.length-1?(q=t.viewTo-1,ae=t.lineDiv.lastChild):(q=Lt(t.view[Y+1].line)-1,ae=t.view[Y+1].node.previousSibling),!K)return!1;for(var le=e.doc.splitLines(tu(e,K,ae,N,q)),be=Hr(e.doc,Ge(N,0),Ge(q,ct(e.doc,q).text.length));le.length>1&&be.length>1;)if(De(le)==De(be))le.pop(),be.pop(),q--;else if(le[0]==be[0])le.shift(),be.shift(),N++;else break;for(var ye=0,ke=0,Fe=le[0],Ve=be[0],$e=Math.min(Fe.length,Ve.length);ye<$e&&Fe.charCodeAt(ye)==Ve.charCodeAt(ye);)++ye;for(var st=De(le),et=De(be),lt=Math.min(st.length-(le.length==1?ye:0),et.length-(be.length==1?ye:0));ker.ch&&st.charCodeAt(st.length-ke-1)==et.charCodeAt(et.length-ke-1);)ye--,ke++;le[le.length-1]=st.slice(0,st.length-ke).replace(/^\u200b+/,""),le[0]=le[0].slice(ye).replace(/\u200b+$/,"");var xt=Ge(N,ye),vt=Ge(q,be.length?De(be).length-ke:0);if(le.length>1||le[0]||Ct(xt,vt))return rn(e.doc,le,xt,vt,"+input"),!0},Ht.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ht.prototype.reset=function(){this.forceCompositionEnd()},Ht.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ht.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Ht.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Or(this.cm,function(){return wr(e.cm)})},Ht.prototype.setUneditable=function(e){e.contentEditable="false"},Ht.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||or(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ht.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ht.prototype.onContextMenu=function(){},Ht.prototype.resetPosition=function(){},Ht.prototype.needsContentAttribute=!0;function Rs(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var r=ct(e.doc,t.line),n=eo(i,r,t.line),S=rt(r,e.doc.direction),N="left";if(S){var K=tt(S,t.ch);N=K%2?"right":"left"}var Y=io(n.map,t.ch,N);return Y.offset=Y.collapse=="right"?Y.end:Y.start,Y}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ln(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,r,n){var S="",N=!1,K=e.doc.lineSeparator(),Y=!1;function q(ye){return function(ke){return ke.id==ye}}function ae(){N&&(S+=K,Y&&(S+=K),N=Y=!1)}function le(ye){ye&&(ae(),S+=ye)}function be(ye){if(ye.nodeType==1){var ke=ye.getAttribute("cm-text");if(ke){le(ke);return}var Fe=ye.getAttribute("cm-marker"),Ve;if(Fe){var $e=e.findMarks(Ge(r,0),Ge(n+1,0),q(+Fe));$e.length&&(Ve=$e[0].find(0))&&le(Hr(e.doc,Ve.from,Ve.to).join(K));return}if(ye.getAttribute("contenteditable")=="false")return;var st=/^(pre|div|p|li|table|br)$/i.test(ye.nodeName);if(!/^br$/i.test(ye.nodeName)&&ye.textContent.length==0)return;st&&ae();for(var et=0;et=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),we(n,"paste",function(N){if(He(r,N)||Ss(N,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function S(N){if(He(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)}we(n,"cut",S),we(n,"copy",S),we(e.scroller,"paste",function(N){if(ui(e,N)||He(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)}),we(e.lineSpace,"selectstart",function(N){ui(e,N)||te(N)}),we(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"})}}),we(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},qt.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},qt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=mo(e);if(e.options.moveInputWithCursor){var n=Jr(e,i.sel.primary().head,"div"),S=t.wrapper.getBoundingClientRect(),N=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+N.top-S.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+N.left-S.left))}return r},qt.prototype.showSelection=function(e){var t=this.cm,i=t.display;u(i.cursorDiv,e.cursors),u(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&$(this.textarea),G&&j>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",G&&j>=9&&(this.hasSelection=null))},qt.prototype.getField=function(){return this.textarea},qt.prototype.supportsTouch=function(){return!1},qt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},qt.prototype.blur=function(){this.textarea.blur()},qt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qt.prototype.receivedFocus=function(){this.slowPoll()},qt.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},qt.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||ht(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(G&&j>=9&&this.hasSelection===n||l&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var S=n.charCodeAt(0);if(S==8203&&!r&&(r="\u200B"),S==8666)return this.reset(),this.cm.execCommand("undo")}for(var N=0,K=Math.min(r.length,n.length);N1e3||n.indexOf(` `)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qt.prototype.onKeyPress=function(){G&&j>=9&&(this.hasSelection=null),this.fastPoll()},qt.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var S=Bi(i,e),N=r.scroller.scrollTop;if(!S||T)return;var K=i.options.resetSelectionOnContextMenu;K&&i.doc.sel.contains(S)==-1&&or(i,br)(i.doc,Ti(S),xe);var Y=n.style.cssText,q=t.wrapper.style.cssText,ae=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-ae.top-5)+"px; left: "+(e.clientX-ae.left-5)+`px; z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var le;O&&(le=window.scrollY),r.input.focus(),O&&window.scrollTo(null,le),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 Fe=i.somethingSelected(),Ve="\u200B"+(Fe?n.value:"");n.value="\u21DA",n.value=Ve,t.prevInput=Fe?"":"\u200B",n.selectionStart=1,n.selectionEnd=Ve.length,r.selForContextMenu=i.doc.sel}}function ye(){if(t.contextMenuPending!=ye)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=q,n.style.cssText=Y,G&&j<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=N),n.selectionStart!=null){(!G||G&&j<9)&&be();var Fe=0,Ve=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?or(i,Qo)(i):Fe++<10?r.detectingSelectAll=setTimeout(Ve,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Ve,200)}}if(G&&j>=9&&be(),L){ue(e);var ke=function(){at(window,"mouseup",ke),setTimeout(ye,20)};we(window,"mouseup",ke)}else setTimeout(ye,50)},qt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qt.prototype.setUneditable=function(){},qt.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?U(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&&(we(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var S=e.form;n=S.submit;try{var N=S.submit=function(){r(),S.submit=n,S.submit(),S.submit=N}}catch(Y){}}t.finishInit=function(Y){Y.save=r,Y.getTextArea=function(){return e},Y.toTextArea=function(){Y.toTextArea=isNaN,r(),e.parentNode.removeChild(Y.getWrapperElement()),e.style.display="",e.form&&(at(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var K=Vt(function(Y){return e.parentNode.insertBefore(Y,e.nextSibling)},t);return K}function nu(e){e.off=at,e.on=we,e.wheelEventPixels=dl,e.Doc=Dr,e.splitLines=St,e.countColumn=ee,e.findColumn=Ce,e.isWordChar=Oe,e.Pass=Me,e.signal=Re,e.Line=Oi,e.changeEnd=wi,e.scrollbarModel=So,e.Pos=Ge,e.cmpPos=Ct,e.modes=Qt,e.mimeModes=It,e.resolveMode=Et,e.getMode=Br,e.modeExtensions=hr,e.extendMode=pr,e.copyState=Nr,e.startState=$r,e.innerMode=ci,e.commands=_n,e.keyMap=hi,e.keyName=us,e.isModifierKey=ss,e.lookupKey=an,e.normalizeKeyMap=Ol,e.StringStream=_t,e.SharedTextMarker=Mn,e.TextMarker=Li,e.LineWidget=In,e.e_preventDefault=te,e.e_stopPropagation=re,e.e_stop=ue,e.addClass=H,e.contains=C,e.rmClass=p,e.keyNames=Ri}Xl(Vt),$l(Vt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Dr.prototype)Dr.prototype.hasOwnProperty(la)&&ce(au,la)<0&&(Vt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Dr.prototype[la]));return fe(Dr),Vt.inputStyles={textarea:qt,contenteditable:Ht},Vt.defineMode=function(e){!Vt.defaults.mode&&e!="null"&&(Vt.defaults.mode=e),_r.apply(this,arguments)},Vt.defineMIME=Kr,Vt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Vt.defineMIME("text/plain","null"),Vt.defineExtension=function(e,t){Vt.prototype[e]=t},Vt.defineDocExtension=function(e,t){Dr.prototype[e]=t},Vt.fromTextArea=iu,nu(Vt),Vt.version="5.58.2",Vt})},W1YM:function(Ie,Le,Z){},W6BS:function(Ie,Le){Ie.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bYQBIEkaBEAkqbRmo/9FulSoX2Qz9GVVQJqUJBhKKA1KRJCIlowwdDDDa+jOd65syc275f1v1d1fOufYYE2ZhJZKRWXjOjvffaa6/1/p//8/yfyzuqLMuS/48P9RrA/8fZfY3B2yXQBHQpf185tBUK+SvH8uV2H/eK1/+jGfwRIBC5ks/Vq/yplq2Wqz+B/ONg5LNlrlz+Qhnot373iih+wgX/YIAivrJgjTKA9BKcYa/Uy/MnUEpD0S2AyzdKkMslZYklbwVYWZpXQSygrSVoc+4fcPzUAKtsom4xpIGiLCkMZbJGs1LkvOH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2pc6bgE0u7IvsRUs56M4Yj6dmfJrOhwyGE8YjkaMxkNmszlpLDGbkeUx02RAlC2Y5UeUSZ+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(Ie,Le,Z){Ie.exports=Z.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Ie,Le,Z){"use strict";Z.r(Le),Z.d(Le,"ResizableTextArea",function(){return ce});var ie=Z("wx14"),X=Z("1OyB"),R=Z("vuIU"),Q=Z("Ji7U"),B=Z("LK+K"),_=Z("q1tI"),G=Z("VTBJ"),j=Z("rePB"),O=Z("Zm9Q"),I=Z("Kwbf"),y=Z("c+Xe"),T=Z("m+aA"),k=Z("bdgK"),D=new Map;function w(xe){xe.forEach(function(Ae){var Ee,Ce=Ae.target;(Ee=D.get(Ce))===null||Ee===void 0||Ee.forEach(function(pe){return pe(Ce)})})}var A=new k.default(w),d=null,o=null;function l(xe,Ae){D.has(xe)||(D.set(xe,new Set),A.observe(xe)),D.get(xe).add(Ae)}function h(xe,Ae){D.has(xe)&&(D.get(xe).delete(Ae),D.get(xe).size||(A.unobserve(xe),D.delete(xe)))}var E=function(xe){Object(Q.a)(Ee,xe);var Ae=Object(B.a)(Ee);function Ee(){return Object(X.a)(this,Ee),Ae.apply(this,arguments)}return Object(R.a)(Ee,[{key:"render",value:function(){return this.props.children}}]),Ee}(_.Component),v=_.createContext(null);function g(xe){var Ae=xe.children,Ee=xe.onBatchResize,Ce=_.useRef(0),pe=_.useRef([]),se=_.useContext(v),De=_.useCallback(function(ze,We,Ke){Ce.current+=1;var Ye=Ce.current;pe.current.push({size:ze,element:We,data:Ke}),Promise.resolve().then(function(){Ye===Ce.current&&(Ee==null||Ee(pe.current),pe.current=[])}),se==null||se(ze,We,Ke)},[Ee,se]);return _.createElement(v.Provider,{value:De},Ae)}function L(xe){var Ae=xe.children,Ee=xe.disabled,Ce=_.useRef(null),pe=_.useRef(null),se=_.useContext(v),De=_.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ze=_.isValidElement(Ae)&&Object(y.c)(Ae),We=ze?Ae.ref:null,Ke=_.useMemo(function(){return Object(y.a)(We,Ce)},[We,Ce]),Ye=_.useRef(xe);Ye.current=xe;var Se=_.useCallback(function(Oe){var Ue=Ye.current,Xe=Ue.onResize,Qe=Ue.data,je=Oe.getBoundingClientRect(),Be=je.width,it=je.height,Ze=Oe.offsetWidth,qe=Oe.offsetHeight,tt=Math.floor(Be),dt=Math.floor(it);if(De.current.width!==tt||De.current.height!==dt||De.current.offsetWidth!==Ze||De.current.offsetHeight!==qe){var rt={width:tt,height:dt,offsetWidth:Ze,offsetHeight:qe};De.current=rt;var nt=Ze===Math.round(Be)?Be:Ze,we=qe===Math.round(it)?it:qe,ut=Object(G.a)(Object(G.a)({},rt),{},{offsetWidth:nt,offsetHeight:we});se==null||se(ut,Oe,Qe),Xe&&Promise.resolve().then(function(){Xe(ut,Oe)})}},[]);return _.useEffect(function(){var Oe=Object(T.a)(Ce.current)||Object(T.a)(pe.current);return Oe&&!Ee&&l(Oe,Se),function(){return h(Oe,Se)}},[Ce.current,Ee]),_.createElement(E,{ref:pe},ze?_.cloneElement(Ae,{ref:Ke}):Ae)}var x="rc-observer-key";function p(xe){var Ae=xe.children,Ee=Object(O.a)(Ae);return Ee.map(function(Ce,pe){var se=(Ce==null?void 0:Ce.key)||"".concat(x,"-").concat(pe);return _.createElement(L,Object(ie.a)({},xe,{key:se}),Ce)})}p.Collection=g;var c=p,u=Z("bT9E"),a=Z("TSYQ"),b=Z.n(a),m=` 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 `,C=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},H;function V(xe){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ee=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Ae&&P[Ee])return P[Ee];var Ce=window.getComputedStyle(xe),pe=Ce.getPropertyValue("box-sizing")||Ce.getPropertyValue("-moz-box-sizing")||Ce.getPropertyValue("-webkit-box-sizing"),se=parseFloat(Ce.getPropertyValue("padding-bottom"))+parseFloat(Ce.getPropertyValue("padding-top")),De=parseFloat(Ce.getPropertyValue("border-bottom-width"))+parseFloat(Ce.getPropertyValue("border-top-width")),ze=C.map(function(Ke){return"".concat(Ke,":").concat(Ce.getPropertyValue(Ke))}).join(";"),We={sizingStyle:ze,paddingSize:se,borderSize:De,boxSizing:pe};return Ae&&Ee&&(P[Ee]=We),We}function $(xe){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ce=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;H||(H=document.createElement("textarea"),H.setAttribute("tab-index","-1"),H.setAttribute("aria-hidden","true"),document.body.appendChild(H)),xe.getAttribute("wrap")?H.setAttribute("wrap",xe.getAttribute("wrap")):H.removeAttribute("wrap");var pe=V(xe,Ae),se=pe.paddingSize,De=pe.borderSize,ze=pe.boxSizing,We=pe.sizingStyle;H.setAttribute("style","".concat(We,";").concat(m)),H.value=xe.value||xe.placeholder||"";var Ke=Number.MIN_SAFE_INTEGER,Ye=Number.MAX_SAFE_INTEGER,Se=H.scrollHeight,Oe;if(ze==="border-box"?Se+=De:ze==="content-box"&&(Se-=se),Ee!==null||Ce!==null){H.value=" ";var Ue=H.scrollHeight-se;Ee!==null&&(Ke=Ue*Ee,ze==="border-box"&&(Ke=Ke+se+De),Se=Math.max(Ke,Se)),Ce!==null&&(Ye=Ue*Ce,ze==="border-box"&&(Ye=Ye+se+De),Oe=Se>Ye?"":"hidden",Se=Math.min(Ye,Se))}return{height:Se,minHeight:Ke,maxHeight:Ye,overflowY:Oe,resize:"none"}}var z=Z("Gytx"),U=Z.n(z),ee;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(ee||(ee={}));var oe=function(xe){Object(Q.a)(Ee,xe);var Ae=Object(B.a)(Ee);function Ee(Ce){var pe;return Object(X.a)(this,Ee),pe=Ae.call(this,Ce),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(se){pe.textArea=se},pe.handleResize=function(se){var De=pe.state.resizeStatus,ze=pe.props,We=ze.autoSize,Ke=ze.onResize;if(De!==ee.NONE)return;typeof Ke=="function"&&Ke(se),We&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var se=pe.props.autoSize;if(!se||!pe.textArea)return;var De=se.minRows,ze=se.maxRows,We=$(pe.textArea,!1,De,ze);pe.setState({textareaStyles:We,resizeStatus:ee.RESIZING},function(){cancelAnimationFrame(pe.resizeFrameId),pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:ee.RESIZED},function(){pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:ee.NONE}),pe.fixFirefoxAutoScroll()})})})})},pe.renderTextArea=function(){var se=pe.props,De=se.prefixCls,ze=De===void 0?"rc-textarea":De,We=se.autoSize,Ke=se.onResize,Ye=se.className,Se=se.disabled,Oe=pe.state,Ue=Oe.textareaStyles,Xe=Oe.resizeStatus,Qe=Object(u.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),je=b()(ze,Ye,Object(j.a)({},"".concat(ze,"-disabled"),Se));"value"in Qe&&(Qe.value=Qe.value||"");var Be=Object(G.a)(Object(G.a)(Object(G.a)({},pe.props.style),Ue),Xe===ee.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return _.createElement(c,{onResize:pe.handleResize,disabled:!(We||Ke)},_.createElement("textarea",Object(ie.a)({},Qe,{className:je,style:Be,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:ee.NONE},pe}return Object(R.a)(Ee,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!U()(pe.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var pe=this.textArea.selectionStart,se=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,se)}}catch(De){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ee}(_.Component),ce=oe,ve=function(xe){Object(Q.a)(Ee,xe);var Ae=Object(B.a)(Ee);function Ee(Ce){var pe;Object(X.a)(this,Ee),pe=Ae.call(this,Ce),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(De){pe.resizableTextArea=De},pe.handleChange=function(De){var ze=pe.props.onChange;pe.setValue(De.target.value,function(){pe.resizableTextArea.resizeTextarea()}),ze&&ze(De)},pe.handleKeyDown=function(De){var ze=pe.props,We=ze.onPressEnter,Ke=ze.onKeyDown;De.keyCode===13&&We&&We(De),Ke&&Ke(De)};var se=typeof Ce.value=="undefined"||Ce.value===null?Ce.defaultValue:Ce.value;return pe.state={value:se},pe}return Object(R.a)(Ee,[{key:"setValue",value:function(pe,se){"value"in this.props||this.setState({value:pe},se)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return _.createElement(ce,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(pe){return"value"in pe?{value:pe.value}:null}}]),Ee}(_.Component),Me=Le.default=ve},ZpRC:function(Ie,Le,Z){"use strict";function ie(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function X(y,T){return(!T||y!=="hidden")&&y!=="visible"&&y!=="clip"}function R(y,T){if(y.clientHeightT||A>y&&d=T&&o>=k?A-y-D:d>T&&ok?d-T+w:0}var B=function(y,T){var k=window,D=T.scrollMode,w=T.block,A=T.inline,d=T.boundary,o=T.skipOverflowHiddenElements,l=typeof d=="function"?d:function(Ue){return Ue!==d};if(!ie(y))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,E=[],v=y;ie(v)&&l(v);){if((v=v.parentElement)===h){E.push(v);break}v!=null&&v===document.body&&R(v)&&!R(document.documentElement)||v!=null&&R(v,o)&&E.push(v)}for(var g=k.visualViewport?k.visualViewport.width:innerWidth,L=k.visualViewport?k.visualViewport.height:innerHeight,x=window.scrollX||pageXOffset,p=window.scrollY||pageYOffset,c=y.getBoundingClientRect(),u=c.height,a=c.width,b=c.top,m=c.right,C=c.bottom,P=c.left,H=w==="start"||w==="nearest"?b:w==="end"?C:b+u/2,V=A==="center"?P+a/2:A==="end"?m:P,$=[],z=0;z=0&&P>=0&&C<=L&&m<=g&&b>=ve&&C<=xe&&P>=Ae&&m<=Me)return $;var Ee=getComputedStyle(U),Ce=parseInt(Ee.borderLeftWidth,10),pe=parseInt(Ee.borderTopWidth,10),se=parseInt(Ee.borderRightWidth,10),De=parseInt(Ee.borderBottomWidth,10),ze=0,We=0,Ke="offsetWidth"in U?U.offsetWidth-U.clientWidth-Ce-se:0,Ye="offsetHeight"in U?U.offsetHeight-U.clientHeight-pe-De:0;if(h===U)ze=w==="start"?H:w==="end"?H-L:w==="nearest"?Q(p,p+L,L,pe,De,p+H,p+H+u,u):H-L/2,We=A==="start"?V:A==="center"?V-g/2:A==="end"?V-g:Q(x,x+g,g,Ce,se,x+V,x+V+a,a),ze=Math.max(0,ze+p),We=Math.max(0,We+x);else{ze=w==="start"?H-ve-pe:w==="end"?H-xe+De+Ye:w==="nearest"?Q(ve,xe,oe,pe,De+Ye,H,H+u,u):H-(ve+oe/2)+Ye/2,We=A==="start"?V-Ae-Ce:A==="center"?V-(Ae+ce/2)+Ke/2:A==="end"?V-Me+se+Ke:Q(Ae,Me,ce,Ce,se+Ke,V,V+a,a);var Se=U.scrollLeft,Oe=U.scrollTop;H+=Oe-(ze=Math.max(0,Math.min(Oe+ze,U.scrollHeight-oe+Ye))),V+=Se-(We=Math.max(0,Math.min(Se+We,U.scrollWidth-ce+Ke)))}$.push({el:U,top:ze,left:We})}return $};function _(y){return y===Object(y)&&Object.keys(y).length!==0}function G(y,T){T===void 0&&(T="auto");var k="scrollBehavior"in document.body.style;y.forEach(function(D){var w=D.el,A=D.top,d=D.left;w.scroll&&k?w.scroll({top:A,left:d,behavior:T}):(w.scrollTop=A,w.scrollLeft=d)})}function j(y){return y===!1?{block:"end",inline:"nearest"}:_(y)?y:{block:"start",inline:"nearest"}}function O(y,T){var k=!y.ownerDocument.documentElement.contains(y);if(_(T)&&typeof T.behavior=="function")return T.behavior(k?[]:B(y,T));if(k)return;var D=j(T);return G(B(y,D),D.behavior)}var I=Le.a=O},bT9E:function(Ie,Le,Z){"use strict";Z.d(Le,"a",function(){return X});var ie=Z("VTBJ");function X(R,Q){var B=Object(ie.a)({},R);return Array.isArray(Q)&&Q.forEach(function(_){delete B[_]}),B}},c5Ni:function(Ie,Le,Z){},cRFk:function(Ie,Le,Z){Ie.exports=Z.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Ie,Le,Z){Ie.exports=Z.p+"static/choose.4ad1045f.svg"},dejd:function(Ie,Le,Z){},djh8:function(Ie,Le,Z){Ie.exports=Z.p+"static/qrCode.d852fdfc.png"},dmUQ:function(Ie,Le,Z){"use strict";var ie=Z("Ff2n"),X=Z("rePB"),R=Z("1OyB"),Q=Z("vuIU"),B=Z("Ji7U"),_=Z("md7G"),G=Z("foSv"),j=Z("q1tI"),O=Z.n(j),I=Z("TSYQ"),y=Z.n(I),T=Z("4IlW");function k(u,a){var b=Object.keys(u);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(u);a&&(m=m.filter(function(C){return Object.getOwnPropertyDescriptor(u,C).enumerable})),b.push.apply(b,m)}return b}function D(u){for(var a=1;a1?ce-1:0),Me=1;Me1?z-1:0),ee=1;ee=0)return parseInt($.slice($.indexOf("e-")+2),10);var z=0;return $.indexOf(".")>=0&&(z=$.length-$.indexOf(".")-1),z},C.getInputDisplayValue=function(V){var $=V||C.state,z=$.focused,U=$.inputValue,ee=$.value,oe;z?oe=U:oe=C.toPrecisionAsStep(ee),oe==null&&(oe="");var ce=C.formatWrapper(oe);return g(C.props.decimalSeparator)&&(ce=ce.toString().replace(".",C.props.decimalSeparator)),ce},C.recordCursorPosition=function(){try{C.cursorStart=C.input.selectionStart,C.cursorEnd=C.input.selectionEnd,C.currentValue=C.input.value,C.cursorBefore=C.input.value.substring(0,C.cursorStart),C.cursorAfter=C.input.value.substring(C.cursorEnd)}catch(V){}},C.restoreByAfter=function(V){if(V===void 0)return!1;var $=C.input.value,z=$.lastIndexOf(V);if(z===-1)return!1;var U=C.cursorBefore.length;return C.lastKeyCode===T.a.DELETE&&C.cursorBefore.charAt(U-1)===V[0]?(C.fixCaret(U,U),!0):z+V.length===$.length?(C.fixCaret(z,z),!0):!1},C.partRestoreByAfter=function(V){return V===void 0?!1:Array.prototype.some.call(V,function($,z){var U=V.substring(z);return C.restoreByAfter(U)})},C.isNotCompleteNumber=function(V){return isNaN(V)||V===""||V===null||V&&V.toString().indexOf(".")===V.toString().length-1},C.stop=function(){C.autoStepTimer&&clearTimeout(C.autoStepTimer)},C.down=function(V,$,z){C.pressingUpOrDown=!0,C.step("down",V,$,z)},C.up=function(V,$,z){C.pressingUpOrDown=!0,C.step("up",V,$,z)},C.saveInput=function(V){C.input=V};var P=m.value;P===void 0&&(P=m.defaultValue),C.state={focused:m.autoFocus};var H=C.getValidValue(C.toNumber(P));return C.state=D(D({},C.state),{},{inputValue:C.toPrecisionAsStep(H),value:H}),C}return Object(Q.a)(b,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(C){var P=this.props,H=P.value,V=P.onChange,$=P.max,z=P.min,U=this.state.focused;if(C){if(!L(C.value,H)||!L(C.max,$)||!L(C.min,z)){var ee=U?H:this.getValidValue(H),oe;this.pressingUpOrDown?oe=ee:this.inputting?oe=this.rawInput:oe=this.toPrecisionAsStep(ee),this.setState({value:ee,inputValue:oe})}var ce="value"in this.props?H:this.state.value;"max"in this.props&&C.max!==$&&typeof ce=="number"&&ce>$&&V&&V($),"min"in this.props&&C.min!==z&&typeof ce=="number"&&ce1&&arguments[1]!==void 0?arguments[1]:this.props.min,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,V=parseFloat(C);return isNaN(V)?C:(VH&&(V=H),V)}},{key:"setValue",value:function(C,P){var H=this.props.precision,V=this.isNotCompleteNumber(parseFloat(C))?null:parseFloat(C),$=this.state.value,z=$===void 0?null:$,U=this.state.inputValue,ee=U===void 0?null:U,oe=typeof V=="number"?V.toFixed(H):"".concat(V),ce=V!==z||oe!=="".concat(ee);return"value"in this.props?(ee=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:ee},P)):this.setState({value:V,inputValue:this.toPrecisionAsStep(C)},P),ce&&this.props.onChange(V),V}},{key:"getMaxPrecision",value:function(C){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.props,V=H.precision,$=H.step;if(g(V))return V;var z=this.getPrecision(P),U=this.getPrecision($),ee=this.getPrecision(C);return C?Math.max(ee,z+U):z+U}},{key:"getPrecisionFactor",value:function(C){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.getMaxPrecision(C,P);return Math.pow(10,H)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(C){return this.props.formatter?this.props.formatter(C):C}},{key:"toPrecisionAsStep",value:function(C){if(this.isNotCompleteNumber(C)||C==="")return C;var P=Math.abs(this.getMaxPrecision(C));return isNaN(P)?C.toString():Number(C).toFixed(P)}},{key:"toNumber",value:function(C){var P=this.props.precision,H=this.state.focused,V=C&&C.length>16&&H;return this.isNotCompleteNumber(C)||V?C:g(P)?Math.round(C*Math.pow(10,P))/Math.pow(10,P):Number(C)}},{key:"upStep",value:function(C,P){var H=this.props.step,V=this.getPrecisionFactor(C,P),$=Math.abs(this.getMaxPrecision(C,P)),z=((V*C+V*H*P)/V).toFixed($);return this.toNumber(z)}},{key:"downStep",value:function(C,P){var H=this.props.step,V=this.getPrecisionFactor(C,P),$=Math.abs(this.getMaxPrecision(C,P)),z=((V*C-V*H*P)/V).toFixed($);return this.toNumber(z)}},{key:"step",value:function(C,P){var H=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,$=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var z=this.props;if(z.disabled)return;var U=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(U))return;var ee=this["".concat(C,"Step")](U,V),oe=ee>z.max||eez.max?ee=z.max:ee=ve),He=(dt||dt===0)&&(isNaN(dt)||Number(dt)<=Me),ge=Re||V||$,de=He||V||$,fe=y()("".concat(H,"-handler"),"".concat(H,"-handler-up"),Object(X.a)({},"".concat(H,"-handler-up-disabled"),ge)),te=y()("".concat(H,"-handler"),"".concat(H,"-handler-down"),Object(X.a)({},"".concat(H,"-handler-down-disabled"),de)),re=z?{onTouchStart:ge?d:this.up,onTouchEnd:this.stop}:{onMouseDown:ge?d:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ne=z?{onTouchStart:de?d:this.down,onTouchEnd:this.stop}:{onMouseDown:de?d:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:nt,style:xe,title:Ae,onMouseEnter:Ee,onMouseLeave:Ce,onMouseOver:pe,onMouseOut:se,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(H,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Increase Value","aria-disabled":ge,className:fe}),ee||O.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-up-inner"),onClick:o})),O.a.createElement("span",Object.assign({unselectable:"on"},ne,{role:"button","aria-label":"Decrease Value","aria-disabled":de,className:te}),oe||O.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-down-inner"),onClick:o}))),O.a.createElement("div",{className:"".concat(H,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Me,"aria-valuemax":ve,"aria-valuenow":dt,required:De,type:Ke,placeholder:Ye,onPaste:it,onClick:ze,onMouseUp:this.onMouseUp,className:"".concat(H,"-input"),tabIndex:We,autoComplete:U,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ut?this.onKeyDown:d,onKeyUp:ut?this.onKeyUp:d,autoFocus:je,maxLength:Qe,readOnly:$,disabled:V,max:ve,min:Me,step:Xe,name:Be,title:Ae,id:Se,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(at),pattern:Ue,inputMode:Oe,onInput:Ze},we))))}}]),b}(O.a.Component);x.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:d,onKeyDown:d,onPressEnter:d,onFocus:d,onBlur:d,parser:l,required:!1,autoComplete:"off"};var p=x,c=Le.a=p},ji0R:function(Ie,Le,Z){Ie.exports=Z.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Ie,Le,Z){Ie.exports=Z.p+"static/question.cb52bef9.gif"},kPYp:function(Ie,Le){Ie.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/yWGX2YZtv5untT0dJ7SpOZrAX9mLTeIYarAIIQEYLrZTQNNFj7A8rx6/GrPfDncPmdihV6Y9nkA+Ot4nrIXaDSGElH6KfjdzpBSpVo8ttVU8Xitx/7hw/imWmYD4wXy6Iqjje9mOGYj/uX0bjYf/5nsaLcpY9fqDZ5hNTD8/wi+27bB+CzfOVcqSiq0BMPdRpiBUNANmHNvJUQo1ZFls0lTuXupnOw+0UVamMsCz+eHCuf3MWgUjZ3w76kUZQeW8j4iOnadXmCUNQI3xvsIbl7bX70MEdKpFLutcCA7iz/BxvfrfY2hNVXDb2v2s/TkU/Lf8SZXrtOcUxFfF8P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wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(Ie,Le,Z){},l2Kq:function(Ie,Le,Z){Ie.exports=Z.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Ie,Le,Z){(function(ie){ie(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function(X,R){var Q=ie.getMode(X,"text/html"),B=Q.name=="null";function _(z){if(ie.findModeByName){var U=ie.findModeByName(z);U&&(z=U.mime||U.mimes[0])}var ee=ie.getMode(X,z);return ee.name=="null"?null:ee}R.highlightFormatting===void 0&&(R.highlightFormatting=!1),R.maxBlockquoteDepth===void 0&&(R.maxBlockquoteDepth=0),R.taskLists===void 0&&(R.taskLists=!1),R.strikethrough===void 0&&(R.strikethrough=!1),R.emoji===void 0&&(R.emoji=!1),R.fencedCodeBlockHighlighting===void 0&&(R.fencedCodeBlockHighlighting=!0),R.fencedCodeBlockDefaultMode===void 0&&(R.fencedCodeBlockDefaultMode="text/plain"),R.xml===void 0&&(R.xml=!0),R.tokenTypeOverrides===void 0&&(R.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var j in G)G.hasOwnProperty(j)&&R.tokenTypeOverrides[j]&&(G[j]=R.tokenTypeOverrides[j]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,T=R.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,k=/^ {0,3}(?:\={1,}|-{2,})\s*$/,D=/^[^#!\[\]*_\\<>` "'(~:]+/,w=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,A=/^\s*\[[^\]]+?\]:.*$/,d=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,o=" ";function l(z,U,ee){return U.f=U.inline=ee,ee(z,U)}function h(z,U,ee){return U.f=U.block=ee,ee(z,U)}function E(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==L){var U=B;if(!U){var ee=ie.innerMode(Q,z.htmlState);U=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}U&&(z.f=u,z.block=g,z.htmlState=null)}return z.trailingSpace=0,z.trailingSpaceNewLine=!1,z.prevLine=z.thisLine,z.thisLine={stream:null},null}function g(z,U){var ee=z.column()===U.indentation,oe=E(U.prevLine.stream),ce=U.indentedCode,ve=U.prevLine.hr,Me=U.list!==!1,xe=(U.listStack[U.listStack.length-1]||0)+3;U.indentedCode=!1;var Ae=U.indentation;if(U.indentationDiff===null&&(U.indentationDiff=U.indentation,Me)){for(U.list=null;Ae=4&&(ce||U.prevLine.fencedCodeEnd||U.prevLine.header||oe))return z.skipToEnd(),U.indentedCode=!0,G.code;if(z.eatSpace())return null;if(ee&&U.indentation<=xe&&(pe=z.match(T))&&pe[1].length<=6)return U.quote=0,U.header=pe[1].length,U.thisLine.header=!0,R.highlightFormatting&&(U.formatting="header"),U.f=U.inline,p(U);if(U.indentation<=xe&&z.eat(">"))return U.quote=ee?1:U.quote+1,R.highlightFormatting&&(U.formatting="quote"),z.eatSpace(),p(U);if(!Ce&&!U.setext&&ee&&U.indentation<=xe&&(pe=z.match(I))){var se=pe[1]?"ol":"ul";return U.indentation=Ae+z.current().length,U.list=!0,U.quote=0,U.listStack.push(U.indentation),U.em=!1,U.strong=!1,U.code=!1,U.strikethrough=!1,R.taskLists&&z.match(y,!1)&&(U.taskList=!0),U.f=U.inline,R.highlightFormatting&&(U.formatting=["list","list-"+se]),p(U)}else{if(ee&&U.indentation<=xe&&(pe=z.match(w,!0)))return U.quote=0,U.fencedEndRE=new RegExp(pe[1]+"+ *$"),U.localMode=R.fencedCodeBlockHighlighting&&_(pe[2]||R.fencedCodeBlockDefaultMode),U.localMode&&(U.localState=ie.startState(U.localMode)),U.f=U.block=x,R.highlightFormatting&&(U.formatting="code-block"),U.code=-1,p(U);if(U.setext||(!Ee||!Me)&&!U.quote&&U.list===!1&&!U.code&&!Ce&&!A.test(z.string)&&(pe=z.lookAhead(1))&&(pe=pe.match(k)))return U.setext?(U.header=U.setext,U.setext=0,z.skipToEnd(),R.highlightFormatting&&(U.formatting="header")):(U.header=pe[0].charAt(0)=="="?1:2,U.setext=U.header),U.thisLine.header=!0,U.f=U.inline,p(U);if(Ce)return z.skipToEnd(),U.hr=!0,U.thisLine.hr=!0,G.hr;if(z.peek()==="[")return l(z,U,P)}return l(z,U,U.inline)}function L(z,U){var ee=Q.token(z,U.htmlState);if(!B){var oe=ie.innerMode(Q,U.htmlState);(oe.mode.name=="xml"&&oe.state.tagStart===null&&!oe.state.context&&oe.state.tokenize.isInText||U.md_inside&&z.current().indexOf(">")>-1)&&(U.f=u,U.block=g,U.htmlState=null)}return ee}function x(z,U){var ee=U.listStack[U.listStack.length-1]||0,oe=U.indentation=z.quote?U.push(G.formatting+"-"+z.formatting[ee]+"-"+z.quote):U.push("error"))}if(z.taskOpen)return U.push("meta"),U.length?U.join(" "):null;if(z.taskClosed)return U.push("property"),U.length?U.join(" "):null;if(z.linkHref?U.push(G.linkHref,"url"):(z.strong&&U.push(G.strong),z.em&&U.push(G.em),z.strikethrough&&U.push(G.strikethrough),z.emoji&&U.push(G.emoji),z.linkText&&U.push(G.linkText),z.code&&U.push(G.code),z.image&&U.push(G.image),z.imageAltText&&U.push(G.imageAltText,"link"),z.imageMarker&&U.push(G.imageMarker)),z.header&&U.push(G.header,G.header+"-"+z.header),z.quote&&(U.push(G.quote),!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=z.quote?U.push(G.quote+"-"+z.quote):U.push(G.quote+"-"+R.maxBlockquoteDepth)),z.list!==!1){var oe=(z.listStack.length-1)%3;oe?oe===1?U.push(G.list2):U.push(G.list3):U.push(G.list1)}return z.trailingSpaceNewLine?U.push("trailing-space-new-line"):z.trailingSpace&&U.push("trailing-space-"+(z.trailingSpace%2?"a":"b")),U.length?U.join(" "):null}function c(z,U){return z.match(D,!0)?p(U):void 0}function u(z,U){var ee=U.text(z,U);if(typeof ee!="undefined")return ee;if(U.list)return U.list=null,p(U);if(U.taskList){var oe=z.match(y,!0)[1]===" ";return oe?U.taskOpen=!0:U.taskClosed=!0,R.highlightFormatting&&(U.formatting="task"),U.taskList=!1,p(U)}if(U.taskOpen=!1,U.taskClosed=!1,U.header&&z.match(/^#+$/,!0))return R.highlightFormatting&&(U.formatting="header"),p(U);var ce=z.next();if(U.linkTitle){U.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 G.linkHref}if(ce==="`"){var xe=U.formatting;R.highlightFormatting&&(U.formatting="code"),z.eatWhile("`");var Ae=z.current().length;if(U.code==0&&(!U.quote||Ae==1))return U.code=Ae,p(U);if(Ae==U.code){var Ee=p(U);return U.code=0,Ee}else return U.formatting=xe,p(U)}else if(U.code)return p(U);if(ce==="\\"&&(z.next(),R.highlightFormatting)){var Ce=p(U),pe=G.formatting+"-escape";return Ce?Ce+" "+pe:pe}if(ce==="!"&&z.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return U.imageMarker=!0,U.image=!0,R.highlightFormatting&&(U.formatting="image"),p(U);if(ce==="["&&U.imageMarker&&z.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return U.imageMarker=!1,U.imageAltText=!0,R.highlightFormatting&&(U.formatting="image"),p(U);if(ce==="]"&&U.imageAltText){R.highlightFormatting&&(U.formatting="image");var Ce=p(U);return U.imageAltText=!1,U.image=!1,U.inline=U.f=b,Ce}if(ce==="["&&!U.image)return U.linkText&&z.match(/^.*?\]/)||(U.linkText=!0,R.highlightFormatting&&(U.formatting="link")),p(U);if(ce==="]"&&U.linkText){R.highlightFormatting&&(U.formatting="link");var Ce=p(U);return U.linkText=!1,U.inline=U.f=z.match(/\(.*?\)| ?\[.*?\]/,!1)?b:u,Ce}if(ce==="<"&&z.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=a,R.highlightFormatting&&(U.formatting="link");var Ce=p(U);return Ce?Ce+=" ":Ce="",Ce+G.linkInline}if(ce==="<"&&z.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=a,R.highlightFormatting&&(U.formatting="link");var Ce=p(U);return Ce?Ce+=" ":Ce="",Ce+G.linkEmail}if(R.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 De=z.string.substring(z.start,se);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(De)&&(U.md_inside=!0)}return z.backUp(1),U.htmlState=ie.startState(Q),h(z,U,L)}if(R.xml&&ce==="<"&&z.match(/^\/\w*?>/))return U.md_inside=!1,"tag";if(ce==="*"||ce==="_"){for(var ze=1,We=z.pos==1?" ":z.string.charAt(z.pos-2);ze<3&&z.eat(ce);)ze++;var Ke=z.peek()||" ",Ye=!/\s/.test(Ke)&&(!d.test(Ke)||/\s/.test(We)||d.test(We)),Se=!/\s/.test(We)&&(!d.test(We)||/\s/.test(Ke)||d.test(Ke)),Oe=null,Ue=null;if(ze%2&&(!U.em&&Ye&&(ce==="*"||!Se||d.test(We))?Oe=!0:U.em==ce&&Se&&(ce==="*"||!Ye||d.test(Ke))&&(Oe=!1)),ze>1&&(!U.strong&&Ye&&(ce==="*"||!Se||d.test(We))?Ue=!0:U.strong==ce&&Se&&(ce==="*"||!Ye||d.test(Ke))&&(Ue=!1)),Ue!=null||Oe!=null){R.highlightFormatting&&(U.formatting=Oe==null?"strong":Ue==null?"em":"strong em"),Oe===!0&&(U.em=ce),Ue===!0&&(U.strong=ce);var Ee=p(U);return Oe===!1&&(U.em=!1),Ue===!1&&(U.strong=!1),Ee}}else if(ce===" "&&(z.eat("*")||z.eat("_"))){if(z.peek()===" ")return p(U);z.backUp(1)}if(R.strikethrough){if(ce==="~"&&z.eatWhile(ce)){if(U.strikethrough){R.highlightFormatting&&(U.formatting="strikethrough");var Ee=p(U);return U.strikethrough=!1,Ee}else if(z.match(/^[^\s]/,!1))return U.strikethrough=!0,R.highlightFormatting&&(U.formatting="strikethrough"),p(U)}else if(ce===" "&&z.match(/^~~/,!0)){if(z.peek()===" ")return p(U);z.backUp(2)}}if(R.emoji&&ce===":"&&z.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){U.emoji=!0,R.highlightFormatting&&(U.formatting="emoji");var Xe=p(U);return U.emoji=!1,Xe}return ce===" "&&(z.match(/^ +$/,!1)?U.trailingSpace++:U.trailingSpace&&(U.trailingSpaceNewLine=!0)),p(U)}function a(z,U){var ee=z.next();if(ee===">"){U.f=U.inline=u,R.highlightFormatting&&(U.formatting="link");var oe=p(U);return oe?oe+=" ":oe="",oe+G.linkInline}return z.match(/^[^>]+/,!0),G.linkInline}function b(z,U){if(z.eatSpace())return null;var ee=z.next();return ee==="("||ee==="["?(U.f=U.inline=C(ee==="("?")":"]"),R.highlightFormatting&&(U.formatting="link-string"),U.linkHref=!0,p(U)):"error"}var m={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(z){return function(U,ee){var oe=U.next();if(oe===z){ee.f=ee.inline=u,R.highlightFormatting&&(ee.formatting="link-string");var ce=p(ee);return ee.linkHref=!1,ce}return U.match(m[z]),ee.linkHref=!0,p(ee)}}function P(z,U){return z.match(/^([^\]\\]|\\.)*\]:/,!1)?(U.f=H,z.next(),R.highlightFormatting&&(U.formatting="link"),U.linkText=!0,p(U)):l(z,U,u)}function H(z,U){if(z.match(/^\]:/,!0)){U.f=U.inline=V,R.highlightFormatting&&(U.formatting="link");var ee=p(U);return U.linkText=!1,ee}return z.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function V(z,U){return z.eatSpace()?null:(z.match(/^[^\s]+/,!0),z.peek()===void 0?U.linkTitle=!0:z.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),U.f=U.inline=u,G.linkHref+" url")}var $={startState:function(){return{f:g,prevLine:{stream:null},thisLine:{stream:null},block:g,htmlState:null,indentation:0,inline:u,text:c,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(z){return{f:z.f,prevLine:z.prevLine,thisLine:z.thisLine,block:z.block,htmlState:z.htmlState&&ie.copyState(Q,z.htmlState),indentation:z.indentation,localMode:z.localMode,localState:z.localMode?ie.copyState(z.localMode,z.localState):null,inline:z.inline,text:z.text,formatting:!1,linkText:z.linkText,linkTitle:z.linkTitle,linkHref:z.linkHref,code:z.code,em:z.em,strong:z.strong,strikethrough:z.strikethrough,emoji:z.emoji,header:z.header,setext:z.setext,hr:z.hr,taskList:z.taskList,list:z.list,listStack:z.listStack.slice(0),quote:z.quote,indentedCode:z.indentedCode,trailingSpace:z.trailingSpace,trailingSpaceNewLine:z.trailingSpaceNewLine,md_inside:z.md_inside,fencedEndRE:z.fencedEndRE}},token:function(z,U){if(U.formatting=!1,z!=U.thisLine.stream){if(U.header=0,U.hr=!1,z.match(/^\s*$/,!0))return v(U),null;if(U.prevLine=U.thisLine,U.thisLine={stream:z},U.taskList=!1,U.trailingSpace=0,U.trailingSpaceNewLine=!1,!U.localState&&(U.f=U.block,U.f!=L)){var ee=z.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(U.indentation=ee,U.indentationDiff=null,ee>0)return null}}return U.f(z,U)},innerMode:function(z){return z.block==L?{state:z.htmlState,mode:Q}:z.localState?{state:z.localState,mode:z.localMode}:{state:z,mode:$}},indent:function(z,U,ee){return z.block==L&&Q.indent?Q.indent(z.htmlState,U,ee):z.localState&&z.localMode.indent?z.localMode.indent(z.localState,U,ee):ie.Pass},blankLine:v,getType:p,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return $},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},lzim:function(Ie,Le,Z){"use strict";var ie=Z("E7E6"),X=Z.n(ie);Z.d(Le,"w",function(){return X.a});var R=Z("/GNS"),Q=Z.n(R);Z.d(Le,"v",function(){return Q.a});var B=Z("FOrL"),_=Z.n(B);Z.d(Le,"q",function(){return _.a});var G=Z("HpTS"),j=Z.n(G);Z.d(Le,"x",function(){return j.a});var O=Z("tWlo"),I=Z.n(O);Z.d(Le,"a",function(){return I.a});var y=Z("7ZXX"),T=Z.n(y);Z.d(Le,"l",function(){return T.a});var k=Z("GABl"),D=Z.n(k);Z.d(Le,"e",function(){return D.a});var w=Z("onxn"),A=Z.n(w);Z.d(Le,"n",function(){return A.a});var d=Z("nKGa"),o=Z.n(d);Z.d(Le,"m",function(){return o.a});var l=Z("4qgm"),h=Z.n(l);Z.d(Le,"y",function(){return h.a});var E=Z("JeFH"),v=Z.n(E);Z.d(Le,"b",function(){return v.a});var g=Z("ji0R"),L=Z.n(g);Z.d(Le,"i",function(){return L.a});var x=Z("W6BS"),p=Z.n(x);Z.d(Le,"z",function(){return p.a});var c=Z("kPYp"),u=Z.n(c);Z.d(Le,"A",function(){return u.a});var a=Z("nukY"),b=Z.n(a),m=Z("4u4S"),C=Z.n(m),P=Z("yslc"),H=Z.n(P),V=Z("l2Kq"),$=Z.n(V),z=Z("RMFE"),U=Z.n(z);Z.d(Le,"o",function(){return U.a});var ee=Z("TGq3"),oe=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 Ae=Z("JWDV"),Ee=Z.n(Ae),Ce=Z("Xsq0"),pe=Z.n(Ce);Z.d(Le,"p",function(){return pe.a});var se=Z("Ohmc"),De=Z.n(se);Z.d(Le,"c",function(){return De.a});var ze=Z("csWT"),We=Z.n(ze);Z.d(Le,"d",function(){return We.a});var Ke=Z("7v3h"),Ye=Z.n(Ke);Z.d(Le,"k",function(){return Ye.a});var Se=Z("cRFk"),Oe=Z.n(Se);Z.d(Le,"u",function(){return Oe.a});var Ue=Z("kPWJ"),Xe=Z.n(Ue);Z.d(Le,"t",function(){return Xe.a});var Qe=Z("qgvg"),je=Z.n(Qe);Z.d(Le,"r",function(){return je.a});var Be=Z("FPkq"),it=Z.n(Be);Z.d(Le,"s",function(){return it.a});var Ze=Z("A/g1"),qe=Z.n(Ze);Z.d(Le,"f",function(){return qe.a});var tt=Z("Nmxd"),dt=Z.n(tt);Z.d(Le,"g",function(){return dt.a});var rt=Z("5D2P"),nt=Z.n(rt);Z.d(Le,"h",function(){return nt.a});var we=Z("djh8"),ut=Z.n(we),at=Z("Jq4h"),Re=Z.n(at)},nKGa:function(Ie,Le,Z){Ie.exports=Z.p+"static/export_exercise-template.f7655c19.png"},nZ20:function(Ie,Le,Z){Ie.exports={icons:"icons___3O80F"}},nukY:function(Ie,Le){Ie.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EXYdzPzv4hoToZtolVPoQUmgV6E/QVm/hMRNaVQX61SRi3wDOiwg5Tya0qp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89ijK4sQ2HP6dGrDm2PhLotetiNpgPVZXi741I8aN0t80R9Pv/VU4P9kJi0VLnm8iU5cvsOAu1Y//8jLZMlF3SBN0ZrRNFnBG8RRxza2utYf3syDjWVoIjV30Z8kzc7aR6579BgYRl30tvXLH7rPLn+7h8bjlZ5mFP9MDt8EMxD13lt4lpb2ZQc0qegnTeyyKOv2QE5FO3OSgzvFjjporyX6qKNwdMU/6UxpWTfmsuOFCrtZT8WKMKqyJkdbfSPpn5nql4XamMamN5GB0TvUK4KE6HbTqS5ma+eahgtO2ZY9fx2TlKtVziZp3Zl/FigUiZ3wOIYWZ/52pLR35oOU6oPtuw+dNdl6QfsAHmYlMZcEpiXsak6tnQY70bWubrUepjkNJTKTbGv8s8SSlOaD5Z0LwhL4XWmQvSa42rWrgf7+Fn7byVVV5KX6mLbTWcKueEa6etz+M+OphwqlZtmnSUME1bjJyb6vOmm8tc3PvrCeMIJZTLt5zBb1i59tUxuvDeRm+14RscbD1IB9Uo6ZnHRfp2XsX4489Ujy8eT08YTAjSg6Plf333p9HDLpzPlpnEvg4kYH83TrZrxcugy7IkU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(Ie,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var X=ie.Pos;function R(d,o){return d.line-o.line||d.ch-o.ch}var Q="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",B=Q+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",_=new RegExp("<(/?)(["+Q+"]["+B+"]*)","g");function G(d,o,l,h){this.line=o,this.ch=l,this.cm=d,this.text=d.getLine(o),this.min=h?Math.max(h.from,d.firstLine()):d.firstLine(),this.max=h?Math.min(h.to-1,d.lastLine()):d.lastLine()}function j(d,o){var l=d.cm.getTokenTypeAt(X(d.line,o));return l&&/\btag\b/.test(l)}function O(d){return d.line>=d.max?void 0:(d.ch=0,d.text=d.cm.getLine(++d.line),!0)}function I(d){return d.line<=d.min?void 0:(d.text=d.cm.getLine(--d.line),d.ch=d.text.length,!0)}function y(d){for(;;){var o=d.text.indexOf(">",d.ch);if(o==-1){if(O(d))continue;return}if(!j(d,o+1)){d.ch=o+1;continue}var l=d.text.lastIndexOf("/",o),h=l>-1&&!/\S/.test(d.text.slice(l+1,o));return d.ch=o+1,h?"selfClose":"regular"}}function T(d){for(;;){var o=d.ch?d.text.lastIndexOf("<",d.ch-1):-1;if(o==-1){if(I(d))continue;return}if(!j(d,o+1)){d.ch=o;continue}_.lastIndex=o,d.ch=o;var l=_.exec(d.text);if(l&&l.index==o)return l}}function k(d){for(;;){_.lastIndex=d.ch;var o=_.exec(d.text);if(!o){if(O(d))continue;return}if(!j(d,o.index+1)){d.ch=o.index+1;continue}return d.ch=o.index+o[0].length,o}}function D(d){for(;;){var o=d.ch?d.text.lastIndexOf(">",d.ch-1):-1;if(o==-1){if(I(d))continue;return}if(!j(d,o+1)){d.ch=o;continue}var l=d.text.lastIndexOf("/",o),h=l>-1&&!/\S/.test(d.text.slice(l+1,o));return d.ch=o+1,h?"selfClose":"regular"}}function w(d,o){for(var l=[];;){var h=k(d),E,v=d.line,g=d.ch-(h?h[0].length:0);if(!h||!(E=y(d)))return;if(E=="selfClose")continue;if(h[1]){for(var L=l.length-1;L>=0;--L)if(l[L]==h[2]){l.length=L;break}if(L<0&&(!o||o==h[2]))return{tag:h[2],from:X(v,g),to:X(d.line,d.ch)}}else l.push(h[2])}}function A(d,o){for(var l=[];;){var h=D(d);if(!h)return;if(h=="selfClose"){T(d);continue}var E=d.line,v=d.ch,g=T(d);if(!g)return;if(g[1])l.push(g[2]);else{for(var L=l.length-1;L>=0;--L)if(l[L]==g[2]){l.length=L;break}if(L<0&&(!o||o==g[2]))return{tag:g[2],from:X(d.line,d.ch),to:X(E,v)}}}}ie.registerHelper("fold","xml",function(d,o){for(var l=new G(d,o.line,0);;){var h=k(l);if(!h||l.line!=o.line)return;var E=y(l);if(!E)return;if(!h[1]&&E!="selfClose"){var v=X(l.line,l.ch),g=w(l,h[2]);return g&&R(g.from,v)>0?{from:v,to:g.from}:null}}}),ie.findMatchingTag=function(d,o,l){var h=new G(d,o.line,o.ch,l);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var E=y(h),v=E&&X(h.line,h.ch),g=E&&T(h);if(!E||!g||R(h,o)>0)return;var L={from:X(h.line,h.ch),to:v,tag:g[2]};return E=="selfClose"?{open:L,close:null,at:"open"}:g[1]?{open:A(h,g[2]),close:L,at:"close"}:(h=new G(d,v.line,v.ch,l),{open:L,close:w(h,g[2]),at:"open"})},ie.findEnclosingTag=function(d,o,l,h){for(var E=new G(d,o.line,o.ch,l);;){var v=A(E,h);if(!v)break;var g=new G(d,o.line,o.ch,l),L=w(g,v.tag);if(L)return{open:v,close:L}}},ie.scanForClosingTag=function(d,o,l,h){var E=new G(d,o.line,o.ch,h?{from:0,to:h}:null);return w(E,l)}})},p5ED:function(Ie,Le,Z){"use strict";var ie=Z("+L6B"),X=Z("2/Rp"),R=Z("5Dmo"),Q=Z("3S7+"),B=Z("k1fw"),_=Z("9og8"),G=Z("tJVT"),j=Z("WmNS"),O=Z.n(j),I=Z("q1tI"),y=Z.n(I),T=Z("vHTk"),k=Z.n(T),D=Z("yEEn"),w=Z("ZW9T"),A=Z("1vsH"),d=Z("V0Rq"),o=Z("m3rI");Le.a=function(l){var h,E,v,g,L,x,p,c=l.editOffice,u=c===void 0?"view":c,a=l.data,b=l.theme,m=l.type,C=l.filename,P=l.monacoEditor,H=l.className,V=l.style,$=l.close,z=l.onClose,U=l.hasMask,ee=l.disabledDownload,oe=Object(I.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ce=Object(G.a)(oe,2),ve=ce[0],Me=ce[1],xe=Object(I.useState)(""),Ae=Object(G.a)(xe,2),Ee=Ae[0],Ce=Ae[1],pe=Object(I.useState)(),se=Object(G.a)(pe,2),De=se[0],ze=se[1],We=window.ENV==="build"?"/react/build":"",Ke=o.a.PROXY_SERVER||location.origin,Ye,Se=1024*1024,Oe=10*Se,Ue=Object(I.useRef)();(h=a)!==null&&h!==void 0&&h.startsWith("/api")&&m!=="txt"&&(a=o.a.API_SERVER+a),m==="office"&&(Ye=Object(A.T)(a).filesize,Ye>Oe&&(m="other")),C&&P&&(P.filename=C),Object(I.useEffect)(function(){var Be,it,Ze=(Be=document.cookie)===null||Be===void 0||((it=Be.replace(/\s/g,""))===null||it===void 0)?void 0:it.split(";");Ze==null||Ze.map(function(qe){var tt=qe.split("=");tt[0]==="_educoder_session"&&Ce(tt[1])})},[]),Object(I.useEffect)(function(){m==="office"&&Xe()},[m,a]);var Xe=function(){var Be=Object(_.a)(O.a.mark(function it(){var Ze,qe,tt;return O.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return console.log("data:",a),Ze=a,a.startsWith("http")||(Ze=location.origin+Ze),qe=new URL(Ze).pathname.split("/").pop(),rt.next=6,Object(d.V)({attachment_id:qe});case 6:tt=rt.sent,ze(tt);case 8:case"end":return rt.stop()}},it)}));return function(){return Be.apply(this,arguments)}}(),Qe=function(){if(a.startsWith("http")||a.startsWith("blob:")){je();return}Object(A.z)(C||"educoder",a,C)},je=function(){Object(A.x)(C||"educoder",decodeURIComponent(a))};return y.a.createElement("div",{style:Object(B.a)({},V||{}),className:"".concat(U&&k.a.bgBlack," ").concat(m?k.a.wrp:"hide")},$&&y.a.createElement("div",{className:k.a.close,ref:Ue},!ee&&y.a.createElement(Q.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ue.current}},y.a.createElement("span",{onClick:je},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(Q.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ue.current}},y.a.createElement("span",{className:"",onClick:z},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(k.a[H]," ").concat(H," ").concat(k.a.monaco," ").concat(m==="txt"?"show":"hide")},m==="txt"&&y.a.createElement(w.b,P)),m==="audio"&&y.a.createElement("audio",{src:"".concat(((E=a)===null||E===void 0?void 0:E.indexOf("http://"))>-1||((v=a)===null||v===void 0?void 0:v.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(a),autoPlay:!0}),m==="video"&&y.a.createElement(y.a.Fragment,null,((g=a)===null||g===void 0?void 0:g.indexOf("http"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(a),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(a),autoPlay:!0})),m==="office"&&De&&y.a.createElement("iframe",{src:"".concat(We,"/office.html?key=").concat(De.key,"&url=").concat(Ke+De.url,"&callbackUrl=").concat(Ke+De.callbackUrl,"&fileType=").concat(De.fileType,"&title=").concat(De.title,"&model=").concat(u,"&officeServer=").concat(o.a.OFFICE_SERVER,"&disabledDownload=").concat(!!ee)}),m==="html"&&y.a.createElement("iframe",{src:a+"&disposition=inline"}),m==="pdf"&&y.a.createElement("iframe",{src:"".concat(We,"/js/pdfview/index.html?url=").concat(a,"&disabledDownload=").concat(!!ee)}),m==="image"&&y.a.createElement("img",{src:"".concat(((L=a)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((x=a)===null||x===void 0?void 0:x.indexOf("https://"))>-1||(p=a)!==null&&p!==void 0&&p.startsWith("/api")?"":"data:image/png;base64,").concat(a)}),m==="other"&&y.a.createElement("div",null,y.a.createElement(X.a,{type:"primary",size:"large",onClick:Qe},y.a.createElement(D.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),m==="download"&&y.a.createElement(X.a,{type:"primary",size:"large",onClick:Qe},y.a.createElement(D.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ie,Le,Z){},qgvg:function(Ie,Le){Ie.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6c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nY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(Ie,Le){const Z=/[&<>"']/,ie=/[&<>"']/g,X=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},B=x=>Q[x];function _(x,p){if(p){if(Z.test(x))return x.replace(ie,B)}else if(X.test(x))return x.replace(R,B);return x}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function j(x){return x.replace(G,(p,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 I(x,p){x=x.source||x,p=p||"";const c={replace:(u,a)=>(a=a.source||a,a=a.replace(O,"$1"),x=x.replace(u,a),c),getRegex:()=>new RegExp(x,p)};return c}const y=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(x,p,c){if(x){let u;try{u=decodeURIComponent(j(c)).replace(y,"").toLowerCase()}catch(a){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}p&&!T.test(c)&&(c=o(p,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(u){return null}return c}const D={},w=/^[^:]+:\/*[^/]*$/,A=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(x,p){D[" "+x]||(w.test(x)?D[" "+x]=x+"/":D[" "+x]=v(x,"/",!0)),x=D[" "+x];const c=x.indexOf(":")===-1;return p.substring(0,2)==="//"?c?p:x.replace(A,"$1")+p:p.charAt(0)==="/"?c?p:x.replace(d,"$1")+p:x+p}const l={exec:function(){}};function h(x){let p=1,c,u;for(;p{let P=!1,H=m;for(;--H>=0&&C[H]==="\\";)P=!P;return P?"|":" |"}),u=c.split(/ \|/);let a=0;if(u.length>p)u.splice(p);else for(;u.length0},!1)}function y(T,k){for(var D={main:[k]},w={main:[]},A={main:{}};I(D);)for(var d=Object.keys(D),o=0;o=2*L/p||C<=H)return;var V=Number.POSITIVE_INFINITY,$;for($=d.level-1;$>u;$--){var z=c[$].maxBitrate;if(V=L*z/(8*.8*m),V=C)return;var U=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+d.sn+(o?" part "+o.index:"")+" of level "+d.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+$+` Current BW estimate: `+(Object(Q.isFiniteNumber)(U)?(U/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+C.toFixed(3)+` s Estimated load time for the next fragment: `+V.toFixed(3)+` s Time to underbuffer: `+H.toFixed(3)+" s"),l.nextLoadLevel=$,this.bwEstimator.sample(x,g.loaded),this.clearTimer(),d.loader&&(this.fragCurrent=this.partCurrent=null,d.loader.abort()),l.trigger(_.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:d,part:o,stats:g})},w.onFragLoaded=function(d,o){var l=o.frag,h=o.part;if(l.type===O.PlaylistLevelType.MAIN&&Object(Q.isFiniteNumber)(l.sn)){var E=h?h.stats:l.stats,v=h?h.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var g=this.hls.levels[l.level],L=(g.loaded?g.loaded.bytes:0)+E.loaded,x=(g.loaded?g.loaded.duration:0)+v;g.loaded={bytes:L,duration:x},g.realBitrate=Math.round(8*L/x)}if(l.bitrateTest){var p={stats:E,frag:l,part:h,id:l.type};this.onFragBuffered(_.Events.FRAG_BUFFERED,p),l.bitrateTest=!1}}},w.onFragBuffered=function(d,o){var l=o.frag,h=o.part,E=h?h.stats:l.stats;if(E.aborted)return;if(l.type!==O.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var v=E.parsing.end-E.loading.start;this.bwEstimator.sample(v,E.loaded),E.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},w.onError=function(d,o){switch(o.details){case j.ErrorDetails.FRAG_LOAD_ERROR:case j.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},w.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},w.getNextABRAutoLevel=function(){var d=this.fragCurrent,o=this.partCurrent,l=this.hls,h=l.maxAutoLevel,E=l.config,v=l.minAutoLevel,g=l.media,L=o?o.duration:d?d.duration:0,x=g?g.currentTime:0,p=g&&g.playbackRate!==0?Math.abs(g.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():E.abrEwmaDefaultEstimate,u=(G.BufferHelper.bufferInfo(g,x,E.maxBufferHole).end-x)/p,a=this.findBestLevel(c,v,h,u,E.abrBandWidthFactor,E.abrBandWidthUpFactor);if(a>=0)return a;I.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var b=L?Math.min(L,E.maxStarvationDelay):E.maxStarvationDelay,m=E.abrBandWidthFactor,C=E.abrBandWidthUpFactor;if(!u){var P=this.bitrateTestDelay;if(P){var H=L?Math.min(L,E.maxLoadingDelay):E.maxLoadingDelay;b=H-P,I.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*b)+" ms"),m=C=1}}return a=this.findBestLevel(c,v,h,u+b,m,C),Math.max(a,0)},w.findBestLevel=function(d,o,l,h,E,v){for(var g,L=this.fragCurrent,x=this.partCurrent,p=this.lastLoadedFragLevel,c=this.hls.levels,u=c[p],a=!!(u!=null&&(g=u.details)!==null&&g!==void 0&&g.live),b=u==null?void 0:u.codecSet,m=x?x.duration:L?L.duration:0,C=l;C>=o;C--){var P=c[C];if(!P||b&&P.codecSet!==b)continue;var H=P.details,V=(x?H==null?void 0:H.partTarget:H==null?void 0:H.averagetargetduration)||m,$=void 0;C<=p?$=E*d:$=v*d;var z=c[C].maxBitrate,U=z*V/$;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+C+"/"+Math.round($)+"/"+z+"/"+V+"/"+h+"/"+U),$>z&&(!U||a&&!this.bitrateTestDelay||U0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=B.State.IDLE):(this.loadedmetadata=!1,this.state=B.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},p.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_TRACK:{var u,a=this.levels,b=this.trackId,m=a==null||((u=a[b])===null||u===void 0)?void 0:u.details;if(m){if(this.waitForCdnTuneIn(m))break;this.state=B.State.WAITING_INIT_PTS}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var C,P=performance.now(),H=this.retryDate;(!H||P>=H||(C=this.media)!==null&&C!==void 0&&C.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,U=V.cache,ee=V.complete;if(this.initPTS[$.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.FRAG_LOADING;var oe=U.flush(),ce={frag:$,part:z,payload:oe,networkDetails:null};this._handleFragmentLoadProgress(ce),ee&&L.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=G.BufferHelper.bufferInfo(this.mediaBuffer,ve,this.config.maxBufferHole),xe=Object(w.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()},p.clearWaitingFragment=function(){var u=this.waitingData;u&&(this.fragmentTracker.removeFragment(u.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.IDLE)},p.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:u,b=a.buffered;!this.loadedmetadata&&b.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},p.doTickIdle=function(){var u,a,b=this.hls,m=this.levels,C=this.media,P=this.trackId,H=b.config;if(!m||!m[P])return;if(!C&&(this.startFragRequested||!H.startFragPrefetch))return;var V=m[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,I.PlaylistLevelType.AUDIO));var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(z===null)return;var U=z.len,ee=this.getMaxBufferLength(),oe=this.audioSwitch;if(U>=ee&&!oe)return;if(!oe&&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(oe){var xe=this.getLoadPosition();Me=xe,$.PTSKnown&&xeve||z.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),C.currentTime=ve+.05))}var Ae=this.getNextFragment(Me,$);if(!Ae){this.bufferFlushed=!0;return}((u=Ae.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((a=Ae.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Ae,$):this.loadFragment(Ae,$,Me)},p.getMaxBufferLength=function(){var u=L.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return a===null?u:Math.max(u,a.len)},p.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},p.onAudioTracksUpdated=function(u,a){var b=a.audioTracks;this.resetTransmuxer(),this.levels=b.map(function(m){return new O.Level(m)})},p.onAudioTrackSwitching=function(u,a){var b=!!a.url;this.trackId=a.id;var m=this.fragCurrent;m!=null&&m.loader&&m.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()},p.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},p.onLevelLoaded=function(u,a){this.mainDetails=a.details},p.onAudioTrackLoaded=function(u,a){var b,m=this.levels,C=a.details,P=a.id;if(!m){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+C.startSN+","+C.endSN+"],duration:"+C.totalduration);var H=m[P],V=0;if(C.live||(b=H.details)!==null&&b!==void 0&&b.live){var $=this.mainDetails;if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed||!$)return;!H.details&&C.hasProgramDateTime&&$.hasProgramDateTime?(Object(A.alignMediaPlaylistByPDT)(C,$),V=C.fragments[0].start):V=this.alignPlaylists(C,H.details)}H.details=C,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!C.live)&&this.setStartPosition(H.details,V),this.state===B.State.WAITING_TRACK&&!this.waitForCdnTuneIn(C)&&(this.state=B.State.IDLE),this.tick()},p._handleFragmentLoadProgress=function(u){var a,b=u.frag,m=u.part,C=u.payload,P=this.config,H=this.trackId,V=this.levels;if(!V){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+b.sn+" of level "+b.level+" will not be buffered");return}var $=V[H];console.assert($,"Audio track is defined on fragment load progress");var z=$.details;console.assert(z,"Audio track details are defined on fragment load progress");var U=P.defaultAudioCodec||$.audioCodec||"mp4a.40.2",ee=this.transmuxer;ee||(ee=this.transmuxer=new k.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var oe=this.initPTS[b.cc],ce=(a=b.initSegment)===null||a===void 0?void 0:a.data;if(oe!==void 0){var ve=!1,Me=m?m.index:-1,xe=Me!==-1,Ae=new D.ChunkMetadata(b.level,b.sn,b.stats.chunkCount,C.byteLength,Me,xe);ee.push(C,ce,U,"",b,m,z.totalduration,ve,Ae,oe)}else{o.logger.log("Unknown video PTS for cc "+b.cc+", waiting for video PTS before demuxing audio frag "+b.sn+" of ["+z.startSN+" ,"+z.endSN+"],track "+H);var Ee=this.waitingData=this.waitingData||{frag:b,part:m,cache:new T.default,complete:!1},Ce=Ee.cache;Ce.push(new Uint8Array(C)),this.waitingVideoCC=this.videoTrackCC,this.state=B.State.WAITING_INIT_PTS}},p._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,u)},p.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},p.onBufferCreated=function(u,a){var b=a.tracks.audio;b&&(this.mediaBuffer=b.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},p.onFragBuffered=function(u,a){var b=a.frag,m=a.part;if(b.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(b)){this.warn("Fragment "+b.sn+(m?" p: "+m.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,m)},p.onError=function(u,a){switch(a.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,a);break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.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 d.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var b=!0,m=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);m&&m.len>.5&&(b=!this.reduceMaxBufferLength(m.len)),b&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},p.onBufferFlushed=function(u,a){var b=a.type;b===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},p._handleTransmuxComplete=function(u){var a,b="audio",m=this.hls,C=u.remuxResult,P=u.chunkMeta,H=this.getCurrentContext(P);if(!H){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var V=H.frag,$=H.part,z=C.audio,U=C.text,ee=C.id3,oe=C.initSegment;if(this.fragContextChanged(V))return;if(this.state=B.State.PARSING,this.audioSwitch&&z&&this.completeAudioSwitch(),oe!=null&&oe.tracks&&(this._bufferInitSegment(oe.tracks,V,P),m.trigger(_.Events.FRAG_PARSING_INIT_SEGMENT,{frag:V,id:b,tracks:oe.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 Ae=l({frag:V,id:b},ee);m.trigger(_.Events.FRAG_PARSING_METADATA,Ae)}if(U){var Ee=l({frag:V,id:b},U);m.trigger(_.Events.FRAG_PARSING_USERDATA,Ee)}},p._bufferInitSegment=function(u,a,b){if(this.state!==B.State.PARSING)return;u.video&&delete u.video;var m=u.audio;if(!m)return;m.levelCodec=m.codec,m.id="audio",this.log("Init audio buffer, container:"+m.container+", codecs[parsed]=["+m.codec+"]"),this.hls.trigger(_.Events.BUFFER_CODECS,u);var C=m.initSegment;if(C!=null&&C.byteLength){var P={type:"audio",frag:a,part:null,chunkMeta:b,parent:a.type,data:C};this.hls.trigger(_.Events.BUFFER_APPENDING,P)}this.tick()},p.loadFragment=function(u,a,b){var m=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||m===j.FragmentState.NOT_LOADED||m===j.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):a.live&&!Object(Q.isFiniteNumber)(this.initPTS[u.cc])?(this.log("Waiting for video PTS in continuity counter "+u.cc+" of live stream before loading audio fragment "+u.sn+" of level "+this.trackId),this.state=B.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,u,a,b)))},p.completeAudioSwitch=function(){var u=this.hls,a=this.media,b=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:b})},x}(B.default);X.default=g},"./src/controller/audio-track-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/controller/base-playlist-controller.ts"),G=R("./src/types/loader.ts");function j(k,D){for(var w=0;w=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=o[this.trackId];this.log("Now switching to audio-track index "+d);var h=o[d],E=h.id,v=h.groupId,g=v===void 0?"":v,L=h.name,x=h.type,p=h.url;if(this.trackId=d,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(Q.Events.AUDIO_TRACK_SWITCHING,{id:E,groupId:g,name:L,type:x,url:p}),h.details&&!h.details.live)return;var c=this.switchParams(h.url,l==null?void 0:l.details);this.loadPlaylist(c)},w.selectInitialTrack=function(){var d=this.tracksInGroup;console.assert(d.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,l=this.findTrackId(o)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},w.findTrackId=function(d){for(var o=this.tracksInGroup,l=0;lD.partTarget&&(h+=1)}if(Object(Q.isFiniteNumber)(l))return new B.HlsUrlParameters(l,Object(Q.isFiniteNumber)(h)?h:void 0,B.HlsSkip.No)}}},y.loadPlaylist=function(k){},y.shouldLoadTrack=function(k){return this.canLoad&&k&&!!k.url&&(!k.details||k.details.live)},y.playlistLoaded=function(k,D,w){var A=this,d=D.details,o=D.stats,l=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(d.advancedDateTime=Date.now()-l,d.live||w!=null&&w.live){if(d.reloaded(w),w&&this.log("live playlist "+k+" "+(d.advanced?"REFRESHED "+d.lastPartSn+"-"+d.lastPartIndex:"MISSED")),w&&d.fragments.length>0&&Object(_.mergeDetails)(w,d),!this.canLoad||!d.live)return;var h,E=void 0,v=void 0;if(d.canBlockReload&&d.endSN&&d.advanced){var g=this.hls.config.lowLatencyMode,L=d.lastPartSn,x=d.endSN,p=d.lastPartIndex,c=p!==-1,u=L===x,a=g?0:p;c?(E=u?x+1:L,v=u?a:p+1):E=x+1;var b=d.age,m=b+d.ageHeader,C=Math.min(m-d.partTarget,d.targetduration*1.5);if(C>0){if(w&&C>w.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+w.tuneInGoal+" to: "+C+" with playlist age: "+d.age),C=0;else{var P=Math.floor(C/d.targetduration);if(E+=P,v!==void 0){var H=Math.round(C%d.targetduration/d.partTarget);v+=H}this.log("CDN Tune-in age: "+d.ageHeader+"s last advanced "+b.toFixed(2)+"s goal: "+C+" skip sn "+P+" to part "+v)}d.tuneInGoal=C}if(h=this.getDeliveryDirectives(d,D.deliveryDirectives,E,v),g||!u){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(d,D.deliveryDirectives,E,v);var V=Object(_.computeReloadInterval)(d,o);E!==void 0&&d.canBlockReload&&(V-=d.partTarget||1),this.log("reload live playlist "+k+" in "+Math.round(V)+" ms"),this.timer=self.setTimeout(function(){return A.loadPlaylist(h)},V)}else this.clearTimer()},y.getDeliveryDirectives=function(k,D,w,A){var d=Object(B.getSkipValue)(k,w);return D!=null&&D.skip&&k.deltaUpdateFailed&&(w=D.msn,A=D.part,d=B.HlsSkip.No),new B.HlsUrlParameters(w,A,d)},y.retryLoadingOrFail=function(k){var D=this,w=this.hls.config,A=this.retryCount-1&&(d=k.context)!==null&&d!==void 0&&d.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+k.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*w.levelLoadingRetryDelay,w.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return D.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+k.details+'"')}}else this.warn('cannot recover from error "'+k.details+'"'),this.clearTimer(),k.fatal=!0;return A},I}()},"./src/controller/base-stream-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"State",function(){return x}),R.d(X,"default",function(){return p});var Q=R("./src/polyfills/number.ts"),B=R("./src/task-loop.ts"),_=R("./src/controller/fragment-tracker.ts"),G=R("./src/utils/buffer-helper.ts"),j=R("./src/utils/logger.ts"),O=R("./src/events.ts"),I=R("./src/errors.ts"),y=R("./src/types/transmuxer.ts"),T=R("./src/utils/mp4-tools.ts"),k=R("./src/utils/discontinuities.ts"),D=R("./src/controller/fragment-finders.ts"),w=R("./src/controller/level-helper.ts"),A=R("./src/loader/fragment-loader.ts"),d=R("./src/crypt/decrypter.ts"),o=R("./src/utils/time-ranges.ts"),l=R("./src/types/loader.ts");function h(c,u){for(var a=0;aoe;($0&&$&&$.key&&$.iv&&$.method==="AES-128"){var z=self.performance.now();return C.decrypter.webCryptoDecrypt(new Uint8Array(V),$.key.buffer,$.iv.buffer).then(function(U){var ee=self.performance.now();return H.trigger(O.Events.FRAG_DECRYPTED,{frag:m,payload:U,stats:{tstart:z,tdecrypt:ee}}),P.payload=U,P})}return P}).then(function(P){var H=C.fragCurrent,V=C.hls,$=C.levels;if(!$)throw new Error("init load aborted, missing levels");var z=$[m.level].details;console.assert(z,"Level details are defined when init segment is loaded");var U=m.stats;C.state=x.IDLE,C.fragLoadError=0,m.data=new Uint8Array(P.payload),U.parsing.start=U.buffering.start=self.performance.now(),U.parsing.end=U.buffering.end=self.performance.now(),P.frag===H&&V.trigger(O.Events.FRAG_BUFFERED,{stats:U,frag:H,part:null,id:m.type}),C.tick()}).catch(function(P){C.warn(P),C.resetFragmentLoading(m)})},a.fragContextChanged=function(m){var C=this.fragCurrent;return!m||!C||m.level!==C.level||m.sn!==C.sn||m.urlId!==C.urlId},a.fragBufferedComplete=function(m,C){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+m.type+" sn: "+m.sn+(C?" part: "+C.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level+" "+o.default.toString(G.BufferHelper.getBuffered(P))),this.state=x.IDLE,this.tick()},a._handleFragmentLoadComplete=function(m){var C=this.transmuxer;if(!C)return;var P=m.frag,H=m.part,V=m.partsLoaded,$=!V||V.length===0||V.some(function(U){return!U}),z=new y.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,H?H.index:-1,!$);C.flush(z)},a._handleFragmentLoadProgress=function(m){},a._doFragLoad=function(m,C,P,H){var V=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(m.start,P||0),this.config.lowLatencyMode&&C){var $=C.partList;if($&&H){P>m.end&&C.fragmentHint&&(m=C.fragmentHint);var z=this.getNextPart($,m,P);if(z>-1){var U=$[z];return this.log("Loading part sn: "+m.sn+" p: "+U.index+" cc: "+m.cc+" of playlist ["+C.startSN+"-"+C.endSN+"] parts [0-"+z+"-"+($.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=U.start+U.duration,this.state=x.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:m,part:$[z],targetBufferTime:P}),this.doFragPartsLoad(m,$,z,H).catch(function(ee){return V.handleFragLoadError(ee)})}else if(!m.url||this.loadedEndOfParts($,P))return Promise.resolve(null)}}return this.log("Loading fragment "+m.sn+" cc: "+m.cc+" "+(C?"of ["+C.startSN+"-"+C.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(P.toFixed(3))),Object(Q.isFiniteNumber)(m.sn)&&!this.bitrateTest&&(this.nextLoadPosition=m.start+m.duration),this.state=x.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:m,targetBufferTime:P}),this.fragmentLoader.load(m,H).catch(function(ee){return V.handleFragLoadError(ee)})},a.doFragPartsLoad=function(m,C,P,H){var V=this;return new Promise(function($,z){var U=[],ee=function oe(ce){var ve=C[ce];V.fragmentLoader.loadPart(m,ve,H).then(function(Me){U[ve.index]=Me;var xe=Me.part;V.hls.trigger(O.Events.FRAG_LOADED,Me);var Ae=C[ce+1];if(Ae&&Ae.fragment===m)oe(ce+1);else return $({frag:m,part:xe,partsLoaded:U})}).catch(z)};ee(P)})},a.handleFragLoadError=function(m){var C=m.data;return C&&C.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(C.frag,C.part):this.hls.trigger(O.Events.ERROR,C),null},a._handleTransmuxerFlush=function(m){var C=this.getCurrentContext(m);if(!C||this.state!==x.PARSING){this.fragCurrent||(this.state=x.IDLE);return}var P=C.frag,H=C.part,V=C.level,$=self.performance.now();P.stats.parsing.end=$,H&&(H.stats.parsing.end=$),this.updateLevelTiming(P,H,V,m.partial)},a.getCurrentContext=function(m){var C=this.levels,P=m.level,H=m.sn,V=m.part;if(!C||!C[P])return this.warn("Levels object was unset while buffering fragment "+H+" of level "+P+". The current chunk will not be buffered."),null;var $=C[P],z=V>-1?Object(w.getPartWith)($,H,V):null,U=z?z.fragment:Object(w.getFragmentWithSN)($,H,this.fragCurrent);return U?{frag:U,part:z,level:$}:null},a.bufferFragmentData=function(m,C,P,H){if(!m||this.state!==x.PARSING)return;var V=m.data1,$=m.data2,z=V;if(V&&$&&(z=Object(T.appendUint8Array)(V,$)),!z||!z.length)return;var U={type:m.type,frag:C,part:P,chunkMeta:H,parent:C.type,data:z};this.hls.trigger(O.Events.BUFFER_APPENDING,U),m.dropped&&m.independent&&!P&&this.flushBufferGap(C)},a.flushBufferGap=function(m){var C=this.media;if(!C)return;if(!G.BufferHelper.isBuffered(C,C.currentTime)){this.flushMainBuffer(0,m.start);return}var P=C.currentTime,H=G.BufferHelper.bufferInfo(C,P,0),V=m.duration,$=Math.min(this.config.maxFragLookUpTolerance*2,V*.25),z=Math.max(Math.min(m.start-$,H.end-$),P+$);m.start-z>$&&this.flushMainBuffer(z,m.start)},a.getFwdBufferInfo=function(m,C){var P=this.config,H=this.getLoadPosition();if(!Object(Q.isFiniteNumber)(H))return null;var V=G.BufferHelper.bufferInfo(m,H,P.maxBufferHole);if(V.len===0&&V.nextStart!==void 0){var $=this.fragmentTracker.getBufferedFrag(H,C);if($&&V.nextStart<$.end)return G.BufferHelper.bufferInfo(m,H,Math.max(V.nextStart,P.maxBufferHole))}return V},a.getMaxBufferLength=function(m){var C=this.config,P;return m?P=Math.max(8*C.maxBufferSize/m,C.maxBufferLength):P=C.maxBufferLength,Math.min(P,C.maxMaxBufferLength)},a.reduceMaxBufferLength=function(m){var C=this.config,P=m||C.maxBufferLength;return C.maxMaxBufferLength>=P?(C.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+C.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(m,C){var P,H,V=C.fragments,$=V.length;if(!$)return null;var z=this.config,U=V[0].start,ee;if(C.live){var oe=z.initialLiveManifestSize;if($-1&&PP.start&&P.loaded},a.getInitialLiveFragment=function(m,C){var P=this.fragPrevious,H=null;if(P){if(m.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),H=Object(D.findFragmentByPDT)(C,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!H){var V=P.sn+1;if(V>=m.startSN&&V<=m.endSN){var $=C[V-m.startSN];P.cc===$.cc&&(H=$,this.log("Live playlist, switching playlist, load frag with next SN: "+H.sn))}H||(H=Object(D.findFragWithCC)(C,P.cc),H&&this.log("Live playlist, switching playlist, load frag with same CC: "+H.sn))}}else{var z=this.hls.liveSyncPosition;z!==null&&(H=this.getFragmentAtPosition(z,this.bitrateTest?m.fragmentEnd:m.edge,m))}return H},a.getFragmentAtPosition=function(m,C,P){var H=this.config,V=this.fragPrevious,$=P.fragments,z=P.endSN,U=P.fragmentHint,ee=H.maxFragLookUpTolerance,oe=!!(H.lowLatencyMode&&P.partList&&U);oe&&U&&!this.bitrateTest&&($=$.concat(U),z=U.sn);var ce;if(mC-ee?0:ee;ce=Object(D.findFragmentByPTS)(V,$,m,ve)}else ce=$[$.length-1];if(ce){var Me=ce.sn-P.startSN,xe=V&&ce.level===V.level,Ae=$[Me+1],Ee=this.fragmentTracker.getState(ce);if(Ee===_.FragmentState.BACKTRACKED){ce=null;for(var Ce=Me;$[Ce]&&this.fragmentTracker.getState($[Ce])===_.FragmentState.BACKTRACKED;)V?ce=$[Ce--]:ce=$[--Ce];ce||(ce=Ae)}else V&&ce.sn===V.sn&&!oe&&(xe&&(ce.sn=$-C.maxFragLookUpTolerance&&V<=z;if(H!==null&&P.duration>H&&(V"+m.startSN+" prev-sn: "+(V?V.sn:"na")+" fragments: "+z),ce}return U},a.waitForCdnTuneIn=function(m){var C=3;return m.live&&m.canBlockReload&&m.tuneInGoal>Math.max(m.partHoldBack,m.partTarget*C)},a.setStartPosition=function(m,C){var P=this.startPosition;if(P"+m))}}]),u}(B.default)},"./src/controller/buffer-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return D});var Q=R("./src/polyfills/number.ts"),B=R("./src/events.ts"),_=R("./src/utils/logger.ts"),G=R("./src/errors.ts"),j=R("./src/utils/buffer-helper.ts"),O=R("./src/utils/mediasource-helper.ts"),I=R("./src/loader/fragment.ts"),y=R("./src/controller/buffer-operation-queue.ts"),T=Object(O.getMediaSource)(),k=/([ha]vc.)(?:\.[^.,]+)+/,D=function(){function w(d){var o=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var l=o.hls,h=o.media,E=o.mediaSource;_.logger.log("[buffer-controller]: Media source opened"),h&&(o.updateMediaElementDuration(),l.trigger(B.Events.MEDIA_ATTACHED,{media:h})),E&&E.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=d,this._initSourceBuffer(),this.registerListeners()}var A=w.prototype;return A.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},A.destroy=function(){this.unregisterListeners(),this.details=null},A.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)},A.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)},A._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},A.onManifestParsed=function(o,l){var h=2;(l.audio&&!l.video||!l.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,_.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},A.onMediaAttaching=function(o,l){var h=this.media=l.media;if(h&&T){var E=this.mediaSource=new T;E.addEventListener("sourceopen",this._onMediaSourceOpen),E.addEventListener("sourceended",this._onMediaSourceEnded),E.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(E),this._objectUrl=h.src}},A.onMediaDetaching=function(){var o=this.media,l=this.mediaSource,h=this._objectUrl;if(l){if(_.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(E){_.logger.warn("[buffer-controller]: onMediaDetaching: "+E.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(h&&self.URL.revokeObjectURL(h),o.src===h?(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)},A.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(l){var h=o.sourceBuffer[l];try{h&&(o.removeBufferListeners(l),o.mediaSource&&o.mediaSource.removeSourceBuffer(h),o.sourceBuffer[l]=void 0)}catch(E){_.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",E)}}),this._initSourceBuffer()},A.onBufferCodecs=function(o,l){var h=this,E=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(v){if(E){var g=h.tracks[v];if(g&&typeof g.buffer.changeType=="function"){var L=l[v],x=L.codec,p=L.levelCodec,c=L.container,u=(g.levelCodec||g.codec).replace(k,"$1"),a=(p||x).replace(k,"$1");if(u!==a){var b=c+";codecs="+(p||x);h.appendChangeType(v,b)}}}else h.pendingTracks[v]=l[v]}),E)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},A.appendChangeType=function(o,l){var h=this,E=this.operationQueue,v={execute:function(){var L=h.sourceBuffer[o];L&&(_.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+l),L.changeType(l)),E.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(L){_.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",L)}};E.append(v,o)},A.onBufferAppending=function(o,l){var h=this,E=this.hls,v=this.operationQueue,g=this.tracks,L=l.data,x=l.type,p=l.frag,c=l.part,u=l.chunkMeta,a=u.buffering[x],b=self.performance.now();a.start=b;var m=p.stats.buffering,C=c?c.stats.buffering:null;m.start===0&&(m.start=b),C&&C.start===0&&(C.start=b);var P=g.audio,H=x==="audio"&&u.id===1&&(P==null?void 0:P.container)==="audio/mpeg",V={execute:function(){if(a.executeStart=self.performance.now(),H){var z=h.sourceBuffer[x];if(z){var U=p.start-z.timestampOffset;Math.abs(U)>=.1&&(_.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+p.start+" (delta: "+U+") sn: "+p.sn+")"),z.timestampOffset=p.start)}}h.appendExecutor(L,x)},onStart:function(){},onComplete:function(){var z=self.performance.now();a.executeEnd=a.end=z,m.first===0&&(m.first=z),C&&C.first===0&&(C.first=z);var U=h.sourceBuffer,ee={};for(var oe in U)ee[oe]=j.BufferHelper.getBuffered(U[oe]);h.appendError=0,h.hls.trigger(B.Events.BUFFER_APPENDED,{type:x,frag:p,part:c,chunkMeta:u,parent:p.type,timeRanges:ee})},onError:function(z){_.logger.error("[buffer-controller]: Error encountered while trying to append to the "+x+" SourceBuffer",z);var U={type:G.ErrorTypes.MEDIA_ERROR,parent:p.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:z,fatal:!1};z.code===DOMException.QUOTA_EXCEEDED_ERR?U.details=G.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,U.details=G.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>E.config.appendErrorMaxRetry&&(_.logger.error("[buffer-controller]: Failed "+E.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),U.fatal=!0)),E.trigger(B.Events.ERROR,U)}};v.append(V,x)},A.onBufferFlushing=function(o,l){var h=this,E=this.operationQueue,v=function(L){return{execute:h.removeExecutor.bind(h,L,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(B.Events.BUFFER_FLUSHED,{type:L})},onError:function(p){_.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",p)}}};l.type?E.append(v(l.type),l.type):this.getSourceBufferTypes().forEach(function(g){E.append(v(g),g)})},A.onFragParsed=function(o,l){var h=this,E=l.frag,v=l.part,g=[],L=v?v.elementaryStreams:E.elementaryStreams;L[I.ElementaryStreamTypes.AUDIOVIDEO]?g.push("audiovideo"):(L[I.ElementaryStreamTypes.AUDIO]&&g.push("audio"),L[I.ElementaryStreamTypes.VIDEO]&&g.push("video"));var x=function(){var c=self.performance.now();E.stats.buffering.end=c,v&&(v.stats.buffering.end=c);var u=v?v.stats:E.stats;h.hls.trigger(B.Events.FRAG_BUFFERED,{frag:E,part:v,stats:u,id:E.type})};g.length===0&&_.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+E.type+" level: "+E.level+" sn: "+E.sn),this.blockBuffers(x,g)},A.onFragChanged=function(o,l){this.flushBackBuffer()},A.onBufferEos=function(o,l){var h=this,E=this.getSourceBufferTypes().reduce(function(v,g){var L=h.sourceBuffer[g];return(!l.type||l.type===g)&&(L&&!L.ended&&(L.ended=!0,_.logger.log("[buffer-controller]: "+g+" sourceBuffer now EOS"))),v&&!!(!L||L.ended)},!0);E&&this.blockBuffers(function(){var v=h.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},A.onLevelUpdated=function(o,l){var h=l.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},A.flushBackBuffer=function(){var o=this.hls,l=this.details,h=this.media,E=this.sourceBuffer;if(!h||l===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var g=l.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(Q.isFiniteNumber)(g)||g<0)return;var L=h.currentTime,x=l.levelTargetDuration,p=Math.max(g,x),c=Math.floor(L/x)*x-p;v.forEach(function(u){var a=E[u];if(a){var b=j.BufferHelper.getBuffered(a);b.length>0&&c>b.start(0)&&(o.trigger(B.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),l.live&&o.trigger(B.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),o.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:u}))}})},A.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,l=this.hls,h=this.media,E=this.mediaSource,v=o.fragments[0].start+o.totalduration,g=h.duration,L=Object(Q.isFiniteNumber)(E.duration)?E.duration:0;o.live&&l.config.liveDurationInfinity?(_.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),E.duration=Infinity,this.updateSeekableRange(o)):(v>L&&v>g||!Object(Q.isFiniteNumber)(g))&&(_.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),E.duration=v)},A.updateSeekableRange=function(o){var l=this.mediaSource,h=o.fragments,E=h.length;if(E&&o.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var v=Math.max(0,h[0].start),g=Math.max(v,v+o.totalduration);l.setLiveSeekableRange(v,g)}},A.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,l=this.operationQueue,h=this.pendingTracks,E=Object.keys(h).length;if(E&&!o||E===2){this.createSourceBuffers(h),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(B.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(g){l.executeNext(g)})}},A.createSourceBuffers=function(o){var l=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var E=0;for(var v in o)if(!l[v]){var g=o[v];if(!g)throw Error("source buffer exists for track "+v+", however track does not");var L=g.levelCodec||g.codec,x=g.container+";codecs="+L;_.logger.log("[buffer-controller]: creating sourceBuffer("+x+")");try{var p=l[v]=h.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:p,codec:L,container:g.container,levelCodec:g.levelCodec,id:g.id},E++}catch(u){_.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(B.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:x})}}E&&this.hls.trigger(B.Events.BUFFER_CREATED,{tracks:this.tracks})},A._onSBUpdateStart=function(o){var l=this.operationQueue,h=l.current(o);h.onStart()},A._onSBUpdateEnd=function(o){var l=this.operationQueue,h=l.current(o);h.onComplete(),l.shiftAndExecuteNext(o)},A._onSBUpdateError=function(o,l){_.logger.error("[buffer-controller]: "+o+" SourceBuffer error",l),this.hls.trigger(B.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(o);h&&h.onError(l)},A.removeExecutor=function(o,l,h){var E=this.media,v=this.mediaSource,g=this.operationQueue,L=this.sourceBuffer,x=L[o];if(!E||!v||!x){_.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),g.shiftAndExecuteNext(o);return}var p=Object(Q.isFiniteNumber)(E.duration)?E.duration:Infinity,c=Object(Q.isFiniteNumber)(v.duration)?v.duration:Infinity,u=Math.max(0,l),a=Math.min(h,p,c);a>u?(_.logger.log("[buffer-controller]: Removing ["+u+","+a+"] from the "+o+" SourceBuffer"),console.assert(!x.updating,o+" sourceBuffer must not be updating"),x.remove(u,a)):g.shiftAndExecuteNext(o)},A.appendExecutor=function(o,l){var h=this.operationQueue,E=this.sourceBuffer,v=E[l];if(!v){_.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(l);return}v.ended=!1,console.assert(!v.updating,l+" sourceBuffer must not be updating"),v.appendBuffer(o)},A.blockBuffers=function(o,l){var h=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){_.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var E=this.operationQueue,v=l.map(function(g){return E.appendBlocker(g)});Promise.all(v).then(function(){o(),l.forEach(function(g){var L=h.sourceBuffer[g];(!L||!L.updating)&&E.shiftAndExecuteNext(g)})})},A.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},A.addBufferListener=function(o,l,h){var E=this.sourceBuffer[o];if(!E)return;var v=h.bind(this,o);this.listeners[o].push({event:l,listener:v}),E.addEventListener(l,v)},A.removeBufferListeners=function(o){var l=this.sourceBuffer[o];if(!l)return;this.listeners[o].forEach(function(h){l.removeEventListener(h.event,h.listener)})},w}()},"./src/controller/buffer-operation-queue.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return B});var Q=R("./src/utils/logger.ts"),B=function(){function _(j){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=j}var G=_.prototype;return G.append=function(O,I){var y=this.queues[I];y.push(O),y.length===1&&this.buffers[I]&&this.executeNext(I)},G.insertAbort=function(O,I){var y=this.queues[I];y.unshift(O),this.executeNext(I)},G.appendBlocker=function(O){var I,y=new Promise(function(k){I=k}),T={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(T,O),y},G.executeNext=function(O){var I=this.buffers,y=this.queues,T=I[O],k=y[O];if(k.length){var D=k[0];try{D.execute()}catch(w){Q.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),D.onError(w),(!T||!T.updating)&&(k.shift(),this.executeNext(O))}}},G.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},G.current=function(O){return this.queues[O][0]},_}()},"./src/controller/cap-level-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/events.ts");function B(j,O){for(var I=0;I0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var T=this.hls;T.autoLevelCapping=this.getMaxLevel(y.length-1),T.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=T.autoLevelCapping}}},O.getMaxLevel=function(y){var T=this,k=this.hls.levels;if(!k.length)return-1;var D=k.filter(function(w,A){return j.isLevelAllowed(A,T.restrictedLevels)&&A<=y});return this.clientRect=null,j.getMaxLevelByMediaSize(D,this.mediaWidth,this.mediaHeight)},O.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},O.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},O.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,T={width:0,height:0};if(y){var k=y.getBoundingClientRect();T.width=k.width,T.height=k.height,!T.width&&!T.height&&(T.width=k.right-k.left||y.width||0,T.height=k.bottom-k.top||y.height||0)}return this.clientRect=T,T},j.isLevelAllowed=function(y,T){return T===void 0&&(T=[]),T.indexOf(y)===-1},j.getMaxLevelByMediaSize=function(y,T,k){if(!y||!y.length)return-1;for(var D=function(l,h){return h?l.width!==h.width||l.height!==h.height:!0},w=y.length-1,A=0;A=T||d.height>=k)&&D(d,y[A+1])){w=A;break}}return w},_(j,[{key:"mediaWidth",get:function(){return this.getDimensions().width*j.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*j.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(T){}return y}}]),j}();X.default=G},"./src/controller/cmcd-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return D});var Q=R("./src/events.ts"),B=R("./src/types/cmcd.ts"),_=R("./src/utils/buffer-helper.ts"),G=R("./src/utils/logger.ts");function j(w,A){for(var d=0;d=w.length?{done:!0}:{done:!1,value:w[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(w,A){if(!w)return;if(typeof w=="string")return T(w,A);var d=Object.prototype.toString.call(w).slice(8,-1);if(d==="Object"&&w.constructor&&(d=w.constructor.name),d==="Map"||d==="Set")return Array.from(w);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return T(w,A)}function T(w,A){(A==null||A>w.length)&&(A=w.length);for(var d=0,o=new Array(A);dl&&(l=g.bitrate)}return l>0?l:NaN},A.getBufferLength=function(o){var l=this.hls.media,h=o===B.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!l)return NaN;var E=_.BufferHelper.bufferInfo(h,l.currentTime,this.config.maxBufferHole);return E.len*1e3},A.createPlaylistLoader=function(){var o=this.config.pLoader,l=this.applyPlaylistData,h=o||this.config.loader;return function(){function E(g){this.loader=void 0,this.loader=new h(g)}var v=E.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(L,x,p){l(L),this.loader.load(L,x,p)},O(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},A.createFragmentLoader=function(){var o=this.config.fLoader,l=this.applyFragmentData,h=o||this.config.loader;return function(){function E(g){this.loader=void 0,this.loader=new h(g)}var v=E.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(L,x,p){l(L),this.loader.load(L,x,p)},O(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},w.uuid=function(){var o=URL.createObjectURL(new Blob),l=o.toString();return URL.revokeObjectURL(o),l.substr(l.lastIndexOf("/")+1)},w.serialize=function(o){for(var l=[],h=function(H){return!Number.isNaN(H)&&H!=null&&H!==""&&H!==!1},E=function(H){return Math.round(H)},v=function(H){return E(H/100)*100},g=function(H){return encodeURIComponent(H)},L={br:E,d:E,bl:v,dl:v,mtp:v,nor:g,rtp:v,tb:E},x=Object.keys(o||{}).sort(),p=I(x),c;!(c=p()).done;){var u=c.value,a=o[u];if(!h(a))continue;if(u==="v"&&a===1)continue;if(u=="pr"&&a===1)continue;var b=L[u];b&&(a=b(a));var m=typeof a,C=void 0;u==="ot"||u==="sf"||u==="st"?C=u+"="+a:m==="boolean"?C=u:m==="number"?C=u+"="+a:C=u+"="+JSON.stringify(a),l.push(C)}return l.join(",")},w.toHeaders=function(o){for(var l=Object.keys(o),h={},E=["Object","Request","Session","Status"],v=[{},{},{},{}],g={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},L=0,x=l;LI){this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var g=I-this._requestLicenseFailureCount+1;_.logger.warn("Retrying license request, "+g+" attempts left"),this._requestLicense(l,h)}break}},w._generateLicenseRequestChallenge=function(d,o){switch(d.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+d.mediaKeySystemDomain)},w._requestLicense=function(d,o){_.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){_.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(l.mediaKeySystemDomain),E=this._createLicenseXhr(h,d,o);_.logger.log("Sending license request to URL: "+h);var v=this._generateLicenseRequestChallenge(l,d);E.send(v)}catch(g){_.logger.error("Failure requesting DRM license: "+g),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},w.onMediaAttached=function(d,o){if(!this._emeEnabled)return;var l=o.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},w.onMediaDetached=function(){var d=this._media,o=this._mediaKeysList;if(!d)return;d.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return d.setMediaKeys(null)}).catch(function(){})},w.onManifestParsed=function(d,o){if(!this._emeEnabled)return;var l=o.levels.map(function(E){return E.audioCodec}).filter(function(E){return!!E}),h=o.levels.map(function(E){return E.videoCodec}).filter(function(E){return!!E});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,l,h)},O(D,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),D}();X.default=k},"./src/controller/fps-controller.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/events.ts"),B=R("./src/utils/logger.ts"),_=function(){function G(O){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=O,this.registerListeners()}var j=G.prototype;return j.setStreamController=function(I){this.streamController=I},j.registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},j.unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching)},j.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},j.onMediaAttaching=function(I,y){var T=this.hls.config;if(T.capLevelOnFPSDrop){var k=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=k,k&&typeof k.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),T.fpsDroppedMonitoringPeriod)}},j.checkFPS=function(I,y,T){var k=performance.now();if(y){if(this.lastTime){var D=k-this.lastTime,w=T-this.lastDroppedFrames,A=y-this.lastDecodedFrames,d=1e3*w/D,o=this.hls;if(o.trigger(Q.Events.FPS_DROP,{currentDropped:w,currentDecoded:A,totalDroppedFrames:T}),d>0&&w>o.config.fpsDroppedMonitoringThreshold*A){var l=o.currentLevel;B.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=l)&&(l=l-1,o.trigger(Q.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:o.currentLevel}),o.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=k,this.lastDroppedFrames=T,this.lastDecodedFrames=y}},j.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var y=I.getVideoPlaybackQuality();this.checkFPS(I,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},G}();X.default=_},"./src/controller/fragment-finders.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"findFragmentByPDT",function(){return _}),R.d(X,"findFragmentByPTS",function(){return G}),R.d(X,"fragmentWithinToleranceTest",function(){return j}),R.d(X,"pdtWithinToleranceTest",function(){return O}),R.d(X,"findFragWithCC",function(){return I});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/binary-search.ts");function _(y,T,k){if(T===null||!Array.isArray(y)||!y.length||!Object(Q.isFiniteNumber)(T))return null;var D=y[0].programDateTime;if(T<(D||0))return null;var w=y[y.length-1].endProgramDateTime;if(T>=(w||0))return null;k=k||0;for(var A=0;Ay&&k.start?-1:0}function O(y,T,k){var D=Math.min(T,k.duration+(k.deltaPTS?k.deltaPTS:0))*1e3,w=k.endProgramDateTime||0;return w-D>y}function I(y,T){return B.default.search(y,function(k){return k.ccT?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"FragmentState",function(){return _}),R.d(X,"FragmentTracker",function(){return G});var Q=R("./src/events.ts"),B=R("./src/types/loader.ts"),_;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(_||(_={}));var G=function(){function I(T){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=T,this._registerListeners()}var y=I.prototype;return y._registerListeners=function(){var k=this.hls;k.on(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.on(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.on(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var k=this.hls;k.off(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.off(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.off(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(k,D){if(D===B.PlaylistLevelType.MAIN){var w=this.activeFragment,A=this.activeParts;if(!w)return null;if(A)for(var d=A.length;d--;){var o=A[d],l=o?o.end:w.appendedPTS;if(o.start<=k&&l!==void 0&&k<=l)return d>9&&(this.activeParts=A.slice(d-9)),o}else if(w.start<=k&&w.appendedPTS!==void 0&&k<=w.appendedPTS)return w}return this.getBufferedFrag(k,D)},y.getBufferedFrag=function(k,D){for(var w=this.fragments,A=Object.keys(w),d=A.length;d--;){var o=w[A[d]];if((o==null?void 0:o.body.type)===D&&o.buffered){var l=o.body;if(l.start<=k&&k<=l.end)return l}}return null},y.detectEvictedFragments=function(k,D,w){var A=this;Object.keys(this.fragments).forEach(function(d){var o=A.fragments[d];if(!o)return;if(!o.buffered){o.body.type===w&&A.removeFragment(o.body);return}var l=o.range[k];if(!l)return;l.time.some(function(h){var E=!A.isTimeBuffered(h.startPTS,h.endPTS,D);return E&&A.removeFragment(o.body),E})})},y.detectPartialFragments=function(k){var D=this,w=this.timeRanges,A=k.frag,d=k.part;if(!w||A.sn==="initSegment")return;var o=O(A),l=this.fragments[o];if(!l)return;Object.keys(w).forEach(function(h){var E=A.elementaryStreams[h];if(!E)return;var v=w[h],g=d!==null||E.partial===!0;l.range[h]=D.getBufferedTimes(A,d,g,v)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},y.fragBuffered=function(k){var D=O(k),w=this.fragments[D];w&&(w.backtrack=w.loaded=null,w.buffered=!0)},y.getBufferedTimes=function(k,D,w,A){for(var d={time:[],partial:w},o=D?D.start:k.start,l=D?D.end:k.end,h=k.minEndPTS||l,E=k.maxStartPTS||o,v=0;v=g&&h<=L){d.time.push({startPTS:Math.max(o,A.start(v)),endPTS:Math.min(l,A.end(v))});break}else if(og)d.partial=!0,d.time.push({startPTS:Math.max(o,A.start(v)),endPTS:Math.min(l,A.end(v))});else if(l<=g)break}return d},y.getPartialFragment=function(k){var D=null,w,A,d,o=0,l=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(E){var v=h[E];if(!v)return;j(v)&&(A=v.body.start-l,d=v.body.end+l,k>=A&&k<=d&&(w=Math.min(k-A,d-k),o<=w&&(D=v.body,o=w)))}),D},y.getState=function(k){var D=O(k),w=this.fragments[D];return w?w.buffered?j(w)?_.PARTIAL:_.OK:w.backtrack?_.BACKTRACKED:_.APPENDING:_.NOT_LOADED},y.backtrack=function(k,D){var w=O(k),A=this.fragments[w];if(!A||A.backtrack)return null;var d=A.backtrack=D||A.loaded;return A.loaded=null,d},y.getBacktrackData=function(k){var D=O(k),w=this.fragments[D];if(w){var A,d=w.backtrack;if(d!=null&&(A=d.payload)!==null&&A!==void 0&&A.byteLength)return d;this.removeFragment(k)}return null},y.isTimeBuffered=function(k,D,w){for(var A,d,o=0;o=A&&D<=d)return!0;if(D<=A)return!1}return!1},y.onFragLoaded=function(k,D){var w=D.frag,A=D.part;if(w.sn==="initSegment"||w.bitrateTest||A)return;var d=O(w);this.fragments[d]={body:w,loaded:D,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(k,D){var w=this,A=D.frag,d=D.part,o=D.timeRanges;if(A.type===B.PlaylistLevelType.MAIN)if(this.activeFragment=A,d){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(d)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(h){var E=o[h];if(w.detectEvictedFragments(h,E),!d)for(var v=0;vk&&A.removeFragment(l)}})},y.removeFragment=function(k){var D=O(k);k.stats.loaded=0,k.clearElementaryStreamInfo(),delete this.fragments[D]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function j(I){var y,T;return I.buffered&&(((y=I.range.video)===null||y===void 0?void 0:y.partial)||((T=I.range.audio)===null||T===void 0?void 0:T.partial))}function O(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"STALL_MINIMUM_DURATION_MS",function(){return j}),R.d(X,"MAX_START_GAP_JUMP",function(){return O}),R.d(X,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),R.d(X,"SKIP_BUFFER_RANGE_START",function(){return y}),R.d(X,"default",function(){return T});var Q=R("./src/utils/buffer-helper.ts"),B=R("./src/errors.ts"),_=R("./src/events.ts"),G=R("./src/utils/logger.ts"),j=250,O=2,I=.1,y=.05,T=function(){function k(w,A,d,o){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=w,this.media=A,this.fragmentTracker=d,this.hls=o}var D=k.prototype;return D.destroy=function(){this.hls=this.fragmentTracker=this.media=null},D.poll=function(A){var d=this.config,o=this.media,l=this.stalled,h=o.currentTime,E=o.seeking,v=this.seeking&&!E,g=!this.seeking&&E;if(this.seeking=E,h!==A){if(this.moved=!0,l!==null){if(this.stallReported){var L=self.performance.now()-l;G.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((g||v)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!Q.BufferHelper.getBuffered(o).length)return;var x=Q.BufferHelper.bufferInfo(o,h,0),p=x.len>0,c=x.nextStart||0;if(!p&&!c)return;if(E){var u=x.len>O,a=!c||c-h>O&&!this.fragmentTracker.getPartialFragment(h);if(u||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var b,m=Math.max(c,x.start||0)-h,C=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=C==null||((b=C.details)===null||b===void 0)?void 0:b.live,H=P?C.details.targetduration*2:O;if(m>0&&m<=H){this._trySkipBufferHole(null);return}}var V=self.performance.now();if(l===null){this.stalled=V;return}var $=V-l;!E&&$>=j&&this._reportStall(x.len);var z=Q.BufferHelper.bufferInfo(o,h,d.maxBufferHole);this._tryFixBufferStall(z,$)},D._tryFixBufferStall=function(A,d){var o=this.config,l=this.fragmentTracker,h=this.media,E=h.currentTime,v=l.getPartialFragment(E);if(v){var g=this._trySkipBufferHole(v);if(g)return}A.len>o.maxBufferHole&&d>o.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},D._reportStall=function(A){var d=this.hls,o=this.media,l=this.stallReported;l||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+A+")"),d.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:A}))},D._trySkipBufferHole=function(A){for(var d=this.config,o=this.hls,l=this.media,h=l.currentTime,E=0,v=Q.BufferHelper.getBuffered(l),g=0;g=E&&h.05&&this.forwardBufferLength>1){var g=Math.min(2,Math.max(1,o)),L=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;k.playbackRate=Math.min(g,Math.max(1,L))}else k.playbackRate!==1&&k.playbackRate!==0&&(k.playbackRate=1)},y.estimateLiveEdge=function(){var k=this.levelDetails;return k===null?null:k.edge+k.age},y.computeLatency=function(){var k=this.estimateLiveEdge();return k===null?null:k-this.currentTime},j(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var k=this.config,D=this.levelDetails;return k.liveMaxLatencyDuration!==void 0?k.liveMaxLatencyDuration:D?k.liveMaxLatencyDurationCount*D.targetduration:0}},{key:"targetLatency",get:function(){var k=this.levelDetails;if(k===null)return null;var D=k.holdBack,w=k.partHoldBack,A=k.targetduration,d=this.config,o=d.liveSyncDuration,l=d.liveSyncDurationCount,h=d.lowLatencyMode,E=this.hls.userConfig,v=h&&w||D;(E.liveSyncDuration||E.liveSyncDurationCount||v===0)&&(v=o!==void 0?o:l*A);var g=A,L=1;return v+Math.min(this.stallCount*L,g)}},{key:"liveSyncPosition",get:function(){var k=this.estimateLiveEdge(),D=this.targetLatency,w=this.levelDetails;if(k===null||D===null||w===null)return null;var A=w.edge,d=k-D-this.edgeStalled,o=A-w.totalduration,l=A-(this.config.lowLatencyMode&&w.partTarget||w.targetduration);return Math.min(Math.max(o,d),l)}},{key:"drift",get:function(){var k=this.levelDetails;return k===null?1:k.drift}},{key:"edgeStalled",get:function(){var k=this.levelDetails;if(k===null)return 0;var D=(this.config.lowLatencyMode&&k.partTarget||k.targetduration)*3;return Math.max(k.age-D,0)}},{key:"forwardBufferLength",get:function(){var k=this.media,D=this.levelDetails;if(!k||!D)return 0;var w=k.buffered.length;return w?k.buffered.end(w-1):D.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return d});var Q=R("./src/types/level.ts"),B=R("./src/events.ts"),_=R("./src/errors.ts"),G=R("./src/utils/codecs.ts"),j=R("./src/controller/level-helper.ts"),O=R("./src/controller/base-playlist-controller.ts"),I=R("./src/types/loader.ts");function y(){return y=Object.assign||function(o){for(var l=1;l0){c=L[0].bitrate,L.sort(function($,z){return $.bitrate-z.bitrate}),this._levels=L;for(var P=0;Pthis.hls.config.fragLoadingMaxRetry&&(u=g.frag.level)):u=g.frag.level}break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(c=!1),u=L.level),p=!0;break;case _.ErrorDetails.REMUX_ALLOC_ERROR:u=g.level,p=!0;break}u!==void 0&&this.recoverLevel(g,u,p,c)},h.recoverLevel=function(v,g,L,x){var p=v.details,c=this._levels[g];if(c.loadError++,L){var u=this.retryLoadingOrFail(v);if(u)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(x){var a=c.url.length;if(a>1&&c.loadError1){var x=(g.urlId+1)%L;this.warn("Switching to redundant URL-id "+x),this._levels.forEach(function(p){p.urlId=x}),this.level=v}},h.onFragLoaded=function(v,g){var L=g.frag;if(L!==void 0&&L.type===I.PlaylistLevelType.MAIN){var x=this._levels[L.level];x!==void 0&&(x.fragmentError=0,x.loadError=0)}},h.onLevelLoaded=function(v,g){var L,x=g.level,p=g.details,c=this._levels[x];if(!c){var u;this.warn("Invalid level index "+x),(u=g.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(p.deltaUpdateFailed=!0);return}x===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(x,g,c.details)):(L=g.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(p.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(v,g){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var x=-1,p=this.hls.audioTracks[g.id].groupId,c=0;c0){var x=L.urlId,p=L.url[x];if(v)try{p=v.addDirectives(p)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+g+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+x+" "+p),this.clearTimer(),this.hls.trigger(B.Events.LEVEL_LOADING,{url:p,level:g,id:x,deliveryDirectives:v||null})}},h.removeLevel=function(v,g){var L=function(c,u){return u!==g},x=this._levels.filter(function(p,c){return c!==v?!0:p.url.length>1&&g!==void 0?(p.url=p.url.filter(L),p.audioGroupIds&&(p.audioGroupIds=p.audioGroupIds.filter(L)),p.textGroupIds&&(p.textGroupIds=p.textGroupIds.filter(L)),p.urlId=0,!0):!1}).map(function(p,c){var u=p.details;return u!=null&&u.fragments&&u.fragments.forEach(function(a){a.level=c}),p});this._levels=x,this.hls.trigger(B.Events.LEVELS_UPDATED,{levels:x})},k(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var g,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===v&&(g=L[v])!==null&&g!==void 0&&g.details)return;if(v<0||v>=L.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,L.length-1)}this.clearTimer();var p=this.currentLevelIndex,c=L[p],u=L[v];this.log("switching to level "+v+" from "+p),this.currentLevelIndex=v;var a=y({},u,{level:v,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete a._urlId,this.hls.trigger(B.Events.LEVEL_SWITCHING,a);var b=u.details;if(!b||b.live){var m=this.switchParams(u.uri,c==null?void 0:c.details);this.loadPlaylist(m)}}},{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)}}]),l}(O.default)},"./src/controller/level-helper.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"addGroupId",function(){return _}),R.d(X,"assignTrackIdsByGroup",function(){return G}),R.d(X,"updatePTS",function(){return j}),R.d(X,"updateFragPTSDTS",function(){return I}),R.d(X,"mergeDetails",function(){return y}),R.d(X,"mapPartIntersection",function(){return T}),R.d(X,"mapFragmentIntersection",function(){return k}),R.d(X,"adjustSliding",function(){return D}),R.d(X,"addSliding",function(){return w}),R.d(X,"computeReloadInterval",function(){return A}),R.d(X,"getFragmentWithSN",function(){return d}),R.d(X,"getPartWith",function(){return o});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/logger.ts");function _(l,h,E){switch(h){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(E);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(E);break}}function G(l){var h={};l.forEach(function(E){var v=E.groupId||"";E.id=h[v]=h[v]||0,h[v]++})}function j(l,h,E){var v=l[h],g=l[E];O(v,g)}function O(l,h){var E=h.startPTS;if(Object(Q.isFiniteNumber)(E)){var v=0,g;h.sn>l.sn?(v=E-l.start,g=l):(v=l.start-E,g=h),g.duration!==v&&(g.duration=v)}else if(h.sn>l.sn){var L=l.cc===h.cc;L&&l.minEndPTS?h.start=l.start+(l.minEndPTS-l.start):h.start=l.start+l.duration}else h.start=Math.max(l.start-h.duration,0)}function I(l,h,E,v,g,L){var x=v-E;x<=0&&(B.logger.warn("Fragment should have a positive duration",h),v=E+h.duration,L=g+h.duration);var p=E,c=v,u=h.startPTS,a=h.endPTS;if(Object(Q.isFiniteNumber)(u)){var b=Math.abs(u-E);Object(Q.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(b,h.deltaPTS):h.deltaPTS=b,p=Math.max(E,u),E=Math.min(E,u),g=Math.min(g,h.startDTS),c=Math.min(v,a),v=Math.max(v,a),L=Math.max(L,h.endDTS)}h.duration=v-E;var m=E-h.start;h.appendedPTS=v,h.start=h.startPTS=E,h.maxStartPTS=p,h.startDTS=g,h.endPTS=v,h.minEndPTS=c,h.endDTS=L;var C=h.sn;if(!l||Cl.endSN)return 0;var P,H=C-l.startSN,V=l.fragments;for(V[H]=h,P=H;P>0;P--)O(V[P],V[P-1]);for(P=H;P=0;g--){var L=v[g].initSegment;if(L){E=L;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var x=0,p;if(k(l,h,function(P,H){P.relurl&&(x=P.cc-H.cc),Object(Q.isFiniteNumber)(P.startPTS)&&Object(Q.isFiniteNumber)(P.endPTS)&&(H.start=H.startPTS=P.startPTS,H.startDTS=P.startDTS,H.appendedPTS=P.appendedPTS,H.maxStartPTS=P.maxStartPTS,H.endPTS=P.endPTS,H.endDTS=P.endDTS,H.minEndPTS=P.minEndPTS,H.duration=P.endPTS-P.startPTS,H.duration&&(p=H),h.PTSKnown=h.alignedSliding=!0),H.elementaryStreams=P.elementaryStreams,H.loader=P.loader,H.stats=P.stats,H.urlId=P.urlId,P.initSegment&&(H.initSegment=P.initSegment,E=P.initSegment)}),E){var c=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;c.forEach(function(P){var H;(!P.initSegment||P.initSegment.relurl===((H=E)===null||H===void 0?void 0:H.relurl))&&(P.initSegment=E)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(P){return!P}),h.deltaUpdateFailed)){B.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=h.skippedSegments;u--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var a=h.fragments;if(x){B.logger.warn("discontinuity sliding from playlist, take drift into account");for(var b=0;b=v.length)return;w(h,v[E].start)}function w(l,h){if(h){for(var E=l.fragments,v=l.skippedSegments;v0&&g0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),c=u),this.state=B.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=B.State.STOPPED},x.stopLoad=function(){this._forceStartLoad=!1,g.prototype.stopLoad.call(this)},x.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_LEVEL:{var c,u=this.levels,a=this.level,b=u==null||((c=u[a])===null||c===void 0)?void 0:c.details;if(b&&(!b.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(b))break;this.state=B.State.IDLE;break}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var m,C=self.performance.now(),P=this.retryDate;(!P||C>=P||(m=this.media)!==null&&m!==void 0&&m.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=B.State.IDLE)}break;default:break}this.onTickEnd()},x.onTickEnd=function(){g.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},x.doTickIdle=function(){var c,u,a=this.hls,b=this.levelLastLoaded,m=this.levels,C=this.media,P=a.config,H=a.nextLoadLevel;if(b===null||!C&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!m||!m[H])return;var V=m[H];this.level=a.nextLoadLevel=H;var $=V.details;if(!$||this.state===B.State.WAITING_LEVEL||$.live&&this.levelLastLoaded!==H){this.state=B.State.WAITING_LEVEL;return}var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:C,I.PlaylistLevelType.MAIN);if(z===null)return;var U=z.len,ee=this.getMaxBufferLength(V.maxBitrate);if(U>=ee)return;if(this._streamEnded(z,$)){var oe={};this.altAudio&&(oe.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,oe),this.state=B.State.ENDED;return}var 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(C,xe,I.PlaylistLevelType.MAIN),ve=this.getNextFragment(this.nextLoadPosition,$)}if(!ve)return;ve.initSegment&&!ve.initSegment.data&&!this.bitrateTest&&(ve=ve.initSegment),((c=ve.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((u=ve.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(ve,$):this.loadFragment(ve,$,ce)},x.loadFragment=function(c,u,a){var b,m=this.fragmentTracker.getState(c);if(this.fragCurrent=c,m===O.FragmentState.BACKTRACKED){var C=this.fragmentTracker.getBacktrackData(c);if(C){this._handleFragmentLoadProgress(C),this._handleFragmentLoadComplete(C);return}else m=O.FragmentState.NOT_LOADED}m===O.FragmentState.NOT_LOADED||m===O.FragmentState.PARTIAL?c.sn==="initSegment"?this._loadInitSegment(c):this.bitrateTest?(c.bitrateTest=!0,this.log("Fragment "+c.sn+" of level "+c.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(c)):(this.startFragRequested=!0,g.prototype.loadFragment.call(this,c,u,a)):m===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 u=this.fragmentTracker.getAppendedFrag(c,I.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},x.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,I.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,u=this.media;if(u!=null&&u.readyState){var a,b=this.getAppendedFrag(u.currentTime);if(b&&b.start>1&&this.flushMainBuffer(0,b.start-1),!u.paused&&c){var m=this.hls.nextLoadLevel,C=c[m],P=this.fragLastKbps;P&&this.fragCurrent?a=this.fragCurrent.duration*C.maxBitrate/(1e3*P)+1:a=0}else a=0;var H=this.getBufferedFrag(u.currentTime+a);if(H){var V=this.followingBufferedFrag(H);if(V){this.abortCurrentFrag();var $=V.maxStartPTS?V.maxStartPTS:V.start,z=V.duration,U=Math.max(H.end,$+Math.min(Math.max(z-this.config.maxFragLookUpTolerance,z*.5),z*.75));this.flushMainBuffer(U,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,u){g.prototype.flushMainBuffer.call(this,c,u,this.altAudio?"video":null)},x.onMediaAttached=function(c,u){g.prototype.onMediaAttached.call(this,c,u);var a=u.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new D.default(this.config,a,this.fragmentTracker,this.hls)},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),g.prototype.onMediaDetaching.call(this)},x.onMediaPlaying=function(){this.tick()},x.onMediaSeeked=function(){var c=this.media,u=c?c.currentTime:null;Object(Q.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},x.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},x.onManifestParsed=function(c,u){var a=!1,b=!1,m;u.levels.forEach(function(C){m=C.audioCodec,m&&(m.indexOf("mp4a.40.2")!==-1&&(a=!0),m.indexOf("mp4a.40.5")!==-1&&(b=!0))}),this.audioCodecSwitch=a&&b&&!Object(_.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=u.levels,this.startFragRequested=!1},x.onLevelLoading=function(c,u){var a=this.levels;if(!a||this.state!==B.State.IDLE)return;var b=a[u.level];(!b.details||b.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(b.details))&&(this.state=B.State.WAITING_LEVEL)},x.onLevelLoaded=function(c,u){var a,b=this.levels,m=u.level,C=u.details,P=C.totalduration;if(!b){this.warn("Levels were reset while loading level "+m);return}this.log("Level "+m+" loaded ["+C.startSN+","+C.endSN+"], cc ["+C.startCC+", "+C.endCC+"] duration:"+P);var H=this.fragCurrent;H&&(this.state===B.State.FRAG_LOADING||this.state===B.State.FRAG_LOADING_WAITING_RETRY)&&(H.level!==u.level&&H.loader&&(this.state=B.State.IDLE,H.loader.abort()));var V=b[m],$=0;if(C.live||(a=V.details)!==null&&a!==void 0&&a.live){if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed)return;$=this.alignPlaylists(C,V.details)}if(V.details=C,this.levelLastLoaded=m,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:C,level:m}),this.state===B.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(C))return;this.state=B.State.IDLE}this.startFragRequested?C.live&&this.synchronizeToLiveEdge(C):this.setStartPosition(C,$),this.tick()},x._handleFragmentLoadProgress=function(c){var u,a=c.frag,b=c.part,m=c.payload,C=this.levels;if(!C){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=C[a.level],H=P.details;if(!H){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var V=P.videoCodec,$=H.PTSKnown||!H.live,z=(u=a.initSegment)===null||u===void 0?void 0:u.data,U=this._getAudioCodec(P),ee=this.transmuxer=this.transmuxer||new T.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),oe=b?b.index:-1,ce=oe!==-1,ve=new k.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,m.byteLength,oe,ce),Me=this.initPTS[a.cc];ee.push(m,z,U,V,a,b,H.totalduration,$,ve,Me)},x.onAudioTrackSwitching=function(c,u){var a=this.altAudio,b=!!u.url,m=u.id;if(!b){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var C=this.fragCurrent;C!=null&&C.loader&&(this.log("Switching to main audio track, cancel main fragment load"),C.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;a&&P.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:m})}},x.onAudioTrackSwitched=function(c,u){var a=u.id,b=!!this.hls.audioTracks[a].url;if(b){var m=this.videoBuffer;m&&this.mediaBuffer!==m&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=m)}this.altAudio=b,this.tick()},x.onBufferCreated=function(c,u){var a=u.tracks,b,m,C=!1;for(var P in a){var H=a[P];if(H.id==="main"){if(m=P,b=H,P==="video"){var V=a[P];V&&(this.videoBuffer=V.buffer)}}else C=!0}C&&b?(this.log("Alternate track found, use "+m+".buffered to schedule main fragment loading"),this.mediaBuffer=b.buffer):this.mediaBuffer=this.media},x.onFragBuffered=function(c,u){var a=u.frag,b=u.part;if(a&&a.type!==I.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 m=b?b.stats:a.stats;this.fragLastKbps=Math.round(8*m.total/(m.buffering.end-m.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,b)},x.onError=function(c,u){switch(u.details){case w.ErrorDetails.FRAG_LOAD_ERROR:case w.ErrorDetails.FRAG_LOAD_TIMEOUT:case w.ErrorDetails.KEY_LOAD_ERROR:case w.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.MAIN,u);break;case w.ErrorDetails.LEVEL_LOAD_ERROR:case w.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==B.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=B.State.ERROR):!u.levelRetry&&this.state===B.State.WAITING_LEVEL&&(this.state=B.State.IDLE));break;case w.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var a=!0,b=this.getFwdBufferInfo(this.media,I.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,u=this.gapController;if(!c||!u||!c.readyState)return;var a=j.BufferHelper.getBuffered(c);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},x.onFragLoadEmergencyAborted=function(){this.state=B.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},x.onBufferFlushed=function(c,u){var a=u.type;if(a!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var b=(a===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(b,a,I.PlaylistLevelType.MAIN)}},x.onLevelsUpdated=function(c,u){this.levels=u.levels},x.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},x.seekToStartPos=function(){var c=this.media,u=c.currentTime,a=this.startPosition;if(a>=0&&u0&&(C1&&c.seeking===!1){var a=c.currentTime;if(j.BufferHelper.isBuffered(c,a)?u=this.getAppendedFrag(a):j.BufferHelper.isBuffered(c,a+.1)&&(u=this.getAppendedFrag(a+.1)),u){var b=this.fragPlaying,m=u.level;(!b||u.sn!==b.sn||b.level!==m||u.urlId!==b.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:u}),(!b||b.level!==m)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:m}),this.fragPlaying=u)}}},o(L,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var u=this.getAppendedFrag(c.currentTime);if(u)return u.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var u=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(u)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(B.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"SubtitleStreamController",function(){return l});var Q=R("./src/events.ts"),B=R("./src/utils/logger.ts"),_=R("./src/utils/buffer-helper.ts"),G=R("./src/controller/fragment-finders.ts"),j=R("./src/utils/discontinuities.ts"),O=R("./src/controller/level-helper.ts"),I=R("./src/controller/fragment-tracker.ts"),y=R("./src/controller/base-stream-controller.ts"),T=R("./src/types/loader.ts"),k=R("./src/types/level.ts");function D(h,E){for(var v=0;v=u[m].start&&b<=u[m].end){a=u[m];break}var C=p.start+p.duration;a?a.end=C:(a={start:b,end:C},u.push(a)),this.fragmentTracker.fragBuffered(p)},v.onBufferFlushing=function(L,x){var p=x.startOffset,c=x.endOffset;if(p===0&&c!==Number.POSITIVE_INFINITY){var u=this.currentTrackId,a=this.levels;if(!a.length||!a[u]||!a[u].details)return;var b=a[u].details,m=b.targetduration,C=c-m;if(C<=0)return;x.endOffsetSubtitles=Math.max(0,C),this.tracksBuffered.forEach(function(P){for(var H=0;H=b.length||u!==a||!m)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(p=m.details)!==null&&p!==void 0&&p.live){var C=this.mainDetails;if(c.deltaUpdateFailed||!C)return;var P=C.fragments[0];if(!m.details)c.hasProgramDateTime&&C.hasProgramDateTime?Object(j.alignMediaPlaylistByPDT)(c,C):P&&Object(O.addSliding)(c,P.start);else{var H=this.alignPlaylists(c,m.details);H===0&&P&&Object(O.addSliding)(c,P.start)}}if(m.details=c,this.levelLastLoaded=u,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var V=Object(G.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);V||(this.warn("Subtitle playlist not aligned with playback"),m.details=void 0)}},v._handleFragmentLoadComplete=function(L){var x=L.frag,p=L.payload,c=x.decryptdata,u=this.hls;if(this.fragContextChanged(x))return;if(p&&p.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(p),c.key.buffer,c.iv.buffer).then(function(b){var m=performance.now();u.trigger(Q.Events.FRAG_DECRYPTED,{frag:x,payload:b,stats:{tstart:a,tdecrypt:m}})})}},v.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var L,x=this.currentTrackId,p=this.levels;if(!p.length||!p[x]||!p[x].details)return;var c=p[x].details,u=c.targetduration,a=this.config,b=this.media,m=_.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,b.currentTime-u,a.maxBufferHole),C=m.end,P=m.len,H=this.getMaxBufferLength()+u;if(P>H)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var V=c.fragments,$=V.length,z=c.edge,U,ee=this.fragPrevious;if(C-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)},A.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},A.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var o=k(this.media.textTracks);o.forEach(function(l){Object(B.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},A.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},A.onManifestParsed=function(o,l){this.tracks=l.subtitleTracks},A.onSubtitleTrackLoaded=function(o,l){var h=l.id,E=l.details,v=this.trackId,g=this.tracksInGroup[v];if(!g){this.warn("Invalid subtitle track id "+h);return}var L=g.details;g.details=l.details,this.log("subtitle track "+h+" loaded ["+E.startSN+"-"+E.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,l,L))},A.onLevelLoading=function(o,l){this.switchLevel(l.level)},A.onLevelSwitching=function(o,l){this.switchLevel(l.level)},A.switchLevel=function(o){var l=this.hls.levels[o];if(!(l!=null&&l.textGroupIds))return;var h=l.textGroupIds[l.urlId];if(this.groupId!==h){var E=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(x){return!h||x.groupId===h});this.tracksInGroup=v;var g=this.findTrackId(E==null?void 0:E.name)||this.findTrackId();this.groupId=h;var L={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(Q.Events.SUBTITLE_TRACKS_UPDATED,L),g!==-1&&this.setSubtitleTrack(g,E)}},A.findTrackId=function(o){for(var l=this.tracksInGroup,h=0;h=E.length)return;this.clearTimer();var v=E[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,v){var g=v.id,L=v.groupId,x=L===void 0?"":L,p=v.name,c=v.type,u=v.url;this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:g,groupId:x,name:p,type:c,url:u});var a=this.switchParams(v.url,l==null?void 0:l.details);this.loadPlaylist(a)}else this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:o})},A.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,l=k(this.media.textTracks),h=0;h=0&&(c[0]=Math.min(c[0],E),c[1]=Math.max(c[1],v),x=!0,u/(v-E)>.5))return}if(x||L.push([E,v]),this.config.renderTextTracksNatively){var a=this.captionsTracks[h];this.Cues.newCue(a,E,v,g)}else{var b=this.Cues.newCue(null,E,v,g);this.hls.trigger(B.Events.CUES_PARSED,{type:"captions",cues:b,track:h})}},o.onInitPtsFound=function(h,E){var v=this,g=E.frag,L=E.id,x=E.initPTS,p=E.timescale,c=this.unparsedVttFrags;L==="main"&&(this.initPTS[g.cc]=x,this.timescale[g.cc]=p),c.length&&(this.unparsedVttFrags=[],c.forEach(function(u){v.onFragLoaded(B.Events.FRAG_LOADED,u)}))},o.getExistingTrack=function(h){var E=this.media;if(E)for(var v=0;v>>8^p&255^99,I[g]=p,y[p]=g;var c=v[g],u=v[c],a=v[u],b=v[p]*257^p*16843008;k[g]=b<<24|b>>>8,D[g]=b<<16|b>>>16,w[g]=b<<8|b>>>24,A[g]=b,b=a*16843009^u*65537^c*257^g*16843008,o[p]=b<<24|b>>>8,l[p]=b<<16|b>>>16,h[p]=b<<8|b>>>24,E[p]=b,g?(g=c^v[v[v[a^c]]],L^=v[v[L]]):g=L=1}},j.expandKey=function(I){for(var y=this.uint8ArrayToUint32Array_(I),T=!0,k=0;k>>6)+1;var b=(h[E+2]&60)>>>2;if(b>a.length-1){l.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+b});return}return x=(h[E+2]&1)<<2,x|=(h[E+3]&192)>>>6,Q.logger.log("manifest codec:"+v+", ADTS type:"+g+", samplingIndex:"+b),/firefox/i.test(c)?b>=6?(g=5,p=new Array(4),L=b-3):(g=2,p=new Array(2),L=b):c.indexOf("android")!==-1?(g=2,p=new Array(2),L=b):(g=5,p=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&b>=6?L=b-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(b>=6&&x===1||/vivaldi/i.test(c))||!v&&x===1)&&(g=2,p=new Array(2)),L=b)),p[0]=g<<3,p[0]|=(b&14)>>1,p[1]|=(b&1)<<7,p[1]|=x<<3,g===5&&(p[1]|=(L&14)>>1,p[2]=(L&1)<<7,p[2]|=2<<2,p[3]=0),{config:p,samplerate:a[b],channelCount:x,codec:"mp4a.40."+g,manifestCodec:u}}function j(l,h){return l[h]===255&&(l[h+1]&246)===240}function O(l,h){return l[h+1]&1?7:9}function I(l,h){return(l[h+3]&3)<<11|l[h+4]<<3|(l[h+5]&224)>>>5}function y(l,h){return h+5=l.length)return!1;var v=I(l,h);if(v<=E)return!1;var g=h+v;return g===l.length||T(l,g)}return!1}function w(l,h,E,v,g){if(!l.samplerate){var L=G(h,E,v,g);if(!L)return;l.config=L.config,l.samplerate=L.samplerate,l.channelCount=L.channelCount,l.codec=L.codec,l.manifestCodec=L.manifestCodec,Q.logger.log("parsed codec:"+l.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function A(l){return 1024*9e4/l}function d(l,h,E,v,g){var L=O(l,h),x=I(l,h);if(x-=L,x>0){var p=E+v*g;return{headerLength:L,frameLength:x,stamp:p}}}function o(l,h,E,v,g){var L=A(l.samplerate),x=d(h,E,v,g,L);if(x){var p=x.frameLength,c=x.headerLength,u=x.stamp,a=c+p,b=Math.max(0,E+a-h.length),m;b?(m=new Uint8Array(a-c),m.set(h.subarray(E+c,h.length),0)):m=h.subarray(E+c,E+a);var C={unit:m,pts:u};return b||l.samples.push(C),{sample:C,length:a,missing:b}}}},"./src/demux/base-audio-demuxer.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"initPTSFn",function(){return I});var Q=R("./src/polyfills/number.ts"),B=R("./src/demux/id3.ts"),_=R("./src/demux/dummy-demuxed-track.ts"),G=R("./src/utils/mp4-tools.ts"),j=R("./src/utils/typed-array.ts"),O=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var T=y.prototype;return T.resetInitSegment=function(D,w,A){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},T.resetTimeStamp=function(){},T.resetContiguity=function(){},T.canParse=function(D,w){return!1},T.appendFrame=function(D,w,A){},T.demux=function(D,w){this.cachedData&&(D=Object(G.appendUint8Array)(this.cachedData,D),this.cachedData=null);var A=B.getID3Data(D,0),d=A?A.length:0,o,l,h=this._audioTrack,E=this._id3Track,v=A?B.getTimeStamp(A):void 0,g=D.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(v,w)),A&&A.length>0&&E.samples.push({pts:this.initPTS,dts:this.initPTS,data:A}),l=this.initPTS;dO?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,I=O>>3,O-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},G.readBits=function(O){var I=Math.min(this.bitsAvailable,O),y=this.word>>>32-I;return O>32&&Q.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=O-I,I>0&&this.bitsAvailable?y<>>O)!==0)return this.word<<=O,this.bitsAvailable-=O,O;return this.loadWord(),O+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},G.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(O){for(var I=8,y=8,T,k=0;k0?g.subarray(x,x+p):void 0},G=function(g,L){var x=0;return x=(g[L]&127)<<21,x|=(g[L+1]&127)<<14,x|=(g[L+2]&127)<<7,x|=g[L+3]&127,x},j=function(g,L){return Q(g,L)&&G(g,L+6)+10<=g.length-L},O=function(g){for(var L=T(g),x=0;x>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:C+=String.fromCharCode(a);break;case 12:case 13:b=g[P++],C+=String.fromCharCode((a&31)<<6|b&63);break;case 14:b=g[P++],m=g[P++],C+=String.fromCharCode((a&15)<<12|(b&63)<<6|(m&63)<<0);break;default:}}return C},l={decodeTextFrame:w},h;function E(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/demux/base-audio-demuxer.ts"),B=R("./src/demux/id3.ts"),_=R("./src/utils/logger.ts"),G=R("./src/demux/mpegaudio.ts");function j(y,T){y.prototype=Object.create(T.prototype),y.prototype.constructor=y,O(y,T)}function O(y,T){return O=Object.setPrototypeOf||function(D,w){return D.__proto__=w,D},O(y,T)}var I=function(y){j(T,y);function T(){return y.apply(this,arguments)||this}var k=T.prototype;return k.resetInitSegment=function(w,A,d){y.prototype.resetInitSegment.call(this,w,A,d),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:w,duration:d,inputTimeScale:9e4,dropped:0}},T.probe=function(w){if(!w)return!1;for(var A=B.getID3Data(w,0)||[],d=A.length,o=w.length;d0},j.demux=function(I){var y=I,T=Object(B.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(Q.appendUint8Array)(this.remainderData,I));var k=Object(Q.segmentValidRange)(y);this.remainderData=k.remainder,T.samples=k.valid||new Uint8Array}else T.samples=y;return{audioTrack:Object(B.dummyTrack)(),avcTrack:T,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},j.flush=function(){var I=Object(B.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(B.dummyTrack)(),avcTrack:I,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},j.demuxSampleAes=function(I,y,T){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},j.destroy=function(){},G}();_.minProbeByteLength=1024,X.default=_},"./src/demux/mpegaudio.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"appendFrame",function(){return O}),R.d(X,"parseHeader",function(){return I}),R.d(X,"isHeaderPattern",function(){return y}),R.d(X,"isHeader",function(){return T}),R.d(X,"canParse",function(){return k}),R.d(X,"probe",function(){return D});var Q=null,B=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],_=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],j=[0,1,1,4];function O(w,A,d,o,l){if(d+24>A.length)return;var h=I(A,d);if(h&&d+h.frameLength<=A.length){var E=h.samplesPerFrame*9e4/h.sampleRate,v=o+l*E,g={unit:A.subarray(d,d+h.frameLength),pts:v,dts:v};return w.config=[],w.channelCount=h.channelCount,w.samplerate=h.sampleRate,w.samples.push(g),{sample:g,length:h.frameLength,missing:0}}}function I(w,A){var d=w[A+1]>>3&3,o=w[A+1]>>1&3,l=w[A+2]>>4&15,h=w[A+2]>>2&3;if(d!==1&&l!==0&&l!==15&&h!==3){var E=w[A+2]>>1&1,v=w[A+3]>>6,g=d===3?3-o:o===3?3:4,L=B[g*14+l-1]*1e3,x=d===3?0:d===2?1:2,p=_[x*3+h],c=v===3?1:2,u=G[d][o],a=j[o],b=u*8*a,m=Math.floor(u*L/p+E)*a;if(Q===null){var C=navigator.userAgent||"",P=C.match(/Chrome\/(\d+)/i);Q=P?parseInt(P[1]):0}var H=!!Q&&Q<=87;return H&&o===2&&L>=224e3&&v===0&&(w[A+3]=w[A+3]|128),{sampleRate:p,channelCount:c,frameLength:m,samplesPerFrame:b}}}function y(w,A){return w[A]===255&&(w[A+1]&224)===224&&(w[A+1]&6)!==0}function T(w,A){return A+1=I.length){T();return}if(I[y].unit.length<32)continue;var k=this.decrypter.isSync();if(this.decryptAacSample(I,y,T,k),!k)return}},j.getAvcEncryptedData=function(I){for(var y=Math.floor((I.length-48)/160)*16+16,T=new Int8Array(y),k=0,D=32;D<=I.length-16;D+=160,k+=16)T.set(I.subarray(D,D+16),k);return T},j.getAvcDecryptedUnit=function(I,y){for(var T=new Uint8Array(y),k=0,D=32;D<=I.length-16;D+=160,k+=16)I.set(T.subarray(k,k+16),D);return I},j.decryptAvcSample=function(I,y,T,k,D,w){var A=Object(B.discardEPB)(D.data),d=this.getAvcEncryptedData(A),o=this;this.decryptBuffer(d.buffer,function(l){D.data=o.getAvcDecryptedUnit(A,l),w||o.decryptAvcSamples(I,y,T+1,k)})},j.decryptAvcSamples=function(I,y,T,k){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,T=0){if(y>=I.length){k();return}for(var D=I[y].units;!(T>=D.length);T++){var w=D[T];if(w.data.length<=48||w.type!==1&&w.type!==5)continue;var A=this.decrypter.isSync();if(this.decryptAvcSample(I,y,T,k,w,A),!A)return}}},G}();X.default=_},"./src/demux/transmuxer-interface.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return D});var Q=R("./node_modules/webworkify-webpack/index.js"),B=R.n(Q),_=R("./src/events.ts"),G=R("./src/demux/transmuxer.ts"),j=R("./src/utils/logger.ts"),O=R("./src/errors.ts"),I=R("./src/utils/mediasource-helper.ts"),y=R("./node_modules/eventemitter3/index.js"),T=R.n(y),k=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},D=function(){function w(d,o,l,h){var E=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=d,this.id=o,this.onTransmuxComplete=l,this.onFlush=h;var v=d.config,g=function(u,a){a=a||{},a.frag=E.frag,a.id=E.id,d.trigger(u,a)};this.observer=new y.EventEmitter,this.observer.on(_.Events.FRAG_DECRYPTED,g),this.observer.on(_.Events.ERROR,g);var L={mp4:k.isTypeSupported("video/mp4"),mpeg:k.isTypeSupported("audio/mpeg"),mp3:k.isTypeSupported('audio/mp4; codecs="mp3"')},x=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){j.logger.log("demuxing in webworker");var p;try{p=this.worker=Q("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),p.addEventListener("message",this.onwmsg),p.onerror=function(c){d.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+")")})},p.postMessage({cmd:"init",typeSupported:L,vendor:x,id:o,config:JSON.stringify(v)})}catch(c){j.logger.warn("Error in worker:",c),j.logger.error("Error while initializing DemuxerWorker, fallback to inline"),p&&self.URL.revokeObjectURL(p.objectURL),this.transmuxer=new G.default(this.observer,L,v,x,o),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,v,x,o)}var A=w.prototype;return A.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},A.push=function(o,l,h,E,v,g,L,x,p,c){var u=this;p.transmuxing.start=self.performance.now();var a=this.transmuxer,b=this.worker,m=g?g.start:v.start,C=v.decryptdata,P=this.frag,H=!(P&&v.cc===P.cc),V=!(P&&p.level===P.level),$=P?p.sn-P.sn:-1,z=this.part?p.part-this.part.index:1,U=!V&&($===1||$===0&&z===1),ee=self.performance.now();(V||$||v.stats.parsing.start===0)&&(v.stats.parsing.start=ee),g&&(z||!U)&&(g.stats.parsing.start=ee);var oe=new G.TransmuxState(H,U,x,V,m);if(!U||H){j.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+p.sn+" p: "+p.part+" level: "+p.level+" id: "+p.id+` discontinuity: `+H+` trackSwitch: `+V+` contiguous: `+U+` accurateTimeOffset: `+x+` timeOffset: `+m);var ce=new G.TransmuxConfig(h,E,l,L,c);this.configureTransmuxer(ce)}if(this.frag=v,this.part=g,b)b.postMessage({cmd:"demux",data:o,decryptdata:C,chunkMeta:p,state:oe},o instanceof ArrayBuffer?[o]:[]);else if(a){var ve=a.push(o,C,p,oe);Object(G.isPromise)(ve)?ve.then(function(Me){u.handleTransmuxComplete(Me)}):this.handleTransmuxComplete(ve)}},A.flush=function(o){var l=this;o.transmuxing.start=self.performance.now();var h=this.transmuxer,E=this.worker;if(E)E.postMessage({cmd:"flush",chunkMeta:o});else if(h){var v=h.flush(o);Object(G.isPromise)(v)?v.then(function(g){l.handleFlushResult(g,o)}):this.handleFlushResult(v,o)}},A.handleFlushResult=function(o,l){var h=this;o.forEach(function(E){h.handleTransmuxComplete(E)}),this.onFlush(l)},A.onWorkerMessage=function(o){var l=o.data,h=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,h.trigger(l.event,l.data);break}}},A.configureTransmuxer=function(o){var l=this.worker,h=this.transmuxer;l?l.postMessage({cmd:"configure",config:o}):h&&h.configure(o)},A.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},w}()},"./src/demux/transmuxer-worker.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return O});var Q=R("./src/demux/transmuxer.ts"),B=R("./src/events.ts"),_=R("./src/utils/logger.ts"),G=R("./node_modules/eventemitter3/index.js"),j=R.n(G);function O(D){var w=new G.EventEmitter,A=function(o,l){D.postMessage({event:o,data:l})};w.on(B.Events.FRAG_DECRYPTED,A),w.on(B.Events.ERROR,A),D.addEventListener("message",function(d){var o=d.data;switch(o.cmd){case"init":{var l=JSON.parse(o.config);D.transmuxer=new Q.default(w,o.typeSupported,l,o.vendor,o.id),Object(_.enableLogs)(l.debug),A("init",null);break}case"configure":{D.transmuxer.configure(o.config);break}case"demux":{var h=D.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(Q.isPromise)(h)?h.then(function(g){I(D,g)}):I(D,h);break}case"flush":{var E=o.chunkMeta,v=D.transmuxer.flush(E);Object(Q.isPromise)(v)?v.then(function(g){T(D,g,E)}):T(D,v,E);break}default:break}})}function I(D,w){if(k(w.remuxResult))return;var A=[],d=w.remuxResult,o=d.audio,l=d.video;o&&y(A,o),l&&y(A,l),D.postMessage({event:"transmuxComplete",data:w},A)}function y(D,w){w.data1&&D.push(w.data1.buffer),w.data2&&D.push(w.data2.buffer)}function T(D,w,A){w.forEach(function(d){I(D,d)}),D.postMessage({event:"flush",data:A})}function k(D){return!D.audio&&!D.video&&!D.text&&!D.id3&&!D.initSegment}},"./src/demux/transmuxer.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return l}),R.d(X,"isPromise",function(){return v}),R.d(X,"TransmuxConfig",function(){return g}),R.d(X,"TransmuxState",function(){return L});var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/crypt/decrypter.ts"),G=R("./src/demux/aacdemuxer.ts"),j=R("./src/demux/mp4demuxer.ts"),O=R("./src/demux/tsdemuxer.ts"),I=R("./src/demux/mp3demuxer.ts"),y=R("./src/remux/mp4-remuxer.ts"),T=R("./src/remux/passthrough-remuxer.ts"),k=R("./src/demux/chunk-cache.ts"),D=R("./src/utils/mp4-tools.ts"),w=R("./src/utils/logger.ts"),A;try{A=self.performance.now.bind(self.performance)}catch(x){w.logger.debug("Unable to use Performance API on this environment"),A=self.Date.now}var d=[{demux:O.default,remux:y.default},{demux:j.default,remux:T.default},{demux:G.default,remux:y.default},{demux:I.default,remux:y.default}],o=1024;d.forEach(function(x){var p=x.demux;o=Math.max(o,p.minProbeByteLength)});var l=function(){function x(c,u,a,b,m){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new k.default,this.observer=c,this.typeSupported=u,this.config=a,this.vendor=b,this.id=m}var p=x.prototype;return p.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},p.push=function(u,a,b,m){var C=this,P=b.transmuxing;P.executeStart=A();var H=new Uint8Array(u),V=this.cache,$=this.config,z=this.currentTransmuxState,U=this.transmuxConfig;m&&(this.currentTransmuxState=m);var ee=h(H,a);if(ee&&ee.method==="AES-128"){var oe=this.getDecrypter();if($.enableSoftwareAES){var ce=oe.softwareDecrypt(H,ee.key.buffer,ee.iv.buffer);if(!ce)return P.executeEnd=A(),E(b);H=new Uint8Array(ce)}else return this.decryptionPromise=oe.webCryptoDecrypt(H,ee.key.buffer,ee.iv.buffer).then(function(Oe){var Ue=C.push(Oe,null,b);return C.decryptionPromise=null,Ue}),this.decryptionPromise}var ve=m||z,Me=ve.contiguous,xe=ve.discontinuity,Ae=ve.trackSwitch,Ee=ve.accurateTimeOffset,Ce=ve.timeOffset,pe=U.audioCodec,se=U.videoCodec,De=U.defaultInitPts,ze=U.duration,We=U.initSegmentData;if((xe||Ae)&&this.resetInitSegment(We,pe,se,ze),xe&&this.resetInitialTimestamp(De),Me||this.resetContiguity(),this.needsProbing(H,xe,Ae)){if(V.dataLength){var Ke=V.flush();H=Object(D.appendUint8Array)(Ke,H)}this.configureTransmuxer(H,U)}var Ye=this.transmux(H,ee,Ce,Ee,b),Se=this.currentTransmuxState;return Se.contiguous=!0,Se.discontinuity=!1,Se.trackSwitch=!1,P.executeEnd=A(),Ye},p.flush=function(u){var a=this,b=u.transmuxing;b.executeStart=A();var m=this.decrypter,C=this.cache,P=this.currentTransmuxState,H=this.decryptionPromise;if(H)return H.then(function(){return a.flush(u)});var V=[],$=P.timeOffset;if(m){var z=m.flush();z&&V.push(this.push(z,null,u))}var U=C.dataLength;C.reset();var ee=this.demuxer,oe=this.remuxer;if(!ee||!oe)return U>=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=A(),[E(u)];var ce=ee.flush($);return v(ce)?ce.then(function(ve){return a.flushRemux(V,ve,u),V}):(this.flushRemux(V,ce,u),V)},p.flushRemux=function(u,a,b){var m=a.audioTrack,C=a.avcTrack,P=a.id3Track,H=a.textTrack,V=this.currentTransmuxState,$=V.accurateTimeOffset,z=V.timeOffset;w.logger.log("[transmuxer.ts]: Flushed fragment "+b.sn+(b.part>-1?" p: "+b.part:"")+" of level "+b.level);var U=this.remuxer.remux(m,C,P,H,z,$,!0,this.id);u.push({remuxResult:U,chunkMeta:b}),b.transmuxing.executeEnd=A()},p.resetInitialTimestamp=function(u){var a=this.demuxer,b=this.remuxer;if(!a||!b)return;a.resetTimeStamp(u),b.resetTimeStamp(u)},p.resetContiguity=function(){var u=this.demuxer,a=this.remuxer;if(!u||!a)return;u.resetContiguity(),a.resetNextTimestamp()},p.resetInitSegment=function(u,a,b,m){var C=this.demuxer,P=this.remuxer;if(!C||!P)return;C.resetInitSegment(a,b,m),P.resetInitSegment(u,a,b)},p.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},p.transmux=function(u,a,b,m,C){var P;return a&&a.method==="SAMPLE-AES"?P=this.transmuxSampleAes(u,a,b,m,C):P=this.transmuxUnencrypted(u,b,m,C),P},p.transmuxUnencrypted=function(u,a,b,m){var C=this.demuxer.demux(u,a,!1,!this.config.progressive),P=C.audioTrack,H=C.avcTrack,V=C.id3Track,$=C.textTrack,z=this.remuxer.remux(P,H,V,$,a,b,!1,this.id);return{remuxResult:z,chunkMeta:m}},p.transmuxSampleAes=function(u,a,b,m,C){var P=this;return this.demuxer.demuxSampleAes(u,a,b).then(function(H){var V=P.remuxer.remux(H.audioTrack,H.avcTrack,H.id3Track,H.textTrack,b,m,!1,P.id);return{remuxResult:V,chunkMeta:C}})},p.configureTransmuxer=function(u,a){for(var b=this.config,m=this.observer,C=this.typeSupported,P=this.vendor,H=a.audioCodec,V=a.defaultInitPts,$=a.duration,z=a.initSegmentData,U=a.videoCodec,ee,oe=0,ce=d.length;oe0&&p!=null&&p.key!=null&&p.iv!==null&&p.method!=null&&(c=p),c}var E=function(p){return{remuxResult:{},chunkMeta:p}};function v(x){return"then"in x&&x.then instanceof Function}var g=function(p,c,u,a,b){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=p,this.videoCodec=c,this.initSegmentData=u,this.duration=a,this.defaultInitPts=b},L=function(p,c,u,a,b){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=p,this.contiguous=c,this.accurateTimeOffset=u,this.trackSwitch=a,this.timeOffset=b}},"./src/demux/tsdemuxer.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"discardEPB",function(){return E});var Q=R("./src/demux/adts.ts"),B=R("./src/demux/mpegaudio.ts"),_=R("./src/demux/exp-golomb.ts"),G=R("./src/demux/id3.ts"),j=R("./src/demux/sample-aes.ts"),O=R("./src/events.ts"),I=R("./src/utils/mp4-tools.ts"),y=R("./src/utils/logger.ts"),T=R("./src/errors.ts"),k={video:1,audio:2,id3:3,text:4},D=function(){function v(L,x,p){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=L,this.config=x,this.typeSupported=p}v.probe=function(x){var p=v.syncOffset(x);return p<0?!1:(p&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+p+", junk ahead ?"),!0)},v.syncOffset=function(x){for(var p=Math.min(1e3,x.length-3*188),c=0;c>4,pe=void 0;if(Ce>1){if(pe=xe+5+x[xe+4],pe===xe+188)continue}else pe=xe+4;switch(Ee){case P:Ae&&(H&&(a=o(H))&&this.parseAVCPES(a,!1),H={data:[],size:0}),H&&(H.data.push(x.subarray(pe,xe+188)),H.size+=xe+188-pe);break;case V:Ae&&(z&&(a=o(z))&&(m.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),z={data:[],size:0}),z&&(z.data.push(x.subarray(pe,xe+188)),z.size+=xe+188-pe);break;case $:Ae&&(U&&(a=o(U))&&this.parseID3PES(a),U={data:[],size:0}),U&&(U.data.push(x.subarray(pe,xe+188)),U.size+=xe+188-pe);break;case 0:Ae&&(pe+=x[pe]+1),ce=this._pmtId=A(x,pe);break;case ce:{Ae&&(pe+=x[pe]+1);var se=d(x,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);P=se.avc,P>0&&(b.pid=P),V=se.audio,V>0&&(m.pid=V,m.isAAC=se.isAAC),$=se.id3,$>0&&(C.pid=$),ee&&!oe&&(y.logger.log("reparse from beginning"),ee=!1,xe=Me-188),oe=this.pmtParsed=!0;break}case 17:case 8191:break;default:ee=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});b.pesData=H,m.pesData=z,C.pesData=U;var De={audioTrack:m,avcTrack:b,id3Track:C,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(De),De},g.flush=function(){var x=this.remainderData;this.remainderData=null;var p;return x?p=this.demux(x,-1,!1,!0):p={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(p),this.sampleAes?this.decrypt(p,this.sampleAes):p},g.extractRemainingSamples=function(x){var p=x.audioTrack,c=x.avcTrack,u=x.id3Track,a=c.pesData,b=p.pesData,m=u.pesData,C;a&&(C=o(a))?(this.parseAVCPES(C,!0),c.pesData=null):c.pesData=a,b&&(C=o(b))?(p.isAAC?this.parseAACPES(C):this.parseMPEGPES(C),p.pesData=null):(b!=null&&b.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=b),m&&(C=o(m))?(this.parseID3PES(C),u.pesData=null):u.pesData=m},g.demuxSampleAes=function(x,p,c){var u=this.demux(x,c,!0,!this.config.progressive),a=this.sampleAes=new j.default(this.observer,this.config,p);return this.decrypt(u,a)},g.decrypt=function(x,p){return new Promise(function(c){var u=x.audioTrack,a=x.avcTrack;u.samples&&u.isAAC?p.decryptAacSamples(u.samples,0,function(){a.samples?p.decryptAvcSamples(a.samples,0,0,function(){c(x)}):c(x)}):a.samples&&p.decryptAvcSamples(a.samples,0,0,function(){c(x)})})},g.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},g.parseAVCPES=function(x,p){var c=this,u=this._avcTrack,a=this.parseAVCNALu(x.data),b=!1,m=this.avcSample,C,P=!1;x.data=null,m&&a.length&&!u.audFound&&(l(m,u),m=this.avcSample=w(!1,x.pts,x.dts,"")),a.forEach(function(H){switch(H.type){case 1:{C=!0,m||(m=c.avcSample=w(!0,x.pts,x.dts,"")),b&&(m.debug+="NDR "),m.frame=!0;var V=H.data;if(P&&V.length>4){var $=new _.default(V).readSliceType();($===2||$===4||$===7||$===9)&&(m.key=!0)}break}case 5:C=!0,m||(m=c.avcSample=w(!0,x.pts,x.dts,"")),b&&(m.debug+="IDR "),m.key=!0,m.frame=!0;break;case 6:{C=!0,b&&m&&(m.debug+="SEI ");var z=new _.default(E(H.data));z.readUByte();for(var U=0,ee=0,oe=!1,ce=0;!oe&&z.bytesAvailable>1;){U=0;do ce=z.readUByte(),U+=ce;while(ce===255);ee=0;do ce=z.readUByte(),ee+=ce;while(ce===255);if(U===4&&z.bytesAvailable!==0){oe=!0;var ve=z.readUByte();if(ve===181){var Me=z.readUShort();if(Me===49){var xe=z.readUInt();if(xe===1195456820){var Ae=z.readUByte();if(Ae===3){for(var Ee=z.readUByte(),Ce=z.readUByte(),pe=31&Ee,se=[Ee,Ce],De=0;De16){for(var ze=[],We=0;We<16;We++)ze.push(z.readUByte().toString(16)),(We===3||We===5||We===7||We===9)&&ze.push("-");for(var Ke=ee-16,Ye=new Uint8Array(Ke),Se=0;Se=0){var z={data:x.subarray(V,m-u-1),type:$};b.push(z)}else{var U=this.getLastNalUnit();if(U&&(a&&m<=4-a&&(U.state&&(U.data=U.data.subarray(0,U.data.byteLength-a))),P=m-u-1,P>0)){var ee=new Uint8Array(U.data.byteLength+P);ee.set(U.data,0),ee.set(x.subarray(0,P),U.data.byteLength),U.data=ee,U.state=0}}m=0&&u>=0){var oe={data:x.subarray(V,p),type:$,state:u};b.push(oe)}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=u,b},g.parseAACPES=function(x){var p=0,c=this._audioTrack,u=this.aacOverFlow,a=x.data;if(u){this.aacOverFlow=null;var b=u.sample.unit.byteLength,m=Math.min(u.missing,b),C=b-m;u.sample.unit.set(a.subarray(0,m),C),c.samples.push(u.sample),p=u.missing}var P,H;for(P=p,H=a.length;P1;){var b=new Uint8Array(a[0].length+a[1].length);b.set(a[0]),b.set(a[1],a[0].length),a[0]=b,a.splice(1,1)}L=a[0];var m=(L[0]<<16)+(L[1]<<8)+L[2];if(m===1){if(x=(L[4]<<8)+L[5],x&&x>v.size-6)return null;var C=L[7];C&192&&(c=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,C&64?(u=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,c-u>60*9e4&&(y.logger.warn(Math.round((c-u)/9e4)+"s delta between PTS and DTS, align them"),c=u)):u=c),p=L[8];var P=p+9;if(v.size<=P)return null;v.size-=P;for(var H=new Uint8Array(v.size),V=0,$=a.length;V<$;V++){L=a[V];var z=L.byteLength;if(P)if(P>z){P-=z;continue}else L=L.subarray(P),z-=P,P=0;H.set(L,g),g+=z}return x&&(x-=p+3),{data:H,pts:c,dts:u,len:x}}return null}function l(v,g){if(v.units.length&&v.frame){if(v.pts===void 0){var L=g.samples,x=L.length;if(x){var p=L[x-1];v.pts=p.pts,v.dts=p.dts}else{g.dropped++;return}}g.samples.push(v)}v.debug.length&&y.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function h(v,g){var L=v.length;if(L>0){if(g.pts>=v[L-1].pts)v.push(g);else for(var x=L-1;x>=0;x--)if(g.ptsc)return a;return 0}},{key:"maxAutoLevel",get:function(){var p=this.levels,c=this.autoLevelCapping,u;return c===-1&&p&&p.length?u=p.length-1:u=c,u}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(p){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,p)}},{key:"audioTracks",get:function(){var p=this.audioTrackController;return p?p.audioTracks:[]}},{key:"audioTrack",get:function(){var p=this.audioTrackController;return p?p.audioTrack:-1},set:function(p){var c=this.audioTrackController;c&&(c.audioTrack=p)}},{key:"subtitleTracks",get:function(){var p=this.subtitleTrackController;return p?p.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var p=this.subtitleTrackController;return p?p.subtitleTrack:-1},set:function(p){var c=this.subtitleTrackController;c&&(c.subtitleTrack=p)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var p=this.subtitleTrackController;return p?p.subtitleDisplay:!1},set:function(p){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=p)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(p){this.config.lowLatencyMode=p}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return o.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return g.defaultConfig?g.defaultConfig:w.hlsDefaultConfig},set:function(p){g.defaultConfig=p}}]),g}();v.defaultConfig=void 0},"./src/is-supported.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"isSupported",function(){return _}),R.d(X,"changeTypeSupported",function(){return G});var Q=R("./src/utils/mediasource-helper.ts");function B(){return self.SourceBuffer||self.WebKitSourceBuffer}function _(){var j=Object(Q.getMediaSource)();if(!j)return!1;var O=B(),I=j&&typeof j.isTypeSupported=="function"&&j.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!I&&!!y}function G(){var j,O=B();return typeof(O==null||((j=O.prototype)===null||j===void 0)?void 0:j.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return D}),R.d(X,"LoadError",function(){return A});var Q=R("./src/polyfills/number.ts"),B=R("./src/errors.ts");function _(d,o){d.prototype=Object.create(o.prototype),d.prototype.constructor=d,y(d,o)}function G(d){var o=typeof Map=="function"?new Map:void 0;return G=function(h){if(h===null||!I(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(h))return o.get(h);o.set(h,E)}function E(){return j(h,arguments,T(this).constructor)}return E.prototype=Object.create(h.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),y(E,h)},G(d)}function j(d,o,l){return O()?j=Reflect.construct:j=function(E,v,g){var L=[null];L.push.apply(L,v);var x=Function.bind.apply(E,L),p=new x;return g&&y(p,g.prototype),p},j.apply(null,arguments)}function O(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function I(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function y(d,o){return y=Object.setPrototypeOf||function(h,E){return h.__proto__=E,h},y(d,o)}function T(d){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},T(d)}var k=Math.pow(2,17),D=function(){function d(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var o=d.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(h,E){var v=this,g=h.url;if(!g)return Promise.reject(new A({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(g?"part list":"url")));this.abort();var L=this.config,x=L.fLoader,p=L.loader;return new Promise(function(c,u){v.loader&&v.loader.destroy();var a=v.loader=h.loader=x?new x(L):new p(L),b=w(h),m={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:k};h.stats=a.stats,a.load(b,m,{onSuccess:function(P,H,V,$){v.resetLoader(h,a),c({frag:h,part:null,payload:P.data,networkDetails:$})},onError:function(P,H,V){v.resetLoader(h,a),u(new A({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:P,networkDetails:V}))},onAbort:function(P,H,V){v.resetLoader(h,a),u(new A({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:V}))},onTimeout:function(P,H,V){v.resetLoader(h,a),u(new A({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:V}))},onProgress:function(P,H,V,$){E&&E({frag:h,part:null,payload:V,networkDetails:$})}})})},o.loadPart=function(h,E,v){var g=this;this.abort();var L=this.config,x=L.fLoader,p=L.loader;return new Promise(function(c,u){g.loader&&g.loader.destroy();var a=g.loader=h.loader=x?new x(L):new p(L),b=w(h,E),m={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:k};E.stats=a.stats,a.load(b,m,{onSuccess:function(P,H,V,$){g.resetLoader(h,a),g.updateStatsFromPart(h,E);var z={frag:h,part:E,payload:P.data,networkDetails:$};v(z),c(z)},onError:function(P,H,V){g.resetLoader(h,a),u(new A({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:E,response:P,networkDetails:V}))},onAbort:function(P,H,V){h.stats.aborted=E.stats.aborted,g.resetLoader(h,a),u(new A({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:E,networkDetails:V}))},onTimeout:function(P,H,V){g.resetLoader(h,a),u(new A({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:E,networkDetails:V}))}})})},o.updateStatsFromPart=function(h,E){var v=h.stats,g=E.stats,L=g.total;if(v.loaded+=g.loaded,L){var x=Math.round(h.duration/E.duration),p=Math.min(Math.round(v.loaded/L),x),c=x-p,u=c*Math.round(v.loaded/p);v.total=v.loaded+u}else v.total=Math.max(v.loaded,v.total);var a=v.loading,b=g.loading;a.start?a.first+=b.first-b.start:(a.start=b.start,a.first=b.first),a.end=b.end},o.resetLoader=function(h,E){h.loader=null,this.loader===E&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),E.destroy()},d}();function w(d,o){o===void 0&&(o=null);var l=o||d,h={frag:d,part:o,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},E=l.byteRangeStartOffset,v=l.byteRangeEndOffset;return Object(Q.isFiniteNumber)(E)&&Object(Q.isFiniteNumber)(v)&&(h.rangeStart=E,h.rangeEnd=v),h}var A=function(d){_(o,d);function o(l){for(var h,E=arguments.length,v=new Array(E>1?E-1:0),g=1;g>8*(15-L)&255;return g},h.setDecryptDataFromLevelKey=function(v,g){var L=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(L=j.LevelKey.fromURI(v.uri),L.method=v.method,L.iv=this.createInitializationVector(g),L.keyFormat="identity"),L},h.setElementaryStreamInfo=function(v,g,L,x,p,c){c===void 0&&(c=!1);var u=this.elementaryStreams,a=u[v];if(!a){u[v]={startPTS:g,endPTS:L,startDTS:x,endDTS:p,partial:c};return}a.startPTS=Math.min(a.startPTS,g),a.endPTS=Math.max(a.endPTS,L),a.startDTS=Math.min(a.startDTS,x),a.endDTS=Math.max(a.endDTS,p)},h.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[D.AUDIO]=null,v[D.VIDEO]=null,v[D.AUDIOVIDEO]=null},k(l,[{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&&G.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)}}]),l}(w),d=function(o){I(l,o);function l(h,E,v,g,L){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=h.decimalFloatingPoint("DURATION"),x.gap=h.bool("GAP"),x.independent=h.bool("INDEPENDENT"),x.relurl=h.enumeratedString("URI"),x.fragment=E,x.index=g;var p=h.enumeratedString("BYTERANGE");return p&&x.setByteRange(p,L),L&&(x.fragOffset=L.fragOffset+L.duration),x}return k(l,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var E=this.elementaryStreams;return!!(E.audio||E.video||E.audiovideo)}}]),l}(w)},"./src/loader/key-loader.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return G});var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/utils/logger.ts"),G=function(){function j(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var O=j.prototype;return O._registerListeners=function(){this.hls.on(Q.Events.KEY_LOADING,this.onKeyLoading,this)},O._unregisterListeners=function(){this.hls.off(Q.Events.KEY_LOADING,this.onKeyLoading)},O.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var T=this.loaders[y];T&&T.destroy()}this.loaders={}},O.onKeyLoading=function(y,T){var k=T.frag,D=k.type,w=this.loaders[D];if(!k.decryptdata){_.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var A=k.decryptdata.uri;if(A!==this.decrypturl||this.decryptkey===null){var d=this.hls.config;if(w&&(_.logger.warn("abort previous key loader for type:"+D),w.abort()),!A){_.logger.warn("key uri is falsy");return}var o=d.loader,l=k.loader=this.loaders[D]=new o(d);this.decrypturl=A,this.decryptkey=null;var h={url:A,frag:k,responseType:"arraybuffer"},E={timeout:d.fragLoadingTimeOut,maxRetry:0,retryDelay:d.fragLoadingRetryDelay,maxRetryDelay:d.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(h,E,v)}else this.decryptkey&&(k.decryptdata.key=this.decryptkey,this.hls.trigger(Q.Events.KEY_LOADED,{frag:k}))},O.loadsuccess=function(y,T,k){var D=k.frag;if(!D.decryptdata){_.logger.error("after key load, decryptdata unset");return}this.decryptkey=D.decryptdata.key=new Uint8Array(y.data),D.loader=null,delete this.loaders[D.type],this.hls.trigger(Q.Events.KEY_LOADED,{frag:D})},O.loaderror=function(y,T){var k=T.frag,D=k.loader;D&&D.abort(),delete this.loaders[k.type],this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:k,response:y})},O.loadtimeout=function(y,T){var k=T.frag,D=k.loader;D&&D.abort(),delete this.loaders[k.type],this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:k})},j}()},"./src/loader/level-details.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"LevelDetails",function(){return j});var Q=R("./src/polyfills/number.ts");function B(O,I){for(var y=0;yT.endSN||k>0||k===0&&D>0,this.updated||this.advanced?this.misses=Math.floor(T.misses*.6):this.misses=T.misses+1,this.availabilityDelay=T.availabilityDelay},_(O,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Q.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var T=this.driftEndTime-this.driftStartTime;if(T>0){var k=this.driftEnd-this.driftStart;return k*1e3/T}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var T;return(T=this.fragments)!==null&&T!==void 0&&T.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"LevelKey",function(){return j});var Q=R("./node_modules/url-toolkit/src/url-toolkit.js"),B=R.n(Q);function _(O,I){for(var y=0;y2){var u=c.shift()+".";return u+=parseInt(c.shift()).toString(16),u+=("000"+parseInt(c.shift()).toString(16)).substr(-4),u}return p},L.resolve=function(p,c){return B.buildAbsoluteURL(c,p,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(p,c){var u=[],a={},b=!1;k.lastIndex=0;for(var m;(m=k.exec(p))!=null;)if(m[1]){var C=new I.AttrList(m[1]),P={attrs:C,bitrate:C.decimalInteger("AVERAGE-BANDWIDTH")||C.decimalInteger("BANDWIDTH"),name:C.NAME,url:L.resolve(m[2],c)},H=C.decimalResolution("RESOLUTION");H&&(P.width=H.width,P.height=H.height),h((C.CODECS||"").split(/[ ,]+/).filter(function($){return $}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=L.convertAVC1ToAVCOTI(P.videoCodec)),u.push(P)}else if(m[3]){var V=new I.AttrList(m[3]);V["DATA-ID"]&&(b=!0,a[V["DATA-ID"]]=V)}return{levels:u,sessionData:b?a:null}},L.parseMasterPlaylistMedia=function(p,c,u,a){a===void 0&&(a=[]);var b,m=[],C=0;for(D.lastIndex=0;(b=D.exec(p))!==null;){var P=new I.AttrList(b[1]);if(P.TYPE===u){var H={attrs:P,bitrate:0,id:C++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:u,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?L.resolve(P.URI,c):""};if(a.length){var V=L.findGroup(a,H.groupId)||a[0];E(H,V,"audioCodec"),E(H,V,"textCodec")}m.push(H)}}return m},L.parseLevelPlaylist=function(p,c,u,a,b){var m=new j.LevelDetails(c),C=m.fragments,P=null,H=0,V=0,$=0,z=0,U=null,ee=new G.Fragment(a,c),oe,ce,ve,Me=-1,xe=!1;for(w.lastIndex=0,m.m3u8=p;(oe=w.exec(p))!==null;){xe&&(xe=!1,ee=new G.Fragment(a,c),ee.start=$,ee.sn=H,ee.cc=z,ee.level=u,P&&(ee.initSegment=P,ee.rawProgramDateTime=P.rawProgramDateTime));var Ae=oe[1];if(Ae){ee.duration=parseFloat(Ae);var Ee=(" "+oe[2]).slice(1);ee.title=Ee||null,ee.tagList.push(Ee?["INF",Ae,Ee]:["INF",Ae])}else if(oe[3])Object(Q.isFiniteNumber)(ee.duration)&&(ee.start=$,ve&&(ee.levelkey=ve),ee.sn=H,ee.level=u,ee.cc=z,ee.urlId=b,C.push(ee),ee.relurl=(" "+oe[3]).slice(1),g(ee,U),U=ee,$+=ee.duration,H++,V=0,xe=!0);else if(oe[4]){var Ce=(" "+oe[4]).slice(1);U?ee.setByteRange(Ce,U):ee.setByteRange(Ce)}else if(oe[5])ee.rawProgramDateTime=(" "+oe[5]).slice(1),ee.tagList.push(["PROGRAM-DATE-TIME",ee.rawProgramDateTime]),Me===-1&&(Me=C.length);else{if(oe=oe[0].match(A),!oe){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(ce=1;ce-1){y.logger.warn("Keyformat "+it+" is not supported from the manifest");continue}else if(it!=="identity")continue;Ue&&(ve=O.LevelKey.fromURL(c,Xe),Xe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ue)>=0&&(ve.method=Ue,ve.keyFormat=it,Be&&(ve.keyID=Be),je&&(ve.keyFormatVersions=je),ve.iv=Qe));break}case"START":{var qe=new I.AttrList(se),tt=qe.decimalFloatingPoint("TIME-OFFSET");Object(Q.isFiniteNumber)(tt)&&(m.startTimeOffset=tt);break}case"MAP":{var dt=new I.AttrList(se);ee.relurl=dt.URI,dt.BYTERANGE&&ee.setByteRange(dt.BYTERANGE),ee.level=u,ee.sn="initSegment",ve&&(ee.levelkey=ve),ee.initSegment=null,P=ee,xe=!0;break}case"SERVER-CONTROL":{var rt=new I.AttrList(se);m.canBlockReload=rt.bool("CAN-BLOCK-RELOAD"),m.canSkipUntil=rt.optionalFloat("CAN-SKIP-UNTIL",0),m.canSkipDateRanges=m.canSkipUntil>0&&rt.bool("CAN-SKIP-DATERANGES"),m.partHoldBack=rt.optionalFloat("PART-HOLD-BACK",0),m.holdBack=rt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var nt=new I.AttrList(se);m.partTarget=nt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var we=m.partList;we||(we=m.partList=[]);var ut=V>0?we[we.length-1]:void 0,at=V++,Re=new G.Part(new I.AttrList(se),ee,c,at,ut);we.push(Re),ee.duration+=Re.duration;break}case"PRELOAD-HINT":{var He=new I.AttrList(se);m.preloadHint=He;break}case"RENDITION-REPORT":{var ge=new I.AttrList(se);m.renditionReports=m.renditionReports||[],m.renditionReports.push(ge);break}default:y.logger.warn("line parsed but not handled: "+oe);break}}}U&&!U.relurl?(C.pop(),$-=U.duration,m.partList&&(m.fragmentHint=U)):m.partList&&(g(ee,U),ee.cc=z,m.fragmentHint=ee);var de=C.length,fe=C[0],te=C[de-1];if($+=m.skippedSegments*m.targetduration,$>0&&de&&te){m.averagetargetduration=$/de;var re=te.sn;m.endSN=re!=="initSegment"?re:0,fe&&(m.startCC=fe.cc,fe.initSegment||m.fragments.every(function(ne){return ne.relurl&&o(ne.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),ee=new G.Fragment(a,c),ee.relurl=te.relurl,ee.level=u,ee.sn="initSegment",fe.initSegment=ee,m.needSidxRanges=!0))}else m.endSN=0,m.startCC=0;return m.fragmentHint&&($+=m.fragmentHint.duration),m.totalduration=$,m.endCC=z,Me>0&&v(C,Me),m},L}();function h(L,x){["video","audio","text"].forEach(function(p){var c=L.filter(function(a){return Object(T.isCodecType)(a,p)});if(c.length){var u=c.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});x[p+"Codec"]=u.length>0?u[0]:c[0],L=L.filter(function(a){return c.indexOf(a)===-1})}}),x.unknownCodecs=L}function E(L,x,p){var c=x[p];c&&(L[p]=c)}function v(L,x){for(var p=L[x],c=x;c--;){var u=L[c];if(!u)return;u.programDateTime=p.programDateTime-u.duration*1e3,p=u}}function g(L,x){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):x!=null&&x.programDateTime&&(L.programDateTime=x.endProgramDateTime),Object(Q.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/polyfills/number.ts"),B=R("./src/events.ts"),_=R("./src/errors.ts"),G=R("./src/utils/logger.ts"),j=R("./src/utils/mp4-tools.ts"),O=R("./src/loader/m3u8-parser.ts"),I=R("./src/types/loader.ts"),y=R("./src/utils/attr-list.ts");function T(w){var A=w.type;switch(A){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function k(w,A){var d=w.url;return(d===void 0||d.indexOf("data:")===0)&&(d=A.url),d}var D=function(){function w(d){this.hls=void 0,this.loaders=Object.create(null),this.hls=d,this.registerListeners()}var A=w.prototype;return A.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)},A.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)},A.createInternalLoader=function(o){var l=this.hls.config,h=l.pLoader,E=l.loader,v=h||E,g=new v(l);return o.loader=g,this.loaders[o.type]=g,g},A.getInternalLoader=function(o){return this.loaders[o.type]},A.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},A.destroyInternalLoaders=function(){for(var o in this.loaders){var l=this.loaders[o];l&&l.destroy(),this.resetInternalLoader(o)}},A.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},A.onManifestLoading=function(o,l){var h=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},A.onLevelLoading=function(o,l){var h=l.id,E=l.level,v=l.url,g=l.deliveryDirectives;this.load({id:h,groupId:null,level:E,responseType:"text",type:I.PlaylistContextType.LEVEL,url:v,deliveryDirectives:g})},A.onAudioTrackLoading=function(o,l){var h=l.id,E=l.groupId,v=l.url,g=l.deliveryDirectives;this.load({id:h,groupId:E,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:g})},A.onSubtitleTrackLoading=function(o,l){var h=l.id,E=l.groupId,v=l.url,g=l.deliveryDirectives;this.load({id:h,groupId:E,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:g})},A.load=function(o){var l,h=this.hls.config,E=this.getInternalLoader(o);if(E){var v=E.context;if(v&&v.url===o.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),E.abort()}var g,L,x,p;switch(o.type){case I.PlaylistContextType.MANIFEST:g=h.manifestLoadingMaxRetry,L=h.manifestLoadingTimeOut,x=h.manifestLoadingRetryDelay,p=h.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:g=0,L=h.levelLoadingTimeOut;break;default:g=h.levelLoadingMaxRetry,L=h.levelLoadingTimeOut,x=h.levelLoadingRetryDelay,p=h.levelLoadingMaxRetryTimeout;break}if(E=this.createInternalLoader(o),(l=o.deliveryDirectives)!==null&&l!==void 0&&l.part){var c;if(o.type===I.PlaylistContextType.LEVEL&&o.level!==null?c=this.hls.levels[o.level].details:o.type===I.PlaylistContextType.AUDIO_TRACK&&o.id!==null?c=this.hls.audioTracks[o.id].details:o.type===I.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(c=this.hls.subtitleTracks[o.id].details),c){var u=c.partTarget,a=c.targetduration;u&&a&&(L=Math.min(Math.max(u*3,a*.8)*1e3,L))}}var b={timeout:L,maxRetry:g,retryDelay:x,maxRetryDelay:p,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};E.load(o,b,m)},A.loadsuccess=function(o,l,h,E){if(E===void 0&&(E=null),h.isSidxRequest){this.handleSidxRequest(o,h),this.handlePlaylistLoaded(o,l,h,E);return}this.resetInternalLoader(h.type);var v=o.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,h,"no EXTM3U delimiter",E);return}l.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,l,h,E):this.handleMasterPlaylist(o,l,h,E)},A.loaderror=function(o,l,h){h===void 0&&(h=null),this.handleNetworkError(l,h,!1,o)},A.loadtimeout=function(o,l,h){h===void 0&&(h=null),this.handleNetworkError(l,h,!0)},A.handleMasterPlaylist=function(o,l,h,E){var v=this.hls,g=o.data,L=k(o,h),x=O.default.parseMasterPlaylist(g,L),p=x.levels,c=x.sessionData;if(!p.length){this.handleManifestParsingError(o,h,"no level found in manifest",E);return}var u=p.map(function(H){return{id:H.attrs.AUDIO,audioCodec:H.audioCodec}}),a=p.map(function(H){return{id:H.attrs.SUBTITLES,textCodec:H.textCodec}}),b=O.default.parseMasterPlaylistMedia(g,L,"AUDIO",u),m=O.default.parseMasterPlaylistMedia(g,L,"SUBTITLES",a),C=O.default.parseMasterPlaylistMedia(g,L,"CLOSED-CAPTIONS");if(b.length){var P=b.some(function(H){return!H.url});!P&&p[0].audioCodec&&!p[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),b.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}v.trigger(B.Events.MANIFEST_LOADED,{levels:p,audioTracks:b,subtitles:m,captions:C,url:L,stats:l,networkDetails:E,sessionData:c})},A.handleTrackOrLevelPlaylist=function(o,l,h,E){var v=this.hls,g=h.id,L=h.level,x=h.type,p=k(o,h),c=Object(Q.isFiniteNumber)(g)?g:0,u=Object(Q.isFiniteNumber)(L)?L:c,a=T(h),b=O.default.parseLevelPlaylist(o.data,p,u,a,c);if(!b.fragments.length){v.trigger(B.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:p,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(x===I.PlaylistContextType.MANIFEST){var m={attrs:new y.AttrList({}),bitrate:0,details:b,name:"",url:p};v.trigger(B.Events.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:p,stats:l,networkDetails:E,sessionData:null})}if(l.parsing.end=performance.now(),b.needSidxRanges){var C,P=(C=b.fragments[0].initSegment)===null||C===void 0?void 0:C.url;this.load({url:P,isSidxRequest:!0,type:x,level:L,levelDetails:b,id:g,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=b,this.handlePlaylistLoaded(o,l,h,E)},A.handleSidxRequest=function(o,l){var h=Object(j.parseSegmentIndex)(new Uint8Array(o.data));if(!h)return;var E=h.references,v=l.levelDetails;E.forEach(function(g,L){var x=g.info,p=v.fragments[L];p.byteRange.length===0&&p.setByteRange(String(1+x.end-x.start)+"@"+String(x.start)),p.initSegment&&p.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},A.handleManifestParsingError=function(o,l,h,E){this.hls.trigger(B.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===I.PlaylistContextType.MANIFEST,url:o.url,reason:h,response:o,context:l,networkDetails:E})},A.handleNetworkError=function(o,l,h,E){h===void 0&&(h=!1),G.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var v=_.ErrorDetails.UNKNOWN,g=!1,L=this.getInternalLoader(o);switch(o.type){case I.PlaylistContextType.MANIFEST:v=h?_.ErrorDetails.MANIFEST_LOAD_TIMEOUT:_.ErrorDetails.MANIFEST_LOAD_ERROR,g=!0;break;case I.PlaylistContextType.LEVEL:v=h?_.ErrorDetails.LEVEL_LOAD_TIMEOUT:_.ErrorDetails.LEVEL_LOAD_ERROR,g=!1;break;case I.PlaylistContextType.AUDIO_TRACK:v=h?_.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:v=h?_.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:_.ErrorDetails.SUBTITLE_LOAD_ERROR,g=!1;break}L&&this.resetInternalLoader(o.type);var x={type:_.ErrorTypes.NETWORK_ERROR,details:v,fatal:g,url:o.url,loader:L,context:o,networkDetails:l};E&&(x.response=E),this.hls.trigger(B.Events.ERROR,x)},A.handlePlaylistLoaded=function(o,l,h,E){var v=h.type,g=h.level,L=h.id,x=h.groupId,p=h.loader,c=h.levelDetails,u=h.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(o,h,"invalid target duration",E);return}if(!p)return;c.live&&(p.getCacheAge&&(c.ageHeader=p.getCacheAge()||0),(!p.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(v){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(B.Events.LEVEL_LOADED,{details:c,level:g||0,id:L||0,stats:l,networkDetails:E,deliveryDirectives:u});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,{details:c,id:L||0,groupId:x||"",stats:l,networkDetails:E,deliveryDirectives:u});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADED,{details:c,id:L||0,groupId:x||"",stats:l,networkDetails:E,deliveryDirectives:u});break}},w}();X.default=D},"./src/polyfills/number.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"isFiniteNumber",function(){return Q}),R.d(X,"MAX_SAFE_INTEGER",function(){return B});var Q=Number.isFinite||function(_){return typeof _=="number"&&isFinite(_)},B=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,X,R){"use strict";R.r(X);var Q=function(){function B(){}return B.getSilentFrame=function(G,j){switch(G){case"mp4a.40.2":if(j===1)return new Uint8Array([0,200,0,128,35,128]);if(j===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(j===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(j===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(j===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(j===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(j===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},B}();X.default=Q},"./src/remux/mp4-generator.ts":function(ie,X,R){"use strict";R.r(X);var Q=Math.pow(2,32)-1,B=function(){function _(){}return _.init=function(){_.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var j;for(j in _.types)_.types.hasOwnProperty(j)&&(_.types[j]=[j.charCodeAt(0),j.charCodeAt(1),j.charCodeAt(2),j.charCodeAt(3)]);var O=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),I=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);_.HDLR_TYPES={video:O,audio:I};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),T=new Uint8Array([0,0,0,0,0,0,0,0]);_.STTS=_.STSC=_.STCO=T,_.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),_.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),_.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var k=new Uint8Array([105,115,111,109]),D=new Uint8Array([97,118,99,49]),w=new Uint8Array([0,0,0,1]);_.FTYP=_.box(_.types.ftyp,k,w,k,D),_.DINF=_.box(_.types.dinf,_.box(_.types.dref,y))},_.box=function(j){for(var O=8,I=arguments.length,y=new Array(I>1?I-1:0),T=1;T>24&255,w[1]=O>>16&255,w[2]=O>>8&255,w[3]=O&255,w.set(j,4),k=0,O=8;k>24&255,j>>16&255,j>>8&255,j&255,I>>24,I>>16&255,I>>8&255,I&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},_.mdia=function(j){return _.box(_.types.mdia,_.mdhd(j.timescale,j.duration),_.hdlr(j.type),_.minf(j))},_.mfhd=function(j){return _.box(_.types.mfhd,new Uint8Array([0,0,0,0,j>>24,j>>16&255,j>>8&255,j&255]))},_.minf=function(j){return j.type==="audio"?_.box(_.types.minf,_.box(_.types.smhd,_.SMHD),_.DINF,_.stbl(j)):_.box(_.types.minf,_.box(_.types.vmhd,_.VMHD),_.DINF,_.stbl(j))},_.moof=function(j,O,I){return _.box(_.types.moof,_.mfhd(j),_.traf(I,O))},_.moov=function(j){for(var O=j.length,I=[];O--;)I[O]=_.trak(j[O]);return _.box.apply(null,[_.types.moov,_.mvhd(j[0].timescale,j[0].duration)].concat(I).concat(_.mvex(j)))},_.mvex=function(j){for(var O=j.length,I=[];O--;)I[O]=_.trex(j[O]);return _.box.apply(null,[_.types.mvex].concat(I))},_.mvhd=function(j,O){O*=j;var I=Math.floor(O/(Q+1)),y=Math.floor(O%(Q+1)),T=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,j>>24&255,j>>16&255,j>>8&255,j&255,I>>24,I>>16&255,I>>8&255,I&255,y>>24,y>>16&255,y>>8&255,y&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return _.box(_.types.mvhd,T)},_.sdtp=function(j){var O=j.samples||[],I=new Uint8Array(4+O.length),y,T;for(y=0;y>>8&255),O.push(k&255),O=O.concat(Array.prototype.slice.call(T));for(y=0;y>>8&255),I.push(k&255),I=I.concat(Array.prototype.slice.call(T));var D=_.box(_.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|j.sps.length].concat(O).concat([j.pps.length]).concat(I))),w=j.width,A=j.height,d=j.pixelRatio[0],o=j.pixelRatio[1];return _.box(_.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,w>>8&255,w&255,A>>8&255,A&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([d>>24,d>>16&255,d>>8&255,d&255,o>>24,o>>16&255,o>>8&255,o&255])))},_.esds=function(j){var O=j.config.length;return new Uint8Array([0,0,0,0,3,23+O,0,1,0,4,15+O,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([O]).concat(j.config).concat([6,1,2]))},_.mp4a=function(j){var O=j.samplerate;return _.box(_.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),_.box(_.types.esds,_.esds(j)))},_.mp3=function(j){var O=j.samplerate;return _.box(_.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},_.stsd=function(j){return j.type==="audio"?!j.isAAC&&j.codec==="mp3"?_.box(_.types.stsd,_.STSD,_.mp3(j)):_.box(_.types.stsd,_.STSD,_.mp4a(j)):_.box(_.types.stsd,_.STSD,_.avc1(j))},_.tkhd=function(j){var O=j.id,I=j.duration*j.timescale,y=j.width,T=j.height,k=Math.floor(I/(Q+1)),D=Math.floor(I%(Q+1));return _.box(_.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,D>>24,D>>16&255,D>>8&255,D&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,T>>8&255,T&255,0,0]))},_.traf=function(j,O){var I=_.sdtp(j),y=j.id,T=Math.floor(O/(Q+1)),k=Math.floor(O%(Q+1));return _.box(_.types.traf,_.box(_.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),_.box(_.types.tfdt,new Uint8Array([1,0,0,0,T>>24,T>>16&255,T>>8&255,T&255,k>>24,k>>16&255,k>>8&255,k&255])),_.trun(j,I.length+16+20+8+16+8+8),I)},_.trak=function(j){return j.duration=j.duration||4294967295,_.box(_.types.trak,_.tkhd(j),_.mdia(j))},_.trex=function(j){var O=j.id;return _.box(_.types.trex,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},_.trun=function(j,O){var I=j.samples||[],y=I.length,T=12+16*y,k=new Uint8Array(T),D,w,A,d,o,l;for(O+=8+T,k.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),D=0;D>>24&255,A>>>16&255,A>>>8&255,A&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*D);return _.box(_.types.trun,k)},_.initSegment=function(j){_.types||_.init();var O=_.moov(j),I=new Uint8Array(_.FTYP.byteLength+O.byteLength);return I.set(_.FTYP),I.set(O,_.FTYP.byteLength),I},_}();B.types=void 0,B.HDLR_TYPES=void 0,B.STTS=void 0,B.STSC=void 0,B.STCO=void 0,B.STSZ=void 0,B.VMHD=void 0,B.SMHD=void 0,B.STSD=void 0,B.FTYP=void 0,B.DINF=void 0,X.default=B},"./src/remux/mp4-remuxer.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return l}),R.d(X,"normalizePts",function(){return h});var Q=R("./src/polyfills/number.ts"),B=R("./src/remux/aac-helper.ts"),_=R("./src/remux/mp4-generator.ts"),G=R("./src/events.ts"),j=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),I=R("./src/types/loader.ts"),y=R("./src/utils/timescale-conversion.ts");function T(){return T=Object.assign||function(L){for(var x=1;x0?b:m.pts},c[0].pts);return u&&O.logger.debug("PTS rollover detected"),a},x.remux=function(c,u,a,b,m,C,P,H){var V,$,z,U,ee,oe,ce=m,ve=m,Me=c.pid>-1,xe=u.pid>-1,Ae=u.samples.length,Ee=c.samples.length>0,Ce=Ae>1,pe=(!Me||Ee)&&(!xe||Ce)||this.ISGenerated||P;if(pe){this.ISGenerated||(z=this.generateIS(c,u,m));var se=this.isVideoContiguous,De=-1;if(Ce&&(De=E(u.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if(oe=!0,De>0){O.logger.warn("[mp4-remuxer]: Dropped "+De+" out of "+Ae+" video samples due to a missing keyframe");var ze=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(De),u.dropped+=De,ve+=(u.samples[0].pts-ze)/(u.timescale||9e4)}else De===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ae+" video samples"),oe=!1);if(this.ISGenerated){if(Ee&&Ce){var We=this.getVideoStartPts(u.samples),Ke=h(c.samples[0].pts,We)-We,Ye=Ke/u.inputTimeScale;ce+=Math.max(0,Ye),ve+=Math.max(0,-Ye)}if(Ee){if(c.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),z=this.generateIS(c,u,m)),$=this.remuxAudio(c,ce,this.isAudioContiguous,C,xe||Ce||H===I.PlaylistLevelType.AUDIO?ve:void 0),Ce){var Se=$?$.endPTS-$.startPTS:0;u.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),z=this.generateIS(c,u,m)),V=this.remuxVideo(u,ve,se,Se)}}else Ce&&(V=this.remuxVideo(u,ve,se,0));V&&(V.firstKeyFrame=De,V.independent=De!==-1)}}return this.ISGenerated&&(a.samples.length&&(ee=this.remuxID3(a,m)),b.samples.length&&(U=this.remuxText(b,m))),{audio:$,video:V,initSegment:z,independent:oe,text:U,id3:ee}},x.generateIS=function(c,u,a){var b=c.samples,m=u.samples,C=this.typeSupported,P={},H=!Object(Q.isFiniteNumber)(this._initPTS),V="audio/mp4",$,z,U;if(H&&($=z=Infinity),c.config&&b.length&&(c.timescale=c.samplerate,c.isAAC||(C.mpeg?(V="audio/mpeg",c.codec=""):C.mp3&&(c.codec="mp3")),P.audio={id:"audio",container:V,codec:c.codec,initSegment:!c.isAAC&&C.mpeg?new Uint8Array(0):_.default.initSegment([c]),metadata:{channelCount:c.channelCount}},H&&(U=c.inputTimeScale,$=z=b[0].pts-Math.round(U*a))),u.sps&&u.pps&&m.length&&(u.timescale=u.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:_.default.initSegment([u]),metadata:{width:u.width,height:u.height}},H)){U=u.inputTimeScale;var ee=this.getVideoStartPts(m),oe=Math.round(U*a);z=Math.min(z,h(m[0].dts,ee)-oe),$=Math.min($,ee-oe)}if(Object.keys(P).length)return this.ISGenerated=!0,H&&(this._initPTS=$,this._initDTS=z),{tracks:P,initPTS:$,timescale:U}},x.remuxVideo=function(c,u,a,b){var m=c.inputTimeScale,C=c.samples,P=[],H=C.length,V=this._initPTS,$=this.nextAvcDts,z=8,U,ee,oe,ce=Number.POSITIVE_INFINITY,ve=Number.NEGATIVE_INFINITY,Me=0,xe=!1;if(!a||$===null){var Ae=u*m,Ee=C[0].pts-h(C[0].dts,C[0].pts);$=Ae-Ee}for(var Ce=0;Cepe.pts){var se=9e4*.2;Me=Math.max(Math.min(Me,pe.pts-pe.dts),-1*se)}pe.dts0?Ce-1:Ce].dts&&(xe=!0)}xe&&C.sort(function(Tt,St){var ht=Tt.dts-St.dts,Ut=Tt.pts-St.pts;return ht||Ut}),ee=C[0].dts,oe=C[C.length-1].dts;var De=Math.round((oe-ee)/(H-1));if(Me<0){if(MeDe,Oe=Ye<-1;if(Se||Oe){Se?O.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(Ye,!0)+" ms ("+Ye+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-Ye,!0)+" ms ("+Ye+"dts) overlapping between fragments detected"),ee=$;var Ue=C[0].pts-Ye;C[0].dts=ee,C[0].pts=Ue,O.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(Ue,!0)+"/"+Object(y.toMsFromMpegTsClock)(ee,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(Ye,!0)+" ms")}}o&&(ee=Math.max(0,ee));for(var Xe=0,Qe=0,je=0;je0?we-1:we].dts;if(re.stretchShortVideoTrack&&this.nextAudioPts!==null){var ue=Math.floor(re.maxBufferHole*m),me=(b?ce+b*m:this.nextAudioPts)-ut.pts;me>ue?(U=me-ne,U<0&&(U=ne),O.logger.log("[mp4-remuxer]: It is approximately "+me/90+" ms to the next segment; using duration "+U/90+" ms for the last video frame.")):U=ne}else U=ne}var Te=Math.round(ut.pts-ut.dts);P.push(new v(ut.key,U,Re,Te))}if(P.length&&A&&A<70){var _e=P[0].flags;_e.dependsOn=2,_e.isNonSync=0}console.assert(U!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=$=oe+U,this.isVideoContiguous=!0;var ot=_.default.moof(c.sequenceNumber++,ee,T({},c,{samples:P})),gt="video",pt={data1:ot,data2:rt,startPTS:ce/m,endPTS:(ve+U)/m,startDTS:ee/m,endDTS:$/m,type:gt,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(rt.length,"MDAT length must not be zero"),pt},x.remuxAudio=function(c,u,a,b,m){var C=c.inputTimeScale,P=c.samplerate?c.samplerate:C,H=C/P,V=c.isAAC?D:w,$=V*H,z=this._initPTS,U=!c.isAAC&&this.typeSupported.mpeg,ee=[],oe=c.samples,ce=U?0:8,ve=this.nextAudioPts||-1,Me=u*C;if(this.isAudioContiguous=a=a||oe.length&&ve>0&&(b&&Math.abs(Me-ve)<9e3||Math.abs(h(oe[0].pts-z,Me)-ve)<20*$),oe.forEach(function(fe){fe.pts=h(fe.pts-z,Me)}),!a||ve<0){if(oe=oe.filter(function(fe){return fe.pts>=0}),!oe.length)return;m===0?ve=0:b?ve=Math.max(0,Me):ve=oe[0].pts}if(c.isAAC)for(var xe=m!==void 0,Ae=this.config.maxAudioFramesDrift,Ee=0,Ce=ve;Ee=Ae*$&&ze0){Qe+=ce;try{Xe=new Uint8Array(Qe)}catch(fe){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:j.ErrorTypes.MUX_ERROR,details:j.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Qe,reason:"fail allocating audio mdat "+Qe});return}if(!U){var rt=new DataView(Xe.buffer);rt.setUint32(0,Qe),Xe.set(_.default.types.mdat,4)}}else return;Xe.set(qe,ce);var nt=qe.byteLength;ce+=nt,ee.push(new v(!0,V,nt,0)),Ue=tt}var we=ee.length;if(!we)return;var ut=ee[ee.length-1];this.nextAudioPts=ve=Ue+H*ut.duration;var at=U?new Uint8Array(0):_.default.moof(c.sequenceNumber++,Oe/H,T({},c,{samples:ee}));c.samples=[];var Re=Oe/C,He=ve/C,ge="audio",de={data1:at,data2:Xe,startPTS:Re,endPTS:He,startDTS:Re,endDTS:He,type:ge,hasAudio:!0,hasVideo:!1,nb:we};return this.isAudioContiguous=!0,console.assert(Xe.length,"MDAT length must not be zero"),de},x.remuxEmptyAudio=function(c,u,a,b){var m=c.inputTimeScale,C=c.samplerate?c.samplerate:m,P=m/C,H=this.nextAudioPts,V=(H!==null?H:b.startDTS*m)+this._initDTS,$=b.endDTS*m+this._initDTS,z=P*D,U=Math.ceil(($-V)/z),ee=B.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!ee){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var oe=[],ce=0;ce4294967296;)L+=p;return L}function E(L){for(var x=0;x0?this.lastEndDTS=c:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!L.audio,a=!!L.video,b="";u&&(b+="audio"),a&&(b+="video");var m={data1:v,startPTS:p,startDTS:p,endPTS:c,endDTS:c,type:b,hasAudio:u,hasVideo:a,nb:1,dropped:0};return E.audio=m.type==="audio"?m:void 0,E.video=m.type!=="audio"?m:void 0,E.text=d,E.id3=A,E.initSegment=g,E},y}(),O=function(T,k,D){return Object(B.getStartDTS)(T,k)-D};function I(y,T){var k=y==null?void 0:y.codec;return k&&k.length>4?k:k==="hvc1"?"hvc1.1.c.L120.90":k==="av01"?"av01.0.04M.08":k==="avc1"||T===_.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}X.default=j},"./src/task-loop.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"default",function(){return Q});var Q=function(){function B(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var _=B.prototype;return _.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},_.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},_.onHandlerDestroyed=function(){},_.hasInterval=function(){return!!this._tickInterval},_.hasNextTick=function(){return!!this._tickTimer},_.setInterval=function(j){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,j),!0)},_.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},_.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},_.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},_.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},_.doTick=function(){},B}()},"./src/types/cmcd.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"CMCDVersion",function(){return Q}),R.d(X,"CMCDObjectType",function(){return B}),R.d(X,"CMCDStreamingFormat",function(){return _}),R.d(X,"CMCDStreamType",function(){return G});var Q=1,B;(function(j){j.MANIFEST="m",j.AUDIO="a",j.VIDEO="v",j.MUXED="av",j.INIT="i",j.CAPTION="c",j.TIMED_TEXT="tt",j.KEY="k",j.OTHER="o"})(B||(B={}));var _;(function(j){j.DASH="d",j.HLS="h",j.SMOOTH="s",j.OTHER="o"})(_||(_={}));var G;(function(j){j.VOD="v",j.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"HlsSkip",function(){return _}),R.d(X,"getSkipValue",function(){return G}),R.d(X,"HlsUrlParameters",function(){return j}),R.d(X,"Level",function(){return O});function Q(I,y){for(var T=0;TNumber.MAX_SAFE_INTEGER?Infinity:y},j.hexadecimalInteger=function(I){if(this[I]){var y=(this[I]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var T=new Uint8Array(y.length/2),k=0;kNumber.MAX_SAFE_INTEGER?Infinity:y},j.decimalFloatingPoint=function(I){return parseFloat(this[I])},j.optionalFloat=function(I,y){var T=this[I];return T?parseFloat(T):y},j.enumeratedString=function(I){return this[I]},j.bool=function(I){return this[I]==="YES"},j.decimalResolution=function(I){var y=Q.exec(this[I]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},G.parseAttrList=function(I){var y,T={},k='"';for(B.lastIndex=0;(y=B.exec(I))!==null;){var D=y[2];D.indexOf(k)===0&&D.lastIndexOf(k)===D.length-1&&(D=D.slice(1,-1)),T[y[1]]=D}return T},G}()},"./src/utils/binary-search.ts":function(ie,X,R){"use strict";R.r(X);var Q={search:function(_,G){for(var j=0,O=_.length-1,I=null,y=null;j<=O;){I=(j+O)/2|0,y=_[I];var T=G(y);if(T>0)j=I+1;else if(T<0)O=I-1;else return y}return null}};X.default=Q},"./src/utils/buffer-helper.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"BufferHelper",function(){return _});var Q=R("./src/utils/logger.ts"),B={length:0,start:function(){return 0},end:function(){return 0}},_=function(){function G(){}return G.isBuffered=function(O,I){try{if(O){for(var y=G.getBuffered(O),T=0;T=y.start(T)&&I<=y.end(T))return!0}}catch(k){}return!1},G.bufferInfo=function(O,I,y){try{if(O){var T=G.getBuffered(O),k=[],D;for(D=0;Dw&&(T[D-1].end=O[k].end):T.push(O[k])}else T.push(O[k])}else T=O;for(var A=0,d,o=I,l=I,h=0;h=E&&I=a&&Q.logger.log(this.time+" ["+a+"] "+b)},p}(),A=function(c){for(var u=[],a=0;aj&&(this.logger.log(D.DEBUG,"Too large cursor position "+this.pos),this.pos=j)},c.moveCursor=function(a){var b=this.pos+a;if(a>1)for(var m=this.pos+1;m=144&&this.backSpace();var b=_(a);if(this.pos>=j){this.logger.log(D.ERROR,"Cannot insert "+a.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(b,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(a){var b;for(b=a;b0&&(a?m="["+b.join(" | ")+"]":m=b.join(` `)),m},c.getTextAndFormat=function(){return this.rows},p}(),E=function(){function p(u,a,b){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=u,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new h(b),this.nonDisplayedMemory=new h(b),this.lastOutputScreen=new h(b),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=b}var c=p.prototype;return c.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(a){this.outputFilter=a},c.setPAC=function(a){this.writeScreen.setPAC(a)},c.setBkgData=function(a){this.writeScreen.setBkgData(a)},c.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(D.INFO,"MODE="+a),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=a},c.insertChars=function(a){for(var b=0;b=46,b.italics)b.foreground="white";else{var m=Math.floor(a/2)-16,C=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=C[m]}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))},p}(),v=function(){function p(u,a,b){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var m=new w;this.channels=[null,new E(u,a,m),new E(u+1,b,m)],this.cmdHistory=x(),this.logger=m}var c=p.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 m,C,P,H=!1;this.logger.time=a;for(var V=0;V ("+A([C,P])+")"),m=this.parseCmd(C,P),m||(m=this.parseMidrow(C,P)),m||(m=this.parsePAC(C,P)),m||(m=this.parseBackgroundAttributes(C,P)),!m&&(H=this.parseChars(C,P),H)){var $=this.currentChannel;if($&&$>0){var z=this.channels[$];z.insertChars(H)}else this.logger.log(D.WARNING,"No channel found yet. TEXT-MODE?")}!m&&!H&&this.logger.log(D.WARNING,"Couldn't parse cleaned data "+A([C,P])+" orig: "+A([b[V],b[V+1]]))}},c.parseCmd=function(a,b){var m=this.cmdHistory,C=(a===20||a===28||a===21||a===29)&&b>=32&&b<=47,P=(a===23||a===31)&&b>=33&&b<=35;if(!(C||P))return!1;if(L(a,b,m))return g(null,null,m),this.logger.log(D.DEBUG,"Repeated command ("+A([a,b])+") is dropped"),!0;var H=a===20||a===21||a===23?1:2,V=this.channels[H];return a===20||a===21||a===28||a===29?b===32?V.ccRCL():b===33?V.ccBS():b===34?V.ccAOF():b===35?V.ccAON():b===36?V.ccDER():b===37?V.ccRU(2):b===38?V.ccRU(3):b===39?V.ccRU(4):b===40?V.ccFON():b===41?V.ccRDC():b===42?V.ccTR():b===43?V.ccRTD():b===44?V.ccEDM():b===45?V.ccCR():b===46?V.ccENM():b===47&&V.ccEOC():V.ccTO(b-32),g(a,b,m),this.currentChannel=H,!0},c.parseMidrow=function(a,b){var m=0;if((a===17||a===25)&&b>=32&&b<=47){if(a===17?m=1:m=2,m!==this.currentChannel)return this.logger.log(D.ERROR,"Mismatch channel in midrow parsing"),!1;var C=this.channels[m];return C?(C.ccMIDROW(b),this.logger.log(D.DEBUG,"MIDROW ("+A([a,b])+")"),!0):!1}return!1},c.parsePAC=function(a,b){var m,C=this.cmdHistory,P=(a>=17&&a<=23||a>=25&&a<=31)&&b>=64&&b<=127,H=(a===16||a===24)&&b>=64&&b<=95;if(!(P||H))return!1;if(L(a,b,C))return g(null,null,C),!0;var V=a<=23?1:2;b>=64&&b<=95?m=V===1?O[a]:y[a]:m=V===1?I[a]:T[a];var $=this.channels[V];return $?($.setPAC(this.interpretPAC(m,b)),g(a,b,C),this.currentChannel=V,!0):!1},c.interpretPAC=function(a,b){var m,C={color:null,italics:!1,indent:null,underline:!1,row:a};return b>95?m=b-96:m=b-64,C.underline=(m&1)===1,m<=13?C.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(m/2)]:m<=15?(C.italics=!0,C.color="white"):C.indent=Math.floor((m-16)/2)*4,C},c.parseChars=function(a,b){var m,C=null,P=null;if(a>=25?(m=2,P=a-8):(m=1,P=a),P>=17&&P<=19){var H;P===17?H=b+80:P===18?H=b+112:H=b+144,this.logger.log(D.INFO,"Special char '"+_(H)+"' in channel "+m),C=[H]}else a>=32&&a<=127&&(C=b===0?[a]:[a,b]);if(C){var V=A(C);this.logger.log(D.DEBUG,"Char codes = "+V.join(",")),g(a,b,this.cmdHistory)}return C},c.parseBackgroundAttributes=function(a,b){var m=(a===16||a===24)&&b>=32&&b<=47,C=(a===23||a===31)&&b>=45&&b<=47;if(!(m||C))return!1;var P,H={};a===16||a===24?(P=Math.floor((b-32)/2),H.background=k[P],b%2===1&&(H.background=H.background+"_semi")):b===45?H.background="transparent":(H.foreground="black",b===47&&(H.underline=!0));var V=a<=23?1:2,$=this.channels[V];return $.setBkgData(H),g(a,b,this.cmdHistory),!0},c.reset=function(){for(var a=0;a=16?o--:o++;var g=Object(Q.fixLineBreaks)(l.trim()),L=Object(B.generateCueId)(y,T,g);(!I||!I.cues||!I.cues.getCueById(L))&&(A=new h(y,T,g),A.id=L,A.line=E+1,A.align="left",A.position=10+Math.min(80,Math.floor(o*8/32)*10),D.push(A))}return I&&D.length&&(D.sort(function(x,p){return x.line==="auto"||p.line==="auto"?0:x.line>8&&p.line>8?p.line-x.line:x.line-p.line}),D.forEach(function(x){return Object(_.addCueToTrack)(I,x)})),D}};X.default=j},"./src/utils/discontinuities.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"findFirstFragWithCC",function(){return G}),R.d(X,"shouldAlignOnDiscontinuities",function(){return j}),R.d(X,"findDiscontinuousReferenceFrag",function(){return O}),R.d(X,"adjustSlidingStart",function(){return y}),R.d(X,"alignStream",function(){return T}),R.d(X,"alignPDT",function(){return D}),R.d(X,"alignFragmentByPDTDelta",function(){return w}),R.d(X,"alignMediaPlaylistByPDT",function(){return A});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/logger.ts"),_=R("./src/controller/level-helper.ts");function G(d,o){for(var l=null,h=0,E=d.length;hl.startCC||d&&d.cc=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},_}();X.default=B},"./src/utils/ewma.ts":function(ie,X,R){"use strict";R.r(X);var Q=function(){function B(G,j,O){j===void 0&&(j=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=j,this.totalWeight_=O}var _=B.prototype;return _.sample=function(j,O){var I=Math.pow(this.alpha_,j);this.estimate_=O*(1-I)+I*this.estimate_,this.totalWeight_+=j},_.getTotalWeight=function(){return this.totalWeight_},_.getEstimate=function(){if(this.alpha_){var j=1-Math.pow(this.alpha_,this.totalWeight_);if(j)return this.estimate_/j}return this.estimate_},B}();X.default=Q},"./src/utils/fetch-loader.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"fetchSupported",function(){return w});var Q=R("./src/polyfills/number.ts"),B=R("./src/loader/load-stats.ts"),_=R("./src/demux/chunk-cache.ts");function G(h,E){h.prototype=Object.create(E.prototype),h.prototype.constructor=h,T(h,E)}function j(h){var E=typeof Map=="function"?new Map:void 0;return j=function(g){if(g===null||!y(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof E!="undefined"){if(E.has(g))return E.get(g);E.set(g,L)}function L(){return O(g,arguments,k(this).constructor)}return L.prototype=Object.create(g.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),T(L,g)},j(h)}function O(h,E,v){return I()?O=Reflect.construct:O=function(L,x,p){var c=[null];c.push.apply(c,x);var u=Function.bind.apply(L,c),a=new u;return p&&T(a,p.prototype),a},O.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(h){return!1}}function y(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function T(h,E){return T=Object.setPrototypeOf||function(g,L){return g.__proto__=L,g},T(h,E)}function k(h){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},k(h)}function D(){return D=Object.assign||function(h){for(var E=1;E=p&&c(L,x,u.flush(),g)):c(L,x,P,g),m()}).catch(function(){return Promise.reject()})};return b()},h}();function d(h,E){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:E,headers:new self.Headers(D({},h.headers))};return h.rangeEnd&&v.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),v}function o(h,E){return new self.Request(h.url,E)}var l=function(h){G(E,h);function E(v,g,L){var x;return x=h.call(this,v)||this,x.code=void 0,x.details=void 0,x.code=g,x.details=L,x}return E}(j(Error));X.default=A},"./src/utils/imsc1-ttml-parser.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"IMSC1_CODEC",function(){return y}),R.d(X,"parseIMSC1",function(){return w});var Q=R("./src/utils/mp4-tools.ts"),B=R("./src/utils/vttparser.ts"),_=R("./src/utils/vttcue.ts"),G=R("./src/demux/id3.ts"),j=R("./src/utils/timescale-conversion.ts"),O=R("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(p){for(var c=1;c"):Q}function j(y){for(var T=arguments.length,k=new Array(T>1?T-1:0),D=1;D>24,E[v+1]=g>>16&255,E[v+2]=g>>8&255,E[v+3]=g&255}function T(E,v){var g=[];if(!v.length)return g;var L,x,p;"data"in E?(L=E.data,x=E.start,p=E.end):(L=E,x=0,p=L.byteLength);for(var c=x;c1?c+u:p;if(a===v[0])if(v.length===1)g.push({data:L,start:c+8,end:b});else{var m=T({data:L,start:c+8,end:b},v.slice(1));m.length&&G.apply(g,m)}c=b}return g}function k(E){var v=T(E,["moov"]),g=v[0],L=g?g.end:null,x=T(E,["sidx"]);if(!x||!x[0])return null;var p=[],c=x[0],u=c.data[0],a=u===0?8:16,b=I(c,a);a+=4;var m=0,C=0;u===0?a+=8:a+=16,a+=2;var P=c.end+C,H=O(c,a);a+=2;for(var V=0;V>>31;if(ee===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var oe=I(c,$);$+=4,p.push({referenceSize:U,subsegmentDuration:oe,info:{duration:oe/b,start:P,end:P+U-1}}),P+=U,$+=4,a=$}return{earliestPresentationTime:m,timescale:b,version:u,referencesCount:H,references:p,moovEndOffset:L}}function D(E){for(var v=[],g=T(E,["moov","trak"]),L=0;Lj)&&(this.startTime=j),this.endTime=O,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},_.reset=function(){this.cueRanges=[]},B}()},"./src/utils/texttrack-utils.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"sendAddTrackEvent",function(){return B}),R.d(X,"addCueToTrack",function(){return _}),R.d(X,"clearCurrentCues",function(){return G}),R.d(X,"removeCuesInRange",function(){return j}),R.d(X,"getCuesInRange",function(){return I});var Q=R("./src/utils/logger.ts");function B(y,T){var k;try{k=new Event("addtrack")}catch(D){k=document.createEvent("Event"),k.initEvent("addtrack",!1,!1)}k.track=y,T.dispatchEvent(k)}function _(y,T){var k=y.mode;if(k==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(T.id))try{if(y.addCue(T),!y.cues.getCueById(T.id))throw new Error("addCue is failed for: "+T)}catch(w){Q.logger.debug("[texttrack-utils]: "+w);var D=new self.TextTrackCue(T.startTime,T.endTime,T.text);D.id=T.id,y.addCue(D)}k==="disabled"&&(y.mode=k)}function G(y){var T=y.mode;if(T==="disabled"&&(y.mode="hidden"),y.cues)for(var k=y.cues.length;k--;)y.removeCue(y.cues[k]);T==="disabled"&&(y.mode=T)}function j(y,T,k){var D=y.mode;if(D==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var w=I(y.cues,T,k),A=0;Ay[k].endTime)return-1;for(var D=0,w=k;D<=w;){var A=Math.floor((w+D)/2);if(Ty[A].startTime&&D-1)for(var A=w,d=y.length;A=T&&o.endTime<=k)D.push(o);else if(o.startTime>k)return D}return D}},"./src/utils/time-ranges.ts":function(ie,X,R){"use strict";R.r(X);var Q={toString:function(_){for(var G="",j=_.length,O=0;O1?T-1:0),D=1;D100)throw new Error("Position must be between 0 and 100.");p=m,this.hasBeenReset=!0}})),Object.defineProperty(D,"positionAlign",O({},w,{get:function(){return c},set:function(m){var C=j(m);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");c=C,this.hasBeenReset=!0}})),Object.defineProperty(D,"size",O({},w,{get:function(){return u},set:function(m){if(m<0||m>100)throw new Error("Size must be between 0 and 100.");u=m,this.hasBeenReset=!0}})),Object.defineProperty(D,"align",O({},w,{get:function(){return a},set:function(m){var C=j(m);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");a=C,this.hasBeenReset=!0}})),D.displayState=void 0}return I.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"parseTimeStamp",function(){return _}),R.d(X,"fixLineBreaks",function(){return T}),R.d(X,"VTTParser",function(){return k});var Q=R("./src/utils/vttcue.ts"),B=function(){function D(){}var w=D.prototype;return w.decode=function(d,o){if(!d)return"";if(typeof d!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))},D}();function _(D){function w(d,o,l,h){return(d|0)*3600+(o|0)*60+(l|0)+parseFloat(h||0)}var A=D.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return A?parseFloat(A[2])>59?w(A[2],A[3],0,A[4]):w(A[1],A[2],A[3],A[4]):null}var G=function(){function D(){this.values=Object.create(null)}var w=D.prototype;return w.set=function(d,o){!this.get(d)&&o!==""&&(this.values[d]=o)},w.get=function(d,o,l){return l?this.has(d)?this.values[d]:o[l]:this.has(d)?this.values[d]:o},w.has=function(d){return d in this.values},w.alt=function(d,o,l){for(var h=0;h=0&&l<=100)return this.set(d,l),!0}return!1},D}();function j(D,w,A,d){var o=d?D.split(d):[D];for(var l in o){if(typeof o[l]!="string")continue;var h=o[l].split(A);if(h.length!==2)continue;var E=h[0],v=h[1];w(E,v)}}var O=new Q.default(0,0,""),I=O.align==="middle"?"middle":"center";function y(D,w,A){var d=D;function o(){var E=_(D);if(E===null)throw new Error("Malformed timestamp: "+d);return D=D.replace(/^[^\sa-zA-Z-]+/,""),E}function l(E,v){var g=new G;j(E,function(p,c){var u;switch(p){case"region":for(var a=A.length-1;a>=0;a--)if(A[a].id===c){g.set(p,A[a].region);break}break;case"vertical":g.alt(p,c,["rl","lr"]);break;case"line":u=c.split(","),g.integer(p,u[0]),g.percent(p,u[0])&&g.set("snapToLines",!1),g.alt(p,u[0],["auto"]),u.length===2&&g.alt("lineAlign",u[1],["start",I,"end"]);break;case"position":u=c.split(","),g.percent(p,u[0]),u.length===2&&g.alt("positionAlign",u[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":g.percent(p,c);break;case"align":g.alt(p,c,["start",I,"end","left","right"]);break}},/:/,/\s/),v.region=g.get("region",null),v.vertical=g.get("vertical","");var L=g.get("line","auto");L==="auto"&&O.line===-1&&(L=-1),v.line=L,v.lineAlign=g.get("lineAlign","start"),v.snapToLines=g.get("snapToLines",!0),v.size=g.get("size",100),v.align=g.get("align",I);var x=g.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 h(){D=D.replace(/^\s+/,"")}if(h(),w.startTime=o(),h(),D.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+d);D=D.substr(3),h(),w.endTime=o(),h(),l(D,w)}function T(D){return D.replace(//gi,` `)}var k=function(){function D(){this.state="INITIAL",this.buffer="",this.decoder=new B,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var w=D.prototype;return w.parse=function(d){var o=this;d&&(o.buffer+=o.decoder.decode(d,{stream:!0}));function l(){var x=o.buffer,p=0;for(x=T(x);p")===-1){o.cue.id=E;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{y(E,o.cue,o.regionList)}catch(x){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var L=E.indexOf("-->")!==-1;if(!E||L&&(g=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=` `),o.cue.text+=E}continue;case"BADCUE":E||(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},w.flush=function(){var d=this;try{if((d.cue||d.state==="HEADER")&&(d.buffer+=` `,d.parse()),d.state==="INITIAL"||d.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){d.onparsingerror&&d.onparsingerror(o)}return d.onflush&&d.onflush(),this},D}()},"./src/utils/webvtt-parser.ts":function(ie,X,R){"use strict";R.r(X),R.d(X,"generateCueId",function(){return k}),R.d(X,"parseWebVTT",function(){return w});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/vttparser.ts"),_=R("./src/demux/id3.ts"),G=R("./src/utils/timescale-conversion.ts"),j=R("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,I=function(d,o,l){return l===void 0&&(l=0),d.substr(l,o.length)===o},y=function(d){var o=parseInt(d.substr(-3)),l=parseInt(d.substr(-6,2)),h=parseInt(d.substr(-9,2)),E=d.length>9?parseInt(d.substr(0,d.indexOf(":"))):0;if(!Object(Q.isFiniteNumber)(o)||!Object(Q.isFiniteNumber)(l)||!Object(Q.isFiniteNumber)(h)||!Object(Q.isFiniteNumber)(E))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return o+=1e3*l,o+=60*1e3*h,o+=60*60*1e3*E,o},T=function(d){for(var o=5381,l=d.length;l;)o=o*33^d.charCodeAt(--l);return(o>>>0).toString()};function k(A,d,o){return T(A.toString())+T(d.toString())+T(o)}var D=function(d,o,l){var h=d[o],E=d[h.prevCC];if(!E||!E.new&&h.new){d.ccOffset=d.presentationOffset=h.start,h.new=!1;return}for(;(v=E)!==null&&v!==void 0&&v.new;){var v;d.ccOffset+=h.start-E.start,h.new=!1,h=E,E=d[h.prevCC]}d.presentationOffset=l};function w(A,d,o,l,h,E,v,g){var L=new B.VTTParser,x=Object(_.utf8ArrayToStr)(new Uint8Array(A)).trim().replace(O,` `).split(` `),p=[],c=Object(G.toMpegTsClockFromTimescale)(d,o),u="00:00.000",a=0,b=0,m,C=!0,P=!1;L.oncue=function(H){var V=l[h],$=l.ccOffset,z=(a-c)/9e4;if(V!=null&&V.new&&(b!==void 0?$=l.ccOffset=V.start:D(l,h,z)),z&&($=z-l.presentationOffset),P){var U=H.endTime-H.startTime,ee=Object(j.normalizePts)((H.startTime+$-b)*9e4,E*9e4)/9e4;H.startTime=ee,H.endTime=ee+U}var oe=H.text.trim();H.text=decodeURIComponent(encodeURIComponent(oe)),H.id||(H.id=k(H.startTime,H.endTime,oe)),H.endTime>0&&p.push(H)},L.onparsingerror=function(H){m=H},L.onflush=function(){if(m){g(m);return}v(p)},x.forEach(function(H){if(C)if(I(H,"X-TIMESTAMP-MAP=")){C=!1,P=!0,H.substr(16).split(",").forEach(function(V){I(V,"LOCAL:")?u=V.substr(6):I(V,"MPEGTS:")&&(a=parseInt(V.substr(7)))});try{b=y(u)/1e3}catch(V){P=!1,m=V}return}else H===""&&(C=!1);L.parse(H+` `)}),L.flush()}},"./src/utils/xhr-loader.ts":function(ie,X,R){"use strict";R.r(X);var Q=R("./src/utils/logger.ts"),B=R("./src/loader/load-stats.ts"),_=/^age:\s*[\d.]+\s*$/m,G=function(){function j(I){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=I?I.xhrSetup:null,this.stats=new B.LoadStats,this.retryDelay=0}var O=j.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},O.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(y,T,k){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=T,this.callbacks=k,this.retryDelay=T.retryDelay,this.loadInternal()},O.loadInternal=function(){var y=this.config,T=this.context;if(!y)return;var k=this.loader=new self.XMLHttpRequest,D=this.stats;D.loading.first=0,D.loaded=0;var w=this.xhrSetup;try{if(w)try{w(k,T.url)}catch(o){k.open("GET",T.url,!0),w(k,T.url)}k.readyState||k.open("GET",T.url,!0);var A=this.context.headers;if(A)for(var d in A)k.setRequestHeader(d,A[d])}catch(o){this.callbacks.onError({code:k.status,text:o.message},T,k);return}T.rangeEnd&&k.setRequestHeader("Range","bytes="+T.rangeStart+"-"+(T.rangeEnd-1)),k.onreadystatechange=this.readystatechange.bind(this),k.onprogress=this.loadprogress.bind(this),k.responseType=T.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),k.send()},O.readystatechange=function(){var y=this.context,T=this.loader,k=this.stats;if(!y||!T)return;var D=T.readyState,w=this.config;if(k.aborted)return;if(D>=2)if(self.clearTimeout(this.requestTimeout),k.loading.first===0&&(k.loading.first=Math.max(self.performance.now(),k.loading.start)),D===4){T.onreadystatechange=null,T.onprogress=null;var A=T.status;if(A>=200&&A<300){k.loading.end=Math.max(self.performance.now(),k.loading.first);var d,o;if(y.responseType==="arraybuffer"?(d=T.response,o=d.byteLength):(d=T.responseText,o=d.length),k.loaded=k.total=o,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(k,y,d,T),!this.callbacks)return;var h={url:T.responseURL,data:d};this.callbacks.onSuccess(h,k,y,T)}else k.retry>=w.maxRetry||A>=400&&A<499?(Q.logger.error(A+" while loading "+y.url),this.callbacks.onError({code:A,text:T.statusText},y,T)):(Q.logger.warn(A+" while loading "+y.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,w.maxRetryDelay),k.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),w.timeout)},O.loadtimeout=function(){Q.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(y){var T=this.stats;T.loaded=y.loaded,y.lengthComputable&&(T.total=y.total)},O.getCacheAge=function(){var y=null;if(this.loader&&_.test(this.loader.getAllResponseHeaders())){var T=this.loader.getResponseHeader("age");y=T?parseFloat(T):null}return y},j}();X.default=G}}).default})},vHTk:function(Ie,Le,Z){Ie.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yslc:function(Ie,Le){Ie.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD4nC4RfIhPsDIaCGBAndEHsujwQMkdBHDGoMmBAvNAtPvZlAMmUAX4GQSEMeCf0wrxgmCu+ASF3K4QnBrOVM+Cd0Cnoorw4mIw/guD6Vs4Ba74CGPBe6IInJicDZn4PgDYK4IpBbMUM+CZ0Qey5t4M3bwUhoa2YB4dNT1CHIzkoEkZzDYrrLtvkCeU0aBsULTw7WntRbtARoQrGbWHtBVw/Vpaggq9t1Rh9F7qwOM0ZA45fDgJp7PmJ0i4hCegU3AabjAc9qmF24r14JeXP+MZ4GEN+/69NmVvD0rGn8zThWYghF7XE7JFN+0wL0x5BQfVZLL60D1XE5JUNfxTqEZqC/C7Zgumeh96EvvqMP6ppNpvSCTM/ZxbAz222lousqGtIAnZkPIMETThmndmM1y/scGvB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