You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Problemset__NewItem__ind...

377 lines
1.1 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[187,5,6,7,8,16],{"+NIl":function(ct,Te,W){(function(ue){ue(W("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(V,P){"use strict";function $(p,f){p.cmdState.push(f)}function N(p){return p.cmdState.length>0?p.cmdState[p.cmdState.length-1]:null}function L(p){var f=p.cmdState.pop();f&&f.closeBracket()}function K(p){for(var f=p.cmdState,g=f.length-1;g>=0;g--){var a=f[g];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function F(p,f,g){return function(){this.name=p,this.bracketNo=0,this.style=f,this.styles=g,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var R={};R.importmodule=F("importmodule","tag",["string","builtin"]),R.documentclass=F("documentclass","tag",["","atom"]),R.usepackage=F("usepackage","tag",["atom"]),R.begin=F("begin","tag",["atom"]),R.end=F("end","tag",["atom"]),R.label=F("label","tag",["atom"]),R.ref=F("ref","tag",["atom"]),R.eqref=F("eqref","tag",["atom"]),R.cite=F("cite","tag",["atom"]),R.bibitem=F("bibitem","tag",["atom"]),R.Bibitem=F("Bibitem","tag",["atom"]),R.RBibitem=F("RBibitem","tag",["atom"]),R.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function A(p,f){p.f=f}function h(p,f){var g;if(p.match(/^\\[a-zA-Z@]+/)){var a=p.current().slice(1);return g=R.hasOwnProperty(a)?R[a]:R.DEFAULT,g=new g,$(f,g),A(f,w),g.style}if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/\\]/))return"tag";if(p.match("\\["))return A(f,function(o,l){return y(o,l,"\\]")}),"keyword";if(p.match("\\("))return A(f,function(o,l){return y(o,l,"\\)")}),"keyword";if(p.match("$$"))return A(f,function(o,l){return y(o,l,"$$")}),"keyword";if(p.match("$"))return A(f,function(o,l){return y(o,l,"$")}),"keyword";var r=p.next();if(r=="%")return p.skipToEnd(),"comment";if(r=="}"||r=="]"){if(g=N(f),g)g.closeBracket(r),A(f,w);else return"error";return"bracket"}else return r=="{"||r=="["?(g=R.DEFAULT,g=new g,$(f,g),"bracket"):/\d/.test(r)?(p.eatWhile(/[\w.%]/),"atom"):(p.eatWhile(/[\w\-_]/),g=K(f),g.name=="begin"&&(g.argument=p.current()),g.styleIdentifier())}function y(p,f,g){if(p.eatSpace())return null;if(g&&p.match(g))return A(f,h),"keyword";if(p.match(/^\\[a-zA-Z@]+/))return"tag";if(p.match(/^[a-zA-Z]+/))return"variable-2";if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/]/))return"tag";if(p.match(/^[\^_&]/))return"tag";if(p.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(p.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=p.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(p.skipToEnd(),"comment"):"error"}function w(p,f){var g=p.peek(),a;return g=="{"||g=="["?(a=N(f),a.openBracket(g),p.eat(g),A(f,h),"bracket"):/[ \t\r]/.test(g)?(p.eat(g),null):(A(f,h),L(f),h(p,f))}return{startState:function(){var p=P.inMathMode?function(f,g){return y(f,g)}:h;return{cmdState:[],f:p}},copyState:function(p){return{cmdState:p.cmdState.slice(),f:p.f}},token:function(p,f){return f.f(p,f)},blankLine:function(p){p.f=h,p.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"+ua5":function(ct,Te,W){},"/cxE":function(ct,Te,W){"use strict";W.d(Te,"e",function(){return P}),W.d(Te,"f",function(){return $}),W.d(Te,"g",function(){return N}),W.d(Te,"d",function(){return K}),W.d(Te,"a",function(){return F}),W.d(Te,"b",function(){return R}),W.d(Te,"c",function(){return A});var ue=function(){function h(){this.listeners=[],this.unexpectedErrorHandler=function(y){setTimeout(function(){throw y.stack?new Error(y.message+`
`+y.stack):y},0)}}return h.prototype.emit=function(y){this.listeners.forEach(function(w){w(y)})},h.prototype.onUnexpectedError=function(y){this.unexpectedErrorHandler(y),this.emit(y)},h.prototype.onUnexpectedExternalError=function(y){this.unexpectedErrorHandler(y)},h}(),V=new ue;function P(h){K(h)||V.onUnexpectedError(h);return}function $(h){K(h)||V.onUnexpectedExternalError(h);return}function N(h){if(h instanceof Error){var y=h.name,w=h.message,p=h.stacktrace||h.stack;return{$isError:!0,name:y,message:w,stack:p}}return h}var L="Canceled";function K(h){return h instanceof Error&&h.name===L&&h.message===L}function F(){var h=new Error(L);return h.name=h.message,h}function R(h){return h?new Error("Illegal argument: "+h):new Error("Illegal argument")}function A(h){return h?new Error("Illegal state: "+h):new Error("Illegal state")}},"0dNJ":function(ct,Te,W){"use strict";W.r(Te);var ue=W("g9YV"),V=W("wCAj"),P=W("+L6B"),$=W("2/Rp"),N=W("BoS7"),L=W("Sdc0"),K=W("6UJt"),F=W("DFOY"),R=W("7Kak"),A=W("9yH6"),h=W("sPJy"),y=W("bE4q"),w=W("2qtc"),p=W("kLXV"),f=W("9og8"),g=W("oBTY"),a=W("k1fw"),r=W("miYZ"),o=W("tsqr"),l=W("y8nQ"),C=W("Vl3Y"),b=W("tJVT"),x=W("PpiC"),D=W("OaEy"),T=W("2fM7"),m=W("DZo9"),v=W("8z0m"),u=W("WmNS"),s=W.n(u),S=W("q1tI"),c=W.n(S),O=W("9kvl"),M=W("m3rI"),B=W("yFVG"),j=W.n(B),H=W("5Dmo"),I=W("3S7+"),U=W("Ot1p"),J=W("9Bee"),ne=W("EgHG"),he=W.n(ne),Ee=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ae=function(ge,ae){var re=ge.problemset,be=ge.globalSetting,Ce=ge.loading,Ie=ge.dispatch,De=ge.onRef,Ge=De===void 0?function(){}:De,Qe=ge.isEdit,dt=Object(x.a)(ge,["problemset","globalSetting","loading","dispatch","onRef","isEdit"]),rt=Object(S.useState)([]),ht=Object(b.a)(rt,2),ft=ht[0],at=ht[1],Dt=Object(S.useState)(),Lt=Object(b.a)(Dt,2),Tt=Lt[0],Rt=Lt[1],wt=Object(S.useState)(),Ut=Object(b.a)(wt,2),Nt=Ut[0],qe=Ut[1],Ze=Object(S.useState)(""),ze=Object(b.a)(Ze,2),Ye=ze[0],ot=ze[1],gt=Object(S.useState)(""),Mt=Object(b.a)(gt,2),Et=Mt[0],lt=Mt[1];Object(S.useEffect)(function(){at(["","","",""])},[]),Object(S.useEffect)(function(){var $t,vt,zt,Qt;if(!re.editData||!Qe)return;ot(($t=re.editData)===null||$t===void 0?void 0:$t.name),lt((vt=re.editData)===null||vt===void 0?void 0:vt.analysis),at((zt=re.editData)===null||zt===void 0?void 0:zt.choices.map(function(or){return or.choice_text})),qe((Qt=re.editData)===null||Qt===void 0?void 0:Qt.choices.findIndex(function(or){return or.is_answer}))},[re.editData]),Object(S.useImperativeHandle)(ae,function(){return{onSave:Jt,Clear:vr}});var Jt=function(){if(!Ye)return o.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var vt=ft.findIndex(function(Qt){return!Qt});if(vt>-1)return o.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ee[vt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log("activeAnswer: ",Nt),!(typeof Nt=="number"))return o.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;var zt=ft.map(function(Qt,or){return{choice_text:Qt,is_answer:Nt===or?1:0}});return{name:Ye,choices:zt,analysis:Et}},vr=function(){at(["","","",""]),ot(""),lt(""),qe("")};return c.a.createElement("section",{className:he.a.wrap},c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),c.a.createElement(U.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ye,onChange:function(vt){return ot(vt)}}),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",c.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ft.map(function($t,vt){return c.a.createElement("div",{className:he.a.choiceWrap,key:vt},c.a.createElement(I.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},c.a.createElement("div",{className:"".concat(he.a.answer," ").concat(Nt===vt?he.a.activeAnswer:""),onClick:function(){return qe(vt)}},Ee[vt])),c.a.createElement("div",{className:he.a.editorWrap},Tt===vt?c.a.createElement(U.a,{id:"single-question-option-".concat(vt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:$t,onChange:function(Qt){ft[vt]=Qt,at(ft)}}):c.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return Rt(vt)}},c.a.createElement(J.a,{value:$t}))),vt>1&&c.a.createElement(I.a,{title:"\u5220\u9664"},c.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return at(ft.filter(function(Qt,or){return or!==vt}))}})),vt<7&&vt===ft.length-1&&c.a.createElement(I.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},c.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return at([].concat(Object(g.a)(ft),[""]))}})))}),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),c.a.createElement(U.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Et,onChange:function(vt){return lt(vt)}}))},Oe=Object(O.a)(function(ye){var ge=ye.problemset,ae=ye.loading,re=ye.globalSetting;return{problemset:ge,globalSetting:re,loading:ae.effects}},null,null,{forwardRef:!0})(Object(S.forwardRef)(Ae)),me=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],de=function(ge,ae){var re=ge.problemset,be=ge.globalSetting,Ce=ge.loading,Ie=ge.dispatch,De=ge.onRef,Ge=De===void 0?function(){}:De,Qe=ge.isEdit,dt=Object(x.a)(ge,["problemset","globalSetting","loading","dispatch","onRef","isEdit"]),rt=Object(S.useState)([]),ht=Object(b.a)(rt,2),ft=ht[0],at=ht[1],Dt=Object(S.useState)(),Lt=Object(b.a)(Dt,2),Tt=Lt[0],Rt=Lt[1],wt=Object(S.useState)([]),Ut=Object(b.a)(wt,2),Nt=Ut[0],qe=Ut[1],Ze=Object(S.useState)(""),ze=Object(b.a)(Ze,2),Ye=ze[0],ot=ze[1],gt=Object(S.useState)(""),Mt=Object(b.a)(gt,2),Et=Mt[0],lt=Mt[1];Object(S.useEffect)(function(){at(["","","",""])},[]),Object(S.useEffect)(function(){var $t,vt,zt,Qt;if(!re.editData||!Qe)return;ot(($t=re.editData)===null||$t===void 0?void 0:$t.name),lt((vt=re.editData)===null||vt===void 0?void 0:vt.analysis),at((zt=re.editData)===null||zt===void 0?void 0:zt.choices.map(function(Xe){return Xe.choice_text}));var or=[];(Qt=re.editData)===null||Qt===void 0||Qt.choices.map(function(Xe,xt){Xe.is_answer&&or.push(xt)}),qe(or)},[re.editData]),Object(S.useImperativeHandle)(ae,function(){return{onSave:Jt,Clear:vr}});var Jt=function(){if(!Ye)return o.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var vt=ft.findIndex(function(Qt){return!Qt});if(vt>-1)return o.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(me[vt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!Nt.length)return o.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(Nt.length<2)return o.b.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;var zt=ft.map(function(Qt,or){return{choice_text:Qt,is_answer:Nt.includes(or)?1:0}});return{name:Ye,choices:zt,analysis:Et}},vr=function(){at(["","","",""]),ot(""),lt(""),qe("")};return c.a.createElement("section",{className:he.a.wrap},c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),c.a.createElement(U.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ye,onChange:function(vt){return ot(vt)}}),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",c.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ft.map(function($t,vt){return c.a.createElement("div",{className:he.a.choiceWrap,key:vt},c.a.createElement(I.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},c.a.createElement("div",{className:"".concat(he.a.answer," ").concat(Nt.includes(vt)?he.a.activeAnswer:""),onClick:function(){Nt.includes(vt)?qe(Nt.filter(function(Qt){return Qt!==vt})):qe([].concat(Object(g.a)(Nt),[vt]))}},me[vt])),c.a.createElement("div",{className:he.a.editorWrap},Tt===vt?c.a.createElement(U.a,{id:"single-question-option-".concat(vt),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:$t,onChange:function(Qt){ft[vt]=Qt,at(ft)}}):c.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return Rt(vt)}},c.a.createElement(J.a,{value:$t}))),vt>1&&c.a.createElement(I.a,{title:"\u5220\u9664"},c.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return at(ft.filter(function(Qt,or){return or!==vt}))}})),vt<7&&vt===ft.length-1&&c.a.createElement(I.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},c.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return at([].concat(Object(g.a)(ft),[""]))}})))}),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),c.a.createElement(U.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Et,onChange:function(vt){return lt(vt)}}))},pe=Object(O.a)(function(ye){var ge=ye.problemset,ae=ye.loading,re=ye.globalSetting;return{problemset:ge,globalSetting:re,loading:ae.effects}},null,null,{forwardRef:!0})(Object(S.forwardRef)(de)),se=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ce=function(ge,ae){var re=ge.problemset,be=ge.globalSetting,Ce=ge.loading,Ie=ge.dispatch,De=ge.onRef,Ge=De===void 0?function(){}:De,Qe=ge.isEdit,dt=Object(x.a)(ge,["problemset","globalSetting","loading","dispatch","onRef","isEdit"]),rt=Object(S.useState)(),ht=Object(b.a)(rt,2),ft=ht[0],at=ht[1],Dt=Object(S.useState)(""),Lt=Object(b.a)(Dt,2),Tt=Lt[0],Rt=Lt[1],wt=Object(S.useState)(""),Ut=Object(b.a)(wt,2),Nt=Ut[0],qe=Ut[1];Object(S.useEffect)(function(){var Ye,ot,gt;if(!re.editData||!Qe)return;Rt((Ye=re.editData)===null||Ye===void 0?void 0:Ye.name),qe((ot=re.editData)===null||ot===void 0?void 0:ot.analysis);var Mt=(gt=re.editData)===null||gt===void 0?void 0:gt.choices.find(function(Et){return Et.is_answer});at(Mt.choice_text==="\u6B63\u786E"?"0":"1")},[re.editData]),Object(S.useImperativeHandle)(ae,function(){return{onSave:Ze,Clear:ze}});var Ze=function(){if(!Tt)return o.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!ft)return o.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var ot=[{choice_text:"\u6B63\u786E",is_answer:ft==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:ft==="1"?1:0}];return{name:Tt,choices:ot,analysis:Nt}},ze=function(){Rt(""),qe(""),at("")};return c.a.createElement("section",{className:he.a.wrap},c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),c.a.createElement(U.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Tt,onChange:function(ot){return Rt(ot)}}),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",c.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),c.a.createElement(A.a.Group,{buttonStyle:"solid",value:ft,onChange:function(ot){return at(ot.target.value)}},c.a.createElement(A.a.Button,{value:"0",className:"".concat(he.a.radio," mr40")},"\u6B63\u786E"),c.a.createElement(A.a.Button,{value:"1",className:he.a.radio},"\u9519\u8BEF")),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),c.a.createElement(U.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Nt,onChange:function(ot){return qe(ot)}}))},Z=Object(O.a)(function(ye){var ge=ye.problemset,ae=ye.loading,re=ye.globalSetting;return{problemset:ge,globalSetting:re,loading:ae.effects}},null,null,{forwardRef:!0})(Object(S.forwardRef)(ce)),te=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],le=function(ge,ae){var re=ge.problemset,be=ge.globalSetting,Ce=ge.loading,Ie=ge.dispatch,De=ge.onRef,Ge=De===void 0?function(){}:De,Qe=ge.isEdit,dt=Object(x.a)(ge,["problemset","globalSetting","loading","dispatch","onRef","isEdit"]),rt=Object(S.useState)(""),ht=Object(b.a)(rt,2),ft=ht[0],at=ht[1],Dt=Object(S.useState)(""),Lt=Object(b.a)(Dt,2),Tt=Lt[0],Rt=Lt[1],wt=Object(S.useState)(""),Ut=Object(b.a)(wt,2),Nt=Ut[0],qe=Ut[1];Object(S.useEffect)(function(){var Ye,ot,gt,Mt;if(!re.editData||!Qe)return;at((Ye=re.editData)===null||Ye===void 0?void 0:Ye.name),Rt((ot=re.editData)===null||ot===void 0?void 0:ot.analysis),qe((gt=re.editData)===null||gt===void 0||((Mt=gt.answer_texts)===null||Mt===void 0)?void 0:Mt[0])},[re.editData]),Object(S.useImperativeHandle)(ae,function(){return{onSave:Ze,Clear:ze}});var Ze=function(){return ft?{name:ft,answer_texts:[Nt],analysis:Tt}:(o.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},ze=function(){at(""),Rt(""),qe("")};return c.a.createElement("section",{className:he.a.wrap},c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),c.a.createElement(U.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ft,onChange:function(ot){return at(ot)}}),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),c.a.createElement(U.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Nt,onChange:function(ot){return qe(ot)}}),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),c.a.createElement(U.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Tt,onChange:function(ot){return Rt(ot)}}))},ve=Object(O.a)(function(ye){var ge=ye.problemset,ae=ye.loading,re=ye.globalSetting;return{problemset:ge,globalSetting:re,loading:ae.effects}},null,null,{forwardRef:!0})(Object(S.forwardRef)(le)),ie=W("sRBo"),oe=W("kaz8"),xe=W("kqOp"),_e=W("7qnI"),Me=W("1vsH"),Ue=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],He=function(ge,ae){var re=ge.problemset,be=ge.globalSetting,Ce=ge.loading,Ie=ge.dispatch,De=ge.isEdit,Ge=Object(x.a)(ge,["problemset","globalSetting","loading","dispatch","isEdit"]),Qe=Object(S.useState)(""),dt=Object(b.a)(Qe,2),rt=dt[0],ht=dt[1],ft=Object(S.useState)(""),at=Object(b.a)(ft,2),Dt=at[0],Lt=at[1],Tt=Object(S.useState)([]),Rt=Object(b.a)(Tt,2),wt=Rt[0],Ut=Rt[1],Nt=Object(S.useState)(""),qe=Object(b.a)(Nt,2),Ze=qe[0],ze=qe[1],Ye=Object(S.useState)(!0),ot=Object(b.a)(Ye,2),gt=ot[0],Mt=ot[1],Et=Object(S.useState)(!1),lt=Object(b.a)(Et,2),Jt=lt[0],vr=lt[1];Object(S.useEffect)(function(){var Pt,At,Ft;if(!re.editData||!De)return;ht((Pt=re.editData)===null||Pt===void 0?void 0:Pt.name),Lt((At=re.editData)===null||At===void 0?void 0:At.analysis),Mt((Ft=re.editData)===null||Ft===void 0?void 0:Ft.is_ordered),vr(!0)},[re.editData]),Object(S.useEffect)(function(){var Pt;if(!Jt)return;var At=(Pt=re.editData)===null||Pt===void 0?void 0:Pt.standard_answer.map(function(Ft){return Ft.answer_text});Ut(At),vr(!1)},[Jt]),Object(S.useImperativeHandle)(ae,function(){return{onSave:$t,Clear:vt}});var $t=function(){var At=[],Ft=!1;return wt.forEach(function(Yt,G){At.push({position:G+1,answer_text:[]}),Yt.forEach(function(E,_){At[G].answer_text.push(E),(!E||!Object(Me.Z)(E,1e4))&&(ze("".concat(G,"-").concat(_)),o.b.info(E?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Ft=!0)})}),Ft?!1:(At==null?void 0:At.length)>20?(o.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:rt,analysis:Dt,standard_answers:At,is_ordered:gt}},vt=function(){ht(""),Lt(""),Ut([]),Mt(!1)},zt=function(At,Ft,Yt){var G=wt.slice();if(Ft&&G.splice(At,Ft),Yt)for(var E=0;E<Yt;E++)G.splice(At+E,0,[""]);Ut(G)},Qt=function(At,Ft,Yt){ze("");var G=wt.slice();G[At][Ft]=Yt,Ut(G)},or=function(At){var Ft=wt.slice();Ft[At]=[].concat(Object(g.a)(Ft[At]),[""]),Ut(Ft)},Xe=function(At,Ft){var Yt=wt.slice();if(!Yt[At][Ft]){Yt[At]=Yt[At].filter(function(G,E){return E!==Ft}),Ut(Yt);return}p.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){Yt[At]=Yt[At].filter(function(E,_){return _!==Ft}),Ut(Yt)}})},xt=function(At){p.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){var Yt=wt.slice();Yt=wt.filter(function(G,E){return At!==E}),Ut(Yt)}})};return c.a.createElement("section",{className:he.a.wrap},c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),c.a.createElement("div",null,c.a.createElement(xe.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:rt,onChange:function(At){return ht(At)},showNullButton:!0,onPlaceholderChange:zt})),c.a.createElement("div",{className:"mt20"},wt.map(function(Pt,At){return c.a.createElement(_e.a,{key:At,answers:Pt,index:At,is_md:!0,activeOptionErrorIndex:Ze,onAnswerChange:Qt,addChildAnswer:or,deleteChildAnswer:Xe,deleteChildAnswermain:xt})})),c.a.createElement("div",{className:"mt20"},wt.length>1&&c.a.createElement("span",null,c.a.createElement(oe.a,{checked:gt,onChange:function(At){return Mt(At.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),c.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),c.a.createElement(U.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Dt,onChange:function(At){return Lt(At)}}))},Be=Object(O.a)(function(ye){var ge=ye.problemset,ae=ye.loading,re=ye.globalSetting;return{problemset:ge,globalSetting:re,loading:ae.effects}},null,null,{forwardRef:!0})(Object(S.forwardRef)(He)),tt=W("LvDl"),Je=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],st=function(ge,ae){var re=ge.problemset,be=ge.globalSetting,Ce=ge.loading,Ie=ge.dispatch,De=ge.onRef,Ge=De===void 0?function(){}:De,Qe=ge.isEdit,dt=Object(x.a)(ge,["problemset","globalSetting","loading","dispatch","onRef","isEdit"]),rt=Object(S.useState)(""),ht=Object(b.a)(rt,2),ft=ht[0],at=ht[1],Dt=Object(S.useState)([]),Lt=Object(b.a)(Dt,2),Tt=Lt[0],Rt=Lt[1];Object(S.useEffect)(function(){var Ze,ze,Ye;if(!re.editData||!Qe)return;at((Ze=re.editData)===null||Ze===void 0?void 0:Ze.name);var ot=re==null||((ze=re.editData)===null||ze===void 0||((Ye=ze.sub_item_banks)===null||Ye===void 0))?void 0:Ye.map(function(gt){var Mt,Et,lt;return Object(a.a)(Object(a.a)({},gt),{},{id:gt.id,open:!1,qusList:gt==null||((Mt=gt.choices)===null||Mt===void 0)?void 0:Mt.map(function(Jt){return Jt.choice_text}),activeQusEditor:null,qusAnswer:(Et=[gt==null||((lt=gt.choices)===null||lt===void 0)?void 0:lt.findIndex(function(Jt){return Jt.is_answer})])===null||Et===void 0?void 0:Et.filter(function(Jt){return Jt!==-1})})});Rt(ot)},[re.editData]),Object(S.useImperativeHandle)(ae,function(){return{onSave:wt,Clear:Ut}});var wt=function(){if(!ft)return o.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(Tt.length===0)return o.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var ze=0;ze<Tt.length;ze++){var Ye,ot=Tt[ze];if(!(ot!=null&&ot.name))return o.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(ze+1,"\u5C0F\u9898\u9898\u5E72")),!1;var gt=ot==null||((Ye=ot.qusList)===null||Ye===void 0)?void 0:Ye.findIndex(function(Et){return!Et});if(gt>-1)return o.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(ze+1,"\u5C0F\u9898").concat(Je[gt],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!(ot!=null&&ot.qusAnswer.length))return o.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(ze+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),!1}var Mt=Tt.map(function(Et){return{id:Et.id>1?Et.id:null,name:Et.name,item_type:Et.item_type,analysis:Et.analysis,choices:Et.qusList.map(function(lt,Jt){return{choice_text:lt,is_answer:Et.qusAnswer[0]===Jt?1:0}})}});return{name:ft,sub_item_banks:Mt}},Ut=function(){at(""),Rt([])},Nt=function(){var ze={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};Rt(Tt.concat(ze))},qe=function(ze,Ye,ot){var gt=Object(tt.cloneDeep)(Tt);if(ze==="open"&&(gt[Ye].open=!gt[Ye].open),ze==="delete"&&gt.splice(Ye,1),ze==="value"&&(gt[Ye].name=ot),ze==="answer"&&(gt[Ye].qusAnswer=[ot]),ze==="edit"&&(gt[Ye].activeQusEditor=ot),ze==="details"&&(gt[Ye].qusList[gt[Ye].activeQusEditor]=ot),ze==="addQus"&&(gt[Ye].qusList=gt[Ye].qusList.concat("")),ze==="deleteQus"){var Mt;gt[Ye].qusList=gt[Ye].qusList.filter(function(Et,lt){return lt!==ot}),gt[Ye].qusAnswer=(Mt=gt[Ye].qusAnswer)===null||Mt===void 0?void 0:Mt.filter(function(Et){return Et!==ot})}ze==="analysis"&&(gt[Ye].analysis=ot),Rt(gt)};return c.a.createElement("section",{className:he.a.wrap},c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),c.a.createElement(U.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ft,onChange:function(ze){return at(ze)}}),Tt==null?void 0:Tt.map(function(Ze,ze){var Ye;return c.a.createElement("div",{className:he.a.fold,key:Ze.id},c.a.createElement("div",{onClick:function(){return qe("open",ze)},className:he.a.head},c.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Ze.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),c.a.createElement("span",null,"\u7B2C",ze+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),c.a.createElement("b",{onClick:function(gt){gt.stopPropagation(),qe("delete",ze)},className:"iconfont icon-shanchu8"})),c.a.createElement("div",{className:"mb10",style:{display:Ze.open?"block":"none"}},c.a.createElement(U.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ze==null?void 0:Ze.name,onChange:function(gt){return qe("value",ze,gt)}}),c.a.createElement("p",{className:he.a.titleWrap},c.a.createElement("span",{className:he.a.required},"*"),c.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",c.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Ze==null||((Ye=Ze.qusList)===null||Ye===void 0)?void 0:Ye.map(function(ot,gt){var Mt,Et;return c.a.createElement("div",{className:he.a.choiceWrap,key:gt},c.a.createElement(I.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},c.a.createElement("div",{className:"".concat(he.a.answer," ").concat(Ze!=null&&(Mt=Ze.qusAnswer)!==null&&Mt!==void 0&&Mt.includes(gt)?he.a.activeAnswer:""),onClick:function(){return qe("answer",ze,gt)}},Je[gt])),c.a.createElement("div",{className:he.a.editorWrap},(Ze==null?void 0:Ze.activeQusEditor)===gt?c.a.createElement(U.a,{id:"single-question-option-".concat(gt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:ot,onChange:function(Jt){return qe("details",ze,Jt)}}):c.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return qe("edit",ze,gt)}},c.a.createElement(J.a,{value:ot}))),gt>1&&c.a.createElement(I.a,{title:"\u5220\u9664"},c.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return qe("deleteQus",ze,gt)}})),gt<7&&gt===(Ze==null||((Et=Ze.qusList)===null||Et===void 0)?void 0:Et.length)-1&&c.a.createElement(I.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},c.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return qe("addQus",ze)}})))}),c.a.createElement("p",{className:"mb10 mt10"},c.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),c.a.createElement(U.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ze.analysis,onChange:function(gt){return qe("analysis",ze,gt)}})))}),Tt.length<20&&c.a.createElement($.a,{type:"primary",onClick:Nt},c.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898"))},nt=Object(O.a)(function(ye){var ge=ye.problemset,ae=ye.loading,re=ye.globalSetting;return{problemset:ge,globalSetting:re,loading:ae.effects}},null,null,{forwardRef:!0})(Object(S.forwardRef)(st)),pt=W("ErOA"),mt=W("u2Z1"),ke=W("xvlK"),Le=W("P/tu"),We=W("WCUW"),Ve=v.a.Dragger,Ne=T.a.Option,Ke=function(ge){var ae,re,be,Ce=ge.problemset,Ie=ge.globalSetting,De=ge.loading,Ge=ge.dispatch,Qe=Object(x.a)(ge,["problemset","globalSetting","loading","dispatch"]),dt=C.a.useForm(),rt=Object(b.a)(dt,1),ht=rt[0],ft=Object(S.useState)({}),at=Object(b.a)(ft,2),Dt=at[0],Lt=at[1],Tt=Object(S.useState)(),Rt=Object(b.a)(Tt,2),wt=Rt[0],Ut=Rt[1],Nt=Object(S.useState)(!1),qe=Object(b.a)(Nt,2),Ze=qe[0],ze=qe[1],Ye=Object(S.useState)([]),ot=Object(b.a)(Ye,2),gt=ot[0],Mt=ot[1],Et=Object(S.useRef)(),lt=Object(S.useRef)(),Jt=Object(S.useState)([]),vr=Object(b.a)(Jt,2),$t=vr[0],vt=vr[1],zt=Object(S.useState)(1),Qt=Object(b.a)(zt,2),or=Qt[0],Xe=Qt[1],xt=Object(S.useState)([]),Pt=Object(b.a)(xt,2),At=Pt[0],Ft=Pt[1],Yt=Object(S.useState)(),G=Object(b.a)(Yt,2),E=G[0],_=G[1],z=Object(S.useState)(!1),Q=Object(b.a)(z,2),Y=Q[0],Re=Q[1],et=Object(S.useState)(),yt=Object(b.a)(et,2),_t=yt[0],it=yt[1];Object(S.useEffect)(function(){return Ge({type:"globalSetting/footerToggle",payload:!1}),function(){Ge({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(S.useEffect)(function(){if(Ce!=null&&Ce.editData){var Zt;it(!(Ce!=null&&(Zt=Ce.editData)!==null&&Zt!==void 0&&Zt.repeat_answer))}},[Ce==null?void 0:Ce.editData]);var Kt={onRemove:function(){Ft([])},beforeUpload:function(Vt){if(console.log(Vt),(Vt==null?void 0:Vt.size)>1024*1024*50)return o.b.info("\u6587\u4EF6\u8D85\u8FC750M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;var Xt=[];return Xt.push(Vt),Ft([].concat(Xt)),!1},fileList:At,accept:".xls,.xlsx"};Object(S.useEffect)(function(){return window.addEventListener("beforeunload",Bt),function(){window.removeEventListener("beforeunload",Bt)}},[]),Object(S.useEffect)(function(){var Zt,Vt,Xt=(Zt=Qe.location.query)===null||Zt===void 0?void 0:Zt.pages;Ut(Xt);var er=(Vt=Qe.match.params)===null||Vt===void 0?void 0:Vt.id;ze(!!er),Et.current=er},[]),Object(S.useEffect)(function(){Ge({type:"problemset/getEditDisciplines",payload:{source:"question"}}),Et.current&&Ge({type:"problemset/getEditData",payload:{id:Et.current}})},[]),Object(S.useEffect)(function(){var Zt;ht.setFieldsValue({itemType:"SINGLE"}),ht.setFieldsValue({difficulty:1});var Vt=((Zt=Qe.location.query)===null||Zt===void 0?void 0:Zt.group_id)||0;if(ht.setFieldsValue({item_banks_group_id:[Number(Vt)]}),!Ce.editData||!Et.current)return;var Xt=(Ce==null?void 0:Ce.editData)||{},er=Xt.discipline,ur=Xt.sub_discipline,sr=Xt.tag_disciplines,Tr=Xt.item_type,Lr=Xt.difficulty,wr=Xt.item_banks_group_id;ht.setFieldsValue({course:[er==null?void 0:er.id,ur==null?void 0:ur.id]}),ht.setFieldsValue({itemType:Tr}),ht.setFieldsValue({difficulty:Lr}),ht.setFieldsValue({item_banks_group_id:wr}),ht.setFieldsValue({knowledge:sr==null?void 0:sr.map(function(Mr){return Mr.id})}),Lt({course:[er==null?void 0:er.id,ur==null?void 0:ur.id],itemType:Tr,difficulty:Lr,item_banks_group_id:wr,knowledge:sr==null?void 0:sr.map(function(Mr){return Mr.id})}),gr(er==null?void 0:er.id,ur==null?void 0:ur.id)},[Ce.editData,Ce.disciplinesData]);var Bt=function(Vt){Vt.preventDefault(),Vt.returnValue=""},gr=function(Vt,Xt){var er,ur,sr,Tr,Lr,wr=(er=Ce.disciplinesData)===null||er===void 0||((ur=er.disciplines)===null||ur===void 0||((sr=ur.find(function(Mr){return Mr.id===Vt}))===null||sr===void 0||((Tr=sr.sub_disciplines)===null||Tr===void 0||((Lr=Tr.find(function(Mr){return Mr.id===Xt}))===null||Lr===void 0))))?void 0:Lr.tag_disciplines;Ur(Xt)},Kr=function(Vt){if(Vt!=null&&Vt.course){var Xt,er,ur,sr,Tr=Object(b.a)(Vt.course,2),Lr=Tr[0],wr=Tr[1],Mr=(Xt=Ce.disciplinesData.disciplines)===null||Xt===void 0||((er=Xt.find(function(Zr){return Zr.id===Lr}))===null||er===void 0||((ur=er.sub_disciplines)===null||ur===void 0||((sr=ur.find(function(Zr){return Zr.id===wr}))===null||sr===void 0)))?void 0:sr.tag_disciplines;Ur(wr),ht.setFieldsValue({knowledge:[]}),Lt(Object(a.a)(Object(a.a)({},ht.getFieldsValue()),{},{knowledge:[]}))}else Lt(Object(a.a)({},ht.getFieldsValue()))},Yr=function(Vt){Mt([].concat(Object(g.a)(gt),[Object(a.a)({},Vt)]))},Er=function(){var Zt=Object(f.a)(s.a.mark(function Vt(){var Xt,er,ur,sr,Tr,Lr,wr,Mr,Zr,sn,dr,qt,Ar,rr,Cr,nr,Dr,_r,Fr;return s.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:if(Xt=Dt||{},er=Xt.course,ur=Xt.itemType,sr=Xt.difficulty,Tr=Xt.item_banks_group_id,Lr=Xt.knowledge,wr=Lr===void 0?[]:Lr,Mr=Object(b.a)(er,2),Zr=Mr[0],sn=Mr[1],!(or===1)){yr.next=24;break}if(!(ur==="PROGRAM")){yr.next=7;break}return qt=wr==null?void 0:wr.join(","),Object(Me.O)("/problems/new?difficult=".concat(sr,"&sub_discipline_id=").concat(sn,"&newoj=1&pages=").concat(wt,"&tagIds=").concat(qt,"&banksIds=").concat(Tr!=null&&Tr[0]?Tr==null?void 0:Tr[0]:0)),yr.abrupt("return");case 7:if(Ar=(dr=lt.current)===null||dr===void 0?void 0:dr.onSave(),Ar){yr.next=10;break}return yr.abrupt("return");case 10:if(rr=Object(a.a)({discipline_id:Zr,sub_discipline_id:sn,item_banks_group_ids:Tr,tag_discipline_ids:wr,item_type:ur,difficulty:sr},Ar||{}),console.log(rr,"postData"),!Ze){yr.next=18;break}return yr.next=15,Ge({type:"problemset/editProblemset",payload:Object(a.a)(Object(a.a)({},rr),{},{repeat_answer:!_t,id:Et.current})});case 15:Cr=yr.sent,yr.next=21;break;case 18:return yr.next=20,Ge({type:"problemset/addProblemset",payload:rr});case 20:Cr=yr.sent;case 21:Cr.status===0&&(Ze?O.d.replace("/problemset?group_id=".concat(Tr)):(Qe.location.query.activeTabsKey&&Qe.location.query.activeTabsKey==="3"&&Object(We.j)({ids:[Cr.id],clazz:"ItemBank",group_ids:Qe.location.query.item_banks_group_id.split(",").map(function(rn){return Number(rn)})}),p.a.confirm({title:null,icon:null,content:"\u521B\u5EFA\u6210\u529F",okText:"\u7EE7\u7EED\u65B0\u589E",cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:function(){var Tn;(Tn=lt.current)===null||Tn===void 0||Tn.Clear()},onCancel:function(){O.d.replace("/problemset?group_id=".concat(Tr))}}))),yr.next=44;break;case 24:if(!((At==null?void 0:At.length)<=0)){yr.next=27;break}return o.b.info("\u8BF7\u4E0A\u4F20\u8BD5\u9898\u6587\u4EF6"),yr.abrupt("return");case 27:return Re(!0),nr=new FormData,nr.append("file",At[0]),nr.append("sub_discipline_id",sn),yr.next=33,Object(pt.a)("/api/item_banks/file_import.json",{method:"post",body:nr},!0);case 33:if(Dr=yr.sent,Re(!1),!((Dr==null?void 0:Dr.status)===0)){yr.next=44;break}if(!((Dr==null||((_r=Dr.fail)===null||_r===void 0)?void 0:_r.length)>0)){yr.next=40;break}return _(Dr==null?void 0:Dr.fail),o.b.error("\u4E0A\u4F20\u5931\u8D25\u9898\u6570\u4E3A"+(Dr==null||((Fr=Dr.fail)===null||Fr===void 0)?void 0:Fr.length)+"\uFF0C\u53EF\u5728\u5E95\u90E8\u8BD5\u9898\u5217\u8868\u67E5\u770B\u9519\u8BEF\u539F\u56E0\u3002"),yr.abrupt("return");case 40:ht.setFieldsValue({course:[]}),Ft([]),_([]),o.b.info("\u4E0A\u4F20\u6210\u529F");case 44:case"end":return yr.stop()}},Vt)}));return function(){return Zt.apply(this,arguments)}}();Object(S.useEffect)(function(){function Zt(){return Vt.apply(this,arguments)}function Vt(){return Vt=Object(f.a)(s.a.mark(function Xt(){var er;return s.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return sr.next=2,Object(pt.c)("item_banks_groups/mine.json");case 2:er=sr.sent,vt(er);case 4:case"end":return sr.stop()}},Xt)})),Vt.apply(this,arguments)}Zt()},[]);var tn=function(){var Vt=Dt||{itemType:"SINGLE"},Xt=Vt.itemType,er={SINGLE:c.a.createElement(Oe,{ref:lt,isEdit:Ze}),MULTIPLE:c.a.createElement(pe,{ref:lt,isEdit:Ze}),JUDGMENT:c.a.createElement(Z,{ref:lt,isEdit:Ze}),COMPLETION:c.a.createElement(Be,{ref:lt,isEdit:Ze}),SUBJECTIVE:c.a.createElement(ve,{ref:lt,isEdit:Ze}),COMBINATION:c.a.createElement(nt,{ref:lt,isEdit:Ze})};return er[Xt||"SINGLE"]},Cn=function(Vt){var Xt=Object(b.a)(Vt,2),er=Xt[0],ur=Xt[1]},Ur=function(){var Zt=Object(f.a)(s.a.mark(function Vt(Xt){var er;return s.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return sr.next=2,Ge({type:"exercise/getTagDiscipline",payload:{sub_discipline_id:Xt}});case 2:er=sr.sent,Mt(er.tag_disciplines);case 4:case"end":return sr.stop()}},Vt)}));return function(Xt){return Zt.apply(this,arguments)}}(),Qr=[{title:"\u9898\u76EE\u540D\u79F0",dataIndex:"name",key:"name"},{title:"\u9519\u8BEF\u539F\u56E0",dataIndex:"message",key:"message"}];return c.a.createElement("section",{className:j.a.bg},c.a.createElement(y.a,{className:"mb20 mt30",separator:">"},c.a.createElement(y.a.Item,{href:"/problemset"},"\u8BD5\u9898\u5E93"),c.a.createElement(y.a.Item,null,Ze?"\u7F16\u8F91":"\u65B0\u589E","\u8BD5\u9898")),c.a.createElement("div",{className:j.a.main},c.a.createElement("span",{style:{fontSize:"18px"}},"\u6DFB\u52A0\u7C7B\u578B"),c.a.createElement("br",null),c.a.createElement(A.a.Group,{style:{marginTop:"5px"},onChange:function(Vt){Xe(Vt.target.value),ht.setFieldsValue({course:[]}),Ft([]),_([])},value:or},c.a.createElement(A.a,{value:1},"\u5355\u4E2A\u6DFB\u52A0"),c.a.createElement(A.a,{value:2},"\u6279\u91CF\u5BFC\u5165")),or===1&&c.a.createElement(C.a,{form:ht,style:{marginTop:"10px"},className:j.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:Kr,onFinish:Er},c.a.createElement(C.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"course",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},c.a.createElement(F.a,{placeholder:"\u8BF7\u9009\u62E9...",allowClear:!1,options:Ce.courseOptions,onChange:Cn})),c.a.createElement(C.a.Item,{label:c.a.createElement("span",null,"\u77E5\u8BC6\u70B9\uFF1A",c.a.createElement("span",{className:"c-grey-999"},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),name:"knowledge"},c.a.createElement(mt.a,{selectvalues:Dt==null?void 0:Dt.knowledge,subId:(ae=Dt.course)===null||ae===void 0?void 0:ae[1],knowledgeOptions:gt,onAddKnowledgeFinish:Yr})),c.a.createElement(C.a.Item,{label:"\u52A0\u5165\u6587\u4EF6\u5939\u76EE\u5F55",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6587\u4EF6\u5939"}],initialValue:[0],name:"item_banks_group_id",labelCol:{span:24},wrapperCol:{span:24}},c.a.createElement(Le.a,null)),c.a.createElement(C.a.Item,{label:"\u9898\u578B\uFF1A",name:"itemType",wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u9898\u578B"}]},c.a.createElement(T.a,{placeholder:"\u8BF7\u9009\u62E9...",disabled:Ze},c.a.createElement(Ne,{value:"PROGRAM"},"\u7F16\u7A0B\u9898"),c.a.createElement(Ne,{value:"SINGLE"},"\u5355\u9009\u9898"),c.a.createElement(Ne,{value:"MULTIPLE"},"\u591A\u9009\u9898"),c.a.createElement(Ne,{value:"JUDGMENT"},"\u5224\u65AD\u9898"),c.a.createElement(Ne,{value:"COMPLETION"},"\u586B\u7A7A\u9898"),c.a.createElement(Ne,{value:"SUBJECTIVE"},"\u7B80\u7B54\u9898"),c.a.createElement(Ne,{value:"COMBINATION"},"\u7EC4\u5408\u9898"))),c.a.createElement(C.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},c.a.createElement(A.a.Group,null,c.a.createElement(A.a.Button,{value:1},"\u7B80\u5355"),c.a.createElement(A.a.Button,{value:2},"\u9002\u4E2D"),c.a.createElement(A.a.Button,{value:3},"\u56F0\u96BE"))),Ze&&(Ce==null||((re=Ce.editData)===null||re===void 0)?void 0:re.item_type)!="PROGRAM"&&(Ce==null||((be=Ce.editData)===null||be===void 0)?void 0:be.item_type)!="COMBINATION"&&c.a.createElement("div",null,c.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),c.a.createElement(L.a,{checked:_t,onChange:function(Vt){it(Vt)}}))),or===2&&c.a.createElement("div",null,c.a.createElement(C.a,{form:ht,style:{marginTop:"20px"},className:j.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:Kr,onFinish:Er},c.a.createElement(C.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"course",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},c.a.createElement(F.a,{placeholder:"\u8BF7\u9009\u62E9...",allowClear:!1,options:Ce.courseOptions,onChange:Cn})),c.a.createElement("span",null,"\u4E0B\u8F7DExcel\u683C\u5F0F ",c.a.createElement("a",{onClick:Object(f.a)(s.a.mark(function Zt(){return s.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:Object(Me.t)("",Object(Me.U)({url:M.a.API_SERVER+"/api/item_banks/down_template",query:{}}));case 1:case"end":return Xt.stop()}},Zt)}))},"\u8BD5\u9898\u6A21\u677F"),", \u6BCF\u6B21\u6700\u591A\u5BFC\u5165300\u9898\u3002"),c.a.createElement("br",null),c.a.createElement(v.a,Kt,c.a.createElement($.a,{className:j.a.upload,style:{marginTop:"20px"},type:"primary",icon:c.a.createElement(ke.a,null)},"\u9009\u62E9\u6587\u4EF6"))),c.a.createElement("br",null),(E==null?void 0:E.length)>0&&c.a.createElement("span",{style:{fontSize:"18px",display:"flex",width:"100%",justifyContent:"center"}},"\u9519\u8BEF\u5217\u8868"),(E==null?void 0:E.length)>0&&c.a.createElement(V.a,{style:{marginTop:"10px"},dataSource:E,columns:Qr}))),or===1&&c.a.createElement("div",{className:j.a.topicWrap},tn()),c.a.createElement("div",{className:j.a.buttonFixed},c.a.createElement("div",{className:j.a.buttonWrap},c.a.createElement($.a,{size:"large",className:"".concat(j.a.button," mr20"),onClick:function(){return O.d.push("/problemset")}},"\u53D6\u6D88"),c.a.createElement($.a,{size:"large",type:"primary",className:"".concat(j.a.button," mr20"),onClick:function(){return ht.submit()},loading:De["problemset/editProblemset"]||De["problemset/addProblemset"]||Y},Dt.itemType==="PROGRAM"?"\u521B\u5EFA":"\u4FDD\u5B58"))))},we=Te.default=Object(O.a)(function(ye){var ge=ye.problemset,ae=ye.loading,re=ye.globalSetting;return{problemset:ge,globalSetting:re,loading:ae.effects}})(Ke)},"19Vz":function(ct,Te,W){(function(ue){ue(W("VrN/"))})(function(ue){ue.defineOption("placeholder","",function(F,R,A){var h=A&&A!=ue.Init;if(R&&!h)F.on("blur",N),F.on("change",L),F.on("swapDoc",L),ue.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){$(F)}),L(F);else if(!R&&h){F.off("blur",N),F.off("change",L),F.off("swapDoc",L),ue.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),V(F);var y=F.getWrapperElement();y.className=y.className.replace(" CodeMirror-empty","")}R&&!F.hasFocus()&&N(F)});function V(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function P(F){V(F);var R=F.state.placeholder=document.createElement("pre");R.style.cssText="height: 0; overflow: visible",R.style.direction=F.getOption("direction"),R.className="CodeMirror-placeholder CodeMirror-line-like";var A=F.getOption("placeholder");typeof A=="string"&&(A=document.createTextNode(A)),R.appendChild(A),F.display.lineSpace.insertBefore(R,F.display.lineSpace.firstChild)}function $(F){setTimeout(function(){var R=!1,A=F.getInputField();A.nodeName=="TEXTAREA"?R=!A.value:F.lineCount()==1&&(R=!/[^\u200b]/.test(A.querySelector(".CodeMirror-line").textContent)),R?P(F):V(F)},20)}function N(F){K(F)&&P(F)}function L(F){var R=F.getWrapperElement(),A=K(F);R.className=R.className.replace(" CodeMirror-empty","")+(A?" CodeMirror-empty":""),A?P(F):V(F)}function K(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(ct,Te,W){(function(ue){ue(W("VrN/"))})(function(ue){"use strict";var V={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ue.defineMode("xml",function($,N){var L=$.indentUnit,K={},F=N.htmlMode?V:P;for(var R in F)K[R]=F[R];for(var R in N)K[R]=N[R];var A,h;function y(s,S){function c(B){return S.tokenize=B,B(s,S)}var O=s.next();if(O=="<")return s.eat("!")?s.eat("[")?s.match("CDATA[")?c(f("atom","]]>")):null:s.match("--")?c(f("comment","-->")):s.match("DOCTYPE",!0,!0)?(s.eatWhile(/[\w\._\-]/),c(g(1))):null:s.eat("?")?(s.eatWhile(/[\w\._\-]/),S.tokenize=f("meta","?>"),"meta"):(A=s.eat("/")?"closeTag":"openTag",S.tokenize=w,"tag bracket");if(O=="&"){var M;return s.eat("#")?s.eat("x")?M=s.eatWhile(/[a-fA-F\d]/)&&s.eat(";"):M=s.eatWhile(/[\d]/)&&s.eat(";"):M=s.eatWhile(/[\w\.\-:]/)&&s.eat(";"),M?"atom":"error"}else return s.eatWhile(/[^&<]/),null}y.isInText=!0;function w(s,S){var c=s.next();if(c==">"||c=="/"&&s.eat(">"))return S.tokenize=y,A=c==">"?"endTag":"selfcloseTag","tag bracket";if(c=="=")return A="equals",null;if(c=="<"){S.tokenize=y,S.state=l,S.tagName=S.tagStart=null;var O=S.tokenize(s,S);return O?O+" tag error":"tag error"}else return/[\'\"]/.test(c)?(S.tokenize=p(c),S.stringStartCol=s.column(),S.tokenize(s,S)):(s.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(s){var S=function(c,O){for(;!c.eol();)if(c.next()==s){O.tokenize=w;break}return"string"};return S.isInAttribute=!0,S}function f(s,S){return function(c,O){for(;!c.eol();){if(c.match(S)){O.tokenize=y;break}c.next()}return s}}function g(s){return function(S,c){for(var O;(O=S.next())!=null;){if(O=="<")return c.tokenize=g(s+1),c.tokenize(S,c);if(O==">")if(s==1){c.tokenize=y;break}else return c.tokenize=g(s-1),c.tokenize(S,c)}return"meta"}}function a(s,S,c){this.prev=s.context,this.tagName=S,this.indent=s.indented,this.startOfLine=c,(K.doNotIndent.hasOwnProperty(S)||s.context&&s.context.noIndent)&&(this.noIndent=!0)}function r(s){s.context&&(s.context=s.context.prev)}function o(s,S){for(var c;;){if(!s.context)return;if(c=s.context.tagName,!K.contextGrabbers.hasOwnProperty(c)||!K.contextGrabbers[c].hasOwnProperty(S))return;r(s)}}function l(s,S,c){return s=="openTag"?(c.tagStart=S.column(),C):s=="closeTag"?b:l}function C(s,S,c){return s=="word"?(c.tagName=S.current(),h="tag",T):K.allowMissingTagName&&s=="endTag"?(h="tag bracket",T(s,S,c)):(h="error",C)}function b(s,S,c){if(s=="word"){var O=S.current();return c.context&&c.context.tagName!=O&&K.implicitlyClosed.hasOwnProperty(c.context.tagName)&&r(c),c.context&&c.context.tagName==O||K.matchClosing===!1?(h="tag",x):(h="tag error",D)}else return K.allowMissingTagName&&s=="endTag"?(h="tag bracket",x(s,S,c)):(h="error",D)}function x(s,S,c){return s!="endTag"?(h="error",x):(r(c),l)}function D(s,S,c){return h="error",x(s,S,c)}function T(s,S,c){if(s=="word")return h="attribute",m;if(s=="endTag"||s=="selfcloseTag"){var O=c.tagName,M=c.tagStart;return c.tagName=c.tagStart=null,s=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(O)?o(c,O):(o(c,O),c.context=new a(c,O,M==c.indented)),l}return h="error",T}function m(s,S,c){return s=="equals"?v:(K.allowMissing||(h="error"),T(s,S,c))}function v(s,S,c){return s=="string"?u:s=="word"&&K.allowUnquoted?(h="string",T):(h="error",T(s,S,c))}function u(s,S,c){return s=="string"?u:T(s,S,c)}return{startState:function(s){var S={tokenize:y,state:l,indented:s||0,tagName:null,tagStart:null,context:null};return s!=null&&(S.baseIndent=s),S},token:function(s,S){if(!S.tagName&&s.sol()&&(S.indented=s.indentation()),s.eatSpace())return null;A=null;var c=S.tokenize(s,S);return(c||A)&&c!="comment"&&(h=null,S.state=S.state(A||c,s,S),h&&(c=h=="error"?c+" error":h)),c},indent:function(s,S,c){var O=s.context;if(s.tokenize.isInAttribute)return s.tagStart==s.indented?s.stringStartCol+1:s.indented+L;if(O&&O.noIndent)return ue.Pass;if(s.tokenize!=w&&s.tokenize!=y)return c?c.match(/^(\s*)/)[0].length:0;if(s.tagName)return K.multilineTagIndentPastTag!==!1?s.tagStart+s.tagName.length+2:s.tagStart+L*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(S))return 0;var M=S&&/^<(\/)?([\w_:\.-]*)/.exec(S);if(M&&M[1])for(;O;)if(O.tagName==M[2]){O=O.prev;break}else if(K.implicitlyClosed.hasOwnProperty(O.tagName))O=O.prev;else break;else if(M)for(;O;){var B=K.contextGrabbers[O.tagName];if(B&&B.hasOwnProperty(M[2]))O=O.prev;else break}for(;O&&O.prev&&!O.startOfLine;)O=O.prev;return O?O.indent+L:s.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(s){s.state==v&&(s.state=T)},xmlCurrentTag:function(s){return s.tagName?{name:s.tagName,close:s.type=="closeTag"}:null},xmlCurrentContext:function(s){for(var S=[],c=s.context;c;c=c.prev)c.tagName&&S.push(c.tagName);return S.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(ct,Te,W){"use strict";W.d(Te,"a",function(){return P});var ue=W("JYp7"),V=function(){function $(N){this.element=N,this.next=$.Undefined,this.prev=$.Undefined}return $.Undefined=new $(void 0),$}(),P=function(){function $(){this._first=V.Undefined,this._last=V.Undefined,this._size=0}return Object.defineProperty($.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),$.prototype.isEmpty=function(){return this._first===V.Undefined},$.prototype.clear=function(){this._first=V.Undefined,this._last=V.Undefined,this._size=0},$.prototype.unshift=function(N){return this._insert(N,!1)},$.prototype.push=function(N){return this._insert(N,!0)},$.prototype._insert=function(N,L){var K=this,F=new V(N);if(this._first===V.Undefined)this._first=F,this._last=F;else if(L){var R=this._last;this._last=F,F.prev=R,R.next=F}else{var A=this._first;this._first=F,F.next=A,A.prev=F}this._size+=1;var h=!1;return function(){h||(h=!0,K._remove(F))}},$.prototype.shift=function(){if(this._first===V.Undefined)return;var N=this._first.element;return this._remove(this._first),N},$.prototype.pop=function(){if(this._last===V.Undefined)return;var N=this._last.element;return this._remove(this._last),N},$.prototype._remove=function(N){if(N.prev!==V.Undefined&&N.next!==V.Undefined){var L=N.prev;L.next=N.next,N.next.prev=L}else N.prev===V.Undefined&&N.next===V.Undefined?(this._first=V.Undefined,this._last=V.Undefined):N.next===V.Undefined?(this._last=this._last.prev,this._last.next=V.Undefined):N.prev===V.Undefined&&(this._first=this._first.next,this._first.prev=V.Undefined);this._size-=1},$.prototype.iterator=function(){var N,L=this._first;return{next:function(){return L===V.Undefined?ue.c:(N?N.value=L.element:N={done:!1,value:L.element},L=L.next,N)}}},$.prototype.toArray=function(){for(var N=[],L=this._first;L!==V.Undefined;L=L.next)N.push(L.element);return N},$}()},"6+eU":function(ct,Te,W){"use strict";W.d(Te,"a",function(){return x});var ue=W("wx14"),V=W("rePB"),P=W("VTBJ"),$=W("1OyB"),N=W("vuIU"),L=W("Ji7U"),K=W("LK+K"),F=W("q1tI"),R=W.n(F),A=W("TSYQ"),h=W.n(A),y=function(T){var m,v="".concat(T.rootPrefixCls,"-item"),u=h()(v,"".concat(v,"-").concat(T.page),(m={},Object(V.a)(m,"".concat(v,"-active"),T.active),Object(V.a)(m,T.className,!!T.className),Object(V.a)(m,"".concat(v,"-disabled"),!T.page),m)),s=function(){T.onClick(T.page)},S=function(O){T.onKeyPress(O,T.onClick,T.page)};return R.a.createElement("li",{title:T.showTitle?T.page:null,className:u,onClick:s,onKeyPress:S,tabIndex:"0"},T.itemRender(T.page,"page",R.a.createElement("a",{rel:"nofollow"},T.page)))},w=y,p={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},f=function(D){Object(L.a)(m,D);var T=Object(K.a)(m);function m(){var v;Object($.a)(this,m);for(var u=arguments.length,s=new Array(u),S=0;S<u;S++)s[S]=arguments[S];return v=T.call.apply(T,[this].concat(s)),v.state={goInputText:""},v.buildOptionText=function(c){return"".concat(c," ").concat(v.props.locale.items_per_page)},v.changeSize=function(c){v.props.changeSize(Number(c))},v.handleChange=function(c){v.setState({goInputText:c.target.value})},v.handleBlur=function(c){var O=v.props,M=O.goButton,B=O.quickGo,j=O.rootPrefixCls,H=v.state.goInputText;if(M||H==="")return;if(c.relatedTarget&&(c.relatedTarget.className.indexOf("".concat(j,"-prev"))>=0||c.relatedTarget.className.indexOf("".concat(j,"-next"))>=0))return;v.setState({goInputText:""}),B(v.getValidValue())},v.go=function(c){var O=v.state.goInputText;if(O==="")return;(c.keyCode===p.ENTER||c.type==="click")&&(v.setState({goInputText:""}),v.props.quickGo(v.getValidValue()))},v}return Object(N.a)(m,[{key:"getValidValue",value:function(){var u=this.state,s=u.goInputText,S=u.current;return!s||isNaN(s)?S:Number(s)}},{key:"getPageSizeOptions",value:function(){var u=this.props,s=u.pageSize,S=u.pageSizeOptions;return S.some(function(c){return c.toString()===s.toString()})?S:S.concat([s.toString()]).sort(function(c,O){var M=isNaN(Number(c))?0:Number(c),B=isNaN(Number(O))?0:Number(O);return M-B})}},{key:"render",value:function(){var u=this,s=this.props,S=s.pageSize,c=s.locale,O=s.rootPrefixCls,M=s.changeSize,B=s.quickGo,j=s.goButton,H=s.selectComponentClass,I=s.buildOptionText,U=s.selectPrefixCls,J=s.disabled,ne=this.state.goInputText,he="".concat(O,"-options"),Ee=H,Ae=null,Oe=null,me=null;if(!M&&!B)return null;var de=this.getPageSizeOptions();if(M&&Ee){var pe=de.map(function(se,ce){return R.a.createElement(Ee.Option,{key:ce,value:se.toString()},(I||u.buildOptionText)(se))});Ae=R.a.createElement(Ee,{disabled:J,prefixCls:U,showSearch:!1,className:"".concat(he,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(S||de[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ce){return ce.parentNode}},pe)}return B&&(j&&(me=typeof j=="boolean"?R.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:J,className:"".concat(he,"-quick-jumper-button")},c.jump_to_confirm):R.a.createElement("span",{onClick:this.go,onKeyUp:this.go},j)),Oe=R.a.createElement("div",{className:"".concat(he,"-quick-jumper")},c.jump_to,R.a.createElement("input",{disabled:J,type:"text",value:ne,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),c.page,me)),R.a.createElement("li",{className:"".concat(he)},Ae,Oe)}}]),m}(R.a.Component);f.defaultProps={pageSizeOptions:["10","20","50","100"]};var g=f,a=W("N2Kk");function r(){}function o(D){return typeof D=="number"&&isFinite(D)&&Math.floor(D)===D}function l(D,T,m){return m}function C(D,T,m){var v=typeof D=="undefined"?T.pageSize:D;return Math.floor((m.total-1)/v)+1}var b=function(D){Object(L.a)(m,D);var T=Object(K.a)(m);function m(v){var u;Object($.a)(this,m),u=T.call(this,v),u.getJumpPrevPage=function(){return Math.max(1,u.state.current-(u.props.showLessItems?3:5))},u.getJumpNextPage=function(){return Math.min(C(void 0,u.state,u.props),u.state.current+(u.props.showLessItems?3:5))},u.getItemIcon=function(M,B){var j=u.props.prefixCls,H=M||R.a.createElement("button",{type:"button","aria-label":B,className:"".concat(j,"-item-link")});return typeof M=="function"&&(H=R.a.createElement(M,Object(P.a)({},u.props))),H},u.savePaginationNode=function(M){u.paginationNode=M},u.isValid=function(M){return o(M)&&M!==u.state.current},u.shouldDisplayQuickJumper=function(){var M=u.props,B=M.showQuickJumper,j=M.pageSize,H=M.total;return H<=j?!1:B},u.handleKeyDown=function(M){(M.keyCode===p.ARROW_UP||M.keyCode===p.ARROW_DOWN)&&M.preventDefault()},u.handleKeyUp=function(M){var B=u.getValidValue(M),j=u.state.currentInputValue;B!==j&&u.setState({currentInputValue:B}),M.keyCode===p.ENTER?u.handleChange(B):M.keyCode===p.ARROW_UP?u.handleChange(B-1):M.keyCode===p.ARROW_DOWN&&u.handleChange(B+1)},u.changePageSize=function(M){var B=u.state.current,j=C(M,u.state,u.props);B=B>j?j:B,j===0&&(B=u.state.current),typeof M=="number"&&("pageSize"in u.props||u.setState({pageSize:M}),"current"in u.props||u.setState({current:B,currentInputValue:B})),u.props.onShowSizeChange(B,M),"onChange"in u.props&&u.props.onChange&&u.props.onChange(B,M)},u.handleChange=function(M){var B=u.props.disabled,j=M;if(u.isValid(j)&&!B){var H=C(void 0,u.state,u.props);j>H?j=H:j<1&&(j=1),"current"in u.props||u.setState({current:j,currentInputValue:j});var I=u.state.pageSize;return u.props.onChange(j,I),j}return u.state.current},u.prev=function(){u.hasPrev()&&u.handleChange(u.state.current-1)},u.next=function(){u.hasNext()&&u.handleChange(u.state.current+1)},u.jumpPrev=function(){u.handleChange(u.getJumpPrevPage())},u.jumpNext=function(){u.handleChange(u.getJumpNextPage())},u.hasPrev=function(){return u.state.current>1},u.hasNext=function(){return u.state.current<C(void 0,u.state,u.props)},u.runIfEnter=function(M,B){if(M.key==="Enter"||M.charCode===13){for(var j=arguments.length,H=new Array(j>2?j-2:0),I=2;I<j;I++)H[I-2]=arguments[I];B.apply(void 0,H)}},u.runIfEnterPrev=function(M){u.runIfEnter(M,u.prev)},u.runIfEnterNext=function(M){u.runIfEnter(M,u.next)},u.runIfEnterJumpPrev=function(M){u.runIfEnter(M,u.jumpPrev)},u.runIfEnterJumpNext=function(M){u.runIfEnter(M,u.jumpNext)},u.handleGoTO=function(M){(M.keyCode===p.ENTER||M.type==="click")&&u.handleChange(u.state.currentInputValue)};var s=v.onChange!==r,S="current"in v;S&&!s&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var c=v.defaultCurrent;"current"in v&&(c=v.current);var O=v.defaultPageSize;return"pageSize"in v&&(O=v.pageSize),c=Math.min(c,C(O,void 0,v)),u.state={current:c,currentInputValue:c,pageSize:O},u}return Object(N.a)(m,[{key:"componentDidUpdate",value:function(u,s){var S=this.props.prefixCls;if(s.current!==this.state.current&&this.paginationNode){var c=this.paginationNode.querySelector(".".concat(S,"-item-").concat(s.current));c&&document.activeElement===c&&c.blur()}}},{key:"getValidValue",value:function(u){var s=u.target.value,S=C(void 0,this.state,this.props),c=this.state.currentInputValue,O;return s===""?O=s:isNaN(Number(s))?O=c:s>=S?O=S:O=Number(s),O}},{key:"getShowSizeChanger",value:function(){var u=this.props,s=u.showSizeChanger,S=u.total,c=u.totalBoundaryShowSizeChanger;return typeof s!="undefined"?s:S>c}},{key:"renderPrev",value:function(u){var s=this.props,S=s.prevIcon,c=s.itemRender,O=c(u,"prev",this.getItemIcon(S,"prev page")),M=!this.hasPrev();return Object(F.isValidElement)(O)?Object(F.cloneElement)(O,{disabled:M}):O}},{key:"renderNext",value:function(u){var s=this.props,S=s.nextIcon,c=s.itemRender,O=c(u,"next",this.getItemIcon(S,"next page")),M=!this.hasNext();return Object(F.isValidElement)(O)?Object(F.cloneElement)(O,{disabled:M}):O}},{key:"render",value:function(){var u=this,s=this.props,S=s.prefixCls,c=s.className,O=s.style,M=s.disabled,B=s.hideOnSinglePage,j=s.total,H=s.locale,I=s.showQuickJumper,U=s.showLessItems,J=s.showTitle,ne=s.showTotal,he=s.simple,Ee=s.itemRender,Ae=s.showPrevNextJumpers,Oe=s.jumpPrevIcon,me=s.jumpNextIcon,de=s.selectComponentClass,pe=s.selectPrefixCls,se=s.pageSizeOptions,ce=this.state,Z=ce.current,te=ce.pageSize,le=ce.currentInputValue;if(B===!0&&j<=te)return null;var ve=C(void 0,this.state,this.props),ie=[],oe=null,xe=null,_e=null,Me=null,Ue=null,He=I&&I.goButton,Be=U?1:2,tt=Z-1>0?Z-1:0,Je=Z+1<ve?Z+1:ve,st=Object.keys(this.props).reduce(function(ae,re){return(re.substr(0,5)==="data-"||re.substr(0,5)==="aria-"||re==="role")&&(ae[re]=u.props[re]),ae},{});if(he)return He&&(typeof He=="boolean"?Ue=R.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):Ue=R.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},He),Ue=R.a.createElement("li",{title:J?"".concat(H.jump_to).concat(Z,"/").concat(ve):null,className:"".concat(S,"-simple-pager")},Ue)),R.a.createElement("ul",Object(ue.a)({className:h()(S,"".concat(S,"-simple"),Object(V.a)({},"".concat(S,"-disabled"),M),c),style:O,ref:this.savePaginationNode},st),R.a.createElement("li",{title:J?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:h()("".concat(S,"-prev"),Object(V.a)({},"".concat(S,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(tt)),R.a.createElement("li",{title:J?"".concat(Z,"/").concat(ve):null,className:"".concat(S,"-simple-pager")},R.a.createElement("input",{type:"text",value:le,disabled:M,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),R.a.createElement("span",{className:"".concat(S,"-slash")},"/"),ve),R.a.createElement("li",{title:J?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:h()("".concat(S,"-next"),Object(V.a)({},"".concat(S,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Je)),Ue);if(ve<=3+Be*2){var nt={locale:H,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:J,itemRender:Ee};ve||ie.push(R.a.createElement(w,Object(ue.a)({},nt,{key:"noPager",page:ve,className:"".concat(S,"-disabled")})));for(var pt=1;pt<=ve;pt+=1){var mt=Z===pt;ie.push(R.a.createElement(w,Object(ue.a)({},nt,{key:pt,page:pt,active:mt})))}}else{var ke=U?H.prev_3:H.prev_5,Le=U?H.next_3:H.next_5;Ae&&(oe=R.a.createElement("li",{title:J?ke:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:h()("".concat(S,"-jump-prev"),Object(V.a)({},"".concat(S,"-jump-prev-custom-icon"),!!Oe))},Ee(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Oe,"prev page"))),xe=R.a.createElement("li",{title:J?Le:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:h()("".concat(S,"-jump-next"),Object(V.a)({},"".concat(S,"-jump-next-custom-icon"),!!me))},Ee(this.getJumpNextPage(),"jump-next",this.getItemIcon(me,"next page")))),Me=R.a.createElement(w,{locale:H,last:!0,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ve,page:ve,active:!1,showTitle:J,itemRender:Ee}),_e=R.a.createElement(w,{locale:H,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:J,itemRender:Ee});var We=Math.max(1,Z-Be),Ve=Math.min(Z+Be,ve);Z-1<=Be&&(Ve=1+Be*2),ve-Z<=Be&&(We=ve-Be*2);for(var Ne=We;Ne<=Ve;Ne+=1){var Ke=Z===Ne;ie.push(R.a.createElement(w,{locale:H,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ne,page:Ne,active:Ke,showTitle:J,itemRender:Ee}))}Z-1>=Be*2&&Z!==1+2&&(ie[0]=Object(F.cloneElement)(ie[0],{className:"".concat(S,"-item-after-jump-prev")}),ie.unshift(oe)),ve-Z>=Be*2&&Z!==ve-2&&(ie[ie.length-1]=Object(F.cloneElement)(ie[ie.length-1],{className:"".concat(S,"-item-before-jump-next")}),ie.push(xe)),We!==1&&ie.unshift(_e),Ve!==ve&&ie.push(Me)}var we=null;ne&&(we=R.a.createElement("li",{className:"".concat(S,"-total-text")},ne(j,[j===0?0:(Z-1)*te+1,Z*te>j?j:Z*te])));var ye=!this.hasPrev()||!ve,ge=!this.hasNext()||!ve;return R.a.createElement("ul",Object(ue.a)({className:h()(S,c,Object(V.a)({},"".concat(S,"-disabled"),M)),style:O,unselectable:"unselectable",ref:this.savePaginationNode},st),we,R.a.createElement("li",{title:J?H.prev_page:null,onClick:this.prev,tabIndex:ye?null:0,onKeyPress:this.runIfEnterPrev,className:h()("".concat(S,"-prev"),Object(V.a)({},"".concat(S,"-disabled"),ye)),"aria-disabled":ye},this.renderPrev(tt)),ie,R.a.createElement("li",{title:J?H.next_page:null,onClick:this.next,tabIndex:ge?null:0,onKeyPress:this.runIfEnterNext,className:h()("".concat(S,"-next"),Object(V.a)({},"".concat(S,"-disabled"),ge)),"aria-disabled":ge},this.renderNext(Je)),R.a.createElement(g,{disabled:M,locale:H,rootPrefixCls:S,selectComponentClass:de,selectPrefixCls:pe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Z,pageSize:te,pageSizeOptions:se,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:He}))}}],[{key:"getDerivedStateFromProps",value:function(u,s){var S={};if("current"in u&&(S.current=u.current,u.current!==s.current&&(S.currentInputValue=S.current)),"pageSize"in u&&u.pageSize!==s.pageSize){var c=s.current,O=C(u.pageSize,s,u);c=c>O?O:c,"current"in u||(S.current=c,S.currentInputValue=c),S.pageSize=u.pageSize}return S}}]),m}(R.a.Component);b.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:r,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:r,locale:a.a,style:{},itemRender:l,totalBoundaryShowSizeChanger:50};var x=b},"6RRn":function(ct,Te,W){"use strict";var ue=W("wCXF"),V=W("n6Qo");W.d(Te,"b",function(){return V.a});var P=W("IBYe"),$=W("6eGT"),N=W("hW8S");W.d(Te,"a",function(){return N.a}),Te.c=ue.b},"6eGT":function(ct,Te,W){"use strict";function ue(V){return null}Te.a=ue},"746U":function(ct,Te,W){"use strict";W.d(Te,"d",function(){return V}),W.d(Te,"j",function(){return P}),W.d(Te,"i",function(){return $}),W.d(Te,"h",function(){return N}),W.d(Te,"e",function(){return L}),W.d(Te,"k",function(){return K}),W.d(Te,"l",function(){return F}),W.d(Te,"a",function(){return R}),W.d(Te,"f",function(){return h}),W.d(Te,"g",function(){return y}),W.d(Te,"m",function(){return w}),W.d(Te,"c",function(){return g}),W.d(Te,"b",function(){return a}),W.d(Te,"n",function(){return r}),W.d(Te,"o",function(){return o});var ue={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function V(l){return Array.isArray?Array.isArray(l):!!(l&&typeof l.length===ue.number&&l.constructor===Array)}function P(l){return typeof l===ue.string||l instanceof String}function $(l){return typeof l===ue.object&&l!==null&&!Array.isArray(l)&&!(l instanceof RegExp)&&!(l instanceof Date)}function N(l){return(typeof l===ue.number||l instanceof Number)&&!isNaN(l)}function L(l){return l===!0||l===!1}function K(l){return typeof l===ue.undefined}function F(l){return K(l)||l===null}function R(l,C){if(!l)throw new Error(C?"Unexpected type, expected '"+C+"'":"Unexpected type")}var A=Object.prototype.hasOwnProperty;function h(l){if(!$(l))return!1;for(var C in l)if(A.call(l,C))return!1;return!0}function y(l){return typeof l===ue.function}function w(l,C){for(var b=Math.min(l.length,C.length),x=0;x<b;x++)p(l[x],C[x])}function p(l,C){if(P(C)){if(typeof l!==C)throw new Error("argument does not match constraint: typeof "+C)}else if(y(C)){try{if(l instanceof C)return}catch(b){}if(!F(l)&&l.constructor===C)return;if(C.length===1&&C.call(void 0,l)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function f(l){for(var C=[],b=Object.getPrototypeOf(l);Object.prototype!==b;)C=C.concat(Object.getOwnPropertyNames(b)),b=Object.getPrototypeOf(b);return C}function g(l){for(var C=[],b=0,x=f(l);b<x.length;b++){var D=x[b];typeof l[D]=="function"&&C.push(D)}return C}function a(l,C){for(var b=function(v){return function(){var u=Array.prototype.slice.call(arguments,0);return C(v,u)}},x={},D=0,T=l;D<T.length;D++){var m=T[D];x[m]=b(m)}return x}function r(l){return l===null?void 0:l}function o(l){return typeof l=="undefined"?null:l}},"7Cbv":function(ct,Te,W){"use strict";var ue=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function P(){if(!ue)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ue(V)}var $=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function N(w){return typeof w=="string"&&$.test(w)}for(var L=N,K=[],F=0;F<256;++F)K.push((F+256).toString(16).substr(1));function R(w){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,f=(K[w[p+0]]+K[w[p+1]]+K[w[p+2]]+K[w[p+3]]+"-"+K[w[p+4]]+K[w[p+5]]+"-"+K[w[p+6]]+K[w[p+7]]+"-"+K[w[p+8]]+K[w[p+9]]+"-"+K[w[p+10]]+K[w[p+11]]+K[w[p+12]]+K[w[p+13]]+K[w[p+14]]+K[w[p+15]]).toLowerCase();if(!L(f))throw TypeError("Stringified UUID is invalid");return f}var A=R;function h(w,p,f){w=w||{};var g=w.random||(w.rng||P)();if(g[6]=g[6]&15|64,g[8]=g[8]&63|128,p){f=f||0;for(var a=0;a<16;++a)p[f+a]=g[a];return p}return A(g)}var y=Te.a=h},"7ahc":function(ct,Te,W){"use strict";W.d(Te,"a",function(){return C});var ue=W("k1fw"),V=W("0Owb"),P=W("+L6B"),$=W("2/Rp"),N=W("y8nQ"),L=W("Vl3Y"),K=W("tJVT"),F=W("OaEy"),R=W("2fM7"),A=W("q1tI"),h=W.n(A),y=W("VrN/"),w=W.n(y),p=W("p77/"),f=W.n(p),g=W("c5Ni"),a=W.n(g),r=R.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},l={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"]};Te.b=function(b){var x=b.callback,D=b.onCancel,T=Object(A.useState)("python"),m=Object(K.a)(T,2),v=m[0],u=m[1];function s(c){u(l[c][1])}function S(c){x(c)}return h.a.createElement(L.a,Object(V.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),h.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},h.a.createElement(R.a,{onChange:s},Object.keys(l).map(function(c){return h.a.createElement(r,{key:c,value:c},l[c][0])}))),h.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},h.a.createElement(C,{mode:v})),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement($.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function C(b){var x=b.value,D=b.onChange,T=b.mode,m=b.options,v=m===void 0?{}:m,u=Object(A.useRef)(),s=Object(A.useState)(),S=Object(K.a)(s,2),c=S[0],O=S[1];return Object(A.useEffect)(function(){if(c){function M(B){var j=B.getValue();D&&D(j)}return c.on("change",M),function(){c.off("change",M)}}},[c,D]),Object(A.useEffect)(function(){c&&c.setOption("mode",T)},[c,T]),Object(A.useEffect)(function(){c&&((x!==c.getValue()||x==="")&&setTimeout(function(){c.setValue(x||" ")},300))},[c,x]),Object(A.useEffect)(function(){if(u.current&&!c){var M=w.a.fromTextArea(u.current,Object(ue.a)({mode:T,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));O(M)}},[u.current,c]),h.a.createElement("div",{className:"my-codemirror-container"},h.a.createElement("textarea",{ref:u}))}},"7qnI":function(ct,Te,W){"use strict";var ue=W("5Dmo"),V=W("3S7+"),P=W("fWQN"),$=W("mtLc"),N=W("yKVA"),L=W("879j"),K=W("5NDa"),F=W("5rEg"),R=W("q1tI"),A=W.n(R),h=W("O2Wb"),y=W.n(h),w=F.a.TextArea,p=function(f){Object(N.a)(a,f);var g=Object(L.a)(a);function a(){return Object(P.a)(this,a),g.apply(this,arguments)}return Object($.a)(a,[{key:"render",value:function(){var o=this,l=this.props,C=l.index,b=l.onAnswerChange,x=l.addChildAnswer,D=l.exerciseIsPublish,T=l.answers,m=l.activeOptionErrorIndex,v=l.flex,u=v===void 0?"0 0 1000px":v;return A.a.createElement("div",{className:y.a.flex},A.a.createElement("div",{className:"".concat(y.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",C+1,"):"),A.a.createElement("div",{className:"".concat(y.a.flex," ").concat(y.a.flex1),style:{flexDirection:"column"}},T.map(function(s,S){var c="".concat(C,"-").concat(S);return A.a.createElement("div",{className:"".concat(y.a.flex," ").concat(y.a.flex1),key:S},A.a.createElement("div",{className:y.a.flex1,style:{flex:u}},A.a.createElement("div",null,A.a.createElement(w,{className:c===m?y.a.error:"",spellCheck:!1,rows:4,value:s||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(S==0?"":"(\u53EF\u9009)"),onChange:function(M){return b(C,S,M.target.value)},style:{minHeight:95}}))),!D&&A.a.createElement(A.a.Fragment,null,S!=0&&A.a.createElement(V.a,{title:"\u5220\u9664"},A.a.createElement("i",{className:"".concat(y.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return o.props.deleteChildAnswer(C,S)},style:{float:"right"}})),S===0&&A.a.createElement(V.a,{title:"\u5220\u9664"},A.a.createElement("i",{className:"".concat(y.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return o.props.deleteChildAnswermain(C,S)},style:{float:"right"}})),A.a.createElement(V.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},A.a.createElement("i",{className:"".concat(y.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return x(C)},style:{float:"right",visibility:S==T.length-1?"":"hidden"}}))))})))}}]),a}(R.Component);Te.a=p},"815F":function(ct,Te,W){"use strict";W.d(Te,"e",function(){return K}),W.d(Te,"c",function(){return R}),W.d(Te,"d",function(){return A}),W.d(Te,"a",function(){return y}),W.d(Te,"f",function(){return w}),W.d(Te,"b",function(){return p});var ue=W("KQm4"),V=W("VTBJ"),P=W("Ff2n"),$=W("Zm9Q"),N=W("Kwbf"),L=W("OZM5");function K(f,g){return f!=null?f:g}function F(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],g=new Map;function a(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(l){var C=l.key,b=l.children;Object(N.a)(C!=null,"Tree node must have a certain key: [".concat(o).concat(C,"]"));var x=String(C);Object(N.a)(!g.has(x)||C===null||C===void 0,"Same 'key' exist in the Tree: ".concat(x)),g.set(x,!0),a(b,"".concat(o).concat(x," > "))})}a(f)}function R(f){function g(a){var r=Object($.a)(a);return r.map(function(o){if(!Object(L.i)(o))return Object(N.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var l=o.key,C=o.props,b=C.children,x=Object(P.a)(C,["children"]),D=Object(V.a)({key:l},x),T=g(b);return T.length&&(D.children=T),D}).filter(function(o){return o})}return g(f)}function A(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=new Set(g===!0?[]:g),r=[];function o(l){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return l.map(function(b,x){var D=Object(L.h)(C?C.pos:"0",x),T=K(b.key,D),m=Object(V.a)(Object(V.a)({},b),{},{parent:C,pos:D,children:null,data:b,isStart:[].concat(Object(ue.a)(C?C.isStart:[]),[x===0]),isEnd:[].concat(Object(ue.a)(C?C.isEnd:[]),[x===l.length-1])});return r.push(m),g===!0||a.has(T)?m.children=o(b.children||[],m):m.children=[],m})}return o(f),r}function h(f,g,a){var r;a?typeof a=="string"?r=function(C){return C[a]}:typeof a=="function"&&(r=function(C){return a(C)}):r=function(C,b){return K(C.key,b)};function o(l,C,b){var x=l?l.children:f,D=l?Object(L.h)(b.pos,C):"0";if(l){var T=r(l,D),m={node:l,index:C,pos:D,key:T,parentPos:b.node?b.pos:null,level:b.level+1};g(m)}x&&x.forEach(function(v,u){o(v,u,{node:l,pos:D,level:b?b.level+1:-1})})}o(null)}function y(f){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=g.initWrapper,r=g.processEntity,o=g.onProcessFinished,l=arguments.length>2?arguments[2]:void 0,C={},b={},x={posEntities:C,keyEntities:b};return a&&(x=a(x)||x),h(f,function(D){var T=D.node,m=D.index,v=D.pos,u=D.key,s=D.parentPos,S=D.level,c={node:T,index:m,key:u,pos:v,level:S},O=K(u,v);C[v]=c,b[O]=c,c.parent=C[s],c.parent&&(c.parent.children=c.parent.children||[],c.parent.children.push(c)),r&&r(c,x)},l),o&&o(x),x}function w(f,g){var a=g.expandedKeys,r=g.selectedKeys,o=g.loadedKeys,l=g.loadingKeys,C=g.checkedKeys,b=g.halfCheckedKeys,x=g.dragOverNodeKey,D=g.dropPosition,T=g.keyEntities,m=T[f],v={eventKey:f,expanded:a.indexOf(f)!==-1,selected:r.indexOf(f)!==-1,loaded:o.indexOf(f)!==-1,loading:l.indexOf(f)!==-1,checked:C.indexOf(f)!==-1,halfChecked:b.indexOf(f)!==-1,pos:String(m?m.pos:""),dragOver:x===f&&D===0,dragOverGapTop:x===f&&D===-1,dragOverGapBottom:x===f&&D===1};return v}function p(f){var g=f.data,a=f.expanded,r=f.selected,o=f.checked,l=f.loaded,C=f.loading,b=f.halfChecked,x=f.dragOver,D=f.dragOverGapTop,T=f.dragOverGapBottom,m=f.pos,v=f.active,u=Object(V.a)(Object(V.a)({},g),{},{expanded:a,selected:r,checked:o,loaded:l,loading:C,halfChecked:b,dragOver:x,dragOverGapTop:D,dragOverGapBottom:T,pos:m,active:v});return"props"in u||Object.defineProperty(u,"props",{get:function(){return Object(N.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),f}}),u}},"8EBN":function(ct,Te,W){(function(ue){ue(W("VrN/"))})(function(ue){"use strict";ue.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 V=0;V<ue.modeInfo.length;V++){var P=ue.modeInfo[V];P.mimes&&(P.mime=P.mimes[0])}ue.findModeByMIME=function($){$=$.toLowerCase();for(var N=0;N<ue.modeInfo.length;N++){var L=ue.modeInfo[N];if(L.mime==$)return L;if(L.mimes){for(var K=0;K<L.mimes.length;K++)if(L.mimes[K]==$)return L}}if(/\+xml$/.test($))return ue.findModeByMIME("application/xml");if(/\+json$/.test($))return ue.findModeByMIME("application/json")},ue.findModeByExtension=function($){$=$.toLowerCase();for(var N=0;N<ue.modeInfo.length;N++){var L=ue.modeInfo[N];if(L.ext){for(var K=0;K<L.ext.length;K++)if(L.ext[K]==$)return L}}},ue.findModeByFileName=function($){for(var N=0;N<ue.modeInfo.length;N++){var L=ue.modeInfo[N];if(L.file&&L.file.test($))return L}var K=$.lastIndexOf("."),F=K>-1&&$.substring(K+1,$.length);if(F)return ue.findModeByExtension(F)},ue.findModeByName=function($){$=$.toLowerCase();for(var N=0;N<ue.modeInfo.length;N++){var L=ue.modeInfo[N];if(L.name.toLowerCase()==$)return L;if(L.alias){for(var K=0;K<L.alias.length;K++)if(L.alias[K].toLowerCase()==$)return L}}}})},"8HAY":function(ct,Te,W){"use strict";W.d(Te,"a",function(){return L}),W.d(Te,"b",function(){return K});var ue=W("pmY6"),V=W("MI8n"),P=function(){var F=function(R,A){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var w in y)y.hasOwnProperty(w)&&(h[w]=y[w])},F(R,A)};return function(R,A){F(R,A);function h(){this.constructor=R}R.prototype=A===null?Object.create(A):(h.prototype=A.prototype,new h)}}(),$=function(F,R,A,h){function y(w){return w instanceof A?w:new A(function(p){p(w)})}return new(A||(A=Promise))(function(w,p){function f(r){try{a(h.next(r))}catch(o){p(o)}}function g(r){try{a(h.throw(r))}catch(o){p(o)}}function a(r){r.done?w(r.value):y(r.value).then(f,g)}a((h=h.apply(F,R||[])).next())})},N=function(F,R){var A={label:0,sent:function(){if(w[0]&1)throw w[1];return w[1]},trys:[],ops:[]},h,y,w,p;return p={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function f(a){return function(r){return g([a,r])}}function g(a){if(h)throw new TypeError("Generator is already executing.");for(;A;)try{if(h=1,y&&(w=a[0]&2?y.return:a[0]?y.throw||((w=y.return)&&w.call(y),0):y.next)&&!(w=w.call(y,a[1])).done)return w;(y=0,w)&&(a=[a[0]&2,w.value]);switch(a[0]){case 0:case 1:w=a;break;case 4:return A.label++,{value:a[1],done:!1};case 5:A.label++,y=a[1],a=[0];continue;case 7:a=A.ops.pop(),A.trys.pop();continue;default:if(!(w=A.trys,w=w.length>0&&w[w.length-1])&&(a[0]===6||a[0]===2)){A=0;continue}if(a[0]===3&&(!w||a[1]>w[0]&&a[1]<w[3])){A.label=a[1];break}if(a[0]===6&&A.label<w[1]){A.label=w[1],w=a;break}if(w&&A.label<w[2]){A.label=w[2],A.ops.push(a);break}w[2]&&A.ops.pop(),A.trys.pop();continue}a=R.call(F,A)}catch(r){a=[6,r],y=0}finally{h=w=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},L=function(F){P(R,F);function R(A,h,y,w,p){h===void 0&&(h=""),y===void 0&&(y=""),w===void 0&&(w=!0);var f=F.call(this)||this;return f._onDidChange=f._register(new V.a),f.onDidChange=f._onDidChange.event,f._enabled=!0,f._checked=!1,f._id=A,f._label=h,f._cssClass=y,f._enabled=w,f._actionCallback=p,f}return Object.defineProperty(R.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){return this._label},set:function(A){this._setLabel(A)},enumerable:!0,configurable:!0}),R.prototype._setLabel=function(A){this._label!==A&&(this._label=A,this._onDidChange.fire({label:A}))},Object.defineProperty(R.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(A){this._setTooltip(A)},enumerable:!0,configurable:!0}),R.prototype._setTooltip=function(A){this._tooltip!==A&&(this._tooltip=A,this._onDidChange.fire({tooltip:A}))},Object.defineProperty(R.prototype,"class",{get:function(){return this._cssClass},set:function(A){this._setClass(A)},enumerable:!0,configurable:!0}),R.prototype._setClass=function(A){this._cssClass!==A&&(this._cssClass=A,this._onDidChange.fire({class:A}))},Object.defineProperty(R.prototype,"enabled",{get:function(){return this._enabled},set:function(A){this._setEnabled(A)},enumerable:!0,configurable:!0}),R.prototype._setEnabled=function(A){this._enabled!==A&&(this._enabled=A,this._onDidChange.fire({enabled:A}))},Object.defineProperty(R.prototype,"checked",{get:function(){return this._checked},set:function(A){this._setChecked(A)},enumerable:!0,configurable:!0}),R.prototype._setChecked=function(A){this._checked!==A&&(this._checked=A,this._onDidChange.fire({checked:A}))},R.prototype.run=function(A,h){return this._actionCallback?this._actionCallback(A):Promise.resolve(!0)},R}(ue.a),K=function(F){P(R,F);function R(){var A=F!==null&&F.apply(this,arguments)||this;return A._onDidBeforeRun=A._register(new V.a),A.onDidBeforeRun=A._onDidBeforeRun.event,A._onDidRun=A._register(new V.a),A.onDidRun=A._onDidRun.event,A}return R.prototype.run=function(A,h){return $(this,void 0,void 0,function(){var y,w;return N(this,function(p){switch(p.label){case 0:if(!A.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:A}),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this.runAction(A,h)];case 2:return y=p.sent(),this._onDidRun.fire({action:A,result:y}),[3,4];case 3:return w=p.sent(),this._onDidRun.fire({action:A,error:w}),[3,4];case 4:return[2]}})})},R.prototype.runAction=function(A,h){var y=h?A.run(h):A.run();return Promise.resolve(y)},R}(ue.a)},"8hTe":function(ct,Te,W){ct.exports={button:"button___1wy9m"}},"9Bee":function(ct,Te,W){"use strict";var ue=W("DYRE"),V=W("zeV3"),P=W("+L6B"),$=W("2/Rp"),N=W("k1fw"),L=W("9og8"),K=W("tJVT"),F=W("WmNS"),R=W.n(F),A=W("q1tI"),h=W.n(A),y=W("vg9a"),w=W("DlQD"),p=W.n(w),f=W("rUJ1");function g(G,E){var _=G.match(/^(\s+)(?:```)/);if(_===null)return E;var z=_[1];return E.split(`
`).map(function(Q){var Y=Q.match(/^\s+/);if(Y===null)return Q;var Re=Object(K.a)(Y,1),et=Re[0];return et.length>=z.length?Q.slice(z.length):Q}).join(`
`)}var a=[],r=["<ul>"],o=new p.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){a.length=0,r=["<ul>"]}var b={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(G,E,_,z){if(E>=G.length||G[E].level<=_)return E;var Q=G[E];z.push("<li><a href='#"+Q.anchor+"'>"+Q.text+"</a>"),E++;var Y=[];return E=x(G,E,Q.level,Y),Y.length>0&&(z.push("<ul>"),Y.forEach(function(Re){z.push(Re)}),z.push("</ul>")),z.push("</li>"),E=x(G,E,_,z),E}function D(){return x(a,0,0,r),r.push("</ul>"),r.join("")}var T={heading:function(E){var _=l.exec(E);if(_)return{type:"heading",raw:_[0],depth:_[1].length,text:_[2]}},fences:function(E){var _=this.rules.block.fences.exec(E);if(_){var z=_[0],Q=g(z,_[3]||""),Y=_[2]?_[2].trim():_[2];if(["latex","katex","math"].indexOf(Y)>=0){var Re=u(),et=Q;Q=Re,s[Re]={type:"block",expression:et}}return{type:"code",raw:z,lang:Y,text:Q}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,u=function(){return"__special_katext_id_".concat(v++,"__")},s={};function S(){return s}function c(){v=0,s={}}function O(G){return G=G.replace(m,function(E,_){var z=u();return s[z]={type:"inline",expression:_},z}),G}var M=o.listitem;o.listitem=function(G){return M(O(G))};var B=o.paragraph;o.paragraph=function(G){return B(O(G))};var j=o.tablecell;o.tablecell=function(G,E){return j(O(G),E)},o.code=function(G,E,_){var z=(E||"").match(/\S*/)[0];return z?["latex","katex","math"].indexOf(z)>=0?"<p class='editormd-tex'>".concat(G,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(E,'">').concat(_?G:Object(f.escape)(G,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(_?G:Object(f.escape)(G,!0))+"</code></pre>"},o.heading=function(G,E,_){var z=this.options.headerPrefix+_.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:z,level:E,text:G}),"<h"+E+' id="'+z+'">'+G+"</h"+E+">"},p.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),p.a.use({tokenizer:T,renderer:o});var H=p.a,I=W("SJMd"),U=W("ulZh"),J=W.n(U),ne=W("m3rI"),he=W("Oy/b"),Ee=W("p5ED"),Ae=W("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Oe=function(G,E){return(Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,z){_.__proto__=z}||function(_,z){for(var Q in z)Object.prototype.hasOwnProperty.call(z,Q)&&(_[Q]=z[Q])})(G,E)};function me(G,E){function _(){this.constructor=G}Oe(G,E),G.prototype=E===null?Object.create(E):(_.prototype=E.prototype,new _)}function de(G,E,_,z){return new(_||(_=Promise))(function(Q,Y){function Re(_t){try{yt(z.next(_t))}catch(it){Y(it)}}function et(_t){try{yt(z.throw(_t))}catch(it){Y(it)}}function yt(_t){var it;_t.done?Q(_t.value):(it=_t.value,it instanceof _?it:new _(function(Kt){Kt(it)})).then(Re,et)}yt((z=z.apply(G,E||[])).next())})}function pe(G,E){var _,z,Q,Y,Re={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return Y={next:et(0),throw:et(1),return:et(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function et(yt){return function(_t){return function(it){if(_)throw new TypeError("Generator is already executing.");for(;Re;)try{if(_=1,z&&(Q=2&it[0]?z.return:it[0]?z.throw||((Q=z.return)&&Q.call(z),0):z.next)&&!(Q=Q.call(z,it[1])).done)return Q;switch(z=0,Q&&(it=[2&it[0],Q.value]),it[0]){case 0:case 1:Q=it;break;case 4:return Re.label++,{value:it[1],done:!1};case 5:Re.label++,z=it[1],it=[0];continue;case 7:it=Re.ops.pop(),Re.trys.pop();continue;default:if(!(Q=Re.trys,(Q=Q.length>0&&Q[Q.length-1])||it[0]!==6&&it[0]!==2)){Re=0;continue}if(it[0]===3&&(!Q||it[1]>Q[0]&&it[1]<Q[3])){Re.label=it[1];break}if(it[0]===6&&Re.label<Q[1]){Re.label=Q[1],Q=it;break}if(Q&&Re.label<Q[2]){Re.label=Q[2],Re.ops.push(it);break}Q[2]&&Re.ops.pop(),Re.trys.pop();continue}it=E.call(G,Re)}catch(Kt){it=[6,Kt],z=0}finally{_=Q=0}if(5&it[0])throw it[1];return{value:it[0]?it[1]:void 0,done:!0}}([yt,_t])}}}function se(){for(var G=0,E=0,_=arguments.length;E<_;E++)G+=arguments[E].length;var z=Array(G),Q=0;for(E=0;E<_;E++)for(var Y=arguments[E],Re=0,et=Y.length;Re<et;Re++,Q++)z[Q]=Y[Re];return z}var ce=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(E,_){for(var z=0,Q=_;z<Q.length;z++){var Y=Q[z],Re=Y[0],et=Y[1];E.setAttribute(Re,et)}},G.createRect=function(E,_,z){var Q=document.createElementNS("http://www.w3.org/2000/svg","rect");return Q.setAttribute("width",E.toString()),Q.setAttribute("height",_.toString()),z&&G.setAttributes(Q,z),Q},G.createLine=function(E,_,z,Q,Y){var Re=document.createElementNS("http://www.w3.org/2000/svg","line");return Re.setAttribute("x1",E.toString()),Re.setAttribute("y1",_.toString()),Re.setAttribute("x2",z.toString()),Re.setAttribute("y2",Q.toString()),Y&&G.setAttributes(Re,Y),Re},G.createPolygon=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",E),_&&G.setAttributes(z,_),z},G.createCircle=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(E/2).toString()),z.setAttribute("cy",(E/2).toString()),z.setAttribute("r",E.toString()),_&&G.setAttributes(z,_),z},G.createEllipse=function(E,_,z){var Q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Q.setAttribute("cx",(E/2).toString()),Q.setAttribute("cy",(_/2).toString()),Q.setAttribute("rx",(E/2).toString()),Q.setAttribute("ry",(_/2).toString()),z&&G.setAttributes(Q,z),Q},G.createGroup=function(E){var _=document.createElementNS("http://www.w3.org/2000/svg","g");return E&&G.setAttributes(_,E),_},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(E,_,z,Q,Y,Re,et){var yt=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(yt,[["id",E],["orient",_],["markerWidth",z.toString()],["markerHeight",Q.toString()],["refX",Y.toString()],["refY",Re.toString()]]),yt.appendChild(et),yt},G.createText=function(E){var _=document.createElementNS("http://www.w3.org/2000/svg","text");return _.setAttribute("x","0"),_.setAttribute("y","0"),E&&G.setAttributes(_,E),_},G.createTSpan=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=E,_&&G.setAttributes(z,_),z},G.createImage=function(E){var _=document.createElementNS("http://www.w3.org/2000/svg","image");return E&&G.setAttributes(_,E),_},G.createPoint=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=E,z.y=_,z},G.createPath=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",E),_&&G.setAttributes(z,_),z},G}(),Z=function(){function G(){}return G.addKey=function(E){G.key=E},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),te=function(){function G(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return G.prototype.rasterize=function(E,_,z){var Q=this;return new Promise(function(Y){var Re=z!==void 0?z:document.createElement("canvas");E===null&&(Q.markersOnly=!0,Q.naturalSize=!1);var et=document.createElementNS("http://www.w3.org/2000/svg","svg");et.setAttribute("xmlns","http://www.w3.org/2000/svg"),et.setAttribute("width",_.width.baseVal.valueAsString),et.setAttribute("height",_.height.baseVal.valueAsString),et.setAttribute("viewBox","0 0 "+_.viewBox.baseVal.width.toString()+" "+_.viewBox.baseVal.height.toString()),et.innerHTML=_.innerHTML,Q.naturalSize===!0?(et.width.baseVal.value=E.naturalWidth,et.height.baseVal.value=E.naturalHeight):Q.width!==void 0&&Q.height!==void 0&&(et.width.baseVal.value=Q.width,et.height.baseVal.value=Q.height),Re.width=et.width.baseVal.value,Re.height=et.height.baseVal.value;var yt=et.outerHTML,_t=Re.getContext("2d");Q.markersOnly!==!0&&_t.drawImage(E,0,0,Re.width,Re.height);var it=window.URL,Kt=new Image(Re.width,Re.height);Kt.setAttribute("crossOrigin","anonymous");var Bt=new Blob([yt],{type:"image/svg+xml"}),gr=it.createObjectURL(Bt);Kt.onload=function(){_t.drawImage(Kt,0,0),it.revokeObjectURL(gr);var Kr=Re.toDataURL(Q.imageType,Q.imageQuality);Y(Kr)},Kt.src=gr})},G}(),le=function(){},ve=function(){function G(E){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+E+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),G.prototype.addClass=function(E){return this.styleSheet===void 0&&this.addStyleSheet(),E.name=""+this.classNamePrefix+E.localName,this.classes.push(E),this.styleSheet.sheet.insertRule("."+E.name+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length),E},G.prototype.addRule=function(E){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(E),this.styleSheet.sheet.insertRule(E.selector+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length)},G.prototype.addStyleSheet=function(){var E;this.styleSheet=document.createElement("style"),((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).appendChild(this.styleSheet),this.addRule(new ie("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ie("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ie("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new oe("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new oe("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},G.prototype.removeStyleSheet=function(){var E;this.styleSheet&&(((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),ie=function(G,E){this.selector=G,this.style=E},oe=function(G,E){this.localName=G,this.style=E},xe=function(){function G(E,_,z,Q,Y){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=E,this.displayMode=_,this.markerItems=z,this.uiStyleSettings=Q,this.styles=Y,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return G.prototype.show=function(E){var _=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=E,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",this.uiContainer.appendChild(z),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Y){var Re=document.createElement("div");Re.className=""+_.toolbarButtonStyleClass.name,Re.setAttribute("data-type-name",Y.typeName),Re.innerHTML=Y.icon,Re.addEventListener("click",function(){_.markerToolbarButtonClicked(Re,Y)}),_.buttons.push(Re),_.markerButtons.push(Re)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Q=document.createElement("div");Q.className=this.toolbarBlockStyleClass.name,Q.style.whiteSpace="nowrap",Q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Q),this.addActionButton(Q,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(Q,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},G.prototype.addButtonClickListener=function(E){this.buttonClickListeners.push(E)},G.prototype.removeButtonClickListener=function(E){this.buttonClickListeners.indexOf(E)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(E),1)},G.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},G.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var E=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var _=0;_<this.markerButtons.length;_++)_<E||_===E&&this.markerButtons.length-1===E?this.markerButtonBlock.appendChild(this.markerButtons[_]):(_===E&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[_]))}},G.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},G.prototype.resetButtonStyles=function(){var E=this;this.buttons.forEach(function(_){_.className=_.className.replace(E.uiStyleSettings.toolbarButtonStyleColorsClassName?E.uiStyleSettings.toolbarButtonStyleColorsClassName:E.toolbarButtonStyleColorsClass.name,"").trim(),_.className=_.className.replace(E.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?E.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:E.toolbarActiveButtonStyleColorsClass.name,"").trim(),_.className+=" "+(E.uiStyleSettings.toolbarButtonStyleColorsClassName?E.uiStyleSettings.toolbarButtonStyleColorsClassName:E.toolbarButtonStyleColorsClass.name)})},G.prototype.addActionButton=function(E,_,z){var Q=this,Y=document.createElement("div");switch(Y.className=""+this.toolbarButtonStyleClass.name,Y.innerHTML=_,Y.setAttribute("data-action",z),Y.addEventListener("click",function(){Q.actionToolbarButtonClicked(Y,z)}),z){case"select":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Y.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Y.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Y.style.fill=this.uiStyleSettings.closeButtonColor}E.appendChild(Y),this.buttons.push(Y)},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new oe("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new oe("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new oe("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new oe("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new oe("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var E=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new oe("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
padding: `+E+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ie("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new ie("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},G.prototype.markerToolbarButtonClicked=function(E,_){this.setActiveButton(E),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("marker",_)}),this.markerButtonOverflowBlock.style.display="none"},G.prototype.actionToolbarButtonClicked=function(E,_){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("action",_)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},G.prototype.setActiveButton=function(E){this.resetButtonStyles(),E.className=E.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),E.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},G.prototype.setActiveMarkerButton=function(E){var _=this.markerButtons.find(function(z){return z.getAttribute("data-type-name")===E});_&&this.setActiveButton(_)},G.prototype.setCurrentMarker=function(E){var _=this;this.currentMarker=E,this.buttons.filter(function(z){return/delete|notes/.test(z.getAttribute("data-action"))}).forEach(function(z){_.currentMarker===void 0?(z.style.fillOpacity="0.4",z.style.pointerEvents="none"):(z.style.fillOpacity="1",z.style.pointerEvents="all")})},G}(),_e=function(){function G(E,_,z,Q){this.panels=[],this.panelButtons=[],this.markerjsContainer=E,this.displayMode=_,this.uiStyleSettings=z,this.styles=Q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return G.prototype.addStyles=function(){var E;this.toolboxStyleClass=this.styles.addClass(new oe("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 oe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var _=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new oe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new oe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new oe("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 oe("toolbox-panel-row_colors",`
background-color: `+((E=this.uiStyleSettings.toolboxBackgroundColor)!==null&&E!==void 0?E:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new oe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
padding: `+_+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ie("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ie("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},G.prototype.show=function(E){var _;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=E,this.uiContainer.className=this.toolboxStyleClass.name+" "+((_=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},G.prototype.setPanelButtons=function(E){var _,z,Q=this;this.panels=E,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((_=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((z=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Y){var Re;Y.uiStyleSettings=Q.uiStyleSettings;var et=document.createElement("div");et.className=Q.toolboxButtonStyleClass.name+" "+((Re=Q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Re!==void 0?Re:Q.toolboxButtonStyleColorsClass.name),et.innerHTML=Y.icon,et.title=Y.title,et.addEventListener("click",function(){Q.panelButtonClick(Y)}),Q.panelButtons.push(et),Q.buttonRow.appendChild(et)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},G.prototype.panelButtonClick=function(E){var _=this,z=-1;if(E!==this.activePanel){z=this.panels.indexOf(E),this.panelRow.innerHTML="";var Q=E.getUi();Q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Q),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=E}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){_.displayMode==="inline"?_.panelRow.style.display="none":_.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Y,Re){var et,yt;Y.className=_.toolboxButtonStyleClass.name+" "+(Re===z?""+((et=_.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&et!==void 0?et:_.toolboxActiveButtonStyleColorsClass.name):""+((yt=_.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&yt!==void 0?yt:_.toolboxButtonStyleColorsClass.name))})},G}(),Me=function(G,E){this.title=G,this.icon=E},Ue=function(G){function E(_,z,Q,Y){var Re=G.call(this,_,Y||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Re.colors=[],Re.addTransparent=!1,Re.colorBoxes=[],Re.colors=z,Re.currentColor=Q,Re.setCurrentColor=Re.setCurrentColor.bind(Re),Re.getColorBox=Re.getColorBox.bind(Re),Re}return me(E,G),E.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.whiteSpace="nowrap",this.colors.forEach(function(Q){var Y=_.getColorBox(Q);z.appendChild(Y),_.colorBoxes.push(Y)}),z},E.prototype.getColorBox=function(_){var z=this,Q=this.uiStyleSettings.toolbarHeight/4,Y=this.uiStyleSettings.toolbarHeight-Q,Re=document.createElement("div");Re.style.display="inline-block",Re.style.boxSizing="content-box",Re.style.width=Y-2+"px",Re.style.height=Y-2+"px",Re.style.padding="1px",Re.style.marginRight="2px",Re.style.marginBottom="2px",Re.style.borderWidth="2px",Re.style.borderStyle="solid",Re.style.borderRadius=(Y+2)/2+"px",Re.style.borderColor=_===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Re.addEventListener("click",function(){z.setCurrentColor(_,Re)});var et=document.createElement("div");return et.style.display="inline-block",et.style.width=Y-2+"px",et.style.height=Y-2+"px",et.style.backgroundColor=_,et.style.borderRadius=Y/2+"px",_==="transparent"&&(et.style.fill=this.uiStyleSettings.toolboxAccentColor,et.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Re.appendChild(et),Re},E.prototype.setCurrentColor=function(_,z){var Q=this;this.currentColor=_,this.colorBoxes.forEach(function(Y){Y.style.borderColor=Y===z?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(_)},E}(Me),He=function(){function G(E,_,z){this._state="new",this._isSelected=!1,this._container=E,this._overlayContainer=_,this.globalSettings=z,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(G.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),G.prototype.ownsTarget=function(E){return!1},Object.defineProperty(G.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),G.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},G.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},G.prototype.pointerDown=function(E,_){},G.prototype.dblClick=function(E,_){},G.prototype.manipulate=function(E){},G.prototype.pointerUp=function(E){this.stateChanged()},G.prototype.dispose=function(){},G.prototype.addMarkerVisualToContainer=function(E){this.container.childNodes.length>0?this.container.insertBefore(E,this.container.childNodes[0]):this.container.appendChild(E)},G.prototype.getState=function(){return{typeName:G.typeName,state:this.state,notes:this.notes}},G.prototype.restoreState=function(E){this._state=E.state,this.notes=E.notes},G.prototype.scale=function(E,_){},G.prototype.colorChanged=function(E){this.onColorChanged&&this.onColorChanged(E),this.stateChanged()},G.prototype.fillColorChanged=function(E){this.onFillColorChanged&&this.onFillColorChanged(E),this.stateChanged()},G.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var E=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),E.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(E)&&this.onStateChanged(this)}},G.typeName="MarkerBase",G}(),Be=function(){function G(){this.findGripByVisual=this.findGripByVisual.bind(this)}return G.prototype.findGripByVisual=function(E){return this.topLeft.ownsTarget(E)?this.topLeft:this.topCenter.ownsTarget(E)?this.topCenter:this.topRight.ownsTarget(E)?this.topRight:this.centerLeft.ownsTarget(E)?this.centerLeft:this.centerRight.ownsTarget(E)?this.centerRight:this.bottomLeft.ownsTarget(E)?this.bottomLeft:this.bottomCenter.ownsTarget(E)?this.bottomCenter:this.bottomRight.ownsTarget(E)?this.bottomRight:void 0},G}(),tt=function(){function G(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(E){return E===this.visual||E===this.visual.childNodes[0]||E===this.visual.childNodes[1]},G}(),Je=function(){function G(){}return G.toITransformMatrix=function(E){return{a:E.a,b:E.b,c:E.c,d:E.d,e:E.e,f:E.f}},G.toSVGMatrix=function(E,_){return E.a=_.a,E.b=_.b,E.c=_.c,E.d=_.d,E.e=_.e,E.f=_.f,E},G}(),st=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.left=0,Y.top=0,Y.width=0,Y.height=0,Y.defaultSize={x:50,y:20},Y.offsetX=0,Y.offsetY=0,Y.rotationAngle=0,Y.CB_DISTANCE=10,Y._suppressMarkerCreateEvent=!1,Y.container.transform.baseVal.appendItem(ce.createTransform()),Y.setupControlBox(),Y}return me(E,G),Object.defineProperty(E.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"visual",{get:function(){return this._visual},set:function(_){this._visual=_;var z=ce.createTransform();this._visual.transform.baseVal.appendItem(z)},enumerable:!1,configurable:!0}),E.prototype.ownsTarget=function(_){return!!G.prototype.ownsTarget.call(this,_)||!!(this.controlGrips.findGripByVisual(_)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(_))},E.prototype.pointerDown=function(_,z){G.prototype.pointerDown.call(this,_,z),this.state==="new"&&(this.left=_.x,this.top=_.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Q=this.unrotatePoint(_);if(this.manipulationStartX=Q.x,this.manipulationStartY=Q.y,this.offsetX=Q.x-this.left,this.offsetY=Q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(z),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(z)){this.activeGrip=this.rotatorGrip;var Y=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Y.x-this.width/2,this.top=Y.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Re=this.container.transform.baseVal.getItem(0);Re.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Re,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},E.prototype.pointerUp=function(_){var z=this.state;G.prototype.pointerUp.call(this,_),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(_),this._state="select",z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},E.prototype.moveVisual=function(_){this.visual.style.transform="translate("+_.x+"px, "+_.y+"px)"},E.prototype.manipulate=function(_){var z=this.unrotatePoint(_);this.state==="creating"?this.resize(_):this.state==="move"?(this.left=this.manipulationStartLeft+(z.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(z.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(z):this.state==="rotate"&&this.rotate(_)},E.prototype.resize=function(_){var z=this.manipulationStartLeft,Q=this.manipulationStartWidth,Y=this.manipulationStartTop,Re=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:z=this.manipulationStartLeft+_.x-this.manipulationStartX,Q=this.manipulationStartWidth+this.manipulationStartLeft-z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Q=this.manipulationStartWidth+_.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Y=this.manipulationStartTop+_.y-this.manipulationStartY,Re=this.manipulationStartHeight+this.manipulationStartTop-Y;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Re=this.manipulationStartHeight+_.y-this.manipulationStartY}Q>=0?(this.left=z,this.width=Q):(this.left=z+Q,this.width=-Q),Re>=0?(this.top=Y,this.height=Re):(this.top=Y+Re,this.height=-Re),this.setSize()},E.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},E.prototype.rotate=function(_){if(Math.abs(_.x-this.centerX)>.1){var z=Math.sign(_.x-this.centerX);this.rotationAngle=180*Math.atan((_.y-this.centerY)/(_.x-this.centerX))/Math.PI+90*z,this.applyRotation()}},E.prototype.applyRotation=function(){var _=this.container.transform.baseVal.getItem(0);_.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(_,0)},E.prototype.rotatePoint=function(_){if(this.rotationAngle===0)return _;var z=this.container.getCTM(),Q=ce.createPoint(_.x,_.y);return{x:(Q=Q.matrixTransform(z)).x,y:Q.y}},E.prototype.unrotatePoint=function(_){if(this.rotationAngle===0)return _;var z=this.container.getCTM();z=z.inverse();var Q=ce.createPoint(_.x,_.y);return{x:(Q=Q.matrixTransform(z)).x,y:Q.y}},E.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},E.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},E.prototype.setupControlBox=function(){this.controlBox=ce.createGroup();var _=ce.createTransform();_.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(_),this.container.appendChild(this.controlBox),this.controlRect=ce.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=ce.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"},E.prototype.adjustControlBox=function(){var _=this.controlBox.transform.baseVal.getItem(0);_.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(_,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()},E.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()},E.prototype.createGrip=function(){var _=new tt;return _.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(_.visual),_},E.prototype.positionGrips=function(){var _=this.controlGrips.topLeft.GRIP_SIZE,z=-_/2,Q=z,Y=(this.width+this.CB_DISTANCE)/2-_/2,Re=(this.height+this.CB_DISTANCE)/2-_/2,et=this.height+this.CB_DISTANCE-_/2,yt=this.width+this.CB_DISTANCE-_/2;this.positionGrip(this.controlGrips.topLeft.visual,z,Q),this.positionGrip(this.controlGrips.topCenter.visual,Y,Q),this.positionGrip(this.controlGrips.topRight.visual,yt,Q),this.positionGrip(this.controlGrips.centerLeft.visual,z,Re),this.positionGrip(this.controlGrips.centerRight.visual,yt,Re),this.positionGrip(this.controlGrips.bottomLeft.visual,z,et),this.positionGrip(this.controlGrips.bottomCenter.visual,Y,et),this.positionGrip(this.controlGrips.bottomRight.visual,yt,et),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Y,Q-3*this.CB_DISTANCE)},E.prototype.positionGrip=function(_,z,Q){var Y=_.transform.baseVal.getItem(0);Y.setTranslate(z,Q),_.transform.baseVal.replaceItem(Y,0)},E.prototype.hideControlBox=function(){this.controlBox.style.display="none"},E.prototype.showControlBox=function(){this.controlBox.style.display=""},E.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},G.prototype.getState.call(this))},E.prototype.restoreState=function(_){G.prototype.restoreState.call(this,_);var z=_;this.left=z.left,this.top=z.top,this.width=z.width,this.height=z.height,this.rotationAngle=z.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,z.containerTransformMatrix))},E.prototype.scale=function(_,z){G.prototype.scale.call(this,_,z);var Q=this.rotatePoint({x:this.left,y:this.top}),Y=this.unrotatePoint({x:Q.x*_,y:Q.y*z});this.left=Y.x,this.top=Y.y,this.width=this.width*_,this.height=this.height*z,this.adjustControlBox()},E}(He),nt=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y}return me(E,G),E.prototype.ownsTarget=function(_){return!(!G.prototype.ownsTarget.call(this,_)&&_!==this.visual)},E.prototype.createVisual=function(){this.visual=ce.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)},E.prototype.pointerDown=function(_,z){G.prototype.pointerDown.call(this,_,z),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},E.prototype.manipulate=function(_){G.prototype.manipulate.call(this,_)},E.prototype.resize=function(_){G.prototype.resize.call(this,_),this.setSize()},E.prototype.setSize=function(){G.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},E.prototype.pointerUp=function(_){G.prototype.pointerUp.call(this,_),this.setSize()},E.prototype.setStrokeColor=function(_){this.strokeColor=_,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},E.prototype.setFillColor=function(_){this.fillColor=_,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},E.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},E.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this))},E.prototype.restoreState=function(_){var z=_;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),G.prototype.restoreState.call(this,_),this.setSize()},E.prototype.scale=function(_,z){G.prototype.scale.call(this,_,z),this.setSize()},E.title="Rectangle marker",E}(st),pt=function(G){function E(_,z,Q,Y){var Re=G.call(this,_,Y||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Re.widths=[],Re.widthBoxes=[],Re.widths=z,Re.currentWidth=Q,Re.setCurrentWidth=Re.setCurrentWidth.bind(Re),Re}return me(E,G),E.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.widths.forEach(function(Q){var Y=document.createElement("div");Y.style.display="flex",Y.style.flexGrow="2",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=Q===_.currentWidth?_.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){_.setCurrentWidth(Q,Y)}),z.appendChild(Y);var Re=document.createElement("div");Re.innerText=Q.toString(),Re.style.marginRight="5px",Y.appendChild(Re);var et=document.createElement("div");et.style.minHeight="20px",et.style.flexGrow="2",et.style.display="flex",et.style.alignItems="center";var yt=document.createElement("hr");yt.style.minWidth="20px",yt.style.border="0px",yt.style.borderTop=Q+"px solid "+_.uiStyleSettings.toolboxColor,yt.style.flexGrow="2",et.appendChild(yt),Y.appendChild(et),_.widthBoxes.push(Y)}),z},E.prototype.setCurrentWidth=function(_,z){var Q=this;this.currentWidth=_,this.widthBoxes.forEach(function(Y){Y.style.borderColor=Y===z?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},E}(Me),mt=function(G){function E(_,z,Q,Y){var Re=G.call(this,_,Y||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Re.styles=[],Re.styleBoxes=[],Re.styles=z,Re.currentStyle=Q,Re.setCurrentStyle=Re.setCurrentStyle.bind(Re),Re}return me(E,G),E.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.styles.forEach(function(Q){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/_.styles.length-5+"%",Y.style.borderColor=Q===_.currentStyle?_.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){_.setCurrentStyle(Q,Y)}),z.appendChild(Y);var Re=document.createElement("div");Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.overflow="hidden";var et=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+_.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Q!==""?'stroke-dasharray="'+Q+'"':"")+` />
</svg>`;Re.innerHTML=et,Y.appendChild(Re),_.styleBoxes.push(Y)}),z},E.prototype.setCurrentStyle=function(_,z){var Q=this;this.currentStyle=_,this.styleBoxes.forEach(function(Y){Y.style.borderColor=Y===z?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},E}(Me),ke=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.strokeColor=Q.defaultColor,Y.strokeWidth=Q.defaultStrokeWidth,Y.strokeDasharray=Q.defaultStrokeDasharray,Y.strokePanel=new Ue("Line color",Q.defaultColorSet,Q.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new pt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new mt("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return me(E,G),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=G.prototype.getState.call(this);return _.typeName=E.typeName,_},E.typeName="FrameMarker",E.title="Frame marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',E}(nt),Le=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},We=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.x1=0,Y.y1=0,Y.x2=0,Y.y2=0,Y.defaultLength=50,Y.manipulationStartX=0,Y.manipulationStartY=0,Y.manipulationStartX1=0,Y.manipulationStartY1=0,Y.manipulationStartX2=0,Y.manipulationStartY2=0,Y.setupControlBox(),Y}return me(E,G),E.prototype.ownsTarget=function(_){return!!G.prototype.ownsTarget.call(this,_)||!(!this.grip1.ownsTarget(_)&&!this.grip2.ownsTarget(_))},E.prototype.pointerDown=function(_,z){G.prototype.pointerDown.call(this,_,z),this.manipulationStartX=_.x,this.manipulationStartY=_.y,this.state==="new"&&(this.x1=_.x,this.y1=_.y,this.x2=_.x,this.y2=_.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(z)?this.activeGrip=this.grip1:this.grip2.ownsTarget(z)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},E.prototype.pointerUp=function(_){var z=this.state;G.prototype.pointerUp.call(this,_),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(_),this._state="select",z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},E.prototype.adjustVisual=function(){},E.prototype.manipulate=function(_){this.state==="creating"?this.resize(_):this.state==="move"?(this.x1=this.manipulationStartX1+_.x-this.manipulationStartX,this.y1=this.manipulationStartY1+_.y-this.manipulationStartY,this.x2=this.manipulationStartX2+_.x-this.manipulationStartX,this.y2=this.manipulationStartY2+_.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(_)},E.prototype.resize=function(_){switch(this.activeGrip){case this.grip1:this.x1=_.x,this.y1=_.y;break;case this.grip2:case void 0:this.x2=_.x,this.y2=_.y}this.adjustVisual(),this.adjustControlBox()},E.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},E.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},E.prototype.setupControlBox=function(){this.controlBox=ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},E.prototype.adjustControlBox=function(){this.positionGrips()},E.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},E.prototype.createGrip=function(){var _=new tt;return _.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(_.visual),_},E.prototype.positionGrips=function(){var _=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-_/2,this.y1-_/2),this.positionGrip(this.grip2.visual,this.x2-_/2,this.y2-_/2)},E.prototype.positionGrip=function(_,z,Q){var Y=_.transform.baseVal.getItem(0);Y.setTranslate(z,Q),_.transform.baseVal.replaceItem(Y,0)},E.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},G.prototype.getState.call(this))},E.prototype.restoreState=function(_){G.prototype.restoreState.call(this,_);var z=_;this.x1=z.x1,this.y1=z.y1,this.x2=z.x2,this.y2=z.y2},E.prototype.scale=function(_,z){G.prototype.scale.call(this,_,z),this.x1=this.x1*_,this.y1=this.y1*z,this.x2=this.x2*_,this.y2=this.y2*z,this.adjustVisual(),this.adjustControlBox()},E}(He),Ve=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.strokeColor=Q.defaultColor,Y.strokeWidth=Q.defaultStrokeWidth,Y.strokeDasharray=Q.defaultStrokeDasharray,Y.strokePanel=new Ue("Line color",Q.defaultColorSet,Q.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new pt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new mt("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return me(E,G),E.prototype.ownsTarget=function(_){return!(!G.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorLine&&_!==this.visibleLine)},E.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.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)},E.prototype.pointerDown=function(_,z){G.prototype.pointerDown.call(this,_,z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},E.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()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},E.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},E.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},E.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},G.prototype.getState.call(this));return _.typeName=E.typeName,_},E.prototype.restoreState=function(_){G.prototype.restoreState.call(this,_);var z=_;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.createVisual(),this.adjustVisual()},E.typeName="LineMarker",E.title="Line marker",E.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',E}(We),Ne=function(G){function E(_,z,Q,Y){var Re=G.call(this,_,Y||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Re.fonts=[],Re.fontBoxes=[],Re.fonts=z,Re.currentFont=Q,Re.setCurrentFont=Re.setCurrentFont.bind(Re),Re}return me(E,G),E.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.flexGrow="2",this.fonts.forEach(function(Q){var Y=document.createElement("div");Y.style.display="inline-block",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/_.fonts.length-5+"%",Y.style.borderColor=Q===_.currentFont?_.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){_.setCurrentFont(Q,Y)}),z.appendChild(Y);var Re=document.createElement("div");Re.style.display="flex",Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.fontFamily=Q,Re.style.overflow="hidden";var et=document.createElement("div");et.style.whiteSpace="nowrap",et.style.overflow="hidden",et.style.textOverflow="ellipsis",et.innerHTML="The quick brown fox jumps over the lazy dog",Re.appendChild(et),Y.appendChild(Re),_.fontBoxes.push(Y)}),z},E.prototype.setCurrentFont=function(_,z){var Q=this;this.currentFont=_,this.fontBoxes.forEach(function(Y){Y.style.borderColor=Y===z?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},E}(Me),Ke=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.color="transparent",Y.padding=5,Y.DEFAULT_TEXT="your text here",Y.text=Y.DEFAULT_TEXT,Y.isMoved=!1,Y.color=Q.defaultColor,Y.fontFamily=Q.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setColor=Y.setColor.bind(Y),Y.setFont=Y.setFont.bind(Y),Y.renderText=Y.renderText.bind(Y),Y.sizeText=Y.sizeText.bind(Y),Y.textEditDivClicked=Y.textEditDivClicked.bind(Y),Y.showTextEditor=Y.showTextEditor.bind(Y),Y.setSize=Y.setSize.bind(Y),Y.positionTextEditor=Y.positionTextEditor.bind(Y),Y.colorPanel=new Ue("Color",Q.defaultColorSet,Q.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.fontFamilyPanel=new Ne("Font",Q.defaultFontFamilies,Q.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y}return me(E,G),E.prototype.ownsTarget=function(_){if(G.prototype.ownsTarget.call(this,_)||_===this.visual||_===this.textElement||_===this.bgRectangle)return!0;var z=!1;return this.textElement.childNodes.forEach(function(Q){Q===_&&(z=!0)}),z},E.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},E.prototype.pointerDown=function(_,z){G.prototype.pointerDown.call(this,_,z),this.isMoved=!1,this.pointerDownPoint=_,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},E.prototype.renderText=function(){var _=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(z){_.textElement.appendChild(ce.createTSpan(z.trim()===""?" ":z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},E.prototype.getTextScale=function(){var _=this.textElement.getBBox(),z=1;if(_.width>0&&_.height>0){var Q=(1*this.width-this.width*this.padding*2/100)/_.width,Y=(1*this.height-this.height*this.padding*2/100)/_.height;z=Math.min(Q,Y)}return z},E.prototype.getTextPosition=function(_){var z=this.textElement.getBBox(),Q=0,Y=0;return z.width>0&&z.height>0&&(Q=(this.width-z.width*_)/2,Y=this.height/2-z.height*_/2),{x:Q,y:Y}},E.prototype.sizeText=function(){var _=this.textElement.getBBox(),z=this.getTextScale(),Q=this.getTextPosition(z);Q.y-=_.y*z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Q.x+"px, "+Q.y+"px) scale("+z+", "+z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Q.x,Q.y),this.textElement.transform.baseVal.getItem(1).setScale(z,z))},E.prototype.manipulate=function(_){G.prototype.manipulate.call(this,_),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(_.x-this.pointerDownPoint.x)>5||Math.abs(_.y-this.pointerDownPoint.y)>5)},E.prototype.resize=function(_){G.prototype.resize.call(this,_),this.isMoved=!0,this.setSize(),this.sizeText()},E.prototype.setSize=function(){G.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},E.prototype.pointerUp=function(_){var z=this.state;z==="creating"&&(this._suppressMarkerCreateEvent=!0),G.prototype.pointerUp.call(this,_),this.setSize(),(z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},E.prototype.showTextEditor=function(){var _=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(z){z.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var z=Number.parseFloat(_.textEditor.style.fontSize);_.textEditor.clientWidth>=Number.parseInt(_.textEditor.style.maxWidth)&&z>.9;)z-=.1,_.textEditor.style.fontSize=Math.max(z,.9)+"em"}),this.textEditor.addEventListener("keyup",function(z){z.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(z){if(z.clipboardData){var Q=z.clipboardData.getData("text"),Y=window.getSelection();if(!Y.rangeCount)return!1;Y.deleteFromDocument(),Y.getRangeAt(0).insertNode(document.createTextNode(Q)),z.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){_.textEditDivClicked(_.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},E.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var _=this.getTextScale(),z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Q=this.textElement.getBBox(),Y={x:Q.width*_,y:Q.height*_};z.x-=Y.x/2,z.y-=Y.y/2,this.textEditor.style.top=z.y+"px",this.textEditor.style.left=z.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-z.x+"px",this.textEditor.style.fontSize=Math.max(16*_,12)+"px",this.textElement.style.display="none"}},E.prototype.textEditDivClicked=function(_){this.text=_.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},E.prototype.select=function(){G.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},E.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),G.prototype.deselect.call(this)},E.prototype.dblClick=function(_,z){G.prototype.dblClick.call(this,_,z),this.showTextEditor()},E.prototype.setColor=function(_){this.textElement&&ce.setAttributes(this.textElement,[["fill",_]]),this.color=_,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(_)},E.prototype.setFont=function(_){this.textElement&&ce.setAttributes(this.textElement,[["font-family",_]]),this.fontFamily=_,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},E.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},E.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},G.prototype.getState.call(this));return _.typeName=E.typeName,_},E.prototype.restoreState=function(_){var z=_;this.color=z.color,this.fontFamily=z.fontFamily,this.padding=z.padding,this.text=z.text,this.createVisual(),G.prototype.restoreState.call(this,_),this.setSize()},E.prototype.scale=function(_,z){G.prototype.scale.call(this,_,z),this.setSize(),this.sizeText(),this.positionTextEditor()},E.typeName="TextMarker",E.title="Text marker",E.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',E}(st),we=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.color="transparent",Y.lineWidth=3,Y.drawing=!1,Y.pixelRatio=1,Y.color=Q.defaultColor,Y.lineWidth=Q.defaultStrokeWidth,Y.pixelRatio=Q.freehandPixelRatio,Y.setColor=Y.setColor.bind(Y),Y.addCanvas=Y.addCanvas.bind(Y),Y.finishCreation=Y.finishCreation.bind(Y),Y.setLineWidth=Y.setLineWidth.bind(Y),Y.colorPanel=new Ue("Color",Q.defaultColorSet,Q.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.lineWidthPanel=new pt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),Y.lineWidthPanel.onWidthChanged=Y.setLineWidth,Y}return me(E,G),E.prototype.ownsTarget=function(_){return!(!G.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.drawingImage)},E.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var _=ce.createTransform();this.visual.transform.baseVal.appendItem(_),this.addMarkerVisualToContainer(this.visual)},E.prototype.pointerDown=function(_,z){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(_.x,_.y),this.drawing=!0):G.prototype.pointerDown.call(this,_,z)},E.prototype.manipulate=function(_){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(_.x,_.y),this.canvasContext.stroke()):G.prototype.manipulate.call(this,_)},E.prototype.resize=function(_){G.prototype.resize.call(this,_),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},E.prototype.pointerUp=function(_){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):G.prototype.pointerUp.call(this,_)},E.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)},E.prototype.select=function(){this.state==="creating"&&this.finishCreation(),G.prototype.select.call(this)},E.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),G.prototype.deselect.call(this)},E.prototype.finishCreation=function(){for(var _=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Q=z[0],Y=z[1],Re=z[2],et=z[3],yt=!1,_t=0;_t<this.canvasElement.height;_t++)for(var it=0;it<this.canvasElement.width;it++)_.data[_t*this.canvasElement.width*4+4*it+3]>0&&(yt=!0,_t<Y&&(Y=_t),it<Q&&(Q=it),_t>et&&(et=_t),it>Re&&(Re=it));if(yt){this.left=Q/this.pixelRatio,this.top=Y/this.pixelRatio,this.width=(Re-Q)/this.pixelRatio,this.height=(et-Y)/this.pixelRatio;var Kt=document.createElement("canvas");Kt.width=Re-Q,Kt.height=et-Y,Kt.getContext("2d").putImageData(this.canvasContext.getImageData(Q,Y,Re-Q,et-Y),0,0),this.drawingImgUrl=Kt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},E.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},E.prototype.setColor=function(_){this.color=_,this.colorChanged(_)},E.prototype.setLineWidth=function(_){this.lineWidth=_},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=Object.assign({drawingImgUrl:this.drawingImgUrl},G.prototype.getState.call(this));return _.typeName=E.typeName,_},E.prototype.restoreState=function(_){this.createVisual(),G.prototype.restoreState.call(this,_),this.drawingImgUrl=_.drawingImgUrl,this.setDrawingImage()},E.prototype.scale=function(_,z){G.prototype.scale.call(this,_,z),this.setDrawingImage()},E.typeName="FreehandMarker",E.title="Freehand marker",E.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',E}(st),ye=function(G){function E(_,z,Q){var Y=G.call(this,_,Q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Y.typeBoxes=[],Y.currentType=z,Y.setCurrentType=Y.setCurrentType.bind(Y),Y}return me(E,G),E.prototype.getUi=function(){var _=this,z=document.createElement("div");z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2";for(var Q=function(et){var yt="both";switch(et){case 0:yt="both";break;case 1:yt="start";break;case 2:yt="end";break;case 3:yt="none"}var _t=document.createElement("div");if(_t.style.display="flex",_t.style.flexGrow="2",_t.style.alignItems="center",_t.style.justifyContent="space-between",_t.style.padding="5px",_t.style.borderWidth="2px",_t.style.borderStyle="solid",_t.style.borderColor=yt===Y.currentType?Y.uiStyleSettings.toolboxAccentColor:"transparent",_t.addEventListener("click",function(){_.setCurrentType(yt,_t)}),z.appendChild(_t),yt==="both"||yt==="start"){var it=document.createElement("div");it.style.display="flex",it.style.alignItems="center",it.style.minHeight="20px",it.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,it.style.marginLeft="5px",_t.appendChild(it)}var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.alignItems="center",Kt.style.minHeight="20px",Kt.style.flexGrow="2";var Bt=document.createElement("hr");if(Bt.style.minWidth="20px",Bt.style.border="0px",Bt.style.borderTop="3px solid "+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee"),Bt.style.flexGrow="2",Kt.appendChild(Bt),_t.appendChild(Kt),yt==="both"||yt==="end"){var gr=document.createElement("div");gr.style.display="flex",gr.style.alignItems="center",gr.style.minHeight="20px",gr.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,gr.style.marginRight="5px",_t.appendChild(gr)}Y.typeBoxes.push(_t)},Y=this,Re=0;Re<4;Re++)Q(Re);return z},E.prototype.setCurrentType=function(_,z){var Q=this;this.currentType=_,this.typeBoxes.forEach(function(Y){Y.style.borderColor=Y===z?Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},E}(Me),ge=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.arrowType="end",Y.arrowBaseHeight=10,Y.arrowBaseWidth=10,Y.getArrowPoints=Y.getArrowPoints.bind(Y),Y.setArrowType=Y.setArrowType.bind(Y),Y.arrowTypePanel=new ye("Arrow type","end"),Y.arrowTypePanel.onArrowTypeChanged=Y.setArrowType,Y}return me(E,G),E.prototype.ownsTarget=function(_){return!(!G.prototype.ownsTarget.call(this,_)&&_!==this.arrow1&&_!==this.arrow2)},E.prototype.getArrowPoints=function(_,z){var Q=this.arrowBaseWidth+2*this.strokeWidth,Y=this.arrowBaseHeight+2*this.strokeWidth;return _-Q/2+","+(z+Y/2)+" "+_+","+(z-Y/2)+" "+(_+Q/2)+","+(z+Y/2)},E.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},E.prototype.pointerDown=function(_,z){G.prototype.pointerDown.call(this,_,z),this.state==="creating"&&this.createTips()},E.prototype.adjustVisual=function(){if(G.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.arrow1.transform.baseVal.getItem(0);z.setRotate(_,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(z,0);var Q=this.arrow2.transform.baseVal.getItem(0);Q.setRotate(_+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Q,0)}},E.prototype.setArrowType=function(_){this.arrowType=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=Object.assign({arrowType:this.arrowType},G.prototype.getState.call(this));return _.typeName=E.typeName,_},E.prototype.restoreState=function(_){G.prototype.restoreState.call(this,_);var z=_;this.arrowType=z.arrowType,this.createTips(),this.adjustVisual()},E.typeName="ArrowMarker",E.title="Arrow marker",E.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',E}(Ve),ae=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.fillColor=Q.defaultFillColor,Y.strokeWidth=0,Y.fillPanel=new Ue("Color",Q.defaultColorSet,Q.defaultFillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y}return me(E,G),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=G.prototype.getState.call(this);return _.typeName=E.typeName,_},E.typeName="CoverMarker",E.title="Cover marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',E}(nt),re=function(G){function E(_,z,Q,Y){var Re=G.call(this,_,Y||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Re.opacities=[],Re.opacityBoxes=[],Re.opacities=z,Re.currentOpacity=Q,Re.setCurrentOpacity=Re.setCurrentOpacity.bind(Re),Re}return me(E,G),E.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",z.style.justifyContent="space-between",this.opacities.forEach(function(Q){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="center",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=Q===_.currentOpacity?_.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){_.setCurrentOpacity(Q,Y)}),z.appendChild(Y);var Re=document.createElement("div");Re.innerText=100*Q+"%",Y.appendChild(Re),_.opacityBoxes.push(Y)}),z},E.prototype.setCurrentOpacity=function(_,z){var Q=this;this.currentOpacity=_,this.opacityBoxes.forEach(function(Y){Y.style.borderColor=Y===z?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},E}(Me),be=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.setOpacity=Y.setOpacity.bind(Y),Y.fillColor=Q.defaultHighlightColor,Y.strokeWidth=0,Y.opacity=Q.defaultHighlightOpacity,Y.fillPanel=new Ue("Color",Q.defaultColorSet,Y.fillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y.opacityPanel=new re("Opacity",Q.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return me(E,G),E.prototype.setOpacity=function(_){this.opacity=_,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=G.prototype.getState.call(this);return _.typeName=E.typeName,_},E.typeName="HighlightMarker",E.title="Highlight marker",E.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',E}(ae),Ce='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Ie=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.bgColor="transparent",Y.tipPosition={x:0,y:0},Y.tipBase1Position={x:0,y:0},Y.tipBase2Position={x:0,y:0},Y.tipMoving=!1,Y.color=Q.defaultStrokeColor,Y.bgColor=Q.defaultFillColor,Y.fontFamily=Q.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setBgColor=Y.setBgColor.bind(Y),Y.getTipPoints=Y.getTipPoints.bind(Y),Y.positionTip=Y.positionTip.bind(Y),Y.setTipPoints=Y.setTipPoints.bind(Y),Y.colorPanel=new Ue("Text color",Q.defaultColorSet,Y.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),Y.colorPanel.onColorChanged=Y.setColor,Y.bgColorPanel=new Ue("Fill color",Q.defaultColorSet,Y.bgColor,Ce),Y.bgColorPanel.onColorChanged=Y.setBgColor,Y.fontFamilyPanel=new Ne("Font",Q.defaultFontFamilies,Q.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y.tipGrip=new tt,Y.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),Y.controlBox.appendChild(Y.tipGrip.visual),Y}return me(E,G),E.prototype.ownsTarget=function(_){return G.prototype.ownsTarget.call(this,_)||this.tipGrip.ownsTarget(_)||this.tip===_},E.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},E.prototype.pointerDown=function(_,z){this.state==="new"&&G.prototype.pointerDown.call(this,_,z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):G.prototype.pointerDown.call(this,_,z)},E.prototype.pointerUp=function(_){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,G.prototype.pointerUp.call(this,_);else{var z=this.state==="creating";G.prototype.pointerUp.call(this,_),this.setTipPoints(z),this.positionTip()}},E.prototype.manipulate=function(_){if(this.tipMoving){var z=this.unrotatePoint(_);this.tipPosition={x:z.x-this.manipulationStartLeft,y:z.y-this.manipulationStartTop},this.positionTip()}else G.prototype.manipulate.call(this,_)},E.prototype.setBgColor=function(_){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",_]]),ce.setAttributes(this.tip,[["fill",_]])),this.bgColor=_,this.fillColorChanged(_)},E.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},E.prototype.setTipPoints=function(_){_===void 0&&(_=!1);var z=Math.min(this.height/2,15),Q=this.height/5;_&&(this.tipPosition={x:z+Q/2,y:this.height+20});var Y=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Q=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:0},this.tipBase2Position={x:z+Q,y:0}):(this.tipBase1Position={x:0,y:z},this.tipBase2Position={x:0,y:z+Q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Q=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-Q,y:0},this.tipBase2Position={x:this.width-z,y:0}):(this.tipBase1Position={x:this.width,y:z},this.tipBase2Position={x:this.width,y:z+Q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Y<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Q=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-Q,y:this.height},this.tipBase2Position={x:this.width-z,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-z-Q},this.tipBase2Position={x:this.width,y:this.height-z}):Y<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Q=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:this.height},this.tipBase2Position={x:z+Q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-z},this.tipBase2Position={x:0,y:this.height-z-Q})},E.prototype.resize=function(_){G.prototype.resize.call(this,_),this.positionTip()},E.prototype.positionTip=function(){ce.setAttributes(this.tip,[["points",this.getTipPoints()]]);var _=this.tipGrip.visual.transform.baseVal.getItem(0);_.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(_,0)},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),E.prototype.select=function(){this.positionTip(),G.prototype.select.call(this)},E.prototype.getState=function(){var _=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},G.prototype.getState.call(this));return _.typeName=E.typeName,_},E.prototype.restoreState=function(_){var z=_;this.bgColor=z.bgColor,this.tipPosition=z.tipPosition,G.prototype.restoreState.call(this,_),this.createTip(),this.setTipPoints()},E.prototype.scale=function(_,z){G.prototype.scale.call(this,_,z),this.tipPosition={x:this.tipPosition.x*_,y:this.tipPosition.y*z},this.positionTip()},E.typeName="CalloutMarker",E.title="Callout marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',E}(Ke),De=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.strokeColor=Q.defaultColor,Y.strokeWidth=Q.defaultStrokeWidth,Y.strokeDasharray=Q.defaultStrokeDasharray,Y.fillColor=Q.defaultFillColor,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.setOpacity=Y.setOpacity.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y.strokePanel=new Ue("Line color",se(Q.defaultColorSet,["transparent"]),Q.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.fillPanel=new Ue("Fill color",se(Q.defaultColorSet,["transparent"]),Y.fillColor,Ce),Y.fillPanel.onColorChanged=Y.setFillColor,Y.strokeWidthPanel=new pt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new mt("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y.opacityPanel=new re("Opacity",Q.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return me(E,G),E.prototype.ownsTarget=function(_){return!(!G.prototype.ownsTarget.call(this,_)&&_!==this.visual)},E.prototype.createVisual=function(){this.visual=ce.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},E.prototype.pointerDown=function(_,z){G.prototype.pointerDown.call(this,_,z),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},E.prototype.manipulate=function(_){G.prototype.manipulate.call(this,_)},E.prototype.resize=function(_){G.prototype.resize.call(this,_),this.setSize()},E.prototype.setSize=function(){G.prototype.setSize.call(this),ce.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},E.prototype.pointerUp=function(_){G.prototype.pointerUp.call(this,_),this.setSize()},E.prototype.setStrokeColor=function(_){this.strokeColor=_,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},E.prototype.setFillColor=function(_){this.fillColor=_,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(_),this.stateChanged()},E.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},E.prototype.setOpacity=function(_){this.opacity=_,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this));return _.typeName=E.typeName,_},E.prototype.restoreState=function(_){var z=_;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),G.prototype.restoreState.call(this,_),this.setSize()},E.prototype.scale=function(_,z){G.prototype.scale.call(this,_,z),this.setSize()},E.typeName="EllipseMarker",E.title="Ellipse marker",E.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',E}(st),Ge=function(G){function E(_,z,Q){return G.call(this,_,z,Q)||this}return me(E,G),Object.defineProperty(E.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),E.prototype.ownsTarget=function(_){return!(!G.prototype.ownsTarget.call(this,_)&&_!==this.tip1&&_!==this.tip2)},E.prototype.createTips=function(){this.tip1=ce.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ce.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.tip2)},E.prototype.pointerDown=function(_,z){G.prototype.pointerDown.call(this,_,z),this.state==="creating"&&this.createTips()},E.prototype.adjustVisual=function(){if(G.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ce.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.tip1.transform.baseVal.getItem(0);z.setRotate(_,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(z,0);var Q=this.tip2.transform.baseVal.getItem(0);Q.setRotate(_+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Q,0)}},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=G.prototype.getState.call(this);return _.typeName=E.typeName,_},E.prototype.restoreState=function(_){G.prototype.restoreState.call(this,_),this.createTips(),this.adjustVisual()},E.typeName="MeasurementMarker",E.title="Measurement marker",E.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',E}(Ve),Qe=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.strokePanel.colors=Q.defaultColorSet,Y.fillColor="transparent",Y}return me(E,G),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=G.prototype.getState.call(this);return _.typeName=E.typeName,_},E.typeName="EllipseFrameMarker",E.title="Ellipse frame marker",E.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',E}(De),dt=function(){function G(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),G.prototype.addUndoStep=function(E){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(E)||(this.undoStack.push(E),JSON.stringify(this.lastRedoStep)!==JSON.stringify(E)&&this.redoStack.splice(0,this.redoStack.length))},G.prototype.replaceLastUndoStep=function(E){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=E)},G.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},G.prototype.undo=function(){if(this.undoStack.length>1){var E=this.undoStack.pop();return E!==void 0&&this.redoStack.push(E),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},G.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},G}(),rt=function(G){function E(_,z,Q){var Y=G.call(this,_,z,Q)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.curveX=0,Y.curveY=0,Y.manipulationStartCurveX=0,Y.manipulationStartCurveY=0,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.positionGrips=Y.positionGrips.bind(Y),Y.addControlGrips=Y.addControlGrips.bind(Y),Y.adjustVisual=Y.adjustVisual.bind(Y),Y.setupControlBox=Y.setupControlBox.bind(Y),Y.resize=Y.resize.bind(Y),Y.strokeColor=Q.defaultColor,Y.strokeWidth=Q.defaultStrokeWidth,Y.strokeDasharray=Q.defaultStrokeDasharray,Y.strokePanel=new Ue("Line color",Q.defaultColorSet,Q.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new pt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new mt("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return me(E,G),E.prototype.ownsTarget=function(_){return!(!G.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorCurve&&_!==this.visibleCurve&&!this.curveGrip.ownsTarget(_))},E.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},E.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.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)},E.prototype.pointerDown=function(_,z){G.prototype.pointerDown.call(this,_,z),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=_.x,this.curveY=_.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(z)&&(this.activeGrip=this.curveGrip,this._state="resize")},E.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},E.prototype.setupControlBox=function(){G.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.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)},E.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,G.prototype.addControlGrips.call(this)},E.prototype.positionGrips=function(){G.prototype.positionGrips.call(this);var _=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-_/2,this.curveY-_/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()))},E.prototype.manipulate=function(_){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+_.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+_.y-this.manipulationStartY),G.prototype.manipulate.call(this,_)},E.prototype.resize=function(_){this.activeGrip===this.curveGrip&&(this.curveX=_.x,this.curveY=_.y),G.prototype.resize.call(this,_),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},E.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},E.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},E.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual()},E.prototype.scale=function(_,z){this.curveX=this.curveX*_,this.curveY=this.curveY*z,G.prototype.scale.call(this,_,z)},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},G.prototype.getState.call(this));return _.typeName=E.typeName,_},E.prototype.restoreState=function(_){G.prototype.restoreState.call(this,_);var z=_;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.curveX=z.curveX,this.curveY=z.curveY,this.createVisual(),this.adjustVisual()},E.typeName="CurveMarker",E.title="Curve marker",E.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',E}(We),ht=function(){function G(E,_){_===void 0&&(_=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=E,this.cancelable=_}return Object.defineProperty(G.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),G.prototype.preventDefault=function(){this._defaultPrevented=!0},G}(),ft=function(G){function E(_,z,Q){var Y=G.call(this,_,!1)||this;return Y.dataUrl=z,Y.state=Q,Y}return me(E,G),E}(ht),at=function(G){function E(_,z,Q){Q===void 0&&(Q=!1);var Y=G.call(this,_,Q)||this;return Y.marker=z,Y}return me(E,G),E}(ht),Dt=function(){function G(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return G.prototype.addEventListener=function(E,_){this[E].push(_)},G.prototype.removeEventListener=function(E,_){var z=this[E].indexOf(_);z>-1&&this[E].splice(z,1)},G}(),Lt=function(){function G(E){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Le,this._isOpen=!1,this.undoRedoManager=new dt,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 Dt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=G.instanceCounter++,this.styles=new ve(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=E,this.targetRoot=document.body,this.width=E.clientWidth,this.height=E.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(G.prototype,"ALL_MARKER_TYPES",{get:function(){return[ke,we,ge,Ke,Qe,De,be,Ie,Ge,ae,Ve,rt]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ke,we,ge,Ke,De,be,Ie]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ke,we,ge,Ke,be]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(E){var _=this;this._availableMarkerTypes.splice(0),E.forEach(function(z){if(typeof z=="string"){var Q=_.ALL_MARKER_TYPES.find(function(Y){return Y.typeName===z});Q!==void 0&&_._availableMarkerTypes.push(Q)}else _._availableMarkerTypes.push(z)})},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(E){this._zoomLevel=E,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),G.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Z.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},G.prototype.show=function(){var E=this;this.styles.styleSheetRoot===void 0&&le.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=le.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(_){return _(new ht(E))})},G.prototype.render=function(){return de(this,void 0,void 0,function(){var E;return pe(this,function(_){switch(_.label){case 0:return this.setCurrentMarker(),(E=new te).naturalSize=this.renderAtNaturalSize,E.imageType=this.renderImageType,E.imageQuality=this.renderImageQuality,E.markersOnly=this.renderMarkersOnly,E.width=this.renderWidth,E.height=this.renderHeight,[4,E.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return _.sent(),[4,E.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,_.sent()]}})})},G.prototype.close=function(E){var _=this;if(E===void 0&&(E=!1),this.isOpen){var z=!1;E||this.eventListeners.beforeclose.forEach(function(Q){var Y=new ht(_,!0);Q(Y),Y.defaultPrevented&&(z=!0)}),z||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(Q){return Q(new ht(_))}),this.detachEvents(),this._isOpen=!1)}},G.prototype.addMarkersToToolbar=function(){for(var E,_=[],z=0;z<arguments.length;z++)_[z]=arguments[z];(E=this._availableMarkerTypes).push.apply(E,_)},G.prototype.addRenderEventListener=function(E){this.addEventListener("render",function(_){E(_.dataUrl,_.state)})},G.prototype.removeRenderEventListener=function(E){},G.prototype.addCloseEventListener=function(E){this.addEventListener("close",function(){E()})},G.prototype.removeCloseEventListener=function(E){},G.prototype.setupResizeObserver=function(){var E=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){E.resize(E.target.clientWidth,E.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return E.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},G.prototype.onPopupTargetResize=function(){var E=1*this.target.clientWidth/this.target.clientHeight,_=this.editorCanvas.clientWidth/E>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*E:this.editorCanvas.clientWidth,z=_<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/E;this.resize(_,z)},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.prototype.resize=function(E,_){this._isResizing=!0;var z=E/this.imageWidth,Q=_/this.imageHeight;this.imageWidth=Math.round(E),this.imageHeight=Math.round(_),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(z,Q),this._isResizing=!1},G.prototype.scaleMarkers=function(E,_){var z,Q=this;this._currentMarker&&this._currentMarker instanceof Ke?this._currentMarker.scale(E,_):(z=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Y){Y!==Q._currentMarker&&Y.scale(E,_)}),z!==void 0&&this.setCurrentMarker(z)},G.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},G.prototype.setTopLeft=function(){var E=this.editingTarget.getBoundingClientRect(),_=this.editorCanvas.getBoundingClientRect();this.left=E.left-_.left,this.top=E.top-_.top},G.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},G.prototype.addDefs=function(){for(var E,_=[],z=0;z<arguments.length;z++)_[z]=arguments[z];this.defs=ce.createDefs(),this.addDefsToImage(),(E=this.defs).append.apply(E,_)},G.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},G.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},G.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},G.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},G.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},G.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},G.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},G.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var E=document.createElement("a");E.href="https://markerjs.com/",E.target="_blank",E.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',E.title="Powered by marker.js",E.style.display="grid",E.style.alignItems="center",E.style.justifyItems="center",E.style.padding="3px",E.style.width="20px",E.style.height="20px",this.logoUI.appendChild(E),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},G.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},G.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var E=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=E+"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 xe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new _e(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},G.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.removeMarker=function(E){this.markerImage.removeChild(E.container),this.markers.indexOf(E)>-1&&this.markers.splice(this.markers.indexOf(E),1),E.dispose()},G.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},G.prototype.toolbarButtonClicked=function(E,_){if(E==="marker"&&_!==void 0)this.createNewMarker(_);else if(E==="action")switch(_){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},G.prototype.deleteSelectedMarker=function(){var E=this;if(this._currentMarker!==void 0){var _=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Q){var Y=new at(E,E._currentMarker,!0);Q(Y),Y.defaultPrevented&&(_=!0)}),!_){var z=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(Q){return Q(new at(E,z))})}}},G.prototype.clear=function(){var E=this,_=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Re){var et=new at(E,void 0,!0);Re(et),et.defaultPrevented&&(_=!0)}),!_)){this.setCurrentMarker();for(var z=function(Re){var et=Q.markers[Re];Q.setCurrentMarker(Q.markers[Re]),Q._currentMarker.dispose(),Q.markerImage.removeChild(Q._currentMarker.container),Q.markers.splice(Q.markers.indexOf(Q._currentMarker),1),Q.eventListeners.markerdelete.forEach(function(yt){return yt(new at(E,et))})},Q=this,Y=this.markers.length-1;Y>=0;Y--)z(Y);this.addUndoStep()}},Object.defineProperty(G.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),G.prototype.showNotesEditor=function(){var E;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=(E=this._currentMarker.notes)!==null&&E!==void 0?E:"",this.overlayContainer.appendChild(this.notesArea))},G.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},G.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},G.prototype.addUndoStep=function(){var E=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var _=this.getState(),z=this.undoRedoManager.getLastUndoStep();if(!z||z.width===_.width&&z.height===_.height){var Q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(_),Q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Y){return Y(new ht(E))})}else this.undoRedoManager.replaceLastUndoStep(_),this.eventListeners.statechange.forEach(function(Y){return Y(new ht(E))})}},G.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},G.prototype.undoStep=function(){var E=this,_=this.undoRedoManager.undo();_!==void 0&&(this.restoreState(_),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new ht(E))}))},G.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},G.prototype.redoStep=function(){var E=this,_=this.undoRedoManager.redo();_!==void 0&&(this.restoreState(_),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new ht(E))}))},G.prototype.stepZoom=function(){var E=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=E<this.zoomSteps.length-1?this.zoomSteps[E+1]:this.zoomSteps[0]},G.prototype.panTo=function(E){this.contentDiv.scrollBy({left:this.prevPanPoint.x-E.x,top:this.prevPanPoint.y-E.y}),this.prevPanPoint=E},G.prototype.startRenderAndClose=function(){return de(this,void 0,void 0,function(){var E,_,z=this;return pe(this,function(Q){switch(Q.label){case 0:return[4,this.render()];case 1:return E=Q.sent(),_=this.getState(),this.eventListeners.render.forEach(function(Y){return Y(new ft(z,E,_))}),this.close(!0),[2]}})})},G.prototype.getState=function(E){E===!0&&this.setCurrentMarker();var _={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(z){return _.markers.push(z.getState())}),_},G.prototype.restoreState=function(E){var _=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);E.markers.forEach(function(z){var Q=_._availableMarkerTypes.find(function(Re){return Re.typeName===z.typeName});if(Q!==void 0){var Y=_.addNewMarker(Q);Y.restoreState(z),_.markers.push(Y)}}),E.width&&E.height&&(E.width!==this.imageWidth||E.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/E.width,this.imageHeight/E.height),this.eventListeners.restorestate.forEach(function(z){return z(new ht(_))})},G.prototype.addNewMarker=function(E){var _=ce.createGroup();return this.markerImage.appendChild(_),new E(_,this.overlayContainer,this.settings)},G.prototype.createNewMarker=function(E){var _,z=this;(_=typeof E=="string"?this._availableMarkerTypes.find(function(Q){return Q.typeName===E}):E)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(_),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(_.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(Q){return Q(new at(z,z._currentMarker))}))},G.prototype.markerCreated=function(E){var _=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(E),this.setCurrentMarker(E),E instanceof we&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(we):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(z){return z(new at(_,_._currentMarker))})},G.prototype.colorChanged=function(E){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=E,this.settings.defaultStrokeColor=E)},G.prototype.fillColorChanged=function(E){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=E)},G.prototype.markerStateChanged=function(E){var _=this;this.eventListeners.markerchange.forEach(function(z){return z(new at(_,E))})},G.prototype.setCurrentMarker=function(E){var _=this;this._currentMarker!==E&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(z){return z(new at(_,_._currentMarker))})),this._currentMarker=E,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(z){return z(new at(_,_._currentMarker))}))},G.prototype.onPointerDown=function(E){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||E.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var _=this.markers.find(function(z){return z.ownsTarget(E.target)});_!==void 0?(this.setCurrentMarker(_),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(E.clientX,E.clientY),E.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:E.clientX,y:E.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(E.clientX,E.clientY))},G.prototype.onDblClick=function(E){if(this._isFocused||this.focus(),this.mode==="select"){var _=this.markers.find(function(z){return z.ownsTarget(E.target)});_!==void 0&&_!==this._currentMarker&&this.setCurrentMarker(_),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(E.clientX,E.clientY),E.target):this.setCurrentMarker()}},G.prototype.onPointerMove=function(E){this.touchPoints!==1&&E.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||E.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(E.clientX,E.clientY)):this.zoomLevel>1&&this.panTo({x:E.clientX,y:E.clientY}))},G.prototype.onPointerUp=function(E){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(E.clientX,E.clientY)),this.isDragging=!1,this.addUndoStep()},G.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},G.prototype.onKeyUp=function(E){this._currentMarker===void 0||this.notesArea!==void 0||E.key!=="Delete"&&E.key!=="Backspace"||this.deleteSelectedMarker()},G.prototype.clientToLocalCoordinates=function(E,_){var z=this.markerImage.getBoundingClientRect();return{x:(E-z.left)/this.zoomLevel,y:(_-z.top)/this.zoomLevel}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var E=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=E+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},G.prototype.addLicenseKey=function(E){Z.addKey(E)},G.prototype.addEventListener=function(E,_){this.eventListeners.addEventListener(E,_)},G.prototype.removeEventListener=function(E,_){this.eventListeners.removeEventListener(E,_)},G.prototype.renderState=function(E){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(E),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(G.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),G.prototype.focus=function(){var E=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(_){return _(new ht(E))}))},G.prototype.blur=function(){var E=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(_){return _(new ht(E))}))},G.instanceCounter=0,G}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Tt=function(G,E){return(Tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,z){_.__proto__=z}||function(_,z){for(var Q in z)Object.prototype.hasOwnProperty.call(z,Q)&&(_[Q]=z[Q])})(G,E)};function Rt(G,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function _(){this.constructor=G}Tt(G,E),G.prototype=E===null?Object.create(E):(_.prototype=E.prototype,new _)}function wt(G,E,_,z){return new(_||(_=Promise))(function(Q,Y){function Re(_t){try{yt(z.next(_t))}catch(it){Y(it)}}function et(_t){try{yt(z.throw(_t))}catch(it){Y(it)}}function yt(_t){var it;_t.done?Q(_t.value):(it=_t.value,it instanceof _?it:new _(function(Kt){Kt(it)})).then(Re,et)}yt((z=z.apply(G,E||[])).next())})}function Ut(G,E){var _,z,Q,Y,Re={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return Y={next:et(0),throw:et(1),return:et(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function et(yt){return function(_t){return function(it){if(_)throw new TypeError("Generator is already executing.");for(;Re;)try{if(_=1,z&&(Q=2&it[0]?z.return:it[0]?z.throw||((Q=z.return)&&Q.call(z),0):z.next)&&!(Q=Q.call(z,it[1])).done)return Q;switch(z=0,Q&&(it=[2&it[0],Q.value]),it[0]){case 0:case 1:Q=it;break;case 4:return Re.label++,{value:it[1],done:!1};case 5:Re.label++,z=it[1],it=[0];continue;case 7:it=Re.ops.pop(),Re.trys.pop();continue;default:if(!(Q=Re.trys,(Q=Q.length>0&&Q[Q.length-1])||it[0]!==6&&it[0]!==2)){Re=0;continue}if(it[0]===3&&(!Q||it[1]>Q[0]&&it[1]<Q[3])){Re.label=it[1];break}if(it[0]===6&&Re.label<Q[1]){Re.label=Q[1],Q=it;break}if(Q&&Re.label<Q[2]){Re.label=Q[2],Re.ops.push(it);break}Q[2]&&Re.ops.pop(),Re.trys.pop();continue}it=E.call(G,Re)}catch(Kt){it=[6,Kt],z=0}finally{_=Q=0}if(5&it[0])throw it[1];return{value:it[0]?it[1]:void 0,done:!0}}([yt,_t])}}}var Nt=function(){function G(){}return G.addKey=function(E){G.key=E},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),qe=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(E,_){for(var z=0,Q=_;z<Q.length;z++){var Y=Q[z],Re=Y[0],et=Y[1];E.setAttribute(Re,et)}},G.createRect=function(E,_,z){var Q=document.createElementNS("http://www.w3.org/2000/svg","rect");return Q.setAttribute("width",E.toString()),Q.setAttribute("height",_.toString()),z&&G.setAttributes(Q,z),Q},G.createLine=function(E,_,z,Q,Y){var Re=document.createElementNS("http://www.w3.org/2000/svg","line");return Re.setAttribute("x1",E.toString()),Re.setAttribute("y1",_.toString()),Re.setAttribute("x2",z.toString()),Re.setAttribute("y2",Q.toString()),Y&&G.setAttributes(Re,Y),Re},G.createPolygon=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",E),_&&G.setAttributes(z,_),z},G.createCircle=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(E/2).toString()),z.setAttribute("cy",(E/2).toString()),z.setAttribute("r",E.toString()),_&&G.setAttributes(z,_),z},G.createEllipse=function(E,_,z){var Q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Q.setAttribute("cx",(E/2).toString()),Q.setAttribute("cy",(_/2).toString()),Q.setAttribute("rx",(E/2).toString()),Q.setAttribute("ry",(_/2).toString()),z&&G.setAttributes(Q,z),Q},G.createGroup=function(E){var _=document.createElementNS("http://www.w3.org/2000/svg","g");return E&&G.setAttributes(_,E),_},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(E,_,z,Q,Y,Re,et){var yt=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(yt,[["id",E],["orient",_],["markerWidth",z.toString()],["markerHeight",Q.toString()],["refX",Y.toString()],["refY",Re.toString()]]),yt.appendChild(et),yt},G.createText=function(E){var _=document.createElementNS("http://www.w3.org/2000/svg","text");return _.setAttribute("x","0"),_.setAttribute("y","0"),E&&G.setAttributes(_,E),_},G.createTSpan=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=E,_&&G.setAttributes(z,_),z},G.createImage=function(E){var _=document.createElementNS("http://www.w3.org/2000/svg","image");return E&&G.setAttributes(_,E),_},G.createPoint=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=E,z.y=_,z},G.createPath=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",E),_&&G.setAttributes(z,_),z},G.createElement=function(E,_){var z=document.createElementNS("http://www.w3.org/2000/svg",E);return _&&G.setAttributes(z,_),z},G.getHollowRectanglePath=function(E,_,z,Q,Y,Re,et,yt){return"M"+E+","+_+"V"+(_+Q)+"H"+(E+z)+"V"+_+"H"+Y+"V"+Re+"H"+(Y+et)+"V"+(Re+yt)+"H"+Y+"V"+_+"Z"},G}(),Ze=function(){function G(E){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+E+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),G.prototype.addClass=function(E){return this.styleSheet===void 0&&this.addStyleSheet(),E.name=""+this.classNamePrefix+E.localName,this.classes.push(E),this.styleSheet.sheet.insertRule("."+E.name+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length),E},G.prototype.addRule=function(E){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(E),this.styleSheet.sheet.insertRule(E.selector+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length)},G.prototype.addStyleSheet=function(){var E;this.styleSheet=document.createElement("style"),((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).appendChild(this.styleSheet),this.addRule(new ze("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ze("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ze("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ye("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ye("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},G.prototype.removeStyleSheet=function(){var E;this.styleSheet&&(((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),ze=function(G,E){this.selector=G,this.style=E},Ye=function(G,E){this.localName=G,this.style=E},ot=function(){function G(){this.blocks=[],this.display=""}return G.prototype.addButtonBlock=function(E){E.className=this.blockClassName,E.buttonClassName=this.buttonClassName,E.buttonColorsClassName=this.buttonColorsClassName,E.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(E)},G.prototype.addElementBlock=function(E){E.className===void 0&&(E.className=this.blockClassName),this.blocks.push(E)},G.prototype.getUI=function(){var E=document.createElement("div");return E.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,E.style.display=this.display,this.blocks.forEach(function(_){return E.appendChild(_.getUI())}),E},G}(),gt=function(){function G(){}return G.prototype.getUI=function(){var E=document.createElement("div");if(E.className=this.className,this.minWidth!==void 0&&(E.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":E.style.justifyContent="flex-start";break;case"center":E.style.justifyContent="center";break;case"end":E.style.justifyContent="flex-end"}return E.style.whiteSpace="nowrap",E},G}(),Mt=function(G){function E(){var _=G!==null&&G.apply(this,arguments)||this;return _.buttons=[],_}return Rt(E,G),E.prototype.addButton=function(_){_.className=this.buttonClassName,_.colorsClassName=this.buttonColorsClassName,_.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(_)},E.prototype.getUI=function(){var _=G.prototype.getUI.call(this);return this.buttons.forEach(function(z){return _.appendChild(z.getUI())}),_},E}(gt),Et=function(){function G(E,_){this._isActive=!1,this._isHidden=!1,this._icon=E,this.title=_,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(G.prototype,"icon",{get:function(){return this._icon},set:function(E){this._icon=E,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isActive",{get:function(){return this._isActive},set:function(E){this._isActive=E,this.adjustClassName()},enumerable:!1,configurable:!0}),G.prototype.getUI=function(){var E=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return E.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},G.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},G.prototype.hide=function(){this._isHidden=!0},G}(),lt=function(G){function E(){var _=G!==null&&G.apply(this,arguments)||this;return _.elements=[],_}return Rt(E,G),E.prototype.addElement=function(_){this.elements.push(_)},E.prototype.getUI=function(){var _=G.prototype.getUI.call(this);return this.elements.forEach(function(z){return _.appendChild(z)}),_},E}(gt),Jt=function(){function G(E,_){this.horizontal=E,this.vertical=_}return Object.defineProperty(G.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),G.prototype.getVerticalLength=function(E){return E/this.ratio},G.prototype.getHorizontalLength=function(E){return E*this.ratio},G}(),vr=function(){function G(){}return G.getIcon=function(E,_){if(E>0&&_>0){var z=new Jt(E,_),Q=z.ratio>=1?20:z.getHorizontalLength(20),Y=z.ratio<1?20:z.getVerticalLength(20),Re=document.createElementNS("http://www.w3.org/2000/svg","svg");Re.setAttribute("xmlns","http://www.w3.org/2000/svg"),Re.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Re);var et=qe.createDefs();Re.appendChild(et);var yt=qe.createElement("clipPath",[["id","text-bg-clip"]]);et.appendChild(yt);var _t=qe.createPath(qe.getHollowRectanglePath((24-Q)/2,(24-Y)/2,Q,Y,(24-Q)/2+2,(24-Y)/2+2,Q-4,Y-4));Re.appendChild(_t);var it=qe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);it.appendChild(qe.createTSpan(E+":"+_)),Re.appendChild(it);var Kt=it.getBBox();qe.setAttributes(it,[["x",((24-Kt.width)/2).toString()],["y",((24-Kt.height)/2-Kt.y).toString()]]);var Bt=qe.createPath(qe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Kt.width))/2,(24-Math.ceil(Kt.height))/2,Math.ceil(Kt.width),Math.ceil(Kt.height)));return yt.appendChild(Bt),qe.setAttributes(_t,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Re),Re.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},G}(),$t=function(G){function E(_,z,Q){var Y=G.call(this,_,z)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=Q,Y}return Rt(E,G),E.prototype.setupDropdown=function(){var _=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(z){z.className=_.className,z.colorsClassName=_.colorsClassName,_.dropdownBlock.appendChild(z.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},E.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},E.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},E.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},E.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},E.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},E}(Et),vt=function(){function G(E,_){this.GRIP_SIZE=10,this.color=E,this.fillColor=_,this.visual=qe.createGroup(),this.visual.appendChild(qe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(qe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(E){return E===this.visual||E===this.visual.childNodes[0]||E===this.visual.childNodes[1]},G.prototype.setCenter=function(E,_){this.visual.childNodes.forEach(function(z){return qe.setAttributes(z,[["cx",E.toString()],["cy",_.toString()]])})},G}(),zt=function(){function G(E,_,z,Q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=E,this.canvasHeight=_,this.margin=z,this.container=Q,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(G.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(E){this._aspectRatio=E,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(E){this._isGridVisible=E,this.gridContainer&&qe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(E){this._zoomFactor=E,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),G.prototype.open=function(){var E=this;this.cropShadeElement=qe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=qe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var _=0;_<this.numberOfGridLines;_++)this.horizontalGridLines.push(qe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(qe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(z){return E.gridContainer.appendChild(z)}),this.verticalGridLines.forEach(function(z){return E.gridContainer.appendChild(z)}),this.cropRectElement=qe.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new vt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new vt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new vt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new vt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},G.prototype.setCropRectangle=function(E){this.cropRect=E;var _=Object.assign({},this.cropRect);this.zoomFactor!==1&&(_.width=this.cropRect.width*this.zoomFactor,_.height=this.cropRect.height*this.zoomFactor,_.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-_.width/2,_.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-_.height/2),qe.setAttributes(this.cropRectElement,[["x",_.x.toString()],["y",_.y.toString()],["width",_.width.toString()],["height",_.height.toString()]]);var z=_.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,Re){var et=_.y+z*(Re+1);qe.setAttributes(Y,[["x1",""+_.x],["y1",""+et],["x2",""+(_.x+_.width)],["y2",""+et]])});var Q=_.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,Re){var et=_.x+Q*(Re+1);qe.setAttributes(Y,[["x1",""+et],["y1",""+_.y],["x2",""+et],["y2",""+(_.y+_.height)]])}),qe.setAttributes(this.cropShadeElement,[["d",qe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,_.x,_.y,_.width,_.height)]]),this.topLeftGrip.setCenter(_.x,_.y),this.topRightGrip.setCenter(_.x+_.width,_.y),this.bottomLeftGrip.setCenter(_.x,_.y+_.height),this.bottomRightGrip.setCenter(_.x+_.width,_.y+_.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},G.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},G.prototype.clientToLocalCoordinates=function(E,_){var z=this.container.getBoundingClientRect();return{x:E-z.left+this.margin,y:_-z.top+this.margin}},G.prototype.onPointerDown=function(E){this.container.setPointerCapture(E.pointerId),this.previousPoint=this.clientToLocalCoordinates(E.clientX,E.clientY),this.cropRectElement===E.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(E.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(E.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(E.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(E.target)&&(this.activeGrip=this.bottomRightGrip)},G.prototype.onPointerMove=function(E){if(this.isMoving)this.move(this.clientToLocalCoordinates(E.clientX,E.clientY));else if(this.activeGrip){var _=this.clientToLocalCoordinates(E.clientX,E.clientY);this.resize(_)}E.preventDefault()},G.prototype.onPointerUp=function(E){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(E.pointerId)},G.prototype.move=function(E){var _=E.x-this.previousPoint.x,z=E.y-this.previousPoint.y;this.zoomFactor!==1&&(_=-_/this.zoomFactor,z=-z/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+_),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+z),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=E},G.prototype.resize=function(E){var _=Object.assign({},this.cropRect),z=E.x-this.previousPoint.x,Q=E.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:_.x+z<this.margin&&(z=this.margin-_.x),_.x+=z,_.width=this.cropRect.x+this.cropRect.width-_.x;break;case this.bottomRightGrip:case this.topRightGrip:_.width+z>this.canvasWidth*this.zoomFactor&&(z=this.canvasWidth*this.zoomFactor-_.width),_.width+=z}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(_.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(z),_.height=this.aspectRatio.getVerticalLength(_.width)):(_.y+=Q,_.height=this.cropRect.y+this.cropRect.height-_.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?_.height=this.aspectRatio.getVerticalLength(_.width):_.height+=Q}_.width<10&&(_.x=this.cropRect.x,_.width=10),_.height<10&&(_.y=this.cropRect.y,_.height=10),this.previousPoint=E,_.x>=this.margin&&_.y>=this.margin&&_.x-this.margin+_.width<=this.canvasWidth&&_.y-this.margin+_.height<=this.canvasHeight&&(this.cropRect=_,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},G.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var E=this.cropRect.x+this.cropRect.width/2,_=this.cropRect.y+this.cropRect.height/2,z=this.aspectRatio.getHorizontalLength(this.cropRect.height),Q=this.aspectRatio.getVerticalLength(this.cropRect.width);z/this.canvasWidth<Q/this.canvasHeight?this.cropRect.width=z:this.cropRect.height=Q,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=E-this.cropRect.width/2,this.cropRect.y=_-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},G.prototype.getRescaledRect=function(E,_,z,Q,Y,Re){var et=z/E,yt=Q/_;return{x:(Y.x-Re)*et+Re,y:(Y.y-Re)*yt+Re,width:Y.width*et,height:Y.height*yt}},G.prototype.scaleCanvas=function(E,_){var z=this.getRescaledRect(this.canvasWidth,this.canvasHeight,E,_,this.cropRect,this.margin);this.canvasWidth=E,this.canvasHeight=_,this.onCropChange&&this.onCropChange(z),this.setCropRectangle(z)},G}(),Qt=function(){function G(E){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=E,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(G.prototype,"angle",{get:function(){return this._angle},set:function(E){this._angle=E,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),G.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},G.prototype.onPointerDown=function(E){this.controlContainer.setPointerCapture(E.pointerId),this.isDragging=!0,this.previousPoint={x:E.clientX,y:E.clientY}},G.prototype.onPointerMove=function(E){this.isDragging&&(this.onAngleChange&&this.onAngleChange((E.clientX-this.previousPoint.x)/5),this.previousPoint.x=E.clientX)},G.prototype.onPointerUp=function(E){this.isDragging&&this.onAngleChange&&this.onAngleChange((E.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(E.pointerId)},G.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var E=this.angleLabelText.getBBox();qe.setAttributes(this.angleLabelElement,[["x",((this.width-E.width)/2).toString()],["y",(this.height/2).toString()]])}},G.prototype.positionScaleShape=function(){if(this.scaleShape){var E=this.scaleShape.transform.baseVal.getItem(0);E.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(E,0)}},G.prototype.getVisual=function(){var E=document.createElementNS("http://www.w3.org/2000/svg","svg");E.setAttribute("xmlns","http://www.w3.org/2000/svg"),E.setAttribute("width",this.width+"px"),E.setAttribute("height",this.height+"px"),E.setAttribute("viewBox","0 0 "+this.width+" "+this.height),E.style.flexShrink="0",document.body.appendChild(E);for(var _="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,z=1;z<=this.width/5+10;z++){var Q=z%5==0?this.height/3:this.height/6;_+="h4v"+-Q+"h1v"+Q}_+="v1H0Z",this.scaleShape=qe.createPath(_);var Y=qe.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),E.appendChild(this.scaleShape),this.angleLabelElement=qe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=qe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Re=qe.createTSpan("");return Re.innerHTML="&deg;",this.angleLabelElement.appendChild(Re),E.appendChild(this.angleLabelElement),document.body.removeChild(E),E},G}(),or=function(){function G(){this.naturalSize=!1,this.imageType="image/png"}return G.prototype.rasterize=function(E,_,z,Q,Y,Re,et){var yt=this;return new Promise(function(_t){var it=document.createElement("canvas");it.width=E.width.baseVal.value-2*Q,it.height=E.height.baseVal.value-2*Q;var Kt=1,Bt=1;yt.naturalSize===!0?(Kt=_.naturalWidth/(E.width.baseVal.value-2*Q)/Re,Bt=_.naturalHeight/(E.height.baseVal.value-2*Q)/et,it.width=_.naturalWidth/Re,it.height=_.naturalHeight/et):yt.width!==void 0&&yt.height!==void 0&&(Kt=yt.width/z.width,Bt=yt.height/z.height,it.width*=Kt,it.height*=Bt);var gr=it.getContext("2d");gr.translate(it.width/2,it.height/2),gr.rotate(Y*Math.PI/180),gr.scale(Re,et),gr.translate(-it.width/2,-it.height/2),gr.drawImage(_,0,0,it.width,it.height);var Kr=document.createElement("canvas");Kr.width=z.width*Kt,Kr.height=z.height*Bt,Kr.getContext("2d").putImageData(gr.getImageData((z.x-Q)*Kt,(z.y-Q)*Bt,z.width*Kt,z.height*Bt),0,0),_t(Kr.toDataURL(yt.imageType,yt.imageQuality))})},G}(),Xe=function(){function G(E){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=G.instanceCounter++,this.styles=new Ze(this.instanceNo),this.target=E,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(E){this._zoomToCropEnabled=E,E?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(E){this._isGridVisible=E,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"gridLines",{get:function(){return this._gridLines},set:function(E){this._gridLines=E,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(E){this._rotationAngle=E,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"aspectRatio",{get:function(){var E;return(E=this._aspectRatio)!==null&&E!==void 0?E:this.aspectRatios[0]},set:function(E){this._aspectRatio=E},enumerable:!1,configurable:!0}),G.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},G.prototype.show=function(){this.showUI(),this.open()},G.prototype.close=function(E){E===void 0&&(E=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),E||this.closeEventListeners.forEach(function(_){return _()}),this._isOpen=!1)},G.prototype.addRenderEventListener=function(E){this.renderEventListeners.push(E)},G.prototype.removeRenderEventListener=function(E){this.renderEventListeners.indexOf(E)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(E),1)},G.prototype.addCloseEventListener=function(E){this.closeEventListeners.push(E)},G.prototype.removeCloseEventListener=function(E){this.closeEventListeners.indexOf(E)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(E),1)},G.prototype.setupResizeObserver=function(){var E=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){E.resize(E.target.clientWidth,E.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},G.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var E=1*this.target.clientWidth/this.target.clientHeight,_=this.contentDiv.clientWidth/E>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*E:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,z=_+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/E;this.resize(_,z)}},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",qe.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},G.prototype.resize=function(E,_){this.imageWidth=Math.round(E),this.imageHeight=Math.round(_),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},G.prototype.setEditingTarget=function(){var E=document.createElement("canvas");E.width=this.target.naturalWidth,E.height=this.target.naturalHeight,E.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var _=E.toDataURL();qe.setAttributes(this.editingTarget,[["href",_]]),this.setEditingTargetSize()},G.prototype.setTopLeft=function(){var E=this.target.getBoundingClientRect(),_=this.editorCanvas.getBoundingClientRect();this.left=E.left-_.left-this.CANVAS_MARGIN,this.top=E.top-_.top-this.CANVAS_MARGIN},G.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=qe.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=qe.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=qe.createGroup(),this.editingTargetRotationScaleContainer=qe.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var E=qe.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(E);var _=qe.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(_),this.editingTargetContainer=qe.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},G.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},G.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=qe.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new zt(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},G.prototype.zoomToCrop=function(){if(this.cropRect){var E=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,_=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=E+"px "+_+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-E+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-_+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},G.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},G.prototype.cropRectChanged=function(E){this.cropRect=E,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},G.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},G.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var E=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,_=this.target.offsetTop>E+this.CANVAS_MARGIN?this.target.offsetTop-(E+this.CANVAS_MARGIN):0;this.coverDiv.style.top=_+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},G.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},G.prototype.addTopToolbar=function(){var E=this;this.topToolbar=new ot,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 _=new Mt;_.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(_);var z=[];this.aspectRatios.forEach(function(Bt){var gr=new Et(vr.getIcon(Bt.horizontal,Bt.vertical),Bt.horizontal===0&&Bt.vertical===0?"FREE":Bt.horizontal+":"+Bt.vertical);gr.onClick=function(){return E.ratioButtonClicked(Bt)},z.push(gr)}),this.aspectRatioButton=new $t(vr.getIcon(0,0),"Aspect ratio",z),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,_.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Q=new Et('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");Q.isActive=this.isGridVisible,Q.onClick=function(){E.isGridVisible=!E.isGridVisible,Q.isActive=E.isGridVisible},_.addButton(Q);var Y=new Et('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){E.zoomToCropEnabled=!E.zoomToCropEnabled,Y.isActive=E.zoomToCropEnabled},_.addButton(Y),!Nt.isLicensed){var Re=new lt;this.topToolbar.addElementBlock(Re);var et=document.createElement("div");et.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var yt=document.createElement("a");yt.style.color="currentColor",yt.href="https://markerjs.com/products/cropro",yt.target="_blank",yt.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',et.appendChild(yt),Re.addElement(et)}var _t=new Mt;_t.minWidth=3*this.toolbarHeight+"px",_t.contentAlign="end",this.topToolbar.addButtonBlock(_t);var it=new Et('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");it.onClick=this.startRenderAndClose,_t.addButton(it),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(it.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Kt=new Et('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Kt.onClick=this.close,_t.addButton(Kt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Kt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},G.prototype.addBottomToolbar=function(){var E=this;this.bottomToolbar=new ot,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 _=new Mt;_.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(_);var z=new Et('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");z.onClick=this.rotateLeftButtonClicked,_.addButton(z);var Q=new Et('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");Q.onClick=this.rotateRightButtonClicked,_.addButton(Q);var Y=new lt;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new Qt("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(_t){E.rotateBy(_t),E.straightener.angle=E.rotationAngle},Y.addElement(this.straightener.getUI());var Re=new Mt;Re.minWidth=2*this.toolbarHeight+"px",Re.contentAlign="end",this.bottomToolbar.addButtonBlock(Re);var et=new Et('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");et.onClick=this.flipHorizontallyButtonClicked,Re.addButton(et);var yt=new Et('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");yt.onClick=this.flipVerticallyButtonClicked,Re.addButton(yt)},G.prototype.ratioButtonClicked=function(E){this.aspectRatio=E,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},G.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=vr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},G.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Jt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},G.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},G.prototype.restoreState=function(E){if(E){var _=this.cropLayer.getRescaledRect(E.width,E.height,this.imageWidth,this.imageHeight,E.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(_),this.cropRectChanged(_),this.flippedHorizontally=E.flippedHorizontally,this.flippedVertically=E.flippedVertically,this.applyFlip(),this.rotationAngle=E.rotationAngle,this.applyRotation()}},G.prototype.clientToLocalCoordinates=function(E,_){var z=this.cropImage.getBoundingClientRect();return{x:E-z.left,y:_-z.top}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var E=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=E+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},G.prototype.rotateLeftButtonClicked=function(){var E=this.rotationAngle-90;this.rotationAngle%90!=0&&(E+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(E)},G.prototype.rotateRightButtonClicked=function(){var E=this.rotationAngle+90;this.rotationAngle%90!=0&&(E-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(E)},G.prototype.rotateTo=function(E){E=(E=E>180?E-360:E)<=-180?E+360:E,this.rotationAngle=E,this.applyRotation()},G.prototype.rotateBy=function(E){this.rotateTo((this.rotationAngle+E)%360)},G.prototype.applyRotation=function(){var E=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var _=this.editingTargetRotationContainer.transform.baseVal.getItem(0);_.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(_,0);var z=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/z.width,this.imageHeight/z.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=E},G.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},G.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},G.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},G.prototype.startRenderAndClose=function(){return wt(this,void 0,void 0,function(){var E,_;return Ut(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return E=z.sent(),_=this.getState(),this.renderEventListeners.forEach(function(Q){return Q(E,_)}),this.close(!0),[2]}})})},G.prototype.render=function(){return wt(this,void 0,void 0,function(){var E;return Ut(this,function(_){switch(_.label){case 0:return(E=new or).naturalSize=this.renderAtNaturalSize,E.imageType=this.renderImageType,E.imageQuality=this.renderImageQuality,E.width=this.renderWidth,E.height=this.renderHeight,this.unzoomFromCrop(),qe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,E.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 _.sent(),[4,E.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,_.sent()]}})})},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ye("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Ye("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ye("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var E=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ye("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*E)+`px;
height: `+(this.toolbarHeight-2*E)+`px;
padding: `+E+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new ze("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new ze("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ye("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Ye("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ye("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Ye("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*E)+`px;
padding: `+E+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ye("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},G.instanceCounter=0,G}(),xt=W("8hTe"),Pt=W.n(xt),At=/<pre[^>]*>/g;function Ft(G){var E=document.createElement("div");return E.innerHTML=G,E.childNodes.length===0?"":E.childNodes[0].nodeValue}var Yt=Te.a=function(G){var E=G.value,_=E===void 0?"":E,z=G.edit,Q=z===void 0?!1:z,Y=G.className,Re=G.showTextOnly,et=G.showLines,yt=G.replaces,_t=G.zoomImg,it=G.hasMask,Kt=G.style,Bt=Kt===void 0?{}:Kt,gr=G.stylesPrev,Kr=gr===void 0?{}:gr,Yr=String(_),Er=Object(A.useRef)(),tn=Object(A.useRef)(),Cn=Object(A.useState)(""),Ur=Object(K.a)(Cn,2),Qr=Ur[0],Zt=Ur[1],Vt=Object(A.useState)("office"),Xt=Object(K.a)(Vt,2),er=Xt[0],ur=Xt[1],sr=function(){var qt=new Xe(tn.current);qt.displayMode="popup",qt.addRenderEventListener(function(){var Ar=Object(L.a)(R.a.mark(function rr(Cr){var nr;return R.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:return Er.current.style.display="none",_r.next=3,Object(Ae.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Cr}});case 3:nr=_r.sent,nr!=null&&nr.id&&yt(tn.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(nr==null?void 0:nr.id,"?type=").concat(nr.content_type));case 5:case"end":return _r.stop()}},rr)}));return function(rr){return Ar.apply(this,arguments)}}()),qt.show()},Tr=function(){var qt=new Lt(tn.current);qt.settings.displayMode="popup",qt.addEventListener("render",function(){var Ar=Object(L.a)(R.a.mark(function rr(Cr){var nr;return R.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:if(Er.current.style.display="none",!tn.current){_r.next=6;break}return _r.next=4,Object(Ae.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Cr.dataUrl}});case 4:nr=_r.sent,nr!=null&&nr.id&&yt(tn.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(nr==null?void 0:nr.id,"?type=").concat(nr.content_type));case 6:case"end":return _r.stop()}},rr)}));return function(rr){return Ar.apply(this,arguments)}}()),qt.show(),window.markerArea=qt},Lr=Object(A.useMemo)(function(){try{var dr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,qt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ar=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Yr=Yr.replace(dr,"("+ne.a.API_SERVER+"/api/attachments/").replace(qt,'"'+ne.a.API_SERVER+"/api/attachments/").replace(Ar,'"'+ne.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,`
`),Yr=Yr.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(Dr){}var rr=H(Yr),Cr=S();if(Yr.match(/\[TOC\]/)&&(rr=rr.replace("<p>[TOC]</p>",D()),C()),rr=rr.replace(/(__special_katext_id_\d+__)/g,function(Dr,_r){var Fr=Cr[_r],Sn=Fr.type,yr=Fr.expression;return Object(he.renderToString)(Ft(yr)||"",{displayMode:Sn==="block",throwOnError:!1,output:"html"})}),rr=rr.replace(/▁/g,"\u2581\u2581\u2581"),c(),Re){var nr=document.createElement("div");return nr.innerHTML=rr,nr.innerText}return setTimeout(function(){return Zr()},500),rr},[Yr]),wr=Object(A.useRef)();b.WebkitLineClamp=et,et&&(Bt=Object(N.a)(Object(N.a)({},Bt),b));function Mr(dr){var qt=dr.target;if(qt.tagName.toUpperCase()==="IMG"){if(_t){var Ar=qt.getAttribute("src");Zt(Ar),ur("image")}}else if(qt.tagName.toUpperCase()==="A"){var rr=qt.getAttribute("href");if(rr.indexOf("office")>-1)dr.preventDefault(),Zt(rr),ur("office");else if(rr.indexOf("application/pdf")>-1)dr.preventDefault(),Zt(rr),ur("pdf");else if(rr.indexOf("type=text")>-1)dr.preventDefault(),Zt(rr),ur("html");else if(rr.startsWith("#")){dr.preventDefault();var Cr=document.getElementById(rr.replace("#",""));Cr&&Cr.scrollIntoView(!0)}}}var Zr=function(){var qt,Ar=(qt=wr.current)===null||qt===void 0?void 0:qt.querySelectorAll("video");Ar==null||Ar.forEach(function(rr){if(rr.oncontextmenu=function(){return!1},rr.src.indexOf(".m3u8")>-1&&!rr.canPlayType("application/vnd.apple.mpegurl")){if(J.a.isSupported()){var Cr=new J.a;Cr.loadSource(rr.src),Cr.attachMedia(rr)}}})};Object(A.useEffect)(function(){if(wr.current&&Lr&&(Lr.match(At)&&window.PR.prettyPrint()),wr.current)return wr.current.addEventListener("click",Mr),function(){wr.current.removeEventListener("click",Mr),c(),C()}},[Lr,wr.current,Mr]);var sn=function(qt){if(!Q)return;qt.target.nodeName==="IMG"?(Er.current.style.display="flex",Er.current.style.width=qt.target.clientWidth+"px",Er.current.style.height=qt.target.clientHeight+"px",Er.current.style.top=qt.target.offsetTop+"px",Er.current.style.left=qt.target.offsetLeft+"px",tn.current.src=qt.target.getAttribute("src")):Er.current.style.display="none"};return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:wr,style:Object(N.a)({},Bt),className:"".concat(Y||""," markdown-body ").concat(Pt.a.mdBody),onMouseOver:sn,dangerouslySetInnerHTML:{__html:Lr}}),h.a.createElement("div",{ref:Er,className:Pt.a.button},h.a.createElement(V.a,null,h.a.createElement($.a,{onClick:function(){return sr()}},"\u88C1\u526A"),h.a.createElement($.a,{onClick:function(){return Tr()}},"\u7F16\u8F91"))),h.a.createElement("img",{ref:tn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),h.a.createElement(Ee.a,{close:!0,data:Qr,hasMask:it,type:Qr!=null&&Qr.length?er:"",style:Object(N.a)({},Kr),onClose:function(){return Zt("")}}))}},"9VGf":function(ct,Te,W){"use strict";W.d(Te,"a",function(){return P});var ue=W("q1tI"),V=W.n(ue);function P($,N){var L=Object(ue.useRef)();Object(ue.useEffect)(function(){L.current=$}),Object(ue.useEffect)(function(){function K(){L.current()}if(N!==null){var F=setInterval(K,N);return function(){return clearInterval(F)}}},[N])}},BU3w:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return L});var ue=W("MNnm"),V="rc-util-key";function P(K){if(K.attachTo)return K.attachTo;var F=document.querySelector("head");return F||document.body}function $(K){var F,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var A=document.createElement("style");if((F=R.csp)===null||F===void 0?void 0:F.nonce){var h;A.nonce=(h=R.csp)===null||h===void 0?void 0:h.nonce}A.innerHTML=K;var y=P(R),w=y.firstChild;return R.prepend&&y.prepend?y.prepend(A):R.prepend&&w?y.insertBefore(A,w):y.appendChild(A),A}var N=new Map;function L(K,F){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=P(R);if(!N.has(A)){var h=$("",R),y=h.parentNode;N.set(A,y),y.removeChild(h)}var w=Array.from(N.get(A).children).find(function(r){return r.tagName==="STYLE"&&r[V]===F});if(w){var p,f;if(((p=R.csp)===null||p===void 0?void 0:p.nonce)&&w.nonce!==((f=R.csp)===null||f===void 0?void 0:f.nonce)){var g;w.nonce=(g=R.csp)===null||g===void 0?void 0:g.nonce}return w.innerHTML!==K&&(w.innerHTML=K),w}var a=$(K,R);return a[V]=F,a}},Bd2K:function(ct,Te,W){(function(ue){ue(W("VrN/"),W("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(R,A,h){if(h!=ue.Init&&h&&R.removeKeyMap("autoCloseTags"),!A)return;var y={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(y["'/'"]=function(w){return L(w)}),(typeof A!="object"||A.whenOpening!==!1)&&(y["'>'"]=function(w){return $(w)}),R.addKeyMap(y)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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 $(R){if(R.getOption("disableInput"))return ue.Pass;for(var A=R.listSelections(),h=[],y=R.getOption("autoCloseTags"),w=0;w<A.length;w++){if(!A[w].empty())return ue.Pass;var p=A[w].head,f=R.getTokenAt(p),g=ue.innerMode(R.getMode(),f.state),a=g.state,r=g.mode.xmlCurrentTag&&g.mode.xmlCurrentTag(a),o=r&&r.name;if(!o)return ue.Pass;var l=g.mode.configuration=="html",C=typeof y=="object"&&y.dontCloseTags||l&&V,b=typeof y=="object"&&y.indentTags||l&&P;f.end>p.ch&&(o=o.slice(0,o.length-f.end+p.ch));var x=o.toLowerCase();if(!o||f.type=="string"&&(f.end!=p.ch||!/[\"\']/.test(f.string.charAt(f.string.length-1))||f.string.length==1)||f.type=="tag"&&r.close||f.string.indexOf("/")==p.ch-f.start-1||C&&K(C,x)>-1||F(R,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(a)||[],o,p,!0))return ue.Pass;var D=typeof y=="object"&&y.emptyTags;if(D&&K(D,o)>-1){h[w]={text:"/>",newPos:ue.Pos(p.line,p.ch+2)};continue}var T=b&&K(b,x)>-1;h[w]={indent:T,text:">"+(T?`
`:"")+"</"+o+">",newPos:T?ue.Pos(p.line+1,0):ue.Pos(p.line,p.ch+1)}}for(var m=typeof y=="object"&&y.dontIndentOnAutoClose,w=A.length-1;w>=0;w--){var v=h[w];R.replaceRange(v.text,A[w].head,A[w].anchor,"+insert");var u=R.listSelections().slice(0);u[w]={head:v.newPos,anchor:v.newPos},R.setSelections(u),!m&&v.indent&&(R.indentLine(v.newPos.line,null,!0),R.indentLine(v.newPos.line+1,null,!0))}}function N(R,A){for(var h=R.listSelections(),y=[],w=A?"/":"</",p=R.getOption("autoCloseTags"),f=typeof p=="object"&&p.dontIndentOnSlash,g=0;g<h.length;g++){if(!h[g].empty())return ue.Pass;var a=h[g].head,r=R.getTokenAt(a),o=ue.innerMode(R.getMode(),r.state),l=o.state;if(A&&(r.type=="string"||r.string.charAt(0)!="<"||r.start!=a.ch-1))return ue.Pass;var C,b=o.mode.name!="xml"&&R.getMode().name=="htmlmixed";if(b&&o.mode.name=="javascript")C=w+"script";else if(b&&o.mode.name=="css")C=w+"style";else{var x=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(l);if(!x||x.length&&F(R,x,x[x.length-1],a))return ue.Pass;C=w+x[x.length-1]}R.getLine(a.line).charAt(r.end)!=">"&&(C+=">"),y[g]=C}if(R.replaceSelections(y),h=R.listSelections(),!f)for(var g=0;g<h.length;g++)(g==h.length-1||h[g].head.line<h[g+1].head.line)&&R.indentLine(h[g].head.line)}function L(R){return R.getOption("disableInput")?ue.Pass:N(R,!0)}ue.commands.closeTag=function(R){return N(R)};function K(R,A){if(R.indexOf)return R.indexOf(A);for(var h=0,y=R.length;h<y;++h)if(R[h]==A)return h;return-1}function F(R,A,h,y,w){if(!ue.scanForClosingTag)return!1;var p=Math.min(R.lastLine()+1,y.line+500),f=ue.scanForClosingTag(R,y,null,p);if(!f||f.tag!=h)return!1;for(var g=w?1:0,a=A.length-1;a>=0&&A[a]==h;a--)++g;y=f.to;for(var a=1;a<g;a++){var r=ue.scanForClosingTag(R,y,null,p);if(!r||r.tag!=h)return!1;y=r.to}return!0}})},BjJ7:function(ct,Te,W){"use strict";W.d(Te,"d",function(){return V}),W.d(Te,"c",function(){return P}),W.d(Te,"e",function(){return $}),W.d(Te,"b",function(){return N}),W.d(Te,"a",function(){return K});var ue=W("m3rI");function V(F){var R=!0;if(F.length>0){for(var A=0;A<F.length;A++)if(F[A].compile_success==0||!F[A].compile_success){R=!1;break}}else R=!1;return R}function P(F){for(var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",A=[],h=0;h<F.length;h++){var y=F[h],w=R?"".concat(R,"/").concat(y.name):"".concat(y.name);A.push({title:y.name,isLeaf:!(y.type==="tree"),key:w})}return A}function $(F,R,A){for(var h=0;h<F.length;h++){var y=F[h];if(y.key===R){y.children=A;break}y.children&&$(y.children,R,A)}return F}function N(F,R,A){var h;return function(){var y=this,w=arguments,p=function(){h=null,A||F.apply(y,w)},f=A&&!h;clearTimeout(h),h=setTimeout(p,R),f&&F.apply(y,w)}}var L=!0,K=ue.a.API_SERVER},"C+DQ":function(ct,Te,W){},"C/vA":function(ct,Te,W){"use strict";W.d(Te,"a",function(){return ue});function ue(V){var P=this,$=!1,N;return function(){return $||($=!0,N=V.apply(P,arguments)),N}}},"Cg/j":function(ct,Te,W){"use strict";W.d(Te,"b",function(){return ue}),W.d(Te,"a",function(){return V}),W.d(Te,"c",function(){return $}),W.d(Te,"d",function(){return N});var ue;(function(L){L.serviceIds=new Map,L.DI_TARGET="$di$target",L.DI_DEPENDENCIES="$di$dependencies";function K(F){return F[L.DI_DEPENDENCIES]||[]}L.getServiceDependencies=K})(ue||(ue={}));var V=$("instantiationService");function P(L,K,F,R){K[ue.DI_TARGET]===K?K[ue.DI_DEPENDENCIES].push({id:L,index:F,optional:R}):(K[ue.DI_DEPENDENCIES]=[{id:L,index:F,optional:R}],K[ue.DI_TARGET]=K)}function $(L){if(ue.serviceIds.has(L))return ue.serviceIds.get(L);var K=function(F,R,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(K,F,A,!1)};return K.toString=function(){return L},ue.serviceIds.set(L,K),K}function N(L){return function(K,F,R){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(L,K,R,!0)}}},DlQD:function(ct,Te,W){(function(ue,V){ct.exports=V()})(this,function(){"use strict";function ue(we,ye){for(var ge=0;ge<ye.length;ge++){var ae=ye[ge];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(we,ae.key,ae)}}function V(we,ye,ge){return ye&&ue(we.prototype,ye),ge&&ue(we,ge),we}function P(we,ye){if(!we)return;if(typeof we=="string")return $(we,ye);var ge=Object.prototype.toString.call(we).slice(8,-1);if(ge==="Object"&&we.constructor&&(ge=we.constructor.name),ge==="Map"||ge==="Set")return Array.from(we);if(ge==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ge))return $(we,ye)}function $(we,ye){(ye==null||ye>we.length)&&(ye=we.length);for(var ge=0,ae=new Array(ye);ge<ye;ge++)ae[ge]=we[ge];return ae}function N(we,ye){var ge;if(typeof Symbol=="undefined"||we[Symbol.iterator]==null){if(Array.isArray(we)||(ge=P(we))||ye&&we&&typeof we.length=="number"){ge&&(we=ge);var ae=0;return function(){return ae>=we.length?{done:!0}:{done:!1,value:we[ae++]}}}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 ge=we[Symbol.iterator](),ge.next.bind(ge)}function L(we,ye){return ye={exports:{}},we(ye,ye.exports),ye.exports}var K=L(function(we){function ye(){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 ge(ae){we.exports.defaults=ae}we.exports={defaults:ye(),getDefaults:ye,changeDefaults:ge}}),F=K.defaults,R=K.getDefaults,A=K.changeDefaults,h=/[&<>"']/,y=/[&<>"']/g,w=/[<>"']|&(?!#?\w+;)/,p=/[<>"']|&(?!#?\w+;)/g,f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},g=function(ye){return f[ye]};function a(we,ye){if(ye){if(h.test(we))return we.replace(y,g)}else if(w.test(we))return we.replace(p,g);return we}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(we){return we.replace(r,function(ye,ge){return ge=ge.toLowerCase(),ge==="colon"?":":ge.charAt(0)==="#"?ge.charAt(1)==="x"?String.fromCharCode(parseInt(ge.substring(2),16)):String.fromCharCode(+ge.substring(1)):""})}var l=/(^|[^\[])\^/g;function C(we,ye){we=we.source||we,ye=ye||"";var ge={replace:function(re,be){return be=be.source||be,be=be.replace(l,"$1"),we=we.replace(re,be),ge},getRegex:function(){return new RegExp(we,ye)}};return ge}var b=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(we,ye,ge){if(we){var ae;try{ae=decodeURIComponent(o(ge)).replace(b,"").toLowerCase()}catch(re){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}ye&&!x.test(ge)&&(ge=s(ye,ge));try{ge=encodeURI(ge).replace(/%25/g,"%")}catch(re){return null}return ge}var T={},m=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(we,ye){T[" "+we]||(m.test(we)?T[" "+we]=we+"/":T[" "+we]=M(we,"/",!0)),we=T[" "+we];var ge=we.indexOf(":")===-1;return ye.substring(0,2)==="//"?ge?ye:we.replace(v,"$1")+ye:ye.charAt(0)==="/"?ge?ye:we.replace(u,"$1")+ye:we+ye}var S={exec:function(){}};function c(we){for(var ye=1,ge,ae;ye<arguments.length;ye++){ge=arguments[ye];for(ae in ge)Object.prototype.hasOwnProperty.call(ge,ae)&&(we[ae]=ge[ae])}return we}function O(we,ye){var ge=we.replace(/\|/g,function(be,Ce,Ie){for(var De=!1,Ge=Ce;--Ge>=0&&Ie[Ge]==="\\";)De=!De;return De?"|":" |"}),ae=ge.split(/ \|/),re=0;if(ae.length>ye)ae.splice(ye);else for(;ae.length<ye;)ae.push("");for(;re<ae.length;re++)ae[re]=ae[re].trim().replace(/\\\|/g,"|");return ae}function M(we,ye,ge){var ae=we.length;if(ae===0)return"";for(var re=0;re<ae;){var be=we.charAt(ae-re-1);if(be===ye&&!ge)re++;else if(be!==ye&&ge)re++;else break}return we.substr(0,ae-re)}function B(we,ye){if(we.indexOf(ye[1])===-1)return-1;for(var ge=we.length,ae=0,re=0;re<ge;re++)if(we[re]==="\\")re++;else if(we[re]===ye[0])ae++;else if(we[re]===ye[1]&&(ae--,ae<0))return re;return-1}function j(we){we&&we.sanitize&&!we.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var H={escape:a,unescape:o,edit:C,cleanUrl:D,resolveUrl:s,noopTest:S,merge:c,splitCells:O,rtrim:M,findClosingBracket:B,checkSanitizeDeprecation:j},I=K.defaults,U=H.rtrim,J=H.splitCells,ne=H.escape,he=H.findClosingBracket;function Ee(we,ye,ge){var ae=ye.href,re=ye.title?ne(ye.title):null,be=we[1].replace(/\\([\[\]])/g,"$1");return we[0].charAt(0)!=="!"?{type:"link",raw:ge,href:ae,title:re,text:be}:{type:"image",raw:ge,href:ae,title:re,text:ne(be)}}function Ae(we,ye){var ge=we.match(/^(\s+)(?:```)/);if(ge===null)return ye;var ae=ge[1];return ye.split(`
`).map(function(re){var be=re.match(/^\s+/);if(be===null)return re;var Ce=be[0];return Ce.length>=ae.length?re.slice(ae.length):re}).join(`
`)}var Oe=function(){function we(ge){this.options=ge||I}var ye=we.prototype;return ye.space=function(ae){var re=this.rules.block.newline.exec(ae);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:`
`}},ye.code=function(ae,re){var be=this.rules.block.code.exec(ae);if(be){var Ce=re[re.length-1];if(Ce&&Ce.type==="paragraph")return{raw:be[0],text:be[0].trimRight()};var Ie=be[0].replace(/^ {4}/gm,"");return{type:"code",raw:be[0],codeBlockStyle:"indented",text:this.options.pedantic?Ie:U(Ie,`
`)}}},ye.fences=function(ae){var re=this.rules.block.fences.exec(ae);if(re){var be=re[0],Ce=Ae(be,re[3]||"");return{type:"code",raw:be,lang:re[2]?re[2].trim():re[2],text:Ce}}},ye.heading=function(ae){var re=this.rules.block.heading.exec(ae);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},ye.nptable=function(ae){var re=this.rules.block.nptable.exec(ae);if(re){var be={type:"table",header:J(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[],raw:re[0]};if(be.header.length===be.align.length){var Ce=be.align.length,Ie;for(Ie=0;Ie<Ce;Ie++)/^ *-+: *$/.test(be.align[Ie])?be.align[Ie]="right":/^ *:-+: *$/.test(be.align[Ie])?be.align[Ie]="center":/^ *:-+ *$/.test(be.align[Ie])?be.align[Ie]="left":be.align[Ie]=null;for(Ce=be.cells.length,Ie=0;Ie<Ce;Ie++)be.cells[Ie]=J(be.cells[Ie],be.header.length);return be}}},ye.hr=function(ae){var re=this.rules.block.hr.exec(ae);if(re)return{type:"hr",raw:re[0]}},ye.blockquote=function(ae){var re=this.rules.block.blockquote.exec(ae);if(re){var be=re[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:re[0],text:be}}},ye.list=function(ae){var re=this.rules.block.list.exec(ae);if(re){for(var be=re[0],Ce=re[2],Ie=Ce.length>1,De=Ce[Ce.length-1]===")",Ge={type:"list",raw:be,ordered:Ie,start:Ie?+Ce.slice(0,-1):"",loose:!1,items:[]},Qe=re[0].match(this.rules.block.item),dt=!1,rt,ht,ft,at,Dt,Lt,Tt,Rt=Qe.length,wt=0;wt<Rt;wt++)rt=Qe[wt],be=rt,ht=rt.length,rt=rt.replace(/^ *([*+-]|\d+[.)]) */,""),~rt.indexOf(`
`)&&(ht-=rt.length,rt=this.options.pedantic?rt.replace(/^ {1,4}/gm,""):rt.replace(new RegExp("^ {1,"+ht+"}","gm"),"")),wt!==Rt-1&&(ft=this.rules.block.bullet.exec(Qe[wt+1])[0],(Ie?ft.length===1||!De&&ft[ft.length-1]===")":ft.length>1||this.options.smartLists&&ft!==Ce)&&(at=Qe.slice(wt+1).join(`
`),Ge.raw=Ge.raw.substring(0,Ge.raw.length-at.length),wt=Rt-1)),Dt=dt||/\n\n(?!\s*$)/.test(rt),wt!==Rt-1&&(dt=rt.charAt(rt.length-1)===`
`,Dt||(Dt=dt)),Dt&&(Ge.loose=!0),Lt=/^\[[ xX]\] /.test(rt),Tt=void 0,Lt&&(Tt=rt[1]!==" ",rt=rt.replace(/^\[[ xX]\] +/,"")),Ge.items.push({type:"list_item",raw:be,task:Lt,checked:Tt,loose:Dt,text:rt});return Ge}},ye.html=function(ae){var re=this.rules.block.html.exec(ae);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]):ne(re[0]):re[0]}},ye.def=function(ae){var re=this.rules.block.def.exec(ae);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var be=re[1].toLowerCase().replace(/\s+/g," ");return{tag:be,raw:re[0],href:re[2],title:re[3]}}},ye.table=function(ae){var re=this.rules.block.table.exec(ae);if(re){var be={type:"table",header:J(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[]};if(be.header.length===be.align.length){be.raw=re[0];var Ce=be.align.length,Ie;for(Ie=0;Ie<Ce;Ie++)/^ *-+: *$/.test(be.align[Ie])?be.align[Ie]="right":/^ *:-+: *$/.test(be.align[Ie])?be.align[Ie]="center":/^ *:-+ *$/.test(be.align[Ie])?be.align[Ie]="left":be.align[Ie]=null;for(Ce=be.cells.length,Ie=0;Ie<Ce;Ie++)be.cells[Ie]=J(be.cells[Ie].replace(/^ *\| *| *\| *$/g,""),be.header.length);return be}}},ye.lheading=function(ae){var re=this.rules.block.lheading.exec(ae);if(re)return{type:"heading",raw:re[0],depth:re[2].charAt(0)==="="?1:2,text:re[1]}},ye.paragraph=function(ae){var re=this.rules.block.paragraph.exec(ae);if(re)return{type:"paragraph",raw:re[0],text:re[1].charAt(re[1].length-1)===`
`?re[1].slice(0,-1):re[1]}},ye.text=function(ae,re){var be=this.rules.block.text.exec(ae);if(be){var Ce=re[re.length-1];return Ce&&Ce.type==="text"?{raw:be[0],text:be[0]}:{type:"text",raw:be[0],text:be[0]}}},ye.escape=function(ae){var re=this.rules.inline.escape.exec(ae);if(re)return{type:"escape",raw:re[0],text:ne(re[1])}},ye.tag=function(ae,re,be){var Ce=this.rules.inline.tag.exec(ae);if(Ce)return!re&&/^<a /i.test(Ce[0])?re=!0:re&&/^<\/a>/i.test(Ce[0])&&(re=!1),!be&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ce[0])?be=!0:be&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ce[0])&&(be=!1),{type:this.options.sanitize?"text":"html",raw:Ce[0],inLink:re,inRawBlock:be,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):ne(Ce[0]):Ce[0]}},ye.link=function(ae){var re=this.rules.inline.link.exec(ae);if(re){var be=he(re[2],"()");if(be>-1){var Ce=re[0].indexOf("!")===0?5:4,Ie=Ce+re[1].length+be;re[2]=re[2].substring(0,be),re[0]=re[0].substring(0,Ie).trim(),re[3]=""}var De=re[2],Ge="";if(this.options.pedantic){var Qe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(De);Qe?(De=Qe[1],Ge=Qe[3]):Ge=""}else Ge=re[3]?re[3].slice(1,-1):"";De=De.trim().replace(/^<([\s\S]*)>$/,"$1");var dt=Ee(re,{href:De&&De.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},re[0]);return dt}},ye.reflink=function(ae,re){var be;if((be=this.rules.inline.reflink.exec(ae))||(be=this.rules.inline.nolink.exec(ae))){var Ce=(be[2]||be[1]).replace(/\s+/g," ");if(Ce=re[Ce.toLowerCase()],!Ce||!Ce.href){var Ie=be[0].charAt(0);return{type:"text",raw:Ie,text:Ie}}var De=Ee(be,Ce,be[0]);return De}},ye.strong=function(ae,re,be){be===void 0&&(be="");var Ce=this.rules.inline.strong.start.exec(ae);if(Ce&&(!Ce[1]||Ce[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){re=re.slice(-1*ae.length);var Ie=Ce[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ie.lastIndex=0;for(var De;(Ce=Ie.exec(re))!=null;)if(De=this.rules.inline.strong.middle.exec(re.slice(0,Ce.index+3)),De)return{type:"strong",raw:ae.slice(0,De[0].length),text:ae.slice(2,De[0].length-2)}}},ye.em=function(ae,re,be){be===void 0&&(be="");var Ce=this.rules.inline.em.start.exec(ae);if(Ce&&(!Ce[1]||Ce[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){re=re.slice(-1*ae.length);var Ie=Ce[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ie.lastIndex=0;for(var De;(Ce=Ie.exec(re))!=null;)if(De=this.rules.inline.em.middle.exec(re.slice(0,Ce.index+2)),De)return{type:"em",raw:ae.slice(0,De[0].length),text:ae.slice(1,De[0].length-1)}}},ye.codespan=function(ae){var re=this.rules.inline.code.exec(ae);if(re){var be=re[2].replace(/\n/g," "),Ce=/[^ ]/.test(be),Ie=be.startsWith(" ")&&be.endsWith(" ");return Ce&&Ie&&(be=be.substring(1,be.length-1)),be=ne(be,!0),{type:"codespan",raw:re[0],text:be}}},ye.br=function(ae){var re=this.rules.inline.br.exec(ae);if(re)return{type:"br",raw:re[0]}},ye.del=function(ae){var re=this.rules.inline.del.exec(ae);if(re)return{type:"del",raw:re[0],text:re[1]}},ye.autolink=function(ae,re){var be=this.rules.inline.autolink.exec(ae);if(be){var Ce,Ie;return be[2]==="@"?(Ce=ne(this.options.mangle?re(be[1]):be[1]),Ie="mailto:"+Ce):(Ce=ne(be[1]),Ie=Ce),{type:"link",raw:be[0],text:Ce,href:Ie,tokens:[{type:"text",raw:Ce,text:Ce}]}}},ye.url=function(ae,re){var be;if(be=this.rules.inline.url.exec(ae)){var Ce,Ie;if(be[2]==="@")Ce=ne(this.options.mangle?re(be[0]):be[0]),Ie="mailto:"+Ce;else{var De;do De=be[0],be[0]=this.rules.inline._backpedal.exec(be[0])[0];while(De!==be[0]);Ce=ne(be[0]),be[1]==="www."?Ie="http://"+Ce:Ie=Ce}return{type:"link",raw:be[0],text:Ce,href:Ie,tokens:[{type:"text",raw:Ce,text:Ce}]}}},ye.inlineText=function(ae,re,be){var Ce=this.rules.inline.text.exec(ae);if(Ce){var Ie;return re?Ie=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):ne(Ce[0]):Ce[0]:Ie=ne(this.options.smartypants?be(Ce[0]):Ce[0]),{type:"text",raw:Ce[0],text:Ie}}},we}(),me=H.noopTest,de=H.edit,pe=H.merge,se={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:me,table:me,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,se.def=de(se.def).replace("label",se._label).replace("title",se._title).getRegex(),se.bullet=/(?:[*+-]|\d{1,9}[.)])/,se.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,se.item=de(se.item,"gm").replace(/bull/g,se.bullet).getRegex(),se.list=de(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex(),se._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",se._comment=/<!--(?!-?>)[\s\S]*?-->/,se.html=de(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se.paragraph=de(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.blockquote=de(se.blockquote).replace("paragraph",se.paragraph).getRegex(),se.normal=pe({},se),se.gfm=pe({},se.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*|$)"}),se.gfm.nptable=de(se.gfm.nptable).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.gfm.table=de(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.pedantic=pe({},se.normal,{html:de(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:me,paragraph:de(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:me,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:me,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ce.punctuation=de(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=de(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=de(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=de(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=de(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=de(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=de(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=de(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=de(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=de(ce._blockSkip,"g").getRegex(),ce.overlapSkip=de(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._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])?)+(?![-_])/,ce.autolink=de(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=de(ce.tag).replace("comment",se._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=de(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=de(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=de(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=pe({},ce),ce.pedantic=pe({},ce.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:de(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:de(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=pe({},ce.normal,{escape:de(ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ce.gfm.url=de(ce.gfm.url,"i").replace("email",ce.gfm._extended_email).getRegex(),ce.breaks=pe({},ce.gfm,{br:de(ce.br).replace("{2,}","*").getRegex(),text:de(ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Z={block:se,inline:ce},te=K.defaults,le=Z.block,ve=Z.inline;function ie(we){return we.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function oe(we){var ye="",ge,ae,re=we.length;for(ge=0;ge<re;ge++)ae=we.charCodeAt(ge),Math.random()>.5&&(ae="x"+ae.toString(16)),ye+="&#"+ae+";";return ye}var xe=function(){function we(ge){this.tokens=[],this.tokens.links=Object.create(null),this.options=ge||te,this.options.tokenizer=this.options.tokenizer||new Oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:le.normal,inline:ve.normal};this.options.pedantic?(ae.block=le.pedantic,ae.inline=ve.pedantic):this.options.gfm&&(ae.block=le.gfm,this.options.breaks?ae.inline=ve.breaks:ae.inline=ve.gfm),this.tokenizer.rules=ae}we.lex=function(ae,re){var be=new we(re);return be.lex(ae)};var ye=we.prototype;return ye.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},ye.blockTokens=function(ae,re,be){re===void 0&&(re=[]),be===void 0&&(be=!0),ae=ae.replace(/^ +$/gm,"");for(var Ce,Ie,De,Ge;ae;){if(Ce=this.tokenizer.space(ae)){ae=ae.substring(Ce.raw.length),Ce.type&&re.push(Ce);continue}if(Ce=this.tokenizer.code(ae,re)){ae=ae.substring(Ce.raw.length),Ce.type?re.push(Ce):(Ge=re[re.length-1],Ge.raw+=`
`+Ce.raw,Ge.text+=`
`+Ce.text);continue}if(Ce=this.tokenizer.fences(ae)){ae=ae.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.heading(ae)){ae=ae.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.nptable(ae)){ae=ae.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.hr(ae)){ae=ae.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.blockquote(ae)){ae=ae.substring(Ce.raw.length),Ce.tokens=this.blockTokens(Ce.text,[],be),re.push(Ce);continue}if(Ce=this.tokenizer.list(ae)){for(ae=ae.substring(Ce.raw.length),De=Ce.items.length,Ie=0;Ie<De;Ie++)Ce.items[Ie].tokens=this.blockTokens(Ce.items[Ie].text,[],!1);re.push(Ce);continue}if(Ce=this.tokenizer.html(ae)){ae=ae.substring(Ce.raw.length),re.push(Ce);continue}if(be&&(Ce=this.tokenizer.def(ae))){ae=ae.substring(Ce.raw.length),this.tokens.links[Ce.tag]||(this.tokens.links[Ce.tag]={href:Ce.href,title:Ce.title});continue}if(Ce=this.tokenizer.table(ae)){ae=ae.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.lheading(ae)){ae=ae.substring(Ce.raw.length),re.push(Ce);continue}if(be&&(Ce=this.tokenizer.paragraph(ae))){ae=ae.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.text(ae,re)){ae=ae.substring(Ce.raw.length),Ce.type?re.push(Ce):(Ge=re[re.length-1],Ge.raw+=`
`+Ce.raw,Ge.text+=`
`+Ce.text);continue}if(ae){var Qe="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(Qe);break}else throw new Error(Qe)}}return re},ye.inline=function(ae){var re,be,Ce,Ie,De,Ge,Qe=ae.length;for(re=0;re<Qe;re++){Ge=ae[re];switch(Ge.type){case"paragraph":case"text":case"heading":{Ge.tokens=[],this.inlineTokens(Ge.text,Ge.tokens);break}case"table":{for(Ge.tokens={header:[],cells:[]},Ie=Ge.header.length,be=0;be<Ie;be++)Ge.tokens.header[be]=[],this.inlineTokens(Ge.header[be],Ge.tokens.header[be]);for(Ie=Ge.cells.length,be=0;be<Ie;be++)for(De=Ge.cells[be],Ge.tokens.cells[be]=[],Ce=0;Ce<De.length;Ce++)Ge.tokens.cells[be][Ce]=[],this.inlineTokens(De[Ce],Ge.tokens.cells[be][Ce]);break}case"blockquote":{this.inline(Ge.tokens);break}case"list":{for(Ie=Ge.items.length,be=0;be<Ie;be++)this.inline(Ge.items[be].tokens);break}}}return ae},ye.inlineTokens=function(ae,re,be,Ce,Ie){re===void 0&&(re=[]),be===void 0&&(be=!1),Ce===void 0&&(Ce=!1),Ie===void 0&&(Ie="");var De,Ge=ae,Qe;if(this.tokens.links){var dt=Object.keys(this.tokens.links);if(dt.length>0)for(;(Qe=this.tokenizer.rules.inline.reflinkSearch.exec(Ge))!=null;)dt.includes(Qe[0].slice(Qe[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,Qe.index)+"["+"a".repeat(Qe[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Qe=this.tokenizer.rules.inline.blockSkip.exec(Ge))!=null;)Ge=Ge.slice(0,Qe.index)+"["+"a".repeat(Qe[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(De=this.tokenizer.escape(ae)){ae=ae.substring(De.raw.length),re.push(De);continue}if(De=this.tokenizer.tag(ae,be,Ce)){ae=ae.substring(De.raw.length),be=De.inLink,Ce=De.inRawBlock,re.push(De);continue}if(De=this.tokenizer.link(ae)){ae=ae.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,Ce)),re.push(De);continue}if(De=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,Ce)),re.push(De);continue}if(De=this.tokenizer.strong(ae,Ge,Ie)){ae=ae.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],be,Ce),re.push(De);continue}if(De=this.tokenizer.em(ae,Ge,Ie)){ae=ae.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],be,Ce),re.push(De);continue}if(De=this.tokenizer.codespan(ae)){ae=ae.substring(De.raw.length),re.push(De);continue}if(De=this.tokenizer.br(ae)){ae=ae.substring(De.raw.length),re.push(De);continue}if(De=this.tokenizer.del(ae)){ae=ae.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],be,Ce),re.push(De);continue}if(De=this.tokenizer.autolink(ae,oe)){ae=ae.substring(De.raw.length),re.push(De);continue}if(!be&&(De=this.tokenizer.url(ae,oe))){ae=ae.substring(De.raw.length),re.push(De);continue}if(De=this.tokenizer.inlineText(ae,Ce,ie)){ae=ae.substring(De.raw.length),Ie=De.raw.slice(-1),re.push(De);continue}if(ae){var rt="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return re},V(we,null,[{key:"rules",get:function(){return{block:le,inline:ve}}}]),we}(),_e=K.defaults,Me=H.cleanUrl,Ue=H.escape,He=function(){function we(ge){this.options=ge||_e}var ye=we.prototype;return ye.code=function(ae,re,be){var Ce=(re||"").match(/\S*/)[0];if(this.options.highlight){var Ie=this.options.highlight(ae,Ce);Ie!=null&&Ie!==ae&&(be=!0,ae=Ie)}return Ce?'<pre><code class="'+this.options.langPrefix+Ue(Ce,!0)+'">'+(be?ae:Ue(ae,!0))+`</code></pre>
`:"<pre><code>"+(be?ae:Ue(ae,!0))+`</code></pre>
`},ye.blockquote=function(ae){return`<blockquote>
`+ae+`</blockquote>
`},ye.html=function(ae){return ae},ye.heading=function(ae,re,be,Ce){return this.options.headerIds?"<h"+re+' id="'+this.options.headerPrefix+Ce.slug(be)+'">'+ae+"</h"+re+`>
`:"<h"+re+">"+ae+"</h"+re+`>
`},ye.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ye.list=function(ae,re,be){var Ce=re?"ol":"ul",Ie=re&&be!==1?' start="'+be+'"':"";return"<"+Ce+Ie+`>
`+ae+"</"+Ce+`>
`},ye.listitem=function(ae){return"<li>"+ae+`</li>
`},ye.checkbox=function(ae){return"<input "+(ae?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ye.paragraph=function(ae){return"<p>"+ae+`</p>
`},ye.table=function(ae,re){return re&&(re="<tbody>"+re+"</tbody>"),`<table>
<thead>
`+ae+`</thead>
`+re+`</table>
`},ye.tablerow=function(ae){return`<tr>
`+ae+`</tr>
`},ye.tablecell=function(ae,re){var be=re.header?"th":"td",Ce=re.align?"<"+be+' align="'+re.align+'">':"<"+be+">";return Ce+ae+"</"+be+`>
`},ye.strong=function(ae){return"<strong>"+ae+"</strong>"},ye.em=function(ae){return"<em>"+ae+"</em>"},ye.codespan=function(ae){return"<code>"+ae+"</code>"},ye.br=function(){return this.options.xhtml?"<br/>":"<br>"},ye.del=function(ae){return"<del>"+ae+"</del>"},ye.link=function(ae,re,be){if(ae=Me(this.options.sanitize,this.options.baseUrl,ae),ae===null)return be;var Ce='<a href="'+Ue(ae)+'"';return re&&(Ce+=' title="'+re+'"'),Ce+=">"+be+"</a>",Ce},ye.image=function(ae,re,be){if(ae=Me(this.options.sanitize,this.options.baseUrl,ae),ae===null)return be;var Ce='<img src="'+ae+'" alt="'+be+'"';return re&&(Ce+=' title="'+re+'"'),Ce+=this.options.xhtml?"/>":">",Ce},ye.text=function(ae){return ae},we}(),Be=function(){function we(){}var ye=we.prototype;return ye.strong=function(ae){return ae},ye.em=function(ae){return ae},ye.codespan=function(ae){return ae},ye.del=function(ae){return ae},ye.html=function(ae){return ae},ye.text=function(ae){return ae},ye.link=function(ae,re,be){return""+be},ye.image=function(ae,re,be){return""+be},ye.br=function(){return""},we}(),tt=function(){function we(){this.seen={}}var ye=we.prototype;return ye.slug=function(ae){var re=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var be=re;do this.seen[be]++,re=be+"-"+this.seen[be];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},we}(),Je=K.defaults,st=H.unescape,nt=function(){function we(ge){this.options=ge||Je,this.options.renderer=this.options.renderer||new He,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new tt}we.parse=function(ae,re){var be=new we(re);return be.parse(ae)};var ye=we.prototype;return ye.parse=function(ae,re){re===void 0&&(re=!0);var be="",Ce,Ie,De,Ge,Qe,dt,rt,ht,ft,at,Dt,Lt,Tt,Rt,wt,Ut,Nt,qe,Ze=ae.length;for(Ce=0;Ce<Ze;Ce++){at=ae[Ce];switch(at.type){case"space":continue;case"hr":{be+=this.renderer.hr();continue}case"heading":{be+=this.renderer.heading(this.parseInline(at.tokens),at.depth,st(this.parseInline(at.tokens,this.textRenderer)),this.slugger);continue}case"code":{be+=this.renderer.code(at.text,at.lang,at.escaped);continue}case"table":{for(ht="",rt="",Ge=at.header.length,Ie=0;Ie<Ge;Ie++)rt+=this.renderer.tablecell(this.parseInline(at.tokens.header[Ie]),{header:!0,align:at.align[Ie]});for(ht+=this.renderer.tablerow(rt),ft="",Ge=at.cells.length,Ie=0;Ie<Ge;Ie++){for(dt=at.tokens.cells[Ie],rt="",Qe=dt.length,De=0;De<Qe;De++)rt+=this.renderer.tablecell(this.parseInline(dt[De]),{header:!1,align:at.align[De]});ft+=this.renderer.tablerow(rt)}be+=this.renderer.table(ht,ft);continue}case"blockquote":{ft=this.parse(at.tokens),be+=this.renderer.blockquote(ft);continue}case"list":{for(Dt=at.ordered,Lt=at.start,Tt=at.loose,Ge=at.items.length,ft="",Ie=0;Ie<Ge;Ie++)wt=at.items[Ie],Ut=wt.checked,Nt=wt.task,Rt="",wt.task&&(qe=this.renderer.checkbox(Ut),Tt?wt.tokens.length>0&&wt.tokens[0].type==="text"?(wt.tokens[0].text=qe+" "+wt.tokens[0].text,wt.tokens[0].tokens&&wt.tokens[0].tokens.length>0&&wt.tokens[0].tokens[0].type==="text"&&(wt.tokens[0].tokens[0].text=qe+" "+wt.tokens[0].tokens[0].text)):wt.tokens.unshift({type:"text",text:qe}):Rt+=qe),Rt+=this.parse(wt.tokens,Tt),ft+=this.renderer.listitem(Rt,Nt,Ut);be+=this.renderer.list(ft,Dt,Lt);continue}case"html":{be+=this.renderer.html(at.text);continue}case"paragraph":{be+=this.renderer.paragraph(this.parseInline(at.tokens));continue}case"text":{for(ft=at.tokens?this.parseInline(at.tokens):at.text;Ce+1<Ze&&ae[Ce+1].type==="text";)at=ae[++Ce],ft+=`
`+(at.tokens?this.parseInline(at.tokens):at.text);be+=re?this.renderer.paragraph(ft):ft;continue}default:{var ze='Token with "'+at.type+'" type was not found.';if(this.options.silent){console.error(ze);return}else throw new Error(ze)}}}return be},ye.parseInline=function(ae,re){re=re||this.renderer;var be="",Ce,Ie,De=ae.length;for(Ce=0;Ce<De;Ce++){Ie=ae[Ce];switch(Ie.type){case"escape":{be+=re.text(Ie.text);break}case"html":{be+=re.html(Ie.text);break}case"link":{be+=re.link(Ie.href,Ie.title,this.parseInline(Ie.tokens,re));break}case"image":{be+=re.image(Ie.href,Ie.title,Ie.text);break}case"strong":{be+=re.strong(this.parseInline(Ie.tokens,re));break}case"em":{be+=re.em(this.parseInline(Ie.tokens,re));break}case"codespan":{be+=re.codespan(Ie.text);break}case"br":{be+=re.br();break}case"del":{be+=re.del(this.parseInline(Ie.tokens,re));break}case"text":{be+=re.text(Ie.text);break}default:{var Ge='Token with "'+Ie.type+'" type was not found.';if(this.options.silent){console.error(Ge);return}else throw new Error(Ge)}}}return be},we}(),pt=H.merge,mt=H.checkSanitizeDeprecation,ke=H.escape,Le=K.getDefaults,We=K.changeDefaults,Ve=K.defaults;function Ne(we,ye,ge){if(typeof we=="undefined"||we===null)throw new Error("marked(): input parameter is undefined or null");if(typeof we!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(we)+", string expected");if(typeof ye=="function"&&(ge=ye,ye=null),ye=pt({},Ne.defaults,ye||{}),mt(ye),ge){var ae=ye.highlight,re;try{re=xe.lex(we,ye)}catch(De){return ge(De)}var be=function(Ge){var Qe;if(!Ge)try{Qe=nt.parse(re,ye)}catch(dt){Ge=dt}return ye.highlight=ae,Ge?ge(Ge):ge(null,Qe)};if(!ae||ae.length<3)return be();if(delete ye.highlight,!re.length)return be();var Ce=0;Ne.walkTokens(re,function(De){De.type==="code"&&(Ce++,setTimeout(function(){ae(De.text,De.lang,function(Ge,Qe){if(Ge)return be(Ge);Qe!=null&&Qe!==De.text&&(De.text=Qe,De.escaped=!0),Ce--,Ce===0&&be()})},0))}),Ce===0&&be();return}try{var Ie=xe.lex(we,ye);return ye.walkTokens&&Ne.walkTokens(Ie,ye.walkTokens),nt.parse(Ie,ye)}catch(De){if(De.message+=`
Please report this to https://github.com/markedjs/marked.`,ye.silent)return"<p>An error occurred:</p><pre>"+ke(De.message+"",!0)+"</pre>";throw De}}Ne.options=Ne.setOptions=function(we){return pt(Ne.defaults,we),We(Ne.defaults),Ne},Ne.getDefaults=Le,Ne.defaults=Ve,Ne.use=function(we){var ye=pt({},we);if(we.renderer&&function(){var ae=Ne.defaults.renderer||new He,re=function(Ie){var De=ae[Ie];ae[Ie]=function(){for(var Ge=arguments.length,Qe=new Array(Ge),dt=0;dt<Ge;dt++)Qe[dt]=arguments[dt];var rt=we.renderer[Ie].apply(ae,Qe);return rt===!1&&(rt=De.apply(ae,Qe)),rt}};for(var be in we.renderer)re(be);ye.renderer=ae}(),we.tokenizer&&function(){var ae=Ne.defaults.tokenizer||new Oe,re=function(Ie){var De=ae[Ie];ae[Ie]=function(){for(var Ge=arguments.length,Qe=new Array(Ge),dt=0;dt<Ge;dt++)Qe[dt]=arguments[dt];var rt=we.tokenizer[Ie].apply(ae,Qe);return rt===!1&&(rt=De.apply(ae,Qe)),rt}};for(var be in we.tokenizer)re(be);ye.tokenizer=ae}(),we.walkTokens){var ge=Ne.defaults.walkTokens;ye.walkTokens=function(ae){we.walkTokens(ae),ge&&ge(ae)}}Ne.setOptions(ye)},Ne.walkTokens=function(we,ye){for(var ge=N(we),ae;!(ae=ge()).done;){var re=ae.value;ye(re);switch(re.type){case"table":{for(var be=N(re.tokens.header),Ce;!(Ce=be()).done;){var Ie=Ce.value;Ne.walkTokens(Ie,ye)}for(var De=N(re.tokens.cells),Ge;!(Ge=De()).done;)for(var Qe=Ge.value,dt=N(Qe),rt;!(rt=dt()).done;){var ht=rt.value;Ne.walkTokens(ht,ye)}break}case"list":{Ne.walkTokens(re.items,ye);break}default:re.tokens&&Ne.walkTokens(re.tokens,ye)}}},Ne.Parser=nt,Ne.parser=nt.parse,Ne.Renderer=He,Ne.TextRenderer=Be,Ne.Lexer=xe,Ne.lexer=xe.lex,Ne.Tokenizer=Oe,Ne.Slugger=tt,Ne.parse=Ne;var Ke=Ne;return Ke})},ELLl:function(ct,Te,W){(function(ue){ue(W("VrN/"))})(function(ue){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(f,g,a){a&&a!=ue.Init&&(f.removeKeyMap(N),f.state.closeBrackets=null),g&&(L($(g,"pairs")),f.state.closeBrackets=g,f.addKeyMap(N))});function $(f,g){return g=="pairs"&&typeof f=="string"?f:typeof f=="object"&&f[g]!=null?f[g]:V[g]}var N={Backspace:R,Enter:A};function L(f){for(var g=0;g<f.length;g++){var a=f.charAt(g),r="'"+a+"'";N[r]||(N[r]=K(a))}}L(V.pairs+"`");function K(f){return function(g){return y(g,f)}}function F(f){var g=f.state.closeBrackets;if(!g||g.override)return g;var a=f.getModeAt(f.getCursor());return a.closeBrackets||g}function R(f){var g=F(f);if(!g||f.getOption("disableInput"))return ue.Pass;for(var a=$(g,"pairs"),r=f.listSelections(),o=0;o<r.length;o++){if(!r[o].empty())return ue.Pass;var l=w(f,r[o].head);if(!l||a.indexOf(l)%2!=0)return ue.Pass}for(var o=r.length-1;o>=0;o--){var C=r[o].head;f.replaceRange("",P(C.line,C.ch-1),P(C.line,C.ch+1),"+delete")}}function A(f){var g=F(f),a=g&&$(g,"explode");if(!a||f.getOption("disableInput"))return ue.Pass;for(var r=f.listSelections(),o=0;o<r.length;o++){if(!r[o].empty())return ue.Pass;var l=w(f,r[o].head);if(!l||a.indexOf(l)%2!=0)return ue.Pass}f.operation(function(){var C=f.lineSeparator()||`
`;f.replaceSelection(C+C,null),f.execCommand("goCharLeft"),r=f.listSelections();for(var b=0;b<r.length;b++){var x=r[b].head.line;f.indentLine(x,null,!0),f.indentLine(x+1,null,!0)}})}function h(f){var g=ue.cmpPos(f.anchor,f.head)>0;return{anchor:new P(f.anchor.line,f.anchor.ch+(g?-1:1)),head:new P(f.head.line,f.head.ch+(g?1:-1))}}function y(f,g){var a=F(f);if(!a||f.getOption("disableInput"))return ue.Pass;var r=$(a,"pairs"),o=r.indexOf(g);if(o==-1)return ue.Pass;for(var l=$(a,"closeBefore"),C=$(a,"triples"),b=r.charAt(o+1)==g,x=f.listSelections(),D=o%2==0,T,m=0;m<x.length;m++){var v=x[m],u=v.head,s,S=f.getRange(u,P(u.line,u.ch+1));if(D&&!v.empty())s="surround";else if((b||!D)&&S==g)b&&p(f,u)?s="both":C.indexOf(g)>=0&&f.getRange(u,P(u.line,u.ch+3))==g+g+g?s="skipThree":s="skip";else if(b&&u.ch>1&&C.indexOf(g)>=0&&f.getRange(P(u.line,u.ch-2),u)==g+g){if(u.ch>2&&/\bstring/.test(f.getTokenTypeAt(P(u.line,u.ch-2))))return ue.Pass;s="addFour"}else if(b){var c=u.ch==0?" ":f.getRange(P(u.line,u.ch-1),u);if(!ue.isWordChar(S)&&c!=g&&!ue.isWordChar(c))s="both";else return ue.Pass}else if(D&&(S.length===0||/\s/.test(S)||l.indexOf(S)>-1))s="both";else return ue.Pass;if(!T)T=s;else if(T!=s)return ue.Pass}var O=o%2?r.charAt(o-1):g,M=o%2?g:r.charAt(o+1);f.operation(function(){if(T=="skip")f.execCommand("goCharRight");else if(T=="skipThree")for(var B=0;B<3;B++)f.execCommand("goCharRight");else if(T=="surround"){for(var j=f.getSelections(),B=0;B<j.length;B++)j[B]=O+j[B]+M;f.replaceSelections(j,"around"),j=f.listSelections().slice();for(var B=0;B<j.length;B++)j[B]=h(j[B]);f.setSelections(j)}else T=="both"?(f.replaceSelection(O+M,null),f.triggerElectric(O+M),f.execCommand("goCharLeft")):T=="addFour"&&(f.replaceSelection(O+O+O+O,"before"),f.execCommand("goCharRight"))})}function w(f,g){var a=f.getRange(P(g.line,g.ch-1),P(g.line,g.ch+1));return a.length==2?a:null}function p(f,g){var a=f.getTokenAt(P(g.line,g.ch+1));return/\bstring/.test(a.type)&&a.start==g.ch&&(g.ch==0||!/\bstring/.test(f.getTokenTypeAt(g)))}})},EgHG:function(ct,Te,W){ct.exports={wrap:"wrap___2vVqS",modal:"modal___AcHKf",titleWrap:"titleWrap___YV24j",required:"required___3XHD4",title:"title___3yV4s",colorGray:"colorGray___2oRqv",choiceWrap:"choiceWrap___2ypJV",answer:"answer___1tmCF",activeAnswer:"activeAnswer___7NV4I",deleteIcon:"deleteIcon___3LBHf",addIcon:"addIcon___2MzTA",editorWrap:"editorWrap___1Xe94",htmlWrap:"htmlWrap___14WFO",radio:"radio___1kFzU",color333:"color333___1Kwa2",color999:"color999___4cmSp",fold:"fold___1JSf-",head:"head___-ebd0"}},GfqC:function(ct,Te,W){"use strict";var ue=W("q1tI"),V=W.n(ue),P=W("TSYQ"),$=W.n(P);function N(H,I){var U="cannot "+H.method+" "+H.action+" "+I.status+"'",J=new Error(U);return J.status=I.status,J.method=H.method,J.url=H.action,J}function L(H){var I=H.responseText||H.response;if(!I)return I;try{return JSON.parse(I)}catch(U){return I}}function K(H){var I=new XMLHttpRequest;H.onProgress&&I.upload&&(I.upload.onprogress=function(he){he.total>0&&(he.percent=he.loaded/he.total*100),H.onProgress(he)});var U=new FormData;H.data&&Object.keys(H.data).forEach(function(ne){var he=H.data[ne];if(Array.isArray(he)){he.forEach(function(Ee){U.append(ne+"[]",Ee)});return}U.append(ne,H.data[ne])}),H.file instanceof Blob?U.append(H.filename,H.file,H.file.name):U.append(H.filename,H.file),I.onerror=function(he){H.onError(he)},I.onload=function(){return I.status<200||I.status>=300?H.onError(N(H,I),L(I)):H.onSuccess(L(I),I)},I.open(H.method,H.action,!0),H.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var J=H.headers||{};return J["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(J).forEach(function(ne){J[ne]!==null&&I.setRequestHeader(ne,J[ne])}),I.send(U),{abort:function(){I.abort()}}}var F=+new Date,R=0;function A(){return"rc-upload-"+F+"-"+ ++R}function h(H,I){return H.indexOf(I,H.length-I.length)!==-1}var y=function(H,I){if(H&&I){var U=Array.isArray(I)?I:I.split(","),J=H.name||"",ne=H.type||"",he=ne.replace(/\/.*$/,"");return U.some(function(Ee){var Ae=Ee.trim();return Ae.charAt(0)==="."?h(J.toLowerCase(),Ae.toLowerCase()):/\/\*$/.test(Ae)?he===Ae.replace(/\/.*$/,""):ne===Ae})}return!0};function w(H,I){var U=H.createReader(),J=[];function ne(){U.readEntries(function(he){var Ee=Array.prototype.slice.apply(he);J=J.concat(Ee);var Ae=!Ee.length;Ae?I(J):ne()})}ne()}var p=function(I,U,J){var ne=function he(Ee,Ae){Ae=Ae||"",Ee.isFile?Ee.file(function(Oe){J(Oe)&&(Ee.fullPath&&!Oe.webkitRelativePath&&(Object.defineProperties(Oe,{webkitRelativePath:{writable:!0}}),Oe.webkitRelativePath=Ee.fullPath.replace(/^\//,""),Object.defineProperties(Oe,{webkitRelativePath:{writable:!1}})),U([Oe]))}):Ee.isDirectory&&w(Ee,function(Oe){Oe.forEach(function(me){he(me,""+Ae+Ee.name+"/")})})};I.forEach(function(he){ne(he.webkitGetAsEntry())})},f=p,g=Object.assign||function(H){for(var I=1;I<arguments.length;I++){var U=arguments[I];for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(H[J]=U[J])}return H},a=function(){function H(I,U){var J=[],ne=!0,he=!1,Ee=void 0;try{for(var Ae=I[Symbol.iterator](),Oe;!(ne=(Oe=Ae.next()).done)&&!(J.push(Oe.value),U&&J.length===U);ne=!0);}catch(me){he=!0,Ee=me}finally{try{!ne&&Ae.return&&Ae.return()}finally{if(he)throw Ee}}return J}return function(I,U){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return H(I,U);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function H(I,U){for(var J=0;J<U.length;J++){var ne=U[J];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(I,ne.key,ne)}}return function(I,U,J){return U&&H(I.prototype,U),J&&H(I,J),I}}();function o(H,I,U){return I in H?Object.defineProperty(H,I,{value:U,enumerable:!0,configurable:!0,writable:!0}):H[I]=U,H}function l(H,I){var U={};for(var J in H){if(I.indexOf(J)>=0)continue;if(!Object.prototype.hasOwnProperty.call(H,J))continue;U[J]=H[J]}return U}function C(H,I){if(!(H instanceof I))throw new TypeError("Cannot call a class as a function")}function b(H,I){if(!H)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:H}function x(H,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);H.prototype=Object.create(I&&I.prototype,{constructor:{value:H,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(H,I):H.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(U,J){return(J.substr(0,5)==="data-"||J.substr(0,5)==="aria-"||J==="role")&&(U[J]=I[J]),U},{})},T=function(H){x(I,H);function I(){var U,J,ne,he;C(this,I);for(var Ee=arguments.length,Ae=Array(Ee),Oe=0;Oe<Ee;Oe++)Ae[Oe]=arguments[Oe];return he=(J=(ne=b(this,(U=I.__proto__||Object.getPrototypeOf(I)).call.apply(U,[this].concat(Ae))),ne),ne.state={uid:A()},ne.reqs={},ne.onChange=function(me){var de=me.target.files;ne.uploadFiles(de),ne.reset()},ne.onClick=function(me){var de=ne.fileInput;if(!de)return;var pe=ne.props,se=pe.children,ce=pe.onClick;se&&se.type==="button"&&(de.parentNode.focus(),de.parentNode.querySelector("button").blur()),de.click(),ce&&ce(me)},ne.onKeyDown=function(me){me.key==="Enter"&&ne.onClick()},ne.onFileDrop=function(me){var de=ne.props.multiple;if(me.preventDefault(),me.type==="dragover")return;if(ne.props.directory)f(Array.prototype.slice.call(me.dataTransfer.items),ne.uploadFiles,function(se){return y(se,ne.props.accept)});else{var pe=Array.prototype.slice.call(me.dataTransfer.files).filter(function(se){return y(se,ne.props.accept)});de===!1&&(pe=pe.slice(0,1)),ne.uploadFiles(pe)}},ne.uploadFiles=function(me){var de=Array.prototype.slice.call(me);de.map(function(pe){return pe.uid=A(),pe}).forEach(function(pe){ne.upload(pe,de)})},ne.saveFileInput=function(me){ne.fileInput=me},J),b(ne,he)}return r(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(J,ne){var he=this,Ee=this.props;if(!Ee.beforeUpload)return setTimeout(function(){return he.post(J)},0);var Ae=Ee.beforeUpload(J,ne);Ae&&Ae.then?Ae.then(function(Oe){var me=Object.prototype.toString.call(Oe);return me==="[object File]"||me==="[object Blob]"?he.post(Oe):he.post(J)}).catch(function(Oe){console.log(Oe)}):Ae!==!1&&setTimeout(function(){return he.post(J)},0);return}},{key:"post",value:function(J){var ne=this;if(!this._isMounted)return;var he=this.props,Ee=he.onStart,Ae=he.onProgress,Oe=he.transformFile,me=Oe===void 0?function(de){return de}:Oe;new Promise(function(de){var pe=he.action;return typeof pe=="function"&&(pe=pe(J)),de(pe)}).then(function(de){var pe=J.uid,se=he.customRequest||K,ce=Promise.resolve(me(J)).then(function(Z){var te=he.data;return typeof te=="function"&&(te=te(Z)),Promise.all([Z,te])}).catch(function(Z){console.error(Z)});ce.then(function(Z){var te=a(Z,2),le=te[0],ve=te[1],ie={action:de,filename:he.name,data:ve,file:le,headers:he.headers,withCredentials:he.withCredentials,method:he.method||"post",onProgress:Ae?function(oe){Ae(oe,J)}:null,onSuccess:function(xe,_e){delete ne.reqs[pe],he.onSuccess(xe,J,_e)},onError:function(xe,_e){delete ne.reqs[pe],he.onError(xe,_e,J)}};Ee(J),ne.reqs[pe]=se(ie)})})}},{key:"reset",value:function(){this.setState({uid:A()})}},{key:"abort",value:function(J){var ne=this.reqs;if(J){var he=J;J&&J.uid&&(he=J.uid),ne[he]&&ne[he].abort&&ne[he].abort(),delete ne[he]}else Object.keys(ne).forEach(function(Ee){ne[Ee]&&ne[Ee].abort&&ne[Ee].abort(),delete ne[Ee]})}},{key:"render",value:function(){var J,ne=this.props,he=ne.component,Ee=ne.prefixCls,Ae=ne.className,Oe=ne.disabled,me=ne.id,de=ne.style,pe=ne.multiple,se=ne.accept,ce=ne.children,Z=ne.directory,te=ne.openFileDialogOnClick,le=ne.onMouseEnter,ve=ne.onMouseLeave,ie=l(ne,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),oe=$()((J={},o(J,Ee,!0),o(J,Ee+"-disabled",Oe),o(J,Ae,Ae),J)),xe=Oe?{}:{onClick:te?this.onClick:function(){},onKeyDown:te?this.onKeyDown:function(){},onMouseEnter:le,onMouseLeave:ve,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return V.a.createElement(he,g({},xe,{className:oe,role:"button",style:de}),V.a.createElement("input",g({},D(ie),{id:me,type:"file",ref:this.saveFileInput,onClick:function(Me){return Me.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:se,directory:Z?"directory":null,webkitdirectory:Z?"webkitdirectory":null,multiple:pe,onChange:this.onChange})),ce)}}]),I}(ue.Component),m=T,v=Object.assign||function(H){for(var I=1;I<arguments.length;I++){var U=arguments[I];for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(H[J]=U[J])}return H},u=function(){function H(I,U){for(var J=0;J<U.length;J++){var ne=U[J];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(I,ne.key,ne)}}return function(I,U,J){return U&&H(I.prototype,U),J&&H(I,J),I}}();function s(H,I){if(!(H instanceof I))throw new TypeError("Cannot call a class as a function")}function S(H,I){if(!H)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:H}function c(H,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);H.prototype=Object.create(I&&I.prototype,{constructor:{value:H,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(H,I):H.__proto__=I)}function O(){}var M=function(H){c(I,H);function I(){var U,J,ne,he;s(this,I);for(var Ee=arguments.length,Ae=Array(Ee),Oe=0;Oe<Ee;Oe++)Ae[Oe]=arguments[Oe];return he=(J=(ne=S(this,(U=I.__proto__||Object.getPrototypeOf(I)).call.apply(U,[this].concat(Ae))),ne),ne.saveUploader=function(me){ne.uploader=me},J),S(ne,he)}return u(I,[{key:"abort",value:function(J){this.uploader.abort(J)}},{key:"render",value:function(){return V.a.createElement(m,v({},this.props,{ref:this.saveUploader}))}}]),I}(ue.Component);M.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:O,onError:O,onSuccess:O,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var B=M,j=Te.a=B},HmJG:function(ct,Te,W){},IBYe:function(ct,Te,W){"use strict";function ue(V){return null}Te.a=ue},JYp7:function(ct,Te,W){"use strict";W.d(Te,"c",function(){return V}),W.d(Te,"d",function(){return P}),W.d(Te,"f",function(){return N}),W.d(Te,"a",function(){return L}),W.d(Te,"b",function(){return K}),W.d(Te,"e",function(){return F});var ue=function(){var R=function(A,h){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,w){y.__proto__=w}||function(y,w){for(var p in w)w.hasOwnProperty(p)&&(y[p]=w[p])},R(A,h)};return function(A,h){R(A,h);function y(){this.constructor=A}A.prototype=h===null?Object.create(h):(y.prototype=h.prototype,new y)}}(),V={done:!0,value:void 0},P;(function(R){var A={next:function(){return V}};function h(){return A}R.empty=h;function y(b){var x=!1;return{next:function(){return x?V:(x=!0,{done:!1,value:b})}}}R.single=y;function w(b,x,D){return x===void 0&&(x=0),D===void 0&&(D=b.length),{next:function(){return x>=D?V:{done:!1,value:b[x++]}}}}R.fromArray=w;function p(b){return{next:function(){var x=b.next();return x.done?V:{done:!1,value:x.value}}}}R.fromNativeIterator=p;function f(b){return b?Array.isArray(b)?R.fromArray(b):b:R.empty()}R.from=f;function g(b,x){return{next:function(){var D=b.next();return D.done?V:{done:!1,value:x(D.value)}}}}R.map=g;function a(b,x){return{next:function(){for(;;){var D=b.next();if(D.done)return V;if(x(D.value))return{done:!1,value:D.value}}}}}R.filter=a;function r(b,x){for(var D=b.next();!D.done;D=b.next())x(D.value)}R.forEach=r;function o(b,x){x===void 0&&(x=Number.POSITIVE_INFINITY);var D=[];if(x===0)return D;for(var T=0,m=b.next();!m.done&&!(D.push(m.value),++T>=x);m=b.next());return D}R.collect=o;function l(){for(var b=[],x=0;x<arguments.length;x++)b[x]=arguments[x];var D=0;return{next:function(){if(D>=b.length)return V;var T=b[D],m=T.next();return m.done?(D++,this.next()):m}}}R.concat=l;function C(b){return new $(b)}R.chain=C})(P||(P={}));var $=function(){function R(A){this.it=A}return R.prototype.next=function(){return this.it.next()},R}();function N(R){return Array.isArray(R)?P.fromArray(R):R||P.empty()}var L=function(){function R(A,h,y,w){h===void 0&&(h=0),y===void 0&&(y=A.length),w===void 0&&(w=h-1),this.items=A,this.start=h,this.end=y,this.index=w}return R.prototype.first=function(){return this.index=this.start,this.current()},R.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},R.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},R}(),K=function(R){ue(A,R);function A(h,y,w,p){return y===void 0&&(y=0),w===void 0&&(w=h.length),p===void 0&&(p=y-1),R.call(this,h,y,w,p)||this}return A.prototype.current=function(){return R.prototype.current.call(this)},A.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},A.prototype.first=function(){return this.index=this.start,this.current()},A.prototype.last=function(){return this.index=this.end-1,this.current()},A.prototype.parent=function(){return null},A}(L),F=function(){function R(A,h){this.iterator=A,this.fn=h}return R.prototype.next=function(){return this.fn(this.iterator.next())},R}()},LdHM:function(ct,Te,W){"use strict";W.d(Te,"b",function(){return l}),W.d(Te,"a",function(){return b});var ue=W("1OyB"),V=W("vuIU"),P=W("Ji7U"),$=W("LK+K"),N=W("q1tI"),L=W("rePB"),K=W("Ff2n"),F=W("ODXe"),R=W("4IlW"),A=W("bX4T"),h=W("YrtM"),y=W("TSYQ"),w=W.n(y),p=W("+nKL"),f=W("8OUc"),g=function(J,ne){var he=J.prefixCls,Ee=J.id,Ae=J.flattenOptions,Oe=J.childrenAsData,me=J.values,de=J.searchValue,pe=J.multiple,se=J.defaultActiveFirstOption,ce=J.height,Z=J.itemHeight,te=J.notFoundContent,le=J.open,ve=J.menuItemSelectedIcon,ie=J.virtual,oe=J.onSelect,xe=J.onToggleOpen,_e=J.onActiveValue,Me=J.onScroll,Ue=J.onMouseEnter,He="".concat(he,"-item"),Be=Object(h.a)(function(){return Ae},[le,Ae],function(Ke,we){return we[0]&&Ke[1]!==we[1]}),tt=N.useRef(null),Je=function(we){we.preventDefault()},st=function(we){tt.current&&tt.current.scrollTo({index:we})},nt=function(we){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ge=Be.length,ae=0;ae<ge;ae+=1){var re=(we+ae*ye+ge)%ge,be=Be[re],Ce=be.group,Ie=be.data;if(!Ce&&!Ie.disabled)return re}return-1},pt=N.useState(function(){return nt(0)}),mt=Object(F.a)(pt,2),ke=mt[0],Le=mt[1],We=function(we){Le(we);var ye=Be[we];if(!ye){_e(null,-1);return}_e(ye.data.value,we)};N.useEffect(function(){We(se!==!1?nt(0):-1)},[Be.length,de]),N.useEffect(function(){var Ke=setTimeout(function(){if(!pe&&le&&me.size===1){var we=Array.from(me)[0],ye=Be.findIndex(function(ge){var ae=ge.data;return ae.value===we});We(ye),st(ye)}});return function(){return clearTimeout(Ke)}},[le]);var Ve=function(we){we!==void 0&&oe(we,{selected:!me.has(we)}),pe||xe(!1)};if(N.useImperativeHandle(ne,function(){return{onKeyDown:function(we){var ye=we.which;switch(ye){case R.a.UP:case R.a.DOWN:{var ge=0;if(ye===R.a.UP?ge=-1:ye===R.a.DOWN&&(ge=1),ge!==0){var ae=nt(ke+ge,ge);st(ae),We(ae)}break}case R.a.ENTER:{var re=Be[ke];re&&!re.data.disabled?Ve(re.data.value):Ve(void 0),le&&we.preventDefault();break}case R.a.ESC:xe(!1)}},onKeyUp:function(){},scrollTo:function(we){st(we)}}}),Be.length===0)return N.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),className:"".concat(He,"-empty"),onMouseDown:Je},te);function Ne(Ke){var we=Be[Ke];if(!we)return null;var ye=we.data||{},ge=ye.value,ae=ye.label,re=ye.children,be=Object(A.a)(ye,!0),Ce=Oe?re:ae;return we?N.createElement("div",Object.assign({"aria-label":typeof Ce=="string"?Ce:null},be,{key:Ke,role:"option",id:"".concat(Ee,"_list_").concat(Ke),"aria-selected":me.has(ge)}),ge):null}return N.createElement(N.Fragment,null,N.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ne(ke-1),Ne(ke),Ne(ke+1)),N.createElement(p.a,{itemKey:"key",ref:tt,data:Be,height:ce,itemHeight:Z,fullHeight:!1,onMouseDown:Je,onScroll:Me,virtual:ie,onMouseEnter:Ue},function(Ke,we){var ye,ge=Ke.group,ae=Ke.groupOption,re=Ke.data,be=re.label,Ce=re.key;if(ge)return N.createElement("div",{className:w()(He,"".concat(He,"-group"))},be!==void 0?be:Ce);var Ie=re.disabled,De=re.value,Ge=re.title,Qe=re.children,dt=re.style,rt=re.className,ht=Object(K.a)(re,["disabled","value","title","children","style","className"]),ft=me.has(De),at="".concat(He,"-option"),Dt=w()(He,at,rt,(ye={},Object(L.a)(ye,"".concat(at,"-grouped"),ae),Object(L.a)(ye,"".concat(at,"-active"),ke===we&&!Ie),Object(L.a)(ye,"".concat(at,"-disabled"),Ie),Object(L.a)(ye,"".concat(at,"-selected"),ft),ye)),Lt=Oe?Qe:be,Tt=!ve||typeof ve=="function"||ft;return N.createElement("div",Object.assign({},ht,{"aria-selected":ft,className:Dt,title:Ge,onMouseMove:function(){if(ke===we||Ie)return;We(we)},onClick:function(){Ie||Ve(De)},style:dt}),N.createElement("div",{className:"".concat(at,"-content")},Lt||De),N.isValidElement(ve)||ft,Tt&&N.createElement(f.a,{className:"".concat(He,"-option-state"),customizeIcon:ve,customizeIconProps:{isSelected:ft}},ft?"\u2713":null))}))},a=N.forwardRef(g);a.displayName="OptionList";var r=a,o=function(){return null};o.isSelectOption=!0;var l=o,C=function(){return null};C.isSelectOptGroup=!0;var b=C,x=W("VTBJ"),D=W("Zm9Q");function T(U){var J=U.key,ne=U.props,he=ne.children,Ee=ne.value,Ae=Object(K.a)(ne,["children","value"]);return Object(x.a)({key:J,value:Ee!==void 0?Ee:J,children:he},Ae)}function m(U){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(U).map(function(ne,he){if(!N.isValidElement(ne)||!ne.type)return null;var Ee=ne.type.isSelectOptGroup,Ae=ne.key,Oe=ne.props,me=Oe.children,de=Object(K.a)(Oe,["children"]);return J||!Ee?T(ne):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(Ae===null?he:Ae,"__"),label:Ae},de),{},{options:m(me)})}).filter(function(ne){return ne})}var v=W("2Qr1"),u=W("qNPg"),s=W("U8pU"),S=W("Kwbf"),c=W("WKfj");function O(U){var J=U.mode,ne=U.options,he=U.children,Ee=U.backfill,Ae=U.allowClear,Oe=U.placeholder,me=U.getInputElement,de=U.showSearch,pe=U.onSearch,se=U.defaultOpen,ce=U.autoFocus,Z=U.labelInValue,te=U.value,le=U.inputValue,ve=U.optionLabelProp,ie=J==="multiple"||J==="tags",oe=de!==void 0?de:ie||J==="combobox",xe=ne||m(he);if(Object(S.a)(J!=="tags"||xe.every(function(He){return!He.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),J==="tags"||J==="combobox"){var _e=xe.some(function(He){return He.options?He.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in He?He.value:He.key)=="number"});Object(S.a)(!_e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(J!=="combobox"||!ve,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(J==="combobox"||!Ee,"`backfill` only works with `combobox` mode."),Object(S.a)(J==="combobox"||!me,"`getInputElement` only work with `combobox` mode."),Object(S.b)(J!=="combobox"||!me||!Ae||!Oe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),pe&&!oe&&J!=="combobox"&&J!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!se||ce,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),te!=null){var Me=Object(c.d)(te);Object(S.a)(!Z||Me.every(function(He){return Object(s.a)(He)==="object"&&("key"in He||"value"in He)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!ie||Array.isArray(te),"`value` should be array when `mode` is `multiple` or `tags`")}if(he){var Ue=null;Object(D.a)(he).some(function(He){if(!N.isValidElement(He)||!He.type)return!1;var Be=He.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var tt=Object(D.a)(He.props.children).every(function(Je){return!N.isValidElement(Je)||!He.type||Je.type.isSelectOption?!0:(Ue=Je.type,!1)});return!tt}return Ue=Be,!0}),Ue&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ue.displayName||Ue.name||Ue,"`.")),Object(S.a)(le===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=O,B=Object(u.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:m,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:M,fillOptionsWithMissingValue:v.a}),j=function(U){Object(P.a)(ne,U);var J=Object($.a)(ne);function ne(){var he;return Object(ue.a)(this,ne),he=J.apply(this,arguments),he.selectRef=N.createRef(),he.focus=function(){he.selectRef.current.focus()},he.blur=function(){he.selectRef.current.blur()},he}return Object(V.a)(ne,[{key:"render",value:function(){return N.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ne}(N.Component);j.Option=l,j.OptGroup=b;var H=j,I=Te.c=H},M8RZ:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return R});var ue=W("fWQN"),V=W("mtLc"),P=W("yKVA"),$=W("879j"),N=W("q1tI"),L=W.n(N),K=W("i8i4"),F=W.n(K),R=function(A){Object(P.a)(y,A);var h=Object($.a)(y);function y(w){var p;Object(ue.a)(this,y),p=h.call(this,w);var f=window.document;return p.node=f.createElement("div"),f.body.appendChild(p.node),p}return Object(V.a)(y,[{key:"render",value:function(){var p=this.props.children;return Object(K.createPortal)(p,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),y}(L.a.Component)},MI8n:function(ct,Te,W){"use strict";W.d(Te,"b",function(){return L}),W.d(Te,"a",function(){return R}),W.d(Te,"e",function(){return A}),W.d(Te,"d",function(){return h}),W.d(Te,"c",function(){return y}),W.d(Te,"f",function(){return w});var ue=W("/cxE"),V=W("C/vA"),P=W("pmY6"),$=W("24hK"),N=function(){var p=function(f,g){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var o in r)r.hasOwnProperty(o)&&(a[o]=r[o])},p(f,g)};return function(f,g){p(f,g);function a(){this.constructor=f}f.prototype=g===null?Object.create(g):(a.prototype=g.prototype,new a)}}(),L;(function(p){p.None=function(){return P.a.None};function f(M){return function(B,j,H){j===void 0&&(j=null);var I=!1,U;return U=M(function(J){return I?void 0:(U?U.dispose():I=!0,B.call(j,J))},null,H),I&&U.dispose(),U}}p.once=f;function g(M,B){return b(function(j,H,I){return H===void 0&&(H=null),M(function(U){return j.call(H,B(U))},null,I)})}p.map=g;function a(M,B){return b(function(j,H,I){return H===void 0&&(H=null),M(function(U){B(U),j.call(H,U)},null,I)})}p.forEach=a;function r(M,B){return b(function(j,H,I){return H===void 0&&(H=null),M(function(U){return B(U)&&j.call(H,U)},null,I)})}p.filter=r;function o(M){return M}p.signal=o;function l(){for(var M=[],B=0;B<arguments.length;B++)M[B]=arguments[B];return function(j,H,I){return H===void 0&&(H=null),P.e.apply(void 0,M.map(function(U){return U(function(J){return j.call(H,J)},null,I)}))}}p.any=l;function C(M,B,j){var H=j;return g(M,function(I){return H=B(H,I),H})}p.reduce=C;function b(M){var B,j=new R({onFirstListenerAdd:function(){B=M(j.fire,j)},onLastListenerRemove:function(){B.dispose()}});return j.event}p.snapshot=b;function x(M,B,j,H,I){j===void 0&&(j=100),H===void 0&&(H=!1);var U,J=void 0,ne=void 0,he=0,Ee=new R({leakWarningThreshold:I,onFirstListenerAdd:function(){U=M(function(Ae){he++,J=B(J,Ae),H&&!ne&&(Ee.fire(J),J=void 0),clearTimeout(ne),ne=setTimeout(function(){var Oe=J;J=void 0,ne=void 0,(!H||he>1)&&Ee.fire(Oe),he=0},j)})},onLastListenerRemove:function(){U.dispose()}});return Ee.event}p.debounce=x;function D(M){var B=new Date().getTime();return g(f(M),function(j){return new Date().getTime()-B})}p.stopwatch=D;function T(M){var B=!0,j;return r(M,function(H){var I=B||H!==j;return B=!1,j=H,I})}p.latch=T;function m(M,B,j){B===void 0&&(B=!1),j===void 0&&(j=[]);var H=j.slice(),I=M(function(ne){H?H.push(ne):J.fire(ne)}),U=function(){H&&H.forEach(function(ne){return J.fire(ne)}),H=null},J=new R({onFirstListenerAdd:function(){I||(I=M(function(ne){return J.fire(ne)}))},onFirstListenerDidAdd:function(){H&&(B?setTimeout(U):U())},onLastListenerRemove:function(){I&&I.dispose(),I=null}});return J.event}p.buffer=m;var v=function(){function M(B){this.event=B}return M.prototype.map=function(B){return new M(g(this.event,B))},M.prototype.forEach=function(B){return new M(a(this.event,B))},M.prototype.filter=function(B){return new M(r(this.event,B))},M.prototype.reduce=function(B,j){return new M(C(this.event,B,j))},M.prototype.latch=function(){return new M(T(this.event))},M.prototype.debounce=function(B,j,H,I){return j===void 0&&(j=100),H===void 0&&(H=!1),new M(x(this.event,B,j,H,I))},M.prototype.on=function(B,j,H){return this.event(B,j,H)},M.prototype.once=function(B,j,H){return f(this.event)(B,j,H)},M}();function u(M){return new v(M)}p.chain=u;function s(M,B,j){j===void 0&&(j=function(ne){return ne});var H=function(){for(var ne=[],he=0;he<arguments.length;he++)ne[he]=arguments[he];return J.fire(j.apply(void 0,ne))},I=function(){return M.on(B,H)},U=function(){return M.removeListener(B,H)},J=new R({onFirstListenerAdd:I,onLastListenerRemove:U});return J.event}p.fromNodeEventEmitter=s;function S(M,B,j){j===void 0&&(j=function(ne){return ne});var H=function(){for(var ne=[],he=0;he<arguments.length;he++)ne[he]=arguments[he];return J.fire(j.apply(void 0,ne))},I=function(){return M.addEventListener(B,H)},U=function(){return M.removeEventListener(B,H)},J=new R({onFirstListenerAdd:I,onLastListenerRemove:U});return J.event}p.fromDOMEventEmitter=S;function c(M){var B=new R,j=!1;return M.then(void 0,function(){return null}).then(function(){j?B.fire(void 0):setTimeout(function(){return B.fire(void 0)},0)}),j=!0,B.event}p.fromPromise=c;function O(M){return new Promise(function(B){return f(M)(B)})}p.toPromise=O})(L||(L={}));var K=-1,F=function(){function p(f,g){g===void 0&&(g=Math.random().toString(18).slice(2,5)),this.customThreshold=f,this.name=g,this._warnCountdown=0}return p.prototype.dispose=function(){this._stacks&&this._stacks.clear()},p.prototype.check=function(f){var g=this,a=K;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||f<a)return;this._stacks||(this._stacks=new Map);var r=new Error().stack.split(`
`).slice(3).join(`
`),o=this._stacks.get(r)||0;if(this._stacks.set(r,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;var l,C=0;this._stacks.forEach(function(b,x){(!l||C<b)&&(l=x,C=b)}),console.warn("["+this.name+"] potential listener LEAK detected, having "+f+" listeners already. MOST frequent listener ("+C+"):"),console.warn(l)}return function(){var b=g._stacks.get(r)||0;g._stacks.set(r,b-1)}},p}(),R=function(){function p(f){this._disposed=!1,this._options=f,this._leakageMon=K>0?new F(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(p.prototype,"event",{get:function(){var f=this;return this._event||(this._event=function(g,a,r){f._listeners||(f._listeners=new $.a);var o=f._listeners.isEmpty();o&&f._options&&f._options.onFirstListenerAdd&&f._options.onFirstListenerAdd(f);var l=f._listeners.push(a?[g,a]:g);o&&f._options&&f._options.onFirstListenerDidAdd&&f._options.onFirstListenerDidAdd(f),f._options&&f._options.onListenerDidAdd&&f._options.onListenerDidAdd(f,g,a);var C;f._leakageMon&&(C=f._leakageMon.check(f._listeners.size));var b;return b={dispose:function(){if(C&&C(),b.dispose=p._noop,!f._disposed&&(l(),f._options&&f._options.onLastListenerRemove)){var x=f._listeners&&!f._listeners.isEmpty();x||f._options.onLastListenerRemove(f)}}},r instanceof P.b?r.add(b):Array.isArray(r)&&r.push(b),b}),this._event},enumerable:!0,configurable:!0}),p.prototype.fire=function(f){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new $.a);for(var g=this._listeners.iterator(),a=g.next();!a.done;a=g.next())this._deliveryQueue.push([a.value,f]);for(;this._deliveryQueue.size>0;){var r=this._deliveryQueue.shift(),o=r[0],l=r[1];try{typeof o=="function"?o.call(void 0,l):o[0].call(o[1],l)}catch(C){Object(ue.e)(C)}}}},p.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},p._noop=function(){},p}(),A=function(p){N(f,p);function f(g){var a=p.call(this,g)||this;return a._isPaused=0,a._eventQueue=new $.a,a._mergeFn=g&&g.merge,a}return f.prototype.pause=function(){this._isPaused++},f.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var g=this._eventQueue.toArray();this._eventQueue.clear(),p.prototype.fire.call(this,this._mergeFn(g))}else for(;!this._isPaused&&this._eventQueue.size!==0;)p.prototype.fire.call(this,this._eventQueue.shift())},f.prototype.fire=function(g){this._listeners&&(this._isPaused!==0?this._eventQueue.push(g):p.prototype.fire.call(this,g))},f}(R),h=function(){function p(){var f=this;this.hasListeners=!1,this.events=[],this.emitter=new R({onFirstListenerAdd:function(){return f.onFirstListenerAdd()},onLastListenerRemove:function(){return f.onLastListenerRemove()}})}return Object.defineProperty(p.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),p.prototype.add=function(f){var g=this,a={event:f,listener:null};this.events.push(a),this.hasListeners&&this.hook(a);var r=function(){g.hasListeners&&g.unhook(a);var o=g.events.indexOf(a);g.events.splice(o,1)};return Object(P.h)(Object(V.a)(r))},p.prototype.onFirstListenerAdd=function(){var f=this;this.hasListeners=!0,this.events.forEach(function(g){return f.hook(g)})},p.prototype.onLastListenerRemove=function(){var f=this;this.hasListeners=!1,this.events.forEach(function(g){return f.unhook(g)})},p.prototype.hook=function(f){var g=this;f.listener=f.event(function(a){return g.emitter.fire(a)})},p.prototype.unhook=function(f){f.listener&&f.listener.dispose(),f.listener=null},p.prototype.dispose=function(){this.emitter.dispose()},p}(),y=function(){function p(){this.buffers=[]}return p.prototype.wrapEvent=function(f){var g=this;return function(a,r,o){return f(function(l){var C=g.buffers[g.buffers.length-1];C?C.push(function(){return a.call(r,l)}):a.call(r,l)},void 0,o)}},p.prototype.bufferEvents=function(f){var g=[];this.buffers.push(g);var a=f();return this.buffers.pop(),g.forEach(function(r){return r()}),a},p}(),w=function(){function p(){var f=this;this.listening=!1,this.inputEvent=L.None,this.inputEventListener=P.a.None,this.emitter=new R({onFirstListenerDidAdd:function(){f.listening=!0,f.inputEventListener=f.inputEvent(f.emitter.fire,f.emitter)},onLastListenerRemove:function(){f.listening=!1,f.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(p.prototype,"input",{set:function(f){this.inputEvent=f,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=f(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),p.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},p}()},N0LK:function(ct,Te,W){"use strict";W.d(Te,"x",function(){return ue}),W.d(Te,"F",function(){return V}),W.d(Te,"r",function(){return $}),W.d(Te,"o",function(){return N}),W.d(Te,"p",function(){return L}),W.d(Te,"Q",function(){return K}),W.d(Te,"K",function(){return R}),W.d(Te,"k",function(){return A}),W.d(Te,"N",function(){return h}),W.d(Te,"m",function(){return y}),W.d(Te,"l",function(){return w}),W.d(Te,"I",function(){return p}),W.d(Te,"H",function(){return f}),W.d(Te,"q",function(){return g}),W.d(Te,"t",function(){return a}),W.d(Te,"D",function(){return r}),W.d(Te,"e",function(){return o}),W.d(Te,"f",function(){return l}),W.d(Te,"B",function(){return C}),W.d(Te,"C",function(){return b}),W.d(Te,"n",function(){return D}),W.d(Te,"O",function(){return m}),W.d(Te,"c",function(){return v}),W.d(Te,"d",function(){return u}),W.d(Te,"z",function(){return s}),W.d(Te,"A",function(){return S}),W.d(Te,"u",function(){return c}),W.d(Te,"E",function(){return M}),W.d(Te,"G",function(){return B}),W.d(Te,"i",function(){return H}),W.d(Te,"g",function(){return U}),W.d(Te,"v",function(){return ne}),W.d(Te,"h",function(){return he}),W.d(Te,"y",function(){return Ee}),W.d(Te,"w",function(){return Ae}),W.d(Te,"a",function(){return Oe}),W.d(Te,"P",function(){return me}),W.d(Te,"L",function(){return de}),W.d(Te,"J",function(){return pe}),W.d(Te,"j",function(){return se}),W.d(Te,"M",function(){return ce}),W.d(Te,"s",function(){return Z}),W.d(Te,"b",function(){return te});function ue(ie){return!ie||typeof ie!="string"?!0:ie.trim().length===0}function V(ie,oe,xe){xe===void 0&&(xe="0");for(var _e=""+ie,Me=[_e],Ue=_e.length;Ue<oe;Ue++)Me.push(xe);return Me.reverse().join("")}var P=/{(\d+)}/g;function $(ie){for(var oe=[],xe=1;xe<arguments.length;xe++)oe[xe-1]=arguments[xe];return oe.length===0?ie:ie.replace(P,function(_e,Me){var Ue=parseInt(Me,10);return isNaN(Ue)||Ue<0||Ue>=oe.length?_e:oe[Ue]})}function N(ie){return ie.replace(/[<>&]/g,function(oe){switch(oe){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return oe}})}function L(ie){return ie.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function K(ie,oe){oe===void 0&&(oe=" ");var xe=F(ie,oe);return R(xe,oe)}function F(ie,oe){if(!ie||!oe)return ie;var xe=oe.length;if(xe===0||ie.length===0)return ie;for(var _e=0;ie.indexOf(oe,_e)===_e;)_e=_e+xe;return ie.substring(_e)}function R(ie,oe){if(!ie||!oe)return ie;var xe=oe.length,_e=ie.length;if(xe===0||_e===0)return ie;for(var Me=_e,Ue=-1;!(Ue=ie.lastIndexOf(oe,Me-1),Ue===-1||Ue+xe!==Me);){if(Ue===0)return"";Me=Ue}return ie.substring(0,Me)}function A(ie){return ie.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function h(ie,oe){if(ie.length<oe.length)return!1;if(ie===oe)return!0;for(var xe=0;xe<oe.length;xe++)if(ie[xe]!==oe[xe])return!1;return!0}function y(ie,oe){var xe=ie.length-oe.length;return xe>0?ie.indexOf(oe,xe)===xe:xe===0?ie===oe:!1}function w(ie,oe,xe){if(xe===void 0&&(xe={}),!ie)throw new Error("Cannot create regex from empty string");oe||(ie=L(ie)),xe.wholeWord&&(/\B/.test(ie.charAt(0))||(ie="\\b"+ie),/\B/.test(ie.charAt(ie.length-1))||(ie=ie+"\\b"));var _e="";return xe.global&&(_e+="g"),xe.matchCase||(_e+="i"),xe.multiline&&(_e+="m"),xe.unicode&&(_e+="u"),new RegExp(ie,_e)}function p(ie){if(ie.source==="^"||ie.source==="^$"||ie.source==="$"||ie.source==="^\\s*$")return!1;var oe=ie.exec("");return!!(oe&&ie.lastIndex===0)}function f(ie){return(ie.global?"g":"")+(ie.ignoreCase?"i":"")+(ie.multiline?"m":"")+(ie.unicode?"u":"")}function g(ie){for(var oe=0,xe=ie.length;oe<xe;oe++){var _e=ie.charCodeAt(oe);if(_e!==32&&_e!==9)return oe}return-1}function a(ie,oe,xe){oe===void 0&&(oe=0),xe===void 0&&(xe=ie.length);for(var _e=oe;_e<xe;_e++){var Me=ie.charCodeAt(_e);if(Me!==32&&Me!==9)return ie.substring(oe,_e)}return ie.substring(oe,xe)}function r(ie,oe){oe===void 0&&(oe=ie.length-1);for(var xe=oe;xe>=0;xe--){var _e=ie.charCodeAt(xe);if(_e!==32&&_e!==9)return xe}return-1}function o(ie,oe){return ie<oe?-1:ie>oe?1:0}function l(ie,oe){for(var xe=Math.min(ie.length,oe.length),_e=0;_e<xe;_e++){var Me=ie.charCodeAt(_e),Ue=oe.charCodeAt(_e);if(Me===Ue)continue;b(Me)&&(Me+=32),b(Ue)&&(Ue+=32);var He=Me-Ue;if(He===0)continue;return C(Me)&&C(Ue)?He:o(ie.toLowerCase(),oe.toLowerCase())}return ie.length<oe.length?-1:ie.length>oe.length?1:0}function C(ie){return ie>=97&&ie<=122}function b(ie){return ie>=65&&ie<=90}function x(ie){return C(ie)||b(ie)}function D(ie,oe){return ie.length===oe.length&&T(ie,oe)}function T(ie,oe,xe){xe===void 0&&(xe=ie.length);for(var _e=0;_e<xe;_e++){var Me=ie.charCodeAt(_e),Ue=oe.charCodeAt(_e);if(Me===Ue)continue;if(x(Me)&&x(Ue)){var He=Math.abs(Me-Ue);if(He!==0&&He!==32)return!1}else if(String.fromCharCode(Me).toLowerCase()!==String.fromCharCode(Ue).toLowerCase())return!1}return!0}function m(ie,oe){var xe=oe.length;return oe.length>ie.length?!1:T(ie,oe,xe)}function v(ie,oe){var xe,_e=Math.min(ie.length,oe.length);for(xe=0;xe<_e;xe++)if(ie.charCodeAt(xe)!==oe.charCodeAt(xe))return xe;return _e}function u(ie,oe){var xe,_e=Math.min(ie.length,oe.length),Me=ie.length-1,Ue=oe.length-1;for(xe=0;xe<_e;xe++)if(ie.charCodeAt(Me-xe)!==oe.charCodeAt(Ue-xe))return xe;return _e}function s(ie){return 55296<=ie&&ie<=56319}function S(ie){return 56320<=ie&&ie<=57343}function c(ie,oe,xe){var _e=ie.charCodeAt(xe);if(s(_e)&&xe+1<oe){var Me=ie.charCodeAt(xe+1);if(S(Me))return(_e-55296<<10)+(Me-56320)+65536}return _e}function O(ie,oe){var xe=ie.charCodeAt(oe-1);if(S(xe)&&oe>1){var _e=ie.charCodeAt(oe-2);if(s(_e))return(_e-55296<<10)+(xe-56320)+65536}return xe}function M(ie,oe){var xe=le.getInstance(),_e=oe,Me=ie.length,Ue=c(ie,Me,oe);oe+=Ue>=65536?2:1;for(var He=xe.getGraphemeBreakType(Ue);oe<Me;){var Be=c(ie,Me,oe),tt=xe.getGraphemeBreakType(Be);if(te(He,tt))break;oe+=Be>=65536?2:1,He=tt}return oe-_e}function B(ie,oe){var xe=le.getInstance(),_e=oe,Me=O(ie,oe);oe-=Me>=65536?2:1;for(var Ue=xe.getGraphemeBreakType(Me);oe>0;){var He=O(ie,oe),Be=xe.getGraphemeBreakType(He);if(te(Be,Ue))break;oe-=He>=65536?2:1,Ue=Be}return _e-oe}var j=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function H(ie){return j.test(ie)}var I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function U(ie){return I.test(ie)}var J=/^[\t\n\r\x20-\x7E]*$/;function ne(ie){return J.test(ie)}function he(ie){for(var oe=0,xe=ie.length;oe<xe;oe++)if(Ee(ie.charCodeAt(oe)))return!0;return!1}function Ee(ie){return ie=+ie,ie>=11904&&ie<=55215||ie>=63744&&ie<=64255||ie>=65281&&ie<=65374}function Ae(ie){return ie>=127462&&ie<=127487||ie>=9728&&ie<=10175||ie>=127744&&ie<=128591||ie>=128640&&ie<=128764||ie>=128992&&ie<=129003||ie>=129280&&ie<=129535||ie>=129648&&ie<=129651||ie>=129656&&ie<=129666||ie>=129680&&ie<=129685}var Oe=String.fromCharCode(65279);function me(ie){return!!(ie&&ie.length>0&&ie.charCodeAt(0)===65279)}function de(ie){return btoa(encodeURIComponent(ie))}function pe(ie,oe){for(var xe="",_e=0;_e<oe;_e++)xe+=ie;return xe}function se(ie,oe){return oe===void 0&&(oe=!1),ie?(oe&&(ie=ie.replace(/\\./g,"")),ie.toLowerCase()!==ie):!1}function ce(ie){var oe=90-65+1;return ie=ie%(2*oe),ie<oe?String.fromCharCode(97+ie):String.fromCharCode(65+ie-oe)}function Z(ie){var oe=le.getInstance();return oe.getGraphemeBreakType(ie)}function te(ie,oe){return ie===0?oe!==5&&oe!==7:ie===2&&oe===3?!1:ie===4||ie===2||ie===3||(oe===4||oe===2||oe===3)?!0:ie===8&&(oe===8||oe===9||oe===11||oe===12)||((ie===11||ie===9)&&(oe===9||oe===10)||((ie===12||ie===10)&&oe===10||(oe===5||oe===13||(oe===7||(ie===1||ie===13&&oe===14)))))?!1:!(ie===6&&oe===6)}var le=function(){function ie(){this._data=ve()}return ie.getInstance=function(){return ie._INSTANCE||(ie._INSTANCE=new ie),ie._INSTANCE},ie.prototype.getGraphemeBreakType=function(oe){if(oe<32)return oe===10?3:oe===13?2:4;if(oe<127)return 0;for(var xe=this._data,_e=xe.length/3,Me=1;Me<=_e;)if(oe<xe[3*Me])Me=2*Me;else if(oe>xe[3*Me+1])Me=2*Me+1;else return xe[3*Me+2];return 0},ie._INSTANCE=null,ie}();function ve(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},NvD2:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return L});var ue=W("Kwbf");function V(K,F){var R=new Set;return K.forEach(function(A){F.has(A)||R.add(A)}),R}function P(K){var F=K||{},R=F.disabled,A=F.disableCheckbox,h=F.checkable;return!!(R||A)||h===!1}function $(K,F,R,A){for(var h=new Set(K),y=new Set,w=0;w<=R;w+=1){var p=F.get(w)||new Set;p.forEach(function(r){var o=r.key,l=r.node,C=r.children,b=C===void 0?[]:C;h.has(o)&&!A(l)&&b.filter(function(x){return!A(x.node)}).forEach(function(x){h.add(x.key)})})}for(var f=new Set,g=R;g>=0;g-=1){var a=F.get(g)||new Set;a.forEach(function(r){var o=r.parent,l=r.node;if(A(l)||!r.parent||f.has(r.parent.key))return;if(A(r.parent.node)){f.add(o.key);return}var C=!0,b=!1;(o.children||[]).filter(function(x){return!A(x.node)}).forEach(function(x){var D=x.key,T=h.has(D);C&&!T&&(C=!1),!b&&(T||y.has(D))&&(b=!0)}),C&&h.add(o.key),b&&y.add(o.key),f.add(o.key)})}return{checkedKeys:Array.from(h),halfCheckedKeys:Array.from(V(y,h))}}function N(K,F,R,A,h){for(var y=new Set(K),w=new Set(F),p=0;p<=A;p+=1){var f=R.get(p)||new Set;f.forEach(function(o){var l=o.key,C=o.node,b=o.children,x=b===void 0?[]:b;!y.has(l)&&!w.has(l)&&!h(C)&&x.filter(function(D){return!h(D.node)}).forEach(function(D){y.delete(D.key)})})}w=new Set;for(var g=new Set,a=A;a>=0;a-=1){var r=R.get(a)||new Set;r.forEach(function(o){var l=o.parent,C=o.node;if(h(C)||!o.parent||g.has(o.parent.key))return;if(h(o.parent.node)){g.add(l.key);return}var b=!0,x=!1;(l.children||[]).filter(function(D){return!h(D.node)}).forEach(function(D){var T=D.key,m=y.has(T);b&&!m&&(b=!1),!x&&(m||w.has(T))&&(x=!0)}),b||y.delete(l.key),x&&w.add(l.key),g.add(l.key)})}return{checkedKeys:Array.from(y),halfCheckedKeys:Array.from(V(w,y))}}function L(K,F,R,A){var h=[],y;A?y=A:y=P;var w=new Set(K.filter(function(a){var r=!!R[a];return r||h.push(a),r})),p=new Map,f=0;Object.keys(R).forEach(function(a){var r=R[a],o=r.level,l=p.get(o);l||(l=new Set,p.set(o,l)),l.add(r),f=Math.max(f,o)}),Object(ue.a)(!h.length,"Tree missing follow keys: ".concat(h.slice(0,100).map(function(a){return"'".concat(a,"'")}).join(", ")));var g;return F===!0?g=$(w,p,f,y):g=N(w,F.halfCheckedKeys,p,f,y),g}},O2Wb:function(ct,Te,W){ct.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(ct,Te,W){"use strict";W.d(Te,"b",function(){return A}),W.d(Te,"a",function(){return h}),W.d(Te,"k",function(){return y}),W.d(Te,"h",function(){return w}),W.d(Te,"i",function(){return p}),W.d(Te,"g",function(){return f}),W.d(Te,"c",function(){return g}),W.d(Te,"d",function(){return a}),W.d(Te,"j",function(){return l}),W.d(Te,"e",function(){return C}),W.d(Te,"f",function(){return b});var ue=W("KQm4"),V=W("U8pU"),P=W("Ff2n"),$=W("q1tI"),N=W.n($),L=W("Kwbf"),K=W("WaYH"),F=.25,R=2;function A(x,D){var T=x.slice(),m=T.indexOf(D);return m>=0&&T.splice(m,1),T}function h(x,D){var T=x.slice();return T.indexOf(D)===-1&&T.push(D),T}function y(x){return x.split("-")}function w(x,D){return"".concat(x,"-").concat(D)}function p(x){return x&&x.type&&x.type.isTreeNode}function f(x,D){var T=[x],m=D[x];function v(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];u.forEach(function(s){var S=s.key,c=s.children;T.push(S),v(c)})}return v(m.children),T}function g(x,D){var T=x.clientY,m=D.selectHandle.getBoundingClientRect(),v=m.top,u=m.bottom,s=m.height,S=Math.max(s*F,R);return T<=v+S?-1:T>=u-S?1:0}function a(x,D){if(!x)return;var T=D.multiple;return T?x.slice():x.length?[x[0]]:x}var r=function(D){return D};function o(x,D){if(!x)return[];var T=D||{},m=T.processProps,v=m===void 0?r:m,u=Array.isArray(x)?x:[x];return u.map(function(s){var S=s.children,c=Object(P.a)(s,["children"]),O=o(S,D);return N.a.createElement(K.a,Object.assign({},v(c)),O)})}function l(x){if(!x)return null;var D;if(Array.isArray(x))D={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(V.a)(x)==="object")D={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(L.a)(!1,"`checkedKeys` is not an array or an object"),null;return D}function C(x,D){var T=new Set;function m(v){if(T.has(v))return;var u=D[v];if(!u)return;T.add(v);var s=u.parent,S=u.node;if(S.disabled)return;s&&m(s.key)}return(x||[]).forEach(function(v){m(v)}),Object(ue.a)(T)}function b(x){var D={};return Object.keys(x).forEach(function(T){(T.startsWith("data-")||T.startsWith("aria-"))&&(D[T]=x[T])}),D}},Ot1p:function(ct,Te,W){"use strict";var ue=W("2qtc"),V=W("kLXV"),P=W("rAM+"),$=W("miYZ"),N=W("tsqr"),L=W("9og8"),K=W("tJVT"),F=W("jrin"),R=W("WmNS"),A=W.n(R),h=W("q1tI"),y=W.n(h),w=W("VrN/"),p=W.n(w),f=W("bdgK"),g=W("p77/"),a=W("Bd2K"),r=W("ELLl"),o=W("19Vz"),l=W("lZu9"),C=W("+NIl"),b=W("kSUc"),x=W("9Bee"),D=function(De){var Ge=De.value,Qe=Ge===void 0?"":Ge,dt=De.className,rt=De.showTextOnly,ht=De.showLines,ft=De.style,at=ft===void 0?{}:ft,Dt=Object(h.useMemo)(function(){return""},[Qe]);return y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{dangerouslySetInnerHTML:{__html:Dt}}))},T=W("0Owb"),m=W("dejd"),v=W("C+DQ"),u=W("1vsH"),s=W("m3rI"),S=[{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 c(De){var Ge=De.onActionCallback,Qe=De.title,dt=De.icon,rt=De.actionName,ht=De.className,ft=ht===void 0?"":ht,at=De.children;function Dt(){Ge(rt)}return y.a.createElement("a",{title:Qe,className:ft,onClick:Dt},y.a.createElement("i",{className:"md-iconfont ".concat(dt)}),at)}var O=function(De){var Ge=De.watch,Qe=De.showNullButton,dt=De.onActionCallback,rt=De.fullScreen,ht=De.insertTemp,ft=De.hidetoolBar,at=De.uuid,Dt=De.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(u.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(u.D)("_educoder_session"),"&key=").concat(at,"&api=").concat(encodeURIComponent(s.a.PROXY_SERVER)));var Lt=[].concat(S,[{title:"".concat(Ge?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ge?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return y.a.createElement("ul",{className:"markdown-toolbar-container"},!ft&&Lt.map(function(Tt,Rt){return y.a.createElement("li",{key:Rt},Tt.actionName?y.a.createElement(c,Object(T.a)({},Tt,{onActionCallback:dt})):y.a.createElement("span",{className:"v-line"}))}),Qe?y.a.createElement("li",null,y.a.createElement(c,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:dt},y.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ht&&y.a.createElement("li",null,y.a.createElement(c,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ht),onActionCallback:dt},y.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),y.a.createElement("li",{className:"btn-full-screen"},y.a.createElement(c,{icon:"".concat(rt?"icon-shrink":"icon-enlarge"),title:rt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:dt})))},M=W("M8RZ"),B=W("+L6B"),j=W("2/Rp"),H=W("y8nQ"),I=W("Vl3Y"),U=W("5NDa"),J=W("5rEg"),ne={labelCol:{span:4},wrapperCol:{span:20}},he=function(De){var Ge=De.callback,Qe=De.onCancel;function dt(rt){Ge(rt)}return y.a.createElement(I.a,Object(T.a)({},ne,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:dt}),y.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},y.a.createElement(J.a,null)),y.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},y.a.createElement(J.a,null)),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(j.a,{type:"ghost",onClick:Qe},"\u53D6\u6D88")))},Ee=W("7ahc"),Ae=W("k1fw"),Oe=W("HmJG"),me=W("BjJ7"),de=I.a.useForm,pe={width:280,marginRight:10},se={labelCol:{span:5},wrapperCol:{span:19}},ce=function(De){var Ge=De.callback,Qe=De.onCancel,dt=de(),rt=Object(K.a)(dt,1),ht=rt[0],ft=Object(h.useRef)();function at(Tt){Ge(Object(Ae.a)(Object(Ae.a)({},Tt),{},{name:ft.current}))}function Dt(Tt,Rt){ht.setFieldsValue({src:"/api/attachments/".concat(Tt.id,"?type=").concat(Tt.content_type),type:Rt.type})}function Lt(Tt){var Rt=Tt.target.files[0];ft.current=Rt.name,te(Rt,Dt)}return y.a.createElement(I.a,Object(T.a)({form:ht},se,{className:"upload-image-panel",onFinish:at}),y.a.createElement(I.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},y.a.createElement("div",{className:"flex-container"},y.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},y.a.createElement(J.a,{style:pe})),y.a.createElement(Z,{onFileChange:Lt}))),y.a.createElement(I.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},y.a.createElement(J.a,{style:{width:264}})),y.a.createElement(I.a.Item,{style:{textAlign:"right"}},y.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(j.a,{type:"ghost",onClick:Qe},"\u53D6\u6D88")))};function Z(De){var Ge=De.onFileChange;return y.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",y.a.createElement("input",{type:"file",onChange:Ge}))}function te(De,Ge){if(!De)throw new String("\u6CA1\u6709\u6587\u4EF6");var Qe=new FormData;Qe.append("editormd-image-file",De),Qe.append("file_param_name","editormd-image-file"),Qe.append("byxhr","true");var dt=new window.XMLHttpRequest;dt.withCredentials=!0,dt.addEventListener("load",function(rt){Ge(JSON.parse(rt.target.responseText),De)},!1),dt.addEventListener("error",function(rt){console.error(rt)},!1),dt.open("POST","".concat(me.a,"/api/attachments.json")),dt.send(Qe)}var le=W("giR+"),ve=W("fyUT"),ie=W("7Kak"),oe=W("9yH6"),xe=oe.a.Group,_e={margin:"0 8px"},Me=function(De){var Ge=De.callback,Qe=De.onCancel;function dt(rt){Ge(rt)}return y.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:dt},y.a.createElement("div",{className:"flex-container"},y.a.createElement("span",{style:_e},"\u5355\u5143\u683C\u6570\uFF1A"),y.a.createElement("span",{style:_e},"\u884C\u6570"),y.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},y.a.createElement(ve.a,null)),y.a.createElement("span",{style:_e},"\u5217\u6570"),y.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},y.a.createElement(ve.a,null))),y.a.createElement("div",{className:"flex-container",style:{marginTop:12}},y.a.createElement("span",{style:_e},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),y.a.createElement(I.a.Item,{name:"align"},y.a.createElement(xe,null,y.a.createElement(oe.a,{value:"default"},y.a.createElement("i",{className:"fa fa-align-justify"})),y.a.createElement(oe.a,{value:"left"},y.a.createElement("i",{className:"fa fa-align-left"})),y.a.createElement(oe.a,{value:"center"},y.a.createElement("i",{className:"fa fa-align-center"})),y.a.createElement(oe.a,{value:"right"},y.a.createElement("i",{className:"fa fa-align-right"}))))),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(j.a,{type:"ghost",onClick:Qe},"\u53D6\u6D88")))},Ue=W("ErOA"),He=W("7Cbv"),Be="link",tt="upload-image",Je="code-block",st="add-table",nt="------------",pt={default:nt,left:":".concat(nt),center:":".concat(nt,":"),right:"".concat(nt,":")},mt=W("9VGf"),ke,Le;function We(){}var Ve=0,Ne=1e4,Ke="\u2581",we=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function ye(De){return/^\d+$/.test(De)?"".concat(De,"px"):De}var ge=navigator.platform.toUpperCase().indexOf("MAC")>=0,ae=ge?"Cmd":"Ctrl",re=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],be=(ke={},Object(F.a)(ke,ae+"-B","bold"),Object(F.a)(ke,ae+"-I","italic"),ke),Ce=(Le={},Object(F.a)(Le,Be,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(Le,Je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(Le,tt,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(Le,st,"\u6DFB\u52A0\u8868\u683C"),Le),Ie=Te.a=function(De){var Ge=De.defaultValue,Qe=Ge===void 0?"":Ge,dt=De.onChange,rt=De.width,ht=rt===void 0?"100%":rt,ft=De.height,at=ft===void 0?400:ft,Dt=De.miniToolbar,Lt=Dt===void 0?!1:Dt,Tt=De.isFocus,Rt=Tt===void 0?!1:Tt,wt=De.watch,Ut=De.insertTemp,Nt=De.mode,qe=Nt===void 0?"markdown":Nt,Ze=De.id,ze=Ze===void 0?"markdown-editor-id":Ze,Ye=De.showResizeBar,ot=Ye===void 0?!1:Ye,gt=De.noStorage,Mt=gt===void 0?!1:gt,Et=De.showNullButton,lt=Et===void 0?!1:Et,Jt=De.hidetoolBar,vr=Jt===void 0?!1:Jt,$t=De.fullScreen,vt=$t===void 0?!1:$t,zt=De.onBlur,Qt=De.onCMBeforeChange,or=De.onFullScreen,Xe=De.className,xt=Xe===void 0?"":Xe,Pt=De.disablePaste,At=Pt===void 0?!1:Pt,Ft=De.placeholder,Yt=Ft===void 0?"":Ft,G=De.values,E=G===void 0?"":G,_=Object(h.useState)(null),z=Object(K.a)(_,2),Q=z[0],Y=z[1],Re=Object(h.useState)(Qe),et=Object(K.a)(Re,2),yt=et[0],_t=et[1],it=Object(h.useState)(wt),Kt=Object(K.a)(it,2),Bt=Kt[0],gr=Kt[1],Kr=Object(h.useState)(vt),Yr=Object(K.a)(Kr,2),Er=Yr[0],tn=Yr[1],Cn=Object(h.useState)(""),Ur=Object(K.a)(Cn,2),Qr=Ur[0],Zt=Ur[1],Vt=Object(h.useState)(0),Xt=Object(K.a)(Vt,2),er=Xt[0],ur=Xt[1],sr=Object(h.useState)(at),Tr=Object(K.a)(sr,2),Lr=Tr[0],wr=Tr[1],Mr=Object(h.useState)(!1),Zr=Object(K.a)(Mr,2),sn=Zr[0],dr=Zr[1],qt=Object(h.useRef)(Object(He.a)()),Ar=Object(h.useRef)(!1),rr=Object(h.useRef)(),Cr=Object(h.useRef)(),nr=Object(h.useRef)(),Dr=Object(h.useRef)(),_r=Object(h.useRef)(),Fr=function(){var It=Object(L.a)(A.a.mark(function Ht(){var jt,tr;return A.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:return br.next=2,Object(Ue.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:qt.current}});case 2:tr=br.sent,tr!=null&&(jt=tr.attachments)!==null&&jt!==void 0&&jt.length&&(console.log("cm:",Q,Cr),tr.attachments.map(function(lr){lr.content_type.indexOf("image")>-1?Q.replaceSelection("![,](/api/attachments/".concat(lr.id,"?type=").concat(lr.content_type,")")):lr.content_type.indexOf("video")>-1?Q.replaceSelection('<video width="100%" controls src="'.concat(s.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):lr.content_type.indexOf("pdf")>-1?Q.replaceSelection('<a href="'.concat(s.a.API_SERVER,"/api/attachments/").concat(lr.id,"?type=").concat(lr.content_type,'&disposition=inline" target="_blank">').concat(lr.name,"</a>")):Q.replaceSelection("[".concat(lr.name,"](").concat(s.a.API_SERVER,"/api/attachments/").concat(lr.id,"?type=").concat(lr.content_type,")"))}));case 4:case"end":return br.stop()}},Ht)}));return function(){return It.apply(this,arguments)}}();Object(h.useEffect)(function(){_t(E),Q==null||Q.setValue(E)},[E]),Object(h.useEffect)(function(){or==null||or(Er)},[Er]),Object(h.useEffect)(function(){if(Cr.current){var It=p.a.fromTextArea(Cr.current,{mode:qe,lineNumbers:!Lt,lineWrapping:!0,value:Qe,autoCloseTags:!0,autoCloseBrackets:!0});Rt&&It.focus();function Ht(jt,tr){if(At){tr.preventDefault();return}var pr=tr.clipboardData;if(pr){var br=pr.types.toString(),lr=pr.items;if(br==="Files"||pr.types.indexOf("Files")>-1){if(tr.preventDefault(),qe=="stex")return;try{var Pr,$r=lr[1];((Pr=lr[0])===null||Pr===void 0?void 0:Pr.kind)==="file"&&($r=lr[0]);var ir=$r.getAsFile(),On=ir.name.split(".").pop();te(ir,function(cr){if(cr.id){var Br,pn,mn;(ir==null||((Br=ir.type)===null||Br===void 0)?void 0:Br.indexOf("image"))>-1?It.replaceSelection("![,](/api/attachments/".concat(cr.id,"?type=").concat(cr.content_type,")")):(ir==null||((pn=ir.type)===null||pn===void 0)?void 0:pn.indexOf("video"))>-1?It.replaceSelection('<video width="100%" controls src="'.concat(s.a.API_SERVER,"/api/attachments/").concat(cr.id,'"></video>')):(ir==null||((mn=ir.type)===null||mn===void 0)?void 0:mn.indexOf("pdf"))>-1?It.replaceSelection('<a href="'.concat(s.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(ir.type,'&disposition=inline" target="_blank">').concat(ir.name,"</a>")):re.includes(On)?It.replaceSelection('<a href="'.concat(s.a.API_SERVER,"/api/attachments/").concat(cr.id,'?type=office&disposition=inline" target="_blank">').concat(ir.name,"</a>")):It.replaceSelection("[".concat(ir.name,"](").concat(s.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(cr.content_type,")"))}else(cr==null?void 0:cr.status)===401&&(document.location.href="/user/login")})}catch(cr){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return It.on("paste",Ht),It.on("dragleave",function(jt,tr){nr.current.classList.remove("mouse-hover-md")}),It.on("dragover",function(jt,tr){nr.current.classList.add("mouse-hover-md")}),It.on("drop",function(jt,tr){nr.current.classList.add("mouse-hover-md");var pr;if(pr=tr.dataTransfer.files,pr.length>0){tr.preventDefault(),tr.stopPropagation();for(var br=function($r){var ir=pr[$r],On=ir.name.split(".").pop();te(ir,function(cr){if(cr.id){var Br,pn,mn;(ir==null||((Br=ir.type)===null||Br===void 0)?void 0:Br.indexOf("image"))>-1?It.replaceSelection("![,](/api/attachments/".concat(cr.id,"?type=").concat(cr.content_type,")")):(ir==null||((pn=ir.type)===null||pn===void 0)?void 0:pn.indexOf("video"))>-1?It.replaceSelection('<video width="100%" controls src="'.concat(s.a.API_SERVER,"/api/attachments/").concat(cr.id,'"></video>')):(ir==null||((mn=ir.type)===null||mn===void 0)?void 0:mn.indexOf("pdf"))>-1?It.replaceSelection('<a href="'.concat(s.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(ir.type,'&disposition=inline" target="_blank">').concat(ir.name,"</a>")):re.includes(On)?It.replaceSelection('<a href="'.concat(s.a.API_SERVER,"/api/attachments/").concat(cr.id,'?type=office&disposition=inline" target="_blank">').concat(ir.name,"</a>")):It.replaceSelection("[".concat(ir.name,"](").concat(s.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(cr.content_type,")"))}else(cr==null?void 0:cr.status)===401&&(document.location.href="/user/login")})},lr=0;lr<pr.length;lr++)br(lr)}}),Y(It),function(){It.off("paste",Ht)}}},[]);var Sn=Object(h.useCallback)(function(){if(nr.current)try{}catch(It){console.log(It,"---- to set md editor body height")}},[Lr,nr,Er]);Object(h.useEffect)(function(){function It(){var jt=new f.default(function(tr){var pr=Object(P.a)(tr),br;try{for(pr.s();!(br=pr.n()).done;){var lr=br.value;(lr.target.offsetHeight>0||lr.target.offsetWidth>0)&&(Sn(),Q.setSize("100%","100%"),Q.refresh())}}catch(Pr){pr.e(Pr)}finally{pr.f()}});return jt.observe(Cr.current.parentElement),jt}if(Q){var Ht=It();return function(){Ht.unobserve(Cr.current.parentElement)}}},[Q,Sn]),Object(h.useEffect)(function(){if(Q){for(var It=[],Ht=function(){var lr=tr[jt];pr=Object(K.a)(lr,2);var Pr=pr[0],$r=pr[1],ir=Object(F.a)({},Pr,function(){yr($r)});It.push(ir),Q.addKeyMap(ir)},jt=0,tr=Object.entries(be);jt<tr.length;jt++){var pr;Ht()}return rr.current=setInterval(function(){Ar.current&&Fr()},4e3),function(){clearInterval(rr.current);var br=Object(P.a)(It),lr;try{for(br.s();!(lr=br.n()).done;){var Pr=lr.value;Q.removeKeyMap(Pr)}}catch($r){br.e($r)}finally{br.f()}}}},[Q]),Object(h.useEffect)(function(){vt!==Er&&tn(vt)},[vt]),Object(mt.a)(function(){if(!Mt&&er>0){var It=new Date().getTime(),Ht=window.sessionStorage.getItem(ze);It>=er+Ne&&(!Ht||Ht!==yt)&&(window.sessionStorage.setItem(ze,yt),dr(!0))}},Ne),Object(h.useEffect)(function(){gr(wt)},[Q,wt]),Object(h.useEffect)(function(){Q&&(Rt&&Q.focus())},[Q,Rt]),Object(h.useEffect)(function(){if(Bt&&Q){var It=Q.getScrollerElement();function Ht(jt){var tr=jt.target;if(_r.current){var pr=tr.scrollTop/tr.scrollHeight;_r.current.scrollTop=_r.current.scrollHeight*pr}}return It.addEventListener("scroll",Ht),function(){It.removeEventListener("scroll",Ht)}}},[Q,Bt]),Object(h.useEffect)(function(){if(Q&&Qt){function It(Ht,jt){Qt(Ht,jt)}return Q.on("beforeChange",It),function(){Q.off("beforeChange",It)}}},[Q,Qt]),Object(h.useEffect)(function(){if(Q&&zt){function It(){zt(Q.getValue())}return Q.on("blur",It),function(){Q.off("blur",It)}}},[Q,zt]),Object(h.useEffect)(function(){if(Q){function It(Ht){var jt=Ht.getValue();_t(jt),ur(new Date().getTime()),Ht.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),dt&&dt(jt)}return Q.on("change",It),function(){Q.off("change",It)}}},[Q,dt]),Object(h.useEffect)(function(){Q&&(Qe==null?(Q.setValue(""),_t("")):Qe!==Q.getValue()&&(Q.setValue(Qe),_t(Qe),Q.setCursor(Q.lineCount(),0)))},[Q,Qe]);var yr=Object(h.useCallback)(function(It){var Ht=Q.getCursor(),jt=Q.getSelection(),tr=jt.split(`
`);switch(It){case"bold":return Q.replaceSelection("**"+jt+"**"),jt===""&&Q.setCursor(Ht.line,Ht.ch+2),Q.focus();case"italic":return Q.replaceSelection("*"+jt+"*"),jt===""&&Q.setCursor(Ht.line,Ht.ch+1),Q.focus();case"code":return Q.replaceSelection("`"+jt+"`"),jt===""&&Q.setCursor(Ht.line,Ht.ch+1),Q.focus();case"inline-latex":return Q.replaceSelection("`$$"+jt+"$$`"),jt===""&&Q.setCursor(Ht.line,Ht.ch+3),Q.focus();case"latex":return Q.replaceSelection("```latex\n"+jt+"\n```"),Q.setCursor(Ht.line+1,jt.length+1),Q.focus();case"line-break":return Q.replaceSelection(`<br/>
`),Q.focus();case"list-ul":return jt===""?Q.replaceSelection("- "+jt):Q.replaceSelection(tr.map(function(pr){return pr===""?"":"- ".concat(pr)}).join(`
`)),Q.focus();case"list-ol":return jt===""?Q.replaceSelection("1. "+jt):Q.replaceSelection(tr.map(function(pr,br){return pr===""?"":"".concat(br+1,". ").concat(pr)}).join(`
`)),Q.focus();case"add-null-ch":return jt===""&&Q.setCursor(Ht.line,Ht.ch+1),Q.replaceSelection(Ke),Q.focus();case"inster-template-1":return jt===""&&Q.setCursor(Ht.line,Ht.ch),Q.replaceSelection(we),Q.focus();case"eraser":return Q.setValue(""),Q.focus();case"trigger-watch":return gr(!Bt),Q.focus();case"trigger-full-screen":return tn(!Er),Q.focus();case Be:Zt(Be);return;case Je:Zt(Je);return;case tt:Zt(tt);return;case st:Zt(st);return;default:throw new Error}},[Q,Bt,Er]),rn=Object(h.useCallback)(function(It){Zt("");switch(Qr){case Be:var Ht=It.title,jt=It.link;return Q.replaceSelection("[".concat(Ht,"](").concat(jt,")")),Q.focus();case Je:var tr=It.language,pr=It.content;return Q.replaceSelection(["```"+tr,pr,"```"].join(`
`)),Q.focus();case tt:var br=It.src,lr=It.alt,Pr=It.name;return br.indexOf("type=image")>-1?Q.replaceSelection("![ ".concat(lr||""," ]( ").concat(br,' "').concat(lr||"",'" )')):br.indexOf("type=application/pdf")>-1?Q.replaceSelection('<a href="'.concat(br,'&disposition=inline" target="_blank">').concat(Pr,"</a>")):Q.replaceSelection('<a href="'.concat(br,'" target="_blank">').concat(Pr,"</a>")),Q.focus();case st:for(var $r=It.row,ir=It.col,On=It.align,cr=`
`,Br=0;Br<$r;Br++){for(var pn=[],mn=[],hr=0;hr<ir;hr++)Br===1&&mn.push(pt[On]),pn.push(" ");Br===1&&(cr+="| ".concat(mn.join(" | "),` |
`)),cr+="| ".concat(pn.join(ir===1?"":" | "),` |
`)}return Q.replaceSelection(cr+`
`),Q.focus();default:throw new Error}},[Q,Qr]),Tn=Object(h.useMemo)(function(){switch(Qr){case Be:return y.a.createElement(he,{callback:rn,onCancel:nn});case Je:return y.a.createElement(Ee.b,{callback:rn,onCancel:nn});case tt:return y.a.createElement(ce,{callback:rn,onCancel:nn});case st:return y.a.createElement(Me,{callback:rn,onCancel:nn});default:return null}},[Qr]);function nn(){Zt("")}Object(h.useEffect)(function(){if(Dr.current){var It=Dr.current,Ht=!1,jt=0;function tr(lr){Ht=!0,jt=lr.pageY}function pr(){Ht=!1}function br(lr){if(Ht){var Pr=lr.pageY-jt;Pr<0&&(Pr=0),Pr>300&&(Pr=300);var $r=at+Pr+"px";wr($r)}}return It.addEventListener("mousedown",tr),document.addEventListener("mousemove",br),document.addEventListener("mouseup",pr),function(){It.removeEventListener("mousedown",tr),document.removeEventListener("mousemove",br),document.removeEventListener("mouseup",pr)}}},[Q,Dr]),Object(h.useEffect)(function(){wr(at)},[at]);var Nn=ye(ht),bn=ye(Lr),Pn={width:Nn,height:bn},Un=Object(h.useMemo)(function(){if(er){var It=new Date(er),Ht=It.getHours(),jt=It.getMinutes(),tr=It.getSeconds();return Ht=Ht<10?"0"+Ht:Ht,jt=jt<10?"0"+jt:jt,tr=tr<10?"0"+tr:tr,"".concat(Ht,":").concat(jt,":").concat(tr)}return 0},[er]);function fn(){window.sessionStorage.removeItem(ze),dr(!1),ur(0)}function ii(){dr(!1),ur(0),Q.setValue(window.sessionStorage.getItem(ze))}function Ci(It,Ht){var jt=Q.getValue();jt=jt.replace(It,Ht),_t(jt),Q==null||Q.setValue(jt)}return y.a.createElement(h.Fragment,null,y.a.createElement("div",{className:"markdown-editor-wrapper",ref:nr},y.a.createElement("div",{className:"markdown-editor-container ".concat(xt," ").concat(Bt?"on-preview":""," ").concat(Lt?"mini":""," ").concat(Er?"full-screen":""),style:Pn},y.a.createElement(O,{insertTemp:Ut,watch:Bt,fullScreen:Er,showNullButton:lt,onActionCallback:yr,hidetoolBar:vr,uuid:qt.current,setOpenPhones:function(){Ar.current=!0}}),y.a.createElement("div",{className:"markdown-editor-body"},y.a.createElement("div",{className:"codemirror-container"},y.a.createElement("textarea",{ref:Cr,placeholder:Yt})),Bt?y.a.createElement("div",{ref:_r,className:"preview-container"},qe==="stex"&&y.a.createElement(D,{value:yt}),qe!=="stex"&&y.a.createElement(x.a,{edit:!0,value:yt,replaces:Ci})):null))),ot?y.a.createElement("a",{ref:Dr,className:"editor-resize"}):null,y.a.createElement(M.a,null,Ce[Qr]?y.a.createElement(V.a,{centered:!0,title:Ce[Qr],visible:!0,onCancel:nn,footer:null},Tn):null))}},"P/tu":function(ct,Te,W){"use strict";var ue=W("ozfa"),V=W("MJZm"),P=W("0Owb"),$=W("9og8"),N=W("tJVT"),L=W("PpiC"),K=W("WmNS"),F=W.n(K),R=W("q1tI"),A=W.n(R),h=W("WCUW"),y=W("spXi"),w=W.n(y),p=function(g){var a=g.value,r=g.onChange,o=g.defaultValue,l=g.disabled,C=Object(L.a)(g,["value","onChange","defaultValue","disabled"]),b=Object(R.useState)([]),x=Object(N.a)(b,2),D=x[0],T=x[1],m=Object(R.useState)("1"),v=Object(N.a)(m,2),u=v[0],s=v[1];Object(R.useEffect)(function(){S()},[]);var S=function(){var M=Object($.a)(F.a.mark(function B(){var j,H;return F.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,Object(h.y)({});case 2:j=U.sent,j!=null&&j.data&&(H=[{title:A.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:w.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:A.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:c(j.data||[])}],T(H),s("2"));case 4:case"end":return U.stop()}},B)}));return function(){return M.apply(this,arguments)}}(),c=function(B){function j(H){var I=H.children,U=Array.isArray(I)&&I.length>0,J=H==null?void 0:H.group_id;return{title:A.a.createElement("div",{title:H==null?void 0:H.name,className:w.a.name},H==null?void 0:H.name),value:J,key:J,icon:A.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:U?I==null?void 0:I.map(function(ne){return j(ne)}):[]}}return B==null?void 0:B.map(function(H){return j(H)})},O=o?{defaultExpandedKeys:[0]}:{selectedKeys:a,defaultExpandedKeys:a};return A.a.createElement("div",{className:w.a.customTree},A.a.createElement(V.a,Object(P.a)({key:u},O,{showIcon:!0,treeData:D,onSelect:r,disabled:l},C)))};Te.a=p},QDVR:function(ct,Te,W){"use strict";W.d(Te,"e",function(){return V}),W.d(Te,"d",function(){return P}),W.d(Te,"c",function(){return K}),W.d(Te,"b",function(){return F}),W.d(Te,"a",function(){return A});var ue=function(){var h=function(y,w){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,f){p.__proto__=f}||function(p,f){for(var g in f)f.hasOwnProperty(g)&&(p[g]=f[g])},h(y,w)};return function(y,w){h(y,w);function p(){this.constructor=y}y.prototype=w===null?Object.create(w):(p.prototype=w.prototype,new p)}}();function V(h){var y=[];return h.forEach(function(w){return y.push(w)}),y}function P(h){var y=[];return h.forEach(function(w,p){return y.push(p)}),y}var $=function(){function h(){this._value="",this._pos=0}return h.prototype.reset=function(y){return this._value=y,this._pos=0,this},h.prototype.next=function(){return this._pos+=1,this},h.prototype.hasNext=function(){return this._pos<this._value.length-1},h.prototype.cmp=function(y){var w=y.charCodeAt(0),p=this._value.charCodeAt(this._pos);return w-p},h.prototype.value=function(){return this._value[this._pos]},h}(),N=function(){function h(y){y===void 0&&(y=!0),this._splitOnBackslash=y}return h.prototype.reset=function(y){return this._value=y.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},h.prototype.hasNext=function(){return this._to<this._value.length},h.prototype.next=function(){this._from=this._to;for(var y=!0;this._to<this._value.length;this._to++){var w=this._value.charCodeAt(this._to);if(w===47||this._splitOnBackslash&&w===92)if(y)this._from++;else break;else y=!1}return this},h.prototype.cmp=function(y){for(var w=0,p=y.length,f=this._from;w<p&&f<this._to;){var g=y.charCodeAt(w)-this._value.charCodeAt(f);if(g!==0)return g;w+=1,f+=1}return p===this._to-this._from?0:w<p?-1:1},h.prototype.value=function(){return this._value.substring(this._from,this._to)},h}(),L=function(){function h(){}return h}(),K=function(){function h(y){this._iter=y}return h.forPaths=function(){return new h(new N)},h.forStrings=function(){return new h(new $)},h.prototype.clear=function(){this._root=void 0},h.prototype.set=function(y,w){var p=this._iter.reset(y),f;for(this._root||(this._root=new L,this._root.segment=p.value()),f=this._root;;){var g=p.cmp(f.segment);if(g>0)f.left||(f.left=new L,f.left.segment=p.value()),f=f.left;else if(g<0)f.right||(f.right=new L,f.right.segment=p.value()),f=f.right;else if(p.hasNext())p.next(),f.mid||(f.mid=new L,f.mid.segment=p.value()),f=f.mid;else break}var a=f.value;return f.value=w,f.key=y,a},h.prototype.get=function(y){for(var w=this._iter.reset(y),p=this._root;p;){var f=w.cmp(p.segment);if(f>0)p=p.left;else if(f<0)p=p.right;else if(w.hasNext())w.next(),p=p.mid;else break}return p?p.value:void 0},h.prototype.findSubstr=function(y){for(var w=this._iter.reset(y),p=this._root,f=void 0;p;){var g=w.cmp(p.segment);if(g>0)p=p.left;else if(g<0)p=p.right;else if(w.hasNext())w.next(),f=p.value||f,p=p.mid;else break}return p&&p.value||f},h.prototype.forEach=function(y){this._forEach(this._root,y)},h.prototype._forEach=function(y,w){y&&(this._forEach(y.left,w),y.value&&w(y.value,y.key),this._forEach(y.mid,w),this._forEach(y.right,w))},h}(),F=function(){function h(){this.map=new Map,this.ignoreCase=!1}return h.prototype.set=function(y,w){this.map.set(this.toKey(y),w)},h.prototype.get=function(y){return this.map.get(this.toKey(y))},h.prototype.toKey=function(y){var w=y.toString();return this.ignoreCase&&(w=w.toLowerCase()),w},h}(),R=function(){function h(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return h.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),h.prototype.get=function(y,w){w===void 0&&(w=0);var p=this._map.get(y);return p?(w!==0&&this.touch(p,w),p.value):void 0},h.prototype.set=function(y,w,p){p===void 0&&(p=0);var f=this._map.get(y);if(f)f.value=w,p!==0&&this.touch(f,p);else{f={key:y,value:w,next:void 0,previous:void 0};switch(p){case 0:this.addItemLast(f);break;case 1:this.addItemFirst(f);break;case 2:this.addItemLast(f);break;default:this.addItemLast(f);break}this._map.set(y,f),this._size++}},h.prototype.delete=function(y){return!!this.remove(y)},h.prototype.remove=function(y){var w=this._map.get(y);return w?(this._map.delete(y),this.removeItem(w),this._size--,w.value):void 0},h.prototype.forEach=function(y,w){for(var p=this._head;p;)w?y.bind(w)(p.value,p.key,this):y(p.value,p.key,this),p=p.next},h.prototype.trimOld=function(y){if(y>=this.size)return;if(y===0){this.clear();return}for(var w=this._head,p=this.size;w&&p>y;)this._map.delete(w.key),w=w.next,p--;this._head=w,this._size=p,w&&(w.previous=void 0)},h.prototype.addItemFirst=function(y){if(!this._head&&!this._tail)this._tail=y;else if(this._head)y.next=this._head,this._head.previous=y;else throw new Error("Invalid list");this._head=y},h.prototype.addItemLast=function(y){if(!this._head&&!this._tail)this._head=y;else if(this._tail)y.previous=this._tail,this._tail.next=y;else throw new Error("Invalid list");this._tail=y},h.prototype.removeItem=function(y){if(y===this._head&&y===this._tail)this._head=void 0,this._tail=void 0;else if(y===this._head){if(!y.next)throw new Error("Invalid list");y.next.previous=void 0,this._head=y.next}else if(y===this._tail){if(!y.previous)throw new Error("Invalid list");y.previous.next=void 0,this._tail=y.previous}else{var w=y.next,p=y.previous;if(!w||!p)throw new Error("Invalid list");w.previous=p,p.next=w}y.next=void 0,y.previous=void 0},h.prototype.touch=function(y,w){if(!this._head||!this._tail)throw new Error("Invalid list");if(w!==1&&w!==2)return;if(w===1){if(y===this._head)return;var p=y.next,f=y.previous;y===this._tail?(f.next=void 0,this._tail=f):(p.previous=f,f.next=p),y.previous=void 0,y.next=this._head,this._head.previous=y,this._head=y}else if(w===2){if(y===this._tail)return;var p=y.next,f=y.previous;y===this._head?(p.previous=void 0,this._head=p):(p.previous=f,f.next=p),y.next=void 0,y.previous=this._tail,this._tail.next=y,this._tail=y}},h.prototype.toJSON=function(){var y=[];return this.forEach(function(w,p){y.push([p,w])}),y},h}(),A=function(h){ue(y,h);function y(w,p){p===void 0&&(p=1);var f=h.call(this)||this;return f._limit=w,f._ratio=Math.min(Math.max(0,p),1),f}return y.prototype.get=function(w){return h.prototype.get.call(this,w,2)},y.prototype.peek=function(w){return h.prototype.get.call(this,w,0)},y.prototype.set=function(w,p){h.prototype.set.call(this,w,p,2),this.checkTrim()},y.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},y}(R)},RxwV:function(ct,Te,W){"use strict";var ue=W("q1tI"),V=W("uciX"),P=W("2W6z"),$=W.n(P),N=W("4IlW"),L=W("uK0f"),K=W.n(L);function F(de,pe){if(de===pe)return!0;if(!de||!pe)return!1;var se=de.length;if(pe.length!==se)return!1;for(var ce=0;ce<se;ce++)if(de[ce]!==pe[ce])return!1;return!0}function R(de){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?R=function(se){return typeof se}:R=function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},R(de)}function A(de,pe){if(!(de instanceof pe))throw new TypeError("Cannot call a class as a function")}function h(de,pe){for(var se=0;se<pe.length;se++){var ce=pe[se];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(de,ce.key,ce)}}function y(de,pe,se){return pe&&h(de.prototype,pe),se&&h(de,se),de}function w(de,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");de.prototype=Object.create(pe&&pe.prototype,{constructor:{value:de,writable:!0,configurable:!0}}),pe&&p(de,pe)}function p(de,pe){return p=Object.setPrototypeOf||function(ce,Z){return ce.__proto__=Z,ce},p(de,pe)}function f(de){var pe=r();return function(){var se=o(de),ce;if(pe){var Z=o(this).constructor;ce=Reflect.construct(se,arguments,Z)}else ce=se.apply(this,arguments);return g(this,ce)}}function g(de,pe){return pe&&(R(pe)==="object"||typeof pe=="function")?pe:a(de)}function a(de){if(de===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return de}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(de){return!1}}function o(de){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(se){return se.__proto__||Object.getPrototypeOf(se)},o(de)}var l=function(){var de=function(pe){w(ce,pe);var se=f(ce);function ce(){var Z;return A(this,ce),Z=se.apply(this,arguments),Z.menuItems={},Z.saveMenuItem=function(te){return function(le){Z.menuItems[te]=le}},Z}return y(ce,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(te){!te.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(te){var le=this.props,ve=le.fieldNames,ie=le.defaultFieldNames;return ve[te]||ie[te]}},{key:"getOption",value:function(te,le){var ve=this.props,ie=ve.prefixCls,oe=ve.expandTrigger,xe=ve.expandIcon,_e=ve.loadingIcon,Me=this.props.onSelect.bind(this,te,le),Ue=this.props.onItemDoubleClick.bind(this,te,le),He={onClick:Me,onDoubleClick:Ue},Be="".concat(ie,"-menu-item"),tt=null,Je=te[this.getFieldName("children")]&&te[this.getFieldName("children")].length>0;(Je||te.isLeaf===!1)&&(Be+=" ".concat(ie,"-menu-item-expand"),te.loading||(tt=ue.createElement("span",{className:"".concat(ie,"-menu-item-expand-icon")},xe))),oe==="hover"&&(Je||te.isLeaf===!1)&&(He={onMouseEnter:this.delayOnSelect.bind(this,Me),onMouseLeave:this.delayOnSelect.bind(this),onClick:Me}),this.isActiveOption(te,le)&&(Be+=" ".concat(ie,"-menu-item-active"),He.ref=this.saveMenuItem(le)),te.disabled&&(Be+=" ".concat(ie,"-menu-item-disabled"));var st=null;te.loading&&(Be+=" ".concat(ie,"-menu-item-loading"),st=_e||null);var nt="";return"title"in te?nt=te.title:typeof te[this.getFieldName("label")]=="string"&&(nt=te[this.getFieldName("label")]),ue.createElement("li",Object.assign({key:te[this.getFieldName("value")],className:Be,title:nt},He,{role:"menuitem",onMouseDown:function(mt){return mt.preventDefault()}}),te[this.getFieldName("label")],tt,st)}},{key:"getActiveOptions",value:function(te){var le=this,ve=this.props.options,ie=te||this.props.activeValue;return K()(ve,function(oe,xe){return oe[le.getFieldName("value")]===ie[xe]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var te=this,le=this.props.options,ve=this.getActiveOptions().map(function(ie){return ie[te.getFieldName("children")]}).filter(function(ie){return!!ie});return ve.unshift(le),ve}},{key:"delayOnSelect",value:function(te){for(var le=this,ve=arguments.length,ie=new Array(ve>1?ve-1:0),oe=1;oe<ve;oe++)ie[oe-1]=arguments[oe];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof te=="function"&&(this.delayTimer=window.setTimeout(function(){te(ie),le.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var te=this.getShowOptions().length,le=0;le<te;le++){var ve=this.menuItems[le];ve&&ve.parentElement&&(ve.parentElement.scrollTop=ve.offsetTop)}}},{key:"isActiveOption",value:function(te,le){var ve=this.props.activeValue,ie=ve===void 0?[]:ve;return ie[le]===te[this.getFieldName("value")]}},{key:"render",value:function(){var te=this,le=this.props,ve=le.prefixCls,ie=le.dropdownMenuColumnStyle;return ue.createElement("div",null,this.getShowOptions().map(function(oe,xe){return ue.createElement("ul",{className:"".concat(ve,"-menu"),key:xe,style:ie},oe.map(function(_e){return te.getOption(_e,xe)}))}))}}]),ce}(ue.Component);return de.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},de}(),C=l,b={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},x=b;function D(de){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?D=function(se){return typeof se}:D=function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},D(de)}function T(de,pe){if(de==null)return{};var se=m(de,pe),ce,Z;if(Object.getOwnPropertySymbols){var te=Object.getOwnPropertySymbols(de);for(Z=0;Z<te.length;Z++){if(ce=te[Z],pe.indexOf(ce)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(de,ce))continue;se[ce]=de[ce]}}return se}function m(de,pe){if(de==null)return{};var se={},ce=Object.keys(de),Z,te;for(te=0;te<ce.length;te++){if(Z=ce[te],pe.indexOf(Z)>=0)continue;se[Z]=de[Z]}return se}function v(de){return c(de)||S(de)||s(de)||u()}function u(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(de,pe){if(!de)return;if(typeof de=="string")return O(de,pe);var se=Object.prototype.toString.call(de).slice(8,-1);if(se==="Object"&&de.constructor&&(se=de.constructor.name),se==="Map"||se==="Set")return Array.from(de);if(se==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(se))return O(de,pe)}function S(de){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(de))return Array.from(de)}function c(de){if(Array.isArray(de))return O(de)}function O(de,pe){(pe==null||pe>de.length)&&(pe=de.length);for(var se=0,ce=new Array(pe);se<pe;se++)ce[se]=de[se];return ce}function M(de,pe){if(!(de instanceof pe))throw new TypeError("Cannot call a class as a function")}function B(de,pe){for(var se=0;se<pe.length;se++){var ce=pe[se];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(de,ce.key,ce)}}function j(de,pe,se){return pe&&B(de.prototype,pe),se&&B(de,se),de}function H(de,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");de.prototype=Object.create(pe&&pe.prototype,{constructor:{value:de,writable:!0,configurable:!0}}),pe&&I(de,pe)}function I(de,pe){return I=Object.setPrototypeOf||function(ce,Z){return ce.__proto__=Z,ce},I(de,pe)}function U(de){var pe=he();return function(){var se=Ee(de),ce;if(pe){var Z=Ee(this).constructor;ce=Reflect.construct(se,arguments,Z)}else ce=se.apply(this,arguments);return J(this,ce)}}function J(de,pe){return pe&&(D(pe)==="object"||typeof pe=="function")?pe:ne(de)}function ne(de){if(de===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return de}function he(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(de){return!1}}function Ee(de){return Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(se){return se.__proto__||Object.getPrototypeOf(se)},Ee(de)}var Ae=function(){var de=function(pe){H(ce,pe);var se=U(ce);function ce(Z){var te;M(this,ce),te=se.call(this,Z),te.setPopupVisible=function(ve){var ie=te.state.value;"popupVisible"in te.props||te.setState({popupVisible:ve}),ve&&!te.state.popupVisible&&te.setState({activeValue:ie}),te.props.onPopupVisibleChange(ve)},te.handleChange=function(ve,ie,oe){var xe=ie.visible;(oe.type!=="keydown"||oe.keyCode===N.a.ENTER)&&(te.props.onChange(ve.map(function(_e){return _e[te.getFieldName("value")]}),ve),te.setPopupVisible(xe))},te.handlePopupVisibleChange=function(ve){te.setPopupVisible(ve)},te.handleMenuSelect=function(ve,ie,oe){var xe=te.trigger.getRootDomNode();xe&&xe.focus&&xe.focus();var _e=te.props,Me=_e.changeOnSelect,Ue=_e.loadData,He=_e.expandTrigger;if(!ve||ve.disabled)return;var Be=te.state.activeValue;Be=Be.slice(0,ie+1),Be[ie]=ve[te.getFieldName("value")];var tt=te.getActiveOptions(Be);if(ve.isLeaf===!1&&!ve[te.getFieldName("children")]&&Ue){Me&&te.handleChange(tt,{visible:!0},oe),te.setState({activeValue:Be}),Ue(tt);return}var Je={};!ve[te.getFieldName("children")]||!ve[te.getFieldName("children")].length?(te.handleChange(tt,{visible:!1},oe),Je.value=Be):Me&&(oe.type==="click"||oe.type==="keydown")&&(He==="hover"?te.handleChange(tt,{visible:!1},oe):te.handleChange(tt,{visible:!0},oe),Je.value=Be),Je.activeValue=Be,("value"in te.props||oe.type==="keydown"&&oe.keyCode!==N.a.ENTER)&&delete Je.value,te.setState(Je)},te.handleItemDoubleClick=function(){var ve=te.props.changeOnSelect;ve&&te.setPopupVisible(!1)},te.handleKeyDown=function(ve){var ie=te.props.children;if(ie&&ie.props.onKeyDown){ie.props.onKeyDown(ve);return}var oe=v(te.state.activeValue),xe=oe.length-1<0?0:oe.length-1,_e=te.getCurrentLevelOptions(),Me=_e.map(function(tt){return tt[te.getFieldName("value")]}).indexOf(oe[xe]);if(ve.keyCode!==N.a.DOWN&&ve.keyCode!==N.a.UP&&ve.keyCode!==N.a.LEFT&&ve.keyCode!==N.a.RIGHT&&ve.keyCode!==N.a.ENTER&&ve.keyCode!==N.a.SPACE&&ve.keyCode!==N.a.BACKSPACE&&ve.keyCode!==N.a.ESC&&ve.keyCode!==N.a.TAB)return;if(!te.state.popupVisible&&ve.keyCode!==N.a.BACKSPACE&&ve.keyCode!==N.a.LEFT&&ve.keyCode!==N.a.RIGHT&&ve.keyCode!==N.a.ESC&&ve.keyCode!==N.a.TAB){te.setPopupVisible(!0);return}if(ve.keyCode===N.a.DOWN||ve.keyCode===N.a.UP){ve.preventDefault();var Ue=Me;Ue!==-1?ve.keyCode===N.a.DOWN?(Ue+=1,Ue=Ue>=_e.length?0:Ue):(Ue-=1,Ue=Ue<0?_e.length-1:Ue):Ue=0,oe[xe]=_e[Ue][te.getFieldName("value")]}else if(ve.keyCode===N.a.LEFT||ve.keyCode===N.a.BACKSPACE)ve.preventDefault(),oe.splice(oe.length-1,1);else if(ve.keyCode===N.a.RIGHT)ve.preventDefault(),_e[Me]&&_e[Me][te.getFieldName("children")]&&oe.push(_e[Me][te.getFieldName("children")][0][te.getFieldName("value")]);else if(ve.keyCode===N.a.ESC||ve.keyCode===N.a.TAB){te.setPopupVisible(!1);return}(!oe||oe.length===0)&&te.setPopupVisible(!1);var He=te.getActiveOptions(oe),Be=He[He.length-1];te.handleMenuSelect(Be,He.length-1,ve),te.props.onKeyDown&&te.props.onKeyDown(ve)},te.saveTrigger=function(ve){te.trigger=ve};var le=[];return"value"in Z?le=Z.value||[]:"defaultValue"in Z&&(le=Z.defaultValue||[]),$()(!("filedNames"in Z),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),te.state={popupVisible:Z.popupVisible,activeValue:le,value:le,prevProps:Z},te.defaultFieldNames={label:"label",value:"value",children:"children"},te}return j(ce,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(te){var le=this.defaultFieldNames,ve=this.props,ie=ve.fieldNames,oe=ve.filedNames;return"filedNames"in this.props?oe[te]||le[te]:ie[te]||le[te]}},{key:"getFieldNames",value:function(){var te=this.props,le=te.fieldNames,ve=te.filedNames;return"filedNames"in this.props?ve:le}},{key:"getCurrentLevelOptions",value:function(){var te=this,le=this.props.options,ve=le===void 0?[]:le,ie=this.state.activeValue,oe=ie===void 0?[]:ie,xe=K()(ve,function(_e,Me){return _e[te.getFieldName("value")]===oe[Me]},{childrenKeyName:this.getFieldName("children")});return xe[xe.length-2]?xe[xe.length-2][this.getFieldName("children")]:v(ve).filter(function(_e){return!_e.disabled})}},{key:"getActiveOptions",value:function(te){var le=this;return K()(this.props.options||[],function(ve,ie){return ve[le.getFieldName("value")]===te[ie]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var te=this.props,le=te.prefixCls,ve=te.transitionName,ie=te.popupClassName,oe=te.options,xe=oe===void 0?[]:oe,_e=te.disabled,Me=te.builtinPlacements,Ue=te.popupPlacement,He=te.children,Be=te.dropdownRender,tt=T(te,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Je=ue.createElement("div",null),st="";xe&&xe.length>0?Je=ue.createElement(C,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):st=" ".concat(le,"-menus-empty");var nt=Je;return Be&&(nt=Be(Je)),ue.createElement(V.a,Object.assign({ref:this.saveTrigger},tt,{popupPlacement:Ue,builtinPlacements:Me,popupTransitionName:ve,action:_e?[]:["click"],popupVisible:_e?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(le,"-menus"),popupClassName:ie+st,popup:nt}),ue.cloneElement(He,{onKeyDown:this.handleKeyDown,tabIndex:_e?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(te,le){var ve=le.prevProps,ie=ve===void 0?{}:ve,oe={prevProps:te};return"value"in te&&!F(ie.value,te.value)&&(oe.value=te.value||[],"loadData"in te||(oe.activeValue=te.value||[])),"popupVisible"in te&&(oe.popupVisible=te.popupVisible),oe}}]),ce}(ue.Component);return de.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:x,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},de}(),Oe=Ae,me=Te.a=Oe},"SA+Z":function(ct,Te,W){var ue=W("wTVA"),V=W("EbDI"),P=W("ZhPi"),$=W("wkBT");function N(L){return ue(L)||V(L)||P(L)||$()}ct.exports=N,ct.exports.__esModule=!0,ct.exports.default=ct.exports},SJMd:function(ct,Te){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var W,ue,V,P=!1,$,N;window.PR_SHOULD_USE_CONTINUATION=!0;var L,K;(function(){var F=window,R=["break,continue,do,else,for,if,return,while"],A=[R,"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"],h=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],y=[h,"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"],w=[h,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],p=[h,"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"],f="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",g=[h,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",r=[R,"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"],o=[R,"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"],l=[R,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[y,p,w,g,a,r,o,l],b=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",D="kwd",T="com",m="typ",v="lit",u="pun",s="pln",S="tag",c="dec",O="src",M="atn",B="atv",j="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(oe){for(var xe=0,_e=!1,Me=!1,Ue=0,He=oe.length;Ue<He;++Ue){var Be=oe[Ue];if(Be.ignoreCase)Me=!0;else if(/[a-z]/i.test(Be.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){_e=!0,Me=!1;break}}var tt={b:8,t:9,n:10,v:11,f:12,r:13};function Je(ke){var Le=ke.charCodeAt(0);if(Le!==92)return Le;var We=ke.charAt(1);return Le=tt[We],Le||("0"<=We&&We<="7"?parseInt(ke.substring(1),8):We==="u"||We==="x"?parseInt(ke.substring(2),16):ke.charCodeAt(1))}function st(ke){if(ke<32)return(ke<16?"\\x0":"\\x")+ke.toString(16);var Le=String.fromCharCode(ke);return Le==="\\"||Le==="-"||Le==="]"||Le==="^"?"\\"+Le:Le}function nt(ke){var Le=ke.substring(1,ke.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),We=[],Ve=Le[0]==="^",Ne=["["];Ve&&Ne.push("^");for(var Ke=Ve?1:0,we=Le.length;Ke<we;++Ke){var ye=Le[Ke];if(/\\[bdsw]/i.test(ye))Ne.push(ye);else{var ge=Je(ye),ae;Ke+2<we&&Le[Ke+1]==="-"?(ae=Je(Le[Ke+2]),Ke+=2):ae=ge,We.push([ge,ae]),ae<65||ge>122||(ae<65||ge>90||We.push([Math.max(65,ge)|32,Math.min(ae,90)|32]),ae<97||ge>122||We.push([Math.max(97,ge)&~32,Math.min(ae,122)&~32]))}}We.sort(function(Ie,De){return Ie[0]-De[0]||De[1]-Ie[1]});for(var re=[],be=[],Ke=0;Ke<We.length;++Ke){var Ce=We[Ke];Ce[0]<=be[1]+1?be[1]=Math.max(be[1],Ce[1]):re.push(be=Ce)}for(var Ke=0;Ke<re.length;++Ke){var Ce=re[Ke];Ne.push(st(Ce[0])),Ce[1]>Ce[0]&&(Ce[1]+1>Ce[0]&&Ne.push("-"),Ne.push(st(Ce[1])))}return Ne.push("]"),Ne.join("")}function pt(ke){for(var Le=ke.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")),We=Le.length,Ve=[],Ne=0,Ke=0;Ne<We;++Ne){var we=Le[Ne];if(we==="(")++Ke;else if(we.charAt(0)==="\\"){var ye=+we.substring(1);ye&&(ye<=Ke?Ve[ye]=-1:Le[Ne]=st(ye))}}for(var Ne=1;Ne<Ve.length;++Ne)Ve[Ne]===-1&&(Ve[Ne]=++xe);for(var Ne=0,Ke=0;Ne<We;++Ne){var we=Le[Ne];if(we==="(")++Ke,Ve[Ke]||(Le[Ne]="(?:");else if(we.charAt(0)==="\\"){var ye=+we.substring(1);ye&&ye<=Ke&&(Le[Ne]="\\"+Ve[ye])}}for(var Ne=0;Ne<We;++Ne)Le[Ne]==="^"&&Le[Ne+1]!=="^"&&(Le[Ne]="");if(ke.ignoreCase&&_e)for(var Ne=0;Ne<We;++Ne){var we=Le[Ne],ge=we.charAt(0);we.length>=2&&ge==="["?Le[Ne]=nt(we):ge!=="\\"&&(Le[Ne]=we.replace(/[a-zA-Z]/g,function(be){var Ce=be.charCodeAt(0);return"["+String.fromCharCode(Ce&~32,Ce|32)+"]"}))}return Le.join("")}for(var mt=[],Ue=0,He=oe.length;Ue<He;++Ue){var Be=oe[Ue];if(Be.global||Be.multiline)throw new Error(""+Be);mt.push("(?:"+pt(Be)+")")}return new RegExp(mt.join("|"),Me?"gi":"g")}function U(oe,xe){var _e=/(?:^|\s)nocode(?:\s|$)/,Me=[],Ue=0,He=[],Be=0;function tt(Je){var st=Je.nodeType;if(st==1){if(_e.test(Je.className))return;for(var nt=Je.firstChild;nt;nt=nt.nextSibling)tt(nt);var pt=Je.nodeName.toLowerCase();(pt==="br"||pt==="li")&&(Me[Be]=`
`,He[Be<<1]=Ue++,He[Be++<<1|1]=Je)}else if(st==3||st==4){var mt=Je.nodeValue;mt.length&&(xe?mt=mt.replace(/\r\n?/g,`
`):mt=mt.replace(/[ \t\r\n]+/g," "),Me[Be]=mt,He[Be<<1]=Ue,Ue+=mt.length,He[Be++<<1|1]=Je)}}return tt(oe),{sourceCode:Me.join("").replace(/\n$/,""),spans:He}}function J(oe,xe,_e,Me,Ue){if(!_e)return;var He={sourceNode:oe,pre:1,langExtension:null,numberLines:null,sourceCode:_e,spans:null,basePos:xe,decorations:null};Me(He),Ue.push.apply(Ue,He.decorations)}var ne=/\S/;function he(oe){for(var xe=void 0,_e=oe.firstChild;_e;_e=_e.nextSibling){var Me=_e.nodeType;xe=Me===1?xe?oe:_e:Me===3&&ne.test(_e.nodeValue)?oe:xe}return xe===oe?void 0:xe}function Ee(oe,xe){var _e={},Me;(function(){for(var Be=oe.concat(xe),tt=[],Je={},st=0,nt=Be.length;st<nt;++st){var pt=Be[st],mt=pt[3];if(mt)for(var ke=mt.length;--ke>=0;)_e[mt.charAt(ke)]=pt;var Le=pt[1],We=""+Le;Je.hasOwnProperty(We)||(tt.push(Le),Je[We]=null)}tt.push(/[\0-\uffff]/),Me=I(tt)})();var Ue=xe.length,He=function(Be){for(var tt=Be.sourceCode,Je=Be.basePos,st=Be.sourceNode,nt=[Je,s],pt=0,mt=tt.match(Me)||[],ke={},Le=0,We=mt.length;Le<We;++Le){var Ve=mt[Le],Ne=ke[Ve],Ke=void 0,we;if(typeof Ne=="string")we=!1;else{var ye=_e[Ve.charAt(0)];if(ye)Ke=Ve.match(ye[1]),Ne=ye[0];else{for(var ge=0;ge<Ue;++ge)if(ye=xe[ge],Ke=Ve.match(ye[1]),Ke){Ne=ye[0];break}Ke||(Ne=s)}we=Ne.length>=5&&Ne.substring(0,5)==="lang-",we&&!(Ke&&typeof Ke[1]=="string")&&(we=!1,Ne=O),we||(ke[Ve]=Ne)}var ae=pt;if(pt+=Ve.length,!we)nt.push(Je+ae,Ne);else{var re=Ke[1],be=Ve.indexOf(re),Ce=be+re.length;Ke[2]&&(Ce=Ve.length-Ke[2].length,be=Ce-re.length);var Ie=Ne.substring(5);J(st,Je+ae,Ve.substring(0,be),He,nt),J(st,Je+ae+be,re,ce(Ie,re),nt),J(st,Je+ae+Ce,Ve.substring(Ce),He,nt)}}Be.decorations=nt};return He}function Ae(oe){var xe=[],_e=[];oe.tripleQuotedStrings?xe.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):oe.multiLineStrings?xe.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):xe.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),oe.verbatimStrings&&_e.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Me=oe.hashComments;Me&&(oe.cStyleComments?(Me>1?xe.push([T,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):xe.push([T,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),_e.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):xe.push([T,/^#[^\r\n]*/,null,"#"])),oe.cStyleComments&&(_e.push([T,/^\/\/[^\r\n]*/,null]),_e.push([T,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ue=oe.regexLiterals;if(Ue){var He=Ue>1?"":`
\r`,Be=He?".":"[\\S\\s]",tt="/(?=[^/*"+He+"])(?:[^/\\x5B\\x5C"+He+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+He+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";_e.push(["lang-regex",RegExp("^"+H+"("+tt+")")])}var Je=oe.types;Je&&_e.push([m,Je]);var st=(""+oe.keywords).replace(/^ | $/g,"");st.length&&_e.push([D,new RegExp("^(?:"+st.replace(/[\s,]+/g,"|")+")\\b"),null]),xe.push([s,/^\s+/,null,` \r
\xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return oe.regexLiterals&&(nt+="(?!s*/)"),_e.push([v,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[s,/^[a-z_$][a-z_$@0-9]*/i,null],[v,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[s,/^\\[\s\S]?/,null],[u,new RegExp(nt),null]),Ee(xe,_e)}var Oe=Ae({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function me(oe,xe,_e){for(var Me=/(?:^|\s)nocode(?:\s|$)/,Ue=/\r\n?|\n/,He=oe.ownerDocument,Be=He.createElement("li");oe.firstChild;)Be.appendChild(oe.firstChild);var tt=[Be];function Je(Le){var We=Le.nodeType;if(We==1&&!Me.test(Le.className))if(Le.nodeName==="br")st(Le),Le.parentNode&&Le.parentNode.removeChild(Le);else for(var Ve=Le.firstChild;Ve;Ve=Ve.nextSibling)Je(Ve);else if((We==3||We==4)&&_e){var Ne=Le.nodeValue,Ke=Ne.match(Ue);if(Ke){var we=Ne.substring(0,Ke.index);Le.nodeValue=we;var ye=Ne.substring(Ke.index+Ke[0].length);if(ye){var ge=Le.parentNode;ge.insertBefore(He.createTextNode(ye),Le.nextSibling)}st(Le),we||Le.parentNode.removeChild(Le)}}}function st(Le){for(;!Le.nextSibling;)if(Le=Le.parentNode,!Le)return;function We(Ke,we){var ye=we?Ke.cloneNode(!1):Ke,ge=Ke.parentNode;if(ge){var ae=We(ge,1),re=Ke.nextSibling;ae.appendChild(ye);for(var be=re;be;be=re)re=be.nextSibling,ae.appendChild(be)}return ye}for(var Ve=We(Le.nextSibling,0),Ne;(Ne=Ve.parentNode)&&Ne.nodeType===1;)Ve=Ne;tt.push(Ve)}for(var nt=0;nt<tt.length;++nt)Je(tt[nt]);xe===(xe|0)&&tt[0].setAttribute("value",xe);var pt=He.createElement("ol");pt.className="linenums";for(var mt=Math.max(0,xe-1|0)||0,nt=0,ke=tt.length;nt<ke;++nt)Be=tt[nt],Be.className="L"+(nt+mt)%10,Be.firstChild||Be.appendChild(He.createTextNode("\xA0")),pt.appendChild(Be);oe.appendChild(pt)}function de(oe){var xe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);xe=xe&&+xe[1]<=8;var _e=/\n/g,Me=oe.sourceCode,Ue=Me.length,He=0,Be=oe.spans,tt=Be.length,Je=0,st=oe.decorations,nt=st.length,pt=0;st[nt]=Ue;var mt,ke;for(ke=mt=0;ke<nt;)st[ke]!==st[ke+2]?(st[mt++]=st[ke++],st[mt++]=st[ke++]):ke+=2;for(nt=mt,ke=mt=0;ke<nt;){for(var Le=st[ke],We=st[ke+1],Ve=ke+2;Ve+2<=nt&&st[Ve+1]===We;)Ve+=2;st[mt++]=Le,st[mt++]=We,ke=Ve}nt=st.length=mt;var Ne=oe.sourceNode,Ke="";Ne&&(Ke=Ne.style.display,Ne.style.display="none");try{for(var we=null;Je<tt;){var ye=Be[Je],ge=Be[Je+2]||Ue,ae=st[pt+2]||Ue,Ve=Math.min(ge,ae),re=Be[Je+1],be;if(re.nodeType!==1&&(be=Me.substring(He,Ve))){xe&&(be=be.replace(_e,"\r")),re.nodeValue=be;var Ce=re.ownerDocument,Ie=Ce.createElement("span");Ie.className=st[pt+1];var De=re.parentNode;De.replaceChild(Ie,re),Ie.appendChild(re),He<ge&&(Be[Je+1]=re=Ce.createTextNode(Me.substring(Ve,ge)),De.insertBefore(re,Ie.nextSibling))}He=Ve,He>=ge&&(Je+=2),He>=ae&&(pt+=2)}}finally{Ne&&(Ne.style.display=Ke)}}var pe={};function se(oe,xe){for(var _e=xe.length;--_e>=0;){var Me=xe[_e];pe.hasOwnProperty(Me)?F.console&&console.warn("cannot override language handler %s",Me):pe[Me]=oe}}function ce(oe,xe){return oe&&pe.hasOwnProperty(oe)||(oe=/^\s*</.test(xe)?"default-markup":"default-code"),pe[oe]}se(Oe,["default-code"]),se(Ee([],[[s,/^[^<?]+/],[c,/^<!\w[^>]*(?:>|$)/],[T,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),se(Ee([[s,/^[\s]+/,null,` \r
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[M,/^(?!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"]),se(Ee([],[[B,/^[\s\S]+/]]),["uq.val"]),se(Ae({keywords:y,hashComments:!0,cStyleComments:!0,types:b}),["c","cc","cpp","cxx","cyc","m"]),se(Ae({keywords:"null,true,false"}),["json"]),se(Ae({keywords:p,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:b}),["cs"]),se(Ae({keywords:w,cStyleComments:!0}),["java"]),se(Ae({keywords:l,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),se(Ae({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),se(Ae({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),se(Ae({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),se(Ae({keywords:g,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),se(Ae({keywords:f,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),se(Ee([],[[x,/^[\s\S]+/]]),["regex"]);function Z(oe){var xe=oe.langExtension;try{var _e=U(oe.sourceNode,oe.pre),Me=_e.sourceCode;oe.sourceCode=Me,oe.spans=_e.spans,oe.basePos=0,ce(xe,Me)(oe),de(oe)}catch(Ue){F.console&&console.log(Ue&&Ue.stack||Ue)}}function te(oe,xe,_e){var Me=_e||!1,Ue=xe||null,He=document.createElement("div");He.innerHTML="<pre>"+oe+"</pre>",He=He.firstChild,Me&&me(He,Me,!0);var Be={langExtension:Ue,numberLines:Me,sourceNode:He,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Z(Be),He.innerHTML}function le(oe,xe){var _e=xe||document.body,Me=_e.ownerDocument||document;function Ue(ye){return _e.getElementsByTagName(ye)}for(var He=[Ue("pre"),Ue("code"),Ue("xmp")],Be=[],tt=0;tt<He.length;++tt)for(var Je=0,st=He[tt].length;Je<st;++Je)Be.push(He[tt][Je]);He=null;var nt=Date;nt.now||(nt={now:function(){return+new Date}});var pt=0,mt=/\blang(?:uage)?-([\w.]+)(?!\S)/,ke=/\bprettyprint\b/,Le=/\bprettyprinted\b/,We=/pre|xmp/i,Ve=/^code$/i,Ne=/^(?:pre|code|xmp)$/i,Ke={};function we(){for(var ye=F.PR_SHOULD_USE_CONTINUATION?nt.now()+250:Infinity;pt<Be.length&&nt.now()<ye;pt++){for(var ge=Be[pt],ae=Ke,re=ge;re=re.previousSibling;){var be=re.nodeType,Ce=(be===7||be===8)&&re.nodeValue;if(Ce?!/^\??prettify\b/.test(Ce):be!==3||/\S/.test(re.nodeValue))break;if(Ce){ae={},Ce.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Rt,wt,Ut){ae[wt]=Ut});break}}var Ie=ge.className;if((ae!==Ke||ke.test(Ie))&&!Le.test(Ie)){for(var De=!1,Ge=ge.parentNode;Ge;Ge=Ge.parentNode){var Qe=Ge.tagName;if(Ne.test(Qe)&&Ge.className&&ke.test(Ge.className)){De=!0;break}}if(!De){ge.className+=" prettyprinted";var dt=ae.lang;if(!dt){dt=Ie.match(mt);var rt;!dt&&(rt=he(ge))&&Ve.test(rt.tagName)&&(dt=rt.className.match(mt)),dt&&(dt=dt[1])}var ht;if(We.test(ge.tagName))ht=1;else{var ft=ge.currentStyle,at=Me.defaultView,Dt=ft?ft.whiteSpace:at&&at.getComputedStyle?at.getComputedStyle(ge,null).getPropertyValue("white-space"):0;ht=Dt&&Dt.substring(0,3)==="pre"}var Lt=ae.linenums;(Lt=Lt==="true"||+Lt)||(Lt=Ie.match(/\blinenums\b(?::(\d+))?/),Lt=Lt?Lt[1]&&Lt[1].length?+Lt[1]:!0:!1),Lt&&me(ge,Lt,ht);var Tt={langExtension:dt,sourceNode:ge,numberLines:Lt,pre:ht,sourceCode:null,basePos:null,spans:null,decorations:null};Z(Tt)}}}pt<Be.length?F.setTimeout(we,250):typeof oe=="function"&&oe()}we()}var ve=F.PR={createSimpleLexer:Ee,registerLangHandler:se,sourceDecorator:Ae,PR_ATTRIB_NAME:M,PR_ATTRIB_VALUE:B,PR_COMMENT:T,PR_DECLARATION:c,PR_KEYWORD:D,PR_LITERAL:v,PR_NOCODE:j,PR_PLAIN:s,PR_PUNCTUATION:u,PR_SOURCE:O,PR_STRING:x,PR_TAG:S,PR_TYPE:m,prettyPrintOne:P?F.prettyPrintOne=te:L=te,prettyPrint:K=P?F.prettyPrint=le:K=le},ie=F.define;typeof ie=="function"&&ie.amd&&ie("google-code-prettify",[],function(){return ve})})()},T1X5:function(ct,Te){ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAALdklEQVR4Xu2dC2wc1RVAzx1nDXFiO4SEhqxtxS0JHzX94TS0FEKLALX8WkKbqrRVKQrh15Zfq0IqIaSGSOXb8ktANFJbKqUFWigEAUohfFRQDC1KxS8UR/7wDbZ3TRxix3urN951No7Xnt15M7Mbz0hRImXevffds/PmzXv33StU0KWqTlcfh6mwkCHmq8M8B5oUZosyS6EeOCD7x/Rsl/kjkFJhu8AHGWiXDNuoYqsoW5K1vCkimUpxg5SzoW+r1gylOUGErygci9IC1Fi2uR+hVeA5VZ6tquOpuSL9lnVYE1d2wNo+0jnVylLNcKYKx6EcaK23XgQJH4vyjDg8OCDc3zxd3vXSLKx7ygJYW5seOGUmZ6GcJ8IShaqwHDCeHoEhVTYh3LO7mweam+XjqO2KFNjWPp09VblUlQuAmVE7YwL93SKs2SncMr9WPojK1kiAdWzXpCa40oHlCtOi6nwpegV2ZOBuGeSGxlnSVYoMP21CBfZmnx5SneFagXPzZnJ+7I+y7S6FdQMO1xxWK++HZUgowNzpeIoVKqwCDgqrcyHp6RFlZbKetWF8HgQOrD2liwTuAHdKvj9frVVTuHDuNGkNspOBAWtt1cShC1ilcLlqecz6gnSkkS3CkMBN77zBypYWGQxCXyDAuvq1KTPIeuCYIIyuAJnPOwmWJWuk3bat1oF1pfWMjLKuAqbptn05Wl63I5ybrJOHbCqyCqw9ratEucqMDjaNrGBZqsLqpjpZaasPVhyrqlVdKe5Wcafr8TXKA6KsS9azXESG/DrHN7CODp0qdaxXON2vMftze4F/aJpljY2y008/fQFr69EZCYeH3ZX0+JrQA2ZHYDDDac0HSe+ENxe4oWRg2SfriRhWca53t3HSnFTqk1YSMPedleZv8TBYHKzc3WZ4TNbxrVLeaSUB6+zV38cTjNJgjUBT1jXMkB8XK6VoYNmp+9XFKorv39cDKlxX7JS/KGDZj+K/x99Z1n5+6gjfLObj2jOw7HLTv+MVDGuwcoK6nQSf97qM5QmYWcj9xHyensRrg9YpjRL4/HtbOd7LgrEnYF1p/U1G+XnQVk9m+Y5wfbJOfjGRDyYEZvazHOFfk2WLZCKHBfX/Zmsmo3ypqV42j6djXGBmp7gzzQuTYPMxKA7Fym1tqGPxeDvX4wLr7NULVdzd4vgKyQOiXNQwQ+4spK4gMBMwc0CG1/bDGIyQXF+ymp5dDkcUCuwpCKwzpXcqbrxgfIXsAYU1TfVy4VhqxwRm4gZJ8L/9IBQtZFdbU7eLQT41VtzjmMDaU3qzwKXW1MeCivaAwi1N9XLZ6Ib7AHPDpzO0hRmR+/L78Ict8J93IT1QdN+sN6irhs/NgR8uhM8eYl28J4EmwninQ/PosPB9gHWmdZUqoS3u/uUVuPEFKMcDWg5wxWL4zlGefGz9JhGuaxgVD7IXsOwpEhMvHsrBBPNknf9IecLKed9Au+vUyJ607t3dJPNPzewFrCOl3wPutf5TKSDwio3wdF7k3imfhMNnugGZkV2q8Ho3PPbWHhOOb4IbT4zMpHMa6+XPOe17A+vVjQhfC8u0E+/d884ysH69JCzNE+v51aY90Mw7beM5E7cJ5A7ln40zZOTnMgLMnHxMDNEZ5mG6RSbcNHv9tAV+sDCQLpck9I9b4Hd5UfKbIwrgM4cKB6toyJ0EHQHWkdJLgFtL6l2JjfKB/WwRfP/TJQoKoNmf/gu/zVuGjQqY6ZrjcEmyVm43/x4B1pnSxxVOCqDvBUXGwLx5W+CJhno5eQSYe1q/jw/DPgAeA/MGDOHjqloONtkN3CesI6XfAB7x2NzabV6B3fca3LoZ+ndbU+0KmpaAn7TA0iP2lVtOQ2LWulMb62WDC6wzrdfp8CGGUC+vwL56L3wU0ArI9Gp4cowZYLkBE2F1Q51cPfyEpXUTyvGh0gK8ArvgUXgxoGwZX5gDa79eAU+Y8HRjnSyR7K5yXwAZZibk7xXYjkHY2Abmb5uXGRJPnAfTqisAGPQ31FErnWldoMrrNh3hVZZXYF7l2byv3IZEd4YoHC4dfbqUDPfZ7KxXWTEwr57K3udwtnT06i8RVhfZ1MrtMbAi3ahcJe1pXSPKiiKbWrk9BlacG1VYa95hG1QZY55UnLBS7vYK7JXtwxuc/ZYnHTWJ4U3Ko2ZVxKTDvMMelY60bs7mISzF577aeAV25l/h7Y98qSrYeO50ePDblQHMzevYmVITDjAvGHeMLzUGVpzXBbZJR0p7gBnFNbVzt1dgr+aGRMtLUzVThofEI8cYEh9/C1ZuGu7n7BrYsMxOn31K6TXAdkTx0WwM9wrMZydLaj6UgTtegje64UefgaPnlCTGdqN+A8z8biPJAFrOwGx72pK8oRiYJU+GJMYFFg+JIXnbghp3SOyO6sCD1yFxxwBs3BbA4m91dvE3YcGV4YjoqYhp/YpH4aWAtlfMZGJNJMsGxRMentZXwIdzFBuYxbszhBbuh3MFLE25IQKtwSxNmRCBs8cIEQjB/UWrcJem4sXfvf32Qhdc8jjcdjIsThbt00AbuIu/8fZK5QDDbK/EG5gVBMxsYMYhApUDzA0RqIQgnEBfDKOEl/E7bDgIx9hb7mFuMTA3qH44zM04o9wDSWNgbsRUXiBpmYdq2wZmhr1C16sfwu0vwsVHw5EHF74vgin/nlDtcjgMEeb5sPw1zFJ/DKEePxp9GMIdFiM4bhTVCUyvT9gR4zxhx4T4Ub3PcSMDrKtPL85kuK3UX1wp7fyccTaHGE5uBhP5ZPMqx1nimAf6ojgy+/J7cP6G0rMILJ4Lt51iExeUG7CCR2bd6X3Ih9KNTj95OmZOhce+u38Do9ChdBdYyGkfcq4uJRPO9ARc9kU4Y8F+DgwKp30IO7GKXVfbkVZmQ+L4iVWyH9Ghpi6y42Z7UsoJ2ISpi0y3o0gOZs/d/iWVCzDPycFMl+P0e/7B+5XgOf2eO/mIE1z69bff9sUluMw+ZXdKnELWr+NLal90ClmjJU7SXJKvbTQqLUmzO2OM06DbAFCUjJLToBstcaGBonxt42Z/hQay77K4lIcNFBPIsFLKI6cjLpYTBjGub7RRLMeYGpejChyY3XJUxty44Ftg0OwXfMsbGs/IKHFJRXvsgiupmLMxLlpqkVbQRUtzpsZlgf1Dk7DKAme/z+LC2z6YhV54210g7tCpUkdc2r5IcJGUts/Z2NajMxIODyscW6Tdk/J2A2sww2nNB0lvqQ7wXTQj+6StVzi9VCMmQzszDGqaZY2NstNPf30DM8qfVJ0yP8VdKkRUP8GPC4JvayYYyXqWi8iQX21WgI2a8pvs3Fbl+u1khO1VhdVNo0pK+bHHumO70mo+rk1VlVBKWvnpfMBtux3h3GSdPGRTj3VgectY64FjbBpbQbKedxIsS9ZIXrEtO9YHAsyYZhaMD13AKoXLJ0uVdbNFInDTO2+wsqVFLOdPHQYeGLCR91pKFwlu8e4WO7+xspXSqnDRRKXp/VofODBjoNm57kqxQoVVUeW18uuocdr3iLIyWc/a8UrS29IfCrCcsSawpzrDtYI7/T/AVicikrNLYd2AwzWFqpoHYVeowHIdMHGPmuBKB5aHWX7YhgNNRG4G7pZBbhirMLYNHePJiARYziA3LFy5VJULKuAzoFuENTuFW0bXVg4aUr78SIHlDMmemjkL5TwRloRZh3OCX/OQKpsQ7tndzQP55XnDhFR2wPINMidBq5WlmuFMFY4Lu2qgqYYnyjPi8OCAcH+uWGhUgEbrLYsnrJAz3OwGaU5AOQ6HL2cLItRYdl6/m8AfnlPl2ao6njKlCy3rsCaurIGN7qX7edDHYSosZIj56jDPgSaF2aLM0uH8+6YaWG4GugsYEOhVYbvABxlolwzbqGKrKFuStbwZxnTcFrH/A8wNv8JI/KKJAAAAAElFTkSuQmCC"},T8No:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return $}),W.d(Te,"b",function(){return w}),W.d(Te,"d",function(){return p}),W.d(Te,"c",function(){return f}),W.d(Te,"e",function(){return g});var ue=W("N0LK"),V=W("Cg/j"),P=function(){var a=function(r,o){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,C){l.__proto__=C}||function(l,C){for(var b in C)C.hasOwnProperty(b)&&(l[b]=C[b])},a(r,o)};return function(r,o){a(r,o);function l(){this.constructor=r}r.prototype=o===null?Object.create(o):(l.prototype=o.prototype,new l)}}(),$=function(){function a(){}return a.has=function(r){return L.create(r)},a.equals=function(r,o){return K.create(r,o)},a.regex=function(r,o){return A.create(r,o)},a.not=function(r){return R.create(r)},a.and=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return y.create(r)},a.or=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return w.create(r)},a.deserialize=function(r,o){return o===void 0&&(o=!1),r?this._deserializeOrExpression(r,o):void 0},a._deserializeOrExpression=function(r,o){var l=this,C=r.split("||");return w.create(C.map(function(b){return l._deserializeAndExpression(b,o)}))},a._deserializeAndExpression=function(r,o){var l=this,C=r.split("&&");return y.create(C.map(function(b){return l._deserializeOne(b,o)}))},a._deserializeOne=function(r,o){if(r=r.trim(),r.indexOf("!=")>=0){var l=r.split("!=");return F.create(l[0].trim(),this._deserializeValue(l[1],o))}if(r.indexOf("==")>=0){var l=r.split("==");return K.create(l[0].trim(),this._deserializeValue(l[1],o))}if(r.indexOf("=~")>=0){var l=r.split("=~");return A.create(l[0].trim(),this._deserializeRegexValue(l[1],o))}return/^\!\s*/.test(r)?R.create(r.substr(1).trim()):L.create(r)},a._deserializeValue=function(r,o){if(r=r.trim(),r==="true")return!0;if(r==="false")return!1;var l=/^'([^']*)'$/.exec(r);return l?l[1].trim():r},a._deserializeRegexValue=function(r,o){if(Object(ue.x)(r)){if(o)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var l=r.indexOf("/"),C=r.lastIndexOf("/");if(l===C||l<0){if(o)throw new Error("bad regexp-value '"+r+"', missing /-enclosure");return console.warn("bad regexp-value '"+r+"', missing /-enclosure"),null}var b=r.slice(l+1,C),x=r[C+1]==="i"?"i":"";try{return new RegExp(b,x)}catch(D){if(o)throw new Error("bad regexp-value '"+r+"', parse error: "+D);return console.warn("bad regexp-value '"+r+"', parse error: "+D),null}},a}();function N(a,r){var o=a.getType(),l=r.getType();if(o!==l)return o-l;switch(o){case 1:return a.cmp(r);case 2:return a.cmp(r);case 3:return a.cmp(r);case 4:return a.cmp(r);case 6:return a.cmp(r);case 7:return a.cmp(r);case 5:return a.cmp(r);default:throw new Error("Unknown ContextKeyExpr!")}}var L=function(){function a(r){this.key=r}return a.create=function(r){return new a(r)},a.prototype.getType=function(){return 1},a.prototype.cmp=function(r){return this.key<r.key?-1:this.key>r.key?1:0},a.prototype.equals=function(r){return r instanceof a?this.key===r.key:!1},a.prototype.evaluate=function(r){return!!r.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return R.create(this.key)},a}(),K=function(){function a(r,o){this.key=r,this.value=o}return a.create=function(r,o){return typeof o=="boolean"?o?L.create(r):R.create(r):new a(r,o)},a.prototype.getType=function(){return 3},a.prototype.cmp=function(r){return this.key<r.key?-1:this.key>r.key?1:this.value<r.value?-1:this.value>r.value?1:0},a.prototype.equals=function(r){return r instanceof a?this.key===r.key&&this.value===r.value:!1},a.prototype.evaluate=function(r){return r.getValue(this.key)==this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return F.create(this.key,this.value)},a}(),F=function(){function a(r,o){this.key=r,this.value=o}return a.create=function(r,o){return typeof o=="boolean"?o?R.create(r):L.create(r):new a(r,o)},a.prototype.getType=function(){return 4},a.prototype.cmp=function(r){return this.key<r.key?-1:this.key>r.key?1:this.value<r.value?-1:this.value>r.value?1:0},a.prototype.equals=function(r){return r instanceof a?this.key===r.key&&this.value===r.value:!1},a.prototype.evaluate=function(r){return r.getValue(this.key)!=this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return K.create(this.key,this.value)},a}(),R=function(){function a(r){this.key=r}return a.create=function(r){return new a(r)},a.prototype.getType=function(){return 2},a.prototype.cmp=function(r){return this.key<r.key?-1:this.key>r.key?1:0},a.prototype.equals=function(r){return r instanceof a?this.key===r.key:!1},a.prototype.evaluate=function(r){return!r.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return L.create(this.key)},a}(),A=function(){function a(r,o){this.key=r,this.regexp=o}return a.create=function(r,o){return new a(r,o)},a.prototype.getType=function(){return 6},a.prototype.cmp=function(r){if(this.key<r.key)return-1;if(this.key>r.key)return 1;var o=this.regexp?this.regexp.source:"",l=r.regexp?r.regexp.source:"";return o<l?-1:o>l?1:0},a.prototype.equals=function(r){if(r instanceof a){var o=this.regexp?this.regexp.source:"",l=r.regexp?r.regexp.source:"";return this.key===r.key&&o===l}return!1},a.prototype.evaluate=function(r){var o=r.getValue(this.key);return this.regexp?this.regexp.test(o):!1},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return h.create(this)},a}(),h=function(){function a(r){this._actual=r}return a.create=function(r){return new a(r)},a.prototype.getType=function(){return 7},a.prototype.cmp=function(r){return this._actual.cmp(r._actual)},a.prototype.equals=function(r){return r instanceof a?this._actual.equals(r._actual):!1},a.prototype.evaluate=function(r){return!this._actual.evaluate(r)},a.prototype.keys=function(){return this._actual.keys()},a.prototype.negate=function(){return this._actual},a}(),y=function(){function a(r){this.expr=r}return a.create=function(r){var o=a._normalizeArr(r);return o.length===0?void 0:o.length===1?o[0]:new a(o)},a.prototype.getType=function(){return 5},a.prototype.cmp=function(r){if(this.expr.length<r.expr.length)return-1;if(this.expr.length>r.expr.length)return 1;for(var o=0,l=this.expr.length;o<l;o++){var C=N(this.expr[o],r.expr[o]);if(C!==0)return C}return 0},a.prototype.equals=function(r){if(r instanceof a){if(this.expr.length!==r.expr.length)return!1;for(var o=0,l=this.expr.length;o<l;o++)if(!this.expr[o].equals(r.expr[o]))return!1;return!0}return!1},a.prototype.evaluate=function(r){for(var o=0,l=this.expr.length;o<l;o++)if(!this.expr[o].evaluate(r))return!1;return!0},a._normalizeArr=function(r){var o=[];if(r){for(var l=0,C=r.length;l<C;l++){var b=r[l];if(!b)continue;if(b instanceof a){o=o.concat(b.expr);continue}if(b instanceof w)throw new Error('It is not allowed to have an or expression here due to lack of parens! For example "a && (b||c)" is not supported, use "(a&&b) || (a&&c)" instead.');o.push(b)}o.sort(N)}return o},a.prototype.keys=function(){for(var r=[],o=0,l=this.expr;o<l.length;o++){var C=l[o];r.push.apply(r,C.keys())}return r},a.prototype.negate=function(){for(var r=[],o=0,l=this.expr;o<l.length;o++){var C=l[o];r.push(C.negate())}return w.create(r)},a}(),w=function(){function a(r){this.expr=r}return a.create=function(r){var o=a._normalizeArr(r);return o.length===0?void 0:o.length===1?o[0]:new a(o)},a.prototype.getType=function(){return 8},a.prototype.equals=function(r){if(r instanceof a){if(this.expr.length!==r.expr.length)return!1;for(var o=0,l=this.expr.length;o<l;o++)if(!this.expr[o].equals(r.expr[o]))return!1;return!0}return!1},a.prototype.evaluate=function(r){for(var o=0,l=this.expr.length;o<l;o++)if(this.expr[o].evaluate(r))return!0;return!1},a._normalizeArr=function(r){var o=[];if(r){for(var l=0,C=r.length;l<C;l++){var b=r[l];if(!b)continue;if(b instanceof a){o=o.concat(b.expr);continue}o.push(b)}o.sort(N)}return o},a.prototype.keys=function(){for(var r=[],o=0,l=this.expr;o<l.length;o++){var C=l[o];r.push.apply(r,C.keys())}return r},a.prototype.negate=function(){for(var r=[],o=0,l=this.expr;o<l.length;o++){var C=l[o];r.push(C.negate())}for(var b=function(O){return O instanceof a?O.expr:[O]};r.length>1;){for(var x=r.shift(),D=r.shift(),T=[],m=0,v=b(x);m<v.length;m++)for(var u=v[m],s=0,S=b(D);s<S.length;s++){var c=S[s];T.push($.and(u,c))}r.unshift($.or.apply($,T))}return r[0]},a}(),p=function(a){P(r,a);function r(o,l){var C=a.call(this,o)||this;return C._defaultValue=l,C}return r.prototype.bindTo=function(o){return o.createKey(this.key,this._defaultValue)},r.prototype.getValue=function(o){return o.getContextKeyValue(this.key)},r.prototype.toNegated=function(){return $.not(this.key)},r}(L),f=Object(V.c)("contextKeyService"),g="setContext"},"VrN/":function(ct,Te,W){(function(ue,V){ct.exports=V()})(this,function(){"use strict";var ue=navigator.userAgent,V=navigator.platform,P=/gecko\/\d/i.test(ue),$=/MSIE \d/.test(ue),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ue),L=/Edge\/(\d+)/.exec(ue),K=$||N||L,F=K&&($?document.documentMode||6:+(L||N)[1]),R=!L&&/WebKit\//.test(ue),A=R&&/Qt\/\d+\.\d+/.test(ue),h=!L&&/Chrome\//.test(ue),y=/Opera\//.test(ue),w=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ue),f=/PhantomJS/.test(ue),g=!L&&/AppleWebKit/.test(ue)&&/Mobile\/\w+/.test(ue),a=/Android/.test(ue),r=g||a||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ue),o=g||/Mac/.test(V),l=/\bCrOS\b/.test(ue),C=/win/i.test(V),b=y&&ue.match(/Version\/(\d*\.\d*)/);b&&(b=Number(b[1])),b&&b>=15&&(y=!1,R=!0);var x=o&&(A||y&&(b==null||b<12.11)),D=P||K&&F>=9;function T(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var m=function(e,t){var i=e.className,n=T(t).exec(i);if(n){var d=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(d?n[1]+d:"")}};function v(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function u(e,t){return v(e).appendChild(t)}function s(e,t,i,n){var d=document.createElement(e);if(i&&(d.className=i),n&&(d.style.cssText=n),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var k=0;k<t.length;++k)d.appendChild(t[k]);return d}function S(e,t,i,n){var d=s(e,t,i,n);return d.setAttribute("role","presentation"),d}var c;document.createRange?c=function(e,t,i,n){var d=document.createRange();return d.setEnd(n||e,i),d.setStart(e,t),d}:c=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(d){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function O(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function M(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function B(e,t){var i=e.className;T(t).test(i)||(e.className+=(i?" ":"")+t)}function j(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!T(i[n]).test(t)&&(t+=" "+i[n]);return t}var H=function(e){e.select()};g?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(H=function(e){try{e.select()}catch(t){}});function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function U(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function J(e,t,i,n,d){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var k=n||0,X=d||0;;){var q=e.indexOf(" ",k);if(q<0||q>=t)return X+(t-k);X+=q-k,X+=i-X%i,k=q+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ne.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function he(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Ee=50,Ae={toString:function(){return"CodeMirror.Pass"}},Oe={scroll:!1},me={origin:"*mouse"},de={origin:"+move"};function pe(e,t,i){for(var n=0,d=0;;){var k=e.indexOf(" ",n);k==-1&&(k=e.length);var X=k-n;if(k==e.length||d+X>=t)return n+Math.min(X,t-d);if(d+=k-n,d+=i-d%i,n=k+1,d>=t)return n}}var se=[""];function ce(e){for(;se.length<=e;)se.push(Z(se)+" ");return se[e]}function Z(e){return e[e.length-1]}function te(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function le(e,t,i){for(var n=0,d=i(t);n<e.length&&i(e[n])<=d;)n++;e.splice(n,0,t)}function ve(){}function ie(e,t){var i;return Object.create?i=Object.create(e):(ve.prototype=e,i=new ve),t&&U(t,i),i}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function xe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||oe.test(e))}function _e(e,t){return t?t.source.indexOf("\\w")>-1&&xe(e)?!0:t.test(e):xe(e)}function Me(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ue=/[\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 He(e){return e.charCodeAt(0)>=768&&Ue.test(e)}function Be(e,t,i){for(;(i<0?t>0:t<e.length)&&He(e.charAt(t));)t+=i;return t}function tt(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var d=(t+i)/2,k=n<0?Math.ceil(d):Math.floor(d);if(k==t)return e(k)?t:i;e(k)?i=k:t=k+n}}function Je(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var d=!1,k=0;k<e.length;++k){var X=e[k];(X.from<i&&X.to>t||t==i&&X.to==t)&&(n(Math.max(X.from,t),Math.min(X.to,i),X.level==1?"rtl":"ltr",k),d=!0)}d||n(t,i,"ltr")}var st=null;function nt(e,t,i){var n;st=null;for(var d=0;d<e.length;++d){var k=e[d];if(k.from<t&&k.to>t)return d;k.to==t&&(k.from!=k.to&&i=="before"?n=d:st=d),k.from==t&&(k.from!=k.to&&i!="before"?n=d:st=d)}return n!=null?n:st}var pt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(fe){return fe<=247?e.charAt(fe):1424<=fe&&fe<=1524?"R":1536<=fe&&fe<=1785?t.charAt(fe-1536):1774<=fe&&fe<=2220?"r":8192<=fe&&fe<=8203?"w":fe==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,k=/[LRr]/,X=/[Lb1n]/,q=/[1n]/;function ee(fe,Se,Pe){this.level=fe,this.from=Se,this.to=Pe}return function(fe,Se){var Pe=Se=="ltr"?"L":"R";if(fe.length==0||Se=="ltr"&&!n.test(fe))return!1;for(var je=fe.length,Fe=[],$e=0;$e<je;++$e)Fe.push(i(fe.charCodeAt($e)));for(var ut=0,bt=Pe;ut<je;++ut){var Ct=Fe[ut];Ct=="m"?Fe[ut]=bt:bt=Ct}for(var Ot=0,St=Pe;Ot<je;++Ot){var kt=Fe[Ot];kt=="1"&&St=="r"?Fe[Ot]="n":k.test(kt)&&(St=kt,kt=="r"&&(Fe[Ot]="R"))}for(var Gt=1,Wt=Fe[0];Gt<je-1;++Gt){var ar=Fe[Gt];ar=="+"&&Wt=="1"&&Fe[Gt+1]=="1"?Fe[Gt]="1":ar==","&&Wt==Fe[Gt+1]&&(Wt=="1"||Wt=="n")&&(Fe[Gt]=Wt),Wt=ar}for(var Or=0;Or<je;++Or){var Vr=Fe[Or];if(Vr==",")Fe[Or]="N";else if(Vr=="%"){var kr=void 0;for(kr=Or+1;kr<je&&Fe[kr]=="%";++kr);for(var yn=Or&&Fe[Or-1]=="!"||kr<je&&Fe[kr]=="1"?"1":"N",dn=Or;dn<kr;++dn)Fe[dn]=yn;Or=kr-1}}for(var jr=0,cn=Pe;jr<je;++jr){var Jr=Fe[jr];cn=="L"&&Jr=="1"?Fe[jr]="L":k.test(Jr)&&(cn=Jr)}for(var Hr=0;Hr<je;++Hr)if(d.test(Fe[Hr])){var Wr=void 0;for(Wr=Hr+1;Wr<je&&d.test(Fe[Wr]);++Wr);for(var Ir=(Hr?Fe[Hr-1]:Pe)=="L",hn=(Wr<je?Fe[Wr]:Pe)=="L",Ei=Ir==hn?Ir?"L":"R":Pe,Xn=Hr;Xn<Wr;++Xn)Fe[Xn]=Ei;Hr=Wr-1}for(var en=[],Rn,Xr=0;Xr<je;)if(X.test(Fe[Xr])){var qa=Xr;for(++Xr;Xr<je&&X.test(Fe[Xr]);++Xr);en.push(new ee(0,qa,Xr))}else{var In=Xr,ri=en.length,ni=Se=="rtl"?1:0;for(++Xr;Xr<je&&Fe[Xr]!="L";++Xr);for(var on=In;on<Xr;)if(q.test(Fe[on])){In<on&&(en.splice(ri,0,new ee(1,In,on)),ri+=ni);var xi=on;for(++on;on<Xr&&q.test(Fe[on]);++on);en.splice(ri,0,new ee(2,xi,on)),ri+=ni,In=on}else++on;In<Xr&&en.splice(ri,0,new ee(1,In,Xr))}return Se=="ltr"&&(en[0].level==1&&(Rn=fe.match(/^\s+/))&&(en[0].from=Rn[0].length,en.unshift(new ee(0,0,Rn[0].length))),Z(en).level==1&&(Rn=fe.match(/\s+$/))&&(Z(en).to-=Rn[0].length,en.push(new ee(0,je-Rn[0].length,je)))),Se=="rtl"?en.reverse():en}}();function mt(e,t){var i=e.order;return i==null&&(i=e.order=pt(e.text,t)),i}var ke=[],Le=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||ke).concat(i)}};function We(e,t){return e._handlers&&e._handlers[t]||ke}function Ve(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,d=n&&n[t];if(d){var k=he(d,i);k>-1&&(n[t]=d.slice(0,k).concat(d.slice(k+1)))}}}function Ne(e,t){var i=We(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),d=0;d<i.length;++d)i[d].apply(null,n)}function Ke(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ne(e,i||t.type,e,t),be(t)||t.codemirrorIgnore}function we(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)he(i,t[n])==-1&&i.push(t[n])}function ye(e,t){return We(e,t).length>0}function ge(e){e.prototype.on=function(t,i){Le(this,t,i)},e.prototype.off=function(t,i){Ve(this,t,i)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function re(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function be(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Ce(e){ae(e),re(e)}function Ie(e){return e.target||e.srcElement}function De(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),o&&e.ctrlKey&&t==1&&(t=3),t}var Ge=function(){if(K&&F<9)return!1;var e=s("div");return"draggable"in e||"dragDrop"in e}(),Qe;function dt(e){if(Qe==null){var t=s("span","\u200B");u(e,s("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Qe=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&F<8))}var i=Qe?s("span","\u200B"):s("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var rt;function ht(e){if(rt!=null)return rt;var t=u(e,document.createTextNode("A\u062EA")),i=c(t,0,1).getBoundingClientRect(),n=c(t,1,2).getBoundingClientRect();return v(e),!i||i.left==i.right?!1:rt=n.right-i.right<3}var ft=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var d=e.indexOf(`
`,t);d==-1&&(d=e.length);var k=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),X=k.indexOf("\r");X!=-1?(i.push(k.slice(0,X)),t+=X+1):(i.push(k),t=d+1)}return i}:function(e){return e.split(/\r\n?|\n/)},at=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},Dt=function(){var e=s("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Lt=null;function Tt(e){if(Lt!=null)return Lt;var t=u(e,s("span","x")),i=t.getBoundingClientRect(),n=c(t,0,1).getBoundingClientRect();return Lt=Math.abs(i.left-n.left)>1}var Rt={},wt={};function Ut(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Rt[e]=t}function Nt(e,t){wt[e]=t}function qe(e){if(typeof e=="string"&&wt.hasOwnProperty(e))e=wt[e];else if(e&&typeof e.name=="string"&&wt.hasOwnProperty(e.name)){var t=wt[e.name];typeof t=="string"&&(t={name:t}),e=ie(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return qe("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return qe("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ze(e,t){t=qe(t);var i=Rt[t.name];if(!i)return Ze(e,"text/plain");var n=i(e,t);if(ze.hasOwnProperty(t.name)){var d=ze[t.name];for(var k in d){if(!d.hasOwnProperty(k))continue;n.hasOwnProperty(k)&&(n["_"+k]=n[k]),n[k]=d[k]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var X in t.modeProps)n[X]=t.modeProps[X];return n}var ze={};function Ye(e,t){var i=ze.hasOwnProperty(e)?ze[e]:ze[e]={};U(t,i)}function ot(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var d=t[n];d instanceof Array&&(d=d.concat([])),i[n]=d}return i}function gt(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 Mt(e,t,i){return e.startState?e.startState(t,i):!0}var Et=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};Et.prototype.eol=function(){return this.pos>=this.string.length},Et.prototype.sol=function(){return this.pos==this.lineStart},Et.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Et.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Et.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Et.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Et.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Et.prototype.skipToEnd=function(){this.pos=this.string.length},Et.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Et.prototype.backUp=function(e){this.pos-=e},Et.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=J(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},Et.prototype.indentation=function(){return J(this.string,null,this.tabSize)-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},Et.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(X){return i?X.toLowerCase():X},d=this.string.substr(this.pos,e.length);if(n(d)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var k=this.string.slice(this.pos).match(e);return k&&k.index>0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},Et.prototype.current=function(){return this.string.slice(this.start,this.pos)},Et.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Et.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Et.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function lt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var d=i.children[n],k=d.chunkSize();if(t<k){i=d;break}t-=k}return i.lines[t]}function Jt(e,t,i){var n=[],d=t.line;return e.iter(t.line,i.line+1,function(k){var X=k.text;d==i.line&&(X=X.slice(0,i.ch)),d==t.line&&(X=X.slice(t.ch)),n.push(X),++d}),n}function vr(e,t,i){var n=[];return e.iter(t,i,function(d){n.push(d.text)}),n}function $t(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function vt(e){if(e.parent==null)return null;for(var t=e.parent,i=he(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var d=0;!(n.children[d]==t);++d)i+=n.children[d].chunkSize();return i+t.first}function zt(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var d=e.children[n],k=d.height;if(t<k){e=d;continue e}t-=k,i+=d.chunkSize()}return i}while(!e.lines);for(var X=0;X<e.lines.length;++X){var q=e.lines[X],ee=q.height;if(t<ee)break;t-=ee}return i+X}function Qt(e,t){return t>=e.first&&t<e.first+e.size}function or(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Xe(e,t,i){if(i===void 0&&(i=null),!(this instanceof Xe))return new Xe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function xt(e,t){return e.line-t.line||e.ch-t.ch}function Pt(e,t){return e.sticky==t.sticky&&xt(e,t)==0}function At(e){return Xe(e.line,e.ch)}function Ft(e,t){return xt(e,t)<0?t:e}function Yt(e,t){return xt(e,t)<0?e:t}function G(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function E(e,t){if(t.line<e.first)return Xe(e.first,0);var i=e.first+e.size-1;return t.line>i?Xe(i,lt(e,i).text.length):_(t,lt(e,t.line).text.length)}function _(e,t){var i=e.ch;return i==null||i>t?Xe(e.line,t):i<0?Xe(e.line,0):e}function z(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=E(e,t[n]);return i}var Q=function(e,t){this.state=e,this.lookAhead=t},Y=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};Y.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Y.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}},Y.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Y.fromSaved=function(e,t,i){return t instanceof Q?new Y(e,ot(e.mode,t.state),i,t.lookAhead):new Y(e,ot(e.mode,t),i)},Y.prototype.save=function(e){var t=e!==!1?ot(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Q(t,this.maxLookAhead):t};function Re(e,t,i,n){var d=[e.state.modeGen],k={};Yr(e,t.text,e.doc.mode,i,function(fe,Se){return d.push(fe,Se)},k,n);for(var X=i.state,q=function(fe){i.baseTokens=d;var Se=e.state.overlays[fe],Pe=1,je=0;i.state=!0,Yr(e,t.text,Se.mode,i,function(Fe,$e){for(var ut=Pe;je<Fe;){var bt=d[Pe];bt>Fe&&d.splice(Pe,1,Fe,d[Pe+1],bt),Pe+=2,je=Math.min(Fe,bt)}if(!$e)return;if(Se.opaque)d.splice(ut,Pe-ut,Fe,"overlay "+$e),Pe=ut+2;else for(;ut<Pe;ut+=2){var Ct=d[ut+1];d[ut+1]=(Ct?Ct+" ":"")+"overlay "+$e}},k),i.state=X,i.baseTokens=null,i.baseTokenPos=1},ee=0;ee<e.state.overlays.length;++ee)q(ee);return{styles:d,classes:k.bgClass||k.textClass?k:null}}function et(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=yt(e,vt(t)),d=t.text.length>e.options.maxHighlightLength&&ot(e.doc.mode,n.state),k=Re(e,t,n);d&&(n.state=d),t.stateAfter=n.save(!d),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function yt(e,t,i){var n=e.doc,d=e.display;if(!n.mode.startState)return new Y(n,!0,t);var k=Er(e,t,i),X=k>n.first&&lt(n,k-1).stateAfter,q=X?Y.fromSaved(n,X,k):new Y(n,Mt(n.mode),k);return n.iter(k,t,function(ee){_t(e,ee.text,q);var fe=q.line;ee.stateAfter=fe==t-1||fe%5==0||fe>=d.viewFrom&&fe<d.viewTo?q.save():null,q.nextLine()}),i&&(n.modeFrontier=q.line),q}function _t(e,t,i,n){var d=e.doc.mode,k=new Et(t,e.options.tabSize,i);for(k.start=k.pos=n||0,t==""&&it(d,i.state);!k.eol();)Kt(d,k,i.state),k.start=k.pos}function it(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=gt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Kt(e,t,i,n){for(var d=0;d<10;d++){n&&(n[0]=gt(e,i).mode);var k=e.token(t,i);if(t.pos>t.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var 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 gr(e,t,i,n){var d=e.doc,k=d.mode,X;t=E(d,t);var q=lt(d,t.line),ee=yt(e,t.line,i),fe=new Et(q.text,e.options.tabSize,ee),Se;for(n&&(Se=[]);(n||fe.pos<t.ch)&&!fe.eol();)fe.start=fe.pos,X=Kt(k,fe,ee.state),n&&Se.push(new Bt(fe,X,ot(d.mode,ee.state)));return n?Se:new Bt(fe,X,ee.state)}function Kr(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Yr(e,t,i,n,d,k,X){var q=i.flattenSpans;q==null&&(q=e.options.flattenSpans);var ee=0,fe=null,Se=new Et(t,e.options.tabSize,n),Pe,je=e.options.addModeClass&&[null];for(t==""&&Kr(it(i,n.state),k);!Se.eol();){if(Se.pos>e.options.maxHighlightLength?(q=!1,X&&_t(e,t,n,Se.pos),Se.pos=t.length,Pe=null):Pe=Kr(Kt(i,Se,n.state,je),k),je){var Fe=je[0].name;Fe&&(Pe="m-"+(Pe?Fe+" "+Pe:Fe))}if(!q||fe!=Pe){for(;ee<Se.start;)ee=Math.min(Se.start,ee+5e3),d(ee,fe);fe=Pe}Se.start=Se.pos}for(;ee<Se.pos;){var $e=Math.min(Se.pos,ee+5e3);d($e,fe),ee=$e}}function Er(e,t,i){for(var n,d,k=e.doc,X=i?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>X;--q){if(q<=k.first)return k.first;var ee=lt(k,q-1),fe=ee.stateAfter;if(fe&&(!i||q+(fe instanceof Q?fe.lookAhead:0)<=k.modeFrontier))return q;var Se=J(ee.text,null,e.options.tabSize);(d==null||n>Se)&&(d=q-1,n=Se)}return d}function tn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var d=lt(e,n).stateAfter;if(d&&(!(d instanceof Q)||n+d.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Cn=!1,Ur=!1;function Qr(){Cn=!0}function Zt(){Ur=!0}function Vt(e,t,i){this.marker=e,this.from=t,this.to=i}function Xt(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function er(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function ur(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function sr(e,t,i){var n;if(e)for(var d=0;d<e.length;++d){var k=e[d],X=k.marker,q=k.from==null||(X.inclusiveLeft?k.from<=t:k.from<t);if(q||k.from==t&&X.type=="bookmark"&&(!i||!k.marker.insertLeft)){var ee=k.to==null||(X.inclusiveRight?k.to>=t:k.to>t);(n||(n=[])).push(new Vt(X,k.from,ee?null:k.to))}}return n}function Tr(e,t,i){var n;if(e)for(var d=0;d<e.length;++d){var k=e[d],X=k.marker,q=k.to==null||(X.inclusiveRight?k.to>=t:k.to>t);if(q||k.from==t&&X.type=="bookmark"&&(!i||k.marker.insertLeft)){var ee=k.from==null||(X.inclusiveLeft?k.from<=t:k.from<t);(n||(n=[])).push(new Vt(X,ee?null:k.from-t,k.to==null?null:k.to-t))}}return n}function Lr(e,t){if(t.full)return null;var i=Qt(e,t.from.line)&&lt(e,t.from.line).markedSpans,n=Qt(e,t.to.line)&&lt(e,t.to.line).markedSpans;if(!i&&!n)return null;var d=t.from.ch,k=t.to.ch,X=xt(t.from,t.to)==0,q=sr(i,d,X),ee=Tr(n,k,X),fe=t.text.length==1,Se=Z(t.text).length+(fe?d:0);if(q)for(var Pe=0;Pe<q.length;++Pe){var je=q[Pe];if(je.to==null){var Fe=Xt(ee,je.marker);Fe?fe&&(je.to=Fe.to==null?null:Fe.to+Se):je.to=d}}if(ee)for(var $e=0;$e<ee.length;++$e){var ut=ee[$e];if(ut.to!=null&&(ut.to+=Se),ut.from==null){var bt=Xt(q,ut.marker);bt||(ut.from=Se,fe&&(q||(q=[])).push(ut))}else ut.from+=Se,fe&&(q||(q=[])).push(ut)}q&&(q=wr(q)),ee&&ee!=q&&(ee=wr(ee));var Ct=[q];if(!fe){var Ot=t.text.length-2,St;if(Ot>0&&q)for(var kt=0;kt<q.length;++kt)q[kt].to==null&&(St||(St=[])).push(new Vt(q[kt].marker,null,null));for(var Gt=0;Gt<Ot;++Gt)Ct.push(St);Ct.push(ee)}return Ct}function wr(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Mr(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(Fe){if(Fe.markedSpans)for(var $e=0;$e<Fe.markedSpans.length;++$e){var ut=Fe.markedSpans[$e].marker;ut.readOnly&&(!n||he(n,ut)==-1)&&(n||(n=[])).push(ut)}}),!n)return null;for(var d=[{from:t,to:i}],k=0;k<n.length;++k)for(var X=n[k],q=X.find(0),ee=0;ee<d.length;++ee){var fe=d[ee];if(xt(fe.to,q.from)<0||xt(fe.from,q.to)>0)continue;var Se=[ee,1],Pe=xt(fe.from,q.from),je=xt(fe.to,q.to);(Pe<0||!X.inclusiveLeft&&!Pe)&&Se.push({from:fe.from,to:q.from}),(je>0||!X.inclusiveRight&&!je)&&Se.push({from:q.to,to:fe.to}),d.splice.apply(d,Se),ee+=Se.length-3}return d}function Zr(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function sn(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function dr(e){return e.inclusiveLeft?-1:0}function qt(e){return e.inclusiveRight?1:0}function Ar(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),d=t.find(),k=xt(n.from,d.from)||dr(e)-dr(t);if(k)return-k;var X=xt(n.to,d.to)||qt(e)-qt(t);return X||t.id-e.id}function rr(e,t){var i=Ur&&e.markedSpans,n;if(i)for(var d=void 0,k=0;k<i.length;++k)d=i[k],d.marker.collapsed&&(t?d.from:d.to)==null&&(!n||Ar(n,d.marker)<0)&&(n=d.marker);return n}function Cr(e){return rr(e,!0)}function nr(e){return rr(e,!1)}function Dr(e,t){var i=Ur&&e.markedSpans,n;if(i)for(var d=0;d<i.length;++d){var k=i[d];k.marker.collapsed&&(k.from==null||k.from<t)&&(k.to==null||k.to>t)&&(!n||Ar(n,k.marker)<0)&&(n=k.marker)}return n}function _r(e,t,i,n,d){var k=lt(e,t),X=Ur&&k.markedSpans;if(X)for(var q=0;q<X.length;++q){var ee=X[q];if(!ee.marker.collapsed)continue;var fe=ee.marker.find(0),Se=xt(fe.from,i)||dr(ee.marker)-dr(d),Pe=xt(fe.to,n)||qt(ee.marker)-qt(d);if(Se>=0&&Pe<=0||Se<=0&&Pe>=0)continue;if(Se<=0&&(ee.marker.inclusiveRight&&d.inclusiveLeft?xt(fe.to,i)>=0:xt(fe.to,i)>0)||Se>=0&&(ee.marker.inclusiveRight&&d.inclusiveLeft?xt(fe.from,n)<=0:xt(fe.from,n)<0))return!0}}function Fr(e){for(var t;t=Cr(e);)e=t.find(-1,!0).line;return e}function Sn(e){for(var t;t=nr(e);)e=t.find(1,!0).line;return e}function yr(e){for(var t,i;t=nr(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function rn(e,t){var i=lt(e,t),n=Fr(i);return i==n?t:vt(n)}function Tn(e,t){if(t>e.lastLine())return t;var i=lt(e,t),n;if(!nn(e,i))return t;for(;n=nr(i);)i=n.find(1,!0).line;return vt(i)+1}function nn(e,t){var i=Ur&&t.markedSpans;if(i)for(var n=void 0,d=0;d<i.length;++d){if(n=i[d],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&Nn(e,t,n))return!0}}function Nn(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return Nn(e,n.line,Xt(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var d=void 0,k=0;k<t.markedSpans.length;++k)if(d=t.markedSpans[k],d.marker.collapsed&&!d.marker.widgetNode&&d.from==i.to&&(d.to==null||d.to!=i.from)&&(d.marker.inclusiveLeft||i.marker.inclusiveRight)&&Nn(e,t,d))return!0}function bn(e){e=Fr(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var d=i.lines[n];if(d==e)break;t+=d.height}for(var k=i.parent;k;i=k,k=i.parent)for(var X=0;X<k.children.length;++X){var q=k.children[X];if(q==i)break;t+=q.height}return t}function Pn(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=Cr(n);){var d=i.find(0,!0);n=d.from.line,t+=d.from.ch-d.to.ch}for(n=e;i=nr(n);){var k=i.find(0,!0);t-=n.text.length-k.from.ch,n=k.to.line,t+=n.text.length-k.to.ch}return t}function Un(e){var t=e.display,i=e.doc;t.maxLine=lt(i,i.first),t.maxLineLength=Pn(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var d=Pn(n);d>t.maxLineLength&&(t.maxLineLength=d,t.maxLine=n)})}var fn=function(e,t,i){this.text=e,sn(this,t),this.height=i?i(this):1};fn.prototype.lineNo=function(){return vt(this)},ge(fn);function ii(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Zr(e),sn(e,i);var d=n?n(e):1;d!=e.height&&$t(e,d)}function Ci(e){e.parent=null,Zr(e)}var It={},Ht={};function jt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Ht:It;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function tr(e,t){var i=S("span",null,null,R?"padding-right: .1px":null),n={pre:S("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var d=0;d<=(t.rest?t.rest.length:0);d++){var k=d?t.rest[d-1]:t.line,X=void 0;n.pos=0,n.addToken=br,ht(e.display.measure)&&(X=mt(k,e.doc.direction))&&(n.addToken=Pr(n.addToken,X)),n.map=[];var q=t!=e.display.externalMeasured&&vt(k);ir(k,n,et(e,k,q)),k.styleClasses&&(k.styleClasses.bgClass&&(n.bgClass=j(k.styleClasses.bgClass,n.bgClass||"")),k.styleClasses.textClass&&(n.textClass=j(k.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(dt(e.display.measure))),d==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(R){var ee=n.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ne(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=j(n.pre.className,n.textClass||"")),n}function pr(e){var t=s("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function br(e,t,i,n,d,k,X){if(!t)return;var q=e.splitSpaces?lr(t,e.trailingSpace):t,ee=e.cm.state.specialChars,fe=!1,Se;if(!ee.test(t))e.col+=t.length,Se=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,Se),K&&F<9&&(fe=!0),e.pos+=t.length;else{Se=document.createDocumentFragment();for(var Pe=0;;){ee.lastIndex=Pe;var je=ee.exec(t),Fe=je?je.index-Pe:t.length-Pe;if(Fe){var $e=document.createTextNode(q.slice(Pe,Pe+Fe));K&&F<9?Se.appendChild(s("span",[$e])):Se.appendChild($e),e.map.push(e.pos,e.pos+Fe,$e),e.col+=Fe,e.pos+=Fe}if(!je)break;Pe+=Fe+1;var ut=void 0;if(je[0]==" "){var bt=e.cm.options.tabSize,Ct=bt-e.col%bt;ut=Se.appendChild(s("span",ce(Ct),"cm-tab")),ut.setAttribute("role","presentation"),ut.setAttribute("cm-text"," "),e.col+=Ct}else je[0]=="\r"||je[0]==`
`?(ut=Se.appendChild(s("span",je[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ut.setAttribute("cm-text",je[0]),e.col+=1):(ut=e.cm.options.specialCharPlaceholder(je[0]),ut.setAttribute("cm-text",je[0]),K&&F<9?Se.appendChild(s("span",[ut])):Se.appendChild(ut),e.col+=1);e.map.push(e.pos,e.pos+1,ut),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,i||n||d||fe||k||X){var Ot=i||"";n&&(Ot+=n),d&&(Ot+=d);var St=s("span",[Se],Ot,k);if(X)for(var kt in X)X.hasOwnProperty(kt)&&kt!="style"&&kt!="class"&&St.setAttribute(kt,X[kt]);return e.content.appendChild(St)}e.content.appendChild(Se)}function lr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",d=0;d<e.length;d++){var k=e.charAt(d);k==" "&&i&&(d==e.length-1||e.charCodeAt(d+1)==32)&&(k="\xA0"),n+=k,i=k==" "}return n}function Pr(e,t){return function(i,n,d,k,X,q,ee){d=d?d+" cm-force-border":"cm-force-border";for(var fe=i.pos,Se=fe+n.length;;){for(var Pe=void 0,je=0;je<t.length&&!(Pe=t[je],Pe.to>fe&&Pe.from<=fe);je++);if(Pe.to>=Se)return e(i,n,d,k,X,q,ee);e(i,n.slice(0,Pe.to-fe),d,k,null,q,ee),k=null,n=n.slice(Pe.to-fe),fe=Pe.to}}}function $r(e,t,i,n){var d=!n&&i.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!n&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",i.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function ir(e,t,i){var n=e.markedSpans,d=e.text,k=0;if(!n){for(var X=1;X<i.length;X+=2)t.addToken(t,d.slice(k,k=i[X]),jt(i[X+1],t.cm.options));return}for(var q=d.length,ee=0,fe=1,Se="",Pe,je,Fe=0,$e,ut,bt,Ct,Ot;;){if(Fe==ee){$e=ut=bt=je="",Ot=null,Ct=null,Fe=Infinity;for(var St=[],kt=void 0,Gt=0;Gt<n.length;++Gt){var Wt=n[Gt],ar=Wt.marker;if(ar.type=="bookmark"&&Wt.from==ee&&ar.widgetNode)St.push(ar);else if(Wt.from<=ee&&(Wt.to==null||Wt.to>ee||ar.collapsed&&Wt.to==ee&&Wt.from==ee)){if(Wt.to!=null&&Wt.to!=ee&&Fe>Wt.to&&(Fe=Wt.to,ut=""),ar.className&&($e+=" "+ar.className),ar.css&&(je=(je?je+";":"")+ar.css),ar.startStyle&&Wt.from==ee&&(bt+=" "+ar.startStyle),ar.endStyle&&Wt.to==Fe&&(kt||(kt=[])).push(ar.endStyle,Wt.to),ar.title&&((Ot||(Ot={})).title=ar.title),ar.attributes)for(var Or in ar.attributes)(Ot||(Ot={}))[Or]=ar.attributes[Or];ar.collapsed&&(!Ct||Ar(Ct.marker,ar)<0)&&(Ct=Wt)}else Wt.from>ee&&Fe>Wt.from&&(Fe=Wt.from)}if(kt)for(var Vr=0;Vr<kt.length;Vr+=2)kt[Vr+1]==Fe&&(ut+=" "+kt[Vr]);if(!Ct||Ct.from==ee)for(var kr=0;kr<St.length;++kr)$r(t,0,St[kr]);if(Ct&&(Ct.from||0)==ee){if($r(t,(Ct.to==null?q+1:Ct.to)-ee,Ct.marker,Ct.from==null),Ct.to==null)return;Ct.to==ee&&(Ct=!1)}}if(ee>=q)break;for(var yn=Math.min(q,Fe);;){if(Se){var dn=ee+Se.length;if(!Ct){var jr=dn>yn?Se.slice(0,yn-ee):Se;t.addToken(t,jr,Pe?Pe+$e:$e,bt,ee+jr.length==Fe?ut:"",je,Ot)}if(dn>=yn){Se=Se.slice(yn-ee),ee=yn;break}ee=dn,bt=""}Se=d.slice(k,k=i[fe++]),Pe=jt(i[fe++],t.cm.options)}}}function On(e,t,i){this.line=t,this.rest=yr(t),this.size=this.rest?vt(Z(this.rest))-i+1:1,this.node=this.text=null,this.hidden=nn(e,t)}function cr(e,t,i){for(var n=[],d,k=t;k<i;k=d){var X=new On(e.doc,lt(e.doc,k),k);d=k+X.size,n.push(X)}return n}var Br=null;function pn(e){Br?Br.ops.push(e):e.ownsGroup=Br={ops:[e],delayedCallbacks:[]}}function mn(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var d=e.ops[n];if(d.cursorActivityHandlers)for(;d.cursorActivityCalled<d.cursorActivityHandlers.length;)d.cursorActivityHandlers[d.cursorActivityCalled++].call(null,d.cm)}}while(i<t.length)}function hr(e,t){var i=e.ownsGroup;if(!i)return;try{mn(i)}finally{Br=null,t(i)}}var fr=null;function mr(e,t){var i=We(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),d;Br?d=Br.delayedCallbacks:fr?d=fr:(d=fr=[],setTimeout(gn,0));for(var k=function(q){d.push(function(){return i[q].apply(null,n)})},X=0;X<i.length;++X)k(X)}function gn(){var e=fr;fr=null;for(var t=0;t<e.length;++t)e[t]()}function Fn(e,t,i,n){for(var d=0;d<t.changes.length;d++){var k=t.changes[d];k=="text"?ga(e,t):k=="gutter"?to(e,t,i,n):k=="class"?va(e,t):k=="widget"&&Is(e,t,n)}t.changes=null}function Bn(e){return e.node==e.text&&(e.node=s("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&F<8&&(e.node.style.zIndex=2)),e.node}function Si(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=Bn(t);t.background=n.insertBefore(s("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Xi(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):tr(e,t)}function ga(e,t){var i=t.text.className,n=Xi(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,va(e,t)):i&&(t.text.className=i)}function va(e,t){Si(e,t),t.line.wrapClass?Bn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function to(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var d=Bn(t);t.gutterBackground=s("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),d.insertBefore(t.gutterBackground,t.text)}var k=t.line.gutterMarkers;if(e.options.lineNumbers||k){var X=Bn(t),q=t.gutter=s("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),X.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!k||!k["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(s("div",or(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),k)for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var fe=e.display.gutterSpecs[ee].className,Se=k.hasOwnProperty(fe)&&k[fe];Se&&q.appendChild(s("div",[Se],"CodeMirror-gutter-elt","left: "+n.gutterLeft[fe]+"px; width: "+n.gutterWidth[fe]+"px"))}}}function Is(e,t,i){t.alignable&&(t.alignable=null);for(var n=T("CodeMirror-linewidget"),d=t.node.firstChild,k=void 0;d;d=k)k=d.nextSibling,n.test(d.className)&&t.node.removeChild(d);ro(e,t,i)}function Ns(e,t,i,n){var d=Xi(e,t);return t.text=t.node=d.pre,d.bgClass&&(t.bgClass=d.bgClass),d.textClass&&(t.textClass=d.textClass),va(e,t),to(e,t,i,n),ro(e,t,n),t.node}function ro(e,t,i){if(no(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)no(e,t.rest[n],t,i,!1)}function no(e,t,i,n,d){if(!t.widgets)return;for(var k=Bn(i),X=0,q=t.widgets;X<q.length;++X){var ee=q[X],fe=s("div",[ee.node],"CodeMirror-linewidget"+(ee.className?" "+ee.className:""));ee.handleMouseEvents||fe.setAttribute("cm-ignore-events","true"),Us(ee,fe,i,n),e.display.input.setUneditable(fe),d&&ee.above?k.insertBefore(fe,i.gutter||i.text):k.appendChild(fe),mr(ee,"redraw")}}function Us(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var d=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(d-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=d+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Ti(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),u(t.display.measure,s("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function kn(e,t){for(var i=Ie(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Yi(e){return e.lineSpace.offsetTop}function ya(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function io(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=u(e.measure,s("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Ln(e){return Ee-e.display.nativeBarWidth}function Yn(e){return e.display.scroller.clientWidth-Ln(e)-e.display.barWidth}function ba(e){return e.display.scroller.clientHeight-Ln(e)-e.display.barHeight}function Fs(e,t,i){var n=e.options.lineWrapping,d=n&&Yn(e);if(!t.measure.heights||n&&t.measure.width!=d){var k=t.measure.heights=[];if(n){t.measure.width=d;for(var X=t.text.firstChild.getClientRects(),q=0;q<X.length-1;q++){var ee=X[q],fe=X[q+1];Math.abs(ee.bottom-fe.bottom)>2&&k.push((ee.bottom+fe.top)/2-i.top)}}k.push(i.bottom-i.top)}}function ao(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var d=0;d<e.rest.length;d++)if(vt(e.rest[d])>i)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function Bs(e,t){t=Fr(t);var i=vt(t),n=e.display.externalMeasured=new On(e.doc,t,i);n.lineN=i;var d=n.built=tr(e,n);return n.text=d.pre,u(e.display.lineMeasure,d.pre),n}function oo(e,t,i,n){return Dn(e,ai(e,t),i,n)}function Ea(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Qn(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function ai(e,t){var i=vt(t),n=Ea(e,i);n&&!n.text?n=null:n&&n.changes&&(Fn(e,n,i,Aa(e)),e.curOp.forceUpdate=!0),n||(n=Bs(e,t));var d=ao(n,t,i);return{line:t,view:n,rect:null,map:d.map,cache:d.cache,before:d.before,hasHeights:!1}}function Dn(e,t,i,n,d){t.before&&(i=-1);var k=i+(n||""),X;return t.cache.hasOwnProperty(k)?X=t.cache[k]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Fs(e,t.view,t.rect),t.hasHeights=!0),X=Ws(e,t,i,n),X.bogus||(t.cache[k]=X)),{left:X.left,right:X.right,top:d?X.rtop:X.top,bottom:d?X.rbottom:X.bottom}}var so={left:0,right:0,top:0,bottom:0};function lo(e,t,i){for(var n,d,k,X,q,ee,fe=0;fe<e.length;fe+=3)if(q=e[fe],ee=e[fe+1],t<q?(d=0,k=1,X="left"):t<ee?(d=t-q,k=d+1):(fe==e.length-3||t==ee&&e[fe+3]>t)&&(k=ee-q,d=k-1,t>=ee&&(X="right")),d!=null){if(n=e[fe+2],q==ee&&i==(n.insertLeft?"left":"right")&&(X=i),i=="left"&&d==0)for(;fe&&e[fe-2]==e[fe-3]&&e[fe-1].insertLeft;)n=e[(fe-=3)+2],X="left";if(i=="right"&&d==ee-q)for(;fe<e.length-3&&e[fe+3]==e[fe+4]&&!e[fe+5].insertLeft;)n=e[(fe+=3)+2],X="right";break}return{node:n,start:d,end:k,collapse:X,coverStart:q,coverEnd:ee}}function js(e,t){var i=so;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var d=e.length-1;d>=0&&!((i=e[d]).left!=i.right);d--);return i}function Ws(e,t,i,n){var d=lo(t.map,i,n),k=d.node,X=d.start,q=d.end,ee=d.collapse,fe;if(k.nodeType==3){for(var Se=0;Se<4;Se++){for(;X&&He(t.line.text.charAt(d.coverStart+X));)--X;for(;d.coverStart+q<d.coverEnd&&He(t.line.text.charAt(d.coverStart+q));)++q;if(K&&F<9&&X==0&&q==d.coverEnd-d.coverStart?fe=k.parentNode.getBoundingClientRect():fe=js(c(k,X,q).getClientRects(),n),fe.left||fe.right||X==0)break;q=X,X=X-1,ee="right"}K&&F<11&&(fe=Ks(e.display.measure,fe))}else{X>0&&(ee=n="right");var Pe;e.options.lineWrapping&&(Pe=k.getClientRects()).length>1?fe=Pe[n=="right"?Pe.length-1:0]:fe=k.getBoundingClientRect()}if(K&&F<9&&!X&&(!fe||!fe.left&&!fe.right)){var je=k.parentNode.getClientRects()[0];je?fe={left:je.left,right:je.left+si(e.display),top:je.top,bottom:je.bottom}:fe=so}for(var Fe=fe.top-t.rect.top,$e=fe.bottom-t.rect.top,ut=(Fe+$e)/2,bt=t.view.measure.heights,Ct=0;Ct<bt.length-1&&!(ut<bt[Ct]);Ct++);var Ot=Ct?bt[Ct-1]:0,St=bt[Ct],kt={left:(ee=="right"?fe.right:fe.left)-t.rect.left,right:(ee=="left"?fe.left:fe.right)-t.rect.left,top:Ot,bottom:St};return!fe.left&&!fe.right&&(kt.bogus=!0),e.options.singleCursorHeightPerLine||(kt.rtop=Fe,kt.rbottom=$e),kt}function Ks(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Tt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function uo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function co(e){e.display.externalMeasure=null,v(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)uo(e.display.view[t])}function wi(e){co(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ho(){return h&&a?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function fo(){return h&&a?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function xa(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=Ti(e.widgets[i]));return t}function $i(e,t,i,n,d){if(!d){var k=xa(t);i.top+=k,i.bottom+=k}if(n=="line")return i;n||(n="local");var X=bn(t);if(n=="local"?X+=Yi(e.display):X-=e.display.viewOffset,n=="page"||n=="window"){var q=e.display.lineSpace.getBoundingClientRect();X+=q.top+(n=="window"?0:fo());var ee=q.left+(n=="window"?0:ho());i.left+=ee,i.right+=ee}return i.top+=X,i.bottom+=X,i}function po(e,t,i){if(i=="div")return t;var n=t.left,d=t.top;if(i=="page")n-=ho(),d-=fo();else if(i=="local"||!i){var k=e.display.sizer.getBoundingClientRect();n+=k.left,d+=k.top}var X=e.display.lineSpace.getBoundingClientRect();return{left:n-X.left,top:d-X.top}}function Ca(e,t,i,n,d){return n||(n=lt(e.doc,t.line)),$i(e,n,oo(e,n,t.ch,d),i)}function wn(e,t,i,n,d,k){n=n||lt(e.doc,t.line),d||(d=ai(e,n));function X($e,ut){var bt=Dn(e,d,$e,ut?"right":"left",k);return ut?bt.left=bt.right:bt.right=bt.left,$i(e,n,bt,i)}var q=mt(n,e.doc.direction),ee=t.ch,fe=t.sticky;if(ee>=n.text.length?(ee=n.text.length,fe="before"):ee<=0&&(ee=0,fe="after"),!q)return X(fe=="before"?ee-1:ee,fe=="before");function Se($e,ut,bt){var Ct=q[ut],Ot=Ct.level==1;return X(bt?$e-1:$e,Ot!=bt)}var Pe=nt(q,ee,fe),je=st,Fe=Se(ee,Pe,fe=="before");return je!=null&&(Fe.other=Se(ee,je,fe!="before")),Fe}function mo(e,t){var i=0;t=E(e.doc,t),e.options.lineWrapping||(i=si(e.display)*t.ch);var n=lt(e.doc,t.line),d=bn(n)+Yi(e.display);return{left:i,right:i,top:d,bottom:d+n.height}}function Sa(e,t,i,n,d){var k=Xe(e,t,i);return k.xRel=d,n&&(k.outside=n),k}function Ta(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return Sa(n.first,0,null,-1,-1);var d=zt(n,i),k=n.first+n.size-1;if(d>k)return Sa(n.first+n.size-1,lt(n,k).text.length,null,1,1);t<0&&(t=0);for(var X=lt(n,d);;){var q=Hs(e,X,d,t,i),ee=Dr(X,q.ch+(q.xRel>0||q.outside>0?1:0));if(!ee)return q;var fe=ee.find(1);if(fe.line==d)return fe;X=lt(n,d=fe.line)}}function go(e,t,i,n){n-=xa(t);var d=t.text.length,k=tt(function(X){return Dn(e,i,X-1).bottom<=n},d,0);return d=tt(function(X){return Dn(e,i,X).top>n},k,d),{begin:k,end:d}}function vo(e,t,i,n){i||(i=ai(e,t));var d=$i(e,t,Dn(e,i,n),"line").top;return go(e,t,i,d)}function wa(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Hs(e,t,i,n,d){d-=bn(t);var k=ai(e,t),X=xa(t),q=0,ee=t.text.length,fe=!0,Se=mt(t,e.doc.direction);if(Se){var Pe=(e.options.lineWrapping?zs:Gs)(e,t,i,k,Se,n,d);fe=Pe.level!=1,q=fe?Pe.from:Pe.to-1,ee=fe?Pe.to:Pe.from-1}var je=null,Fe=null,$e=tt(function(Gt){var Wt=Dn(e,k,Gt);return Wt.top+=X,Wt.bottom+=X,wa(Wt,n,d,!1)?(Wt.top<=d&&Wt.left<=n&&(je=Gt,Fe=Wt),!0):!1},q,ee),ut,bt,Ct=!1;if(Fe){var Ot=n-Fe.left<Fe.right-n,St=Ot==fe;$e=je+(St?0:1),bt=St?"after":"before",ut=Ot?Fe.left:Fe.right}else{!fe&&($e==ee||$e==q)&&$e++,bt=$e==0?"after":$e==t.text.length?"before":Dn(e,k,$e-(fe?1:0)).bottom+X<=d==fe?"after":"before";var kt=wn(e,Xe(i,$e,bt),"line",t,k);ut=kt.left,Ct=d<kt.top?-1:d>=kt.bottom?1:0}return $e=Be(t.text,$e,1),Sa(i,$e,bt,Ct,n-ut)}function Gs(e,t,i,n,d,k,X){var q=tt(function(Pe){var je=d[Pe],Fe=je.level!=1;return wa(wn(e,Xe(i,Fe?je.to:je.from,Fe?"before":"after"),"line",t,n),k,X,!0)},0,d.length-1),ee=d[q];if(q>0){var fe=ee.level!=1,Se=wn(e,Xe(i,fe?ee.from:ee.to,fe?"after":"before"),"line",t,n);wa(Se,k,X,!0)&&Se.top>X&&(ee=d[q-1])}return ee}function zs(e,t,i,n,d,k,X){var q=go(e,t,n,X),ee=q.begin,fe=q.end;/\s/.test(t.text.charAt(fe-1))&&fe--;for(var Se=null,Pe=null,je=0;je<d.length;je++){var Fe=d[je];if(Fe.from>=fe||Fe.to<=ee)continue;var $e=Fe.level!=1,ut=Dn(e,n,$e?Math.min(fe,Fe.to)-1:Math.max(ee,Fe.from)).right,bt=ut<k?k-ut+1e9:ut-k;(!Se||Pe>bt)&&(Se=Fe,Pe=bt)}return Se||(Se=d[d.length-1]),Se.from<ee&&(Se={from:ee,to:Se.to,level:Se.level}),Se.to>fe&&(Se={from:Se.from,to:fe,level:Se.level}),Se}var $n;function oi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if($n==null){$n=s("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)$n.appendChild(document.createTextNode("x")),$n.appendChild(s("br"));$n.appendChild(document.createTextNode("x"))}u(e.measure,$n);var i=$n.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),v(e.measure),i||1}function si(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=s("span","xxxxxxxxxx"),i=s("pre",[t],"CodeMirror-line-like");u(e.measure,i);var n=t.getBoundingClientRect(),d=(n.right-n.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function Aa(e){for(var t=e.display,i={},n={},d=t.gutters.clientLeft,k=t.gutters.firstChild,X=0;k;k=k.nextSibling,++X){var q=e.display.gutterSpecs[X].className;i[q]=k.offsetLeft+k.clientLeft+d,n[q]=k.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function yo(e){var t=oi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/si(e.display)-3);return function(d){if(nn(e.doc,d))return 0;var k=0;if(d.widgets)for(var X=0;X<d.widgets.length;X++)d.widgets[X].height&&(k+=d.widgets[X].height);return i?k+(Math.ceil(d.text.length/n)||1)*t:k+t}}function Oa(e){var t=e.doc,i=yo(e);t.iter(function(n){var d=i(n);d!=n.height&&$t(n,d)})}function Jn(e,t,i,n){var d=e.display;if(!i&&Ie(t).getAttribute("cm-not-content")=="true")return null;var k,X,q=d.lineSpace.getBoundingClientRect();try{k=t.clientX-q.left,X=t.clientY-q.top}catch(Pe){return null}var ee=Ta(e,k,X),fe;if(n&&ee.xRel>0&&(fe=lt(e.doc,ee.line).text).length==ee.ch){var Se=J(fe,fe.length,e.options.tabSize)-fe.length;ee=Xe(ee.line,Math.max(0,Math.round((k-io(e.display).left)/si(e.display))-Se))}return ee}function Qn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function ln(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var d=e.display;if(n&&i<d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>t)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)Ur&&rn(e.doc,t)<d.viewTo&&Wn(e);else if(i<=d.viewFrom)Ur&&Tn(e.doc,i+n)>d.viewFrom?Wn(e):(d.viewFrom+=n,d.viewTo+=n);else if(t<=d.viewFrom&&i>=d.viewTo)Wn(e);else if(t<=d.viewFrom){var k=Ji(e,i,i+n,1);k?(d.view=d.view.slice(k.index),d.viewFrom=k.lineN,d.viewTo+=n):Wn(e)}else if(i>=d.viewTo){var X=Ji(e,t,t,-1);X?(d.view=d.view.slice(0,X.index),d.viewTo=X.lineN):Wn(e)}else{var q=Ji(e,t,t,-1),ee=Ji(e,i,i+n,1);q&&ee?(d.view=d.view.slice(0,q.index).concat(cr(e,q.lineN,ee.lineN)).concat(d.view.slice(ee.index)),d.viewTo+=n):Wn(e)}var fe=d.externalMeasured;fe&&(i<fe.lineN?fe.lineN+=n:t<fe.lineN+fe.size&&(d.externalMeasured=null))}function jn(e,t,i){e.curOp.viewChanged=!0;var n=e.display,d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var k=n.view[Qn(e,t)];if(k.node==null)return;var X=k.changes||(k.changes=[]);he(X,i)==-1&&X.push(i)}function Wn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ji(e,t,i,n){var d=Qn(e,t),k,X=e.display.view;if(!Ur||i==e.doc.first+e.doc.size)return{index:d,lineN:i};for(var q=e.display.viewFrom,ee=0;ee<d;ee++)q+=X[ee].size;if(q!=t){if(n>0){if(d==X.length-1)return null;k=q+X[d].size-t,d++}else k=q-t;t+=k,i+=k}for(;rn(e.doc,i)!=i;){if(d==(n<0?0:X.length-1))return null;i+=n*X[d-(n<0?1:0)].size,d+=n}return{index:d,lineN:i}}function Vs(e,t,i){var n=e.display,d=n.view;d.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=cr(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=cr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Qn(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(cr(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Qn(e,i)))),n.viewTo=i}function bo(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var d=t[n];!d.hidden&&(!d.node||d.changes)&&++i}return i}function Ai(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Eo(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},d=n.cursors=document.createDocumentFragment(),k=n.selection=document.createDocumentFragment(),X=0;X<i.sel.ranges.length;X++){if(!t&&X==i.sel.primIndex)continue;var q=i.sel.ranges[X];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var ee=q.empty();(ee||e.options.showCursorWhenSelecting)&&xo(e,q.head,d),ee||Xs(e,q,k)}return n}function xo(e,t,i){var n=wn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),d=i.appendChild(s("div","\xA0","CodeMirror-cursor"));if(d.style.left=n.left+"px",d.style.top=n.top+"px",d.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var k=i.appendChild(s("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));k.style.display="",k.style.left=n.other.left+"px",k.style.top=n.other.top+"px",k.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Qi(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,i){var n=e.display,d=e.doc,k=document.createDocumentFragment(),X=io(e.display),q=X.left,ee=Math.max(n.sizerWidth,Yn(e)-n.sizer.offsetLeft)-X.right,fe=d.direction=="ltr";function Se(St,kt,Gt,Wt){kt<0&&(kt=0),kt=Math.round(kt),Wt=Math.round(Wt),k.appendChild(s("div",null,"CodeMirror-selected","position: absolute; left: "+St+`px;
top: `+kt+"px; width: "+(Gt==null?ee-St:Gt)+`px;
height: `+(Wt-kt)+"px"))}function Pe(St,kt,Gt){var Wt=lt(d,St),ar=Wt.text.length,Or,Vr;function kr(jr,cn){return Ca(e,Xe(St,jr),"div",Wt,cn)}function yn(jr,cn,Jr){var Hr=vo(e,Wt,null,jr),Wr=cn=="ltr"==(Jr=="after")?"left":"right",Ir=Jr=="after"?Hr.begin:Hr.end-(/\s/.test(Wt.text.charAt(Hr.end-1))?2:1);return kr(Ir,Wr)[Wr]}var dn=mt(Wt,d.direction);return Je(dn,kt||0,Gt==null?ar:Gt,function(jr,cn,Jr,Hr){var Wr=Jr=="ltr",Ir=kr(jr,Wr?"left":"right"),hn=kr(cn-1,Wr?"right":"left"),Ei=kt==null&&jr==0,Xn=Gt==null&&cn==ar,en=Hr==0,Rn=!dn||Hr==dn.length-1;if(hn.top-Ir.top<=3){var Xr=(fe?Ei:Xn)&&en,qa=(fe?Xn:Ei)&&Rn,In=Xr?q:(Wr?Ir:hn).left,ri=qa?ee:(Wr?hn:Ir).right;Se(In,Ir.top,ri-In,Ir.bottom)}else{var ni,on,xi,eo;Wr?(ni=fe&&Ei&&en?q:Ir.left,on=fe?ee:yn(jr,Jr,"before"),xi=fe?q:yn(cn,Jr,"after"),eo=fe&&Xn&&Rn?ee:hn.right):(ni=fe?yn(jr,Jr,"before"):q,on=!fe&&Ei&&en?ee:Ir.right,xi=!fe&&Xn&&Rn?q:hn.left,eo=fe?yn(cn,Jr,"after"):ee),Se(ni,Ir.top,on-ni,Ir.bottom),Ir.bottom<hn.top&&Se(q,Ir.bottom,null,hn.top),Se(xi,hn.top,eo-xi,hn.bottom)}(!Or||Qi(Ir,Or)<0)&&(Or=Ir),Qi(hn,Or)<0&&(Or=hn),(!Vr||Qi(Ir,Vr)<0)&&(Vr=Ir),Qi(hn,Vr)<0&&(Vr=hn)}),{start:Or,end:Vr}}var je=t.from(),Fe=t.to();if(je.line==Fe.line)Pe(je.line,je.ch,Fe.ch);else{var $e=lt(d,je.line),ut=lt(d,Fe.line),bt=Fr($e)==Fr(ut),Ct=Pe(je.line,je.ch,bt?$e.text.length+1:null).end,Ot=Pe(Fe.line,bt?0:null,Fe.ch).start;bt&&(Ct.top<Ot.top-2?(Se(Ct.right,Ct.top,null,Ct.bottom),Se(q,Ot.top,Ot.left,Ot.bottom)):Se(Ct.right,Ct.top,Ot.left-Ct.right,Ct.bottom)),Ct.bottom<Ot.top&&Se(q,Ct.bottom,null,Ot.top)}i.appendChild(k)}function La(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||li(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Co(e){e.state.focused||(e.display.input.focus(),Da(e))}function So(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,li(e))},100)}function Da(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ne(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),R&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),La(e)}function li(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ne(e,"blur",e,t),e.state.focused=!1,m(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Zi(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var d=t.view[n],k=e.options.lineWrapping,X=void 0,q=0;if(d.hidden)continue;if(K&&F<8){var ee=d.node.offsetTop+d.node.offsetHeight;X=ee-i,i=ee}else{var fe=d.node.getBoundingClientRect();X=fe.bottom-fe.top,!k&&d.text.firstChild&&(q=d.text.firstChild.getBoundingClientRect().right-fe.left-1)}var Se=d.line.height-X;if((Se>.005||Se<-.005)&&($t(d.line,X),To(d.line),d.rest))for(var Pe=0;Pe<d.rest.length;Pe++)To(d.rest[Pe]);if(q>e.display.sizerWidth){var je=Math.ceil(q/si(e.display));je>e.display.maxLineLength&&(e.display.maxLineLength=je,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}function To(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function qi(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Yi(e));var d=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,k=zt(t,n),X=zt(t,d);if(i&&i.ensure){var q=i.ensure.from.line,ee=i.ensure.to.line;q<k?(k=q,X=zt(t,bn(lt(t,q))+e.wrapper.clientHeight)):Math.min(ee,t.lastLine())>=X&&(k=zt(t,bn(lt(t,ee))-e.wrapper.clientHeight),X=ee)}return{from:k,to:Math.max(X,k+1)}}function Ys(e,t){if(Ke(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),d=null;if(t.top+n.top<0?d=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!f){var k=s("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Yi(e.display))+`px;
height: `+(t.bottom-t.top+Ln(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(d),e.display.lineSpace.removeChild(k)}}function $s(e,t,i,n){n==null&&(n=0);var d;!e.options.lineWrapping&&t==i&&(t=t.ch?Xe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Xe(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var X=!1,q=wn(e,t),ee=!i||i==t?q:wn(e,i);d={left:Math.min(q.left,ee.left),top:Math.min(q.top,ee.top)-n,right:Math.max(q.left,ee.left),bottom:Math.max(q.bottom,ee.bottom)+n};var fe=Ra(e,d),Se=e.doc.scrollTop,Pe=e.doc.scrollLeft;if(fe.scrollTop!=null&&(Oi(e,fe.scrollTop),Math.abs(e.doc.scrollTop-Se)>1&&(X=!0)),fe.scrollLeft!=null&&(Zn(e,fe.scrollLeft),Math.abs(e.doc.scrollLeft-Pe)>1&&(X=!0)),!X)break}return d}function Js(e,t){var i=Ra(e,t);i.scrollTop!=null&&Oi(e,i.scrollTop),i.scrollLeft!=null&&Zn(e,i.scrollLeft)}function Ra(e,t){var i=e.display,n=oi(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,k=ba(e),X={};t.bottom-t.top>k&&(t.bottom=t.top+k);var q=e.doc.height+ya(i),ee=t.top<n,fe=t.bottom>q-n;if(t.top<d)X.scrollTop=ee?0:t.top;else if(t.bottom>d+k){var Se=Math.min(t.top,(fe?q:t.bottom)-k);Se!=d&&(X.scrollTop=Se)}var Pe=e.options.fixedGutter?0:i.gutters.offsetWidth,je=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Pe,Fe=Yn(e)-i.gutters.offsetWidth,$e=t.right-t.left>Fe;return $e&&(t.right=t.left+Fe),t.left<10?X.scrollLeft=0:t.left<je?X.scrollLeft=Math.max(0,t.left+Pe-($e?0:10)):t.right>Fe+je-3&&(X.scrollLeft=t.right+($e?0:10)-Fe),X}function Pa(e,t){if(t==null)return;ea(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ui(e){ea(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _i(e,t,i){(t!=null||i!=null)&&ea(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Qs(e,t){ea(e),e.curOp.scrollToPos=t}function ea(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=mo(e,t.from),n=mo(e,t.to);wo(e,i,n,t.margin)}}function wo(e,t,i,n){var d=Ra(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});_i(e,d.scrollLeft,d.scrollTop)}function Oi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Ma(e,{top:t}),Ao(e,t,!0),P&&Ma(e),Ri(e,100)}function Ao(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 Zn(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ro(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Li(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+ya(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+Ln(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var qn=function(e,t,i){this.cm=i;var n=this.vert=s("div",[s("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=s("div",[s("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=d.tabIndex=-1,e(n),e(d),Le(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Le(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&F<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var d=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+d)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},qn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},qn.prototype.zeroWidthHack=function(){var e=o&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ne,this.disableVert=new ne},qn.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var d=e.getBoundingClientRect(),k=i=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},qn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Di=function(){};Di.prototype.update=function(){return{bottom:0,right:0}},Di.prototype.setScrollLeft=function(){},Di.prototype.setScrollTop=function(){},Di.prototype.clear=function(){};function di(e,t){t||(t=Li(e));var i=e.display.barWidth,n=e.display.barHeight;_o(e,t);for(var d=0;d<4&&i!=e.display.barWidth||n!=e.display.barHeight;d++)i!=e.display.barWidth&&e.options.lineWrapping&&Zi(e),_o(e,Li(e)),i=e.display.barWidth,n=e.display.barHeight}function _o(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Oo={native:qn,null:Di};function Lo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&m(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Oo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Le(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"?Zn(e,t):Oi(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function ei(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:++Zs},pn(e.curOp)}function ti(e){var t=e.curOp;t&&hr(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var d=0;d<t.length;d++)rl(t[d]);for(var k=0;k<t.length;k++)nl(t[k]);for(var X=0;X<t.length;X++)il(t[X])}function el(e){var t=e.cm,i=t.display;ol(t),e.updateMaxLine&&Un(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ta(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&ka(e.cm,e.update)}function rl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Zi(t),e.barMeasure=Li(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oo(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+Ln(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Yn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Zn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==M();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&di(t,e.barMeasure),e.updatedDisplay&&Na(t,e.barMeasure),e.selectionChanged&&La(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Co(e.cm)}function il(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Do(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ao(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Zn(t,e.scrollLeft,!0,!0),e.scrollToPos){var d=$s(t,E(n,e.scrollToPos.from),E(n,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,d)}var k=e.maybeHiddenMarkers,X=e.maybeUnhiddenMarkers;if(k)for(var q=0;q<k.length;++q)k[q].lines.length||Ne(k[q],"hide");if(X)for(var ee=0;ee<X.length;++ee)X[ee].lines.length&&Ne(X[ee],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ne(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function vn(e,t){if(e.curOp)return t();ei(e);try{return t()}finally{ti(e)}}function Gr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ei(e);try{return t.apply(e,arguments)}finally{ti(e)}}}function an(e){return function(){if(this.curOp)return e.apply(this,arguments);ei(this);try{return e.apply(this,arguments)}finally{ti(this)}}}function zr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ei(t);try{return e.apply(this,arguments)}finally{ti(t)}}}function Ri(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=yt(e,t.highlightFrontier),d=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(n.line>=e.display.viewFrom){var X=k.styles,q=k.text.length>e.options.maxHighlightLength?ot(t.mode,n.state):null,ee=Re(e,k,n,!0);q&&(n.state=q),k.styles=ee.styles;var fe=k.styleClasses,Se=ee.classes;Se?k.styleClasses=Se:fe&&(k.styleClasses=null);for(var Pe=!X||X.length!=k.styles.length||fe!=Se&&(!fe||!Se||fe.bgClass!=Se.bgClass||fe.textClass!=Se.textClass),je=0;!Pe&&je<X.length;++je)Pe=X[je]!=k.styles[je];Pe&&d.push(n.line),k.stateAfter=n.save(),n.nextLine()}else k.text.length<=e.options.maxHighlightLength&&_t(e,k.text,n),k.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Ri(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),d.length&&vn(e,function(){for(var k=0;k<d.length;k++)jn(e,d[k],"text")})}var ta=function(e,t,i){var n=e.display;this.viewport=t,this.visible=qi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Yn(e),this.force=i,this.dims=Aa(e),this.events=[]};ta.prototype.signal=function(e,t){ye(e,t)&&this.events.push(arguments)},ta.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ne.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ln(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ln(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=M();if(!t||!O(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&O(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==M())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function ka(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Wn(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&bo(e)==0)return!1;Po(e)&&(Wn(e),t.dims=Aa(e));var d=n.first+n.size,k=Math.max(t.visible.from-e.options.viewportMargin,n.first),X=Math.min(d,t.visible.to+e.options.viewportMargin);i.viewFrom<k&&k-i.viewFrom<20&&(k=Math.max(n.first,i.viewFrom)),i.viewTo>X&&i.viewTo-X<20&&(X=Math.min(d,i.viewTo)),Ur&&(k=rn(e.doc,k),X=Tn(e.doc,X));var q=k!=i.viewFrom||X!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vs(e,k,X),i.viewOffset=bn(lt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var ee=bo(e);if(!q&&ee==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var fe=sl(e);return ee>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),ee>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(fe),v(i.cursorDiv),v(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,q&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Ri(e,400)),i.updateLineNumbers=null,!0}function Do(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Yn(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ya(e.display)-ba(e),i.top)}),t.visible=qi(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=qi(e.display,e.doc,i));if(!ka(e,t))break;Zi(e);var d=Li(e);Ai(e),di(e,d),Na(e,d),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ma(e,t){var i=new ta(e,t);if(ka(e,i)){Zi(e),Do(e,i);var n=Li(e);Ai(e),di(e,n),Na(e,n),i.finish()}}function ul(e,t,i){var n=e.display,d=e.options.lineNumbers,k=n.lineDiv,X=k.firstChild;function q($e){var ut=$e.nextSibling;return R&&o&&e.display.currentWheelTarget==$e?$e.style.display="none":$e.parentNode.removeChild($e),ut}for(var ee=n.view,fe=n.viewFrom,Se=0;Se<ee.length;Se++){var Pe=ee[Se];if(!Pe.hidden)if(!Pe.node||Pe.node.parentNode!=k){var je=Ns(e,Pe,fe,i);k.insertBefore(je,X)}else{for(;X!=Pe.node;)X=q(X);var Fe=d&&t!=null&&t<=fe&&Pe.lineNumber;Pe.changes&&(he(Pe.changes,"gutter")>-1&&(Fe=!1),Fn(e,Pe,fe,i)),Fe&&(v(Pe.lineNumber),Pe.lineNumber.appendChild(document.createTextNode(or(e.options,fe)))),X=Pe.node.nextSibling}fe+=Pe.size}for(;X;)X=q(X)}function Ia(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Na(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+Ln(e)+"px"}function Ro(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,k=n+"px",X=0;X<i.length;X++)if(!i[X].hidden){e.options.fixedGutter&&(i[X].gutter&&(i[X].gutter.style.left=k),i[X].gutterBackground&&(i[X].gutterBackground.style.left=k));var q=i[X].alignable;if(q)for(var ee=0;ee<q.length;ee++)q[ee].style.left=k}e.options.fixedGutter&&(t.gutters.style.left=n+d+"px")}function Po(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=or(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var d=n.measure.appendChild(s("div",[s("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),k=d.firstChild.offsetWidth,X=d.offsetWidth-k;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(k,n.lineGutter.offsetWidth-X)+1,n.lineNumWidth=n.lineNumInnerWidth+X,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Ia(e.display),!0}return!1}function Ua(e,t){for(var i=[],n=!1,d=0;d<e.length;d++){var k=e[d],X=null;if(typeof k!="string"&&(X=k.style,k=k.className),k=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:k,style:X})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function ko(e){var t=e.gutters,i=e.gutterSpecs;v(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var d=i[n],k=d.className,X=d.style,q=t.appendChild(s("div",null,"CodeMirror-gutter "+k));X&&(q.style.cssText=X),k=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Ia(e)}function Pi(e){ko(e.display),ln(e),Ro(e)}function dl(e,t,i,n){var d=this;this.input=i,d.scrollbarFiller=s("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=s("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=S("div",null,"CodeMirror-code"),d.selectionDiv=s("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=s("div",null,"CodeMirror-cursors"),d.measure=s("div",null,"CodeMirror-measure"),d.lineMeasure=s("div",null,"CodeMirror-measure"),d.lineSpace=S("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var k=S("div",[d.lineSpace],"CodeMirror-lines");d.mover=s("div",[k],null,"position: relative"),d.sizer=s("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=s("div",null,null,"position: absolute; height: "+Ee+"px; width: 1px;"),d.gutters=s("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=s("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=s("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),K&&F<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!R&&!(P&&r)&&(d.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(d.wrapper):e(d.wrapper)),d.viewFrom=d.viewTo=t.first,d.reportedViewFrom=d.reportedViewTo=t.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,d.gutterSpecs=Ua(n.gutters,n.lineNumbers),ko(d),i.init(d)}var ra=0,En=null;K?En=-.53:P?En=15:h?En=-.7:w&&(En=-1/3);function Mo(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Mo(e);return t.x*=En,t.y*=En,t}function Io(e,t){var i=Mo(t),n=i.x,d=i.y,k=e.display,X=k.scroller,q=X.scrollWidth>X.clientWidth,ee=X.scrollHeight>X.clientHeight;if(!(n&&q||d&&ee))return;if(d&&o&&R){e:for(var fe=t.target,Se=k.view;fe!=X;fe=fe.parentNode)for(var Pe=0;Pe<Se.length;Pe++)if(Se[Pe].node==fe){e.display.currentWheelTarget=fe;break e}}if(n&&!P&&!y&&En!=null){d&&ee&&Oi(e,Math.max(0,X.scrollTop+d*En)),Zn(e,Math.max(0,X.scrollLeft+n*En)),(!d||d&&ee)&&ae(t),k.wheelStartX=null;return}if(d&&En!=null){var je=d*En,Fe=e.doc.scrollTop,$e=Fe+k.wrapper.clientHeight;je<0?Fe=Math.max(0,Fe+je-50):$e=Math.min(e.doc.height,$e+je+50),Ma(e,{top:Fe,bottom:$e})}ra<20&&(k.wheelStartX==null?(k.wheelStartX=X.scrollLeft,k.wheelStartY=X.scrollTop,k.wheelDX=n,k.wheelDY=d,setTimeout(function(){if(k.wheelStartX==null)return;var ut=X.scrollLeft-k.wheelStartX,bt=X.scrollTop-k.wheelStartY,Ct=bt&&k.wheelDY&&bt/k.wheelDY||ut&&k.wheelDX&&ut/k.wheelDX;if(k.wheelStartX=k.wheelStartY=null,!Ct)return;En=(En*ra+Ct)/(ra+1),++ra},200)):(k.wheelDX+=n,k.wheelDY+=d))}var xn=function(e,t){this.ranges=e,this.primIndex=t};xn.prototype.primary=function(){return this.ranges[this.primIndex]},xn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!Pt(i.anchor,n.anchor)||!Pt(i.head,n.head))return!1}return!0},xn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new xr(At(this.ranges[t].anchor),At(this.ranges[t].head));return new xn(e,this.primIndex)},xn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},xn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(xt(t,n.from())>=0&&xt(e,n.to())<=0)return i}return-1};var xr=function(e,t){this.anchor=e,this.head=t};xr.prototype.from=function(){return Yt(this.anchor,this.head)},xr.prototype.to=function(){return Ft(this.anchor,this.head)},xr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function An(e,t,i){var n=e&&e.options.selectionsMayTouch,d=t[i];t.sort(function(je,Fe){return xt(je.from(),Fe.from())}),i=he(t,d);for(var k=1;k<t.length;k++){var X=t[k],q=t[k-1],ee=xt(q.to(),X.from());if(n&&!X.empty()?ee>0:ee>=0){var fe=Yt(q.from(),X.from()),Se=Ft(q.to(),X.to()),Pe=q.empty()?X.from()==X.head:q.from()==q.head;k<=i&&--i,t.splice(--k,2,new xr(Pe?Se:fe,Pe?fe:Se))}}return new xn(t,i)}function Kn(e,t){return new xn([new xr(e,t||e)],0)}function Hn(e){return e.text?Xe(e.from.line+e.text.length-1,Z(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function No(e,t){if(xt(e,t.from)<0)return e;if(xt(e,t.to)<=0)return Hn(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Hn(t).ch-t.to.ch),Xe(i,n)}function Fa(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var d=e.sel.ranges[n];i.push(new xr(No(d.anchor,t),No(d.head,t)))}return An(e.cm,i,e.sel.primIndex)}function Uo(e,t,i){return e.line==t.line?Xe(i.line,e.ch-t.ch+i.ch):Xe(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var n=[],d=Xe(e.first,0),k=d,X=0;X<t.length;X++){var q=t[X],ee=Uo(q.from,d,k),fe=Uo(Hn(q),d,k);if(d=q.to,k=fe,i=="around"){var Se=e.sel.ranges[X],Pe=xt(Se.head,Se.anchor)<0;n[X]=new xr(Pe?fe:ee,Pe?ee:fe)}else n[X]=new xr(ee,ee)}return new xn(n,e.sel.primIndex)}function Ba(e){e.doc.mode=Ze(e.options,e.doc.modeOption),ki(e)}function ki(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ri(e,100),e.state.modeGen++,e.curOp&&ln(e)}function Fo(e,t){return t.from.ch==0&&t.to.ch==0&&Z(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ja(e,t,i,n){function d(Ot){return i?i[Ot]:null}function k(Ot,St,kt){ii(Ot,St,kt,n),mr(Ot,"change",Ot,t)}function X(Ot,St){for(var kt=[],Gt=Ot;Gt<St;++Gt)kt.push(new fn(fe[Gt],d(Gt),n));return kt}var q=t.from,ee=t.to,fe=t.text,Se=lt(e,q.line),Pe=lt(e,ee.line),je=Z(fe),Fe=d(fe.length-1),$e=ee.line-q.line;if(t.full)e.insert(0,X(0,fe.length)),e.remove(fe.length,e.size-fe.length);else if(Fo(e,t)){var ut=X(0,fe.length-1);k(Pe,Pe.text,Fe),$e&&e.remove(q.line,$e),ut.length&&e.insert(q.line,ut)}else if(Se==Pe)if(fe.length==1)k(Se,Se.text.slice(0,q.ch)+je+Se.text.slice(ee.ch),Fe);else{var bt=X(1,fe.length-1);bt.push(new fn(je+Se.text.slice(ee.ch),Fe,n)),k(Se,Se.text.slice(0,q.ch)+fe[0],d(0)),e.insert(q.line+1,bt)}else if(fe.length==1)k(Se,Se.text.slice(0,q.ch)+fe[0]+Pe.text.slice(ee.ch),d(0)),e.remove(q.line+1,$e);else{k(Se,Se.text.slice(0,q.ch)+fe[0],d(0)),k(Pe,je+Pe.text.slice(ee.ch),Fe);var Ct=X(1,fe.length-1);$e>1&&e.remove(q.line+1,$e-1),e.insert(q.line+1,Ct)}mr(e,"change",e,t)}function Gn(e,t,i){function n(d,k,X){if(d.linked)for(var q=0;q<d.linked.length;++q){var ee=d.linked[q];if(ee.doc==k)continue;var fe=X&&ee.sharedHist;if(i&&!fe)continue;t(ee.doc,fe),n(ee.doc,d,fe)}}n(e,null,!0)}function Bo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Oa(e),Ba(e),jo(e),e.options.lineWrapping||Un(e),e.options.mode=t.modeOption,ln(e)}function jo(e){(e.doc.direction=="rtl"?B:m)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){vn(e,function(){jo(e),ln(e)})}function na(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Wa(e,t){var i={from:At(t.from),to:Hn(t),text:Jt(e,t.from,t.to)};return Ho(e,i,t.from.line,t.to.line+1),Gn(e,function(n){return Ho(n,i,t.from.line,t.to.line+1)},!0),i}function Wo(e){for(;e.length;){var t=Z(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Wo(e.done),Z(e.done);if(e.done.length&&!Z(e.done).ranges)return Z(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Z(e.done)}function Ko(e,t,i,n){var d=e.history;d.undone.length=0;var k=+new Date,X,q;if((d.lastOp==n||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(X=pl(d,d.lastOp==n)))q=Z(X.changes),xt(t.from,t.to)==0&&xt(t.from,q.to)==0?q.to=Hn(t):X.changes.push(Wa(e,t));else{var ee=Z(d.done);for((!ee||!ee.ranges)&&ia(e.sel,d.done),X={changes:[Wa(e,t)],generation:d.generation},d.done.push(X);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(i),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=k,d.lastOp=d.lastSelOp=n,d.lastOrigin=d.lastSelOrigin=t.origin,q||Ne(e,"historyAdded")}function ml(e,t,i,n){var d=t.charAt(0);return d=="*"||d=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var d=e.history,k=n&&n.origin;i==d.lastSelOp||k&&d.lastSelOrigin==k&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==k||ml(e,k,Z(d.done),t))?d.done[d.done.length-1]=t:ia(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=k,d.lastSelOp=i,n&&n.clearRedo!==!1&&Wo(d.undone)}function ia(e,t){var i=Z(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Ho(e,t,i,n){var d=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(X){X.markedSpans&&((d||(d=t["spans_"+e.id]={}))[k]=X.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],d=0;d<t.text.length;++d)n.push(vl(i[d]));return n}function Go(e,t){var i=yl(e,t),n=Lr(e,t);if(!i)return n;if(!n)return i;for(var d=0;d<i.length;++d){var k=i[d],X=n[d];if(k&&X){e:for(var q=0;q<X.length;++q){for(var ee=X[q],fe=0;fe<k.length;++fe)if(k[fe].marker==ee.marker)continue e;k.push(ee)}}else X&&(i[d]=X)}return i}function ci(e,t,i){for(var n=[],d=0;d<e.length;++d){var k=e[d];if(k.ranges){n.push(i?xn.prototype.deepCopy.call(k):k);continue}var X=k.changes,q=[];n.push({changes:q});for(var ee=0;ee<X.length;++ee){var fe=X[ee],Se=void 0;if(q.push({from:fe.from,to:fe.to,text:fe.text}),t)for(var Pe in fe)(Se=Pe.match(/^spans_(\d+)$/))&&(he(t,Number(Se[1]))>-1&&(Z(q)[Pe]=fe[Pe],delete fe[Pe]))}}return n}function Ka(e,t,i,n){if(n){var d=e.anchor;if(i){var k=xt(t,d)<0;k!=xt(i,d)<0?(d=t,t=i):k!=xt(t,i)<0&&(t=i)}return new xr(d,t)}else return new xr(i||t,t)}function aa(e,t,i,n,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),qr(e,new xn([Ka(e.sel.primary(),t,i,d)],0),n)}function zo(e,t,i){for(var n=[],d=e.cm&&(e.cm.display.shift||e.extend),k=0;k<e.sel.ranges.length;k++)n[k]=Ka(e.sel.ranges[k],t[k],null,d);var X=An(e.cm,n,e.sel.primIndex);qr(e,X,i)}function Ha(e,t,i,n){var d=e.sel.ranges.slice(0);d[t]=i,qr(e,An(e.cm,d,e.sel.primIndex),n)}function Vo(e,t,i,n){qr(e,Kn(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(d){this.ranges=[];for(var k=0;k<d.length;k++)this.ranges[k]=new xr(E(e,d[k].anchor),E(e,d[k].head))},origin:i&&i.origin};return Ne(e,"beforeSelectionChange",e,n),e.cm&&Ne(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?An(e.cm,n.ranges,n.ranges.length-1):t}function Xo(e,t,i){var n=e.history.done,d=Z(n);d&&d.ranges?(n[n.length-1]=t,oa(e,t,i)):qr(e,t,i)}function qr(e,t,i){oa(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function oa(e,t,i){(ye(e,"beforeSelectionChange")||e.cm&&ye(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(xt(t.primary().head,e.sel.primary().head)<0?-1:1);Yo(e,Jo(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&ui(e.cm)}function Yo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,we(e.cm)),mr(e,"cursorActivity",e)}function $o(e){Yo(e,Jo(e,e.sel,null,!1))}function Jo(e,t,i,n){for(var d,k=0;k<t.ranges.length;k++){var X=t.ranges[k],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[k],ee=sa(e,X.anchor,q&&q.anchor,i,n),fe=sa(e,X.head,q&&q.head,i,n);(d||ee!=X.anchor||fe!=X.head)&&(d||(d=t.ranges.slice(0,k)),d[k]=new xr(ee,fe))}return d?An(e.cm,d,t.primIndex):t}function hi(e,t,i,n,d){var k=lt(e,t.line);if(k.markedSpans)for(var X=0;X<k.markedSpans.length;++X){var q=k.markedSpans[X],ee=q.marker,fe="selectLeft"in ee?!ee.selectLeft:ee.inclusiveLeft,Se="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((q.from==null||(fe?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(Se?q.to>=t.ch:q.to>t.ch))){if(d&&(Ne(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(k.markedSpans){--X;continue}else break;if(!ee.atomic)continue;if(i){var Pe=ee.find(n<0?1:-1),je=void 0;if((n<0?Se:fe)&&(Pe=Qo(e,Pe,-n,Pe&&Pe.line==t.line?k:null)),Pe&&Pe.line==t.line&&(je=xt(Pe,i))&&(n<0?je<0:je>0))return hi(e,Pe,t,n,d)}var Fe=ee.find(n<0?-1:1);return(n<0?fe:Se)&&(Fe=Qo(e,Fe,n,Fe.line==t.line?k:null)),Fe?hi(e,Fe,t,n,d):null}}return t}function sa(e,t,i,n,d){var k=n||1,X=hi(e,t,i,k,d)||!d&&hi(e,t,i,k,!0)||hi(e,t,i,-k,d)||!d&&hi(e,t,i,-k,!0);return X||(e.cantEdit=!0,Xe(e.first,0))}function Qo(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?E(e,Xe(t.line-1)):null:i>0&&t.ch==(n||lt(e,t.line)).text.length?t.line<e.first+e.size-1?Xe(t.line+1,0):null:new Xe(t.line,t.ch+i)}function Zo(e){e.setSelection(Xe(e.firstLine(),0),Xe(e.lastLine()),Oe)}function qo(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(d,k,X,q){d&&(n.from=E(e,d)),k&&(n.to=E(e,k)),X&&(n.text=X),q!==void 0&&(n.origin=q)}),Ne(e,"beforeChange",e,n),e.cm&&Ne(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function fi(e,t,i){if(e.cm){if(!e.cm.curOp)return Gr(e.cm,fi)(e,t,i);if(e.cm.state.suppressEdits)return}if((ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"))&&(t=qo(e,t,!0),!t))return;var n=Cn&&!i&&Mr(e,t.from,t.to);if(n)for(var d=n.length-1;d>=0;--d)es(e,{from:n[d].from,to:n[d].to,text:d?[""]:t.text,origin:t.origin});else es(e,t)}function es(e,t){if(t.text.length==1&&t.text[0]==""&&xt(t.from,t.to)==0)return;var i=Fa(e,t);Ko(e,t,i,e.cm?e.cm.curOp.id:NaN),Mi(e,t,i,Lr(e,t));var n=[];Gn(e,function(d,k){!k&&he(n,d.history)==-1&&(is(d.history,t),n.push(d.history)),Mi(d,t,null,Lr(d,t))})}function la(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var d=e.history,k,X=e.sel,q=t=="undo"?d.done:d.undone,ee=t=="undo"?d.undone:d.done,fe=0;fe<q.length&&!(k=q[fe],i?k.ranges&&!k.equals(e.sel):!k.ranges);fe++);if(fe==q.length)return;for(d.lastOrigin=d.lastSelOrigin=null;;)if(k=q.pop(),k.ranges){if(ia(k,ee),i&&!k.equals(e.sel)){qr(e,k,{clearRedo:!1});return}X=k}else if(n){q.push(k);return}else break;var Se=[];ia(X,ee),ee.push({changes:Se,generation:d.generation}),d.generation=k.generation||++d.maxGeneration;for(var Pe=ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"),je=function(ut){var bt=k.changes[ut];if(bt.origin=t,Pe&&!qo(e,bt,!1))return q.length=0,{};Se.push(Wa(e,bt));var Ct=ut?Fa(e,bt):Z(q);Mi(e,bt,Ct,Go(e,bt)),!ut&&e.cm&&e.cm.scrollIntoView({from:bt.from,to:Hn(bt)});var Ot=[];Gn(e,function(St,kt){!kt&&he(Ot,St.history)==-1&&(is(St.history,bt),Ot.push(St.history)),Mi(St,bt,null,Go(St,bt))})},Fe=k.changes.length-1;Fe>=0;--Fe){var $e=je(Fe);if($e)return $e.v}}function ts(e,t){if(t==0)return;if(e.first+=t,e.sel=new xn(te(e.sel.ranges,function(d){return new xr(Xe(d.anchor.line+t,d.anchor.ch),Xe(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){ln(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)jn(e.cm,n,"gutter")}}function Mi(e,t,i,n){if(e.cm&&!e.cm.curOp)return Gr(e.cm,Mi)(e,t,i,n);if(t.to.line<e.first){ts(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var d=t.text.length-1-(e.first-t.from.line);ts(e,d),t={from:Xe(e.first,0),to:Xe(t.to.line+d,t.to.ch),text:[Z(t.text)],origin:t.origin}}var k=e.lastLine();t.to.line>k&&(t={from:t.from,to:Xe(k,lt(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jt(e,t.from,t.to),i||(i=Fa(e,t)),e.cm?El(e.cm,t,n):ja(e,t,n),oa(e,i,Oe),e.cantEdit&&sa(e,Xe(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var n=e.doc,d=e.display,k=t.from,X=t.to,q=!1,ee=k.line;e.options.lineWrapping||(ee=vt(Fr(lt(n,k.line))),n.iter(ee,X.line+1,function(Fe){if(Fe==d.maxLine)return q=!0,!0})),n.sel.contains(t.from,t.to)>-1&&we(e),ja(n,t,i,yo(e)),e.options.lineWrapping||(n.iter(ee,k.line+t.text.length,function(Fe){var $e=Pn(Fe);$e>d.maxLineLength&&(d.maxLine=Fe,d.maxLineLength=$e,d.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),tn(n,k.line),Ri(e,400);var fe=t.text.length-(X.line-k.line)-1;t.full?ln(e):k.line==X.line&&t.text.length==1&&!Fo(e.doc,t)?jn(e,k.line,"text"):ln(e,k.line,X.line+1,fe);var Se=ye(e,"changes"),Pe=ye(e,"change");if(Pe||Se){var je={from:k,to:X,text:t.text,removed:t.removed,origin:t.origin};Pe&&mr(e,"change",e,je),Se&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(je)}e.display.selForContextMenu=null}function pi(e,t,i,n,d){var k;n||(n=i),xt(n,i)<0&&(k=[n,i],i=k[0],n=k[1]),typeof t=="string"&&(t=e.splitLines(t)),fi(e,{from:i,to:n,text:t,origin:d})}function rs(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ns(e,t,i,n){for(var d=0;d<e.length;++d){var k=e[d],X=!0;if(k.ranges){k.copied||(k=e[d]=k.deepCopy(),k.copied=!0);for(var q=0;q<k.ranges.length;q++)rs(k.ranges[q].anchor,t,i,n),rs(k.ranges[q].head,t,i,n);continue}for(var ee=0;ee<k.changes.length;++ee){var fe=k.changes[ee];if(i<fe.from.line)fe.from=Xe(fe.from.line+n,fe.from.ch),fe.to=Xe(fe.to.line+n,fe.to.ch);else if(t<=fe.to.line){X=!1;break}}X||(e.splice(0,d+1),d=0)}}function is(e,t){var i=t.from.line,n=t.to.line,d=t.text.length-(n-i)-1;ns(e.done,i,n,d),ns(e.undone,i,n,d)}function Ii(e,t,i,n){var d=t,k=t;return typeof t=="number"?k=lt(e,G(e,t)):d=vt(t),d==null?null:(n(k,d)&&e.cm&&jn(e.cm,d,i),k)}function Ni(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Ni.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var d=this.lines[i];this.height-=d.height,Ci(d),mr(d,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Ui(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var d=e[n];t+=d.chunkSize(),i+=d.height,d.parent=this}this.size=t,this.height=i,this.parent=null}Ui.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],d=n.chunkSize();if(e<d){var k=Math.min(t,d-e),X=n.height;if(n.removeInner(e,k),this.height-=X-n.height,d==k&&(this.children.splice(i--,1),n.parent=null),(t-=k)==0)break;e=0}else e-=d}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ni))){var q=[];this.collapse(q),this.children=[new Ni(q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var d=this.children[n],k=d.chunkSize();if(e<=k){if(d.insertInner(e,t,i),d.lines&&d.lines.length>50){for(var X=d.lines.length%25+25,q=X;q<d.lines.length;){var ee=new Ni(d.lines.slice(q,q+=25));d.height-=ee.height,this.children.splice(++n,0,ee),ee.parent=this}d.lines=d.lines.slice(0,X),this.maybeSpill()}break}e-=k}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Ui(t);if(e.parent){e.size-=i.size,e.height-=i.height;var d=he(e.parent.children,e);e.parent.children.splice(d+1,0,i)}else{var n=new Ui(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var d=this.children[n],k=d.chunkSize();if(e<k){var X=Math.min(t,k-e);if(d.iterN(e,X,i))return!0;if((t-=X)==0)break;e=0}else e-=k}}};var Fi=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Fi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=vt(i);if(n==null||!t)return;for(var d=0;d<t.length;++d)t[d]==this&&t.splice(d--,1);t.length||(i.widgets=null);var k=Ti(this);$t(i,Math.max(0,i.height-k)),e&&(vn(e,function(){as(e,i,-k),jn(e,n,"widget")}),mr(e,"lineWidgetCleared",e,this,n))},Fi.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var d=Ti(this)-t;if(!d)return;nn(this.doc,n)||$t(n,n.height+d),i&&vn(i,function(){i.curOp.forceUpdate=!0,as(i,n,d),mr(i,"lineWidgetChanged",i,e,vt(n))})},ge(Fi);function as(e,t,i){bn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Pa(e,i)}function xl(e,t,i,n){var d=new Fi(e,i,n),k=e.cm;return k&&d.noHScroll&&(k.display.alignWidgets=!0),Ii(e,t,"widget",function(X){var q=X.widgets||(X.widgets=[]);if(d.insertAt==null?q.push(d):q.splice(Math.min(q.length-1,Math.max(0,d.insertAt)),0,d),d.line=X,k&&!nn(e,X)){var ee=bn(X)<e.scrollTop;$t(X,X.height+Ti(d)),ee&&Pa(k,d.height),k.curOp.forceUpdate=!0}return!0}),k&&mr(k,"lineWidgetAdded",k,d,typeof t=="number"?t:vt(t)),d}var os=0,zn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++os};zn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ei(e),ye(this,"clear")){var i=this.find();i&&mr(this,"clear",i.from,i.to)}for(var n=null,d=null,k=0;k<this.lines.length;++k){var X=this.lines[k],q=Xt(X.markedSpans,this);e&&!this.collapsed?jn(e,vt(X),"text"):e&&(q.to!=null&&(d=vt(X)),q.from!=null&&(n=vt(X))),X.markedSpans=er(X.markedSpans,q),q.from==null&&this.collapsed&&!nn(this.doc,X)&&e&&$t(X,oi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ee=0;ee<this.lines.length;++ee){var fe=Fr(this.lines[ee]),Se=Pn(fe);Se>e.display.maxLineLength&&(e.display.maxLine=fe,e.display.maxLineLength=Se,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&ln(e,n,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&$o(e.doc)),e&&mr(e,"markerCleared",e,this,n,d),t&&ti(e),this.parent&&this.parent.clear()},zn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,d=0;d<this.lines.length;++d){var k=this.lines[d],X=Xt(k.markedSpans,this);if(X.from!=null&&(i=Xe(t?k:vt(k),X.from),e==-1))return i;if(X.to!=null&&(n=Xe(t?k:vt(k),X.to),e==1))return n}return i&&{from:i,to:n}},zn.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;vn(n,function(){var d=t.line,k=vt(t.line),X=Ea(n,k);if(X&&(uo(X),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!nn(i.doc,d)&&i.height!=null){var q=i.height;i.height=null;var ee=Ti(i)-q;ee&&$t(d,d.height+ee)}mr(n,"markerChanged",n,e)})},zn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||he(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},zn.prototype.detachLine=function(e){if(this.lines.splice(he(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ge(zn);function mi(e,t,i,n,d){if(n&&n.shared)return Cl(e,t,i,n,d);if(e.cm&&!e.cm.curOp)return Gr(e.cm,mi)(e,t,i,n,d);var k=new zn(e,d),X=xt(t,i);if(n&&U(n,k,!1),X>0||X==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=S("span",[k.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(_r(e,t.line,t,i,k)||t.line!=i.line&&_r(e,i.line,t,i,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");Zt()}k.addToHistory&&Ko(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var q=t.line,ee=e.cm,fe;if(e.iter(q,i.line+1,function(Pe){ee&&k.collapsed&&!ee.options.lineWrapping&&Fr(Pe)==ee.display.maxLine&&(fe=!0),k.collapsed&&q!=t.line&&$t(Pe,0),ur(Pe,new Vt(k,q==t.line?t.ch:null,q==i.line?i.ch:null)),++q}),k.collapsed&&e.iter(t.line,i.line+1,function(Pe){nn(e,Pe)&&$t(Pe,0)}),k.clearOnEnter&&Le(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(Qr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++os,k.atomic=!0),ee){if(fe&&(ee.curOp.updateMaxLine=!0),k.collapsed)ln(ee,t.line,i.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var Se=t.line;Se<=i.line;Se++)jn(ee,Se,"text");k.atomic&&$o(ee.doc),mr(ee,"markerAdded",ee,k)}return k}var Bi=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Bi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();mr(this,"clear")},Bi.prototype.find=function(e,t){return this.primary.find(e,t)},ge(Bi);function Cl(e,t,i,n,d){n=U(n),n.shared=!1;var k=[mi(e,t,i,n,d)],X=k[0],q=n.widgetNode;return Gn(e,function(ee){q&&(n.widgetNode=q.cloneNode(!0)),k.push(mi(ee,E(ee,t),E(ee,i),n,d));for(var fe=0;fe<ee.linked.length;++fe)if(ee.linked[fe].isParent)return;X=Z(k)}),new Bi(k,X)}function ss(e){return e.findMarks(Xe(e.first,0),e.clipPos(Xe(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var i=0;i<t.length;i++){var n=t[i],d=n.find(),k=e.clipPos(d.from),X=e.clipPos(d.to);if(xt(k,X)){var q=mi(e,k,X,n.primary,n.primary.type);n.markers.push(q),q.parent=n}}}function Tl(e){for(var t=function(n){var d=e[n],k=[d.primary.doc];Gn(d.primary.doc,function(ee){return k.push(ee)});for(var X=0;X<d.markers.length;X++){var q=d.markers[X];he(k,q.doc)==-1&&(q.parent=null,d.markers.splice(X--,1))}},i=0;i<e.length;i++)t(i)}var wl=0,un=function(e,t,i,n,d){if(!(this instanceof un))return new un(e,t,i,n,d);i==null&&(i=0),Ui.call(this,[new Ni([new fn("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var k=Xe(i,0);this.sel=Kn(k),this.history=new na(null),this.id=++wl,this.modeOption=t,this.lineSep=n,this.direction=d=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ja(this,{from:k,to:k,text:e}),qr(this,Kn(k),Oe)};un.prototype=ie(Ui.prototype,{constructor:un,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=vr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:zr(function(e){var t=Xe(this.first,0),i=this.first+this.size-1;fi(this,{from:t,to:Xe(i,lt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_i(this.cm,0,0),qr(this,Kn(t),Oe)}),replaceRange:function(e,t,i,n){t=E(this,t),i=i?E(this,i):t,pi(this,e,t,i,n)},getRange:function(e,t,i){var n=Jt(this,E(this,e),E(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qt(this,e))return lt(this,e)},getLineNumber:function(e){return vt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=lt(this,e)),Fr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return E(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:zr(function(e,t,i){Vo(this,E(this,typeof e=="number"?Xe(e,t||0):e),null,i)}),setSelection:zr(function(e,t,i){Vo(this,E(this,e),E(this,t||e),i)}),extendSelection:zr(function(e,t,i){aa(this,E(this,e),t&&E(this,t),i)}),extendSelections:zr(function(e,t){zo(this,z(this,e),t)}),extendSelectionsBy:zr(function(e,t){var i=te(this.sel.ranges,e);zo(this,z(this,i),t)}),setSelections:zr(function(e,t,i){if(!e.length)return;for(var n=[],d=0;d<e.length;d++)n[d]=new xr(E(this,e[d].anchor),E(this,e[d].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),qr(this,An(this.cm,n,t),i)}),addSelection:zr(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new xr(E(this,e),E(this,t||e))),qr(this,An(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var d=Jt(this,t[n].from(),t[n].to());i=i?i.concat(d):d}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var d=Jt(this,i[n].from(),i[n].to());e!==!1&&(d=d.join(e||this.lineSeparator())),t[n]=d}return t},replaceSelection:function(e,t,i){for(var n=[],d=0;d<this.sel.ranges.length;d++)n[d]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:zr(function(e,t,i){for(var n=[],d=this.sel,k=0;k<d.ranges.length;k++){var X=d.ranges[k];n[k]={from:X.from(),to:X.to(),text:this.splitLines(e[k]),origin:i}}for(var q=t&&t!="end"&&hl(this,n,t),ee=n.length-1;ee>=0;ee--)fi(this,n[ee]);q?Xo(this,q):this.cm&&ui(this.cm)}),undo:zr(function(){la(this,"undo")}),redo:zr(function(){la(this,"redo")}),undoSelection:zr(function(){la(this,"undo",!0)}),redoSelection:zr(function(){la(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var d=0;d<e.undone.length;d++)e.undone[d].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new na(this.history.maxGeneration),Gn(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ci(this.history.done),undone:ci(this.history.undone)}},setHistory:function(e){var t=this.history=new na(this.history.maxGeneration);t.done=ci(e.done.slice(0),null,!0),t.undone=ci(e.undone.slice(0),null,!0)},setGutterMarker:zr(function(e,t,i){return Ii(this,e,"gutter",function(n){var d=n.gutterMarkers||(n.gutterMarkers={});return d[t]=i,!i&&Me(d)&&(n.gutterMarkers=null),!0})}),clearGutter:zr(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Ii(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Me(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Qt(this,e))return null;if(t=e,e=lt(this,e),!e)return null}else if(t=vt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:zr(function(e,t,i){return Ii(this,e,t=="gutter"?"gutter":"class",function(n){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[d])n[d]=i;else{if(T(i).test(n[d]))return!1;n[d]+=" "+i}return!0})}),removeLineClass:zr(function(e,t,i){return Ii(this,e,t=="gutter"?"gutter":"class",function(n){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",k=n[d];if(k)if(i==null)n[d]=null;else{var X=k.match(T(i));if(!X)return!1;var q=X.index+X[0].length;n[d]=k.slice(0,X.index)+(!X.index||q==k.length?"":" ")+k.slice(q)||null}else return!1;return!0})}),addLineWidget:zr(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return mi(this,E(this,e),E(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=E(this,e),mi(this,e,e,i,"bookmark")},findMarksAt:function(e){e=E(this,e);var t=[],i=lt(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var d=i[n];(d.from==null||d.from<=e.ch)&&(d.to==null||d.to>=e.ch)&&t.push(d.marker.parent||d.marker)}return t},findMarks:function(e,t,i){e=E(this,e),t=E(this,t);var n=[],d=e.line;return this.iter(e.line,t.line+1,function(k){var X=k.markedSpans;if(X)for(var q=0;q<X.length;q++){var ee=X[q];!(ee.to!=null&&d==e.line&&e.ch>=ee.to||ee.from==null&&d!=e.line||ee.from!=null&&d==t.line&&ee.from>=t.ch)&&(!i||i(ee.marker))&&n.push(ee.marker.parent||ee.marker)}++d}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(d){var k=d.text.length+n;if(k>e)return t=e,!0;e-=k,++i}),E(this,Xe(i,t))},indexFromPos:function(e){e=E(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new un(vr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new un(vr(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(n,ss(this)),n},unlinkDoc:function(e){if(e instanceof Rr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(ss(this));break}if(e.history==this.history){var n=[e.id];Gn(e,function(d){return n.push(d.id)},!0),e.history=new na(null),e.history.done=ci(this.history.done,n),e.history.undone=ci(this.history.undone,n)}},iterLinkedDocs:function(e){Gn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ft(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:zr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),un.prototype.eachLine=un.prototype.iter;var ls=0;function Al(e){var t=this;if(us(t),Ke(t,e)||kn(t.display,e))return;ae(e),K&&(ls=+new Date);var i=Jn(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var d=n.length,k=Array(d),X=0,q=function(){++X==d&&Gr(t,function(){i=E(t.doc,i);var Fe={from:i,to:i,text:t.doc.splitLines(k.filter(function($e){return $e!=null}).join(t.doc.lineSeparator())),origin:"paste"};fi(t.doc,Fe),Xo(t.doc,Kn(E(t.doc,i),E(t.doc,Hn(Fe))))})()},ee=function(Fe,$e){if(t.options.allowDropFileTypes&&he(t.options.allowDropFileTypes,Fe.type)==-1){q();return}var ut=new FileReader;ut.onerror=function(){return q()},ut.onload=function(){var bt=ut.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(bt)){q();return}k[$e]=bt,q()},ut.readAsText(Fe)},fe=0;fe<n.length;fe++)ee(n[fe],fe);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Se=e.dataTransfer.getData("Text");if(Se){var Pe;if(t.state.draggingText&&!t.state.draggingText.copy&&(Pe=t.listSelections()),oa(t.doc,Kn(i,i)),Pe)for(var je=0;je<Pe.length;++je)pi(t.doc,"",Pe[je].anchor,Pe[je].head,"drag");t.replaceSelection(Se,"around","paste"),t.display.input.focus()}}catch(Fe){}}}function _l(e,t){if(K&&(!e.state.draggingText||+new Date-ls<100)){Ce(t);return}if(Ke(e,t)||kn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!w){var i=s("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",y&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),y&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Jn(e,t);if(!i)return;var n=document.createDocumentFragment();xo(e,i,n),e.display.dragCursor||(e.display.dragCursor=s("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),u(e.display.dragCursor,n)}function us(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ds(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var d=t[n].CodeMirror;d&&i.push(d)}i.length&&i[0].operation(function(){for(var k=0;k<i.length;k++)e(i[k])})}var cs=!1;function Ll(){if(cs)return;Dl(),cs=!0}function Dl(){var e;Le(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ds(Rl)},100))}),Le(window,"blur",function(){return ds(li)})}function Rl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Vn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ji=0;ji<10;ji++)Vn[ji+48]=Vn[ji+96]=String(ji);for(var ua=65;ua<=90;ua++)Vn[ua]=String.fromCharCode(ua);for(var Wi=1;Wi<=12;Wi++)Vn[Wi+111]=Vn[Wi+63235]="F"+Wi;var Mn={};Mn.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Mn.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Mn.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Mn.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Mn.default=o?Mn.macDefault:Mn.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,d,k,X=0;X<t.length-1;X++){var q=t[X];if(/^(cmd|meta|m)$/i.test(q))k=!0;else if(/^a(lt)?$/i.test(q))i=!0;else if(/^(c|ctrl|control)$/i.test(q))n=!0;else if(/^s(hift)?$/i.test(q))d=!0;else throw new Error("Unrecognized modifier name: "+q)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),k&&(e="Cmd-"+e),d&&(e="Shift-"+e),e}function kl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var d=te(i.split(" "),Pl),k=0;k<d.length;k++){var X=void 0,q=void 0;k==d.length-1?(q=d.join(" "),X=n):(q=d.slice(0,k+1).join(" "),X="...");var ee=t[q];if(!ee)t[q]=X;else if(ee!=X)throw new Error("Inconsistent bindings for "+q)}delete e[i]}for(var fe in t)e[fe]=t[fe];return e}function gi(e,t,i,n){t=da(t);var d=t.call?t.call(e,n):t[e];if(d===!1)return"nothing";if(d==="...")return"multi";if(d!=null&&i(d))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return gi(e,t.fallthrough,i,n);for(var k=0;k<t.fallthrough.length;k++){var X=gi(e,t.fallthrough[k],i,n);if(X)return X}}}function hs(e){var t=typeof e=="string"?e:Vn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function fs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ps(e,t){if(y&&e.keyCode==34&&e.char)return!1;var i=Vn[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),fs(i,e,t))}function da(e){return typeof e=="string"?Mn[e]:e}function vi(e,t){for(var i=e.doc.sel.ranges,n=[],d=0;d<i.length;d++){for(var k=t(i[d]);n.length&&xt(k.from,Z(n).to)<=0;){var X=n.pop();if(xt(X.from,k.from)<0){k.from=X.from;break}}n.push(k)}vn(e,function(){for(var q=n.length-1;q>=0;q--)pi(e.doc,"",n[q].from,n[q].to,"+delete");ui(e)})}function Ga(e,t,i){var n=Be(e.text,t+i,i);return n<0||n>e.text.length?null:n}function za(e,t,i){var n=Ga(e,t.ch,i);return n==null?null:new Xe(t.line,n,i<0?"after":"before")}function Va(e,t,i,n,d){if(e){t.doc.direction=="rtl"&&(d=-d);var k=mt(i,t.doc.direction);if(k){var X=d<0?Z(k):k[0],q=d<0==(X.level==1),ee=q?"after":"before",fe;if(X.level>0||t.doc.direction=="rtl"){var Se=ai(t,i);fe=d<0?i.text.length-1:0;var Pe=Dn(t,Se,fe).top;fe=tt(function(je){return Dn(t,Se,je).top==Pe},d<0==(X.level==1)?X.from:X.to-1,fe),ee=="before"&&(fe=Ga(i,fe,1))}else fe=d<0?X.to:X.from;return new Xe(n,fe,ee)}}return new Xe(n,d<0?i.text.length:0,d<0?"before":"after")}function Ml(e,t,i,n){var d=mt(t,e.doc.direction);if(!d)return za(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var k=nt(d,i.ch,i.sticky),X=d[k];if(e.doc.direction=="ltr"&&X.level%2==0&&(n>0?X.to>i.ch:X.from<i.ch))return za(t,i,n);var q=function(Ct,Ot){return Ga(t,Ct instanceof Xe?Ct.ch:Ct,Ot)},ee,fe=function(Ct){return e.options.lineWrapping?(ee=ee||ai(e,t),vo(e,t,ee,Ct)):{begin:0,end:t.text.length}},Se=fe(i.sticky=="before"?q(i,-1):i.ch);if(e.doc.direction=="rtl"||X.level==1){var Pe=X.level==1==n<0,je=q(i,Pe?1:-1);if(je!=null&&(Pe?je<=X.to&&je<=Se.end:je>=X.from&&je>=Se.begin)){var Fe=Pe?"before":"after";return new Xe(i.line,je,Fe)}}var $e=function(Ct,Ot,St){for(var kt=function(Or,Vr){return Vr?new Xe(i.line,q(Or,1),"before"):new Xe(i.line,Or,"after")};Ct>=0&&Ct<d.length;Ct+=Ot){var Gt=d[Ct],Wt=Ot>0==(Gt.level!=1),ar=Wt?St.begin:q(St.end,-1);if(Gt.from<=ar&&ar<Gt.to)return kt(ar,Wt);if(ar=Wt?Gt.from:q(Gt.to,-1),St.begin<=ar&&ar<St.end)return kt(ar,Wt)}},ut=$e(k+n,n,Se);if(ut)return ut;var bt=n>0?Se.end:q(Se.begin,-1);return bt!=null&&!(n>0&&bt==t.text.length)&&(ut=$e(n>0?0:d.length-1,n,fe(bt)),ut)?ut:null}var Ki={selectAll:Zo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Oe)},killLine:function(e){return vi(e,function(t){if(t.empty()){var i=lt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Xe(t.head.line+1,0)}:{from:t.head,to:Xe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return vi(e,function(t){return{from:Xe(t.from().line,0),to:E(e.doc,Xe(t.to().line+1,0))}})},delLineLeft:function(e){return vi(e,function(t){return{from:Xe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return vi(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return vi(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Xe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Xe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ms(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return gs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Il(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},de)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},de)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?gs(e,t.head):n},de)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,d=0;d<i.length;d++){var k=i[d].from(),X=J(e.getLine(k.line),k.ch,n);t.push(ce(n-X%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return vn(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var d=t[n].head,k=lt(e.doc,d.line).text;if(k){if(d.ch==k.length&&(d=new Xe(d.line,d.ch-1)),d.ch>0)d=new Xe(d.line,d.ch+1),e.replaceRange(k.charAt(d.ch-1)+k.charAt(d.ch-2),Xe(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var X=lt(e.doc,d.line-1).text;X&&(d=new Xe(d.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+X.charAt(X.length-1),Xe(d.line-1,X.length-1),d,"+transpose"))}}i.push(new xr(d,d))}e.setSelections(i)})},newlineAndIndent:function(e){return vn(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);ui(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ms(e,t){var i=lt(e.doc,t),n=Fr(i);return n!=i&&(t=vt(n)),Va(!0,e,n,t,1)}function Il(e,t){var i=lt(e.doc,t),n=Sn(i);return n!=i&&(t=vt(n)),Va(!0,e,i,t,-1)}function gs(e,t){var i=ms(e,t.line),n=lt(e.doc,i.line),d=mt(n,e.doc.direction);if(!d||d[0].level==0){var k=Math.max(i.ch,n.text.search(/\S/)),X=t.line==i.line&&t.ch<=k&&t.ch;return Xe(i.line,X?0:k,i.sticky)}return i}function ca(e,t,i){if(typeof t=="string"&&(t=Ki[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),d=t(e)!=Ae}finally{e.display.shift=n,e.state.suppressEdits=!1}return d}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var d=gi(t,e.state.keyMaps[n],i,e);if(d)return d}return e.options.extraKeys&&gi(t,e.options.extraKeys,i,e)||gi(t,e.options.keyMap,i,e)}var Ul=new ne;function Hi(e,t,i,n){var d=e.state.keySeq;if(d){if(hs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==d&&(e.state.keySeq=null,e.display.input.reset())}),vs(e,d+" "+t,i,n))return!0}return vs(e,t,i,n)}function vs(e,t,i,n){var d=Nl(e,t,n);return d=="multi"&&(e.state.keySeq=t),d=="handled"&&mr(e,"keyHandled",e,t,i),(d=="handled"||d=="multi")&&(ae(i),La(e)),!!d}function ys(e,t){var i=ps(t,!0);return i?t.shiftKey&&!e.state.keySeq?Hi(e,"Shift-"+i,t,function(n){return ca(e,n,!0)})||Hi(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ca(e,n)}):Hi(e,i,t,function(n){return ca(e,n)}):!1}function Fl(e,t,i){return Hi(e,"'"+i+"'",t,function(n){return ca(e,n,!0)})}var Xa=null;function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=M(),Ke(t,e))return;K&&F<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=ys(t,e);y&&(Xa=n?i:null,!n&&i==88&&!Dt&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!o&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(m(t,"CodeMirror-crosshair"),Ve(document,"keyup",i),Ve(document,"mouseover",i))}Le(document,"keyup",i),Le(document,"mouseover",i)}function Es(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ke(this,e)}function xs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(kn(t.display,e)||Ke(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(y&&i==Xa){Xa=null,ae(e);return}if(y&&(!e.which||e.which<10)&&ys(t,e))return;var d=String.fromCharCode(n==null?i:n);if(d=="\b")return;if(Fl(t,e,d))return;t.display.input.onKeyPress(e)}var jl=400,Ya=function(e,t,i){this.time=e,this.pos=t,this.button=i};Ya.prototype.compare=function(e,t,i){return this.time+jl>e&&xt(t,this.pos)==0&&i==this.button};var Gi,zi;function Wl(e,t){var i=+new Date;return zi&&zi.compare(i,e,t)?(Gi=zi=null,"triple"):Gi&&Gi.compare(i,e,t)?(zi=new Ya(i,e,t),Gi=null,"double"):(Gi=new Ya(i,e,t),zi=null,"single")}function Cs(e){var t=this,i=t.display;if(Ke(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,kn(i,e)){R||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if($a(t,e))return;var n=Jn(t,e),d=De(e),k=n?Wl(n,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),n&&Kl(t,d,n,k,e))return;d==1?n?Gl(t,n,k,e):Ie(e)==i.scroller&&ae(e):d==2?(n&&aa(t.doc,n),setTimeout(function(){return i.input.focus()},20)):d==3&&(D?t.display.input.onContextMenu(e):So(t))}function Kl(e,t,i,n,d){var k="Click";return n=="double"?k="Double"+k:n=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,Hi(e,fs(k,d),d,function(X){if(typeof X=="string"&&(X=Ki[X]),!X)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=X(e,i)!=Ae}finally{e.state.suppressEdits=!1}return q})}function Hl(e,t,i){var n=e.getOption("configureMouse"),d=n?n(e,t,i):{};if(d.unit==null){var k=l?i.shiftKey&&i.metaKey:i.altKey;d.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||i.shiftKey),d.addNew==null&&(d.addNew=o?i.metaKey:i.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(o?i.altKey:i.ctrlKey)),d}function Gl(e,t,i,n){K?setTimeout(I(Co,e),0):e.curOp.focus=M();var d=Hl(e,i,n),k=e.doc.sel,X;e.options.dragDrop&&Ge&&!e.isReadOnly()&&i=="single"&&(X=k.contains(t))>-1&&(xt((X=k.ranges[X]).from(),t)<0||t.xRel>0)&&(xt(X.to(),t)>0||t.xRel<0)?zl(e,n,t,d):Vl(e,n,t,d)}function zl(e,t,i,n){var d=e.display,k=!1,X=Gr(e,function(fe){R&&(d.scroller.draggable=!1),e.state.draggingText=!1,Ve(d.wrapper.ownerDocument,"mouseup",X),Ve(d.wrapper.ownerDocument,"mousemove",q),Ve(d.scroller,"dragstart",ee),Ve(d.scroller,"drop",X),k||(ae(fe),n.addNew||aa(e.doc,i,null,null,n.extend),R&&!w||K&&F==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),q=function(fe){k=k||Math.abs(t.clientX-fe.clientX)+Math.abs(t.clientY-fe.clientY)>=10},ee=function(){return k=!0};R&&(d.scroller.draggable=!0),e.state.draggingText=X,X.copy=!n.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),Le(d.wrapper.ownerDocument,"mouseup",X),Le(d.wrapper.ownerDocument,"mousemove",q),Le(d.scroller,"dragstart",ee),Le(d.scroller,"drop",X),So(e),setTimeout(function(){return d.input.focus()},20)}function Ss(e,t,i){if(i=="char")return new xr(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new xr(Xe(t.line,0),E(e.doc,Xe(t.line+1,0)));var n=i(e,t);return new xr(n.from,n.to)}function Vl(e,t,i,n){var d=e.display,k=e.doc;ae(t);var X,q,ee=k.sel,fe=ee.ranges;if(n.addNew&&!n.extend?(q=k.sel.contains(i),q>-1?X=fe[q]:X=new xr(i,i)):(X=k.sel.primary(),q=k.sel.primIndex),n.unit=="rectangle")n.addNew||(X=new xr(i,i)),i=Jn(e,t,!0,!0),q=-1;else{var Se=Ss(e,i,n.unit);n.extend?X=Ka(X,Se.anchor,Se.head,n.extend):X=Se}n.addNew?q==-1?(q=fe.length,qr(k,An(e,fe.concat([X]),q),{scroll:!1,origin:"*mouse"})):fe.length>1&&fe[q].empty()&&n.unit=="char"&&!n.extend?(qr(k,An(e,fe.slice(0,q).concat(fe.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),ee=k.sel):Ha(k,q,X,me):(q=0,qr(k,new xn([X],0),me),ee=k.sel);var Pe=i;function je(St){if(xt(Pe,St)==0)return;if(Pe=St,n.unit=="rectangle"){for(var kt=[],Gt=e.options.tabSize,Wt=J(lt(k,i.line).text,i.ch,Gt),ar=J(lt(k,St.line).text,St.ch,Gt),Or=Math.min(Wt,ar),Vr=Math.max(Wt,ar),kr=Math.min(i.line,St.line),yn=Math.min(e.lastLine(),Math.max(i.line,St.line));kr<=yn;kr++){var dn=lt(k,kr).text,jr=pe(dn,Or,Gt);Or==Vr?kt.push(new xr(Xe(kr,jr),Xe(kr,jr))):dn.length>jr&&kt.push(new xr(Xe(kr,jr),Xe(kr,pe(dn,Vr,Gt))))}kt.length||kt.push(new xr(i,i)),qr(k,An(e,ee.ranges.slice(0,q).concat(kt),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(St)}else{var cn=X,Jr=Ss(e,St,n.unit),Hr=cn.anchor,Wr;xt(Jr.anchor,Hr)>0?(Wr=Jr.head,Hr=Yt(cn.from(),Jr.anchor)):(Wr=Jr.anchor,Hr=Ft(cn.to(),Jr.head));var Ir=ee.ranges.slice(0);Ir[q]=Xl(e,new xr(E(k,Hr),Wr)),qr(k,An(e,Ir,q),me)}}var Fe=d.wrapper.getBoundingClientRect(),$e=0;function ut(St){var kt=++$e,Gt=Jn(e,St,!0,n.unit=="rectangle");if(!Gt)return;if(xt(Gt,Pe)!=0){e.curOp.focus=M(),je(Gt);var Wt=qi(d,k);(Gt.line>=Wt.to||Gt.line<Wt.from)&&setTimeout(Gr(e,function(){$e==kt&&ut(St)}),150)}else{var ar=St.clientY<Fe.top?-20:St.clientY>Fe.bottom?20:0;ar&&setTimeout(Gr(e,function(){if($e!=kt)return;d.scroller.scrollTop+=ar,ut(St)}),50)}}function bt(St){e.state.selectingText=!1,$e=Infinity,St&&(ae(St),d.input.focus()),Ve(d.wrapper.ownerDocument,"mousemove",Ct),Ve(d.wrapper.ownerDocument,"mouseup",Ot),k.history.lastSelOrigin=null}var Ct=Gr(e,function(St){St.buttons===0||!De(St)?bt(St):ut(St)}),Ot=Gr(e,bt);e.state.selectingText=Ot,Le(d.wrapper.ownerDocument,"mousemove",Ct),Le(d.wrapper.ownerDocument,"mouseup",Ot)}function Xl(e,t){var i=t.anchor,n=t.head,d=lt(e.doc,i.line);if(xt(i,n)==0&&i.sticky==n.sticky)return t;var k=mt(d);if(!k)return t;var X=nt(k,i.ch,i.sticky),q=k[X];if(q.from!=i.ch&&q.to!=i.ch)return t;var ee=X+(q.from==i.ch==(q.level!=1)?0:1);if(ee==0||ee==k.length)return t;var fe;if(n.line!=i.line)fe=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Se=nt(k,n.ch,n.sticky),Pe=Se-X||(n.ch-i.ch)*(q.level==1?-1:1);Se==ee-1||Se==ee?fe=Pe<0:fe=Pe>0}var je=k[ee+(fe?-1:0)],Fe=fe==(je.level==1),$e=Fe?je.from:je.to,ut=Fe?"after":"before";return i.ch==$e&&i.sticky==ut?t:new xr(new Xe(i.line,$e,ut),n)}function Ts(e,t,i,n){var d,k;if(t.touches)d=t.touches[0].clientX,k=t.touches[0].clientY;else try{d=t.clientX,k=t.clientY}catch(je){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ae(t);var X=e.display,q=X.lineDiv.getBoundingClientRect();if(k>q.bottom||!ye(e,i))return be(t);k-=q.top-X.viewOffset;for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var fe=X.gutters.childNodes[ee];if(fe&&fe.getBoundingClientRect().right>=d){var Se=zt(e.doc,k),Pe=e.display.gutterSpecs[ee];return Ne(e,i,e,Se,Pe.className,t),be(t)}}}function $a(e,t){return Ts(e,t,"gutterClick",!0)}function ws(e,t){if(kn(e.display,t)||Yl(e,t))return;if(Ke(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Yl(e,t){return ye(e,"gutterContextMenu")?Ts(e,t,"gutterContextMenu",!1):!1}function As(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),wi(e)}var yi={toString:function(){return"CodeMirror.Init"}},_s={},ha={};function $l(e){var t=e.optionHandlers;function i(n,d,k,X){e.defaults[n]=d,k&&(t[n]=X?function(q,ee,fe){fe!=yi&&k(q,ee,fe)}:k)}e.defineOption=i,e.Init=yi,i("value","",function(n,d){return n.setValue(d)},!0),i("mode",null,function(n,d){n.doc.modeOption=d,Ba(n)},!0),i("indentUnit",2,Ba,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){ki(n),wi(n),ln(n)},!0),i("lineSeparator",null,function(n,d){if(n.doc.lineSep=d,!d)return;var k=[],X=n.doc.first;n.doc.iter(function(ee){for(var fe=0;;){var Se=ee.text.indexOf(d,fe);if(Se==-1)break;fe=Se+d.length,k.push(Xe(X,Se))}X++});for(var q=k.length-1;q>=0;q--)pi(n.doc,d,k[q],Xe(k[q].line,k[q].ch+d.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,d,k){n.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),k!=yi&&n.refresh()}),i("specialCharPlaceholder",pr,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",r?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,d){return n.getInputField().spellcheck=d},!0),i("autocorrect",!1,function(n,d){return n.getInputField().autocorrect=d},!0),i("autocapitalize",!1,function(n,d){return n.getInputField().autocapitalize=d},!0),i("rtlMoveVisually",!C),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){As(n),Pi(n)},!0),i("keyMap","default",function(n,d,k){var X=da(d),q=k!=yi&&da(k);q&&q.detach&&q.detach(n,X),X.attach&&X.attach(n,q||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Ql,!0),i("gutters",[],function(n,d){n.display.gutterSpecs=Ua(d,n.options.lineNumbers),Pi(n)},!0),i("fixedGutter",!0,function(n,d){n.display.gutters.style.left=d?_a(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return di(n)},!0),i("scrollbarStyle","native",function(n){Lo(n),di(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,d){n.display.gutterSpecs=Ua(n.options.gutters,d),Pi(n)},!0),i("firstLineNumber",1,Pi,!0),i("lineNumberFormatter",function(n){return n},Pi,!0),i("showCursorWhenSelecting",!1,Ai,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,d){d=="nocursor"&&(li(n),n.display.input.blur()),n.display.input.readOnlyChanged(d)}),i("screenReaderLabel",null,function(n,d){d=d===""?null:d,n.display.input.screenReaderLabelChanged(d)}),i("disableInput",!1,function(n,d){d||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Ai,!0),i("singleCursorHeightPerLine",!0,Ai,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,ki,!0),i("addModeClass",!1,ki,!0),i("pollInterval",100),i("undoDepth",200,function(n,d){return n.doc.history.undoDepth=d}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,ki,!0),i("moveInputWithCursor",!0,function(n,d){d||n.display.input.resetPosition()}),i("tabindex",null,function(n,d){return n.display.input.getField().tabIndex=d||""}),i("autofocus",null),i("direction","ltr",function(n,d){return n.doc.setDirection(d)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=yi;if(!t!=!n){var d=e.display.dragFunctions,k=t?Le:Ve;k(e.display.scroller,"dragstart",d.start),k(e.display.scroller,"dragenter",d.enter),k(e.display.scroller,"dragover",d.over),k(e.display.scroller,"dragleave",d.leave),k(e.display.scroller,"drop",d.drop)}}function Ql(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(m(e.display.wrapper,"CodeMirror-wrap"),Un(e)),Oa(e),ln(e),wi(e),setTimeout(function(){return di(e)},100)}function Rr(e,t){var i=this;if(!(this instanceof Rr))return new Rr(e,t);this.options=t=t?U(t):{},U(_s,t,!1);var n=t.value;typeof n=="string"?n=new un(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var d=new Rr.inputStyles[t.inputStyle](this),k=this.display=new dl(e,n,d,t);k.wrapper.CodeMirror=this,As(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Lo(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 ne,keySeq:null,specialChars:null},t.autofocus&&!r&&k.input.focus(),K&&F<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Ll(),ei(this),this.curOp.forceUpdate=!0,Bo(this,n),t.autofocus&&!r||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Da(i)},20):li(this);for(var X in ha)ha.hasOwnProperty(X)&&ha[X](this,t[X],yi);Po(this),t.finishInit&&t.finishInit(this);for(var q=0;q<Ja.length;++q)Ja[q](this);ti(this),R&&t.lineWrapping&&getComputedStyle(k.lineDiv).textRendering=="optimizelegibility"&&(k.lineDiv.style.textRendering="auto")}Rr.defaults=_s,Rr.optionHandlers=ha;function Zl(e){var t=e.display;Le(t.scroller,"mousedown",Gr(e,Cs)),K&&F<11?Le(t.scroller,"dblclick",Gr(e,function(ee){if(Ke(e,ee))return;var fe=Jn(e,ee);if(!fe||$a(e,ee)||kn(e.display,ee))return;ae(ee);var Se=e.findWordAt(fe);aa(e.doc,Se.anchor,Se.head)})):Le(t.scroller,"dblclick",function(ee){return Ke(e,ee)||ae(ee)}),Le(t.scroller,"contextmenu",function(ee){return ws(e,ee)}),Le(t.input.getField(),"contextmenu",function(ee){t.scroller.contains(ee.target)||ws(e,ee)});var i,n={end:0};function d(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function k(ee){if(ee.touches.length!=1)return!1;var fe=ee.touches[0];return fe.radiusX<=1&&fe.radiusY<=1}function X(ee,fe){if(fe.left==null)return!0;var Se=fe.left-ee.left,Pe=fe.top-ee.top;return Se*Se+Pe*Pe>20*20}Le(t.scroller,"touchstart",function(ee){if(!Ke(e,ee)&&!k(ee)&&!$a(e,ee)){t.input.ensurePolled(),clearTimeout(i);var fe=+new Date;t.activeTouch={start:fe,moved:!1,prev:fe-n.end<=300?n:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),Le(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Le(t.scroller,"touchend",function(ee){var fe=t.activeTouch;if(fe&&!kn(t,ee)&&fe.left!=null&&!fe.moved&&new Date-fe.start<300){var Se=e.coordsChar(t.activeTouch,"page"),Pe;!fe.prev||X(fe,fe.prev)?Pe=new xr(Se,Se):!fe.prev.prev||X(fe,fe.prev.prev)?Pe=e.findWordAt(Se):Pe=new xr(Xe(Se.line,0),E(e.doc,Xe(Se.line+1,0))),e.setSelection(Pe.anchor,Pe.head),e.focus(),ae(ee)}d()}),Le(t.scroller,"touchcancel",d),Le(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Oi(e,t.scroller.scrollTop),Zn(e,t.scroller.scrollLeft,!0),Ne(e,"scroll",e))}),Le(t.scroller,"mousewheel",function(ee){return Io(e,ee)}),Le(t.scroller,"DOMMouseScroll",function(ee){return Io(e,ee)}),Le(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){Ke(e,ee)||Ce(ee)},over:function(ee){Ke(e,ee)||(Ol(e,ee),Ce(ee))},start:function(ee){return _l(e,ee)},drop:Gr(e,Al),leave:function(ee){Ke(e,ee)||us(e)}};var q=t.input.getField();Le(q,"keyup",function(ee){return Es.call(e,ee)}),Le(q,"keydown",Gr(e,bs)),Le(q,"keypress",Gr(e,xs)),Le(q,"focus",function(ee){return Da(e,ee)}),Le(q,"blur",function(ee){return li(e,ee)})}var Ja=[];Rr.defineInitHook=function(e){return Ja.push(e)};function Vi(e,t,i,n){var d=e.doc,k;i==null&&(i="add"),i=="smart"&&(d.mode.indent?k=yt(e,t).state:i="prev");var X=e.options.tabSize,q=lt(d,t),ee=J(q.text,null,X);q.stateAfter&&(q.stateAfter=null);var fe=q.text.match(/^\s*/)[0],Se;if(!n&&!/\S/.test(q.text))Se=0,i="not";else if(i=="smart"&&(Se=d.mode.indent(k,q.text.slice(fe.length),q.text),Se==Ae||Se>150)){if(!n)return;i="prev"}i=="prev"?t>d.first?Se=J(lt(d,t-1).text,null,X):Se=0:i=="add"?Se=ee+e.options.indentUnit:i=="subtract"?Se=ee-e.options.indentUnit:typeof i=="number"&&(Se=ee+i),Se=Math.max(0,Se);var Pe="",je=0;if(e.options.indentWithTabs)for(var Fe=Math.floor(Se/X);Fe;--Fe)je+=X,Pe+=" ";if(je<Se&&(Pe+=ce(Se-je)),Pe!=fe)return pi(d,Pe,Xe(t,0),Xe(t,fe.length),"+input"),q.stateAfter=null,!0;for(var $e=0;$e<d.sel.ranges.length;$e++){var ut=d.sel.ranges[$e];if(ut.head.line==t&&ut.head.ch<fe.length){var bt=Xe(t,fe.length);Ha(d,$e,new xr(bt,bt));break}}}var _n=null;function fa(e){_n=e}function Qa(e,t,i,n,d){var k=e.doc;e.display.shift=!1,n||(n=k.sel);var X=+new Date-200,q=d=="paste"||e.state.pasteIncoming>X,ee=ft(t),fe=null;if(q&&n.ranges.length>1)if(_n&&_n.text.join(`
`)==t){if(n.ranges.length%_n.text.length==0){fe=[];for(var Se=0;Se<_n.text.length;Se++)fe.push(k.splitLines(_n.text[Se]))}}else ee.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(fe=te(ee,function(Ct){return[Ct]}));for(var Pe=e.curOp.updateInput,je=n.ranges.length-1;je>=0;je--){var Fe=n.ranges[je],$e=Fe.from(),ut=Fe.to();Fe.empty()&&(i&&i>0?$e=Xe($e.line,$e.ch-i):e.state.overwrite&&!q?ut=Xe(ut.line,Math.min(lt(k,ut.line).text.length,ut.ch+Z(ee).length)):q&&_n&&_n.lineWise&&_n.text.join(`
`)==ee.join(`
`)&&($e=ut=Xe($e.line,0)));var bt={from:$e,to:ut,text:fe?fe[je%fe.length]:ee,origin:d||(q?"paste":e.state.cutIncoming>X?"cut":"+input")};fi(e.doc,bt),mr(e,"inputRead",e,bt)}t&&!q&&Ls(e,t),ui(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Pe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Os(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&vn(t,function(){return Qa(t,i,0,null,"paste")}),!0}function Ls(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var d=i.ranges[n];if(d.head.ch>100||n&&i.ranges[n-1].head.line==d.head.line)continue;var k=e.getModeAt(d.head),X=!1;if(k.electricChars){for(var q=0;q<k.electricChars.length;q++)if(t.indexOf(k.electricChars.charAt(q))>-1){X=Vi(e,d.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(lt(e.doc,d.head.line).text.slice(0,d.head.ch))&&(X=Vi(e,d.head.line,"smart")));X&&mr(e,"electricInput",e,d.head.line)}}function Ds(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var d=e.doc.sel.ranges[n].head.line,k={anchor:Xe(d,0),head:Xe(d+1,0)};i.push(k),t.push(e.getRange(k.anchor,k.head))}return{text:t,ranges:i}}function Rs(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ps(){var e=s("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=s("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return R?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Rs(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,d){var k=this.options,X=k[n];if(k[n]==d&&n!="mode")return;k[n]=d,t.hasOwnProperty(n)&&Gr(this,t[n])(this,d,X),Ne(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,d){this.state.keyMaps[d?"push":"unshift"](da(n))},removeKeyMap:function(n){for(var d=this.state.keyMaps,k=0;k<d.length;++k)if(d[k]==n||d[k].name==n)return d.splice(k,1),!0},addOverlay:an(function(n,d){var k=n.token?n:e.getMode(this.options,n);if(k.startState)throw new Error("Overlays may not be stateful.");le(this.state.overlays,{mode:k,modeSpec:n,opaque:d&&d.opaque,priority:d&&d.priority||0},function(X){return X.priority}),this.state.modeGen++,ln(this)}),removeOverlay:an(function(n){for(var d=this.state.overlays,k=0;k<d.length;++k){var X=d[k].modeSpec;if(X==n||typeof n=="string"&&X.name==n){d.splice(k,1),this.state.modeGen++,ln(this);return}}}),indentLine:an(function(n,d,k){typeof d!="string"&&typeof d!="number"&&(d==null?d=this.options.smartIndent?"smart":"prev":d=d?"add":"subtract"),Qt(this.doc,n)&&Vi(this,n,d,k)}),indentSelection:an(function(n){for(var d=this.doc.sel.ranges,k=-1,X=0;X<d.length;X++){var q=d[X];if(q.empty())q.head.line>k&&(Vi(this,q.head.line,n,!0),k=q.head.line,X==this.doc.sel.primIndex&&ui(this));else{var ee=q.from(),fe=q.to(),Se=Math.max(k,ee.line);k=Math.min(this.lastLine(),fe.line-(fe.ch?0:1))+1;for(var Pe=Se;Pe<k;++Pe)Vi(this,Pe,n);var je=this.doc.sel.ranges;ee.ch==0&&d.length==je.length&&je[X].from().ch>0&&Ha(this.doc,X,new xr(ee,je[X].to()),Oe)}}}),getTokenAt:function(n,d){return gr(this,n,d)},getLineTokens:function(n,d){return gr(this,Xe(n),d,!0)},getTokenTypeAt:function(n){n=E(this.doc,n);var d=et(this,lt(this.doc,n.line)),k=0,X=(d.length-1)/2,q=n.ch,ee;if(q==0)ee=d[2];else for(;;){var fe=k+X>>1;if((fe?d[fe*2-1]:0)>=q)X=fe;else if(d[fe*2+1]<q)k=fe+1;else{ee=d[fe*2+2];break}}var Se=ee?ee.indexOf("overlay "):-1;return Se<0?ee:Se==0?null:ee.slice(0,Se-1)},getModeAt:function(n){var d=this.doc.mode;return d.innerMode?e.innerMode(d,this.getTokenAt(n).state).mode:d},getHelper:function(n,d){return this.getHelpers(n,d)[0]},getHelpers:function(n,d){var k=[];if(!i.hasOwnProperty(d))return k;var X=i[d],q=this.getModeAt(n);if(typeof q[d]=="string")X[q[d]]&&k.push(X[q[d]]);else if(q[d])for(var ee=0;ee<q[d].length;ee++){var fe=X[q[d][ee]];fe&&k.push(fe)}else q.helperType&&X[q.helperType]?k.push(X[q.helperType]):X[q.name]&&k.push(X[q.name]);for(var Se=0;Se<X._global.length;Se++){var Pe=X._global[Se];Pe.pred(q,this)&&he(k,Pe.val)==-1&&k.push(Pe.val)}return k},getStateAfter:function(n,d){var k=this.doc;return n=G(k,n==null?k.first+k.size-1:n),yt(this,n+1,d).state},cursorCoords:function(n,d){var k,X=this.doc.sel.primary();return n==null?k=X.head:typeof n=="object"?k=E(this.doc,n):k=n?X.from():X.to(),wn(this,k,d||"page")},charCoords:function(n,d){return Ca(this,E(this.doc,n),d||"page")},coordsChar:function(n,d){return n=po(this,n,d||"page"),Ta(this,n.left,n.top)},lineAtHeight:function(n,d){return n=po(this,{top:n,left:0},d||"page").top,zt(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,d,k){var X=!1,q;if(typeof n=="number"){var ee=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>ee&&(n=ee,X=!0),q=lt(this.doc,n)}else q=n;return $i(this,q,{top:0,left:0},d||"page",k||X).top+(X?this.doc.height-bn(q):0)},defaultTextHeight:function(){return oi(this.display)},defaultCharWidth:function(){return si(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,d,k,X,q){var ee=this.display;n=wn(this,E(this.doc,n));var fe=n.bottom,Se=n.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),ee.sizer.appendChild(d),X=="over")fe=n.top;else if(X=="above"||X=="near"){var Pe=Math.max(ee.wrapper.clientHeight,this.doc.height),je=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);(X=="above"||n.bottom+d.offsetHeight>Pe)&&n.top>d.offsetHeight?fe=n.top-d.offsetHeight:n.bottom+d.offsetHeight<=Pe&&(fe=n.bottom),Se+d.offsetWidth>je&&(Se=je-d.offsetWidth)}d.style.top=fe+"px",d.style.left=d.style.right="",q=="right"?(Se=ee.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(q=="left"?Se=0:q=="middle"&&(Se=(ee.sizer.clientWidth-d.offsetWidth)/2),d.style.left=Se+"px"),k&&Js(this,{left:Se,top:fe,right:Se+d.offsetWidth,bottom:fe+d.offsetHeight})},triggerOnKeyDown:an(bs),triggerOnKeyPress:an(xs),triggerOnKeyUp:Es,triggerOnMouseDown:an(Cs),execCommand:function(n){if(Ki.hasOwnProperty(n))return Ki[n].call(null,this)},triggerElectric:an(function(n){Ls(this,n)}),findPosH:function(n,d,k,X){var q=1;d<0&&(q=-1,d=-d);for(var ee=E(this.doc,n),fe=0;fe<d&&!(ee=Za(this.doc,ee,q,k,X),ee.hitSide);++fe);return ee},moveH:an(function(n,d){var k=this;this.extendSelectionsBy(function(X){return k.display.shift||k.doc.extend||X.empty()?Za(k.doc,X.head,n,d,k.options.rtlMoveVisually):n<0?X.from():X.to()},de)}),deleteH:an(function(n,d){var k=this.doc.sel,X=this.doc;k.somethingSelected()?X.replaceSelection("",null,"+delete"):vi(this,function(q){var ee=Za(X,q.head,n,d,!1);return n<0?{from:ee,to:q.head}:{from:q.head,to:ee}})}),findPosV:function(n,d,k,X){var q=1,ee=X;d<0&&(q=-1,d=-d);for(var fe=E(this.doc,n),Se=0;Se<d;++Se){var Pe=wn(this,fe,"div");if(ee==null?ee=Pe.left:Pe.left=ee,fe=ks(this,Pe,q,k),fe.hitSide)break}return fe},moveV:an(function(n,d){var k=this,X=this.doc,q=[],ee=!this.display.shift&&!X.extend&&X.sel.somethingSelected();if(X.extendSelectionsBy(function(Se){if(ee)return n<0?Se.from():Se.to();var Pe=wn(k,Se.head,"div");Se.goalColumn!=null&&(Pe.left=Se.goalColumn),q.push(Pe.left);var je=ks(k,Pe,n,d);return d=="page"&&Se==X.sel.primary()&&Pa(k,Ca(k,je,"div").top-Pe.top),je},de),q.length)for(var fe=0;fe<X.sel.ranges.length;fe++)X.sel.ranges[fe].goalColumn=q[fe]}),findWordAt:function(n){var d=this.doc,k=lt(d,n.line).text,X=n.ch,q=n.ch;if(k){var ee=this.getHelper(n,"wordChars");(n.sticky=="before"||q==k.length)&&X?--X:++q;for(var fe=k.charAt(X),Se=_e(fe,ee)?function(Pe){return _e(Pe,ee)}:/\s/.test(fe)?function(Pe){return/\s/.test(Pe)}:function(Pe){return!/\s/.test(Pe)&&!_e(Pe)};X>0&&Se(k.charAt(X-1));)--X;for(;q<k.length&&Se(k.charAt(q));)++q}return new xr(Xe(n.line,X),Xe(n.line,q))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):m(this.display.cursorDiv,"CodeMirror-overwrite"),Ne(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:an(function(n,d){_i(this,n,d)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Ln(this)-this.display.barHeight,width:n.scrollWidth-Ln(this)-this.display.barWidth,clientHeight:ba(this),clientWidth:Yn(this)}},scrollIntoView:an(function(n,d){n==null?(n={from:this.doc.sel.primary().head,to:null},d==null&&(d=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Xe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=d||0,n.from.line!=null?Qs(this,n):wo(this,n.from,n.to,n.margin)}),setSize:an(function(n,d){var k=this,X=function(ee){return typeof ee=="number"||/^\d+$/.test(String(ee))?ee+"px":ee};n!=null&&(this.display.wrapper.style.width=X(n)),d!=null&&(this.display.wrapper.style.height=X(d)),this.options.lineWrapping&&co(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(ee){if(ee.widgets){for(var fe=0;fe<ee.widgets.length;fe++)if(ee.widgets[fe].noHScroll){jn(k,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,Ne(this,"refresh",this)}),operation:function(n){return vn(this,n)},startOperation:function(){return ei(this)},endOperation:function(){return ti(this)},refresh:an(function(){var n=this.display.cachedTextHeight;ln(this),this.curOp.forceUpdate=!0,wi(this),_i(this,this.doc.scrollLeft,this.doc.scrollTop),Ia(this.display),(n==null||Math.abs(n-oi(this.display))>.5||this.options.lineWrapping)&&Oa(this),Ne(this,"refresh",this)}),swapDoc:an(function(n){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),Bo(this,n),wi(this),this.display.input.reset(),_i(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,mr(this,"swapDoc",this,d),d}),phrase:function(n){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,n)?d[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ge(e),e.registerHelper=function(n,d,k){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][d]=k},e.registerGlobalHelper=function(n,d,k,X){e.registerHelper(n,d,X),i[n]._global.push({pred:k,val:X})}}function Za(e,t,i,n,d){var k=t,X=i,q=lt(e,t.line),ee=d&&e.direction=="rtl"?-i:i;function fe(){var Ot=t.line+ee;return Ot<e.first||Ot>=e.first+e.size?!1:(t=new Xe(Ot,t.ch,t.sticky),q=lt(e,Ot))}function Se(Ot){var St;if(n=="codepoint"){var kt=q.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(kt)?St=null:St=new Xe(t.line,Math.max(0,Math.min(q.text.length,t.ch+i*(kt>=55296&&kt<56320?2:1))),-i)}else d?St=Ml(e.cm,q,t,i):St=za(q,t,i);if(St==null)if(!Ot&&fe())t=Va(d,e.cm,q,t.line,ee);else return!1;else t=St;return!0}if(n=="char"||n=="codepoint")Se();else if(n=="column")Se(!0);else if(n=="word"||n=="group")for(var Pe=null,je=n=="group",Fe=e.cm&&e.cm.getHelper(t,"wordChars"),$e=!0;!(i<0&&!Se(!$e));$e=!1){var ut=q.text.charAt(t.ch)||`
`,bt=_e(ut,Fe)?"w":je&&ut==`
`?"n":!je||/\s/.test(ut)?null:"p";if(je&&!$e&&!bt&&(bt="s"),Pe&&Pe!=bt){i<0&&(i=1,Se(),t.sticky="after");break}if(bt&&(Pe=bt),i>0&&!Se(!$e))break}var Ct=sa(e,t,k,X,!0);return Pt(k,Ct)&&(Ct.hitSide=!0),Ct}function ks(e,t,i,n){var d=e.doc,k=t.left,X;if(n=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(q-.5*oi(e.display),3);X=(i>0?t.bottom:t.top)+i*ee}else n=="line"&&(X=i>0?t.bottom+3:t.top-3);for(var fe;!(fe=Ta(e,k,X),!fe.outside);){if(i<0?X<=0:X>=d.height){fe.hitSide=!0;break}X+=i*5}return fe}var Sr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Sr.prototype.init=function(e){var t=this,i=this,n=i.cm,d=i.div=e.lineDiv;Rs(d,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function k(q){for(var ee=q.target;ee;ee=ee.parentNode){if(ee==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}Le(d,"paste",function(q){if(!k(q)||Ke(n,q)||Os(q,n))return;F<=11&&setTimeout(Gr(n,function(){return t.updateFromDOM()}),20)}),Le(d,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Le(d,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Le(d,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Le(d,"touchstart",function(){return i.forceCompositionEnd()}),Le(d,"input",function(){t.composing||t.readFromDOMSoon()});function X(q){if(!k(q)||Ke(n,q))return;if(n.somethingSelected())fa({lineWise:!1,text:n.getSelections()}),q.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var ee=Ds(n);fa({lineWise:!0,text:ee.text}),q.type=="cut"&&n.operation(function(){n.setSelections(ee.ranges,0,Oe),n.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var fe=_n.text.join(`
`);if(q.clipboardData.setData("Text",fe),q.clipboardData.getData("Text")==fe){q.preventDefault();return}}var Se=Ps(),Pe=Se.firstChild;n.display.lineSpace.insertBefore(Se,n.display.lineSpace.firstChild),Pe.value=_n.text.join(`
`);var je=document.activeElement;H(Pe),setTimeout(function(){n.display.lineSpace.removeChild(Se),je.focus(),je==d&&i.showPrimarySelection()},50)}Le(d,"copy",X),Le(d,"cut",X)},Sr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Sr.prototype.prepareSelection=function(){var e=Eo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Sr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Sr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Sr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),d=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||d.line<t.display.viewFrom){e.removeAllRanges();return}var k=pa(t,e.anchorNode,e.anchorOffset),X=pa(t,e.focusNode,e.focusOffset);if(k&&!k.bad&&X&&!X.bad&&xt(Yt(k,X),n)==0&&xt(Ft(k,X),d)==0)return;var q=t.display.view,ee=n.line>=t.display.viewFrom&&Ms(t,n)||{node:q[0].measure.map[2],offset:0},fe=d.line<t.display.viewTo&&Ms(t,d);if(!fe){var Se=q[q.length-1].measure,Pe=Se.maps?Se.maps[Se.maps.length-1]:Se.map;fe={node:Pe[Pe.length-1],offset:Pe[Pe.length-2]-Pe[Pe.length-3]}}if(!ee||!fe){e.removeAllRanges();return}var je=e.rangeCount&&e.getRangeAt(0),Fe;try{Fe=c(ee.node,ee.offset,fe.offset,fe.node)}catch($e){}Fe&&(!P&&t.state.focused?(e.collapse(ee.node,ee.offset),Fe.collapsed||(e.removeAllRanges(),e.addRange(Fe))):(e.removeAllRanges(),e.addRange(Fe)),je&&e.anchorNode==null?e.addRange(je):P&&this.startGracePeriod()),this.rememberSelection()},Sr.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Sr.prototype.showMultipleSelections=function(e){u(this.cm.display.cursorDiv,e.cursors),u(this.cm.display.selectionDiv,e.selection)},Sr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Sr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},Sr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Sr.prototype.blur=function(){this.div.blur()},Sr.prototype.getField=function(){return this.div},Sr.prototype.supportsTouch=function(){return!0},Sr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():vn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Sr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Sr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(a&&h&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=pa(t,e.anchorNode,e.anchorOffset),n=pa(t,e.focusNode,e.focusOffset);i&&n&&vn(t,function(){qr(t.doc,Kn(i,n),Oe),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Sr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),d=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Xe(n.line-1,lt(e.doc,n.line-1).length)),d.ch==lt(e.doc,d.line).text.length&&d.line<e.lastLine()&&(d=Xe(d.line+1,0)),n.line<t.viewFrom||d.line>t.viewTo-1)return!1;var k,X,q;n.line==t.viewFrom||(k=Qn(e,n.line))==0?(X=vt(t.view[0].line),q=t.view[0].node):(X=vt(t.view[k].line),q=t.view[k-1].node.nextSibling);var ee=Qn(e,d.line),fe,Se;if(ee==t.view.length-1?(fe=t.viewTo-1,Se=t.lineDiv.lastChild):(fe=vt(t.view[ee+1].line)-1,Se=t.view[ee+1].node.previousSibling),!q)return!1;for(var Pe=e.doc.splitLines(tu(e,q,Se,X,fe)),je=Jt(e.doc,Xe(X,0),Xe(fe,lt(e.doc,fe).text.length));Pe.length>1&&je.length>1;)if(Z(Pe)==Z(je))Pe.pop(),je.pop(),fe--;else if(Pe[0]==je[0])Pe.shift(),je.shift(),X++;else break;for(var Fe=0,$e=0,ut=Pe[0],bt=je[0],Ct=Math.min(ut.length,bt.length);Fe<Ct&&ut.charCodeAt(Fe)==bt.charCodeAt(Fe);)++Fe;for(var Ot=Z(Pe),St=Z(je),kt=Math.min(Ot.length-(Pe.length==1?Fe:0),St.length-(je.length==1?Fe:0));$e<kt&&Ot.charCodeAt(Ot.length-$e-1)==St.charCodeAt(St.length-$e-1);)++$e;if(Pe.length==1&&je.length==1&&X==n.line)for(;Fe&&Fe>n.ch&&Ot.charCodeAt(Ot.length-$e-1)==St.charCodeAt(St.length-$e-1);)Fe--,$e++;Pe[Pe.length-1]=Ot.slice(0,Ot.length-$e).replace(/^\u200b+/,""),Pe[0]=Pe[0].slice(Fe).replace(/\u200b+$/,"");var Gt=Xe(X,Fe),Wt=Xe(fe,je.length?Z(je).length-$e:0);if(Pe.length>1||Pe[0]||xt(Gt,Wt))return pi(e.doc,Pe,Gt,Wt,"+input"),!0},Sr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Sr.prototype.reset=function(){this.forceCompositionEnd()},Sr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Sr.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)},Sr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&vn(this.cm,function(){return ln(e.cm)})},Sr.prototype.setUneditable=function(e){e.contentEditable="false"},Sr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gr(this.cm,Qa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Sr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Sr.prototype.onContextMenu=function(){},Sr.prototype.resetPosition=function(){},Sr.prototype.needsContentAttribute=!0;function Ms(e,t){var i=Ea(e,t.line);if(!i||i.hidden)return null;var n=lt(e.doc,t.line),d=ao(i,n,t.line),k=mt(n,e.doc.direction),X="left";if(k){var q=nt(k,t.ch);X=q%2?"right":"left"}var ee=lo(d.map,t.ch,X);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function bi(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,d){var k="",X=!1,q=e.doc.lineSeparator(),ee=!1;function fe(Fe){return function($e){return $e.id==Fe}}function Se(){X&&(k+=q,ee&&(k+=q),X=ee=!1)}function Pe(Fe){Fe&&(Se(),k+=Fe)}function je(Fe){if(Fe.nodeType==1){var $e=Fe.getAttribute("cm-text");if($e){Pe($e);return}var ut=Fe.getAttribute("cm-marker"),bt;if(ut){var Ct=e.findMarks(Xe(n,0),Xe(d+1,0),fe(+ut));Ct.length&&(bt=Ct[0].find(0))&&Pe(Jt(e.doc,bt.from,bt.to).join(q));return}if(Fe.getAttribute("contenteditable")=="false")return;var Ot=/^(pre|div|p|li|table|br)$/i.test(Fe.nodeName);if(!/^br$/i.test(Fe.nodeName)&&Fe.textContent.length==0)return;Ot&&Se();for(var St=0;St<Fe.childNodes.length;St++)je(Fe.childNodes[St]);/^(pre|p)$/i.test(Fe.nodeName)&&(ee=!0),Ot&&(X=!0)}else Fe.nodeType==3&&Pe(Fe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(je(t),t==i);)t=t.nextSibling,ee=!1;return k}function pa(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return bi(e.clipPos(Xe(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var d=0;d<e.display.view.length;d++){var k=e.display.view[d];if(k.node==n)return ru(k,t,i)}}function ru(e,t,i){var n=e.text.firstChild,d=!1;if(!t||!O(n,t))return bi(Xe(vt(e.line),0),!0);if(t==n&&(d=!0,t=n.childNodes[i],i=0,!t)){var k=e.rest?Z(e.rest):e.line;return bi(Xe(vt(k),k.text.length),d)}var X=t.nodeType==3?t:null,q=t;for(!X&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(X=t.firstChild,i&&(i=X.nodeValue.length));q.parentNode!=n;)q=q.parentNode;var ee=e.measure,fe=ee.maps;function Se(bt,Ct,Ot){for(var St=-1;St<(fe?fe.length:0);St++)for(var kt=St<0?ee.map:fe[St],Gt=0;Gt<kt.length;Gt+=3){var Wt=kt[Gt+2];if(Wt==bt||Wt==Ct){var ar=vt(St<0?e.line:e.rest[St]),Or=kt[Gt]+Ot;return(Ot<0||Wt!=bt)&&(Or=kt[Gt+(Ot?1:0)]),Xe(ar,Or)}}}var Pe=Se(X,q,i);if(Pe)return bi(Pe,d);for(var je=q.nextSibling,Fe=X?X.nodeValue.length-i:0;je;je=je.nextSibling){if(Pe=Se(je,je.firstChild,0),Pe)return bi(Xe(Pe.line,Pe.ch-Fe),d);Fe+=je.textContent.length}for(var $e=q.previousSibling,ut=i;$e;$e=$e.previousSibling){if(Pe=Se($e,$e.firstChild,-1),Pe)return bi(Xe(Pe.line,Pe.ch+ut),d);ut+=$e.textContent.length}}var Nr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ne,this.hasSelection=!1,this.composing=null};Nr.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var d=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(d.style.width="0px"),Le(d,"input",function(){K&&F>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Le(d,"paste",function(X){if(Ke(n,X)||Os(X,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function k(X){if(Ke(n,X))return;if(n.somethingSelected())fa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var q=Ds(n);fa({lineWise:!0,text:q.text}),X.type=="cut"?n.setSelections(q.ranges,null,Oe):(i.prevInput="",d.value=q.text.join(`
`),H(d))}else return;X.type=="cut"&&(n.state.cutIncoming=+new Date)}Le(d,"cut",k),Le(d,"copy",k),Le(e.scroller,"paste",function(X){if(kn(e,X)||Ke(n,X))return;if(!d.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var q=new Event("paste");q.clipboardData=X.clipboardData,d.dispatchEvent(q)}),Le(e.lineSpace,"selectstart",function(X){kn(e,X)||ae(X)}),Le(d,"compositionstart",function(){var X=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:X,range:n.markText(X,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Le(d,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Nr.prototype.createField=function(e){this.wrapper=Ps(),this.textarea=this.wrapper.firstChild},Nr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Nr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Eo(e);if(e.options.moveInputWithCursor){var d=wn(e,i.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),X=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+X.top-k.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+X.left-k.left))}return n},Nr.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")},Nr.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&&H(this.textarea),K&&F>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&F>=9&&(this.hasSelection=null))},Nr.prototype.getField=function(){return this.textarea},Nr.prototype.supportsTouch=function(){return!1},Nr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!r||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Nr.prototype.blur=function(){this.textarea.blur()},Nr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Nr.prototype.receivedFocus=function(){this.slowPoll()},Nr.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()})},Nr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Nr.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||at(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=i.value;if(d==n&&!t.somethingSelected())return!1;if(K&&F>=9&&this.hasSelection===d||o&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=d.charCodeAt(0);if(k==8203&&!n&&(n="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var X=0,q=Math.min(n.length,d.length);X<q&&n.charCodeAt(X)==d.charCodeAt(X);)++X;return vn(t,function(){Qa(t,d.slice(X),n.length-X,null,e.composing?"*compose":null),d.length>1e3||d.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=d,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Nr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Nr.prototype.onKeyPress=function(){K&&F>=9&&(this.hasSelection=null),this.fastPoll()},Nr.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=Jn(i,e),X=n.scroller.scrollTop;if(!k||y)return;var q=i.options.resetSelectionOnContextMenu;q&&i.doc.sel.contains(k)==-1&&Gr(i,qr)(i.doc,Kn(k),Oe);var ee=d.style.cssText,fe=t.wrapper.style.cssText,Se=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Se.top-5)+"px; left: "+(e.clientX-Se.left-5)+`px;
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Pe;R&&(Pe=window.scrollY),n.input.focus(),R&&window.scrollTo(null,Pe),n.input.reset(),i.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=Fe,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function je(){if(d.selectionStart!=null){var ut=i.somethingSelected(),bt="\u200B"+(ut?d.value:"");d.value="\u21DA",d.value=bt,t.prevInput=ut?"":"\u200B",d.selectionStart=1,d.selectionEnd=bt.length,n.selForContextMenu=i.doc.sel}}function Fe(){if(t.contextMenuPending!=Fe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=fe,d.style.cssText=ee,K&&F<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=X),d.selectionStart!=null){(!K||K&&F<9)&&je();var ut=0,bt=function(){n.selForContextMenu==i.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?Gr(i,Zo)(i):ut++<10?n.detectingSelectAll=setTimeout(bt,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(bt,200)}}if(K&&F>=9&&je(),D){Ce(e);var $e=function(){Ve(window,"mouseup",$e),setTimeout(Fe,20)};Le(window,"mouseup",$e)}else setTimeout(Fe,50)},Nr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Nr.prototype.setUneditable=function(){},Nr.prototype.needsContentAttribute=!1;function nu(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=M();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=q.getValue()}var d;if(e.form&&(Le(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var k=e.form;d=k.submit;try{var X=k.submit=function(){n(),k.submit=d,k.submit(),k.submit=X}}catch(ee){}}t.finishInit=function(ee){ee.save=n,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,n(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(Ve(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var q=Rr(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return q}function iu(e){e.off=Ve,e.on=Le,e.wheelEventPixels=cl,e.Doc=un,e.splitLines=ft,e.countColumn=J,e.findColumn=pe,e.isWordChar=xe,e.Pass=Ae,e.signal=Ne,e.Line=fn,e.changeEnd=Hn,e.scrollbarModel=Oo,e.Pos=Xe,e.cmpPos=xt,e.modes=Rt,e.mimeModes=wt,e.resolveMode=qe,e.getMode=Ze,e.modeExtensions=ze,e.extendMode=Ye,e.copyState=ot,e.startState=Mt,e.innerMode=gt,e.commands=Ki,e.keyMap=Mn,e.keyName=ps,e.isModifierKey=hs,e.lookupKey=gi,e.normalizeKeyMap=kl,e.StringStream=Et,e.SharedTextMarker=Bi,e.TextMarker=zn,e.LineWidget=Fi,e.e_preventDefault=ae,e.e_stopPropagation=re,e.e_stop=Ce,e.addClass=B,e.contains=O,e.rmClass=m,e.keyNames=Vn}$l(Rr),ql(Rr);var au="iter insert remove copy getEditor constructor".split(" ");for(var ma in un.prototype)un.prototype.hasOwnProperty(ma)&&he(au,ma)<0&&(Rr.prototype[ma]=function(e){return function(){return e.apply(this.doc,arguments)}}(un.prototype[ma]));return ge(un),Rr.inputStyles={textarea:Nr,contenteditable:Sr},Rr.defineMode=function(e){!Rr.defaults.mode&&e!="null"&&(Rr.defaults.mode=e),Ut.apply(this,arguments)},Rr.defineMIME=Nt,Rr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Rr.defineMIME("text/plain","null"),Rr.defineExtension=function(e,t){Rr.prototype[e]=t},Rr.defineDocExtension=function(e,t){un.prototype[e]=t},Rr.fromTextArea=nu,iu(Rr),Rr.version="5.58.2",Rr})},WaYH:function(ct,Te,W){"use strict";var ue=W("rePB"),V=W("Ff2n"),P=W("VTBJ"),$=W("1OyB"),N=W("vuIU"),L=W("JX7q"),K=W("Ji7U"),F=W("LK+K"),R=W("q1tI"),A=W("TSYQ"),h=W.n(A),y=W("sboe"),w=W("OZM5"),p=function(D){var T=D.prefixCls,m=D.level,v=D.isStart,u=D.isEnd;if(!m)return null;for(var s="".concat(T,"-indent-unit"),S=[],c=0;c<m;c+=1){var O;S.push(R.createElement("span",{key:c,className:h()(s,(O={},Object(ue.a)(O,"".concat(s,"-start"),v[c+1]),Object(ue.a)(O,"".concat(s,"-end"),u[c+1]),Object(ue.a)(O,"".concat(s,"-end-first-level"),!c&&u[0]),O))}))}return R.createElement("span",{"aria-hidden":"true",className:"".concat(T,"-indent")},S)},f=p,g=W("815F"),a="open",r="close",o="---",l=function(x){Object(K.a)(T,x);var D=Object(F.a)(T);function T(){var m;return Object($.a)(this,T),m=D.apply(this,arguments),m.state={dragNodeHighlight:!1},m.onSelectorClick=function(v){var u=m.props.context.onNodeClick;u(v,Object(g.b)(m.props)),m.isSelectable()?m.onSelect(v):m.onCheck(v)},m.onSelectorDoubleClick=function(v){var u=m.props.context.onNodeDoubleClick;u(v,Object(g.b)(m.props))},m.onSelect=function(v){if(m.isDisabled())return;var u=m.props.context.onNodeSelect;v.preventDefault(),u(v,Object(g.b)(m.props))},m.onCheck=function(v){if(m.isDisabled())return;var u=m.props,s=u.disableCheckbox,S=u.checked,c=m.props.context.onNodeCheck;if(!m.isCheckable()||s)return;v.preventDefault();var O=!S;c(v,Object(g.b)(m.props),O)},m.onMouseEnter=function(v){var u=m.props.context.onNodeMouseEnter;u(v,Object(g.b)(m.props))},m.onMouseLeave=function(v){var u=m.props.context.onNodeMouseLeave;u(v,Object(g.b)(m.props))},m.onContextMenu=function(v){var u=m.props.context.onNodeContextMenu;u(v,Object(g.b)(m.props))},m.onDragStart=function(v){var u=m.props.context.onNodeDragStart;v.stopPropagation(),m.setState({dragNodeHighlight:!0}),u(v,Object(L.a)(m));try{v.dataTransfer.setData("text/plain","")}catch(s){}},m.onDragEnter=function(v){var u=m.props.context.onNodeDragEnter;v.preventDefault(),v.stopPropagation(),u(v,Object(L.a)(m))},m.onDragOver=function(v){var u=m.props.context.onNodeDragOver;v.preventDefault(),v.stopPropagation(),u(v,Object(L.a)(m))},m.onDragLeave=function(v){var u=m.props.context.onNodeDragLeave;v.stopPropagation(),u(v,Object(L.a)(m))},m.onDragEnd=function(v){var u=m.props.context.onNodeDragEnd;v.stopPropagation(),m.setState({dragNodeHighlight:!1}),u(v,Object(L.a)(m))},m.onDrop=function(v){var u=m.props.context.onNodeDrop;v.preventDefault(),v.stopPropagation(),m.setState({dragNodeHighlight:!1}),u(v,Object(L.a)(m))},m.onExpand=function(v){var u=m.props.context.onNodeExpand;u(v,Object(g.b)(m.props))},m.setSelectHandle=function(v){m.selectHandle=v},m.getNodeState=function(){var v=m.props.expanded;return m.isLeaf()?null:v?a:r},m.hasChildren=function(){var v=m.props.eventKey,u=m.props.context.keyEntities,s=u[v]||{},S=s.children;return!!(S||[]).length},m.isLeaf=function(){var v=m.props,u=v.isLeaf,s=v.loaded,S=m.props.context.loadData,c=m.hasChildren();return u===!1?!1:u||!S&&!c||S&&s&&!c},m.isDisabled=function(){var v=m.props.disabled,u=m.props.context.disabled;return!!(u||v)},m.isCheckable=function(){var v=m.props.checkable,u=m.props.context.checkable;return!u||v===!1?!1:u},m.syncLoadData=function(v){var u=v.expanded,s=v.loading,S=v.loaded,c=m.props.context,O=c.loadData,M=c.onNodeLoad;if(s)return;O&&u&&!m.isLeaf()&&(!m.hasChildren()&&!S&&M(Object(g.b)(m.props)))},m.renderSwitcher=function(){var v=m.props,u=v.expanded,s=v.switcherIcon,S=m.props.context,c=S.prefixCls,O=S.switcherIcon,M=s||O;if(m.isLeaf())return R.createElement("span",{className:h()("".concat(c,"-switcher"),"".concat(c,"-switcher-noop"))},typeof M=="function"?M(Object(P.a)(Object(P.a)({},m.props),{},{isLeaf:!0})):M);var B=h()("".concat(c,"-switcher"),"".concat(c,"-switcher_").concat(u?a:r));return R.createElement("span",{onClick:m.onExpand,className:B},typeof M=="function"?M(Object(P.a)(Object(P.a)({},m.props),{},{isLeaf:!1})):M)},m.renderCheckbox=function(){var v=m.props,u=v.checked,s=v.halfChecked,S=v.disableCheckbox,c=m.props.context.prefixCls,O=m.isDisabled(),M=m.isCheckable();if(!M)return null;var B=typeof M!="boolean"?M:null;return R.createElement("span",{className:h()("".concat(c,"-checkbox"),u&&"".concat(c,"-checkbox-checked"),!u&&s&&"".concat(c,"-checkbox-indeterminate"),(O||S)&&"".concat(c,"-checkbox-disabled")),onClick:m.onCheck},B)},m.renderIcon=function(){var v=m.props.loading,u=m.props.context.prefixCls;return R.createElement("span",{className:h()("".concat(u,"-iconEle"),"".concat(u,"-icon__").concat(m.getNodeState()||"docu"),v&&"".concat(u,"-icon_loading"))})},m.renderSelector=function(){var v=m.state.dragNodeHighlight,u=m.props,s=u.title,S=u.selected,c=u.icon,O=u.loading,M=u.data,B=m.props.context,j=B.prefixCls,H=B.showIcon,I=B.icon,U=B.draggable,J=B.loadData,ne=B.titleRender,he=m.isDisabled(),Ee="".concat(j,"-node-content-wrapper"),Ae;if(H){var Oe=c||I;Ae=Oe?R.createElement("span",{className:h()("".concat(j,"-iconEle"),"".concat(j,"-icon__customize"))},typeof Oe=="function"?Oe(m.props):Oe):m.renderIcon()}else J&&O&&(Ae=m.renderIcon());var me;typeof s=="function"?me=s(M):ne?me=ne(M):me=s;var de=R.createElement("span",{className:"".concat(j,"-title")},me);return R.createElement("span",{ref:m.setSelectHandle,title:typeof s=="string"?s:"",className:h()("".concat(Ee),"".concat(Ee,"-").concat(m.getNodeState()||"normal"),!he&&(S||v)&&"".concat(j,"-node-selected"),!he&&U&&"draggable"),draggable:!he&&U||void 0,"aria-grabbed":!he&&U||void 0,onMouseEnter:m.onMouseEnter,onMouseLeave:m.onMouseLeave,onContextMenu:m.onContextMenu,onClick:m.onSelectorClick,onDoubleClick:m.onSelectorDoubleClick,onDragStart:U?m.onDragStart:void 0},Ae,de)},m}return Object(N.a)(T,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var v=this.props.selectable,u=this.props.context.selectable;return typeof v=="boolean"?v:u}},{key:"render",value:function(){var v,u=this.props,s=u.eventKey,S=u.className,c=u.style,O=u.dragOver,M=u.dragOverGapTop,B=u.dragOverGapBottom,j=u.isLeaf,H=u.isStart,I=u.isEnd,U=u.expanded,J=u.selected,ne=u.checked,he=u.halfChecked,Ee=u.loading,Ae=u.domRef,Oe=u.active,me=u.onMouseMove,de=Object(V.a)(u,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),pe=this.props.context,se=pe.prefixCls,ce=pe.filterTreeNode,Z=pe.draggable,te=pe.keyEntities,le=this.isDisabled(),ve=Object(w.f)(de),ie=te[s]||{},oe=ie.level,xe=I[I.length-1];return R.createElement("div",Object.assign({ref:Ae,className:h()(S,"".concat(se,"-treenode"),(v={},Object(ue.a)(v,"".concat(se,"-treenode-disabled"),le),Object(ue.a)(v,"".concat(se,"-treenode-switcher-").concat(U?"open":"close"),!j),Object(ue.a)(v,"".concat(se,"-treenode-checkbox-checked"),ne),Object(ue.a)(v,"".concat(se,"-treenode-checkbox-indeterminate"),he),Object(ue.a)(v,"".concat(se,"-treenode-selected"),J),Object(ue.a)(v,"".concat(se,"-treenode-loading"),Ee),Object(ue.a)(v,"".concat(se,"-treenode-active"),Oe),Object(ue.a)(v,"".concat(se,"-treenode-leaf-last"),xe),Object(ue.a)(v,"drag-over",!le&&O),Object(ue.a)(v,"drag-over-gap-top",!le&&M),Object(ue.a)(v,"drag-over-gap-bottom",!le&&B),Object(ue.a)(v,"filter-node",ce&&ce(Object(g.b)(this.props))),v)),style:c,onDragEnter:Z?this.onDragEnter:void 0,onDragOver:Z?this.onDragOver:void 0,onDragLeave:Z?this.onDragLeave:void 0,onDrop:Z?this.onDrop:void 0,onDragEnd:Z?this.onDragEnd:void 0,onMouseMove:me},ve),R.createElement(f,{prefixCls:se,level:oe,isStart:H,isEnd:I}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),T}(R.Component),C=function(D){return R.createElement(y.a.Consumer,null,function(T){return R.createElement(l,Object.assign({},D,{context:T}))})};C.displayName="TreeNode",C.defaultProps={title:o},C.isTreeNode=1;var b=Te.a=C},XIdC:function(ct,Te,W){"use strict";var ue=W("rePB"),V=W("ODXe"),P=W("Ff2n"),$=W("q1tI"),N=W.n($),L=W("TSYQ"),K=W.n(L),F=W("6cGi"),R=W("4IlW"),A=$.forwardRef(function(h,y){var w,p=h.prefixCls,f=p===void 0?"rc-switch":p,g=h.className,a=h.checked,r=h.defaultChecked,o=h.disabled,l=h.loadingIcon,C=h.checkedChildren,b=h.unCheckedChildren,x=h.onClick,D=h.onChange,T=h.onKeyDown,m=Object(P.a)(h,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),v=Object(F.a)(!1,{value:a,defaultValue:r}),u=Object(V.a)(v,2),s=u[0],S=u[1];function c(j,H){var I=s;return o||(I=j,S(I),D==null||D(I,H)),I}function O(j){j.which===R.a.LEFT?c(!1,j):j.which===R.a.RIGHT&&c(!0,j),T==null||T(j)}function M(j){var H=c(!s,j);x==null||x(H,j)}var B=K()(f,g,(w={},Object(ue.a)(w,"".concat(f,"-checked"),s),Object(ue.a)(w,"".concat(f,"-disabled"),o),w));return $.createElement("button",Object.assign({},m,{type:"button",role:"switch","aria-checked":s,disabled:o,className:B,ref:y,onKeyDown:O,onClick:M}),l,$.createElement("span",{className:"".concat(f,"-inner")},s?C:b))});A.displayName="Switch",Te.a=A},Y1PL:function(ct,Te,W){"use strict";W.r(Te),W.d(Te,"ResizableTextArea",function(){return he});var ue=W("wx14"),V=W("1OyB"),P=W("vuIU"),$=W("Ji7U"),N=W("LK+K"),L=W("q1tI"),K=W("VTBJ"),F=W("rePB"),R=W("Zm9Q"),A=W("Kwbf"),h=W("c+Xe"),y=W("m+aA"),w=W("bdgK"),p=new Map;function f(Oe){Oe.forEach(function(me){var de,pe=me.target;(de=p.get(pe))===null||de===void 0||de.forEach(function(se){return se(pe)})})}var g=new w.default(f),a=null,r=null;function o(Oe,me){p.has(Oe)||(p.set(Oe,new Set),g.observe(Oe)),p.get(Oe).add(me)}function l(Oe,me){p.has(Oe)&&(p.get(Oe).delete(me),p.get(Oe).size||(g.unobserve(Oe),p.delete(Oe)))}var C=function(Oe){Object($.a)(de,Oe);var me=Object(N.a)(de);function de(){return Object(V.a)(this,de),me.apply(this,arguments)}return Object(P.a)(de,[{key:"render",value:function(){return this.props.children}}]),de}(L.Component),b=L.createContext(null);function x(Oe){var me=Oe.children,de=Oe.onBatchResize,pe=L.useRef(0),se=L.useRef([]),ce=L.useContext(b),Z=L.useCallback(function(te,le,ve){pe.current+=1;var ie=pe.current;se.current.push({size:te,element:le,data:ve}),Promise.resolve().then(function(){ie===pe.current&&(de==null||de(se.current),se.current=[])}),ce==null||ce(te,le,ve)},[de,ce]);return L.createElement(b.Provider,{value:Z},me)}function D(Oe){var me=Oe.children,de=Oe.disabled,pe=L.useRef(null),se=L.useRef(null),ce=L.useContext(b),Z=L.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),te=L.isValidElement(me)&&Object(h.c)(me),le=te?me.ref:null,ve=L.useMemo(function(){return Object(h.a)(le,pe)},[le,pe]),ie=L.useRef(Oe);ie.current=Oe;var oe=L.useCallback(function(xe){var _e=ie.current,Me=_e.onResize,Ue=_e.data,He=xe.getBoundingClientRect(),Be=He.width,tt=He.height,Je=xe.offsetWidth,st=xe.offsetHeight,nt=Math.floor(Be),pt=Math.floor(tt);if(Z.current.width!==nt||Z.current.height!==pt||Z.current.offsetWidth!==Je||Z.current.offsetHeight!==st){var mt={width:nt,height:pt,offsetWidth:Je,offsetHeight:st};Z.current=mt;var ke=Je===Math.round(Be)?Be:Je,Le=st===Math.round(tt)?tt:st,We=Object(K.a)(Object(K.a)({},mt),{},{offsetWidth:ke,offsetHeight:Le});ce==null||ce(We,xe,Ue),Me&&Promise.resolve().then(function(){Me(We,xe)})}},[]);return L.useEffect(function(){var xe=Object(y.a)(pe.current)||Object(y.a)(se.current);return xe&&!de&&o(xe,oe),function(){return l(xe,oe)}},[pe.current,de]),L.createElement(C,{ref:se},te?L.cloneElement(me,{ref:ve}):me)}var T="rc-observer-key";function m(Oe){var me=Oe.children,de=Object(R.a)(me);return de.map(function(pe,se){var ce=(pe==null?void 0:pe.key)||"".concat(T,"-").concat(se);return L.createElement(D,Object(ue.a)({},Oe,{key:ce}),pe)})}m.Collection=x;var v=m,u=W("bT9E"),s=W("TSYQ"),S=W.n(s),c=`
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
`,O=["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"],M={},B;function j(Oe){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,de=Oe.getAttribute("id")||Oe.getAttribute("data-reactid")||Oe.getAttribute("name");if(me&&M[de])return M[de];var pe=window.getComputedStyle(Oe),se=pe.getPropertyValue("box-sizing")||pe.getPropertyValue("-moz-box-sizing")||pe.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(pe.getPropertyValue("padding-bottom"))+parseFloat(pe.getPropertyValue("padding-top")),Z=parseFloat(pe.getPropertyValue("border-bottom-width"))+parseFloat(pe.getPropertyValue("border-top-width")),te=O.map(function(ve){return"".concat(ve,":").concat(pe.getPropertyValue(ve))}).join(";"),le={sizingStyle:te,paddingSize:ce,borderSize:Z,boxSizing:se};return me&&de&&(M[de]=le),le}function H(Oe){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,pe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),Oe.getAttribute("wrap")?B.setAttribute("wrap",Oe.getAttribute("wrap")):B.removeAttribute("wrap");var se=j(Oe,me),ce=se.paddingSize,Z=se.borderSize,te=se.boxSizing,le=se.sizingStyle;B.setAttribute("style","".concat(le,";").concat(c)),B.value=Oe.value||Oe.placeholder||"";var ve=Number.MIN_SAFE_INTEGER,ie=Number.MAX_SAFE_INTEGER,oe=B.scrollHeight,xe;if(te==="border-box"?oe+=Z:te==="content-box"&&(oe-=ce),de!==null||pe!==null){B.value=" ";var _e=B.scrollHeight-ce;de!==null&&(ve=_e*de,te==="border-box"&&(ve=ve+ce+Z),oe=Math.max(ve,oe)),pe!==null&&(ie=_e*pe,te==="border-box"&&(ie=ie+ce+Z),xe=oe>ie?"":"hidden",oe=Math.min(ie,oe))}return{height:oe,minHeight:ve,maxHeight:ie,overflowY:xe,resize:"none"}}var I=W("Gytx"),U=W.n(I),J;(function(Oe){Oe[Oe.NONE=0]="NONE",Oe[Oe.RESIZING=1]="RESIZING",Oe[Oe.RESIZED=2]="RESIZED"})(J||(J={}));var ne=function(Oe){Object($.a)(de,Oe);var me=Object(N.a)(de);function de(pe){var se;return Object(V.a)(this,de),se=me.call(this,pe),se.nextFrameActionId=void 0,se.resizeFrameId=void 0,se.textArea=void 0,se.saveTextArea=function(ce){se.textArea=ce},se.handleResize=function(ce){var Z=se.state.resizeStatus,te=se.props,le=te.autoSize,ve=te.onResize;if(Z!==J.NONE)return;typeof ve=="function"&&ve(ce),le&&se.resizeOnNextFrame()},se.resizeOnNextFrame=function(){cancelAnimationFrame(se.nextFrameActionId),se.nextFrameActionId=requestAnimationFrame(se.resizeTextarea)},se.resizeTextarea=function(){var ce=se.props.autoSize;if(!ce||!se.textArea)return;var Z=ce.minRows,te=ce.maxRows,le=H(se.textArea,!1,Z,te);se.setState({textareaStyles:le,resizeStatus:J.RESIZING},function(){cancelAnimationFrame(se.resizeFrameId),se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:J.RESIZED},function(){se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:J.NONE}),se.fixFirefoxAutoScroll()})})})})},se.renderTextArea=function(){var ce=se.props,Z=ce.prefixCls,te=Z===void 0?"rc-textarea":Z,le=ce.autoSize,ve=ce.onResize,ie=ce.className,oe=ce.disabled,xe=se.state,_e=xe.textareaStyles,Me=xe.resizeStatus,Ue=Object(u.a)(se.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),He=S()(te,ie,Object(F.a)({},"".concat(te,"-disabled"),oe));"value"in Ue&&(Ue.value=Ue.value||"");var Be=Object(K.a)(Object(K.a)(Object(K.a)({},se.props.style),_e),Me===J.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return L.createElement(v,{onResize:se.handleResize,disabled:!(le||ve)},L.createElement("textarea",Object(ue.a)({},Ue,{className:He,style:Be,ref:se.saveTextArea})))},se.state={textareaStyles:{},resizeStatus:J.NONE},se}return Object(P.a)(de,[{key:"componentDidUpdate",value:function(se){(se.value!==this.props.value||!U()(se.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 se=this.textArea.selectionStart,ce=this.textArea.selectionEnd;this.textArea.setSelectionRange(se,ce)}}catch(Z){}}},{key:"render",value:function(){return this.renderTextArea()}}]),de}(L.Component),he=ne,Ee=function(Oe){Object($.a)(de,Oe);var me=Object(N.a)(de);function de(pe){var se;Object(V.a)(this,de),se=me.call(this,pe),se.resizableTextArea=void 0,se.focus=function(){se.resizableTextArea.textArea.focus()},se.saveTextArea=function(Z){se.resizableTextArea=Z},se.handleChange=function(Z){var te=se.props.onChange;se.setValue(Z.target.value,function(){se.resizableTextArea.resizeTextarea()}),te&&te(Z)},se.handleKeyDown=function(Z){var te=se.props,le=te.onPressEnter,ve=te.onKeyDown;Z.keyCode===13&&le&&le(Z),ve&&ve(Z)};var ce=typeof pe.value=="undefined"||pe.value===null?pe.defaultValue:pe.value;return se.state={value:ce},se}return Object(P.a)(de,[{key:"setValue",value:function(se,ce){"value"in this.props||this.setState({value:se},ce)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return L.createElement(he,Object(ue.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(se){return"value"in se?{value:se.value}:null}}]),de}(L.Component),Ae=Te.default=Ee},ZW9T:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return v});var ue=W("k1fw"),V=W("oBTY"),P=W("9og8"),$=W("miYZ"),N=W("tsqr"),L=W("rAM+"),K=W("tJVT"),F=W("PpiC"),R=W("WmNS"),A=W.n(R),h=W("q1tI"),y=W.n(h),w=W("bdgK");function p(u,s,S,c,O){var M=s.getWordUntilPosition(S),B={startLineNumber:S.lineNumber,endLineNumber:S.lineNumber,startColumn:M.startColumn,endColumn:M.endColumn},j=c.map(function(H){return{label:H,kind:u.languages.CompletionItemKind.Keyword,insertText:H,insertTextRules:u.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:B}});return O.map(function(H){j.push(Object(ue.a)(Object(ue.a)({},H),{},{range:B}))}),j}var f=function(u){var s={label:"ifelse",kind:u.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:u.languages.CompletionItemInsertTextRule.InsertAsSnippet},S=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];u.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(B,j){var H=p(u,B,j,S,[s]);return{suggestions:H}}});var c=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];u.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(B,j){var H=[{label:"print",kind:u.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:u.languages.CompletionItemInsertTextRule.InsertAsSnippet}],I=p(u,B,j,c,H);return{suggestions:I}}});var O=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];u.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(B,j){var H=[s,{label:"main",kind:u.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:u.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:u.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:u.languages.CompletionItemInsertTextRule.InsertAsSnippet}],I=p(u,B,j,O,H);return{suggestions:I}}})},g="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",a=W("fjLI"),r=W("LvDl"),o=W("+ua5");function l(u){return/^\d+$/.test(u)?"".concat(u,"px"):u}function C(){}var b=!1,x={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale"};function D(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=u;if(Array.isArray(u)){for(var S=0;S<u.length;S++){var c=x[u[S]];if(c)return c}return s[0]}return x[s]||s}var T=null,m=Te.b=function(u){var s=u.width,S=s===void 0?"100%":s,c=u.height,O=c===void 0?"100%":c,M=u.value,B=u.language,j=B===void 0?"javascript":B,H=u.style,I=H===void 0?{}:H,U=u.options,J=U===void 0?{}:U,ne=u.overrideServices,he=ne===void 0?{}:ne,Ee=u.theme,Ae=Ee===void 0?"vs-dark":Ee,Oe=u.onEditBlur,me=u.onSave,de=u.autoHeight,pe=de===void 0?!1:de,se=u.forbidCopy,ce=se===void 0?!1:se,Z=u.onChange,te=Z===void 0?C:Z,le=u.editorDidMount,ve=le===void 0?C:le,ie=u.onFocus,oe=ie===void 0?C:ie,xe=u.onBreakPoint,_e=xe===void 0?C:xe,Me=u.breakPointValue,Ue=Me===void 0?[]:Me,He=u.filename,Be=He===void 0?"educoder.txt":He,tt=u.errorLine,Je=u.errorContent,st=Je===void 0?"":Je,nt=u.highlightLine,pt=u.openBreakPoint,mt=pt===void 0?!1:pt,ke=Object(F.a)(u,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint"]),Le=Object(h.useRef)(),We=Object(h.useRef)({}),Ve=Object(h.useRef)(),Ne=Object(h.useRef)(),Ke=Object(h.useRef)([]),we=Object(h.useRef)(!1),ye=Object(h.useRef)(),ge=Object(h.useState)(!1),ae=Object(K.a)(ge,2),re=ae[0],be=ae[1];function Ce(){var Ze;return Le.current&&(Ze=new w.default(function(ze){var Ye=Object(L.a)(ze),ot;try{for(Ye.s();!(ot=Ye.n()).done;){var gt=ot.value;(gt.target.offsetHeight>0||gt.target.offsetWidth>0)&&We.current.instance.layout()}}catch(Mt){Ye.e(Mt)}finally{Ye.f()}}),Ze.observe(Le.current)),Ze}function Ie(){N.b.warn({content:decodeURIComponent(g),key:"monaco-editor-tip"})}var De=function(){var ze=We.current.instance;if(M!=null&&ze&&re){var Ye=ze.getModel();Ye&&M!==Ye.getValue()&&(b=!0,Ye.setValue(M),ze.layout(),b=!1)}};Object(h.useEffect)(function(){try{var Ze,ze=We.current.instance;Ne.current&&clearTimeout(Ne.current),Ne.current=setTimeout(function(){De()},500),ze==null||((Ze=ze.updateOptions)===null||Ze===void 0)||Ze.call(ze,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(M.split(/\r\n|\r|\n/g).length))+3,5)})}catch(Ye){debugger}},[M,re,We.current]),Object(h.useEffect)(function(){try{if(tt&&We.current&&We.current.instance){var Ze=We.current.instance;Ze.changeViewZones(function(Ye){var ot=document.createElement("div");ot.style.padding="10px 20px",ot.style.width="calc(100% - 20px)",ot.className="my-error-line-wrp",ot.innerHTML=st,Ye.addZone({afterLineNumber:tt||11,heightInLines:3,domNode:ot})});var ze={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Ze.addOverlayWidget(ze),Ze.revealPositionInCenter({lineNumber:20,column:1})}}catch(Ye){debugger}},[tt,We.current,re]),Object(h.useEffect)(function(){var Ze;if((Ze=We.current)!==null&&Ze!==void 0&&Ze.instance&&re&&mt){var ze=We.current.instance,Ye=ze.getModel();if(!Ye)return;var ot=function(){var xt=[],Pt=[],At=Ye.getAllDecorations(),Ft=Object(L.a)(At),Yt;try{for(Ft.s();!(Yt=Ft.n()).done;){var G=Yt.value;if(G.options.className==="highlighted-line"){var E;xt.push(G==null||((E=G.range)===null||E===void 0)?void 0:E.startLineNumber),Pt.push(G==null?void 0:G.id)}}}catch(z){Ft.e(z)}finally{Ft.f()}Ye.deltaDecorations(Pt,[]);var _=Ye.getLineCount();!!nt&&nt<=_&&(ze.deltaDecorations([],[{range:new T.Range(nt,1,nt,Ye.getLineMaxColumn(nt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),ze.revealLineInCenter(nt))};ot();var gt=function(){var xt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Pt=[],At=[],Ft=Ye.getAllDecorations(),Yt=Object(L.a)(Ft),G;try{for(Yt.s();!(G=Yt.n()).done;){var E=G.value;if(E.options.linesDecorationsClassName==="breakpoints"){var _;Pt.push(E==null||((_=E.range)===null||_===void 0)?void 0:_.startLineNumber),At.push(E==null?void 0:E.id)}}}catch(z){Yt.e(z)}finally{Yt.f()}if(xt)return{lines:Pt,ids:At};_e(Pt)},Mt=function(){var Xe=Object(P.a)(A.a.mark(function xt(Pt){var At;return A.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return At={range:new T.Range(Pt,1,Pt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},Yt.next=3,Ye.deltaDecorations([],[At]);case 3:gt();case 4:case"end":return Yt.stop()}},xt)}));return function(Pt){return Xe.apply(this,arguments)}}(),Et=function(){var Xe=Object(P.a)(A.a.mark(function xt(Pt){var At,Ft,Yt,G,E;return A.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:At=[],Ft=ze.getLineDecorations(Pt),Yt=Object(L.a)(Ft);try{for(Yt.s();!(G=Yt.n()).done;)E=G.value,E.options.linesDecorationsClassName==="breakpoints"&&At.push(E.id)}catch(Q){Yt.e(Q)}finally{Yt.f()}return z.next=6,Ye.deltaDecorations(At,[]);case 6:gt();case 7:case"end":return z.stop()}},xt)}));return function(Pt){return Xe.apply(this,arguments)}}(),lt=function(xt){var Pt=ze.getLineDecorations(xt),At=Object(L.a)(Pt),Ft;try{for(At.s();!(Ft=At.n()).done;){var Yt=Ft.value;if(Yt.options.linesDecorationsClassName==="breakpoints")return!0}}catch(G){At.e(G)}finally{At.f()}return!1};if(!Object(r.isEqual)(Ue,gt(!0).lines)){Ye.deltaDecorations(gt(!0).ids,[]);var Jt=Ue.map(function(Xe){return{range:new T.Range(Xe,1,Xe,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});Ye.deltaDecorations([],Jt)}var vr=ze.onDidChangeModelContent(function(Xe){var xt=ze.getPosition();if(xt){var Pt=xt.lineNumber;Ye.getLineContent(Pt).trim()===""?Et(Pt):lt(Pt)&&(Et(Pt),Mt(Pt))}}),$t=ze.onMouseDown(function(Xe){var xt,Pt,At;if(Xe.target.detail&&(xt=Xe.target)!==null&&xt!==void 0&&(Pt=xt.element)!==null&&Pt!==void 0&&(At=Pt.className)!==null&&At!==void 0&&At.includes("line-numbers")){var Ft=Xe.target.position.lineNumber;if(Ye.getLineContent(Ft).trim()==="")return;lt(Ft)?Et(Ft):Mt(Ft)}}),vt=function(xt){var Pt={range:new T.Range(xt,1,xt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Ke.current=ze.deltaDecorations(Ke.current,[Pt])},zt=function(){Ke.current=ze.deltaDecorations(Ke.current,[])},Qt=ze.onMouseMove(function(Xe){var xt,Pt,At;if(zt(),Xe.target.detail&&(xt=Xe.target)!==null&&xt!==void 0&&(Pt=xt.element)!==null&&Pt!==void 0&&(At=Pt.className)!==null&&At!==void 0&&At.includes("line-numbers")){var Ft=Xe.target.position.lineNumber;if(Ye.getLineContent(Ft).trim()==="")return;vt(Ft)}}),or=ze.onMouseLeave(function(){zt()});return function(){vr.dispose(),$t.dispose(),Qt.dispose(),or.dispose()}}},[We.current,re,Ue,nt,mt]);function Ge(){var Ze=We.current.instance;if(Ze){var ze=Ze.getSelection(),Ye=We.current.pastePos||{},ot=new T.Range(Ye.startLineNumber||ze.endLineNumber,Ye.startColumn||ze.endColumn,Ye.endLineNumber||ze.endLineNumber,Ye.endColumn||ze.endColumn);setTimeout(function(){Ze.executeEdits("",[{range:ot,text:""}])},300)}}function Qe(Ze){(window.navigator.platform.match("Mac")?Ze.metaKey:Ze.ctrlKey)&&Ze.keyCode==83&&(Ze.preventDefault(),me())}var dt=function(){if(pe&&We.current.instance){var ze=We.current.instance.getContentHeight();Nt(ze<O?O:ze)}else Nt(O)};function rt(Ze){var ze=document.createEvent("MouseEvents");ze.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ze.dispatchEvent(ze)}var ht=function(ze){var Ye=ze.keyCode,ot=ze.ctrlKey,gt=ze.metaKey,Mt=ze.target,Et=ze.type;return(Et==="paste"||(Ye===67||Ye===86)&&(gt||ot))&&Mt.nodeName==="TEXTAREA"&&(Ie(),ze.preventDefault()),!1};function ft(Ze,ze){var Ye=window.URL||window.webkitURL||window,ot=new Blob([ze]),gt=document.createElementNS("http://www.w3.org/1999/xhtml","a");gt.href=Ye.createObjectURL(ot),gt.download=Ze,rt(gt)}Object(h.useEffect)(function(){dt()},[dt]),Object(h.useEffect)(function(){Le.current&&!re&&W.e(27).then(W.t.bind(null,"M/lh",7)).then(function(Ze){try{T=Ze,We.current.instance=T.editor.create(Le.current,{value:M,language:D(j),theme:Ae,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},he);var ze=We.current.instance,Ye=a.c._menuItems,ot=Object(V.a)(Ye).find(function(Mt){return Mt[0]._debugName=="EditorContext"});if(ve(ze,T),setTimeout(function(){dt(),We.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ft(Be||"educoder.txt",ze.getValue())}}),ze.getDomNode().addEventListener("input",function(){Ve.current.autoFormat&&ze.getAction("editor.action.formatDocument").run()})},500),We.current.subscription=ze.onDidChangeModelContent(function(Mt){debugger;we.current?clearTimeout(ye.current):(dt(),te(ze.getValue(),Mt)),ye.current=setTimeout(function(){we.current=!1},500)}),window.Monaco||f(T,D(j)),ce&&(Le.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",ht),window.removeEventListener("paste",ht),window.addEventListener("keydown",ht),window.addEventListener("paste",ht)),window.Monaco=T,Oe&&ze.onDidBlurEditorWidget(function(){Oe(ze.getValue())}),oe&&ze.onDidFocusEditorText(function(){oe(ze.getValue())}),ce)try{window.addEventListener("paste",Ge)}catch(Mt){}var gt=Ce();return be(!0),function(){var Mt=We.current.instance;Mt.dispose();var Et=Mt.getModel();Et&&Et.dispose(),We.current.subscription&&We.current.subscription.dispose(),ce&&window.removeEventListener("paste",Ge),gt.unobserve(Le.current)}}catch(Mt){debugger}})},[]),Object(h.useEffect)(function(){var Ze=We.current.instance;if(Ze&&re)return document.addEventListener("keydown",Qe,!1),function(){document.removeEventListener("keydown",Qe)}},[me,re]),Object(h.useEffect)(function(){var Ze=We.current.instance;if(Ze&&re){var ze=D(j);T.editor.setModelLanguage(Ze.getModel(),ze)}},[j,re]),Object(h.useEffect)(function(){var Ze=We.current.instance;Ze&&re&&T.editor.setTheme(Ae)},[Ae,re]),Object(h.useEffect)(function(){var Ze=We.current.instance;Ve.current=J,Ze&&re&&(Ze.updateOptions(Object(ue.a)({},J)),setTimeout(function(){Ze.getModel().updateOptions(Object(ue.a)({},J))},200))},[JSON.stringify(J),re]),Object(h.useEffect)(function(){var Ze=We.current.instance;Ze&&re&&Ze.layout()},[S,O,re]);var at=Object(h.useState)(l(S)),Dt=Object(K.a)(at,2),Lt=Dt[0],Tt=Dt[1],Rt=Object(h.useState)(l(O)),wt=Object(K.a)(Rt,2),Ut=wt[0],Nt=wt[1],qe=Object(ue.a)(Object(ue.a)({},I),{},{width:Lt,height:Ut});return y.a.createElement("div",{className:"my-monaco-editor",ref:Le,style:qe})};function v(u){var s=u.width,S=s===void 0?"100%":s,c=u.height,O=c===void 0?"100%":c,M=u.original,B=u.modified,j=u.language,H=u.options,I=H===void 0?{}:H,U=Object(h.useRef)(),J=Object(h.useState)(null),ne=Object(K.a)(J,2),he=ne[0],Ee=ne[1];function Ae(pe){var se;return U.current&&(se=new w.default(function(ce){var Z=Object(L.a)(ce),te;try{for(Z.s();!(te=Z.n()).done;){var le=te.value;(le.target.offsetHeight>0||le.target.offsetWidth>0)&&pe.layout()}}catch(ve){Z.e(ve)}finally{Z.f()}}),se.observe(U.current)),se}Object(h.useEffect)(function(){return U.current&&W.e(27).then(W.t.bind(null,"M/lh",7)).then(function(pe){T=pe;var se=T.editor.createDiffEditor(U.current,Object(ue.a)(Object(ue.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},I),{},{wordWrap:!0}));Ee(se);var ce=Ae(se);return function(){se.dispose();var Z=se.getModel();Z&&Z.dispose(),ce.unobserve(U.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(h.useEffect)(function(){he&&he.setModel({original:T.editor.createModel(M,j),modified:T.editor.createModel(B,j)})},[M,B,j,he]);var Oe=l(S),me=l(O),de={width:Oe,height:me};return y.a.createElement("div",{className:"my-diff-editor",ref:U,style:de})}},ZpRC:function(ct,Te,W){"use strict";function ue(h){return typeof h=="object"&&h!=null&&h.nodeType===1}function V(h,y){return(!y||h!=="hidden")&&h!=="visible"&&h!=="clip"}function P(h,y){if(h.clientHeight<h.scrollHeight||h.clientWidth<h.scrollWidth){var w=getComputedStyle(h,null);return V(w.overflowY,y)||V(w.overflowX,y)||function(p){var f=function(g){if(!g.ownerDocument||!g.ownerDocument.defaultView)return null;try{return g.ownerDocument.defaultView.frameElement}catch(a){return null}}(p);return!!f&&(f.clientHeight<p.scrollHeight||f.clientWidth<p.scrollWidth)}(h)}return!1}function $(h,y,w,p,f,g,a,r){return g<h&&a>y||g>h&&a<y?0:g<=h&&r<=w||a>=y&&r>=w?g-h-p:a>y&&r<w||g<h&&r>w?a-y+f:0}var N=function(h,y){var w=window,p=y.scrollMode,f=y.block,g=y.inline,a=y.boundary,r=y.skipOverflowHiddenElements,o=typeof a=="function"?a:function(_e){return _e!==a};if(!ue(h))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,C=[],b=h;ue(b)&&o(b);){if((b=b.parentElement)===l){C.push(b);break}b!=null&&b===document.body&&P(b)&&!P(document.documentElement)||b!=null&&P(b,r)&&C.push(b)}for(var x=w.visualViewport?w.visualViewport.width:innerWidth,D=w.visualViewport?w.visualViewport.height:innerHeight,T=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,v=h.getBoundingClientRect(),u=v.height,s=v.width,S=v.top,c=v.right,O=v.bottom,M=v.left,B=f==="start"||f==="nearest"?S:f==="end"?O:S+u/2,j=g==="center"?M+s/2:g==="end"?c:M,H=[],I=0;I<C.length;I++){var U=C[I],J=U.getBoundingClientRect(),ne=J.height,he=J.width,Ee=J.top,Ae=J.right,Oe=J.bottom,me=J.left;if(p==="if-needed"&&S>=0&&M>=0&&O<=D&&c<=x&&S>=Ee&&O<=Oe&&M>=me&&c<=Ae)return H;var de=getComputedStyle(U),pe=parseInt(de.borderLeftWidth,10),se=parseInt(de.borderTopWidth,10),ce=parseInt(de.borderRightWidth,10),Z=parseInt(de.borderBottomWidth,10),te=0,le=0,ve="offsetWidth"in U?U.offsetWidth-U.clientWidth-pe-ce:0,ie="offsetHeight"in U?U.offsetHeight-U.clientHeight-se-Z:0;if(l===U)te=f==="start"?B:f==="end"?B-D:f==="nearest"?$(m,m+D,D,se,Z,m+B,m+B+u,u):B-D/2,le=g==="start"?j:g==="center"?j-x/2:g==="end"?j-x:$(T,T+x,x,pe,ce,T+j,T+j+s,s),te=Math.max(0,te+m),le=Math.max(0,le+T);else{te=f==="start"?B-Ee-se:f==="end"?B-Oe+Z+ie:f==="nearest"?$(Ee,Oe,ne,se,Z+ie,B,B+u,u):B-(Ee+ne/2)+ie/2,le=g==="start"?j-me-pe:g==="center"?j-(me+he/2)+ve/2:g==="end"?j-Ae+ce+ve:$(me,Ae,he,pe,ce+ve,j,j+s,s);var oe=U.scrollLeft,xe=U.scrollTop;B+=xe-(te=Math.max(0,Math.min(xe+te,U.scrollHeight-ne+ie))),j+=oe-(le=Math.max(0,Math.min(oe+le,U.scrollWidth-he+ve)))}H.push({el:U,top:te,left:le})}return H};function L(h){return h===Object(h)&&Object.keys(h).length!==0}function K(h,y){y===void 0&&(y="auto");var w="scrollBehavior"in document.body.style;h.forEach(function(p){var f=p.el,g=p.top,a=p.left;f.scroll&&w?f.scroll({top:g,left:a,behavior:y}):(f.scrollTop=g,f.scrollLeft=a)})}function F(h){return h===!1?{block:"end",inline:"nearest"}:L(h)?h:{block:"start",inline:"nearest"}}function R(h,y){var w=!h.ownerDocument.documentElement.contains(h);if(L(y)&&typeof y.behavior=="function")return y.behavior(w?[]:N(h,y));if(w)return;var p=F(y);return K(N(h,p),p.behavior)}var A=Te.a=R},Zss7:function(ct,Te,W){var ue;(function(V){var P=/^\s+/,$=/\s+$/,N=0,L=V.round,K=V.min,F=V.max,R=V.random;function A(Z,te){if(Z=Z||"",te=te||{},Z instanceof A)return Z;if(!(this instanceof A))return new A(Z,te);var le=h(Z);this._originalInput=Z,this._r=le.r,this._g=le.g,this._b=le.b,this._a=le.a,this._roundA=L(100*this._a)/100,this._format=te.format||le.format,this._gradientType=te.gradientType,this._r<1&&(this._r=L(this._r)),this._g<1&&(this._g=L(this._g)),this._b<1&&(this._b=L(this._b)),this._ok=le.ok,this._tc_id=N++}A.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var Z=this.toRgb();return(Z.r*299+Z.g*587+Z.b*114)/1e3},getLuminance:function(){var Z=this.toRgb(),te,le,ve,ie,oe,xe;return te=Z.r/255,le=Z.g/255,ve=Z.b/255,te<=.03928?ie=te/12.92:ie=V.pow((te+.055)/1.055,2.4),le<=.03928?oe=le/12.92:oe=V.pow((le+.055)/1.055,2.4),ve<=.03928?xe=ve/12.92:xe=V.pow((ve+.055)/1.055,2.4),.2126*ie+.7152*oe+.0722*xe},setAlpha:function(Z){return this._a=H(Z),this._roundA=L(100*this._a)/100,this},toHsv:function(){var Z=f(this._r,this._g,this._b);return{h:Z.h*360,s:Z.s,v:Z.v,a:this._a}},toHsvString:function(){var Z=f(this._r,this._g,this._b),te=L(Z.h*360),le=L(Z.s*100),ve=L(Z.v*100);return this._a==1?"hsv("+te+", "+le+"%, "+ve+"%)":"hsva("+te+", "+le+"%, "+ve+"%, "+this._roundA+")"},toHsl:function(){var Z=w(this._r,this._g,this._b);return{h:Z.h*360,s:Z.s,l:Z.l,a:this._a}},toHslString:function(){var Z=w(this._r,this._g,this._b),te=L(Z.h*360),le=L(Z.s*100),ve=L(Z.l*100);return this._a==1?"hsl("+te+", "+le+"%, "+ve+"%)":"hsla("+te+", "+le+"%, "+ve+"%, "+this._roundA+")"},toHex:function(Z){return a(this._r,this._g,this._b,Z)},toHexString:function(Z){return"#"+this.toHex(Z)},toHex8:function(Z){return r(this._r,this._g,this._b,this._a,Z)},toHex8String:function(Z){return"#"+this.toHex8(Z)},toRgb:function(){return{r:L(this._r),g:L(this._g),b:L(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+L(this._r)+", "+L(this._g)+", "+L(this._b)+")":"rgba("+L(this._r)+", "+L(this._g)+", "+L(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:L(I(this._r,255)*100)+"%",g:L(I(this._g,255)*100)+"%",b:L(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+L(I(this._r,255)*100)+"%, "+L(I(this._g,255)*100)+"%, "+L(I(this._b,255)*100)+"%)":"rgba("+L(I(this._r,255)*100)+"%, "+L(I(this._g,255)*100)+"%, "+L(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:B[a(this._r,this._g,this._b,!0)]||!1},toFilter:function(Z){var te="#"+o(this._r,this._g,this._b,this._a),le=te,ve=this._gradientType?"GradientType = 1, ":"";if(Z){var ie=A(Z);le="#"+o(ie._r,ie._g,ie._b,ie._a)}return"progid:DXImageTransform.Microsoft.gradient("+ve+"startColorstr="+te+",endColorstr="+le+")"},toString:function(Z){var te=!!Z;Z=Z||this._format;var le=!1,ve=this._a<1&&this._a>=0,ie=!te&&ve&&(Z==="hex"||Z==="hex6"||Z==="hex3"||Z==="hex4"||Z==="hex8"||Z==="name");return ie?Z==="name"&&this._a===0?this.toName():this.toRgbString():(Z==="rgb"&&(le=this.toRgbString()),Z==="prgb"&&(le=this.toPercentageRgbString()),(Z==="hex"||Z==="hex6")&&(le=this.toHexString()),Z==="hex3"&&(le=this.toHexString(!0)),Z==="hex4"&&(le=this.toHex8String(!0)),Z==="hex8"&&(le=this.toHex8String()),Z==="name"&&(le=this.toName()),Z==="hsl"&&(le=this.toHslString()),Z==="hsv"&&(le=this.toHsvString()),le||this.toHexString())},clone:function(){return A(this.toString())},_applyModification:function(Z,te){var le=Z.apply(null,[this].concat([].slice.call(te)));return this._r=le._r,this._g=le._g,this._b=le._b,this.setAlpha(le._a),this},lighten:function(){return this._applyModification(x,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(T,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(C,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(Z,te){return Z.apply(null,[this].concat([].slice.call(te)))},analogous:function(){return this._applyCombination(c,arguments)},complement:function(){return this._applyCombination(v,arguments)},monochromatic:function(){return this._applyCombination(O,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(u,arguments)},tetrad:function(){return this._applyCombination(s,arguments)}},A.fromRatio=function(Z,te){if(typeof Z=="object"){var le={};for(var ve in Z)Z.hasOwnProperty(ve)&&(ve==="a"?le[ve]=Z[ve]:le[ve]=Ae(Z[ve]));Z=le}return A(Z,te)};function h(Z){var te={r:0,g:0,b:0},le=1,ve=null,ie=null,oe=null,xe=!1,_e=!1;return typeof Z=="string"&&(Z=se(Z)),typeof Z=="object"&&(pe(Z.r)&&pe(Z.g)&&pe(Z.b)?(te=y(Z.r,Z.g,Z.b),xe=!0,_e=String(Z.r).substr(-1)==="%"?"prgb":"rgb"):pe(Z.h)&&pe(Z.s)&&pe(Z.v)?(ve=Ae(Z.s),ie=Ae(Z.v),te=g(Z.h,ve,ie),xe=!0,_e="hsv"):pe(Z.h)&&pe(Z.s)&&pe(Z.l)&&(ve=Ae(Z.s),oe=Ae(Z.l),te=p(Z.h,ve,oe),xe=!0,_e="hsl"),Z.hasOwnProperty("a")&&(le=Z.a)),le=H(le),{ok:xe,format:Z.format||_e,r:K(255,F(te.r,0)),g:K(255,F(te.g,0)),b:K(255,F(te.b,0)),a:le}}function y(Z,te,le){return{r:I(Z,255)*255,g:I(te,255)*255,b:I(le,255)*255}}function w(Z,te,le){Z=I(Z,255),te=I(te,255),le=I(le,255);var ve=F(Z,te,le),ie=K(Z,te,le),oe,xe,_e=(ve+ie)/2;if(ve==ie)oe=xe=0;else{var Me=ve-ie;xe=_e>.5?Me/(2-ve-ie):Me/(ve+ie);switch(ve){case Z:oe=(te-le)/Me+(te<le?6:0);break;case te:oe=(le-Z)/Me+2;break;case le:oe=(Z-te)/Me+4;break}oe/=6}return{h:oe,s:xe,l:_e}}function p(Z,te,le){var ve,ie,oe;Z=I(Z,360),te=I(te,100),le=I(le,100);function xe(Ue,He,Be){return Be<0&&(Be+=1),Be>1&&(Be-=1),Be<1/6?Ue+(He-Ue)*6*Be:Be<1/2?He:Be<2/3?Ue+(He-Ue)*(2/3-Be)*6:Ue}if(te===0)ve=ie=oe=le;else{var _e=le<.5?le*(1+te):le+te-le*te,Me=2*le-_e;ve=xe(Me,_e,Z+1/3),ie=xe(Me,_e,Z),oe=xe(Me,_e,Z-1/3)}return{r:ve*255,g:ie*255,b:oe*255}}function f(Z,te,le){Z=I(Z,255),te=I(te,255),le=I(le,255);var ve=F(Z,te,le),ie=K(Z,te,le),oe,xe,_e=ve,Me=ve-ie;if(xe=ve===0?0:Me/ve,ve==ie)oe=0;else{switch(ve){case Z:oe=(te-le)/Me+(te<le?6:0);break;case te:oe=(le-Z)/Me+2;break;case le:oe=(Z-te)/Me+4;break}oe/=6}return{h:oe,s:xe,v:_e}}function g(Z,te,le){Z=I(Z,360)*6,te=I(te,100),le=I(le,100);var ve=V.floor(Z),ie=Z-ve,oe=le*(1-te),xe=le*(1-ie*te),_e=le*(1-(1-ie)*te),Me=ve%6,Ue=[le,xe,oe,oe,_e,le][Me],He=[_e,le,le,xe,oe,oe][Me],Be=[oe,oe,_e,le,le,xe][Me];return{r:Ue*255,g:He*255,b:Be*255}}function a(Z,te,le,ve){var ie=[Ee(L(Z).toString(16)),Ee(L(te).toString(16)),Ee(L(le).toString(16))];return ve&&ie[0].charAt(0)==ie[0].charAt(1)&&ie[1].charAt(0)==ie[1].charAt(1)&&ie[2].charAt(0)==ie[2].charAt(1)?ie[0].charAt(0)+ie[1].charAt(0)+ie[2].charAt(0):ie.join("")}function r(Z,te,le,ve,ie){var oe=[Ee(L(Z).toString(16)),Ee(L(te).toString(16)),Ee(L(le).toString(16)),Ee(Oe(ve))];return ie&&oe[0].charAt(0)==oe[0].charAt(1)&&oe[1].charAt(0)==oe[1].charAt(1)&&oe[2].charAt(0)==oe[2].charAt(1)&&oe[3].charAt(0)==oe[3].charAt(1)?oe[0].charAt(0)+oe[1].charAt(0)+oe[2].charAt(0)+oe[3].charAt(0):oe.join("")}function o(Z,te,le,ve){var ie=[Ee(Oe(ve)),Ee(L(Z).toString(16)),Ee(L(te).toString(16)),Ee(L(le).toString(16))];return ie.join("")}A.equals=function(Z,te){return!Z||!te?!1:A(Z).toRgbString()==A(te).toRgbString()},A.random=function(){return A.fromRatio({r:R(),g:R(),b:R()})};function l(Z,te){te=te===0?0:te||10;var le=A(Z).toHsl();return le.s-=te/100,le.s=U(le.s),A(le)}function C(Z,te){te=te===0?0:te||10;var le=A(Z).toHsl();return le.s+=te/100,le.s=U(le.s),A(le)}function b(Z){return A(Z).desaturate(100)}function x(Z,te){te=te===0?0:te||10;var le=A(Z).toHsl();return le.l+=te/100,le.l=U(le.l),A(le)}function D(Z,te){te=te===0?0:te||10;var le=A(Z).toRgb();return le.r=F(0,K(255,le.r-L(255*-(te/100)))),le.g=F(0,K(255,le.g-L(255*-(te/100)))),le.b=F(0,K(255,le.b-L(255*-(te/100)))),A(le)}function T(Z,te){te=te===0?0:te||10;var le=A(Z).toHsl();return le.l-=te/100,le.l=U(le.l),A(le)}function m(Z,te){var le=A(Z).toHsl(),ve=(le.h+te)%360;return le.h=ve<0?360+ve:ve,A(le)}function v(Z){var te=A(Z).toHsl();return te.h=(te.h+180)%360,A(te)}function u(Z){var te=A(Z).toHsl(),le=te.h;return[A(Z),A({h:(le+120)%360,s:te.s,l:te.l}),A({h:(le+240)%360,s:te.s,l:te.l})]}function s(Z){var te=A(Z).toHsl(),le=te.h;return[A(Z),A({h:(le+90)%360,s:te.s,l:te.l}),A({h:(le+180)%360,s:te.s,l:te.l}),A({h:(le+270)%360,s:te.s,l:te.l})]}function S(Z){var te=A(Z).toHsl(),le=te.h;return[A(Z),A({h:(le+72)%360,s:te.s,l:te.l}),A({h:(le+216)%360,s:te.s,l:te.l})]}function c(Z,te,le){te=te||6,le=le||30;var ve=A(Z).toHsl(),ie=360/le,oe=[A(Z)];for(ve.h=(ve.h-(ie*te>>1)+720)%360;--te;)ve.h=(ve.h+ie)%360,oe.push(A(ve));return oe}function O(Z,te){te=te||6;for(var le=A(Z).toHsv(),ve=le.h,ie=le.s,oe=le.v,xe=[],_e=1/te;te--;)xe.push(A({h:ve,s:ie,v:oe})),oe=(oe+_e)%1;return xe}A.mix=function(Z,te,le){le=le===0?0:le||50;var ve=A(Z).toRgb(),ie=A(te).toRgb(),oe=le/100,xe={r:(ie.r-ve.r)*oe+ve.r,g:(ie.g-ve.g)*oe+ve.g,b:(ie.b-ve.b)*oe+ve.b,a:(ie.a-ve.a)*oe+ve.a};return A(xe)},A.readability=function(Z,te){var le=A(Z),ve=A(te);return(V.max(le.getLuminance(),ve.getLuminance())+.05)/(V.min(le.getLuminance(),ve.getLuminance())+.05)},A.isReadable=function(Z,te,le){var ve=A.readability(Z,te),ie,oe;oe=!1,ie=ce(le);switch(ie.level+ie.size){case"AAsmall":case"AAAlarge":oe=ve>=4.5;break;case"AAlarge":oe=ve>=3;break;case"AAAsmall":oe=ve>=7;break}return oe},A.mostReadable=function(Z,te,le){var ve=null,ie=0,oe,xe,_e,Me;le=le||{},xe=le.includeFallbackColors,_e=le.level,Me=le.size;for(var Ue=0;Ue<te.length;Ue++)oe=A.readability(Z,te[Ue]),oe>ie&&(ie=oe,ve=A(te[Ue]));return A.isReadable(Z,ve,{level:_e,size:Me})||!xe?ve:(le.includeFallbackColors=!1,A.mostReadable(Z,["#fff","#000"],le))};var M=A.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},B=A.hexNames=j(M);function j(Z){var te={};for(var le in Z)Z.hasOwnProperty(le)&&(te[Z[le]]=le);return te}function H(Z){return Z=parseFloat(Z),(isNaN(Z)||Z<0||Z>1)&&(Z=1),Z}function I(Z,te){ne(Z)&&(Z="100%");var le=he(Z);return Z=K(te,F(0,parseFloat(Z))),le&&(Z=parseInt(Z*te,10)/100),V.abs(Z-te)<1e-6?1:Z%te/parseFloat(te)}function U(Z){return K(1,F(0,Z))}function J(Z){return parseInt(Z,16)}function ne(Z){return typeof Z=="string"&&Z.indexOf(".")!=-1&&parseFloat(Z)===1}function he(Z){return typeof Z=="string"&&Z.indexOf("%")!=-1}function Ee(Z){return Z.length==1?"0"+Z:""+Z}function Ae(Z){return Z<=1&&(Z=Z*100+"%"),Z}function Oe(Z){return V.round(parseFloat(Z)*255).toString(16)}function me(Z){return J(Z)/255}var de=function(){var Z="[-\\+]?\\d+%?",te="[-\\+]?\\d*\\.\\d+%?",le="(?:"+te+")|(?:"+Z+")",ve="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?",ie="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?";return{CSS_UNIT:new RegExp(le),rgb:new RegExp("rgb"+ve),rgba:new RegExp("rgba"+ie),hsl:new RegExp("hsl"+ve),hsla:new RegExp("hsla"+ie),hsv:new RegExp("hsv"+ve),hsva:new RegExp("hsva"+ie),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function pe(Z){return!!de.CSS_UNIT.exec(Z)}function se(Z){Z=Z.replace(P,"").replace($,"").toLowerCase();var te=!1;if(M[Z])Z=M[Z],te=!0;else if(Z=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var le;return(le=de.rgb.exec(Z))?{r:le[1],g:le[2],b:le[3]}:(le=de.rgba.exec(Z))?{r:le[1],g:le[2],b:le[3],a:le[4]}:(le=de.hsl.exec(Z))?{h:le[1],s:le[2],l:le[3]}:(le=de.hsla.exec(Z))?{h:le[1],s:le[2],l:le[3],a:le[4]}:(le=de.hsv.exec(Z))?{h:le[1],s:le[2],v:le[3]}:(le=de.hsva.exec(Z))?{h:le[1],s:le[2],v:le[3],a:le[4]}:(le=de.hex8.exec(Z))?{r:J(le[1]),g:J(le[2]),b:J(le[3]),a:me(le[4]),format:te?"name":"hex8"}:(le=de.hex6.exec(Z))?{r:J(le[1]),g:J(le[2]),b:J(le[3]),format:te?"name":"hex"}:(le=de.hex4.exec(Z))?{r:J(le[1]+""+le[1]),g:J(le[2]+""+le[2]),b:J(le[3]+""+le[3]),a:me(le[4]+""+le[4]),format:te?"name":"hex8"}:(le=de.hex3.exec(Z))?{r:J(le[1]+""+le[1]),g:J(le[2]+""+le[2]),b:J(le[3]+""+le[3]),format:te?"name":"hex"}:!1}function ce(Z){var te,le;return Z=Z||{level:"AA",size:"small"},te=(Z.level||"AA").toUpperCase(),le=(Z.size||"small").toLowerCase(),te!=="AA"&&te!=="AAA"&&(te="AA"),le!=="small"&&le!=="large"&&(le="small"),{level:te,size:le}}ct.exports?ct.exports=A:!(ue=function(){return A}.call(Te,W,Te,ct),ue!==void 0&&(ct.exports=ue))})(Math)},bT9E:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return V});var ue=W("VTBJ");function V(P,$){var N=Object(ue.a)({},P);return Array.isArray($)&&$.forEach(function(L){delete N[L]}),N}},biw7:function(ct,Te,W){"use strict";var ue=W("q1tI"),V=W.n(ue),P=ue.createContext(null);Te.a=P},c5Ni:function(ct,Te,W){},dejd:function(ct,Te,W){},dmUQ:function(ct,Te,W){"use strict";var ue=W("Ff2n"),V=W("rePB"),P=W("1OyB"),$=W("vuIU"),N=W("Ji7U"),L=W("md7G"),K=W("foSv"),F=W("q1tI"),R=W.n(F),A=W("TSYQ"),h=W.n(A),y=W("4IlW");function w(u,s){var S=Object.keys(u);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(u);s&&(c=c.filter(function(O){return Object.getOwnPropertyDescriptor(u,O).enumerable})),S.push.apply(S,c)}return S}function p(u){for(var s=1;s<arguments.length;s++){var S=arguments[s]!=null?arguments[s]:{};s%2?w(Object(S),!0).forEach(function(c){Object(V.a)(u,c,S[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(S)):w(Object(S)).forEach(function(c){Object.defineProperty(u,c,Object.getOwnPropertyDescriptor(S,c))})}return u}function f(u){var s=g();return function(){var c=Object(K.a)(u),O;if(s){var M=Object(K.a)(this).constructor;O=Reflect.construct(c,arguments,M)}else O=c.apply(this,arguments);return Object(L.a)(this,O)}}function g(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(u){return!1}}function a(){}function r(u){u.preventDefault()}var o=function(s){return s.replace(/[^\w.-]+/g,"")},l=200,C=600,b=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(s){return s!=null},D=function(s,S){return S===s||typeof S=="number"&&typeof s=="number"&&isNaN(S)&&isNaN(s)},T=function(u){Object(N.a)(S,u);var s=f(S);function S(c){var O;Object(P.a)(this,S),O=s.call(this,c),O.onKeyDown=function(j){var H=O.props,I=H.onKeyDown,U=H.onPressEnter;if(j.keyCode===y.a.UP){var J=O.getRatio(j);O.up(j,J,null),O.stop()}else if(j.keyCode===y.a.DOWN){var ne=O.getRatio(j);O.down(j,ne,null),O.stop()}else j.keyCode===y.a.ENTER&&U&&U(j);if(O.recordCursorPosition(),O.lastKeyCode=j.keyCode,I){for(var he=arguments.length,Ee=new Array(he>1?he-1:0),Ae=1;Ae<he;Ae++)Ee[Ae-1]=arguments[Ae];I.apply(void 0,[j].concat(Ee))}},O.onKeyUp=function(j){var H=O.props.onKeyUp;if(O.stop(),O.recordCursorPosition(),H){for(var I=arguments.length,U=new Array(I>1?I-1:0),J=1;J<I;J++)U[J-1]=arguments[J];H.apply(void 0,[j].concat(U))}},O.onChange=function(j){var H=O.props.onChange;O.state.focused&&(O.inputting=!0),O.rawInput=O.props.parser(O.getValueFromEvent(j)),O.setState({inputValue:O.rawInput}),H(O.toNumber(O.rawInput))},O.onMouseUp=function(){var j=O.props.onMouseUp;O.recordCursorPosition(),j&&j.apply(void 0,arguments)},O.onFocus=function(){var j;O.setState({focused:!0}),(j=O.props).onFocus.apply(j,arguments)},O.onBlur=function(){var j=O.props.onBlur;O.inputting=!1,O.setState({focused:!1});var H=O.getCurrentValidValue(O.state.inputValue),I=O.setValue(H,a);if(j){var U=O.input.value,J=O.getInputDisplayValue({focus:!1,value:I});O.input.value=J&&Number(J),j.apply(void 0,arguments),O.input.value=U}},O.getRatio=function(j){var H=1;return j.metaKey||j.ctrlKey?H=.1:j.shiftKey&&(H=10),H},O.getFullNum=function(j){return isNaN(j)?j:/e/i.test(String(j))?Number(j).toFixed(18).replace(/\.?0+$/,""):j},O.getPrecision=function(j){if(x(O.props.precision))return O.props.precision;var H=String(j);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var I=0;return H.indexOf(".")>=0&&(I=H.length-H.indexOf(".")-1),I},O.getInputDisplayValue=function(j){var H=j||O.state,I=H.focused,U=H.inputValue,J=H.value,ne;I?ne=U:ne=O.toPrecisionAsStep(J),ne==null&&(ne="");var he=O.formatWrapper(ne);return x(O.props.decimalSeparator)&&(he=he.toString().replace(".",O.props.decimalSeparator)),he},O.recordCursorPosition=function(){try{O.cursorStart=O.input.selectionStart,O.cursorEnd=O.input.selectionEnd,O.currentValue=O.input.value,O.cursorBefore=O.input.value.substring(0,O.cursorStart),O.cursorAfter=O.input.value.substring(O.cursorEnd)}catch(j){}},O.restoreByAfter=function(j){if(j===void 0)return!1;var H=O.input.value,I=H.lastIndexOf(j);if(I===-1)return!1;var U=O.cursorBefore.length;return O.lastKeyCode===y.a.DELETE&&O.cursorBefore.charAt(U-1)===j[0]?(O.fixCaret(U,U),!0):I+j.length===H.length?(O.fixCaret(I,I),!0):!1},O.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(H,I){var U=j.substring(I);return O.restoreByAfter(U)})},O.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},O.stop=function(){O.autoStepTimer&&clearTimeout(O.autoStepTimer)},O.down=function(j,H,I){O.pressingUpOrDown=!0,O.step("down",j,H,I)},O.up=function(j,H,I){O.pressingUpOrDown=!0,O.step("up",j,H,I)},O.saveInput=function(j){O.input=j};var M=c.value;M===void 0&&(M=c.defaultValue),O.state={focused:c.autoFocus};var B=O.getValidValue(O.toNumber(M));return O.state=p(p({},O.state),{},{inputValue:O.toPrecisionAsStep(B),value:B}),O}return Object($.a)(S,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(O){var M=this.props,B=M.value,j=M.onChange,H=M.max,I=M.min,U=this.state.focused;if(O){if(!D(O.value,B)||!D(O.max,H)||!D(O.min,I)){var J=U?B:this.getValidValue(B),ne;this.pressingUpOrDown?ne=J:this.inputting?ne=this.rawInput:ne=this.toPrecisionAsStep(J),this.setState({value:J,inputValue:ne})}var he="value"in this.props?B:this.state.value;"max"in this.props&&O.max!==H&&typeof he=="number"&&he>H&&j&&j(H),"min"in this.props&&O.min!==I&&typeof he=="number"&&he<I&&j&&j(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ee=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===y.a.BACKSPACE?Ee=this.cursorStart-1:this.lastKeyCode===y.a.DELETE&&(Ee=this.cursorStart):Ee=this.input.value.length,this.fixCaret(Ee,Ee)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case y.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case y.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ae){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(O){var M=O;return M===""?M="":this.isNotCompleteNumber(parseFloat(M))?M=this.state.value:M=this.getValidValue(M),this.toNumber(M)}},{key:"getValueFromEvent",value:function(O){var M=O.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(M=M.replace(this.props.decimalSeparator,".")),M}},{key:"getValidValue",value:function(O){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,j=parseFloat(O);return isNaN(j)?O:(j<M&&(j=M),j>B&&(j=B),j)}},{key:"setValue",value:function(O,M){var B=this.props.precision,j=this.isNotCompleteNumber(parseFloat(O))?null:parseFloat(O),H=this.state.value,I=H===void 0?null:H,U=this.state.inputValue,J=U===void 0?null:U,ne=typeof j=="number"?j.toFixed(B):"".concat(j),he=j!==I||ne!=="".concat(J);return"value"in this.props?(J=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:J},M)):this.setState({value:j,inputValue:this.toPrecisionAsStep(O)},M),he&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(O){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,j=B.precision,H=B.step;if(x(j))return j;var I=this.getPrecision(M),U=this.getPrecision(H),J=this.getPrecision(O);return O?Math.max(J,I+U):I+U}},{key:"getPrecisionFactor",value:function(O){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(O,M);return Math.pow(10,B)}},{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(O){return this.props.formatter?this.props.formatter(O):O}},{key:"toPrecisionAsStep",value:function(O){if(this.isNotCompleteNumber(O)||O==="")return O;var M=Math.abs(this.getMaxPrecision(O));return isNaN(M)?O.toString():Number(O).toFixed(M)}},{key:"toNumber",value:function(O){var M=this.props.precision,B=this.state.focused,j=O&&O.length>16&&B;return this.isNotCompleteNumber(O)||j?O:x(M)?Math.round(O*Math.pow(10,M))/Math.pow(10,M):Number(O)}},{key:"upStep",value:function(O,M){var B=this.props.step,j=this.getPrecisionFactor(O,M),H=Math.abs(this.getMaxPrecision(O,M)),I=((j*O+j*B*M)/j).toFixed(H);return this.toNumber(I)}},{key:"downStep",value:function(O,M){var B=this.props.step,j=this.getPrecisionFactor(O,M),H=Math.abs(this.getMaxPrecision(O,M)),I=((j*O-j*B*M)/j).toFixed(H);return this.toNumber(I)}},{key:"step",value:function(O,M){var B=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),M&&(M.persist(),M.preventDefault());var I=this.props;if(I.disabled)return;var U=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(U))return;var J=this["".concat(O,"Step")](U,j),ne=J>I.max||J<I.min;if(J>I.max?J=I.max:J<I.min&&(J=I.min),this.setValue(J,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),ne)return;this.autoStepTimer=setTimeout(function(){B[O](M,j,!0)},H?l:C)}},{key:"fixCaret",value:function(O,M){if(O===void 0||M===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,j=this.input.selectionEnd;(O!==B||M!==j)&&this.input.setSelectionRange(O,M)}catch(H){}}},{key:"render",value:function(){var O,M=this.props,B=M.prefixCls,j=M.disabled,H=M.readOnly,I=M.useTouch,U=M.autoComplete,J=M.upHandler,ne=M.downHandler,he=M.className,Ee=M.max,Ae=M.min,Oe=M.style,me=M.title,de=M.onMouseEnter,pe=M.onMouseLeave,se=M.onMouseOver,ce=M.onMouseOut,Z=M.required,te=M.onClick,le=M.tabIndex,ve=M.type,ie=M.placeholder,oe=M.id,xe=M.inputMode,_e=M.pattern,Me=M.step,Ue=M.maxLength,He=M.autoFocus,Be=M.name,tt=M.onPaste,Je=M.onInput,st=Object(ue.a)(M,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),nt=this.state,pt=nt.value,mt=nt.focused,ke=h()(B,(O={},Object(V.a)(O,he,!!he),Object(V.a)(O,"".concat(B,"-disabled"),j),Object(V.a)(O,"".concat(B,"-focused"),mt),O)),Le={};Object.keys(st).forEach(function(Ce){(Ce.substr(0,5)==="data-"||Ce.substr(0,5)==="aria-"||Ce==="role")&&(Le[Ce]=st[Ce])});var We=!H&&!j,Ve=this.getInputDisplayValue(null),Ne=(pt||pt===0)&&(isNaN(pt)||Number(pt)>=Ee),Ke=(pt||pt===0)&&(isNaN(pt)||Number(pt)<=Ae),we=Ne||j||H,ye=Ke||j||H,ge=h()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(V.a)({},"".concat(B,"-handler-up-disabled"),we)),ae=h()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(V.a)({},"".concat(B,"-handler-down-disabled"),ye)),re=I?{onTouchStart:we?a:this.up,onTouchEnd:this.stop}:{onMouseDown:we?a:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},be=I?{onTouchStart:ye?a:this.down,onTouchEnd:this.stop}:{onMouseDown:ye?a:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return R.a.createElement("div",{className:ke,style:Oe,title:me,onMouseEnter:de,onMouseLeave:pe,onMouseOver:se,onMouseOut:ce,onFocus:function(){return null},onBlur:function(){return null}},R.a.createElement("div",{className:"".concat(B,"-handler-wrap")},R.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Increase Value","aria-disabled":we,className:ge}),J||R.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:r})),R.a.createElement("span",Object.assign({unselectable:"on"},be,{role:"button","aria-label":"Decrease Value","aria-disabled":ye,className:ae}),ne||R.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:r}))),R.a.createElement("div",{className:"".concat(B,"-input-wrap")},R.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ae,"aria-valuemax":Ee,"aria-valuenow":pt,required:Z,type:ve,placeholder:ie,onPaste:tt,onClick:te,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:le,autoComplete:U,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:We?this.onKeyDown:a,onKeyUp:We?this.onKeyUp:a,autoFocus:He,maxLength:Ue,readOnly:H,disabled:j,max:Ee,min:Ae,step:Me,name:Be,title:me,id:oe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ve),pattern:_e,inputMode:xe,onInput:Je},Le))))}}]),S}(R.a.Component);T.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:b,min:-b,step:1,style:{},onChange:a,onKeyDown:a,onPressEnter:a,onFocus:a,onBlur:a,parser:o,required:!1,autoComplete:"off"};var m=T,v=Te.a=m},fAei:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return l.a});var ue=W("rePB"),V=W("VTBJ"),P=W("KQm4"),$=W("1OyB"),N=W("vuIU"),L=W("Ji7U"),K=W("LK+K"),F=W("q1tI"),R=W("4IlW"),A=W("Kwbf"),h=W("TSYQ"),y=W.n(h),w=W("sboe"),p=W("OZM5"),f=W("815F"),g=W("ODXe"),a=W("Ff2n"),r=W("+nKL"),o=W("8XRh"),l=W("WaYH"),C=function(Ae,Oe){var me=Ae.className,de=Ae.style,pe=Ae.motion,se=Ae.motionNodes,ce=Ae.motionType,Z=Ae.onMotionStart,te=Ae.onMotionEnd,le=Ae.active,ve=Ae.treeNodeRequiredProps,ie=Object(a.a)(Ae,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),oe=F.useState(!0),xe=Object(g.a)(oe,2),_e=xe[0],Me=xe[1],Ue=F.useContext(w.a),He=Ue.prefixCls,Be=F.useRef(!1),tt=function(){Be.current||te(),Be.current=!0};return Object(F.useEffect)(function(){se&&ce==="hide"&&_e&&Me(!1)},[se]),Object(F.useEffect)(function(){return se&&Z(),function(){se&&tt()}},[]),se?F.createElement(o.default,Object.assign({ref:Oe,visible:_e},pe,{motionAppear:ce==="show",onAppearEnd:tt,onLeaveEnd:tt}),function(Je,st){var nt=Je.className,pt=Je.style;return F.createElement("div",{ref:st,className:y()("".concat(He,"-treenode-motion"),nt),style:pt},se.map(function(mt){var ke=mt.data,Le=ke.key,We=Object(a.a)(ke,["key"]),Ve=mt.isStart,Ne=mt.isEnd;delete We.children;var Ke=Object(f.f)(Le,ve);return F.createElement(l.a,Object.assign({},We,Ke,{active:le,data:mt.data,key:Le,isStart:Ve,isEnd:Ne}))}))}):F.createElement(l.a,Object.assign({domRef:Oe,className:me,style:de},ie,{active:le}))};C.displayName="MotionTreeNode";var b=F.forwardRef(C),x=b;function D(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Oe=Ee.length,me=Ae.length;if(Math.abs(Oe-me)!==1)return{add:!1,key:null};function de(pe,se){var ce=new Map;pe.forEach(function(te){ce.set(te,!0)});var Z=se.filter(function(te){return!ce.has(te)});return Z.length===1?Z[0]:null}return Oe<me?{add:!0,key:de(Ee,Ae)}:{add:!1,key:de(Ae,Ee)}}function T(Ee,Ae,Oe){var me=Ee.findIndex(function(ce){var Z=ce.data;return Z.key===Oe}),de=Ee[me+1],pe=Ae.findIndex(function(ce){var Z=ce.data;return Z.key===Oe});if(de){var se=Ae.findIndex(function(ce){var Z=ce.data;return Z.key===de.data.key});return Ae.slice(pe+1,se)}return Ae.slice(pe+1)}var m={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},v=function(){},u="RC_TREE_MOTION_".concat(Math.random()),s={key:u},S={key:u,level:0,index:0,pos:"0",node:s},c={parent:null,children:[],pos:S.pos,data:s,isStart:[],isEnd:[]};function O(Ee,Ae,Oe,me){return Ae===!1||!Oe?Ee:Ee.slice(0,Math.ceil(Oe/me)+1)}function M(Ee){var Ae=Ee.data.key,Oe=Ee.pos;return Object(f.e)(Ae,Oe)}function B(Ee){for(var Ae=String(Ee.data.key),Oe=Ee;Oe.parent;)Oe=Oe.parent,Ae="".concat(Oe.data.key," > ").concat(Ae);return Ae}var j=function(Ae,Oe){var me=Ae.prefixCls,de=Ae.data,pe=Ae.selectable,se=Ae.checkable,ce=Ae.expandedKeys,Z=Ae.selectedKeys,te=Ae.checkedKeys,le=Ae.loadedKeys,ve=Ae.loadingKeys,ie=Ae.halfCheckedKeys,oe=Ae.keyEntities,xe=Ae.disabled,_e=Ae.dragging,Me=Ae.dragOverNodeKey,Ue=Ae.dropPosition,He=Ae.motion,Be=Ae.height,tt=Ae.itemHeight,Je=Ae.virtual,st=Ae.focusable,nt=Ae.activeItem,pt=Ae.focused,mt=Ae.tabIndex,ke=Ae.onKeyDown,Le=Ae.onFocus,We=Ae.onBlur,Ve=Ae.onActiveChange,Ne=Ae.onListChangeStart,Ke=Ae.onListChangeEnd,we=Object(a.a)(Ae,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),ye=F.useRef(null);F.useImperativeHandle(Oe,function(){return{scrollTo:function(Ye){ye.current.scrollTo(Ye)}}});var ge=F.useState(ce),ae=Object(g.a)(ge,2),re=ae[0],be=ae[1],Ce=F.useState(de),Ie=Object(g.a)(Ce,2),De=Ie[0],Ge=Ie[1],Qe=F.useState(de),dt=Object(g.a)(Qe,2),rt=dt[0],ht=dt[1],ft=F.useState([]),at=Object(g.a)(ft,2),Dt=at[0],Lt=at[1],Tt=F.useState(null),Rt=Object(g.a)(Tt,2),wt=Rt[0],Ut=Rt[1];function Nt(){Ge(de),ht(de),Lt([]),Ut(null),Ke()}F.useEffect(function(){be(ce);var ze=D(re,ce);if(ze.key!==null)if(ze.add){var Ye=De.findIndex(function(Jt){var vr=Jt.data.key;return vr===ze.key}),ot=O(T(De,de,ze.key),Je,Be,tt),gt=De.slice();gt.splice(Ye+1,0,c),ht(gt),Lt(ot),Ut("show")}else{var Mt=de.findIndex(function(Jt){var vr=Jt.data.key;return vr===ze.key}),Et=O(T(de,De,ze.key),Je,Be,tt),lt=de.slice();lt.splice(Mt+1,0,c),ht(lt),Lt(Et),Ut("hide")}else De!==de&&(Ge(de),ht(de))},[ce,de]),F.useEffect(function(){_e||Nt()},[_e]);var qe=He?rt:de,Ze={expandedKeys:ce,selectedKeys:Z,loadedKeys:le,loadingKeys:ve,checkedKeys:te,halfCheckedKeys:ie,dragOverNodeKey:Me,dropPosition:Ue,keyEntities:oe};return F.createElement(F.Fragment,null,pt&&nt&&F.createElement("span",{style:m,"aria-live":"assertive"},B(nt)),F.createElement("div",{role:"tree"},F.createElement("input",{style:m,disabled:st===!1||xe,tabIndex:st!==!1?mt:null,onKeyDown:ke,onFocus:Le,onBlur:We,value:"",onChange:v})),F.createElement(r.a,Object.assign({},we,{data:qe,itemKey:M,height:Be,fullHeight:!1,virtual:Je,itemHeight:tt,prefixCls:"".concat(me,"-list"),ref:ye}),function(ze){var Ye=ze.pos,ot=ze.data,gt=ot.key,Mt=Object(a.a)(ot,["key"]),Et=ze.isStart,lt=ze.isEnd,Jt=Object(f.e)(gt,Ye);delete Mt.children;var vr=Object(f.f)(Jt,Ze);return F.createElement(x,Object.assign({},Mt,vr,{active:nt&&gt===nt.data.key,pos:Ye,data:ze.data,isStart:Et,isEnd:lt,motion:He,motionNodes:gt===u?Dt:null,motionType:wt,onMotionStart:Ne,onMotionEnd:Nt,treeNodeRequiredProps:Ze,onMouseMove:function(){Ve(null)}}))}))},H=F.forwardRef(j);H.displayName="NodeList";var I=H,U=W("NvD2"),J=function(Ee){Object(L.a)(Oe,Ee);var Ae=Object(K.a)(Oe);function Oe(){var me;return Object($.a)(this,Oe),me=Ae.apply(this,arguments),me.destroyed=!1,me.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},me.listRef=F.createRef(),me.onNodeDragStart=function(de,pe){var se=me.state,ce=se.expandedKeys,Z=se.keyEntities,te=me.props.onDragStart,le=pe.props.eventKey;me.dragNode=pe;var ve=Object(p.b)(ce,le);me.setState({dragging:!0,dragNodesKeys:Object(p.g)(le,Z)}),me.setExpandedKeys(ve),te&&te({event:de,node:Object(f.b)(pe.props)})},me.onNodeDragEnter=function(de,pe){var se=me.state,ce=se.expandedKeys,Z=se.keyEntities,te=se.dragNodesKeys,le=me.props.onDragEnter,ve=pe.props,ie=ve.pos,oe=ve.eventKey;if(!me.dragNode||te.indexOf(oe)!==-1)return;var xe=Object(p.c)(de,pe);if(me.dragNode.props.eventKey===oe&&xe===0){me.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){me.setState({dragOverNodeKey:oe,dropPosition:xe}),me.delayedDragEnterLogic||(me.delayedDragEnterLogic={}),Object.keys(me.delayedDragEnterLogic).forEach(function(_e){clearTimeout(me.delayedDragEnterLogic[_e])}),me.delayedDragEnterLogic[ie]=window.setTimeout(function(){if(!me.state.dragging)return;var _e=Object(P.a)(ce),Me=Z[oe];Me&&(Me.children||[]).length&&(_e=Object(p.a)(ce,oe)),"expandedKeys"in me.props||me.setExpandedKeys(_e),le&&le({event:de,node:Object(f.b)(pe.props),expandedKeys:_e})},400)},0)},me.onNodeDragOver=function(de,pe){var se=me.state.dragNodesKeys,ce=me.props.onDragOver,Z=pe.props.eventKey;if(se.indexOf(Z)!==-1)return;if(me.dragNode&&Z===me.state.dragOverNodeKey){var te=Object(p.c)(de,pe);if(te===me.state.dropPosition)return;me.setState({dropPosition:te})}ce&&ce({event:de,node:Object(f.b)(pe.props)})},me.onNodeDragLeave=function(de,pe){var se=me.props.onDragLeave;me.setState({dragOverNodeKey:""}),se&&se({event:de,node:Object(f.b)(pe.props)})},me.onNodeDragEnd=function(de,pe){var se=me.props.onDragEnd;me.setState({dragOverNodeKey:""}),me.cleanDragState(),se&&se({event:de,node:Object(f.b)(pe.props)}),me.dragNode=null},me.onNodeDrop=function(de,pe){var se=me.state,ce=se.dragNodesKeys,Z=ce===void 0?[]:ce,te=se.dropPosition,le=me.props.onDrop,ve=pe.props,ie=ve.eventKey,oe=ve.pos;if(me.setState({dragOverNodeKey:""}),me.cleanDragState(),Z.indexOf(ie)!==-1){Object(A.a)(!1,"Can not drop to dragNode(include it's children node)");return}var xe=Object(p.k)(oe),_e={event:de,node:Object(f.b)(pe.props),dragNode:me.dragNode?Object(f.b)(me.dragNode.props):null,dragNodesKeys:Z.slice(),dropPosition:te+Number(xe[xe.length-1]),dropToGap:!1};te!==0&&(_e.dropToGap=!0),le&&le(_e),me.dragNode=null},me.cleanDragState=function(){var de=me.state.dragging;de&&me.setState({dragging:!1})},me.onNodeClick=function(de,pe){var se=me.props.onClick;se&&se(de,pe)},me.onNodeDoubleClick=function(de,pe){var se=me.props.onDoubleClick;se&&se(de,pe)},me.onNodeSelect=function(de,pe){var se=me.state.selectedKeys,ce=me.state.keyEntities,Z=me.props,te=Z.onSelect,le=Z.multiple,ve=pe.selected,ie=pe.key,oe=!ve;oe?le?se=Object(p.a)(se,ie):se=[ie]:se=Object(p.b)(se,ie);var xe=se.map(function(_e){var Me=ce[_e];return Me?Me.node:null}).filter(function(_e){return _e});me.setUncontrolledState({selectedKeys:se}),te&&te(se,{event:"select",selected:oe,node:pe,selectedNodes:xe,nativeEvent:de.nativeEvent})},me.onNodeCheck=function(de,pe,se){var ce=me.state,Z=ce.keyEntities,te=ce.checkedKeys,le=ce.halfCheckedKeys,ve=me.props,ie=ve.checkStrictly,oe=ve.onCheck,xe=pe.key,_e,Me={event:"check",node:pe,checked:se,nativeEvent:de.nativeEvent};if(ie){var Ue=se?Object(p.a)(te,xe):Object(p.b)(te,xe),He=Object(p.b)(le,xe);_e={checked:Ue,halfChecked:He},Me.checkedNodes=Ue.map(function(pt){return Z[pt]}).filter(function(pt){return pt}).map(function(pt){return pt.node}),me.setUncontrolledState({checkedKeys:Ue})}else{var Be=Object(U.a)([].concat(Object(P.a)(te),[xe]),!0,Z),tt=Be.checkedKeys,Je=Be.halfCheckedKeys;if(!se){var st=new Set(tt);st.delete(xe);var nt=Object(U.a)(Array.from(st),{checked:!1,halfCheckedKeys:Je},Z);tt=nt.checkedKeys,Je=nt.halfCheckedKeys}_e=tt,Me.checkedNodes=[],Me.checkedNodesPositions=[],Me.halfCheckedKeys=Je,tt.forEach(function(pt){var mt=Z[pt];if(!mt)return;var ke=mt.node,Le=mt.pos;Me.checkedNodes.push(ke),Me.checkedNodesPositions.push({node:ke,pos:Le})}),me.setUncontrolledState({checkedKeys:tt},!1,{halfCheckedKeys:Je})}oe&&oe(_e,Me)},me.onNodeLoad=function(de){return new Promise(function(pe){me.setState(function(se){var ce=se.loadedKeys,Z=ce===void 0?[]:ce,te=se.loadingKeys,le=te===void 0?[]:te,ve=me.props,ie=ve.loadData,oe=ve.onLoad,xe=de.key;if(!ie||Z.indexOf(xe)!==-1||le.indexOf(xe)!==-1)return{};var _e=ie(de);return _e.then(function(){var Me=me.state,Ue=Me.loadedKeys,He=Me.loadingKeys,Be=Object(p.a)(Ue,xe),tt=Object(p.b)(He,xe);oe&&oe(Be,{event:"load",node:de}),me.setUncontrolledState({loadedKeys:Be}),me.setState({loadingKeys:tt}),pe()}),{loadingKeys:Object(p.a)(le,xe)}})})},me.onNodeMouseEnter=function(de,pe){var se=me.props.onMouseEnter;se&&se({event:de,node:pe})},me.onNodeMouseLeave=function(de,pe){var se=me.props.onMouseLeave;se&&se({event:de,node:pe})},me.onNodeContextMenu=function(de,pe){var se=me.props.onRightClick;se&&(de.preventDefault(),se({event:de,node:pe}))},me.onFocus=function(){var de=me.props.onFocus;me.setState({focused:!0}),de&&de.apply(void 0,arguments)},me.onBlur=function(){var de=me.props.onBlur;me.setState({focused:!1}),me.onActiveChange(null),de&&de.apply(void 0,arguments)},me.getTreeNodeRequiredProps=function(){var de=me.state,pe=de.expandedKeys,se=de.selectedKeys,ce=de.loadedKeys,Z=de.loadingKeys,te=de.checkedKeys,le=de.halfCheckedKeys,ve=de.dragOverNodeKey,ie=de.dropPosition,oe=de.keyEntities;return{expandedKeys:pe||[],selectedKeys:se||[],loadedKeys:ce||[],loadingKeys:Z||[],checkedKeys:te||[],halfCheckedKeys:le||[],dragOverNodeKey:ve,dropPosition:ie,keyEntities:oe}},me.setExpandedKeys=function(de){var pe=me.state.treeData,se=Object(f.d)(pe,de);me.setUncontrolledState({expandedKeys:de,flattenNodes:se},!0)},me.onNodeExpand=function(de,pe){var se=me.state.expandedKeys,ce=me.state.listChanging,Z=me.props,te=Z.onExpand,le=Z.loadData,ve=pe.key,ie=pe.expanded;if(ce)return;var oe=se.indexOf(ve),xe=!ie;if(Object(A.a)(ie&&oe!==-1||!ie&&oe===-1,"Expand state not sync with index check"),xe?se=Object(p.a)(se,ve):se=Object(p.b)(se,ve),me.setExpandedKeys(se),te&&te(se,{node:pe,expanded:xe,nativeEvent:de.nativeEvent}),xe&&le){var _e=me.onNodeLoad(pe);_e&&_e.then(function(){var Me=Object(f.d)(me.state.treeData,se);me.setUncontrolledState({flattenNodes:Me})})}},me.onListChangeStart=function(){me.setUncontrolledState({listChanging:!0})},me.onListChangeEnd=function(){setTimeout(function(){me.setUncontrolledState({listChanging:!1})})},me.onActiveChange=function(de){var pe=me.state.activeKey,se=me.props.onActiveChange;if(pe===de)return;me.setState({activeKey:de}),de!==null&&me.scrollTo({key:de}),se&&se(de)},me.getActiveItem=function(){var de=me.state,pe=de.activeKey,se=de.flattenNodes;return pe===null?null:se.find(function(ce){var Z=ce.data.key;return Z===pe})||null},me.offsetActiveKey=function(de){var pe=me.state,se=pe.flattenNodes,ce=pe.activeKey,Z=se.findIndex(function(ve){var ie=ve.data.key;return ie===ce});Z===-1&&de<0&&(Z=se.length),Z=(Z+de+se.length)%se.length;var te=se[Z];if(te){var le=te.data.key;me.onActiveChange(le)}else me.onActiveChange(null)},me.onKeyDown=function(de){var pe=me.state,se=pe.activeKey,ce=pe.expandedKeys,Z=pe.checkedKeys,te=me.props,le=te.onKeyDown,ve=te.checkable,ie=te.selectable;switch(de.which){case R.a.UP:{me.offsetActiveKey(-1),de.preventDefault();break}case R.a.DOWN:{me.offsetActiveKey(1),de.preventDefault();break}}var oe=me.getActiveItem();if(oe&&oe.data){var xe=me.getTreeNodeRequiredProps(),_e=oe.data.isLeaf===!1||!!(oe.data.children||[]).length,Me=Object(f.b)(Object(V.a)(Object(V.a)({},Object(f.f)(se,xe)),{},{data:oe.data,active:!0}));switch(de.which){case R.a.LEFT:{_e&&ce.includes(se)?me.onNodeExpand({},Me):oe.parent&&me.onActiveChange(oe.parent.data.key),de.preventDefault();break}case R.a.RIGHT:{_e&&!ce.includes(se)?me.onNodeExpand({},Me):oe.children&&oe.children.length&&me.onActiveChange(oe.children[0].data.key),de.preventDefault();break}case R.a.ENTER:case R.a.SPACE:{ve&&!Me.disabled&&Me.checkable!==!1&&!Me.disableCheckbox?me.onNodeCheck({},Me,!Z.includes(se)):!ve&&ie&&!Me.disabled&&Me.selectable!==!1&&me.onNodeSelect({},Me);break}}}le&&le(de)},me.setUncontrolledState=function(de){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(me.destroyed)return;var ce=!1,Z=!0,te={};Object.keys(de).forEach(function(le){if(le in me.props){Z=!1;return}ce=!0,te[le]=de[le]}),ce&&(!pe||Z)&&me.setState(Object(V.a)(Object(V.a)({},te),se))},me.scrollTo=function(de){me.listRef.current.scrollTo(de)},me}return Object(N.a)(Oe,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var de,pe=this.state,se=pe.focused,ce=pe.flattenNodes,Z=pe.keyEntities,te=pe.dragging,le=pe.activeKey,ve=this.props,ie=ve.prefixCls,oe=ve.className,xe=ve.style,_e=ve.showLine,Me=ve.focusable,Ue=ve.tabIndex,He=Ue===void 0?0:Ue,Be=ve.selectable,tt=ve.showIcon,Je=ve.icon,st=ve.switcherIcon,nt=ve.draggable,pt=ve.checkable,mt=ve.checkStrictly,ke=ve.disabled,Le=ve.motion,We=ve.loadData,Ve=ve.filterTreeNode,Ne=ve.height,Ke=ve.itemHeight,we=ve.virtual,ye=ve.titleRender,ge=ve.onContextMenu,ae=Object(p.f)(this.props);return F.createElement(w.a.Provider,{value:{prefixCls:ie,selectable:Be,showIcon:tt,icon:Je,switcherIcon:st,draggable:nt,checkable:pt,checkStrictly:mt,disabled:ke,keyEntities:Z,loadData:We,filterTreeNode:Ve,titleRender:ye,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},F.createElement("div",{className:y()(ie,oe,(de={},Object(ue.a)(de,"".concat(ie,"-show-line"),_e),Object(ue.a)(de,"".concat(ie,"-focused"),se),Object(ue.a)(de,"".concat(ie,"-active-focused"),le!==null),de))},F.createElement(I,Object.assign({ref:this.listRef,prefixCls:ie,style:xe,data:ce,disabled:ke,selectable:Be,checkable:!!pt,motion:Le,dragging:te,height:Ne,itemHeight:Ke,virtual:we,focusable:Me,focused:se,tabIndex:He,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ge},this.getTreeNodeRequiredProps(),ae))))}}],[{key:"getDerivedStateFromProps",value:function(de,pe){var se=pe.prevProps,ce={prevProps:de};function Z(Je){return!se&&Je in de||se&&se[Je]!==de[Je]}var te;if(Z("treeData")?te=de.treeData:Z("children")&&(Object(A.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),te=Object(f.c)(de.children)),te){ce.treeData=te;var le=Object(f.a)(te);ce.keyEntities=Object(V.a)(Object(ue.a)({},u,S),le.keyEntities)}var ve=ce.keyEntities||pe.keyEntities;if(Z("expandedKeys")||se&&Z("autoExpandParent"))ce.expandedKeys=de.autoExpandParent||!se&&de.defaultExpandParent?Object(p.e)(de.expandedKeys,ve):de.expandedKeys;else if(!se&&de.defaultExpandAll){var ie=Object(V.a)({},ve);delete ie[u],ce.expandedKeys=Object.keys(ie).map(function(Je){return ie[Je].key})}else!se&&de.defaultExpandedKeys&&(ce.expandedKeys=de.autoExpandParent||de.defaultExpandParent?Object(p.e)(de.defaultExpandedKeys,ve):de.defaultExpandedKeys);if(ce.expandedKeys||delete ce.expandedKeys,te||ce.expandedKeys){var oe=Object(f.d)(te||pe.treeData,ce.expandedKeys||pe.expandedKeys);ce.flattenNodes=oe}if(de.selectable&&(Z("selectedKeys")?ce.selectedKeys=Object(p.d)(de.selectedKeys,de):!se&&de.defaultSelectedKeys&&(ce.selectedKeys=Object(p.d)(de.defaultSelectedKeys,de))),de.checkable){var xe;if(Z("checkedKeys")?xe=Object(p.j)(de.checkedKeys)||{}:!se&&de.defaultCheckedKeys?xe=Object(p.j)(de.defaultCheckedKeys)||{}:te&&(xe=Object(p.j)(de.checkedKeys)||{checkedKeys:pe.checkedKeys,halfCheckedKeys:pe.halfCheckedKeys}),xe){var _e=xe,Me=_e.checkedKeys,Ue=Me===void 0?[]:Me,He=_e.halfCheckedKeys,Be=He===void 0?[]:He;if(!de.checkStrictly){var tt=Object(U.a)(Ue,!0,ve);Ue=tt.checkedKeys,Be=tt.halfCheckedKeys}ce.checkedKeys=Ue,ce.halfCheckedKeys=Be}}return Z("loadedKeys")&&(ce.loadedKeys=de.loadedKeys),ce}}]),Oe}(F.Component);J.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},J.TreeNode=l.a;var ne=J,he=Te.b=ne},fjLI:function(ct,Te,W){"use strict";W.d(Te,"e",function(){return A}),W.d(Te,"a",function(){return h}),W.d(Te,"c",function(){return y}),W.d(Te,"d",function(){return p}),W.d(Te,"b",function(){return f});var ue=W("8HAY"),V=W("Cg/j"),P=W("T8No"),$=W("nnTU"),N=W("MI8n"),L=function(){var g=function(a,r){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,l){o.__proto__=l}||function(o,l){for(var C in l)l.hasOwnProperty(C)&&(o[C]=l[C])},g(a,r)};return function(a,r){g(a,r);function o(){this.constructor=a}a.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}(),K=function(g,a,r,o){var l=arguments.length,C=l<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,r):o,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(g,a,r,o);else for(var x=g.length-1;x>=0;x--)(b=g[x])&&(C=(l<3?b(C):l>3?b(a,r,C):b(a,r))||C);return l>3&&C&&Object.defineProperty(a,r,C),C},F=function(g,a){return function(r,o){a(r,o,g)}},R=function(){for(var g=0,a=0,r=arguments.length;a<r;a++)g+=arguments[a].length;for(var o=Array(g),l=0,a=0;a<r;a++)for(var C=arguments[a],b=0,x=C.length;b<x;b++,l++)o[l]=C[b];return o};function A(g){return g.command!==void 0}var h=Object(V.c)("menuService"),y=new(function(){function g(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new N.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return g.prototype.addCommand=function(a){var r=this;return this._commands.set(a.id,a),this._onDidChangeMenu.fire(0),{dispose:function(){r._commands.delete(a.id)&&r._onDidChangeMenu.fire(0)}}},g.prototype.getCommand=function(a){return this._commands.get(a)},g.prototype.getCommands=function(){var a=new Map;return this._commands.forEach(function(r,o){return a.set(o,r)}),a},g.prototype.appendMenuItem=function(a,r){var o=this,l=this._menuItems.get(a);return l?l.push(r):(l=[r],this._menuItems.set(a,l)),this._onDidChangeMenu.fire(a),{dispose:function(){var C=l.indexOf(r);C>=0&&(l.splice(C,1),o._onDidChangeMenu.fire(a))}}},g.prototype.getMenuItems=function(a){var r=(this._menuItems.get(a)||[]).slice(0);return a===0&&this._appendImplicitItems(r),r},g.prototype._appendImplicitItems=function(a){for(var r=new Set,o=a.filter(function(T){return A(T)}),l=0,C=o;l<C.length;l++){var b=C[l],x=b.command,D=b.alt;r.add(x.id),D&&r.add(D.id)}this._commands.forEach(function(T,m){r.has(m)||a.push({command:T})})},g}()),w=function(g){L(a,g);function a(r,o,l){var C=g.call(this,r,o)||this;return C._commandService=l,C}return a.prototype.run=function(){for(var r,o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];return(r=this._commandService).executeCommand.apply(r,R([this.id],o))},a=K([F(2,$.b)],a),a}(ue.a),p=function(g){L(a,g);function a(r){var o=this;return typeof r.title=="string"?o=g.call(this,"",r.title,"submenu")||this:o=g.call(this,"",r.title.value,"submenu")||this,o.item=r,o}return a}(ue.a),f=function(g){L(a,g);function a(r,o,l,C,b){var x=this;return typeof r.title=="string"?x=g.call(this,r.id,r.title,b)||this:x=g.call(this,r.id,r.title.value,b)||this,x._cssClass=void 0,x._enabled=!r.precondition||C.contextMatchesRules(r.precondition),x._checked=Boolean(r.toggled&&C.contextMatchesRules(r.toggled)),x._options=l||{},x.item=r,x.alt=o?new a(o,void 0,x._options,C,b):void 0,x}return a.prototype.dispose=function(){this.alt&&this.alt.dispose(),g.prototype.dispose.call(this)},a.prototype.run=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var l=[];return this._options.arg&&(l=R(l,[this._options.arg])),this._options.shouldForwardArgs&&(l=R(l,r)),g.prototype.run.apply(this,l)},a=K([F(3,P.c),F(4,$.b)],a),a}(w)},fyJ8:function(ct,Te,W){"use strict";var ue=W("rePB"),V=W("VTBJ"),P=W("Ff2n"),$=W("U8pU"),N=W("q1tI"),L=W.n(N),K=W("TSYQ"),F=W.n(K),R=W("c+Xe"),A=W("sR1s");function h(g){return g&&Object($.a)(g)==="object"&&!Array.isArray(g)&&!N.isValidElement(g)}function y(g){return typeof g=="string"?!0:Object(R.c)(g)}function w(g,a){var r,o=g.prefixCls,l=g.className,C=g.record,b=g.index,x=g.dataIndex,D=g.render,T=g.children,m=g.component,v=m===void 0?"td":m,u=g.colSpan,s=g.rowSpan,S=g.fixLeft,c=g.fixRight,O=g.firstFixLeft,M=g.lastFixLeft,B=g.firstFixRight,j=g.lastFixRight,H=g.appendNode,I=g.additionalProps,U=I===void 0?{}:I,J=g.ellipsis,ne=g.align,he=g.rowType,Ee=g.isSticky,Ae="".concat(o,"-cell"),Oe,me;if(T)me=T;else{var de=Object(A.b)(C,x);if(me=de,D){var pe=D(de,C,b);h(pe)?(me=pe.children,Oe=pe.props):me=pe}}Object($.a)(me)==="object"&&!Array.isArray(me)&&!N.isValidElement(me)&&(me=null),J&&(M||B)&&(me=N.createElement("span",{className:"".concat(Ae,"-content")},me));var se=Oe||{},ce=se.colSpan,Z=se.rowSpan,te=se.style,le=se.className,ve=Object(P.a)(se,["colSpan","rowSpan","style","className"]),ie=ce!==void 0?ce:u,oe=Z!==void 0?Z:s;if(ie===0||oe===0)return null;var xe={},_e=typeof S=="number",Me=typeof c=="number";_e&&(xe.position="sticky",xe.left=S),Me&&(xe.position="sticky",xe.right=c);var Ue={};ne&&(Ue.textAlign=ne);var He,Be=J===!0?{showTitle:!0}:J;Be&&(Be.showTitle||he==="header")&&(typeof me=="string"||typeof me=="number"?He=me.toString():N.isValidElement(me)&&typeof me.props.children=="string"&&(He=me.props.children));var tt=Object(V.a)(Object(V.a)(Object(V.a)({title:He},ve),U),{},{colSpan:ie&&ie!==1?ie:null,rowSpan:oe&&oe!==1?oe:null,className:F()(Ae,l,(r={},Object(ue.a)(r,"".concat(Ae,"-fix-left"),_e),Object(ue.a)(r,"".concat(Ae,"-fix-left-first"),O),Object(ue.a)(r,"".concat(Ae,"-fix-left-last"),M),Object(ue.a)(r,"".concat(Ae,"-fix-right"),Me),Object(ue.a)(r,"".concat(Ae,"-fix-right-first"),B),Object(ue.a)(r,"".concat(Ae,"-fix-right-last"),j),Object(ue.a)(r,"".concat(Ae,"-ellipsis"),J),Object(ue.a)(r,"".concat(Ae,"-with-append"),H),Object(ue.a)(r,"".concat(Ae,"-fix-sticky"),(_e||Me)&&Ee),r),U.className,le),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},U.style),Ue),xe),te),ref:y(v)?a:null});return N.createElement(v,Object.assign({},tt),H,me)}var p=N.forwardRef(w);p.displayName="Cell";var f=N.memo(p,function(g,a){return a.shouldCellUpdate?!a.shouldCellUpdate(a.record,g.record):!1});Te.a=f},h78n:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return O});var ue=W("q1tI"),V=W.n(ue),P=W("TSYQ"),$=W.n(P),N={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},L=function(j){var H=j.map(function(){return Object(ue.useRef)()}),I=Object(ue.useRef)();return Object(ue.useEffect)(function(){var U=Date.now(),J=!1;Object.keys(H).forEach(function(ne){var he=H[ne].current;if(!he)return;J=!0;var Ee=he.style;Ee.transitionDuration=".3s, .3s, .3s, .06s",I.current&&U-I.current<100&&(Ee.transitionDuration="0s, 0s")}),J&&(I.current=Date.now())}),[H]};function K(){return K=Object.assign||function(B){for(var j=1;j<arguments.length;j++){var H=arguments[j];for(var I in H)Object.prototype.hasOwnProperty.call(H,I)&&(B[I]=H[I])}return B},K.apply(this,arguments)}function F(B,j){return w(B)||y(B,j)||A(B,j)||R()}function R(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(B,j){if(!B)return;if(typeof B=="string")return h(B,j);var H=Object.prototype.toString.call(B).slice(8,-1);if(H==="Object"&&B.constructor&&(H=B.constructor.name),H==="Map"||H==="Set")return Array.from(B);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return h(B,j)}function h(B,j){(j==null||j>B.length)&&(j=B.length);for(var H=0,I=new Array(j);H<j;H++)I[H]=B[H];return I}function y(B,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(B)))return;var H=[],I=!0,U=!1,J=void 0;try{for(var ne=B[Symbol.iterator](),he;!(I=(he=ne.next()).done)&&!(H.push(he.value),j&&H.length===j);I=!0);}catch(Ee){U=!0,J=Ee}finally{try{!I&&ne.return!=null&&ne.return()}finally{if(U)throw J}}return H}function w(B){if(Array.isArray(B))return B}function p(B,j){if(B==null)return{};var H=f(B,j),I,U;if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(B);for(U=0;U<J.length;U++){if(I=J[U],j.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(B,I))continue;H[I]=B[I]}}return H}function f(B,j){if(B==null)return{};var H={},I=Object.keys(B),U,J;for(J=0;J<I.length;J++){if(U=I[J],j.indexOf(U)>=0)continue;H[U]=B[U]}return H}var g=function(j){var H=j.className,I=j.percent,U=j.prefixCls,J=j.strokeColor,ne=j.strokeLinecap,he=j.strokeWidth,Ee=j.style,Ae=j.trailColor,Oe=j.trailWidth,me=j.transition,de=p(j,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete de.gapPosition;var pe=Array.isArray(I)?I:[I],se=Array.isArray(J)?J:[J],ce=L(pe),Z=F(ce,1),te=Z[0],le=he/2,ve=100-he/2,ie="M ".concat(ne==="round"?le:0,",").concat(le,`
L `).concat(ne==="round"?ve:100,",").concat(le),oe="0 0 100 ".concat(he),xe=0;return V.a.createElement("svg",K({className:$()("".concat(U,"-line"),H),viewBox:oe,preserveAspectRatio:"none",style:Ee},de),V.a.createElement("path",{className:"".concat(U,"-line-trail"),d:ie,strokeLinecap:ne,stroke:Ae,strokeWidth:Oe||he,fillOpacity:"0"}),pe.map(function(_e,Me){var Ue={strokeDasharray:"".concat(_e,"px, 100px"),strokeDashoffset:"-".concat(xe,"px"),transition:me||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},He=se[Me]||se[se.length-1];return xe+=_e,V.a.createElement("path",{key:Me,className:"".concat(U,"-line-path"),d:ie,strokeLinecap:ne,stroke:He,strokeWidth:he,fillOpacity:"0",ref:te[Me],style:Ue})}))};g.defaultProps=N;var a=g;function r(){return r=Object.assign||function(B){for(var j=1;j<arguments.length;j++){var H=arguments[j];for(var I in H)Object.prototype.hasOwnProperty.call(H,I)&&(B[I]=H[I])}return B},r.apply(this,arguments)}function o(B,j){return D(B)||x(B,j)||C(B,j)||l()}function l(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C(B,j){if(!B)return;if(typeof B=="string")return b(B,j);var H=Object.prototype.toString.call(B).slice(8,-1);if(H==="Object"&&B.constructor&&(H=B.constructor.name),H==="Map"||H==="Set")return Array.from(B);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return b(B,j)}function b(B,j){(j==null||j>B.length)&&(j=B.length);for(var H=0,I=new Array(j);H<j;H++)I[H]=B[H];return I}function x(B,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(B)))return;var H=[],I=!0,U=!1,J=void 0;try{for(var ne=B[Symbol.iterator](),he;!(I=(he=ne.next()).done)&&!(H.push(he.value),j&&H.length===j);I=!0);}catch(Ee){U=!0,J=Ee}finally{try{!I&&ne.return!=null&&ne.return()}finally{if(U)throw J}}return H}function D(B){if(Array.isArray(B))return B}function T(B,j){if(B==null)return{};var H=m(B,j),I,U;if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(B);for(U=0;U<J.length;U++){if(I=J[U],j.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(B,I))continue;H[I]=B[I]}}return H}function m(B,j){if(B==null)return{};var H={},I=Object.keys(B),U,J;for(J=0;J<I.length;J++){if(U=I[J],j.indexOf(U)>=0)continue;H[U]=B[U]}return H}var v=0;function u(B){return+B.replace("%","")}function s(B){return Array.isArray(B)?B:[B]}function S(B,j,H,I){var U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,J=arguments.length>5?arguments[5]:void 0,ne=50-I/2,he=0,Ee=-ne,Ae=0,Oe=-2*ne;switch(J){case"left":he=-ne,Ee=0,Ae=2*ne,Oe=0;break;case"right":he=ne,Ee=0,Ae=-2*ne,Oe=0;break;case"bottom":Ee=ne,Oe=2*ne;break;default:}var me="M 50,50 m ".concat(he,",").concat(Ee,`
a `).concat(ne,",").concat(ne," 0 1 1 ").concat(Ae,",").concat(-Oe,`
a `).concat(ne,",").concat(ne," 0 1 1 ").concat(-Ae,",").concat(Oe),de=Math.PI*2*ne,pe={stroke:H,strokeDasharray:"".concat(j/100*(de-U),"px ").concat(de,"px"),strokeDashoffset:"-".concat(U/2+B/100*(de-U),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:me,pathStyle:pe}}var c=function(j){var H=j.prefixCls,I=j.strokeWidth,U=j.trailWidth,J=j.gapDegree,ne=j.gapPosition,he=j.trailColor,Ee=j.strokeLinecap,Ae=j.style,Oe=j.className,me=j.strokeColor,de=j.percent,pe=T(j,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),se=Object(ue.useMemo)(function(){return v+=1,v},[]),ce=S(0,100,he,I,J,ne),Z=ce.pathString,te=ce.pathStyle,le=s(de),ve=s(me),ie=ve.find(function(Ue){return Object.prototype.toString.call(Ue)==="[object Object]"}),oe=L(le),xe=o(oe,1),_e=xe[0],Me=function(){var He=0;return le.map(function(Be,tt){var Je=ve[tt]||ve[ve.length-1],st=Object.prototype.toString.call(Je)==="[object Object]"?"url(#".concat(H,"-gradient-").concat(se,")"):"",nt=S(He,Be,Je,I,J,ne);return He+=Be,V.a.createElement("path",{key:tt,className:"".concat(H,"-circle-path"),d:nt.pathString,stroke:st,strokeLinecap:Ee,strokeWidth:I,opacity:Be===0?0:1,fillOpacity:"0",style:nt.pathStyle,ref:_e[tt]})})};return V.a.createElement("svg",r({className:$()("".concat(H,"-circle"),Oe),viewBox:"0 0 100 100",style:Ae},pe),ie&&V.a.createElement("defs",null,V.a.createElement("linearGradient",{id:"".concat(H,"-gradient-").concat(se),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(ie).sort(function(Ue,He){return u(Ue)-u(He)}).map(function(Ue,He){return V.a.createElement("stop",{key:He,offset:Ue,stopColor:ie[Ue]})}))),V.a.createElement("path",{className:"".concat(H,"-circle-trail"),d:Z,stroke:he,strokeLinecap:Ee,strokeWidth:U||I,fillOpacity:"0",style:te}),Me().reverse())};c.defaultProps=N;var O=c,M={Line:a,Circle:O}},hW8S:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return $}),W.d(Te,"c",function(){return N}),W.d(Te,"b",function(){return L});var ue=W("VTBJ"),V=W("Ff2n"),P=W("Kwbf"),$="RC_TABLE_INTERNAL_COL_DEFINE";function N(K){var F=K.expandable,R=Object(V.a)(K,["expandable"]);return"expandable"in K?Object(ue.a)(Object(ue.a)({},R),F):R}function L(K){return Object.keys(K).reduce(function(F,R){return(R.substr(0,5)==="data-"||R.substr(0,5)==="aria-")&&(F[R]=K[R]),F},{})}},i58Z:function(ct,Te,W){ct.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},kSUc:function(ct,Te,W){},kqOp:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return A});var ue=W("0Owb"),V=W("fWQN"),P=W("mtLc"),$=W("yKVA"),N=W("879j"),L=W("q1tI"),K=W.n(L),F=W("Ot1p"),R="\u2581",A=function(h){Object($.a)(w,h);var y=Object(N.a)(w);function w(){var p;Object(V.a)(this,w);for(var f=arguments.length,g=new Array(f),a=0;a<f;a++)g[a]=arguments[a];return p=y.call.apply(y,[this].concat(g)),p.getChCountBeforeCursor=function(r,o){for(var l=o.line,C=0,b=0;b<l;b++)C+=r.getLine(b).split(R).length-1;var x=r.getLine(l).substring(0,o.ch);return C+=x.split(R).length-1,C},p.onCMBeforeChange=function(r,o){var l=r.getRange(o.from,o.to),C=0;if(o.text.forEach(function(T){C+=T.split(R).length-1}),l&&l.indexOf(R)!=-1){var b=l.split(R).length-1,x=p.getChCountBeforeCursor(r,o.from);console.log("\u5220\u9664".concat(b,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(x,"\u4E2A\uFF0C\u65B0\u589E").concat(C,"\u4E2A")),p.props.deleteEmptyDisabled?o.cancel():p.props.onPlaceholderChange&&p.props.onPlaceholderChange(x,b,C)}else if(C){var D=p.getChCountBeforeCursor(r,o.from);console.log("\u65B0\u589E".concat(C,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(D,"\u4E2A")),p.props.onPlaceholderChange&&p.props.onPlaceholderChange(D,0,C)}},p}return Object(P.a)(w,[{key:"render",value:function(){return K.a.createElement(F.a,Object(ue.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),w}(L.Component)},lZu9:function(ct,Te,W){(function(ue){ue(W("VrN/"),W("1eCo"),W("8EBN"))})(function(ue){"use strict";ue.defineMode("markdown",function(V,P){var $=ue.getMode(V,"text/html"),N=$.name=="null";function L(I){if(ue.findModeByName){var U=ue.findModeByName(I);U&&(I=U.mime||U.mimes[0])}var J=ue.getMode(V,I);return J.name=="null"?null:J}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var F in K)K.hasOwnProperty(F)&&P.tokenTypeOverrides[F]&&(K[F]=P.tokenTypeOverrides[F]);var R=/^([*\-_])(?:\s*\1){2,}\s*$/,A=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,h=/^\[(x| )\](?=\s)/i,y=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,w=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,g=/^\s*\[[^\]]+?\]:.*$/,a=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,r=" ";function o(I,U,J){return U.f=U.inline=J,J(I,U)}function l(I,U,J){return U.f=U.block=J,J(I,U)}function C(I){return!I||!/\S/.test(I.string)}function b(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==D){var U=N;if(!U){var J=ue.innerMode($,I.htmlState);U=J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText}U&&(I.f=u,I.block=x,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function x(I,U){var J=I.column()===U.indentation,ne=C(U.prevLine.stream),he=U.indentedCode,Ee=U.prevLine.hr,Ae=U.list!==!1,Oe=(U.listStack[U.listStack.length-1]||0)+3;U.indentedCode=!1;var me=U.indentation;if(U.indentationDiff===null&&(U.indentationDiff=U.indentation,Ae)){for(U.list=null;me<U.listStack[U.listStack.length-1];)U.listStack.pop(),U.listStack.length?U.indentation=U.listStack[U.listStack.length-1]:U.list=!1;U.list!==!1&&(U.indentationDiff=me-U.listStack[U.listStack.length-1])}var de=!ne&&!Ee&&!U.prevLine.header&&(!Ae||!he)&&!U.prevLine.fencedCodeEnd,pe=(U.list===!1||Ee||ne)&&U.indentation<=Oe&&I.match(R),se=null;if(U.indentationDiff>=4&&(he||U.prevLine.fencedCodeEnd||U.prevLine.header||ne))return I.skipToEnd(),U.indentedCode=!0,K.code;if(I.eatSpace())return null;if(J&&U.indentation<=Oe&&(se=I.match(y))&&se[1].length<=6)return U.quote=0,U.header=se[1].length,U.thisLine.header=!0,P.highlightFormatting&&(U.formatting="header"),U.f=U.inline,m(U);if(U.indentation<=Oe&&I.eat(">"))return U.quote=J?1:U.quote+1,P.highlightFormatting&&(U.formatting="quote"),I.eatSpace(),m(U);if(!pe&&!U.setext&&J&&U.indentation<=Oe&&(se=I.match(A))){var ce=se[1]?"ol":"ul";return U.indentation=me+I.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,P.taskLists&&I.match(h,!1)&&(U.taskList=!0),U.f=U.inline,P.highlightFormatting&&(U.formatting=["list","list-"+ce]),m(U)}else{if(J&&U.indentation<=Oe&&(se=I.match(f,!0)))return U.quote=0,U.fencedEndRE=new RegExp(se[1]+"+ *$"),U.localMode=P.fencedCodeBlockHighlighting&&L(se[2]||P.fencedCodeBlockDefaultMode),U.localMode&&(U.localState=ue.startState(U.localMode)),U.f=U.block=T,P.highlightFormatting&&(U.formatting="code-block"),U.code=-1,m(U);if(U.setext||(!de||!Ae)&&!U.quote&&U.list===!1&&!U.code&&!pe&&!g.test(I.string)&&(se=I.lookAhead(1))&&(se=se.match(w)))return U.setext?(U.header=U.setext,U.setext=0,I.skipToEnd(),P.highlightFormatting&&(U.formatting="header")):(U.header=se[0].charAt(0)=="="?1:2,U.setext=U.header),U.thisLine.header=!0,U.f=U.inline,m(U);if(pe)return I.skipToEnd(),U.hr=!0,U.thisLine.hr=!0,K.hr;if(I.peek()==="[")return o(I,U,M)}return o(I,U,U.inline)}function D(I,U){var J=$.token(I,U.htmlState);if(!N){var ne=ue.innerMode($,U.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||U.md_inside&&I.current().indexOf(">")>-1)&&(U.f=u,U.block=x,U.htmlState=null)}return J}function T(I,U){var J=U.listStack[U.listStack.length-1]||0,ne=U.indentation<J,he=J+3;if(U.fencedEndRE&&U.indentation<=he&&(ne||I.match(U.fencedEndRE))){P.highlightFormatting&&(U.formatting="code-block");var Ee;return ne||(Ee=m(U)),U.localMode=U.localState=null,U.block=x,U.f=u,U.fencedEndRE=null,U.code=0,U.thisLine.fencedCodeEnd=!0,ne?l(I,U,U.block):Ee}else return U.localMode?U.localMode.token(I,U.localState):(I.skipToEnd(),K.code)}function m(I){var U=[];if(I.formatting){U.push(K.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var J=0;J<I.formatting.length;J++)U.push(K.formatting+"-"+I.formatting[J]),I.formatting[J]==="header"&&U.push(K.formatting+"-"+I.formatting[J]+"-"+I.header),I.formatting[J]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?U.push(K.formatting+"-"+I.formatting[J]+"-"+I.quote):U.push("error"))}if(I.taskOpen)return U.push("meta"),U.length?U.join(" "):null;if(I.taskClosed)return U.push("property"),U.length?U.join(" "):null;if(I.linkHref?U.push(K.linkHref,"url"):(I.strong&&U.push(K.strong),I.em&&U.push(K.em),I.strikethrough&&U.push(K.strikethrough),I.emoji&&U.push(K.emoji),I.linkText&&U.push(K.linkText),I.code&&U.push(K.code),I.image&&U.push(K.image),I.imageAltText&&U.push(K.imageAltText,"link"),I.imageMarker&&U.push(K.imageMarker)),I.header&&U.push(K.header,K.header+"-"+I.header),I.quote&&(U.push(K.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?U.push(K.quote+"-"+I.quote):U.push(K.quote+"-"+P.maxBlockquoteDepth)),I.list!==!1){var ne=(I.listStack.length-1)%3;ne?ne===1?U.push(K.list2):U.push(K.list3):U.push(K.list1)}return I.trailingSpaceNewLine?U.push("trailing-space-new-line"):I.trailingSpace&&U.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),U.length?U.join(" "):null}function v(I,U){return I.match(p,!0)?m(U):void 0}function u(I,U){var J=U.text(I,U);if(typeof J!="undefined")return J;if(U.list)return U.list=null,m(U);if(U.taskList){var ne=I.match(h,!0)[1]===" ";return ne?U.taskOpen=!0:U.taskClosed=!0,P.highlightFormatting&&(U.formatting="task"),U.taskList=!1,m(U)}if(U.taskOpen=!1,U.taskClosed=!1,U.header&&I.match(/^#+$/,!0))return P.highlightFormatting&&(U.formatting="header"),m(U);var he=I.next();if(U.linkTitle){U.linkTitle=!1;var Ee=he;he==="("&&(Ee=")"),Ee=(Ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ae="^\\s*(?:[^"+Ee+"\\\\]+|\\\\\\\\|\\\\.)"+Ee;if(I.match(new RegExp(Ae),!0))return K.linkHref}if(he==="`"){var Oe=U.formatting;P.highlightFormatting&&(U.formatting="code"),I.eatWhile("`");var me=I.current().length;if(U.code==0&&(!U.quote||me==1))return U.code=me,m(U);if(me==U.code){var de=m(U);return U.code=0,de}else return U.formatting=Oe,m(U)}else if(U.code)return m(U);if(he==="\\"&&(I.next(),P.highlightFormatting)){var pe=m(U),se=K.formatting+"-escape";return pe?pe+" "+se:se}if(he==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return U.imageMarker=!0,U.image=!0,P.highlightFormatting&&(U.formatting="image"),m(U);if(he==="["&&U.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return U.imageMarker=!1,U.imageAltText=!0,P.highlightFormatting&&(U.formatting="image"),m(U);if(he==="]"&&U.imageAltText){P.highlightFormatting&&(U.formatting="image");var pe=m(U);return U.imageAltText=!1,U.image=!1,U.inline=U.f=S,pe}if(he==="["&&!U.image)return U.linkText&&I.match(/^.*?\]/)||(U.linkText=!0,P.highlightFormatting&&(U.formatting="link")),m(U);if(he==="]"&&U.linkText){P.highlightFormatting&&(U.formatting="link");var pe=m(U);return U.linkText=!1,U.inline=U.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?S:u,pe}if(he==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=s,P.highlightFormatting&&(U.formatting="link");var pe=m(U);return pe?pe+=" ":pe="",pe+K.linkInline}if(he==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=s,P.highlightFormatting&&(U.formatting="link");var pe=m(U);return pe?pe+=" ":pe="",pe+K.linkEmail}if(P.xml&&he==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ce=I.string.indexOf(">",I.pos);if(ce!=-1){var Z=I.string.substring(I.start,ce);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Z)&&(U.md_inside=!0)}return I.backUp(1),U.htmlState=ue.startState($),l(I,U,D)}if(P.xml&&he==="<"&&I.match(/^\/\w*?>/))return U.md_inside=!1,"tag";if(he==="*"||he==="_"){for(var te=1,le=I.pos==1?" ":I.string.charAt(I.pos-2);te<3&&I.eat(he);)te++;var ve=I.peek()||" ",ie=!/\s/.test(ve)&&(!a.test(ve)||/\s/.test(le)||a.test(le)),oe=!/\s/.test(le)&&(!a.test(le)||/\s/.test(ve)||a.test(ve)),xe=null,_e=null;if(te%2&&(!U.em&&ie&&(he==="*"||!oe||a.test(le))?xe=!0:U.em==he&&oe&&(he==="*"||!ie||a.test(ve))&&(xe=!1)),te>1&&(!U.strong&&ie&&(he==="*"||!oe||a.test(le))?_e=!0:U.strong==he&&oe&&(he==="*"||!ie||a.test(ve))&&(_e=!1)),_e!=null||xe!=null){P.highlightFormatting&&(U.formatting=xe==null?"strong":_e==null?"em":"strong em"),xe===!0&&(U.em=he),_e===!0&&(U.strong=he);var de=m(U);return xe===!1&&(U.em=!1),_e===!1&&(U.strong=!1),de}}else if(he===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return m(U);I.backUp(1)}if(P.strikethrough){if(he==="~"&&I.eatWhile(he)){if(U.strikethrough){P.highlightFormatting&&(U.formatting="strikethrough");var de=m(U);return U.strikethrough=!1,de}else if(I.match(/^[^\s]/,!1))return U.strikethrough=!0,P.highlightFormatting&&(U.formatting="strikethrough"),m(U)}else if(he===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return m(U);I.backUp(2)}}if(P.emoji&&he===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){U.emoji=!0,P.highlightFormatting&&(U.formatting="emoji");var Me=m(U);return U.emoji=!1,Me}return he===" "&&(I.match(/^ +$/,!1)?U.trailingSpace++:U.trailingSpace&&(U.trailingSpaceNewLine=!0)),m(U)}function s(I,U){var J=I.next();if(J===">"){U.f=U.inline=u,P.highlightFormatting&&(U.formatting="link");var ne=m(U);return ne?ne+=" ":ne="",ne+K.linkInline}return I.match(/^[^>]+/,!0),K.linkInline}function S(I,U){if(I.eatSpace())return null;var J=I.next();return J==="("||J==="["?(U.f=U.inline=O(J==="("?")":"]"),P.highlightFormatting&&(U.formatting="link-string"),U.linkHref=!0,m(U)):"error"}var c={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function O(I){return function(U,J){var ne=U.next();if(ne===I){J.f=J.inline=u,P.highlightFormatting&&(J.formatting="link-string");var he=m(J);return J.linkHref=!1,he}return U.match(c[I]),J.linkHref=!0,m(J)}}function M(I,U){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(U.f=B,I.next(),P.highlightFormatting&&(U.formatting="link"),U.linkText=!0,m(U)):o(I,U,u)}function B(I,U){if(I.match(/^\]:/,!0)){U.f=U.inline=j,P.highlightFormatting&&(U.formatting="link");var J=m(U);return U.linkText=!1,J}return I.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function j(I,U){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?U.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),U.f=U.inline=u,K.linkHref+" url")}var H={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:u,text:v,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(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&ue.copyState($,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?ue.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,U){if(U.formatting=!1,I!=U.thisLine.stream){if(U.header=0,U.hr=!1,I.match(/^\s*$/,!0))return b(U),null;if(U.prevLine=U.thisLine,U.thisLine={stream:I},U.taskList=!1,U.trailingSpace=0,U.trailingSpaceNewLine=!1,!U.localState&&(U.f=U.block,U.f!=D)){var J=I.match(/^\s*/,!0)[0].replace(/\t/g,r).length;if(U.indentation=J,U.indentationDiff=null,J>0)return null}}return U.f(I,U)},innerMode:function(I){return I.block==D?{state:I.htmlState,mode:$}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:H}},indent:function(I,U,J){return I.block==D&&$.indent?$.indent(I.htmlState,U,J):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,U,J):ue.Pass},blankLine:b,getType:m,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),ue.defineMIME("text/markdown","markdown"),ue.defineMIME("text/x-markdown","markdown")})},n6Qo:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return F});var ue=W("q1tI"),V=W("biw7"),P=W("fyJ8");function $(R){var A=R.className,h=R.index,y=R.children,w=R.colSpan,p=R.rowSpan,f=ue.useContext(V.a),g=f.prefixCls,a=f.fixedInfoList,r=a[h];return ue.createElement(P.a,Object.assign({className:A,index:h,component:"td",prefixCls:g,record:null,dataIndex:null,render:function(){return{children:y,props:{colSpan:w,rowSpan:p}}}},r))}function N(R){return ue.createElement("tr",Object.assign({},R))}function L(R){var A=R.children,h=ue.useContext(V.a),y=h.prefixCls;return ue.createElement("tfoot",{className:"".concat(y,"-summary")},A)}var K=Te.b=L,F={Cell:$,Row:N}},nnTU:function(ct,Te,W){"use strict";W.d(Te,"b",function(){return F}),W.d(Te,"a",function(){return R});var ue=W("pmY6"),V=W("746U"),P=W("Cg/j"),$=W("MI8n"),N=W("24hK"),L=W("QDVR"),K=function(){for(var A=0,h=0,y=arguments.length;h<y;h++)A+=arguments[h].length;for(var w=Array(A),p=0,h=0;h<y;h++)for(var f=arguments[h],g=0,a=f.length;g<a;g++,p++)w[p]=f[g];return w},F=Object(P.c)("commandService"),R=new(function(){function A(){this._commands=new Map,this._onDidRegisterCommand=new $.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return A.prototype.registerCommand=function(h,y){var w=this;if(!h)throw new Error("invalid command");if(typeof h=="string"){if(!y)throw new Error("invalid command");return this.registerCommand({id:h,handler:y})}if(h.description){for(var p=[],f=0,g=h.description.args;f<g.length;f++){var a=g[f];p.push(a.constraint)}var r=h.handler;h.handler=function(x){for(var D=[],T=1;T<arguments.length;T++)D[T-1]=arguments[T];return Object(V.m)(D,p),r.apply(void 0,K([x],D))}}var o=h.id,l=this._commands.get(o);l||(l=new N.a,this._commands.set(o,l));var C=l.unshift(h),b=Object(ue.h)(function(){C();var x=w._commands.get(o);(x==null?void 0:x.isEmpty())&&w._commands.delete(o)});return this._onDidRegisterCommand.fire(o),b},A.prototype.registerCommandAlias=function(h,y){return R.registerCommand(h,function(w){for(var p,f=[],g=1;g<arguments.length;g++)f[g-1]=arguments[g];return(p=w.get(F)).executeCommand.apply(p,K([y],f))})},A.prototype.getCommand=function(h){var y=this._commands.get(h);return!y||y.isEmpty()?void 0:y.iterator().next().value},A.prototype.getCommands=function(){for(var h=new Map,y=0,w=Object(L.d)(this._commands);y<w.length;y++){var p=w[y],f=this.getCommand(p);f&&h.set(p,f)}return h},A}())},osHv:function(ct,Te,W){(function(ue){ue(W("VrN/"))})(function(ue){"use strict";var V=ue.Pos;function P(a,r){return a.line-r.line||a.ch-r.ch}var $="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",N=$+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",L=new RegExp("<(/?)(["+$+"]["+N+"]*)","g");function K(a,r,o,l){this.line=r,this.ch=o,this.cm=a,this.text=a.getLine(r),this.min=l?Math.max(l.from,a.firstLine()):a.firstLine(),this.max=l?Math.min(l.to-1,a.lastLine()):a.lastLine()}function F(a,r){var o=a.cm.getTokenTypeAt(V(a.line,r));return o&&/\btag\b/.test(o)}function R(a){return a.line>=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function A(a){return a.line<=a.min?void 0:(a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0)}function h(a){for(;;){var r=a.text.indexOf(">",a.ch);if(r==-1){if(R(a))continue;return}if(!F(a,r+1)){a.ch=r+1;continue}var o=a.text.lastIndexOf("/",r),l=o>-1&&!/\S/.test(a.text.slice(o+1,r));return a.ch=r+1,l?"selfClose":"regular"}}function y(a){for(;;){var r=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(r==-1){if(A(a))continue;return}if(!F(a,r+1)){a.ch=r;continue}L.lastIndex=r,a.ch=r;var o=L.exec(a.text);if(o&&o.index==r)return o}}function w(a){for(;;){L.lastIndex=a.ch;var r=L.exec(a.text);if(!r){if(R(a))continue;return}if(!F(a,r.index+1)){a.ch=r.index+1;continue}return a.ch=r.index+r[0].length,r}}function p(a){for(;;){var r=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(r==-1){if(A(a))continue;return}if(!F(a,r+1)){a.ch=r;continue}var o=a.text.lastIndexOf("/",r),l=o>-1&&!/\S/.test(a.text.slice(o+1,r));return a.ch=r+1,l?"selfClose":"regular"}}function f(a,r){for(var o=[];;){var l=w(a),C,b=a.line,x=a.ch-(l?l[0].length:0);if(!l||!(C=h(a)))return;if(C=="selfClose")continue;if(l[1]){for(var D=o.length-1;D>=0;--D)if(o[D]==l[2]){o.length=D;break}if(D<0&&(!r||r==l[2]))return{tag:l[2],from:V(b,x),to:V(a.line,a.ch)}}else o.push(l[2])}}function g(a,r){for(var o=[];;){var l=p(a);if(!l)return;if(l=="selfClose"){y(a);continue}var C=a.line,b=a.ch,x=y(a);if(!x)return;if(x[1])o.push(x[2]);else{for(var D=o.length-1;D>=0;--D)if(o[D]==x[2]){o.length=D;break}if(D<0&&(!r||r==x[2]))return{tag:x[2],from:V(a.line,a.ch),to:V(C,b)}}}}ue.registerHelper("fold","xml",function(a,r){for(var o=new K(a,r.line,0);;){var l=w(o);if(!l||o.line!=r.line)return;var C=h(o);if(!C)return;if(!l[1]&&C!="selfClose"){var b=V(o.line,o.ch),x=f(o,l[2]);return x&&P(x.from,b)>0?{from:b,to:x.from}:null}}}),ue.findMatchingTag=function(a,r,o){var l=new K(a,r.line,r.ch,o);if(l.text.indexOf(">")==-1&&l.text.indexOf("<")==-1)return;var C=h(l),b=C&&V(l.line,l.ch),x=C&&y(l);if(!C||!x||P(l,r)>0)return;var D={from:V(l.line,l.ch),to:b,tag:x[2]};return C=="selfClose"?{open:D,close:null,at:"open"}:x[1]?{open:g(l,x[2]),close:D,at:"close"}:(l=new K(a,b.line,b.ch,o),{open:D,close:f(l,x[2]),at:"open"})},ue.findEnclosingTag=function(a,r,o,l){for(var C=new K(a,r.line,r.ch,o);;){var b=g(C,l);if(!b)break;var x=new K(a,r.line,r.ch,o),D=f(x,b.tag);if(D)return{open:b,close:D}}},ue.scanForClosingTag=function(a,r,o,l){var C=new K(a,r.line,r.ch,l?{from:0,to:l}:null);return f(C,o)}})},p5ED:function(ct,Te,W){"use strict";var ue=W("+L6B"),V=W("2/Rp"),P=W("5Dmo"),$=W("3S7+"),N=W("k1fw"),L=W("9og8"),K=W("tJVT"),F=W("WmNS"),R=W.n(F),A=W("q1tI"),h=W.n(A),y=W("vHTk"),w=W.n(y),p=W("yEEn"),f=W("ZW9T"),g=W("1vsH"),a=W("V0Rq"),r=W("m3rI");Te.a=function(o){var l,C,b,x,D,T,m=o.editOffice,v=m===void 0?"view":m,u=o.name,s=o.data,S=o.theme,c=o.type,O=o.filename,M=o.monacoEditor,B=o.className,j=o.style,H=o.close,I=o.onClose,U=o.hasMask,J=o.disabledDownload,ne=o.onImgDimensions,he=o.otherData,Ee=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Ae=Object(K.a)(Ee,2),Oe=Ae[0],me=Ae[1],de=Object(A.useState)(""),pe=Object(K.a)(de,2),se=pe[0],ce=pe[1],Z=Object(A.useState)(),te=Object(K.a)(Z,2),le=te[0],ve=te[1],ie=window.ENV==="build"?"/react/build":"",oe=location.host.startsWith("localhost")?r.a.PROXY_SERVER:r.a.API_SERVER,xe,_e=1024*1024,Me=10*_e,Ue=Object(A.useRef)();(l=s)!==null&&l!==void 0&&l.startsWith("/api")&&c!=="txt"&&(s=r.a.API_SERVER+s),c==="office"&&(xe=Object(g.P)(s).filesize,xe>Me&&(c="other")),O&&(M.filename=O),Object(A.useEffect)(function(){var Je,st,nt=(Je=document.cookie)===null||Je===void 0||((st=Je.replace(/\s/g,""))===null||st===void 0)?void 0:st.split(";");nt==null||nt.map(function(pt){var mt=pt.split("=");mt[0]==="_educoder_session"&&ce(mt[1])})},[]),Object(A.useEffect)(function(){c==="office"&&He()},[c,s]);var He=function(){var Je=Object(L.a)(R.a.mark(function st(){var nt,pt,mt;return R.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return console.log("data:",s),nt=s,s.startsWith("http")||(nt=location.origin+nt),pt=new URL(nt).pathname.split("/").pop(),Le.next=6,Object(a.U)({attachment_id:pt});case 6:mt=Le.sent,ve(mt);case 8:case"end":return Le.stop()}},st)}));return function(){return Je.apply(this,arguments)}}(),Be=function(){if(s.startsWith("http")||s.startsWith("blob:")){tt();return}Object(g.x)(O||"educoder",s,O)},tt=function(){Object(g.v)(O||"educoder",decodeURIComponent(s))};return h.a.createElement("div",{style:Object(N.a)({},j||{}),className:"".concat(U&&w.a.bgBlack," ").concat(c?w.a.wrp:"hide")},H&&h.a.createElement("div",{className:w.a.close,ref:Ue},!!ne&&h.a.createElement($.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return Ue.current}},h.a.createElement("span",{onClick:function(){I(),ne()}},h.a.createElement("i",{className:"icon-yulanpizhu"}))),!J&&h.a.createElement($.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ue.current}},h.a.createElement("span",{onClick:tt},h.a.createElement("i",{className:"icon-quxiaozhiding"}))),h.a.createElement($.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ue.current}},h.a.createElement("span",{className:"",onClick:I},h.a.createElement("i",{className:"icon-guanbi1"})))),h.a.createElement("div",{className:"".concat(w.a[B]," ").concat(B," ").concat(w.a.monaco," ").concat(c==="txt"?"show":"hide")},c==="txt"&&h.a.createElement(f.b,M)),c==="audio"&&h.a.createElement("audio",{src:"".concat(((C=s)===null||C===void 0?void 0:C.indexOf("http://"))>-1||((b=s)===null||b===void 0?void 0:b.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(s),autoPlay:!0}),c==="video"&&h.a.createElement(h.a.Fragment,null,((x=s)===null||x===void 0?void 0:x.indexOf("http"))>-1?h.a.createElement("video",{controls:!0,src:"".concat(s),autoPlay:!0}):h.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(s),autoPlay:!0})),c==="office"&&le&&h.a.createElement("iframe",{src:"".concat(ie,"/office.html?key=").concat(le.key,"&url=").concat(oe+le.url,"&callbackUrl=").concat(oe+le.callbackUrl,"&fileType=").concat(le.fileType,"&title=").concat(le.title,"&model=").concat(v,"&officeServer=").concat(r.a.OFFICE_SERVER,"&disabledDownload=").concat(!!J)}),(c==="xlsx"||c==="doc"||c==="pptx"||c==="docx")&&h.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(he.key,"&url=").concat(r.a.API_SERVER+he.url,"&callbackUrl=").concat(r.a.API_SERVER+he.callbackUrl,"&fileType=").concat(he.fileType,"&title=").concat(he.title,"&model=").concat(he.model)}),c==="html"&&h.a.createElement("iframe",{src:s+"&disposition=inline"}),c==="pdf"&&h.a.createElement("embed",{className:w.a.embed,src:s}),c==="image"&&h.a.createElement("img",{src:"".concat(((D=s)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((T=s)===null||T===void 0?void 0:T.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(s)}),c==="other"&&h.a.createElement("div",null,h.a.createElement(V.a,{type:"primary",size:"large",onClick:Be},h.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),c==="download"&&h.a.createElement(V.a,{type:"primary",size:"large",onClick:Be},h.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ct,Te,W){},pmY6:function(ct,Te,W){"use strict";W.d(Te,"g",function(){return N}),W.d(Te,"f",function(){return L}),W.d(Te,"e",function(){return K}),W.d(Te,"h",function(){return F}),W.d(Te,"b",function(){return R}),W.d(Te,"a",function(){return A}),W.d(Te,"d",function(){return h}),W.d(Te,"c",function(){return y});var ue=!1,V="__is_disposable_tracked__";function P(w){if(!ue)return;if(w&&w!==A.None)try{w[V]=!0}catch(p){}}function $(w){if(!ue)return w;var p=new Error("Potentially leaked disposable").stack;return setTimeout(function(){w[V]||console.log(p)},3e3),w}function N(w){return typeof w.dispose=="function"&&w.dispose.length===0}function L(w){return Array.isArray(w)?(w.forEach(function(p){p&&(P(p),p.dispose())}),[]):w?(P(w),w.dispose(),w):void 0}function K(){for(var w=[],p=0;p<arguments.length;p++)w[p]=arguments[p];return w.forEach(P),$({dispose:function(){return L(w)}})}function F(w){var p=$({dispose:function(){P(p),w()}});return p}var R=function(){function w(){this._toDispose=new Set,this._isDisposed=!1}return w.prototype.dispose=function(){if(this._isDisposed)return;P(this),this._isDisposed=!0,this.clear()},w.prototype.clear=function(){this._toDispose.forEach(function(p){return p.dispose()}),this._toDispose.clear()},w.prototype.add=function(p){if(!p)return p;if(p===this)throw new Error("Cannot register a disposable on itself!");return P(p),this._isDisposed?console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(p),p},w}(),A=function(){function w(){this._store=new R,$(this)}return w.prototype.dispose=function(){P(this),this._store.dispose()},w.prototype._register=function(p){if(p===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(p)},w.None=Object.freeze({dispose:function(){}}),w}(),h=function(){function w(){this._isDisposed=!1,$(this)}return Object.defineProperty(w.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(p){if(this._isDisposed||p===this._value)return;this._value&&this._value.dispose(),p&&P(p),this._value=p},enumerable:!0,configurable:!0}),w.prototype.clear=function(){this.value=void 0},w.prototype.dispose=function(){this._isDisposed=!0,P(this),this._value&&this._value.dispose(),this._value=void 0},w}(),y=function(){function w(p){this.object=p}return w.prototype.dispose=function(){},w}()},"rAM+":function(ct,Te,W){"use strict";W.d(Te,"a",function(){return V});var ue=W("Qw5x");function V(P,$){var N;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(N=Object(ue.a)(P))||$&&P&&typeof P.length=="number"){N&&(P=N);var L=0,K=function(){};return{s:K,n:function(){return L>=P.length?{done:!0}:{done:!1,value:P[L++]}},e:function(y){throw y},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var F=!0,R=!1,A;return{s:function(){N=P[Symbol.iterator]()},n:function(){var y=N.next();return F=y.done,y},e:function(y){R=!0,A=y},f:function(){try{!F&&N.return!=null&&N.return()}finally{if(R)throw A}}}}},rUJ1:function(ct,Te){const W=/[&<>"']/,ue=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},N=T=>$[T];function L(T,m){if(m){if(W.test(T))return T.replace(ue,N)}else if(V.test(T))return T.replace(P,N);return T}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(T){return T.replace(K,(m,v)=>(v=v.toLowerCase(),v==="colon"?":":v.charAt(0)==="#"?v.charAt(1)==="x"?String.fromCharCode(parseInt(v.substring(2),16)):String.fromCharCode(+v.substring(1)):""))}const R=/(^|[^\[])\^/g;function A(T,m){T=T.source||T,m=m||"";const v={replace:(u,s)=>(s=s.source||s,s=s.replace(R,"$1"),T=T.replace(u,s),v),getRegex:()=>new RegExp(T,m)};return v}const h=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(T,m,v){if(T){let u;try{u=decodeURIComponent(F(v)).replace(h,"").toLowerCase()}catch(s){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}m&&!y.test(v)&&(v=r(m,v));try{v=encodeURI(v).replace(/%25/g,"%")}catch(u){return null}return v}const p={},f=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(T,m){p[" "+T]||(f.test(T)?p[" "+T]=T+"/":p[" "+T]=b(T,"/",!0)),T=p[" "+T];const v=T.indexOf(":")===-1;return m.substring(0,2)==="//"?v?m:T.replace(g,"$1")+m:m.charAt(0)==="/"?v?m:T.replace(a,"$1")+m:T+m}const o={exec:function(){}};function l(T){let m=1,v,u;for(;m<arguments.length;m++){v=arguments[m];for(u in v)Object.prototype.hasOwnProperty.call(v,u)&&(T[u]=v[u])}return T}function C(T,m){const v=T.replace(/\|/g,(S,c,O)=>{let M=!1,B=c;for(;--B>=0&&O[B]==="\\";)M=!M;return M?"|":" |"}),u=v.split(/ \|/);let s=0;if(u.length>m)u.splice(m);else for(;u.length<m;)u.push("");for(;s<u.length;s++)u[s]=u[s].trim().replace(/\\\|/g,"|");return u}function b(T,m,v){const u=T.length;if(u===0)return"";let s=0;for(;s<u;){const S=T.charAt(u-s-1);if(S===m&&!v)s++;else if(S!==m&&v)s++;else break}return T.substr(0,u-s)}function x(T,m){if(T.indexOf(m[1])===-1)return-1;const v=T.length;let u=0,s=0;for(;s<v;s++)if(T[s]==="\\")s++;else if(T[s]===m[0])u++;else if(T[s]===m[1]&&(u--,u<0))return s;return-1}function D(T){T&&T.sanitize&&!T.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ct.exports={escape:L,unescape:F,edit:A,cleanUrl:w,resolveUrl:r,noopTest:o,merge:l,splitCells:C,rtrim:b,findClosingBracket:x,checkSanitizeDeprecation:D}},sR1s:function(ct,Te,W){"use strict";W.d(Te,"b",function(){return $}),W.d(Te,"a",function(){return N}),W.d(Te,"c",function(){return L}),W.d(Te,"d",function(){return K});var ue=W("U8pU"),V="RC_TABLE_KEY";function P(F){return F==null?[]:Array.isArray(F)?F:[F]}function $(F,R){if(!R&&typeof R!="number")return F;for(var A=P(R),h=F,y=0;y<A.length;y+=1){if(!h)return null;var w=A[y];h=h[w]}return h}function N(F){var R=[],A={};return F.forEach(function(h){for(var y=h||{},w=y.key,p=y.dataIndex,f=w||P(p).join("-")||V;A[f];)f="".concat(f,"_next");A[f]=!0,R.push(f)}),R}function L(){var F={};function R(w,p){p&&Object.keys(p).forEach(function(f){var g=p[f];g&&Object(ue.a)(g)==="object"?(w[f]=w[f]||{},R(w[f],g)):w[f]=g})}for(var A=arguments.length,h=new Array(A),y=0;y<A;y++)h[y]=arguments[y];return h.forEach(function(w){R(F,w)}),F}function K(F){return F!=null}},sboe:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return P});var ue=W("q1tI"),V=W.n(ue),P=ue.createContext(null)},spXi:function(ct,Te,W){ct.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},t23M:function(ct,Te,W){"use strict";var ue=W("VTBJ"),V=W("1OyB"),P=W("vuIU"),$=W("Ji7U"),N=W("LK+K"),L=W("q1tI"),K=W.n(L),F=W("m+aA"),R=W("Zm9Q"),A=W("Kwbf"),h=W("c+Xe"),y=W("bdgK"),w="rc-observer-key",p=function(f){Object($.a)(a,f);var g=Object(N.a)(a);function a(){var r;return Object(V.a)(this,a),r=g.apply(this,arguments),r.resizeObserver=null,r.childNode=null,r.currentElement=null,r.state={width:0,height:0,offsetHeight:0,offsetWidth:0},r.onResize=function(o){var l=r.props.onResize,C=o[0].target,b=C.getBoundingClientRect(),x=b.width,D=b.height,T=C.offsetWidth,m=C.offsetHeight,v=Math.floor(x),u=Math.floor(D);if(r.state.width!==v||r.state.height!==u||r.state.offsetWidth!==T||r.state.offsetHeight!==m){var s={width:v,height:u,offsetWidth:T,offsetHeight:m};r.setState(s),l&&Promise.resolve().then(function(){l(Object(ue.a)(Object(ue.a)({},s),{},{offsetWidth:T,offsetHeight:m}))})}},r.setChildNode=function(o){r.childNode=o},r}return Object(P.a)(a,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var o=this.props.disabled;if(o){this.destroyObserver();return}var l=Object(F.a)(this.childNode||this),C=l!==this.currentElement;C&&(this.destroyObserver(),this.currentElement=l),!this.resizeObserver&&l&&(this.resizeObserver=new y.default(this.onResize),this.resizeObserver.observe(l))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var o=this.props.children,l=Object(R.a)(o);if(l.length>1)Object(A.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(l.length===0)return Object(A.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var C=l[0];if(L.isValidElement(C)&&Object(h.c)(C)){var b=C.ref;l[0]=L.cloneElement(C,{ref:Object(h.a)(b,this.setChildNode)})}return l.length===1?l[0]:l.map(function(x,D){return!L.isValidElement(x)||"key"in x&&x.key!==null?x:L.cloneElement(x,{key:"".concat(w,"-").concat(D)})})}}]),a}(L.Component);p.displayName="ResizeObserver",Te.a=p},u2Z1:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return b});var ue=W("miYZ"),V=W("tsqr"),P=W("9og8"),$=W("5NDa"),N=W("5rEg"),L=W("2qtc"),K=W("kLXV"),F=W("oBTY"),R=W("tJVT"),A=W("OaEy"),h=W("2fM7"),y=W("WmNS"),w=W.n(y),p=W("q1tI"),f=W.n(p),g=W("ErOA"),a=W("i58Z"),r=W.n(a),o=W("T1X5"),l=W.n(o),C=h.a.Option,b=function(D){var T=D.subId,m=D.value,v=D.selectvalues,u=D.disabled,s=D.knowledgeOptions,S=s===void 0?[]:s,c=D.onChange,O=c===void 0?function(){}:c,M=D.onAddKnowledgeFinish,B=M===void 0?function(){}:M,j=Object(p.useRef)(),H=Object(p.useState)([]),I=Object(R.a)(H,2),U=I[0],J=I[1];m=m||[];var ne=function(Ae,Oe){Ae?(J([Oe.key]),O([Oe.key])):(J([]),O([]))};Object(p.useEffect)(function(){(v==null?void 0:v.length)>0&&(J(Object(F.a)(v)),O(Object(F.a)(v)))},[S]),Object(p.useEffect)(function(){var Ee;((Ee=m)===null||Ee===void 0?void 0:Ee.length)>0&&O(Object(F.a)(m))},[S]);var he=function(Ae){Ae.preventDefault(),j.current="",K.a.confirm({centered:!0,width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",icon:null,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",className:"custom-modal-divider",content:f.a.createElement("div",{className:"font14"},f.a.createElement("div",{style:{display:"flex",marginTop:"48px",marginBottom:"36px"}},f.a.createElement("img",{src:l.a,style:{width:"108px",height:"108px",marginRight:"29px"}}),"\u60A8\u586B\u5199\u7684\u77E5\u8BC6\u70B9\u6682\u65F6\u4EC5\u5BF9\u672C\u4EBA\u53EF\u89C1\uFF0C\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u540E\u5C06\u5217\u5165\u516C\u5F00\u77E5\u8BC6\u70B9\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF1B",f.a.createElement("br",null),"\u5E73\u53F0\u5BA1\u6838\u8FC7\u7A0B\u4E2D\u6709\u6743\u5220\u9664\u4E0D\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF08\u5305\u62EC\u4F46\u4E0D\u9650\u4E8E\u9519\u8BEF\u3001\u975E\u6CD5\u3001\u4E0D\u96C5\u3001\u4E0D\u5339\u914D\u5F53\u524D\u8BFE\u7A0B\u7B49\u60C5\u5F62\uFF09\uFF0C\u5220\u9664\u540E\u53EF\u80FD\u5F71\u54CD\u60A8\u7684\u8BD5\u9898\u7684\u6B63\u5E38\u4F7F\u7528\u3002",f.a.createElement("br",null),"\u8BF7\u8BA4\u771F\u586B\u5199\u4E0E\u6559\u5B66\u5185\u5BB9\u76F8\u5173\u7684\u771F\u5B9E\u77E5\u8BC6\u70B9 ",f.a.createElement("br",null)),f.a.createElement(N.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:j.current,onChange:function(me){j.current=me.target.value}})),onOk:function(){return new Promise(function(){var me=Object(P.a)(w.a.mark(function de(pe,se){var ce,Z;return w.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:if(j.current){le.next=3;break}return V.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),le.abrupt("return",se());case 3:if(!(j.current.length>20)){le.next=6;break}return V.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),le.abrupt("return",se());case 6:return le.next=8,Object(g.a)("/api/tag_disciplines.json",{method:"post",body:{name:j.current,sub_discipline_id:T}});case 8:return ce=le.sent,(ce==null?void 0:ce.status)===0&&(B({id:ce.tag_discipline_id,name:j.current,type:"personal"}),Z=[],Z.push(ce.tag_discipline_id),O([].concat(Z)),J([ce.tag_discipline_id]),O([].concat(Z))),le.abrupt("return",pe());case 11:case"end":return le.stop()}},de)}));return function(de,pe){return me.apply(this,arguments)}}())}})};return f.a.createElement("div",{className:r.a.wrap},f.a.createElement(h.a,{disabled:!T||u,className:"mr5",style:{width:"242px"},onChange:ne,showSearch:!0,allowClear:!0,value:S==null?void 0:S.filter(function(Ee){return(U==null?void 0:U.includes(Ee==null?void 0:Ee.id))||(U==null?void 0:U.includes((Ee==null?void 0:Ee.id)+""))}).map(function(Ee){return Ee.name})},S==null?void 0:S.map(function(Ee){return f.a.createElement(C,{key:Ee.id,value:Ee.name},f.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},f.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},Ee.name),f.a.createElement("span",null,Ee.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),f.a.createElement("button",{disabled:!T,className:"".concat(r.a.addKnowledge," ").concat(T?"":r.a.disabled),onClick:he},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uK0f:function(ct,Te,W){(function(ue,V){ct.exports=V()})(this,function(){"use strict";function ue(V,P,$){$=$||{},$.childrenKeyName=$.childrenKeyName||"children";var N=V||[],L=[],K=0;do{var F=N.filter(function(R){return P(R,K)})[0];if(!F)break;L.push(F),N=F[$.childrenKeyName]||[],K+=1}while(N.length>0);return L}return ue})},ulZh:function(ct,Te,W){typeof window!="undefined"&&function(V,P){ct.exports=P()}(this,function(){return function(ue){var V={};function P($){if(V[$])return V[$].exports;var N=V[$]={i:$,l:!1,exports:{}};return ue[$].call(N.exports,N,N.exports,P),N.l=!0,N.exports}return P.m=ue,P.c=V,P.d=function($,N,L){P.o($,N)||Object.defineProperty($,N,{enumerable:!0,get:L})},P.r=function($){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),Object.defineProperty($,"__esModule",{value:!0})},P.t=function($,N){if(N&1&&($=P($)),N&8)return $;if(N&4&&typeof $=="object"&&$&&$.__esModule)return $;var L=Object.create(null);if(P.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:$}),N&2&&typeof $!="string")for(var K in $)P.d(L,K,function(F){return $[F]}.bind(null,K));return L},P.n=function($){var N=$&&$.__esModule?function(){return $.default}:function(){return $};return P.d(N,"a",N),N},P.o=function($,N){return Object.prototype.hasOwnProperty.call($,N)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ue,V,P){"use strict";var $=Object.prototype.hasOwnProperty,N="~";function L(){}Object.create&&(L.prototype=Object.create(null),new L().__proto__||(N=!1));function K(h,y,w){this.fn=h,this.context=y,this.once=w||!1}function F(h,y,w,p,f){if(typeof w!="function")throw new TypeError("The listener must be a function");var g=new K(w,p||h,f),a=N?N+y:y;return h._events[a]?h._events[a].fn?h._events[a]=[h._events[a],g]:h._events[a].push(g):(h._events[a]=g,h._eventsCount++),h}function R(h,y){--h._eventsCount===0?h._events=new L:delete h._events[y]}function A(){this._events=new L,this._eventsCount=0}A.prototype.eventNames=function(){var y=[],w,p;if(this._eventsCount===0)return y;for(p in w=this._events)$.call(w,p)&&y.push(N?p.slice(1):p);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(w)):y},A.prototype.listeners=function(y){var w=N?N+y:y,p=this._events[w];if(!p)return[];if(p.fn)return[p.fn];for(var f=0,g=p.length,a=new Array(g);f<g;f++)a[f]=p[f].fn;return a},A.prototype.listenerCount=function(y){var w=N?N+y:y,p=this._events[w];return p?p.fn?1:p.length:0},A.prototype.emit=function(y,w,p,f,g,a){var r=N?N+y:y;if(!this._events[r])return!1;var o=this._events[r],l=arguments.length,C,b;if(o.fn){o.once&&this.removeListener(y,o.fn,void 0,!0);switch(l){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,w),!0;case 3:return o.fn.call(o.context,w,p),!0;case 4:return o.fn.call(o.context,w,p,f),!0;case 5:return o.fn.call(o.context,w,p,f,g),!0;case 6:return o.fn.call(o.context,w,p,f,g,a),!0}for(b=1,C=new Array(l-1);b<l;b++)C[b-1]=arguments[b];o.fn.apply(o.context,C)}else{var x=o.length,D;for(b=0;b<x;b++){o[b].once&&this.removeListener(y,o[b].fn,void 0,!0);switch(l){case 1:o[b].fn.call(o[b].context);break;case 2:o[b].fn.call(o[b].context,w);break;case 3:o[b].fn.call(o[b].context,w,p);break;case 4:o[b].fn.call(o[b].context,w,p,f);break;default:if(!C)for(D=1,C=new Array(l-1);D<l;D++)C[D-1]=arguments[D];o[b].fn.apply(o[b].context,C)}}}return!0},A.prototype.on=function(y,w,p){return F(this,y,w,p,!1)},A.prototype.once=function(y,w,p){return F(this,y,w,p,!0)},A.prototype.removeListener=function(y,w,p,f){var g=N?N+y:y;if(!this._events[g])return this;if(!w)return R(this,g),this;var a=this._events[g];if(a.fn)a.fn===w&&(!f||a.once)&&(!p||a.context===p)&&R(this,g);else{for(var r=0,o=[],l=a.length;r<l;r++)(a[r].fn!==w||f&&!a[r].once||p&&a[r].context!==p)&&o.push(a[r]);o.length?this._events[g]=o.length===1?o[0]:o:R(this,g)}return this},A.prototype.removeAllListeners=function(y){var w;return y?(w=N?N+y:y,this._events[w]&&R(this,w)):(this._events=new L,this._eventsCount=0),this},A.prototype.off=A.prototype.removeListener,A.prototype.addListener=A.prototype.on,A.prefixed=N,A.EventEmitter=A,ue.exports=A},"./node_modules/url-toolkit/src/url-toolkit.js":function(ue,V,P){(function($){var N=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,L=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,F=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,R={buildAbsoluteURL:function(A,h,y){if(y=y||{},A=A.trim(),h=h.trim(),!h){if(!y.alwaysNormalize)return A;var w=R.parseURL(A);if(!w)throw new Error("Error trying to parse base URL.");return w.path=R.normalizePath(w.path),R.buildURLFromParts(w)}var p=R.parseURL(h);if(!p)throw new Error("Error trying to parse relative URL.");if(p.scheme)return y.alwaysNormalize?(p.path=R.normalizePath(p.path),R.buildURLFromParts(p)):h;var f=R.parseURL(A);if(!f)throw new Error("Error trying to parse base URL.");if(!f.netLoc&&f.path&&f.path[0]!=="/"){var g=L.exec(f.path);f.netLoc=g[1],f.path=g[2]}f.netLoc&&!f.path&&(f.path="/");var a={scheme:f.scheme,netLoc:p.netLoc,path:null,params:p.params,query:p.query,fragment:p.fragment};if(!p.netLoc&&(a.netLoc=f.netLoc,p.path[0]!=="/"))if(!p.path)a.path=f.path,p.params||(a.params=f.params,p.query||(a.query=f.query));else{var r=f.path,o=r.substring(0,r.lastIndexOf("/")+1)+p.path;a.path=R.normalizePath(o)}return a.path===null&&(a.path=y.alwaysNormalize?R.normalizePath(p.path):p.path),R.buildURLFromParts(a)},parseURL:function(A){var h=N.exec(A);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(K,"");A.length!==(A=A.replace(F,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};ue.exports=R})(this)},"./node_modules/webworkify-webpack/index.js":function(ue,V,P){function $(y){var w={};function p(g){if(w[g])return w[g].exports;var a=w[g]={i:g,l:!1,exports:{}};return y[g].call(a.exports,a,a.exports,p),a.l=!0,a.exports}p.m=y,p.c=w,p.i=function(g){return g},p.d=function(g,a,r){p.o(g,a)||Object.defineProperty(g,a,{configurable:!1,enumerable:!0,get:r})},p.r=function(g){Object.defineProperty(g,"__esModule",{value:!0})},p.n=function(g){var a=g&&g.__esModule?function(){return g.default}:function(){return g};return p.d(a,"a",a),a},p.o=function(g,a){return Object.prototype.hasOwnProperty.call(g,a)},p.p="/",p.oe=function(g){throw console.error(g),g};var f=p(p.s=ENTRY_MODULE);return f.default||f}var N="[\\.|\\-|\\+|\\w|/|@]+",L="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+N+").*?\\)";function K(y){return(y+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function F(y){return!isNaN(1*y)}function R(y,w,p){var f={};f[p]=[];var g=w.toString(),a=g.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return f;for(var r=a[1],o=new RegExp("(\\\\n|\\W)"+K(r)+L,"g"),l;l=o.exec(g);){if(l[3]==="dll-reference")continue;f[p].push(l[3])}for(o=new RegExp("\\("+K(r)+'\\("(dll-reference\\s('+N+'))"\\)\\)'+L,"g");l=o.exec(g);)y[l[2]]||(f[p].push(l[1]),y[l[2]]=P(l[1]).m),f[l[2]]=f[l[2]]||[],f[l[2]].push(l[4]);for(var C=Object.keys(f),b=0;b<C.length;b++)for(var x=0;x<f[C[b]].length;x++)F(f[C[b]][x])&&(f[C[b]][x]=1*f[C[b]][x]);return f}function A(y){var w=Object.keys(y);return w.reduce(function(p,f){return p||y[f].length>0},!1)}function h(y,w){for(var p={main:[w]},f={main:[]},g={main:{}};A(p);)for(var a=Object.keys(p),r=0;r<a.length;r++){var o=a[r],l=p[o],C=l.pop();if(g[o]=g[o]||{},g[o][C]||!y[o][C])continue;g[o][C]=!0,f[o]=f[o]||[],f[o].push(C);for(var b=R(y,y[o][C],o),x=Object.keys(b),D=0;D<x.length;D++)p[x[D]]=p[x[D]]||[],p[x[D]]=p[x[D]].concat(b[x[D]])}return f}ue.exports=function(y,w){w=w||{};var p={main:P.m},f=w.all?{main:Object.keys(p.main)}:h(p,y),g="";Object.keys(f).filter(function(C){return C!=="main"}).forEach(function(C){for(var b=0;f[C][b];)b++;f[C].push(b),p[C][b]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",g=g+"var "+C+" = ("+$.toString().replace("ENTRY_MODULE",JSON.stringify(b))+")({"+f[C].map(function(x){return""+JSON.stringify(x)+": "+p[C][x].toString()}).join(",")+`});
`}),g=g+"new (("+$.toString().replace("ENTRY_MODULE",JSON.stringify(y))+")({"+f.main.map(function(C){return""+JSON.stringify(C)+": "+p.main[C].toString()}).join(",")+"}))(self);";var a=new window.Blob([g],{type:"text/javascript"});if(w.bare)return a;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,o=r.createObjectURL(a),l=new window.Worker(o);return l.objectURL=o,l}},"./src/config.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"hlsDefaultConfig",function(){return D}),P.d(V,"mergeConfig",function(){return m}),P.d(V,"enableStreamingMode",function(){return v});var $=P("./src/controller/abr-controller.ts"),N=P("./src/controller/audio-stream-controller.ts"),L=P("./src/controller/audio-track-controller.ts"),K=P("./src/controller/subtitle-stream-controller.ts"),F=P("./src/controller/subtitle-track-controller.ts"),R=P("./src/controller/buffer-controller.ts"),A=P("./src/controller/timeline-controller.ts"),h=P("./src/controller/cap-level-controller.ts"),y=P("./src/controller/fps-controller.ts"),w=P("./src/controller/eme-controller.ts"),p=P("./src/controller/cmcd-controller.ts"),f=P("./src/utils/xhr-loader.ts"),g=P("./src/utils/fetch-loader.ts"),a=P("./src/utils/cues.ts"),r=P("./src/utils/mediakeys-helper.ts"),o=P("./src/utils/logger.ts");function l(){return l=Object.assign||function(u){for(var s=1;s<arguments.length;s++){var S=arguments[s];for(var c in S)Object.prototype.hasOwnProperty.call(S,c)&&(u[c]=S[c])}return u},l.apply(this,arguments)}function C(u,s){var S=Object.keys(u);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(u);s&&(c=c.filter(function(O){return Object.getOwnPropertyDescriptor(u,O).enumerable})),S.push.apply(S,c)}return S}function b(u){for(var s=1;s<arguments.length;s++){var S=arguments[s]!=null?arguments[s]:{};s%2?C(Object(S),!0).forEach(function(c){x(u,c,S[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(S)):C(Object(S)).forEach(function(c){Object.defineProperty(u,c,Object.getOwnPropertyDescriptor(S,c))})}return u}function x(u,s,S){return s in u?Object.defineProperty(u,s,{value:S,enumerable:!0,configurable:!0,writable:!0}):u[s]=S,u}var D=b(b({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:f.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:$.default,bufferController:R.default,capLevelController:h.default,fpsController:y.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},T()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:F.default,timelineController:A.TimelineController,audioStreamController:N.default,audioTrackController:L.default,emeController:w.default,cmcdController:p.default});function T(){return{cueHandler:a.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function m(u,s){if((s.liveSyncDurationCount||s.liveMaxLatencyDurationCount)&&(s.liveSyncDuration||s.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(s.liveMaxLatencyDurationCount!==void 0&&(s.liveSyncDurationCount===void 0||s.liveMaxLatencyDurationCount<=s.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(s.liveMaxLatencyDuration!==void 0&&(s.liveSyncDuration===void 0||s.liveMaxLatencyDuration<=s.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return l({},u,s)}function v(u){var s=u.loader;if(s!==g.default&&s!==f.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var S=Object(g.fetchSupported)();S&&(u.loader=g.default,u.progressive=!0,u.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/polyfills/number.ts"),N=P("./src/utils/ewma-bandwidth-estimator.ts"),L=P("./src/events.ts"),K=P("./src/utils/buffer-helper.ts"),F=P("./src/errors.ts"),R=P("./src/types/loader.ts"),A=P("./src/utils/logger.ts");function h(p,f){for(var g=0;g<f.length;g++){var a=f[g];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}function y(p,f,g){return f&&h(p.prototype,f),g&&h(p,g),p}var w=function(){function p(g){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=g;var a=g.config;this.bwEstimator=new N.default(a.abrEwmaSlowVoD,a.abrEwmaFastVoD,a.abrEwmaDefaultEstimate),this.registerListeners()}var f=p.prototype;return f.registerListeners=function(){var a=this.hls;a.on(L.Events.FRAG_LOADING,this.onFragLoading,this),a.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(L.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var a=this.hls;a.off(L.Events.FRAG_LOADING,this.onFragLoading,this),a.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(L.Events.ERROR,this.onError,this)},f.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},f.onFragLoading=function(a,r){var o=r.frag;if(o.type===R.PlaylistLevelType.MAIN&&!this.timer){var l;this.fragCurrent=o,this.partCurrent=(l=r.part)!=null?l:null,this.timer=self.setInterval(this.onCheck,100)}},f.onLevelLoaded=function(a,r){var o=this.hls.config;r.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},f._abandonRulesCheck=function(){var a=this.fragCurrent,r=this.partCurrent,o=this.hls,l=o.autoLevelEnabled,C=o.config,b=o.media;if(!a||!b)return;var x=r?r.stats:a.stats,D=r?r.duration:a.duration;if(x.aborted){A.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!l||b.paused||!b.playbackRate||!b.readyState)return;var T=performance.now()-x.loading.start,m=Math.abs(b.playbackRate);if(T<=500*D/m)return;var v=o.levels,u=o.minAutoLevel,s=v[a.level],S=x.total||Math.max(x.loaded,Math.round(D*s.maxBitrate/8)),c=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/T),O=(S-x.loaded)/c,M=b.currentTime,B=(K.BufferHelper.bufferInfo(b,M,C.maxBufferHole).end-M)/m;if(B>=2*D/m||O<=B)return;var j=Number.POSITIVE_INFINITY,H;for(H=a.level-1;H>u;H--){var I=v[H].maxBitrate;if(j=D*I/(8*.8*c),j<B)break}if(j>=O)return;var U=this.bwEstimator.getEstimate();A.logger.warn("Fragment "+a.sn+(r?" part "+r.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
Current BW estimate: `+(Object($.isFiniteNumber)(U)?(U/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+O.toFixed(3)+` s
Estimated load time for the next fragment: `+j.toFixed(3)+` s
Time to underbuffer: `+B.toFixed(3)+" s"),o.nextLoadLevel=H,this.bwEstimator.sample(T,x.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),o.trigger(L.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:r,stats:x})},f.onFragLoaded=function(a,r){var o=r.frag,l=r.part;if(o.type===R.PlaylistLevelType.MAIN&&Object($.isFiniteNumber)(o.sn)){var C=l?l.stats:o.stats,b=l?l.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[o.level],D=(x.loaded?x.loaded.bytes:0)+C.loaded,T=(x.loaded?x.loaded.duration:0)+b;x.loaded={bytes:D,duration:T},x.realBitrate=Math.round(8*D/T)}if(o.bitrateTest){var m={stats:C,frag:o,part:l,id:o.type};this.onFragBuffered(L.Events.FRAG_BUFFERED,m),o.bitrateTest=!1}}},f.onFragBuffered=function(a,r){var o=r.frag,l=r.part,C=l?l.stats:o.stats;if(C.aborted)return;if(o.type!==R.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var b=C.parsing.end-C.loading.start;this.bwEstimator.sample(b,C.loaded),C.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=b/1e3:this.bitrateTestDelay=0},f.onError=function(a,r){switch(r.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},f.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},f.getNextABRAutoLevel=function(){var a=this.fragCurrent,r=this.partCurrent,o=this.hls,l=o.maxAutoLevel,C=o.config,b=o.minAutoLevel,x=o.media,D=r?r.duration:a?a.duration:0,T=x?x.currentTime:0,m=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,v=this.bwEstimator?this.bwEstimator.getEstimate():C.abrEwmaDefaultEstimate,u=(K.BufferHelper.bufferInfo(x,T,C.maxBufferHole).end-T)/m,s=this.findBestLevel(v,b,l,u,C.abrBandWidthFactor,C.abrBandWidthUpFactor);if(s>=0)return s;A.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=D?Math.min(D,C.maxStarvationDelay):C.maxStarvationDelay,c=C.abrBandWidthFactor,O=C.abrBandWidthUpFactor;if(!u){var M=this.bitrateTestDelay;if(M){var B=D?Math.min(D,C.maxLoadingDelay):C.maxLoadingDelay;S=B-M,A.logger.trace("bitrate test took "+Math.round(1e3*M)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),c=O=1}}return s=this.findBestLevel(v,b,l,u+S,c,O),Math.max(s,0)},f.findBestLevel=function(a,r,o,l,C,b){for(var x,D=this.fragCurrent,T=this.partCurrent,m=this.lastLoadedFragLevel,v=this.hls.levels,u=v[m],s=!!(u!=null&&(x=u.details)!==null&&x!==void 0&&x.live),S=u==null?void 0:u.codecSet,c=T?T.duration:D?D.duration:0,O=o;O>=r;O--){var M=v[O];if(!M||S&&M.codecSet!==S)continue;var B=M.details,j=(T?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||c,H=void 0;O<=m?H=C*a:H=b*a;var I=v[O].maxBitrate,U=I*j/H;if(A.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+O+"/"+Math.round(H)+"/"+I+"/"+j+"/"+l+"/"+U),H>I&&(!U||s&&!this.bitrateTestDelay||U<l))return O}return-1},y(p,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,r=this.bwEstimator;if(a!==-1&&(!r||!r.canEstimate()))return a;var o=this.getNextABRAutoLevel();return a!==-1&&(o=Math.min(a,o)),o},set:function(a){this._nextAutoLevel=a}}]),p}();V.default=w},"./src/controller/audio-stream-controller.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/polyfills/number.ts"),N=P("./src/controller/base-stream-controller.ts"),L=P("./src/events.ts"),K=P("./src/utils/buffer-helper.ts"),F=P("./src/controller/fragment-tracker.ts"),R=P("./src/types/level.ts"),A=P("./src/types/loader.ts"),h=P("./src/loader/fragment.ts"),y=P("./src/demux/chunk-cache.ts"),w=P("./src/demux/transmuxer-interface.ts"),p=P("./src/types/transmuxer.ts"),f=P("./src/controller/fragment-finders.ts"),g=P("./src/utils/discontinuities.ts"),a=P("./src/errors.ts"),r=P("./src/utils/logger.ts");function o(){return o=Object.assign||function(D){for(var T=1;T<arguments.length;T++){var m=arguments[T];for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(D[v]=m[v])}return D},o.apply(this,arguments)}function l(D,T){D.prototype=Object.create(T.prototype),D.prototype.constructor=D,C(D,T)}function C(D,T){return C=Object.setPrototypeOf||function(v,u){return v.__proto__=u,v},C(D,T)}var b=100,x=function(D){l(T,D);function T(v,u){var s;return s=D.call(this,v,u,"[audio-stream-controller]")||this,s.videoBuffer=null,s.videoTrackCC=-1,s.waitingVideoCC=-1,s.audioSwitch=!1,s.trackId=-1,s.waitingData=null,s.mainDetails=null,s.bufferFlushed=!1,s._registerListeners(),s}var m=T.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var u=this.hls;u.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.on(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(L.Events.ERROR,this.onError,this),u.on(L.Events.BUFFER_RESET,this.onBufferReset,this),u.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var u=this.hls;u.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.off(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(L.Events.ERROR,this.onError,this),u.off(L.Events.BUFFER_RESET,this.onBufferReset,this),u.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onInitPtsFound=function(u,s){var S=s.frag,c=s.id,O=s.initPTS;if(c==="main"){var M=S.cc;this.initPTS[S.cc]=O,this.log("InitPTS for cc: "+M+" found from main: "+O),this.videoTrackCC=M,this.state===N.State.WAITING_INIT_PTS&&this.tick()}},m.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=N.State.STOPPED;return}var s=this.lastCurrentTime;this.stopLoad(),this.setInterval(b),this.fragLoadError=0,s>0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),this.state=N.State.IDLE):(this.loadedmetadata=!1,this.state=N.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},m.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_TRACK:{var u,s=this.levels,S=this.trackId,c=s==null||((u=s[S])===null||u===void 0)?void 0:u.details;if(c){if(this.waitForCdnTuneIn(c))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var O,M=performance.now(),B=this.retryDate;(!B||M>=B||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=N.State.IDLE);break}case N.State.WAITING_INIT_PTS:{var j=this.waitingData;if(j){var H=j.frag,I=j.part,U=j.cache,J=j.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var ne=U.flush(),he={frag:H,part:I,payload:ne,networkDetails:null};this._handleFragmentLoadProgress(he),J&&D.prototype._handleFragmentLoadComplete.call(this,he)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Ee=this.getLoadPosition(),Ae=K.BufferHelper.bufferInfo(this.mediaBuffer,Ee,this.config.maxBufferHole),Oe=Object(f.fragmentWithinToleranceTest)(Ae.end,this.config.maxFragLookUpTolerance,H);Oe<0&&(r.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+Ae.end+" is needed"),this.clearWaitingFragment())}}else this.state=N.State.IDLE}}this.onTickEnd()},m.clearWaitingFragment=function(){var u=this.waitingData;u&&(this.fragmentTracker.removeFragment(u.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.IDLE)},m.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var s=this.mediaBuffer?this.mediaBuffer:u,S=s.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},m.doTickIdle=function(){var u,s,S=this.hls,c=this.levels,O=this.media,M=this.trackId,B=S.config;if(!c||!c[M])return;if(!O&&(this.startFragRequested||!B.startFragPrefetch))return;var j=c[M],H=j.details;if(!H||H.live&&this.levelLastLoaded!==M||this.waitForCdnTuneIn(H)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,h.ElementaryStreamTypes.AUDIO,A.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,A.PlaylistLevelType.AUDIO);if(I===null)return;var U=I.len,J=this.getMaxBufferLength(),ne=this.audioSwitch;if(U>=J&&!ne)return;if(!ne&&this._streamEnded(I,H)){S.trigger(L.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var he=H.fragments,Ee=he[0].start,Ae=I.end;if(ne){var Oe=this.getLoadPosition();Ae=Oe,H.PTSKnown&&Oe<Ee&&((I.end>Ee||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),O.currentTime=Ee+.05))}var me=this.getNextFragment(Ae,H);if(!me){this.bufferFlushed=!0;return}((u=me.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((s=me.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(me,H):this.loadFragment(me,H,Ae)},m.getMaxBufferLength=function(){var u=D.prototype.getMaxBufferLength.call(this),s=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,A.PlaylistLevelType.MAIN);return s===null?u:Math.max(u,s.len)},m.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},m.onAudioTracksUpdated=function(u,s){var S=s.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(c){return new R.Level(c)})},m.onAudioTrackSwitching=function(u,s){var S=!!s.url;this.trackId=s.id;var c=this.fragCurrent;c!=null&&c.loader&&c.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(b):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=N.State.IDLE):this.state=N.State.STOPPED,this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},m.onLevelLoaded=function(u,s){this.mainDetails=s.details},m.onAudioTrackLoaded=function(u,s){var S,c=this.levels,O=s.details,M=s.id;if(!c){this.warn("Audio tracks were reset while loading level "+M);return}this.log("Track "+M+" loaded ["+O.startSN+","+O.endSN+"],duration:"+O.totalduration);var B=c[M],j=0;if(O.live||(S=B.details)!==null&&S!==void 0&&S.live){var H=this.mainDetails;if(O.fragments[0]||(O.deltaUpdateFailed=!0),O.deltaUpdateFailed||!H)return;!B.details&&O.hasProgramDateTime&&H.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(O,H),j=O.fragments[0].start):j=this.alignPlaylists(O,B.details)}B.details=O,this.levelLastLoaded=M,!this.startFragRequested&&(this.mainDetails||!O.live)&&this.setStartPosition(B.details,j),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(O)&&(this.state=N.State.IDLE),this.tick()},m._handleFragmentLoadProgress=function(u){var s,S=u.frag,c=u.part,O=u.payload,M=this.config,B=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var H=j[B];console.assert(H,"Audio track is defined on fragment load progress");var I=H.details;console.assert(I,"Audio track details are defined on fragment load progress");var U=M.defaultAudioCodec||H.audioCodec||"mp4a.40.2",J=this.transmuxer;J||(J=this.transmuxer=new w.default(this.hls,A.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[S.cc],he=(s=S.initSegment)===null||s===void 0?void 0:s.data;if(ne!==void 0){var Ee=!1,Ae=c?c.index:-1,Oe=Ae!==-1,me=new p.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,O.byteLength,Ae,Oe);J.push(O,he,U,"",S,c,I.totalduration,Ee,me,ne)}else{r.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+B);var de=this.waitingData=this.waitingData||{frag:S,part:c,cache:new y.default,complete:!1},pe=de.cache;pe.push(new Uint8Array(O)),this.waitingVideoCC=this.videoTrackCC,this.state=N.State.WAITING_INIT_PTS}},m._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,u)},m.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},m.onBufferCreated=function(u,s){var S=s.tracks.audio;S&&(this.mediaBuffer=S.buffer),s.tracks.video&&(this.videoBuffer=s.tracks.video.buffer)},m.onFragBuffered=function(u,s){var S=s.frag,c=s.part;if(S.type!==A.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(c?" p: "+c.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,c)},m.onError=function(u,s){switch(s.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.AUDIO,s);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==N.State.ERROR&&this.state!==N.State.STOPPED&&(this.state=s.fatal?N.State.ERROR:N.State.IDLE,this.warn(s.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var S=!0,c=this.getFwdBufferInfo(this.mediaBuffer,A.PlaylistLevelType.AUDIO);c&&c.len>.5&&(S=!this.reduceMaxBufferLength(c.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},m.onBufferFlushed=function(u,s){var S=s.type;S===h.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},m._handleTransmuxComplete=function(u){var s,S="audio",c=this.hls,O=u.remuxResult,M=u.chunkMeta,B=this.getCurrentContext(M);if(!B){this.warn("The loading context changed while buffering fragment "+M.sn+" of level "+M.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(M.level);return}var j=B.frag,H=B.part,I=O.audio,U=O.text,J=O.id3,ne=O.initSegment;if(this.fragContextChanged(j))return;if(this.state=N.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,j,M),c.trigger(L.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:S,tracks:ne.tracks})),I){var he=I.startPTS,Ee=I.endPTS,Ae=I.startDTS,Oe=I.endDTS;H&&(H.elementaryStreams[h.ElementaryStreamTypes.AUDIO]={startPTS:he,endPTS:Ee,startDTS:Ae,endDTS:Oe}),j.setElementaryStreamInfo(h.ElementaryStreamTypes.AUDIO,he,Ee,Ae,Oe),this.bufferFragmentData(I,j,H,M)}if(J!=null&&(s=J.samples)!==null&&s!==void 0&&s.length){var me=o({frag:j,id:S},J);c.trigger(L.Events.FRAG_PARSING_METADATA,me)}if(U){var de=o({frag:j,id:S},U);c.trigger(L.Events.FRAG_PARSING_USERDATA,de)}},m._bufferInitSegment=function(u,s,S){if(this.state!==N.State.PARSING)return;u.video&&delete u.video;var c=u.audio;if(!c)return;c.levelCodec=c.codec,c.id="audio",this.log("Init audio buffer, container:"+c.container+", codecs[parsed]=["+c.codec+"]"),this.hls.trigger(L.Events.BUFFER_CODECS,u);var O=c.initSegment;if(O!=null&&O.byteLength){var M={type:"audio",frag:s,part:null,chunkMeta:S,parent:s.type,data:O};this.hls.trigger(L.Events.BUFFER_APPENDING,M)}this.tick()},m.loadFragment=function(u,s,S){var c=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||c===F.FragmentState.NOT_LOADED||c===F.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):s.live&&!Object($.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=N.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,u,s,S)))},m.completeAudioSwitch=function(){var u=this.hls,s=this.media,S=this.trackId;s&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:S})},T}(N.default);V.default=x},"./src/controller/audio-track-controller.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/events.ts"),N=P("./src/errors.ts"),L=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function F(w,p){for(var f=0;f<p.length;f++){var g=p[f];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(w,g.key,g)}}function R(w,p,f){return p&&F(w.prototype,p),f&&F(w,f),w}function A(w,p){w.prototype=Object.create(p.prototype),w.prototype.constructor=w,h(w,p)}function h(w,p){return h=Object.setPrototypeOf||function(g,a){return g.__proto__=a,g},h(w,p)}var y=function(w){A(p,w);function p(g){var a;return a=w.call(this,g,"[audio-track-controller]")||this,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.trackName="",a.selectDefaultTrack=!0,a.registerListeners(),a}var f=p.prototype;return f.registerListeners=function(){var a=this.hls;a.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on($.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on($.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var a=this.hls;a.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off($.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off($.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off($.Events.ERROR,this.onError,this)},f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,w.prototype.destroy.call(this)},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},f.onManifestParsed=function(a,r){this.tracks=r.audioTracks||[]},f.onAudioTrackLoaded=function(a,r){var o=r.id,l=r.details,C=this.tracksInGroup[o];if(!C){this.warn("Invalid audio track id "+o);return}var b=C.details;C.details=r.details,this.log("audioTrack "+o+" loaded ["+l.startSN+"-"+l.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,r,b))},f.onLevelLoading=function(a,r){this.switchLevel(r.level)},f.onLevelSwitching=function(a,r){this.switchLevel(r.level)},f.switchLevel=function(a){var r=this.hls.levels[a];if(!(r!=null&&r.audioGroupIds))return;var o=r.audioGroupIds[r.urlId];if(this.groupId!==o){this.groupId=o;var l=this.tracks.filter(function(b){return!o||b.groupId===o});this.selectDefaultTrack&&!l.some(function(b){return b.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=l;var C={audioTracks:l};this.log("Updating audio tracks, "+l.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger($.Events.AUDIO_TRACKS_UPDATED,C),this.selectInitialTrack()}},f.onError=function(a,r){if(w.prototype.onError.call(this,a,r),r.fatal||!r.context)return;r.context.type===K.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},f.setAudioTrack=function(a){var r=this.tracksInGroup;if(a<0||a>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=r[this.trackId];this.log("Now switching to audio-track index "+a);var l=r[a],C=l.id,b=l.groupId,x=b===void 0?"":b,D=l.name,T=l.type,m=l.url;if(this.trackId=a,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger($.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:x,name:D,type:T,url:m}),l.details&&!l.details.live)return;var v=this.switchParams(l.url,o==null?void 0:o.details);this.loadPlaylist(v)},f.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,o=this.findTrackId(r)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},f.findTrackId=function(a){for(var r=this.tracksInGroup,o=0;o<r.length;o++){var l=r[o];if((!this.selectDefaultTrack||l.default)&&(!a||a===l.name))return l.id}return-1},f.loadPlaylist=function(a){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var o=r.id,l=r.groupId,C=r.url;if(a)try{C=a.addDirectives(C)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("loading audio-track playlist for id: "+o),this.clearTimer(),this.hls.trigger($.Events.AUDIO_TRACK_LOADING,{url:C,id:o,groupId:l,deliveryDirectives:a||null})}},R(p,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1,this.setAudioTrack(a)}}]),p}(L.default);V.default=y},"./src/controller/base-playlist-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return R});var $=P("./src/polyfills/number.ts"),N=P("./src/types/level.ts"),L=P("./src/controller/level-helper.ts"),K=P("./src/utils/logger.ts"),F=P("./src/errors.ts"),R=function(){function A(y,w){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,w+":"),this.warn=K.logger.warn.bind(K.logger,w+":"),this.hls=y}var h=A.prototype;return h.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},h.onError=function(w,p){p.fatal&&p.type===F.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},h.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},h.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},h.stopLoad=function(){this.canLoad=!1,this.clearTimer()},h.switchParams=function(w,p){var f=p==null?void 0:p.renditionReports;if(f)for(var g=0;g<f.length;g++){var a=f[g],r=""+a.URI;if(r===w.substr(-r.length)){var o=parseInt(a["LAST-MSN"]),l=parseInt(a["LAST-PART"]);if(p&&this.hls.config.lowLatencyMode){var C=Math.min(p.age-p.partTarget,p.targetduration);l!==void 0&&C>p.partTarget&&(l+=1)}if(Object($.isFiniteNumber)(o))return new N.HlsUrlParameters(o,Object($.isFiniteNumber)(l)?l:void 0,N.HlsSkip.No)}}},h.loadPlaylist=function(w){},h.shouldLoadTrack=function(w){return this.canLoad&&w&&!!w.url&&(!w.details||w.details.live)},h.playlistLoaded=function(w,p,f){var g=this,a=p.details,r=p.stats,o=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(a.advancedDateTime=Date.now()-o,a.live||f!=null&&f.live){if(a.reloaded(f),f&&this.log("live playlist "+w+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),f&&a.fragments.length>0&&Object(L.mergeDetails)(f,a),!this.canLoad||!a.live)return;var l,C=void 0,b=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var x=this.hls.config.lowLatencyMode,D=a.lastPartSn,T=a.endSN,m=a.lastPartIndex,v=m!==-1,u=D===T,s=x?0:m;v?(C=u?T+1:D,b=u?s:m+1):C=T+1;var S=a.age,c=S+a.ageHeader,O=Math.min(c-a.partTarget,a.targetduration*1.5);if(O>0){if(f&&O>f.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+f.tuneInGoal+" to: "+O+" with playlist age: "+a.age),O=0;else{var M=Math.floor(O/a.targetduration);if(C+=M,b!==void 0){var B=Math.round(O%a.targetduration/a.partTarget);b+=B}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+O+" skip sn "+M+" to part "+b)}a.tuneInGoal=O}if(l=this.getDeliveryDirectives(a,p.deliveryDirectives,C,b),x||!u){this.loadPlaylist(l);return}}else l=this.getDeliveryDirectives(a,p.deliveryDirectives,C,b);var j=Object(L.computeReloadInterval)(a,r);C!==void 0&&a.canBlockReload&&(j-=a.partTarget||1),this.log("reload live playlist "+w+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return g.loadPlaylist(l)},j)}else this.clearTimer()},h.getDeliveryDirectives=function(w,p,f,g){var a=Object(N.getSkipValue)(w,f);return p!=null&&p.skip&&w.deltaUpdateFailed&&(f=p.msn,g=p.part,a=N.HlsSkip.No),new N.HlsUrlParameters(f,g,a)},h.retryLoadingOrFail=function(w){var p=this,f=this.hls.config,g=this.retryCount<f.levelLoadingMaxRetry;if(g){var a;if(this.retryCount++,w.details.indexOf("LoadTimeOut")>-1&&(a=w.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+w.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*f.levelLoadingRetryDelay,f.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return p.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+w.details+'"')}}else this.warn('cannot recover from error "'+w.details+'"'),this.clearTimer(),w.fatal=!0;return g},A}()},"./src/controller/base-stream-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"State",function(){return T}),P.d(V,"default",function(){return m});var $=P("./src/polyfills/number.ts"),N=P("./src/task-loop.ts"),L=P("./src/controller/fragment-tracker.ts"),K=P("./src/utils/buffer-helper.ts"),F=P("./src/utils/logger.ts"),R=P("./src/events.ts"),A=P("./src/errors.ts"),h=P("./src/types/transmuxer.ts"),y=P("./src/utils/mp4-tools.ts"),w=P("./src/utils/discontinuities.ts"),p=P("./src/controller/fragment-finders.ts"),f=P("./src/controller/level-helper.ts"),g=P("./src/loader/fragment-loader.ts"),a=P("./src/crypt/decrypter.ts"),r=P("./src/utils/time-ranges.ts"),o=P("./src/types/loader.ts");function l(v,u){for(var s=0;s<u.length;s++){var S=u[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}function C(v,u,s){return u&&l(v.prototype,u),s&&l(v,s),v}function b(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function x(v,u){v.prototype=Object.create(u.prototype),v.prototype.constructor=v,D(v,u)}function D(v,u){return D=Object.setPrototypeOf||function(S,c){return S.__proto__=c,S},D(v,u)}var T={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},m=function(v){x(u,v);function u(S,c,O){var M;return M=v.call(this)||this,M.hls=void 0,M.fragPrevious=null,M.fragCurrent=null,M.fragmentTracker=void 0,M.transmuxer=null,M._state=T.STOPPED,M.media=void 0,M.mediaBuffer=void 0,M.config=void 0,M.bitrateTest=!1,M.lastCurrentTime=0,M.nextLoadPosition=0,M.startPosition=0,M.loadedmetadata=!1,M.fragLoadError=0,M.retryDate=0,M.levels=null,M.fragmentLoader=void 0,M.levelLastLoaded=null,M.startFragRequested=!1,M.decrypter=void 0,M.initPTS=[],M.onvseeking=null,M.onvended=null,M.logPrefix="",M.log=void 0,M.warn=void 0,M.logPrefix=O,M.log=F.logger.log.bind(F.logger,O+":"),M.warn=F.logger.warn.bind(F.logger,O+":"),M.hls=S,M.fragmentLoader=new g.default(S.config),M.fragmentTracker=c,M.config=S.config,M.decrypter=new a.default(S,S.config),S.on(R.Events.KEY_LOADED,M.onKeyLoaded,b(M)),M}var s=u.prototype;return s.doTick=function(){this.onTickEnd()},s.onTickEnd=function(){},s.startLoad=function(c){},s.stopLoad=function(){this.fragmentLoader.abort();var c=this.fragCurrent;c&&this.fragmentTracker.removeFragment(c),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=T.STOPPED},s._streamEnded=function(c,O){var M=this.fragCurrent,B=this.fragmentTracker;if(!O.live&&M&&M.sn===O.endSN&&!c.nextStart){var j=B.getState(M);return j===L.FragmentState.PARTIAL||j===L.FragmentState.OK}return!1},s.onMediaAttached=function(c,O){var M=this.media=this.mediaBuffer=O.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),M.addEventListener("seeking",this.onvseeking),M.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===T.STOPPED&&this.startLoad(B.startPosition)},s.onMediaDetaching=function(){var c=this.media;c!=null&&c.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),c&&(c.removeEventListener("seeking",this.onvseeking),c.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},s.onMediaSeeking=function(){var c=this.config,O=this.fragCurrent,M=this.media,B=this.mediaBuffer,j=this.state,H=M?M.currentTime:0,I=K.BufferHelper.bufferInfo(B||M,H,c.maxBufferHole);if(this.log("media seeking to "+(Object($.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+j),j===T.ENDED)this.resetLoadingState();else if(O&&!I.len){var U=c.maxFragLookUpTolerance,J=O.start-U,ne=O.start+O.duration+U,he=H>ne;(H<J||he)&&(he&&O.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),O.loader.abort()),this.resetLoadingState())}M&&(this.lastCurrentTime=H),!this.loadedmetadata&&!I.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},s.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},s.onKeyLoaded=function(c,O){if(this.state!==T.KEY_LOADING||O.frag!==this.fragCurrent||!this.levels)return;this.state=T.IDLE;var M=this.levels[O.frag.level].details;M&&this.loadFragment(O.frag,M,O.frag.start)},s.onHandlerDestroying=function(){this.stopLoad(),v.prototype.onHandlerDestroying.call(this)},s.onHandlerDestroyed=function(){this.state=T.STOPPED,this.hls.off(R.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,v.prototype.onHandlerDestroyed.call(this)},s.loadKey=function(c,O){this.log("Loading key for "+c.sn+" of ["+O.startSN+"-"+O.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+c.level),this.state=T.KEY_LOADING,this.fragCurrent=c,this.hls.trigger(R.Events.KEY_LOADING,{frag:c})},s.loadFragment=function(c,O,M){this._loadFragForPlayback(c,O,M)},s._loadFragForPlayback=function(c,O,M){var B=this,j=function(I){if(B.fragContextChanged(c)){B.warn("Fragment "+c.sn+(I.part?" p: "+I.part.index:"")+" of level "+c.level+" was dropped during download."),B.fragmentTracker.removeFragment(c);return}c.stats.chunkCount++,B._handleFragmentLoadProgress(I)};this._doFragLoad(c,O,M,j).then(function(H){if(!H)return;B.fragLoadError=0;var I=B.state;if(B.fragContextChanged(c)){(I===T.FRAG_LOADING||I===T.BACKTRACKING||!B.fragCurrent&&I===T.PARSING)&&(B.fragmentTracker.removeFragment(c),B.state=T.IDLE);return}if("payload"in H&&(B.log("Loaded fragment "+c.sn+" of level "+c.level),B.hls.trigger(R.Events.FRAG_LOADED,H),B.state===T.BACKTRACKING)){B.fragmentTracker.backtrack(c,H),B.resetFragmentLoading(c);return}B._handleFragmentLoadComplete(H)}).catch(function(H){B.warn(H),B.resetFragmentLoading(c)})},s.flushMainBuffer=function(c,O,M){if(M===void 0&&(M=null),!(c-O))return;var B={startOffset:c,endOffset:O,type:M};this.fragLoadError=0,this.hls.trigger(R.Events.BUFFER_FLUSHING,B)},s._loadInitSegment=function(c){var O=this;this._doFragLoad(c).then(function(M){if(!M||O.fragContextChanged(c)||!O.levels)throw new Error("init load aborted");return M}).then(function(M){var B=O.hls,j=M.payload,H=c.decryptdata;if(j&&j.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var I=self.performance.now();return O.decrypter.webCryptoDecrypt(new Uint8Array(j),H.key.buffer,H.iv.buffer).then(function(U){var J=self.performance.now();return B.trigger(R.Events.FRAG_DECRYPTED,{frag:c,payload:U,stats:{tstart:I,tdecrypt:J}}),M.payload=U,M})}return M}).then(function(M){var B=O.fragCurrent,j=O.hls,H=O.levels;if(!H)throw new Error("init load aborted, missing levels");var I=H[c.level].details;console.assert(I,"Level details are defined when init segment is loaded");var U=c.stats;O.state=T.IDLE,O.fragLoadError=0,c.data=new Uint8Array(M.payload),U.parsing.start=U.buffering.start=self.performance.now(),U.parsing.end=U.buffering.end=self.performance.now(),M.frag===B&&j.trigger(R.Events.FRAG_BUFFERED,{stats:U,frag:B,part:null,id:c.type}),O.tick()}).catch(function(M){O.warn(M),O.resetFragmentLoading(c)})},s.fragContextChanged=function(c){var O=this.fragCurrent;return!c||!O||c.level!==O.level||c.sn!==O.sn||c.urlId!==O.urlId},s.fragBufferedComplete=function(c,O){var M=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+c.type+" sn: "+c.sn+(O?" part: "+O.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+c.level+" "+r.default.toString(K.BufferHelper.getBuffered(M))),this.state=T.IDLE,this.tick()},s._handleFragmentLoadComplete=function(c){var O=this.transmuxer;if(!O)return;var M=c.frag,B=c.part,j=c.partsLoaded,H=!j||j.length===0||j.some(function(U){return!U}),I=new h.ChunkMetadata(M.level,M.sn,M.stats.chunkCount+1,0,B?B.index:-1,!H);O.flush(I)},s._handleFragmentLoadProgress=function(c){},s._doFragLoad=function(c,O,M,B){var j=this;if(M===void 0&&(M=null),!this.levels)throw new Error("frag load aborted, missing levels");if(M=Math.max(c.start,M||0),this.config.lowLatencyMode&&O){var H=O.partList;if(H&&B){M>c.end&&O.fragmentHint&&(c=O.fragmentHint);var I=this.getNextPart(H,c,M);if(I>-1){var U=H[I];return this.log("Loading part sn: "+c.sn+" p: "+U.index+" cc: "+c.cc+" of playlist ["+O.startSN+"-"+O.endSN+"] parts [0-"+I+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+c.level+", target: "+parseFloat(M.toFixed(3))),this.nextLoadPosition=U.start+U.duration,this.state=T.FRAG_LOADING,this.hls.trigger(R.Events.FRAG_LOADING,{frag:c,part:H[I],targetBufferTime:M}),this.doFragPartsLoad(c,H,I,B).catch(function(J){return j.handleFragLoadError(J)})}else if(!c.url||this.loadedEndOfParts(H,M))return Promise.resolve(null)}}return this.log("Loading fragment "+c.sn+" cc: "+c.cc+" "+(O?"of ["+O.startSN+"-"+O.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+c.level+", target: "+parseFloat(M.toFixed(3))),Object($.isFiniteNumber)(c.sn)&&!this.bitrateTest&&(this.nextLoadPosition=c.start+c.duration),this.state=T.FRAG_LOADING,this.hls.trigger(R.Events.FRAG_LOADING,{frag:c,targetBufferTime:M}),this.fragmentLoader.load(c,B).catch(function(J){return j.handleFragLoadError(J)})},s.doFragPartsLoad=function(c,O,M,B){var j=this;return new Promise(function(H,I){var U=[],J=function ne(he){var Ee=O[he];j.fragmentLoader.loadPart(c,Ee,B).then(function(Ae){U[Ee.index]=Ae;var Oe=Ae.part;j.hls.trigger(R.Events.FRAG_LOADED,Ae);var me=O[he+1];if(me&&me.fragment===c)ne(he+1);else return H({frag:c,part:Oe,partsLoaded:U})}).catch(I)};J(M)})},s.handleFragLoadError=function(c){var O=c.data;return O&&O.details===A.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(O.frag,O.part):this.hls.trigger(R.Events.ERROR,O),null},s._handleTransmuxerFlush=function(c){var O=this.getCurrentContext(c);if(!O||this.state!==T.PARSING){this.fragCurrent||(this.state=T.IDLE);return}var M=O.frag,B=O.part,j=O.level,H=self.performance.now();M.stats.parsing.end=H,B&&(B.stats.parsing.end=H),this.updateLevelTiming(M,B,j,c.partial)},s.getCurrentContext=function(c){var O=this.levels,M=c.level,B=c.sn,j=c.part;if(!O||!O[M])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+M+". The current chunk will not be buffered."),null;var H=O[M],I=j>-1?Object(f.getPartWith)(H,B,j):null,U=I?I.fragment:Object(f.getFragmentWithSN)(H,B,this.fragCurrent);return U?{frag:U,part:I,level:H}:null},s.bufferFragmentData=function(c,O,M,B){if(!c||this.state!==T.PARSING)return;var j=c.data1,H=c.data2,I=j;if(j&&H&&(I=Object(y.appendUint8Array)(j,H)),!I||!I.length)return;var U={type:c.type,frag:O,part:M,chunkMeta:B,parent:O.type,data:I};this.hls.trigger(R.Events.BUFFER_APPENDING,U),c.dropped&&c.independent&&!M&&this.flushBufferGap(O)},s.flushBufferGap=function(c){var O=this.media;if(!O)return;if(!K.BufferHelper.isBuffered(O,O.currentTime)){this.flushMainBuffer(0,c.start);return}var M=O.currentTime,B=K.BufferHelper.bufferInfo(O,M,0),j=c.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),I=Math.max(Math.min(c.start-H,B.end-H),M+H);c.start-I>H&&this.flushMainBuffer(I,c.start)},s.getFwdBufferInfo=function(c,O){var M=this.config,B=this.getLoadPosition();if(!Object($.isFiniteNumber)(B))return null;var j=K.BufferHelper.bufferInfo(c,B,M.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(B,O);if(H&&j.nextStart<H.end)return K.BufferHelper.bufferInfo(c,B,Math.max(j.nextStart,M.maxBufferHole))}return j},s.getMaxBufferLength=function(c){var O=this.config,M;return c?M=Math.max(8*O.maxBufferSize/c,O.maxBufferLength):M=O.maxBufferLength,Math.min(M,O.maxMaxBufferLength)},s.reduceMaxBufferLength=function(c){var O=this.config,M=c||O.maxBufferLength;return O.maxMaxBufferLength>=M?(O.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+O.maxMaxBufferLength+"s"),!0):!1},s.getNextFragment=function(c,O){var M,B,j=O.fragments,H=j.length;if(!H)return null;var I=this.config,U=j[0].start,J;if(O.live){var ne=I.initialLiveManifestSize;if(H<ne)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+ne+")"),null;!O.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(J=this.getInitialLiveFragment(O,j),this.startPosition=J?this.hls.liveSyncPosition||J.start:c)}else c<=U&&(J=j[0]);if(!J){var he=I.lowLatencyMode?O.partEnd:O.fragmentEnd;J=this.getFragmentAtPosition(c,he,O)}return(M=J)!==null&&M!==void 0&&M.initSegment&&!((B=J)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(J=J.initSegment),J},s.getNextPart=function(c,O,M){for(var B=-1,j=!1,H=!0,I=0,U=c.length;I<U;I++){var J=c[I];if(H=H&&!J.independent,B>-1&&M<J.start)break;var ne=J.loaded;!ne&&(j||J.independent||H)&&J.fragment===O&&(B=I),j=ne}return B},s.loadedEndOfParts=function(c,O){var M=c[c.length-1];return M&&O>M.start&&M.loaded},s.getInitialLiveFragment=function(c,O){var M=this.fragPrevious,B=null;if(M){if(c.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+M.programDateTime),B=Object(p.findFragmentByPDT)(O,M.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var j=M.sn+1;if(j>=c.startSN&&j<=c.endSN){var H=O[j-c.startSN];M.cc===H.cc&&(B=H,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(p.findFragWithCC)(O,M.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(B=this.getFragmentAtPosition(I,this.bitrateTest?c.fragmentEnd:c.edge,c))}return B},s.getFragmentAtPosition=function(c,O,M){var B=this.config,j=this.fragPrevious,H=M.fragments,I=M.endSN,U=M.fragmentHint,J=B.maxFragLookUpTolerance,ne=!!(B.lowLatencyMode&&M.partList&&U);ne&&U&&!this.bitrateTest&&(H=H.concat(U),I=U.sn);var he;if(c<O){var Ee=c>O-J?0:J;he=Object(p.findFragmentByPTS)(j,H,c,Ee)}else he=H[H.length-1];if(he){var Ae=he.sn-M.startSN,Oe=j&&he.level===j.level,me=H[Ae+1],de=this.fragmentTracker.getState(he);if(de===L.FragmentState.BACKTRACKED){he=null;for(var pe=Ae;H[pe]&&this.fragmentTracker.getState(H[pe])===L.FragmentState.BACKTRACKED;)j?he=H[pe--]:he=H[--pe];he||(he=me)}else j&&he.sn===j.sn&&!ne&&(Oe&&(he.sn<I&&this.fragmentTracker.getState(me)!==L.FragmentState.OK?(this.log("SN "+he.sn+" just loaded, load next one: "+me.sn),he=me):he=null))}return he},s.synchronizeToLiveEdge=function(c){var O=this.config,M=this.media;if(!M)return;var B=this.hls.liveSyncPosition,j=M.currentTime,H=c.fragments[0].start,I=c.edge,U=j>=H-O.maxFragLookUpTolerance&&j<=I;if(B!==null&&M.duration>B&&(j<B||!U)){var J=O.liveMaxLatencyDuration!==void 0?O.liveMaxLatencyDuration:O.liveMaxLatencyDurationCount*c.targetduration;(!U&&M.readyState<4||j<I-J)&&(this.loadedmetadata||(this.nextLoadPosition=B),M.readyState&&(this.warn("Playback: "+j.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+B.toFixed(3)),M.currentTime=B))}},s.alignPlaylists=function(c,O){var M=this.levels,B=this.levelLastLoaded,j=this.fragPrevious,H=B!==null?M[B]:null,I=c.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var U=c.fragments[0].start,J=!O,ne=c.alignedSliding&&Object($.isFiniteNumber)(U);if(J||!ne&&!U){Object(w.alignStream)(j,H,c);var he=c.fragments[0].start;return this.log("Live playlist sliding: "+he.toFixed(2)+" start-sn: "+(O?O.startSN:"na")+"->"+c.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+I),he}return U},s.waitForCdnTuneIn=function(c){var O=3;return c.live&&c.canBlockReload&&c.tuneInGoal>Math.max(c.partHoldBack,c.partTarget*O)},s.setStartPosition=function(c,O){var M=this.startPosition;if(M<O&&(M=-1),M===-1||this.lastCurrentTime===-1){var B=c.startTimeOffset;Object($.isFiniteNumber)(B)?(M=O+B,B<0&&(M+=c.totalduration),M=Math.min(Math.max(O,M),O+c.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+M),this.startPosition=M):c.live?M=this.hls.liveSyncPosition||O:this.startPosition=M=0,this.lastCurrentTime=M}this.nextLoadPosition=M},s.getLoadPosition=function(){var c=this.media,O=0;return this.loadedmetadata&&c?O=c.currentTime:this.nextLoadPosition&&(O=this.nextLoadPosition),O},s.handleFragLoadAborted=function(c,O){this.transmuxer&&c.sn!=="initSegment"&&c.stats.aborted&&(this.warn("Fragment "+c.sn+(O?" part"+O.index:"")+" of level "+c.level+" was aborted"),this.resetFragmentLoading(c))},s.resetFragmentLoading=function(c){(!this.fragCurrent||!this.fragContextChanged(c))&&(this.state=T.IDLE)},s.onFragmentOrKeyLoadError=function(c,O){if(O.fatal)return;var M=O.frag;if(!M||M.type!==c)return;var B=this.fragCurrent;console.assert(B&&M.sn===B.sn&&M.level===B.level&&M.urlId===B.urlId,"Frag load error must match current frag to retry");var j=this.config;if(this.fragLoadError+1<=j.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(M.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*j.fragLoadingRetryDelay,j.fragLoadingMaxRetryTimeout);this.warn("Fragment "+M.sn+" of "+c+" "+M.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=T.FRAG_LOADING_WAITING_RETRY}else O.levelRetry?(c===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=T.IDLE):(F.logger.error(O.details+" reaches max retry, redispatch as fatal ..."),O.fatal=!0,this.hls.stopLoad(),this.state=T.ERROR)},s.afterBufferFlushed=function(c,O,M){if(!c)return;var B=K.BufferHelper.getBuffered(c);this.fragmentTracker.detectEvictedFragments(O,B,M),this.state===T.ENDED&&this.resetLoadingState()},s.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=T.IDLE},s.resetLiveStartWhenNotLoaded=function(c){if(!this.loadedmetadata){this.startFragRequested=!1;var O=this.levels?this.levels[c].details:null;if(O!=null&&O.live)return this.startPosition=-1,this.setStartPosition(O,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},s.updateLevelTiming=function(c,O,M,B){var j=this,H=M.details;console.assert(!!H,"level.details must be defined");var I=Object.keys(c.elementaryStreams).reduce(function(U,J){var ne=c.elementaryStreams[J];if(ne){var he=ne.endPTS-ne.startPTS;if(he<=0)return j.warn("Could not parse fragment "+c.sn+" "+J+" duration reliably ("+he+") resetting transmuxer to fallback to playlist timing"),j.resetTransmuxer(),U||!1;var Ee=B?0:Object(f.updateFragPTSDTS)(H,c,ne.startPTS,ne.endPTS,ne.startDTS,ne.endDTS);return j.hls.trigger(R.Events.LEVEL_PTS_UPDATED,{details:H,level:M,drift:Ee,type:J,frag:c,start:ne.startPTS,end:ne.endPTS}),!0}return U},!1);I?(this.state=T.PARSED,this.hls.trigger(R.Events.FRAG_PARSED,{frag:c,part:O})):this.resetLoadingState()},s.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},C(u,[{key:"state",get:function(){return this._state},set:function(c){var O=this._state;O!==c&&(this._state=c,this.log(O+"->"+c))}}]),u}(N.default)},"./src/controller/buffer-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return p});var $=P("./src/polyfills/number.ts"),N=P("./src/events.ts"),L=P("./src/utils/logger.ts"),K=P("./src/errors.ts"),F=P("./src/utils/buffer-helper.ts"),R=P("./src/utils/mediasource-helper.ts"),A=P("./src/loader/fragment.ts"),h=P("./src/controller/buffer-operation-queue.ts"),y=Object(R.getMediaSource)(),w=/([ha]vc.)(?:\.[^.,]+)+/,p=function(){function f(a){var r=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var o=r.hls,l=r.media,C=r.mediaSource;L.logger.log("[buffer-controller]: Media source opened"),l&&(r.updateMediaElementDuration(),o.trigger(N.Events.MEDIA_ATTACHED,{media:l})),C&&C.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){L.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){L.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var g=f.prototype;return g.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},g.destroy=function(){this.unregisterListeners(),this.details=null},g.registerListeners=function(){var r=this.hls;r.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(N.Events.BUFFER_RESET,this.onBufferReset,this),r.on(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(N.Events.BUFFER_EOS,this.onBufferEos,this),r.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(N.Events.FRAG_PARSED,this.onFragParsed,this),r.on(N.Events.FRAG_CHANGED,this.onFragChanged,this)},g.unregisterListeners=function(){var r=this.hls;r.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(N.Events.BUFFER_RESET,this.onBufferReset,this),r.off(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(N.Events.BUFFER_EOS,this.onBufferEos,this),r.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(N.Events.FRAG_PARSED,this.onFragParsed,this),r.off(N.Events.FRAG_CHANGED,this.onFragChanged,this)},g._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new h.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},g.onManifestParsed=function(r,o){var l=2;(o.audio&&!o.video||!o.altAudio)&&(l=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=l,this.details=null,L.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},g.onMediaAttaching=function(r,o){var l=this.media=o.media;if(l&&y){var C=this.mediaSource=new y;C.addEventListener("sourceopen",this._onMediaSourceOpen),C.addEventListener("sourceended",this._onMediaSourceEnded),C.addEventListener("sourceclose",this._onMediaSourceClose),l.src=self.URL.createObjectURL(C),this._objectUrl=l.src}},g.onMediaDetaching=function(){var r=this.media,o=this.mediaSource,l=this._objectUrl;if(o){if(L.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(C){L.logger.warn("[buffer-controller]: onMediaDetaching: "+C.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(l&&self.URL.revokeObjectURL(l),r.src===l?(r.removeAttribute("src"),r.load()):L.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(N.Events.MEDIA_DETACHED,void 0)},g.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(o){var l=r.sourceBuffer[o];try{l&&(r.removeBufferListeners(o),r.mediaSource&&r.mediaSource.removeSourceBuffer(l),r.sourceBuffer[o]=void 0)}catch(C){L.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",C)}}),this._initSourceBuffer()},g.onBufferCodecs=function(r,o){var l=this,C=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(b){if(C){var x=l.tracks[b];if(x&&typeof x.buffer.changeType=="function"){var D=o[b],T=D.codec,m=D.levelCodec,v=D.container,u=(x.levelCodec||x.codec).replace(w,"$1"),s=(m||T).replace(w,"$1");if(u!==s){var S=v+";codecs="+(m||T);l.appendChangeType(b,S)}}}else l.pendingTracks[b]=o[b]}),C)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},g.appendChangeType=function(r,o){var l=this,C=this.operationQueue,b={execute:function(){var D=l.sourceBuffer[r];D&&(L.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+o),D.changeType(o)),C.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(D){L.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",D)}};C.append(b,r)},g.onBufferAppending=function(r,o){var l=this,C=this.hls,b=this.operationQueue,x=this.tracks,D=o.data,T=o.type,m=o.frag,v=o.part,u=o.chunkMeta,s=u.buffering[T],S=self.performance.now();s.start=S;var c=m.stats.buffering,O=v?v.stats.buffering:null;c.start===0&&(c.start=S),O&&O.start===0&&(O.start=S);var M=x.audio,B=T==="audio"&&u.id===1&&(M==null?void 0:M.container)==="audio/mpeg",j={execute:function(){if(s.executeStart=self.performance.now(),B){var I=l.sourceBuffer[T];if(I){var U=m.start-I.timestampOffset;Math.abs(U)>=.1&&(L.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+m.start+" (delta: "+U+") sn: "+m.sn+")"),I.timestampOffset=m.start)}}l.appendExecutor(D,T)},onStart:function(){},onComplete:function(){var I=self.performance.now();s.executeEnd=s.end=I,c.first===0&&(c.first=I),O&&O.first===0&&(O.first=I);var U=l.sourceBuffer,J={};for(var ne in U)J[ne]=F.BufferHelper.getBuffered(U[ne]);l.appendError=0,l.hls.trigger(N.Events.BUFFER_APPENDED,{type:T,frag:m,part:v,chunkMeta:u,parent:m.type,timeRanges:J})},onError:function(I){L.logger.error("[buffer-controller]: Error encountered while trying to append to the "+T+" SourceBuffer",I);var U={type:K.ErrorTypes.MEDIA_ERROR,parent:m.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?U.details=K.ErrorDetails.BUFFER_FULL_ERROR:(l.appendError++,U.details=K.ErrorDetails.BUFFER_APPEND_ERROR,l.appendError>C.config.appendErrorMaxRetry&&(L.logger.error("[buffer-controller]: Failed "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),U.fatal=!0)),C.trigger(N.Events.ERROR,U)}};b.append(j,T)},g.onBufferFlushing=function(r,o){var l=this,C=this.operationQueue,b=function(D){return{execute:l.removeExecutor.bind(l,D,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){l.hls.trigger(N.Events.BUFFER_FLUSHED,{type:D})},onError:function(m){L.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",m)}}};o.type?C.append(b(o.type),o.type):this.getSourceBufferTypes().forEach(function(x){C.append(b(x),x)})},g.onFragParsed=function(r,o){var l=this,C=o.frag,b=o.part,x=[],D=b?b.elementaryStreams:C.elementaryStreams;D[A.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(D[A.ElementaryStreamTypes.AUDIO]&&x.push("audio"),D[A.ElementaryStreamTypes.VIDEO]&&x.push("video"));var T=function(){var v=self.performance.now();C.stats.buffering.end=v,b&&(b.stats.buffering.end=v);var u=b?b.stats:C.stats;l.hls.trigger(N.Events.FRAG_BUFFERED,{frag:C,part:b,stats:u,id:C.type})};x.length===0&&L.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+C.type+" level: "+C.level+" sn: "+C.sn),this.blockBuffers(T,x)},g.onFragChanged=function(r,o){this.flushBackBuffer()},g.onBufferEos=function(r,o){var l=this,C=this.getSourceBufferTypes().reduce(function(b,x){var D=l.sourceBuffer[x];return(!o.type||o.type===x)&&(D&&!D.ended&&(D.ended=!0,L.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),b&&!!(!D||D.ended)},!0);C&&this.blockBuffers(function(){var b=l.mediaSource;if(!b||b.readyState!=="open")return;b.endOfStream()})},g.onLevelUpdated=function(r,o){var l=o.details;if(!l.fragments.length)return;this.details=l,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},g.flushBackBuffer=function(){var r=this.hls,o=this.details,l=this.media,C=this.sourceBuffer;if(!l||o===null)return;var b=this.getSourceBufferTypes();if(!b.length)return;var x=o.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object($.isFiniteNumber)(x)||x<0)return;var D=l.currentTime,T=o.levelTargetDuration,m=Math.max(x,T),v=Math.floor(D/T)*T-m;b.forEach(function(u){var s=C[u];if(s){var S=F.BufferHelper.getBuffered(s);S.length>0&&v>S.start(0)&&(r.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:v}),o.live&&r.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:v}),r.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:v,type:u}))}})},g.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,o=this.hls,l=this.media,C=this.mediaSource,b=r.fragments[0].start+r.totalduration,x=l.duration,D=Object($.isFiniteNumber)(C.duration)?C.duration:0;r.live&&o.config.liveDurationInfinity?(L.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),C.duration=Infinity,this.updateSeekableRange(r)):(b>D&&b>x||!Object($.isFiniteNumber)(x))&&(L.logger.log("[buffer-controller]: Updating Media Source duration to "+b.toFixed(3)),C.duration=b)},g.updateSeekableRange=function(r){var o=this.mediaSource,l=r.fragments,C=l.length;if(C&&r.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var b=Math.max(0,l[0].start),x=Math.max(b,b+r.totalduration);o.setLiveSeekableRange(b,x)}},g.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,o=this.operationQueue,l=this.pendingTracks,C=Object.keys(l).length;if(C&&!r||C===2){this.createSourceBuffers(l),this.pendingTracks={};var b=this.getSourceBufferTypes();if(b.length===0){this.hls.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}b.forEach(function(x){o.executeNext(x)})}},g.createSourceBuffers=function(r){var o=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");var C=0;for(var b in r)if(!o[b]){var x=r[b];if(!x)throw Error("source buffer exists for track "+b+", however track does not");var D=x.levelCodec||x.codec,T=x.container+";codecs="+D;L.logger.log("[buffer-controller]: creating sourceBuffer("+T+")");try{var m=o[b]=l.addSourceBuffer(T),v=b;this.addBufferListener(v,"updatestart",this._onSBUpdateStart),this.addBufferListener(v,"updateend",this._onSBUpdateEnd),this.addBufferListener(v,"error",this._onSBUpdateError),this.tracks[b]={buffer:m,codec:D,container:x.container,levelCodec:x.levelCodec,id:x.id},C++}catch(u){L.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:T})}}C&&this.hls.trigger(N.Events.BUFFER_CREATED,{tracks:this.tracks})},g._onSBUpdateStart=function(r){var o=this.operationQueue,l=o.current(r);l.onStart()},g._onSBUpdateEnd=function(r){var o=this.operationQueue,l=o.current(r);l.onComplete(),o.shiftAndExecuteNext(r)},g._onSBUpdateError=function(r,o){L.logger.error("[buffer-controller]: "+r+" SourceBuffer error",o),this.hls.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var l=this.operationQueue.current(r);l&&l.onError(o)},g.removeExecutor=function(r,o,l){var C=this.media,b=this.mediaSource,x=this.operationQueue,D=this.sourceBuffer,T=D[r];if(!C||!b||!T){L.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(r);return}var m=Object($.isFiniteNumber)(C.duration)?C.duration:Infinity,v=Object($.isFiniteNumber)(b.duration)?b.duration:Infinity,u=Math.max(0,o),s=Math.min(l,m,v);s>u?(L.logger.log("[buffer-controller]: Removing ["+u+","+s+"] from the "+r+" SourceBuffer"),console.assert(!T.updating,r+" sourceBuffer must not be updating"),T.remove(u,s)):x.shiftAndExecuteNext(r)},g.appendExecutor=function(r,o){var l=this.operationQueue,C=this.sourceBuffer,b=C[o];if(!b){L.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(o);return}b.ended=!1,console.assert(!b.updating,o+" sourceBuffer must not be updating"),b.appendBuffer(r)},g.blockBuffers=function(r,o){var l=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){L.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var C=this.operationQueue,b=o.map(function(x){return C.appendBlocker(x)});Promise.all(b).then(function(){r(),o.forEach(function(x){var D=l.sourceBuffer[x];(!D||!D.updating)&&C.shiftAndExecuteNext(x)})})},g.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},g.addBufferListener=function(r,o,l){var C=this.sourceBuffer[r];if(!C)return;var b=l.bind(this,r);this.listeners[r].push({event:o,listener:b}),C.addEventListener(o,b)},g.removeBufferListeners=function(r){var o=this.sourceBuffer[r];if(!o)return;this.listeners[r].forEach(function(l){o.removeEventListener(l.event,l.listener)})},f}()},"./src/controller/buffer-operation-queue.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return N});var $=P("./src/utils/logger.ts"),N=function(){function L(F){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=F}var K=L.prototype;return K.append=function(R,A){var h=this.queues[A];h.push(R),h.length===1&&this.buffers[A]&&this.executeNext(A)},K.insertAbort=function(R,A){var h=this.queues[A];h.unshift(R),this.executeNext(A)},K.appendBlocker=function(R){var A,h=new Promise(function(w){A=w}),y={execute:A,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(y,R),h},K.executeNext=function(R){var A=this.buffers,h=this.queues,y=A[R],w=h[R];if(w.length){var p=w[0];try{p.execute()}catch(f){$.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),p.onError(f),(!y||!y.updating)&&(w.shift(),this.executeNext(R))}}},K.shiftAndExecuteNext=function(R){this.queues[R].shift(),this.executeNext(R)},K.current=function(R){return this.queues[R][0]},L}()},"./src/controller/cap-level-controller.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/events.ts");function N(F,R){for(var A=0;A<R.length;A++){var h=R[A];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(F,h.key,h)}}function L(F,R,A){return R&&N(F.prototype,R),A&&N(F,A),F}var K=function(){function F(A){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=A,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var R=F.prototype;return R.setStreamController=function(h){this.streamController=h},R.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},R.registerListeners=function(){var h=this.hls;h.on($.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),h.on($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on($.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},R.unregisterListener=function(){var h=this.hls;h.off($.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),h.off($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off($.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},R.onFpsDropLevelCapping=function(h,y){F.isLevelAllowed(y.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(y.droppedLevel)},R.onMediaAttaching=function(h,y){this.media=y.media instanceof HTMLVideoElement?y.media:null},R.onManifestParsed=function(h,y){var w=this.hls;this.restrictedLevels=[],this.firstLevel=y.firstLevel,w.config.capLevelToPlayerSize&&y.video&&this.startCapping()},R.onBufferCodecs=function(h,y){var w=this.hls;w.config.capLevelToPlayerSize&&y.video&&this.startCapping()},R.onMediaDetaching=function(){this.stopCapping()},R.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var h=this.hls.levels;if(h.length){var y=this.hls;y.autoLevelCapping=this.getMaxLevel(h.length-1),y.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=y.autoLevelCapping}}},R.getMaxLevel=function(h){var y=this,w=this.hls.levels;if(!w.length)return-1;var p=w.filter(function(f,g){return F.isLevelAllowed(g,y.restrictedLevels)&&g<=h});return this.clientRect=null,F.getMaxLevelByMediaSize(p,this.mediaWidth,this.mediaHeight)},R.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()},R.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},R.getDimensions=function(){if(this.clientRect)return this.clientRect;var h=this.media,y={width:0,height:0};if(h){var w=h.getBoundingClientRect();y.width=w.width,y.height=w.height,!y.width&&!y.height&&(y.width=w.right-w.left||h.width||0,y.height=w.bottom-w.top||h.height||0)}return this.clientRect=y,y},F.isLevelAllowed=function(h,y){return y===void 0&&(y=[]),y.indexOf(h)===-1},F.getMaxLevelByMediaSize=function(h,y,w){if(!h||!h.length)return-1;for(var p=function(o,l){return l?o.width!==l.width||o.height!==l.height:!0},f=h.length-1,g=0;g<h.length;g+=1){var a=h[g];if((a.width>=y||a.height>=w)&&p(a,h[g+1])){f=g;break}}return f},L(F,[{key:"mediaWidth",get:function(){return this.getDimensions().width*F.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*F.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var h=1;try{h=self.devicePixelRatio}catch(y){}return h}}]),F}();V.default=K},"./src/controller/cmcd-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return p});var $=P("./src/events.ts"),N=P("./src/types/cmcd.ts"),L=P("./src/utils/buffer-helper.ts"),K=P("./src/utils/logger.ts");function F(f,g){for(var a=0;a<g.length;a++){var r=g[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(f,r.key,r)}}function R(f,g,a){return g&&F(f.prototype,g),a&&F(f,a),f}function A(f,g){var a=typeof Symbol!="undefined"&&f[Symbol.iterator]||f["@@iterator"];if(a)return(a=a.call(f)).next.bind(a);if(Array.isArray(f)||(a=h(f))||g&&f&&typeof f.length=="number"){a&&(f=a);var r=0;return function(){return r>=f.length?{done:!0}:{done:!1,value:f[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h(f,g){if(!f)return;if(typeof f=="string")return y(f,g);var a=Object.prototype.toString.call(f).slice(8,-1);if(a==="Object"&&f.constructor&&(a=f.constructor.name),a==="Map"||a==="Set")return Array.from(f);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return y(f,g)}function y(f,g){(g==null||g>f.length)&&(g=f.length);for(var a=0,r=new Array(g);a<g;a++)r[a]=f[a];return r}function w(){return w=Object.assign||function(f){for(var g=1;g<arguments.length;g++){var a=arguments[g];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(f[r]=a[r])}return f},w.apply(this,arguments)}var p=function(){function f(a){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(C){try{r.apply(C,{ot:N.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(b){K.logger.warn("Could not generate manifest CMCD data.",b)}},this.applyFragmentData=function(C){try{var b=C.frag,x=r.hls.levels[b.level],D=r.getObjectType(b),T={d:b.duration*1e3,ot:D};(D===N.CMCDObjectType.VIDEO||D===N.CMCDObjectType.AUDIO||D==N.CMCDObjectType.MUXED)&&(T.br=x.bitrate/1e3,T.tb=r.getTopBandwidth(D),T.bl=r.getBufferLength(D)),r.apply(C,T)}catch(m){K.logger.warn("Could not generate segment CMCD data.",m)}},this.hls=a;var o=this.config=a.config,l=o.cmcd;l!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=l.sessionId||f.uuid(),this.cid=l.contentId,this.useHeaders=l.useHeaders===!0,this.registerListeners())}var g=f.prototype;return g.registerListeners=function(){var r=this.hls;r.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on($.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on($.Events.BUFFER_CREATED,this.onBufferCreated,this)},g.unregisterListeners=function(){var r=this.hls;r.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off($.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off($.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},g.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},g.onMediaAttached=function(r,o){this.media=o.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},g.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},g.onBufferCreated=function(r,o){var l,C;this.audioBuffer=(l=o.tracks.audio)===null||l===void 0?void 0:l.buffer,this.videoBuffer=(C=o.tracks.video)===null||C===void 0?void 0:C.buffer},g.createData=function(){var r;return{v:N.CMCDVersion,sf:N.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},g.apply=function(r,o){o===void 0&&(o={}),w(o,this.createData());var l=o.ot===N.CMCDObjectType.INIT||o.ot===N.CMCDObjectType.VIDEO||o.ot===N.CMCDObjectType.MUXED;if(this.starved&&l&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var C=f.toHeaders(o);if(!Object.keys(C).length)return;r.headers||(r.headers={}),w(r.headers,C)}else{var b=f.toQuery(o);if(!b)return;r.url=f.appendQueryToUri(r.url,b)}},g.getObjectType=function(r){var o=r.type;return o==="subtitle"?N.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?N.CMCDObjectType.INIT:o==="audio"?N.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?N.CMCDObjectType.VIDEO:N.CMCDObjectType.MUXED:void 0},g.getTopBandwidth=function(r){for(var o=0,l=r===N.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,C=A(l),b;!(b=C()).done;){var x=b.value;x.bitrate>o&&(o=x.bitrate)}return o>0?o:NaN},g.getBufferLength=function(r){var o=this.hls.media,l=r===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!l||!o)return NaN;var C=L.BufferHelper.bufferInfo(l,o.currentTime,this.config.maxBufferHole);return C.len*1e3},g.createPlaylistLoader=function(){var r=this.config.pLoader,o=this.applyPlaylistData,l=r||this.config.loader;return function(){function C(x){this.loader=void 0,this.loader=new l(x)}var b=C.prototype;return b.destroy=function(){this.loader.destroy()},b.abort=function(){this.loader.abort()},b.load=function(D,T,m){o(D),this.loader.load(D,T,m)},R(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},g.createFragmentLoader=function(){var r=this.config.fLoader,o=this.applyFragmentData,l=r||this.config.loader;return function(){function C(x){this.loader=void 0,this.loader=new l(x)}var b=C.prototype;return b.destroy=function(){this.loader.destroy()},b.abort=function(){this.loader.abort()},b.load=function(D,T,m){o(D),this.loader.load(D,T,m)},R(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},f.uuid=function(){var r=URL.createObjectURL(new Blob),o=r.toString();return URL.revokeObjectURL(r),o.substr(o.lastIndexOf("/")+1)},f.serialize=function(r){for(var o=[],l=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},C=function(B){return Math.round(B)},b=function(B){return C(B/100)*100},x=function(B){return encodeURIComponent(B)},D={br:C,d:C,bl:b,dl:b,mtp:b,nor:x,rtp:b,tb:C},T=Object.keys(r||{}).sort(),m=A(T),v;!(v=m()).done;){var u=v.value,s=r[u];if(!l(s))continue;if(u==="v"&&s===1)continue;if(u=="pr"&&s===1)continue;var S=D[u];S&&(s=S(s));var c=typeof s,O=void 0;u==="ot"||u==="sf"||u==="st"?O=u+"="+s:c==="boolean"?O=u:c==="number"?O=u+"="+s:O=u+"="+JSON.stringify(s),o.push(O)}return o.join(",")},f.toHeaders=function(r){for(var o=Object.keys(r),l={},C=["Object","Request","Session","Status"],b=[{},{},{},{}],x={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},D=0,T=o;D<T.length;D++){var m=T[D],v=x[m]!=null?x[m]:1;b[v][m]=r[m]}for(var u=0;u<b.length;u++){var s=f.serialize(b[u]);s&&(l["CMCD-"+C[u]]=s)}return l},f.toQuery=function(r){return"CMCD="+encodeURIComponent(f.serialize(r))},f.appendQueryToUri=function(r,o){if(!o)return r;var l=r.includes("?")?"&":"?";return""+r+l+o},f}()},"./src/controller/eme-controller.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/events.ts"),N=P("./src/errors.ts"),L=P("./src/utils/logger.ts"),K=P("./src/utils/mediakeys-helper.ts");function F(p,f){for(var g=0;g<f.length;g++){var a=f[g];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}function R(p,f,g){return f&&F(p.prototype,f),g&&F(p,g),p}var A=3,h=function(f,g,a){var r={audioCapabilities:[],videoCapabilities:[]};return f.forEach(function(o){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:a.audioRobustness||""})}),g.forEach(function(o){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:a.videoRobustness||""})}),[r]},y=function(f,g,a,r){switch(f){case K.KeySystems.WIDEVINE:return h(g,a,r);default:throw new Error("Unknown key-system: "+f)}},w=function(){function p(g){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=g,this._config=g.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var f=p.prototype;return f.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},f._registerListeners=function(){this.hls.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on($.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this)},f._unregisterListeners=function(){this.hls.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off($.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this)},f.getLicenseServerUrl=function(a){switch(a){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},f._attemptKeySystemAccess=function(a,r,o){var l=this,C=y(a,r,o,this._drmSystemOptions);L.logger.log("Requesting encrypted media key-system access");var b=this.requestMediaKeySystemAccess(a,C);this.mediaKeysPromise=b.then(function(x){return l._onMediaKeySystemAccessObtained(a,x)}),b.catch(function(x){L.logger.error('Failed to obtain key-system "'+a+'" access:',x)})},f._onMediaKeySystemAccessObtained=function(a,r){var o=this;L.logger.log('Access for key-system "'+a+'" obtained');var l={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:a};this._mediaKeysList.push(l);var C=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(b){return l.mediaKeys=b,L.logger.log('Media-keys created for key-system "'+a+'"'),o._onMediaKeysCreated(),b});return C.catch(function(b){L.logger.error("Failed to create media-keys:",b)}),C},f._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),a._onNewMediaKeySession(r.mediaKeysSession))})},f._onNewMediaKeySession=function(a){var r=this;L.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(o){r._onKeySessionMessage(a,o.message)},!1)},f._onKeySessionMessage=function(a,r){L.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(o){L.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),a.update(o)})},f.onMediaEncrypted=function(a){var r=this;if(L.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(C){if(!r._media)return;r._attemptSetMediaKeys(C),r._generateRequestWithPreferredKeySession(a.initDataType,a.initData)};this.mediaKeysPromise.then(o).catch(o)},f._attemptSetMediaKeys=function(a){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}L.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},f._generateRequestWithPreferredKeySession=function(a,r){var o=this,l=this._mediaKeysList[0];if(!l){L.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(l.mediaKeysSessionInitialized){L.logger.warn("Key-Session already initialized but requested again");return}var C=l.mediaKeysSession;if(!C){L.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){L.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}L.logger.log('Generating key-session request for "'+a+'" init data type'),l.mediaKeysSessionInitialized=!0,C.generateRequest(a,r).then(function(){L.logger.debug("Key-session generation succeeded")}).catch(function(b){L.logger.error("Error generating key-session request:",b),o.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},f._createLicenseXhr=function(a,r,o){var l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,l,a,r,o);var C=this._licenseXhrSetup;if(C)try{C.call(this.hls,l,a),C=void 0}catch(b){L.logger.error(b)}try{l.readyState||l.open("POST",a,!0),C&&C.call(this.hls,l,a)}catch(b){throw new Error("issue setting up KeySystem license XHR "+b)}return l},f._onLicenseRequestReadyStageChange=function(a,r,o,l){switch(a.readyState){case 4:if(a.status===200){this._requestLicenseFailureCount=0,L.logger.log("License request succeeded");var C=a.response,b=this._licenseResponseCallback;if(b)try{C=b.call(this.hls,a,r)}catch(D){L.logger.error(D)}l(C)}else{if(L.logger.error("License Request XHR failed ("+r+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>A){this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=A-this._requestLicenseFailureCount+1;L.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(o,l)}break}},f._generateLicenseRequestChallenge=function(a,r){switch(a.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},f._requestLicense=function(a,r){L.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){L.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var l=this.getLicenseServerUrl(o.mediaKeySystemDomain),C=this._createLicenseXhr(l,a,r);L.logger.log("Sending license request to URL: "+l);var b=this._generateLicenseRequestChallenge(o,a);C.send(b)}catch(x){L.logger.error("Failure requesting DRM license: "+x),this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},f.onMediaAttached=function(a,r){if(!this._emeEnabled)return;var o=r.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},f.onMediaDetached=function(){var a=this._media,r=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},f.onManifestParsed=function(a,r){if(!this._emeEnabled)return;var o=r.levels.map(function(C){return C.audioCodec}).filter(function(C){return!!C}),l=r.levels.map(function(C){return C.videoCodec}).filter(function(C){return!!C});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,o,l)},R(p,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),p}();V.default=w},"./src/controller/fps-controller.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/events.ts"),N=P("./src/utils/logger.ts"),L=function(){function K(R){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=R,this.registerListeners()}var F=K.prototype;return F.setStreamController=function(A){this.streamController=A},F.registerListeners=function(){this.hls.on($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},F.unregisterListeners=function(){this.hls.off($.Events.MEDIA_ATTACHING,this.onMediaAttaching)},F.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},F.onMediaAttaching=function(A,h){var y=this.hls.config;if(y.capLevelOnFPSDrop){var w=h.media instanceof self.HTMLVideoElement?h.media:null;this.media=w,w&&typeof w.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),y.fpsDroppedMonitoringPeriod)}},F.checkFPS=function(A,h,y){var w=performance.now();if(h){if(this.lastTime){var p=w-this.lastTime,f=y-this.lastDroppedFrames,g=h-this.lastDecodedFrames,a=1e3*f/p,r=this.hls;if(r.trigger($.Events.FPS_DROP,{currentDropped:f,currentDecoded:g,totalDroppedFrames:y}),a>0&&f>r.config.fpsDroppedMonitoringThreshold*g){var o=r.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=o)&&(o=o-1,r.trigger($.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:r.currentLevel}),r.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=w,this.lastDroppedFrames=y,this.lastDecodedFrames=h}},F.checkFPSInterval=function(){var A=this.media;if(A)if(this.isVideoPlaybackQualityAvailable){var h=A.getVideoPlaybackQuality();this.checkFPS(A,h.totalVideoFrames,h.droppedVideoFrames)}else this.checkFPS(A,A.webkitDecodedFrameCount,A.webkitDroppedFrameCount)},K}();V.default=L},"./src/controller/fragment-finders.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"findFragmentByPDT",function(){return L}),P.d(V,"findFragmentByPTS",function(){return K}),P.d(V,"fragmentWithinToleranceTest",function(){return F}),P.d(V,"pdtWithinToleranceTest",function(){return R}),P.d(V,"findFragWithCC",function(){return A});var $=P("./src/polyfills/number.ts"),N=P("./src/utils/binary-search.ts");function L(h,y,w){if(y===null||!Array.isArray(h)||!h.length||!Object($.isFiniteNumber)(y))return null;var p=h[0].programDateTime;if(y<(p||0))return null;var f=h[h.length-1].endProgramDateTime;if(y>=(f||0))return null;w=w||0;for(var g=0;g<h.length;++g){var a=h[g];if(R(y,w,a))return a}return null}function K(h,y,w,p){w===void 0&&(w=0),p===void 0&&(p=0);var f=null;if(h?f=y[h.sn-y[0].sn+1]||null:w===0&&y[0].start===0&&(f=y[0]),f&&F(w,p,f)===0)return f;var g=N.default.search(y,F.bind(null,w,p));return g||f}function F(h,y,w){h===void 0&&(h=0),y===void 0&&(y=0);var p=Math.min(y,w.duration+(w.deltaPTS?w.deltaPTS:0));return w.start+w.duration-p<=h?1:w.start-p>h&&w.start?-1:0}function R(h,y,w){var p=Math.min(y,w.duration+(w.deltaPTS?w.deltaPTS:0))*1e3,f=w.endProgramDateTime||0;return f-p>h}function A(h,y){return N.default.search(h,function(w){return w.cc<y?1:w.cc>y?-1:0})}},"./src/controller/fragment-tracker.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"FragmentState",function(){return L}),P.d(V,"FragmentTracker",function(){return K});var $=P("./src/events.ts"),N=P("./src/types/loader.ts"),L;(function(A){A.NOT_LOADED="NOT_LOADED",A.BACKTRACKED="BACKTRACKED",A.APPENDING="APPENDING",A.PARTIAL="PARTIAL",A.OK="OK"})(L||(L={}));var K=function(){function A(y){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=y,this._registerListeners()}var h=A.prototype;return h._registerListeners=function(){var w=this.hls;w.on($.Events.BUFFER_APPENDED,this.onBufferAppended,this),w.on($.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.on($.Events.FRAG_LOADED,this.onFragLoaded,this)},h._unregisterListeners=function(){var w=this.hls;w.off($.Events.BUFFER_APPENDED,this.onBufferAppended,this),w.off($.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.off($.Events.FRAG_LOADED,this.onFragLoaded,this)},h.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},h.getAppendedFrag=function(w,p){if(p===N.PlaylistLevelType.MAIN){var f=this.activeFragment,g=this.activeParts;if(!f)return null;if(g)for(var a=g.length;a--;){var r=g[a],o=r?r.end:f.appendedPTS;if(r.start<=w&&o!==void 0&&w<=o)return a>9&&(this.activeParts=g.slice(a-9)),r}else if(f.start<=w&&f.appendedPTS!==void 0&&w<=f.appendedPTS)return f}return this.getBufferedFrag(w,p)},h.getBufferedFrag=function(w,p){for(var f=this.fragments,g=Object.keys(f),a=g.length;a--;){var r=f[g[a]];if((r==null?void 0:r.body.type)===p&&r.buffered){var o=r.body;if(o.start<=w&&w<=o.end)return o}}return null},h.detectEvictedFragments=function(w,p,f){var g=this;Object.keys(this.fragments).forEach(function(a){var r=g.fragments[a];if(!r)return;if(!r.buffered){r.body.type===f&&g.removeFragment(r.body);return}var o=r.range[w];if(!o)return;o.time.some(function(l){var C=!g.isTimeBuffered(l.startPTS,l.endPTS,p);return C&&g.removeFragment(r.body),C})})},h.detectPartialFragments=function(w){var p=this,f=this.timeRanges,g=w.frag,a=w.part;if(!f||g.sn==="initSegment")return;var r=R(g),o=this.fragments[r];if(!o)return;Object.keys(f).forEach(function(l){var C=g.elementaryStreams[l];if(!C)return;var b=f[l],x=a!==null||C.partial===!0;o.range[l]=p.getBufferedTimes(g,a,x,b)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},h.fragBuffered=function(w){var p=R(w),f=this.fragments[p];f&&(f.backtrack=f.loaded=null,f.buffered=!0)},h.getBufferedTimes=function(w,p,f,g){for(var a={time:[],partial:f},r=p?p.start:w.start,o=p?p.end:w.end,l=w.minEndPTS||o,C=w.maxStartPTS||r,b=0;b<g.length;b++){var x=g.start(b)-this.bufferPadding,D=g.end(b)+this.bufferPadding;if(C>=x&&l<=D){a.time.push({startPTS:Math.max(r,g.start(b)),endPTS:Math.min(o,g.end(b))});break}else if(r<D&&o>x)a.partial=!0,a.time.push({startPTS:Math.max(r,g.start(b)),endPTS:Math.min(o,g.end(b))});else if(o<=x)break}return a},h.getPartialFragment=function(w){var p=null,f,g,a,r=0,o=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach(function(C){var b=l[C];if(!b)return;F(b)&&(g=b.body.start-o,a=b.body.end+o,w>=g&&w<=a&&(f=Math.min(w-g,a-w),r<=f&&(p=b.body,r=f)))}),p},h.getState=function(w){var p=R(w),f=this.fragments[p];return f?f.buffered?F(f)?L.PARTIAL:L.OK:f.backtrack?L.BACKTRACKED:L.APPENDING:L.NOT_LOADED},h.backtrack=function(w,p){var f=R(w),g=this.fragments[f];if(!g||g.backtrack)return null;var a=g.backtrack=p||g.loaded;return g.loaded=null,a},h.getBacktrackData=function(w){var p=R(w),f=this.fragments[p];if(f){var g,a=f.backtrack;if(a!=null&&(g=a.payload)!==null&&g!==void 0&&g.byteLength)return a;this.removeFragment(w)}return null},h.isTimeBuffered=function(w,p,f){for(var g,a,r=0;r<f.length;r++){if(g=f.start(r)-this.bufferPadding,a=f.end(r)+this.bufferPadding,w>=g&&p<=a)return!0;if(p<=g)return!1}return!1},h.onFragLoaded=function(w,p){var f=p.frag,g=p.part;if(f.sn==="initSegment"||f.bitrateTest||g)return;var a=R(f);this.fragments[a]={body:f,loaded:p,backtrack:null,buffered:!1,range:Object.create(null)}},h.onBufferAppended=function(w,p){var f=this,g=p.frag,a=p.part,r=p.timeRanges;if(g.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=g,a){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(a)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(l){var C=r[l];if(f.detectEvictedFragments(l,C),!a)for(var b=0;b<C.length;b++)g.appendedPTS=Math.max(C.end(b),g.appendedPTS||0)})},h.onFragBuffered=function(w,p){this.detectPartialFragments(p)},h.hasFragment=function(w){var p=R(w);return!!this.fragments[p]},h.removeFragmentsInRange=function(w,p,f){var g=this;Object.keys(this.fragments).forEach(function(a){var r=g.fragments[a];if(!r)return;if(r.buffered){var o=r.body;o.type===f&&o.start<p&&o.end>w&&g.removeFragment(o)}})},h.removeFragment=function(w){var p=R(w);w.stats.loaded=0,w.clearElementaryStreamInfo(),delete this.fragments[p]},h.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},A}();function F(A){var h,y;return A.buffered&&(((h=A.range.video)===null||h===void 0?void 0:h.partial)||((y=A.range.audio)===null||y===void 0?void 0:y.partial))}function R(A){return A.type+"_"+A.level+"_"+A.urlId+"_"+A.sn}},"./src/controller/gap-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"STALL_MINIMUM_DURATION_MS",function(){return F}),P.d(V,"MAX_START_GAP_JUMP",function(){return R}),P.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return A}),P.d(V,"SKIP_BUFFER_RANGE_START",function(){return h}),P.d(V,"default",function(){return y});var $=P("./src/utils/buffer-helper.ts"),N=P("./src/errors.ts"),L=P("./src/events.ts"),K=P("./src/utils/logger.ts"),F=250,R=2,A=.1,h=.05,y=function(){function w(f,g,a,r){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=f,this.media=g,this.fragmentTracker=a,this.hls=r}var p=w.prototype;return p.destroy=function(){this.hls=this.fragmentTracker=this.media=null},p.poll=function(g){var a=this.config,r=this.media,o=this.stalled,l=r.currentTime,C=r.seeking,b=this.seeking&&!C,x=!this.seeking&&C;if(this.seeking=C,l!==g){if(this.moved=!0,o!==null){if(this.stallReported){var D=self.performance.now()-o;K.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||b)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!$.BufferHelper.getBuffered(r).length)return;var T=$.BufferHelper.bufferInfo(r,l,0),m=T.len>0,v=T.nextStart||0;if(!m&&!v)return;if(C){var u=T.len>R,s=!v||v-l>R&&!this.fragmentTracker.getPartialFragment(l);if(u||s)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,c=Math.max(v,T.start||0)-l,O=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,M=O==null||((S=O.details)===null||S===void 0)?void 0:S.live,B=M?O.details.targetduration*2:R;if(c>0&&c<=B){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(o===null){this.stalled=j;return}var H=j-o;!C&&H>=F&&this._reportStall(T.len);var I=$.BufferHelper.bufferInfo(r,l,a.maxBufferHole);this._tryFixBufferStall(I,H)},p._tryFixBufferStall=function(g,a){var r=this.config,o=this.fragmentTracker,l=this.media,C=l.currentTime,b=o.getPartialFragment(C);if(b){var x=this._trySkipBufferHole(b);if(x)return}g.len>r.maxBufferHole&&a>r.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},p._reportStall=function(g){var a=this.hls,r=this.media,o=this.stallReported;o||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+g+")"),a.trigger(L.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}))},p._trySkipBufferHole=function(g){for(var a=this.config,r=this.hls,o=this.media,l=o.currentTime,C=0,b=$.BufferHelper.getBuffered(o),x=0;x<b.length;x++){var D=b.start(x);if(l+a.maxBufferHole>=C&&l<D){var T=Math.max(D+h,o.currentTime+A);return K.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+T),this.moved=!0,this.stalled=null,o.currentTime=T,g&&r.trigger(L.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+T,frag:g}),T}C=b.end(x)}return 0},p._tryNudgeBuffer=function(){var g=this.config,a=this.hls,r=this.media,o=r.currentTime,l=(this.nudgeRetry||0)+1;if(this.nudgeRetry=l,l<g.nudgeMaxRetry){var C=o+l*g.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+o+" to "+C),r.currentTime=C,a.trigger(L.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+g.nudgeMaxRetry+" nudges"),a.trigger(L.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},w}()},"./src/controller/id3-track-controller.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/events.ts"),N=P("./src/utils/texttrack-utils.ts"),L=P("./src/demux/id3.ts"),K=.25,F=function(){function R(h){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=h,this._registerListeners()}var A=R.prototype;return A.destroy=function(){this._unregisterListeners()},A._registerListeners=function(){var y=this.hls;y.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on($.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),y.on($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var y=this.hls;y.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off($.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),y.off($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.onMediaAttached=function(y,w){this.media=w.media},A.onMediaDetaching=function(){if(!this.id3Track)return;Object(N.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},A.getID3Track=function(y){if(!this.media)return;for(var w=0;w<y.length;w++){var p=y[w];if(p.kind==="metadata"&&p.label==="id3")return Object(N.sendAddTrackEvent)(p,this.media),p}return this.media.addTextTrack("metadata","id3")},A.onFragParsingMetadata=function(y,w){if(!this.media)return;var p=w.frag,f=w.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var g=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<f.length;a++){var r=L.getID3Frames(f[a].data);if(r){var o=f[a].pts,l=a<f.length-1?f[a+1].pts:p.end,C=l-o;C<=0&&(l=o+K);for(var b=0;b<r.length;b++){var x=r[b];if(!L.isTimeStampFrame(x)){var D=new g(o,l,"");D.value=x,this.id3Track.addCue(D)}}}}},A.onBufferFlushing=function(y,w){var p=w.startOffset,f=w.endOffset,g=w.type;if(!g||g==="audio"){var a=this.id3Track;a&&Object(N.removeCuesInRange)(a,p,f)}},R}();V.default=F},"./src/controller/latency-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return R});var $=P("./src/errors.ts"),N=P("./src/events.ts"),L=P("./src/utils/logger.ts");function K(A,h){for(var y=0;y<h.length;y++){var w=h[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(A,w.key,w)}}function F(A,h,y){return h&&K(A.prototype,h),y&&K(A,y),A}var R=function(){function A(y){var w=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return w.timeupdate()},this.hls=y,this.config=y.config,this.registerListeners()}var h=A.prototype;return h.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},h.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(N.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(N.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(N.Events.ERROR,this.onError)},h.onMediaAttached=function(w,p){this.media=p.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},h.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},h.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},h.onLevelUpdated=function(w,p){var f=p.details;this.levelDetails=f,f.advanced&&this.timeupdate(),!f.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},h.onError=function(w,p){if(p.details!==$.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,L.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},h.timeupdate=function(){var w=this.media,p=this.levelDetails;if(!w||!p)return;this.currentTime=w.currentTime;var f=this.computeLatency();if(f===null)return;this._latency=f;var g=this.config,a=g.lowLatencyMode,r=g.maxLiveSyncPlaybackRate;if(!a||r===1)return;var o=this.targetLatency;if(o===null)return;var l=f-o,C=Math.min(this.maxLatency,o+p.targetduration),b=l<C;if(p.live&&b&&l>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,r)),D=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;w.playbackRate=Math.min(x,Math.max(1,D))}else w.playbackRate!==1&&w.playbackRate!==0&&(w.playbackRate=1)},h.estimateLiveEdge=function(){var w=this.levelDetails;return w===null?null:w.edge+w.age},h.computeLatency=function(){var w=this.estimateLiveEdge();return w===null?null:w-this.currentTime},F(A,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var w=this.config,p=this.levelDetails;return w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:p?w.liveMaxLatencyDurationCount*p.targetduration:0}},{key:"targetLatency",get:function(){var w=this.levelDetails;if(w===null)return null;var p=w.holdBack,f=w.partHoldBack,g=w.targetduration,a=this.config,r=a.liveSyncDuration,o=a.liveSyncDurationCount,l=a.lowLatencyMode,C=this.hls.userConfig,b=l&&f||p;(C.liveSyncDuration||C.liveSyncDurationCount||b===0)&&(b=r!==void 0?r:o*g);var x=g,D=1;return b+Math.min(this.stallCount*D,x)}},{key:"liveSyncPosition",get:function(){var w=this.estimateLiveEdge(),p=this.targetLatency,f=this.levelDetails;if(w===null||p===null||f===null)return null;var g=f.edge,a=w-p-this.edgeStalled,r=g-f.totalduration,o=g-(this.config.lowLatencyMode&&f.partTarget||f.targetduration);return Math.min(Math.max(r,a),o)}},{key:"drift",get:function(){var w=this.levelDetails;return w===null?1:w.drift}},{key:"edgeStalled",get:function(){var w=this.levelDetails;if(w===null)return 0;var p=(this.config.lowLatencyMode&&w.partTarget||w.targetduration)*3;return Math.max(w.age-p,0)}},{key:"forwardBufferLength",get:function(){var w=this.media,p=this.levelDetails;if(!w||!p)return 0;var f=w.buffered.length;return f?w.buffered.end(f-1):p.edge-this.currentTime}}]),A}()},"./src/controller/level-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return a});var $=P("./src/types/level.ts"),N=P("./src/events.ts"),L=P("./src/errors.ts"),K=P("./src/utils/codecs.ts"),F=P("./src/controller/level-helper.ts"),R=P("./src/controller/base-playlist-controller.ts"),A=P("./src/types/loader.ts");function h(){return h=Object.assign||function(r){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var C in l)Object.prototype.hasOwnProperty.call(l,C)&&(r[C]=l[C])}return r},h.apply(this,arguments)}function y(r,o){for(var l=0;l<o.length;l++){var C=o[l];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(r,C.key,C)}}function w(r,o,l){return o&&y(r.prototype,o),l&&y(r,l),r}function p(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,f(r,o)}function f(r,o){return f=Object.setPrototypeOf||function(C,b){return C.__proto__=b,C},f(r,o)}var g=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),a=function(r){p(o,r);function o(C){var b;return b=r.call(this,C,"[level-controller]")||this,b._levels=[],b._firstLevel=-1,b._startLevel=void 0,b.currentLevelIndex=-1,b.manualLevelIndex=-1,b.onParsedComplete=void 0,b._registerListeners(),b}var l=o.prototype;return l._registerListeners=function(){var b=this.hls;b.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),b.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),b.on(N.Events.ERROR,this.onError,this)},l._unregisterListeners=function(){var b=this.hls;b.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),b.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),b.off(N.Events.ERROR,this.onError,this)},l.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},l.startLoad=function(){var b=this._levels;b.forEach(function(x){x.loadError=0}),r.prototype.startLoad.call(this)},l.onManifestLoaded=function(b,x){var D=[],T=[],m=[],v,u={},s,S=!1,c=!1,O=!1;if(x.levels.forEach(function(H){var I=H.attrs;S=S||!!(H.width&&H.height),c=c||!!H.videoCodec,O=O||!!H.audioCodec,g&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var U=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;s=u[U],s?s.url.push(H.url):(s=new $.Level(H),u[U]=s,D.push(s)),I&&(I.AUDIO&&Object(F.addGroupId)(s,"audio",I.AUDIO),I.SUBTITLES&&Object(F.addGroupId)(s,"text",I.SUBTITLES))}),(S||c)&&O&&(D=D.filter(function(H){var I=H.videoCodec,U=H.width,J=H.height;return!!I||!!(U&&J)})),D=D.filter(function(H){var I=H.audioCodec,U=H.videoCodec;return(!I||Object(K.isCodecSupportedInMp4)(I,"audio"))&&(!U||Object(K.isCodecSupportedInMp4)(U,"video"))}),x.audioTracks&&(T=x.audioTracks.filter(function(H){return!H.audioCodec||Object(K.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(F.assignTrackIdsByGroup)(T)),x.subtitles&&(m=x.subtitles,Object(F.assignTrackIdsByGroup)(m)),D.length>0){v=D[0].bitrate,D.sort(function(H,I){return H.bitrate-I.bitrate}),this._levels=D;for(var M=0;M<D.length;M++)if(D[M].bitrate===v){this._firstLevel=M,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+v);break}var B=O&&!c,j={levels:D,audioTracks:T,subtitleTracks:m,firstLevel:this._firstLevel,stats:x.stats,audio:O,video:c,altAudio:!B&&T.some(function(H){return!!H.url})};this.hls.trigger(N.Events.MANIFEST_PARSED,j),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(N.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},l.onError=function(b,x){if(r.prototype.onError.call(this,b,x),x.fatal)return;var D=x.context,T=this._levels[this.currentLevelIndex];if(D&&(D.type===A.PlaylistContextType.AUDIO_TRACK&&T.audioGroupIds&&D.groupId===T.audioGroupIds[T.urlId]||D.type===A.PlaylistContextType.SUBTITLE_TRACK&&T.textGroupIds&&D.groupId===T.textGroupIds[T.urlId])){this.redundantFailover(this.currentLevelIndex);return}var m=!1,v=!0,u;switch(x.details){case L.ErrorDetails.FRAG_LOAD_ERROR:case L.ErrorDetails.FRAG_LOAD_TIMEOUT:case L.ErrorDetails.KEY_LOAD_ERROR:case L.ErrorDetails.KEY_LOAD_TIMEOUT:if(x.frag){var s=this._levels[x.frag.level];s?(s.fragmentError++,s.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=x.frag.level)):u=x.frag.level}break;case L.ErrorDetails.LEVEL_LOAD_ERROR:case L.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(v=!1),u=D.level),m=!0;break;case L.ErrorDetails.REMUX_ALLOC_ERROR:u=x.level,m=!0;break}u!==void 0&&this.recoverLevel(x,u,m,v)},l.recoverLevel=function(b,x,D,T){var m=b.details,v=this._levels[x];if(v.loadError++,D){var u=this.retryLoadingOrFail(b);if(u)b.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(T){var s=v.url.length;if(s>1&&v.loadError<s)b.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var S=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==S&&this._levels[S].loadError===0&&(this.warn(m+": switch to "+S),b.levelRetry=!0,this.hls.nextAutoLevel=S)}}},l.redundantFailover=function(b){var x=this._levels[b],D=x.url.length;if(D>1){var T=(x.urlId+1)%D;this.warn("Switching to redundant URL-id "+T),this._levels.forEach(function(m){m.urlId=T}),this.level=b}},l.onFragLoaded=function(b,x){var D=x.frag;if(D!==void 0&&D.type===A.PlaylistLevelType.MAIN){var T=this._levels[D.level];T!==void 0&&(T.fragmentError=0,T.loadError=0)}},l.onLevelLoaded=function(b,x){var D,T=x.level,m=x.details,v=this._levels[T];if(!v){var u;this.warn("Invalid level index "+T),(u=x.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(m.deltaUpdateFailed=!0);return}T===this.currentLevelIndex?(v.fragmentError===0&&(v.loadError=0,this.retryCount=0),this.playlistLoaded(T,x,v.details)):(D=x.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(m.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(b,x){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var T=-1,m=this.hls.audioTracks[x.id].groupId,v=0;v<D.audioGroupIds.length;v++)if(D.audioGroupIds[v]===m){T=v;break}T!==D.urlId&&(D.urlId=T,this.startLoad())}},l.loadPlaylist=function(b){var x=this.currentLevelIndex,D=this._levels[x];if(this.canLoad&&D&&D.url.length>0){var T=D.urlId,m=D.url[T];if(b)try{m=b.addDirectives(m)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Attempt loading level index "+x+(b?" at sn "+b.msn+" part "+b.part:"")+" with URL-id "+T+" "+m),this.clearTimer(),this.hls.trigger(N.Events.LEVEL_LOADING,{url:m,level:x,id:T,deliveryDirectives:b||null})}},l.removeLevel=function(b,x){var D=function(v,u){return u!==x},T=this._levels.filter(function(m,v){return v!==b?!0:m.url.length>1&&x!==void 0?(m.url=m.url.filter(D),m.audioGroupIds&&(m.audioGroupIds=m.audioGroupIds.filter(D)),m.textGroupIds&&(m.textGroupIds=m.textGroupIds.filter(D)),m.urlId=0,!0):!1}).map(function(m,v){var u=m.details;return u!=null&&u.fragments&&u.fragments.forEach(function(s){s.level=v}),m});this._levels=T,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:T})},w(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(b){var x,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===b&&(x=D[b])!==null&&x!==void 0&&x.details)return;if(b<0||b>=D.length){var T=b<0;if(this.hls.trigger(N.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.LEVEL_SWITCH_ERROR,level:b,fatal:T,reason:"invalid level idx"}),T)return;b=Math.min(b,D.length-1)}this.clearTimer();var m=this.currentLevelIndex,v=D[m],u=D[b];this.log("switching to level "+b+" from "+m),this.currentLevelIndex=b;var s=h({},u,{level:b,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete s._urlId,this.hls.trigger(N.Events.LEVEL_SWITCHING,s);var S=u.details;if(!S||S.live){var c=this.switchParams(u.uri,v==null?void 0:v.details);this.loadPlaylist(c)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(b){this.manualLevelIndex=b,this._startLevel===void 0&&(this._startLevel=b),b!==-1&&(this.level=b)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(b){this._firstLevel=b}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var b=this.hls.config.startLevel;return b!==void 0?b:this._firstLevel}else return this._startLevel},set:function(b){this._startLevel=b}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(b){this.level=b,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=b)}}]),o}(R.default)},"./src/controller/level-helper.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"addGroupId",function(){return L}),P.d(V,"assignTrackIdsByGroup",function(){return K}),P.d(V,"updatePTS",function(){return F}),P.d(V,"updateFragPTSDTS",function(){return A}),P.d(V,"mergeDetails",function(){return h}),P.d(V,"mapPartIntersection",function(){return y}),P.d(V,"mapFragmentIntersection",function(){return w}),P.d(V,"adjustSliding",function(){return p}),P.d(V,"addSliding",function(){return f}),P.d(V,"computeReloadInterval",function(){return g}),P.d(V,"getFragmentWithSN",function(){return a}),P.d(V,"getPartWith",function(){return r});var $=P("./src/polyfills/number.ts"),N=P("./src/utils/logger.ts");function L(o,l,C){switch(l){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(C);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(C);break}}function K(o){var l={};o.forEach(function(C){var b=C.groupId||"";C.id=l[b]=l[b]||0,l[b]++})}function F(o,l,C){var b=o[l],x=o[C];R(b,x)}function R(o,l){var C=l.startPTS;if(Object($.isFiniteNumber)(C)){var b=0,x;l.sn>o.sn?(b=C-o.start,x=o):(b=o.start-C,x=l),x.duration!==b&&(x.duration=b)}else if(l.sn>o.sn){var D=o.cc===l.cc;D&&o.minEndPTS?l.start=o.start+(o.minEndPTS-o.start):l.start=o.start+o.duration}else l.start=Math.max(o.start-l.duration,0)}function A(o,l,C,b,x,D){var T=b-C;T<=0&&(N.logger.warn("Fragment should have a positive duration",l),b=C+l.duration,D=x+l.duration);var m=C,v=b,u=l.startPTS,s=l.endPTS;if(Object($.isFiniteNumber)(u)){var S=Math.abs(u-C);Object($.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(S,l.deltaPTS):l.deltaPTS=S,m=Math.max(C,u),C=Math.min(C,u),x=Math.min(x,l.startDTS),v=Math.min(b,s),b=Math.max(b,s),D=Math.max(D,l.endDTS)}l.duration=b-C;var c=C-l.start;l.appendedPTS=b,l.start=l.startPTS=C,l.maxStartPTS=m,l.startDTS=x,l.endPTS=b,l.minEndPTS=v,l.endDTS=D;var O=l.sn;if(!o||O<o.startSN||O>o.endSN)return 0;var M,B=O-o.startSN,j=o.fragments;for(j[B]=l,M=B;M>0;M--)R(j[M],j[M-1]);for(M=B;M<j.length-1;M++)R(j[M],j[M+1]);return o.fragmentHint&&R(j[j.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,c}function h(o,l){for(var C=null,b=o.fragments,x=b.length-1;x>=0;x--){var D=b[x].initSegment;if(D){C=D;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var T=0,m;if(w(o,l,function(M,B){M.relurl&&(T=M.cc-B.cc),Object($.isFiniteNumber)(M.startPTS)&&Object($.isFiniteNumber)(M.endPTS)&&(B.start=B.startPTS=M.startPTS,B.startDTS=M.startDTS,B.appendedPTS=M.appendedPTS,B.maxStartPTS=M.maxStartPTS,B.endPTS=M.endPTS,B.endDTS=M.endDTS,B.minEndPTS=M.minEndPTS,B.duration=M.endPTS-M.startPTS,B.duration&&(m=B),l.PTSKnown=l.alignedSliding=!0),B.elementaryStreams=M.elementaryStreams,B.loader=M.loader,B.stats=M.stats,B.urlId=M.urlId,M.initSegment&&(B.initSegment=M.initSegment,C=M.initSegment)}),C){var v=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;v.forEach(function(M){var B;(!M.initSegment||M.initSegment.relurl===((B=C)===null||B===void 0?void 0:B.relurl))&&(M.initSegment=C)})}if(l.skippedSegments&&(l.deltaUpdateFailed=l.fragments.some(function(M){return!M}),l.deltaUpdateFailed)){N.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=l.skippedSegments;u--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}var s=l.fragments;if(T){N.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<s.length;S++)s[S].cc+=T}l.skippedSegments&&(l.startCC=l.fragments[0].cc),y(o.partList,l.partList,function(M,B){B.elementaryStreams=M.elementaryStreams,B.stats=M.stats}),m?A(l,m,m.startPTS,m.endPTS,m.startDTS,m.endDTS):p(o,l),s.length&&(l.totalduration=l.edge-s[0].start),l.driftStartTime=o.driftStartTime,l.driftStart=o.driftStart;var c=l.advancedDateTime;if(l.advanced&&c){var O=l.edge;l.driftStart||(l.driftStartTime=c,l.driftStart=O),l.driftEndTime=c,l.driftEnd=O}else l.driftEndTime=o.driftEndTime,l.driftEnd=o.driftEnd,l.advancedDateTime=o.advancedDateTime}function y(o,l,C){if(o&&l)for(var b=0,x=0,D=o.length;x<=D;x++){var T=o[x],m=l[x+b];T&&m&&T.index===m.index&&T.fragment.sn===m.fragment.sn?C(T,m):b--}}function w(o,l,C){for(var b=l.skippedSegments,x=Math.max(o.startSN,l.startSN)-l.startSN,D=(o.fragmentHint?1:0)+(b?l.endSN:Math.min(o.endSN,l.endSN))-l.startSN,T=l.startSN-o.startSN,m=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,v=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,u=x;u<=D;u++){var s=v[T+u],S=m[u];b&&!S&&u<b&&(S=l.fragments[u]=s),s&&S&&C(s,S)}}function p(o,l){var C=l.startSN+l.skippedSegments-o.startSN,b=o.fragments;if(C<0||C>=b.length)return;f(l,b[C].start)}function f(o,l){if(l){for(var C=o.fragments,b=o.skippedSegments;b<C.length;b++)C[b].start+=l;o.fragmentHint&&(o.fragmentHint.start+=l)}}function g(o,l){var C=1e3*o.levelTargetDuration,b=C/2,x=o.age,D=x>0&&x<C*3,T=l.loading.end-l.loading.start,m,v=o.availabilityDelay;if(o.updated===!1)if(D){var u=333*o.misses;m=Math.max(Math.min(b,T*2),u),o.availabilityDelay=(o.availabilityDelay||0)+m}else m=b;else D?(v=Math.min(v||C/2,x),o.availabilityDelay=v,m=v+C-x):m=C-T;return Math.round(m)}function a(o,l,C){if(!o||!o.details)return null;var b=o.details,x=b.fragments[l-b.startSN];return x||(x=b.fragmentHint,x&&x.sn===l?x:l<b.startSN&&C&&C.sn===l?C:null)}function r(o,l,C){if(!o||!o.details)return null;var b=o.details.partList;if(b)for(var x=b.length;x--;){var D=b[x];if(D.index===C&&D.fragment.sn===l)return D}return null}},"./src/controller/stream-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return b});var $=P("./src/polyfills/number.ts"),N=P("./src/controller/base-stream-controller.ts"),L=P("./src/is-supported.ts"),K=P("./src/events.ts"),F=P("./src/utils/buffer-helper.ts"),R=P("./src/controller/fragment-tracker.ts"),A=P("./src/types/loader.ts"),h=P("./src/loader/fragment.ts"),y=P("./src/demux/transmuxer-interface.ts"),w=P("./src/types/transmuxer.ts"),p=P("./src/controller/gap-controller.ts"),f=P("./src/errors.ts"),g=P("./src/utils/logger.ts");function a(x,D){for(var T=0;T<D.length;T++){var m=D[T];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(x,m.key,m)}}function r(x,D,T){return D&&a(x.prototype,D),T&&a(x,T),x}function o(x,D){x.prototype=Object.create(D.prototype),x.prototype.constructor=x,l(x,D)}function l(x,D){return l=Object.setPrototypeOf||function(m,v){return m.__proto__=v,m},l(x,D)}var C=100,b=function(x){o(D,x);function D(m,v){var u;return u=x.call(this,m,v,"[stream-controller]")||this,u.audioCodecSwap=!1,u.gapController=null,u.level=-1,u._forceStartLoad=!1,u.altAudio=!1,u.audioOnly=!1,u.fragPlaying=null,u.onvplaying=null,u.onvseeked=null,u.fragLastKbps=0,u.stalled=!1,u.couldBacktrack=!1,u.audioCodecSwitch=!1,u.videoBuffer=null,u._registerListeners(),u}var T=D.prototype;return T._registerListeners=function(){var v=this.hls;v.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),v.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.on(K.Events.ERROR,this.onError,this),v.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),v.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T._unregisterListeners=function(){var v=this.hls;v.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.off(K.Events.ERROR,this.onError,this),v.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),v.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},T.startLoad=function(v){if(this.levels){var u=this.lastCurrentTime,s=this.hls;if(this.stopLoad(),this.setInterval(C),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var S=s.startLevel;S===-1&&(s.config.testBandwidth?(S=0,this.bitrateTest=!0):S=s.nextAutoLevel),this.level=s.nextLoadLevel=S,this.loadedmetadata=!1}u>0&&v===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),v=u),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()}else this._forceStartLoad=!0,this.state=N.State.STOPPED},T.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},T.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_LEVEL:{var v,u=this.levels,s=this.level,S=u==null||((v=u[s])===null||v===void 0)?void 0:v.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var c,O=self.performance.now(),M=this.retryDate;(!M||O>=M||(c=this.media)!==null&&c!==void 0&&c.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=N.State.IDLE)}break;default:break}this.onTickEnd()},T.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},T.doTickIdle=function(){var v,u,s=this.hls,S=this.levelLastLoaded,c=this.levels,O=this.media,M=s.config,B=s.nextLoadLevel;if(S===null||!O&&(this.startFragRequested||!M.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!c||!c[B])return;var j=c[B];this.level=s.nextLoadLevel=B;var H=j.details;if(!H||this.state===N.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==B){this.state=N.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:O,A.PlaylistLevelType.MAIN);if(I===null)return;var U=I.len,J=this.getMaxBufferLength(j.maxBitrate);if(U>=J)return;if(this._streamEnded(I,H)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,ne),this.state=N.State.ENDED;return}var he=I.end,Ee=this.getNextFragment(he,H);if(this.couldBacktrack&&!this.fragPrevious&&Ee&&Ee.sn!=="initSegment"){var Ae=Ee.sn-H.startSN;Ae>1&&(Ee=H.fragments[Ae-1],this.fragmentTracker.removeFragment(Ee))}if(Ee&&this.fragmentTracker.getState(Ee)===R.FragmentState.OK&&this.nextLoadPosition>he){var Oe=this.audioOnly&&!this.altAudio?h.ElementaryStreamTypes.AUDIO:h.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(O,Oe,A.PlaylistLevelType.MAIN),Ee=this.getNextFragment(this.nextLoadPosition,H)}if(!Ee)return;Ee.initSegment&&!Ee.initSegment.data&&!this.bitrateTest&&(Ee=Ee.initSegment),((v=Ee.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((u=Ee.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(Ee,H):this.loadFragment(Ee,H,he)},T.loadFragment=function(v,u,s){var S,c=this.fragmentTracker.getState(v);if(this.fragCurrent=v,c===R.FragmentState.BACKTRACKED){var O=this.fragmentTracker.getBacktrackData(v);if(O){this._handleFragmentLoadProgress(O),this._handleFragmentLoadComplete(O);return}else c=R.FragmentState.NOT_LOADED}c===R.FragmentState.NOT_LOADED||c===R.FragmentState.PARTIAL?v.sn==="initSegment"?this._loadInitSegment(v):this.bitrateTest?(v.bitrateTest=!0,this.log("Fragment "+v.sn+" of level "+v.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(v)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,v,u,s)):c===R.FragmentState.APPENDING?this.reduceMaxBufferLength(v.duration)&&this.fragmentTracker.removeFragment(v):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},T.getAppendedFrag=function(v){var u=this.fragmentTracker.getAppendedFrag(v,A.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},T.getBufferedFrag=function(v){return this.fragmentTracker.getBufferedFrag(v,A.PlaylistLevelType.MAIN)},T.followingBufferedFrag=function(v){return v?this.getBufferedFrag(v.end+.5):null},T.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},T.nextLevelSwitch=function(){var v=this.levels,u=this.media;if(u!=null&&u.readyState){var s,S=this.getAppendedFrag(u.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!u.paused&&v){var c=this.hls.nextLoadLevel,O=v[c],M=this.fragLastKbps;M&&this.fragCurrent?s=this.fragCurrent.duration*O.maxBitrate/(1e3*M)+1:s=0}else s=0;var B=this.getBufferedFrag(u.currentTime+s);if(B){var j=this.followingBufferedFrag(B);if(j){this.abortCurrentFrag();var H=j.maxStartPTS?j.maxStartPTS:j.start,I=j.duration,U=Math.max(B.end,H+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(U,Number.POSITIVE_INFINITY)}}}},T.abortCurrentFrag=function(){var v=this.fragCurrent;this.fragCurrent=null,v!=null&&v.loader&&v.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},T.flushMainBuffer=function(v,u){x.prototype.flushMainBuffer.call(this,v,u,this.altAudio?"video":null)},T.onMediaAttached=function(v,u){x.prototype.onMediaAttached.call(this,v,u);var s=u.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),s.addEventListener("playing",this.onvplaying),s.addEventListener("seeked",this.onvseeked),this.gapController=new p.default(this.config,s,this.fragmentTracker,this.hls)},T.onMediaDetaching=function(){var v=this.media;v&&(v.removeEventListener("playing",this.onvplaying),v.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},T.onMediaPlaying=function(){this.tick()},T.onMediaSeeked=function(){var v=this.media,u=v?v.currentTime:null;Object($.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},T.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},T.onManifestParsed=function(v,u){var s=!1,S=!1,c;u.levels.forEach(function(O){c=O.audioCodec,c&&(c.indexOf("mp4a.40.2")!==-1&&(s=!0),c.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=s&&S&&!Object(L.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},T.onLevelLoading=function(v,u){var s=this.levels;if(!s||this.state!==N.State.IDLE)return;var S=s[u.level];(!S.details||S.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(S.details))&&(this.state=N.State.WAITING_LEVEL)},T.onLevelLoaded=function(v,u){var s,S=this.levels,c=u.level,O=u.details,M=O.totalduration;if(!S){this.warn("Levels were reset while loading level "+c);return}this.log("Level "+c+" loaded ["+O.startSN+","+O.endSN+"], cc ["+O.startCC+", "+O.endCC+"] duration:"+M);var B=this.fragCurrent;B&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==u.level&&B.loader&&(this.state=N.State.IDLE,B.loader.abort()));var j=S[c],H=0;if(O.live||(s=j.details)!==null&&s!==void 0&&s.live){if(O.fragments[0]||(O.deltaUpdateFailed=!0),O.deltaUpdateFailed)return;H=this.alignPlaylists(O,j.details)}if(j.details=O,this.levelLastLoaded=c,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:O,level:c}),this.state===N.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(O))return;this.state=N.State.IDLE}this.startFragRequested?O.live&&this.synchronizeToLiveEdge(O):this.setStartPosition(O,H),this.tick()},T._handleFragmentLoadProgress=function(v){var u,s=v.frag,S=v.part,c=v.payload,O=this.levels;if(!O){this.warn("Levels were reset while fragment load was in progress. Fragment "+s.sn+" of level "+s.level+" will not be buffered");return}var M=O[s.level],B=M.details;if(!B){this.warn("Dropping fragment "+s.sn+" of level "+s.level+" after level details were reset");return}var j=M.videoCodec,H=B.PTSKnown||!B.live,I=(u=s.initSegment)===null||u===void 0?void 0:u.data,U=this._getAudioCodec(M),J=this.transmuxer=this.transmuxer||new y.default(this.hls,A.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=S?S.index:-1,he=ne!==-1,Ee=new w.ChunkMetadata(s.level,s.sn,s.stats.chunkCount,c.byteLength,ne,he),Ae=this.initPTS[s.cc];J.push(c,I,U,j,s,S,B.totalduration,H,Ee,Ae)},T.onAudioTrackSwitching=function(v,u){var s=this.altAudio,S=!!u.url,c=u.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var O=this.fragCurrent;O!=null&&O.loader&&(this.log("Switching to main audio track, cancel main fragment load"),O.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var M=this.hls;s&&M.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),M.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:c})}},T.onAudioTrackSwitched=function(v,u){var s=u.id,S=!!this.hls.audioTracks[s].url;if(S){var c=this.videoBuffer;c&&this.mediaBuffer!==c&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=c)}this.altAudio=S,this.tick()},T.onBufferCreated=function(v,u){var s=u.tracks,S,c,O=!1;for(var M in s){var B=s[M];if(B.id==="main"){if(c=M,S=B,M==="video"){var j=s[M];j&&(this.videoBuffer=j.buffer)}}else O=!0}O&&S?(this.log("Alternate track found, use "+c+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},T.onFragBuffered=function(v,u){var s=u.frag,S=u.part;if(s&&s.type!==A.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(s)){this.warn("Fragment "+s.sn+(S?" p: "+S.index:"")+" of level "+s.level+" finished buffering, but was aborted. state: "+this.state),this.state===N.State.PARSED&&(this.state=N.State.IDLE);return}var c=S?S.stats:s.stats;this.fragLastKbps=Math.round(8*c.total/(c.buffering.end-c.loading.first)),s.sn!=="initSegment"&&(this.fragPrevious=s),this.fragBufferedComplete(s,S)},T.onError=function(v,u){switch(u.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.MAIN,u);break;case f.ErrorDetails.LEVEL_LOAD_ERROR:case f.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==N.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=N.State.ERROR):!u.levelRetry&&this.state===N.State.WAITING_LEVEL&&(this.state=N.State.IDLE));break;case f.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var s=!0,S=this.getFwdBufferInfo(this.media,A.PlaylistLevelType.MAIN);S&&S.len>.5&&(s=!this.reduceMaxBufferLength(S.len)),s&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},T.checkBuffer=function(){var v=this.media,u=this.gapController;if(!v||!u||!v.readyState)return;var s=F.BufferHelper.getBuffered(v);!this.loadedmetadata&&s.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=v.currentTime},T.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},T.onBufferFlushed=function(v,u){var s=u.type;if(s!==h.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(s===h.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,s,A.PlaylistLevelType.MAIN)}},T.onLevelsUpdated=function(v,u){this.levels=u.levels},T.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},T.seekToStartPos=function(){var v=this.media,u=v.currentTime,s=this.startPosition;if(s>=0&&u<s){if(v.seeking){g.logger.log("could not seek to "+s+", already seeking at "+u);return}var S=F.BufferHelper.getBuffered(v),c=S.length?S.start(0):0,O=c-s;O>0&&(O<this.config.maxBufferHole||O<this.config.maxFragLookUpTolerance)&&(g.logger.log("adjusting start position by "+O+" to match buffer start"),s+=O,this.startPosition=s),this.log("seek to target start position "+s+" from current time "+u),v.currentTime=s}},T._getAudioCodec=function(v){var u=this.config.defaultAudioCodec||v.audioCodec;return this.audioCodecSwap&&u&&(this.log("Swapping audio codec"),u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5"),u},T._loadBitrateTestFrag=function(v){var u=this;this._doFragLoad(v).then(function(s){var S=u.hls;if(!s||S.nextLoadLevel||u.fragContextChanged(v))return;u.fragLoadError=0,u.state=N.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var c=v.stats;c.parsing.start=c.parsing.end=c.buffering.start=c.buffering.end=self.performance.now(),S.trigger(K.Events.FRAG_LOADED,s)})},T._handleTransmuxComplete=function(v){var u,s="main",S=this.hls,c=v.remuxResult,O=v.chunkMeta,M=this.getCurrentContext(O);if(!M){this.warn("The loading context changed while buffering fragment "+O.sn+" of level "+O.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(O.level);return}var B=M.frag,j=M.part,H=M.level,I=c.video,U=c.text,J=c.id3,ne=c.initSegment,he=this.altAudio?void 0:c.audio;if(this.fragContextChanged(B))return;if(this.state=N.State.PARSING,ne){ne.tracks&&(this._bufferInitSegment(H,ne.tracks,B,O),S.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:s,tracks:ne.tracks}));var Ee=ne.initPTS,Ae=ne.timescale;Object($.isFiniteNumber)(Ee)&&(this.initPTS[B.cc]=Ee,S.trigger(K.Events.INIT_PTS_FOUND,{frag:B,id:s,initPTS:Ee,timescale:Ae}))}if(I&&c.independent!==!1){if(H.details){var Oe=I.startPTS,me=I.endPTS,de=I.startDTS,pe=I.endDTS;if(j)j.elementaryStreams[I.type]={startPTS:Oe,endPTS:me,startDTS:de,endDTS:pe};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var se=this.getLoadPosition()+this.config.maxBufferHole;if(se<Oe){this.backtrack(B);return}B.setElementaryStreamInfo(I.type,B.start,me,B.start,pe,!0)}B.setElementaryStreamInfo(I.type,Oe,me,de,pe),this.bufferFragmentData(I,B,j,O)}}else if(c.independent===!1){this.backtrack(B);return}if(he){var ce=he.startPTS,Z=he.endPTS,te=he.startDTS,le=he.endDTS;j&&(j.elementaryStreams[h.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:Z,startDTS:te,endDTS:le}),B.setElementaryStreamInfo(h.ElementaryStreamTypes.AUDIO,ce,Z,te,le),this.bufferFragmentData(he,B,j,O)}if(J!=null&&(u=J.samples)!==null&&u!==void 0&&u.length){var ve={frag:B,id:s,samples:J.samples};S.trigger(K.Events.FRAG_PARSING_METADATA,ve)}if(U){var ie={frag:B,id:s,samples:U.samples};S.trigger(K.Events.FRAG_PARSING_USERDATA,ie)}},T._bufferInitSegment=function(v,u,s,S){var c=this;if(this.state!==N.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var O=u.audio,M=u.video,B=u.audiovideo;if(O){var j=v.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(j&&(j.indexOf("mp4a.40.5")!==-1?j="mp4a.40.2":j="mp4a.40.5"),O.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(j="mp4a.40.5")),H.indexOf("android")!==-1&&O.container!=="audio/mpeg"&&(j="mp4a.40.2",this.log("Android: force audio codec to "+j)),v.audioCodec&&v.audioCodec!==j&&this.log('Swapping manifest audio codec "'+v.audioCodec+'" for "'+j+'"'),O.levelCodec=j,O.id="main",this.log("Init audio buffer, container:"+O.container+", codecs[selected/level/parsed]=["+(j||"")+"/"+(v.audioCodec||"")+"/"+O.codec+"]")}M&&(M.levelCodec=v.videoCodec,M.id="main",this.log("Init video buffer, container:"+M.container+", codecs[level/parsed]=["+(v.videoCodec||"")+"/"+M.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(v.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(I){var U=u[I],J=U.initSegment;J!=null&&J.byteLength&&c.hls.trigger(K.Events.BUFFER_APPENDING,{type:I,data:J,frag:s,part:null,chunkMeta:S,parent:s.type})}),this.tick()},T.backtrack=function(v){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(v);var u=this.fragmentTracker.backtrack(v);this.fragPrevious=null,this.nextLoadPosition=v.start,u?this.resetFragmentLoading(v):this.state=N.State.BACKTRACKING},T.checkFragmentChanged=function(){var v=this.media,u=null;if(v&&v.readyState>1&&v.seeking===!1){var s=v.currentTime;if(F.BufferHelper.isBuffered(v,s)?u=this.getAppendedFrag(s):F.BufferHelper.isBuffered(v,s+.1)&&(u=this.getAppendedFrag(s+.1)),u){var S=this.fragPlaying,c=u.level;(!S||u.sn!==S.sn||S.level!==c||u.urlId!==S.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:u}),(!S||S.level!==c)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:c}),this.fragPlaying=u)}}},r(D,[{key:"nextLevel",get:function(){var v=this.nextBufferedFrag;return v?v.level:-1}},{key:"currentLevel",get:function(){var v=this.media;if(v){var u=this.getAppendedFrag(v.currentTime);if(u)return u.level}return-1}},{key:"nextBufferedFrag",get:function(){var v=this.media;if(v){var u=this.getAppendedFrag(v.currentTime);return this.followingBufferedFrag(u)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(N.default)},"./src/controller/subtitle-stream-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"SubtitleStreamController",function(){return o});var $=P("./src/events.ts"),N=P("./src/utils/logger.ts"),L=P("./src/utils/buffer-helper.ts"),K=P("./src/controller/fragment-finders.ts"),F=P("./src/utils/discontinuities.ts"),R=P("./src/controller/level-helper.ts"),A=P("./src/controller/fragment-tracker.ts"),h=P("./src/controller/base-stream-controller.ts"),y=P("./src/types/loader.ts"),w=P("./src/types/level.ts");function p(l,C){for(var b=0;b<C.length;b++){var x=C[b];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(l,x.key,x)}}function f(l,C,b){return C&&p(l.prototype,C),b&&p(l,b),l}function g(l,C){l.prototype=Object.create(C.prototype),l.prototype.constructor=l,a(l,C)}function a(l,C){return a=Object.setPrototypeOf||function(x,D){return x.__proto__=D,x},a(l,C)}var r=500,o=function(l){g(C,l);function C(x,D){var T;return T=l.call(this,x,D,"[subtitle-stream-controller]")||this,T.levels=[],T.currentTrackId=-1,T.tracksBuffered=[],T.mainDetails=null,T._registerListeners(),T}var b=C.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var D=this.hls;D.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on($.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on($.Events.ERROR,this.onError,this),D.on($.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on($.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on($.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b._unregisterListeners=function(){var D=this.hls;D.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off($.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off($.Events.ERROR,this.onError,this),D.off($.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off($.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off($.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b.startLoad=function(){this.stopLoad(),this.state=h.State.IDLE,this.setInterval(r),this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},b.onLevelLoaded=function(D,T){this.mainDetails=T.details},b.onSubtitleFragProcessed=function(D,T){var m=T.frag,v=T.success;if(this.fragPrevious=m,this.state=h.State.IDLE,!v)return;var u=this.tracksBuffered[this.currentTrackId];if(!u)return;for(var s,S=m.start,c=0;c<u.length;c++)if(S>=u[c].start&&S<=u[c].end){s=u[c];break}var O=m.start+m.duration;s?s.end=O:(s={start:S,end:O},u.push(s)),this.fragmentTracker.fragBuffered(m)},b.onBufferFlushing=function(D,T){var m=T.startOffset,v=T.endOffset;if(m===0&&v!==Number.POSITIVE_INFINITY){var u=this.currentTrackId,s=this.levels;if(!s.length||!s[u]||!s[u].details)return;var S=s[u].details,c=S.targetduration,O=v-c;if(O<=0)return;T.endOffsetSubtitles=Math.max(0,O),this.tracksBuffered.forEach(function(M){for(var B=0;B<M.length;){if(M[B].end<=O){M.shift();continue}else if(M[B].start<O)M[B].start=O;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(m,O,y.PlaylistLevelType.SUBTITLE)}},b.onError=function(D,T){var m,v=T.frag;if(!v||v.type!==y.PlaylistLevelType.SUBTITLE)return;(m=this.fragCurrent)!==null&&m!==void 0&&m.loader&&this.fragCurrent.loader.abort(),this.state=h.State.IDLE},b.onSubtitleTracksUpdated=function(D,T){var m=this,v=T.subtitleTracks;this.tracksBuffered=[],this.levels=v.map(function(u){return new w.Level(u)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(u){m.tracksBuffered[u.id]=[]}),this.mediaBuffer=null},b.onSubtitleTrackSwitch=function(D,T){if(this.currentTrackId=T.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var m=this.levels[this.currentTrackId];m!=null&&m.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,m&&this.setInterval(r)},b.onSubtitleTrackLoaded=function(D,T){var m,v=T.details,u=T.id,s=this.currentTrackId,S=this.levels;if(!S.length)return;var c=S[s];if(u>=S.length||u!==s||!c)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,v.live||(m=c.details)!==null&&m!==void 0&&m.live){var O=this.mainDetails;if(v.deltaUpdateFailed||!O)return;var M=O.fragments[0];if(!c.details)v.hasProgramDateTime&&O.hasProgramDateTime?Object(F.alignMediaPlaylistByPDT)(v,O):M&&Object(R.addSliding)(v,M.start);else{var B=this.alignPlaylists(v,c.details);B===0&&M&&Object(R.addSliding)(v,M.start)}}if(c.details=v,this.levelLastLoaded=u,this.tick(),v.live&&!this.fragCurrent&&this.media&&this.state===h.State.IDLE){var j=Object(K.findFragmentByPTS)(null,v.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)}},b._handleFragmentLoadComplete=function(D){var T=D.frag,m=D.payload,v=T.decryptdata,u=this.hls;if(this.fragContextChanged(T))return;if(m&&m.byteLength>0&&v&&v.key&&v.iv&&v.method==="AES-128"){var s=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(m),v.key.buffer,v.iv.buffer).then(function(S){var c=performance.now();u.trigger($.Events.FRAG_DECRYPTED,{frag:T,payload:S,stats:{tstart:s,tdecrypt:c}})})}},b.doTick=function(){if(!this.media){this.state=h.State.IDLE;return}if(this.state===h.State.IDLE){var D,T=this.currentTrackId,m=this.levels;if(!m.length||!m[T]||!m[T].details)return;var v=m[T].details,u=v.targetduration,s=this.config,S=this.media,c=L.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-u,s.maxBufferHole),O=c.end,M=c.len,B=this.getMaxBufferLength()+u;if(M>B)return;console.assert(v,"Subtitle track details are defined on idle subtitle stream controller tick");var j=v.fragments,H=j.length,I=v.edge,U,J=this.fragPrevious;if(O<I){var ne=s.maxFragLookUpTolerance;J&&v.hasProgramDateTime&&(U=Object(K.findFragmentByPDT)(j,J.endProgramDateTime,ne)),U||(U=Object(K.findFragmentByPTS)(J,j,O,ne),!U&&J&&J.start<j[0].start&&(U=j[0]))}else U=j[H-1];(D=U)!==null&&D!==void 0&&D.encrypted?(N.logger.log("Loading key for "+U.sn),this.state=h.State.KEY_LOADING,this.hls.trigger($.Events.KEY_LOADING,{frag:U})):U&&this.fragmentTracker.getState(U)===A.FragmentState.NOT_LOADED&&this.loadFragment(U,v,O)}},b.loadFragment=function(D,T,m){this.fragCurrent=D,l.prototype.loadFragment.call(this,D,T,m)},f(C,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),C}(h.default)},"./src/controller/subtitle-track-controller.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/events.ts"),N=P("./src/utils/texttrack-utils.ts"),L=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function F(p,f){for(var g=0;g<f.length;g++){var a=f[g];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}function R(p,f,g){return f&&F(p.prototype,f),g&&F(p,g),p}function A(p,f){p.prototype=Object.create(f.prototype),p.prototype.constructor=p,h(p,f)}function h(p,f){return h=Object.setPrototypeOf||function(a,r){return a.__proto__=r,a},h(p,f)}var y=function(p){A(f,p);function f(a){var r;return r=p.call(this,a,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var g=f.prototype;return g.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,p.prototype.destroy.call(this)},g.registerListeners=function(){var r=this.hls;r.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on($.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){var r=this.hls;r.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off($.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off($.Events.ERROR,this.onError,this)},g.onMediaAttached=function(r,o){if(this.media=o.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},g.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},g.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var r=w(this.media.textTracks);r.forEach(function(o){Object(N.clearCurrentCues)(o)}),this.subtitleTrack=-1,this.media=null},g.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},g.onManifestParsed=function(r,o){this.tracks=o.subtitleTracks},g.onSubtitleTrackLoaded=function(r,o){var l=o.id,C=o.details,b=this.trackId,x=this.tracksInGroup[b];if(!x){this.warn("Invalid subtitle track id "+l);return}var D=x.details;x.details=o.details,this.log("subtitle track "+l+" loaded ["+C.startSN+"-"+C.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,o,D))},g.onLevelLoading=function(r,o){this.switchLevel(o.level)},g.onLevelSwitching=function(r,o){this.switchLevel(o.level)},g.switchLevel=function(r){var o=this.hls.levels[r];if(!(o!=null&&o.textGroupIds))return;var l=o.textGroupIds[o.urlId];if(this.groupId!==l){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,b=this.tracks.filter(function(T){return!l||T.groupId===l});this.tracksInGroup=b;var x=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=l;var D={subtitleTracks:b};this.log("Updating subtitle tracks, "+b.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger($.Events.SUBTITLE_TRACKS_UPDATED,D),x!==-1&&this.setSubtitleTrack(x,C)}},g.findTrackId=function(r){for(var o=this.tracksInGroup,l=0;l<o.length;l++){var C=o[l];if((!this.selectDefaultTrack||C.default)&&(!r||r===C.name))return C.id}return-1},g.onError=function(r,o){if(p.prototype.onError.call(this,r,o),o.fatal||!o.context)return;o.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},g.loadPlaylist=function(r){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var l=o.id,C=o.groupId,b=o.url;if(r)try{b=r.addDirectives(b)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+l),this.hls.trigger($.Events.SUBTITLE_TRACK_LOADING,{url:b,id:l,groupId:C,deliveryDirectives:r||null})}},g.toggleTrackModes=function(r){var o=this,l=this.media,C=this.subtitleDisplay,b=this.trackId;if(!l)return;var x=w(l.textTracks),D=x.filter(function(v){return v.groupId===o.groupId});if(r===-1)[].slice.call(x).forEach(function(v){v.mode="disabled"});else{var T=D[b];T&&(T.mode="disabled")}var m=D[r];m&&(m.mode=C?"showing":"hidden")},g.setSubtitleTrack=function(r,o){var l,C=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(l=C[r])!==null&&l!==void 0&&l.details)||r<-1||r>=C.length)return;this.clearTimer();var b=C[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,b){var x=b.id,D=b.groupId,T=D===void 0?"":D,m=b.name,v=b.type,u=b.url;this.hls.trigger($.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:T,name:m,type:v,url:u});var s=this.switchParams(b.url,o==null?void 0:o.details);this.loadPlaylist(s)}else this.hls.trigger($.Events.SUBTITLE_TRACK_SWITCH,{id:r})},g.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,o=w(this.media.textTracks),l=0;l<o.length;l++)if(o[l].mode==="hidden")r=l;else if(o[l].mode==="showing"){r=l;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},R(f,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,o)}}]),f}(L.default);function w(p){for(var f=[],g=0;g<p.length;g++){var a=p[g];a.kind==="subtitles"&&a.label&&f.push(p[g])}return f}V.default=y},"./src/controller/timeline-controller.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"TimelineController",function(){return w});var $=P("./src/polyfills/number.ts"),N=P("./src/events.ts"),L=P("./src/utils/cea-608-parser.ts"),K=P("./src/utils/output-filter.ts"),F=P("./src/utils/webvtt-parser.ts"),R=P("./src/utils/texttrack-utils.ts"),A=P("./src/utils/imsc1-ttml-parser.ts"),h=P("./src/types/loader.ts"),y=P("./src/utils/logger.ts"),w=function(){function a(o){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=g(),this.captionsProperties=void 0,this.hls=o,this.config=o.config,this.Cues=o.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var l=new K.default(this,"textTrack1"),C=new K.default(this,"textTrack2"),b=new K.default(this,"textTrack3"),x=new K.default(this,"textTrack4");this.cea608Parser1=new L.default(1,l,C),this.cea608Parser2=new L.default(3,b,x)}o.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(N.Events.FRAG_LOADING,this.onFragLoading,this),o.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=a.prototype;return r.destroy=function(){var l=this.hls;l.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.off(N.Events.FRAG_LOADING,this.onFragLoading,this),l.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.off(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(l,C,b,x,D){for(var T=!1,m=D.length;m--;){var v=D[m],u=f(v[0],v[1],C,b);if(u>=0&&(v[0]=Math.min(v[0],C),v[1]=Math.max(v[1],b),T=!0,u/(b-C)>.5))return}if(T||D.push([C,b]),this.config.renderTextTracksNatively){var s=this.captionsTracks[l];this.Cues.newCue(s,C,b,x)}else{var S=this.Cues.newCue(null,C,b,x);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:S,track:l})}},r.onInitPtsFound=function(l,C){var b=this,x=C.frag,D=C.id,T=C.initPTS,m=C.timescale,v=this.unparsedVttFrags;D==="main"&&(this.initPTS[x.cc]=T,this.timescale[x.cc]=m),v.length&&(this.unparsedVttFrags=[],v.forEach(function(u){b.onFragLoaded(N.Events.FRAG_LOADED,u)}))},r.getExistingTrack=function(l){var C=this.media;if(C)for(var b=0;b<C.textTracks.length;b++){var x=C.textTracks[b];if(x[l])return x}return null},r.createCaptionsTrack=function(l){this.config.renderTextTracksNatively?this.createNativeTrack(l):this.createNonNativeTrack(l)},r.createNativeTrack=function(l){if(this.captionsTracks[l])return;var C=this.captionsProperties,b=this.captionsTracks,x=this.media,D=C[l],T=D.label,m=D.languageCode,v=this.getExistingTrack(l);if(v)b[l]=v,Object(R.clearCurrentCues)(b[l]),Object(R.sendAddTrackEvent)(b[l],x);else{var u=this.createTextTrack("captions",T,m);u&&(u[l]=!0,b[l]=u)}},r.createNonNativeTrack=function(l){if(this.nonNativeCaptionsTracks[l])return;var C=this.captionsProperties[l];if(!C)return;var b=C.label,x={_id:l,label:b,kind:"captions",default:C.media?!!C.media.default:!1,closedCaptions:C.media};this.nonNativeCaptionsTracks[l]=x,this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},r.createTextTrack=function(l,C,b){var x=this.media;return x?x.addTextTrack(l,C,b):void 0},r.onMediaAttaching=function(l,C){this.media=C.media,this._cleanTracks()},r.onMediaDetaching=function(){var l=this.captionsTracks;Object.keys(l).forEach(function(C){Object(R.clearCurrentCues)(l[C]),delete l[C]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=g(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},r._cleanTracks=function(){var l=this.media;if(!l)return;var C=l.textTracks;if(C)for(var b=0;b<C.length;b++)Object(R.clearCurrentCues)(C[b])},r.onSubtitleTracksUpdated=function(l,C){var b=this;this.textTracks=[];var x=C.subtitleTracks||[],D=x.some(function(u){return u.textCodec===A.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var T=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var m=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,s){var S;if(s<m.length){for(var c=null,O=0;O<m.length;O++)if(p(m[O],u)){c=m[O];break}c&&(S=c)}S?Object(R.clearCurrentCues)(S):(S=b.createTextTrack("subtitles",u.name,u.lang),S&&(S.mode="disabled")),S&&(S.groupId=u.groupId,b.textTracks.push(S))})}else if(!T&&this.tracks&&this.tracks.length){var v=this.tracks.map(function(u){return{label:u.name,kind:u.type.toLowerCase(),default:u.default,subtitleTrack:u}});this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:v})}}},r.onManifestLoaded=function(l,C){var b=this;this.config.enableCEA708Captions&&C.captions&&C.captions.forEach(function(x){var D=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!D)return;var T="textTrack"+D[1],m=b.captionsProperties[T];if(!m)return;m.label=x.name,x.lang&&(m.languageCode=x.lang),m.media=x})},r.onFragLoading=function(l,C){var b=this.cea608Parser1,x=this.cea608Parser2,D=this.lastSn,T=this.lastPartIndex;if(!this.enabled||!(b&&x))return;if(C.frag.type===h.PlaylistLevelType.MAIN){var m,v,u=C.frag.sn,s=(m=C==null||((v=C.part)===null||v===void 0)?void 0:v.index)!=null?m:-1;u===D+1||u===D&&s===T+1||(b.reset(),x.reset()),this.lastSn=u,this.lastPartIndex=s}},r.onFragLoaded=function(l,C){var b=C.frag,x=C.payload,D=this.initPTS,T=this.unparsedVttFrags;if(b.type===h.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object($.isFiniteNumber)(D[b.cc])){T.push(C),D.length&&this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:b,error:new Error("Missing initial subtitle PTS")});return}var m=b.decryptdata;if(m==null||m.key==null||m.method!=="AES-128"){var v=this.tracks[b.level],u=this.vttCCs;u[b.cc]||(u[b.cc]={start:b.start,prevCC:this.prevCC,new:!0},this.prevCC=b.cc),v&&v.textCodec===A.IMSC1_CODEC?this._parseIMSC1(b,x):this._parseVTTs(b,x,u)}}else this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:b,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(l,C){var b=this,x=this.hls;Object(A.parseIMSC1)(C,this.initPTS[l.cc],this.timescale[l.cc],function(D){b._appendCues(D,l.level),x.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(D){y.logger.log("Failed to parse IMSC1: "+D),x.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:D})})},r._parseVTTs=function(l,C,b){var x=this,D=this.hls;Object(F.parseWebVTT)(C,this.initPTS[l.cc],this.timescale[l.cc],b,l.cc,l.start,function(T){x._appendCues(T,l.level),D.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(T){x._fallbackToIMSC1(l,C),y.logger.log("Failed to parse VTT cue: "+T),D.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:T})})},r._fallbackToIMSC1=function(l,C){var b=this,x=this.tracks[l.level];x.textCodec||Object(A.parseIMSC1)(C,this.initPTS[l.cc],this.timescale[l.cc],function(){x.textCodec=A.IMSC1_CODEC,b._parseIMSC1(l,C)},function(){x.textCodec="wvtt"})},r._appendCues=function(l,C){var b=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[C];if(x.mode==="disabled")return;l.forEach(function(m){return Object(R.addCueToTrack)(x,m)})}else{var D=this.tracks[C],T=D.default?"default":"subtitles"+C;b.trigger(N.Events.CUES_PARSED,{type:"subtitles",cues:l,track:T})}},r.onFragDecrypted=function(l,C){var b=C.frag;if(b.type===h.PlaylistLevelType.SUBTITLE){if(!Object($.isFiniteNumber)(this.initPTS[b.cc])){this.unparsedVttFrags.push(C);return}this.onFragLoaded(N.Events.FRAG_LOADED,C)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(l,C){var b=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(b&&x))return;for(var D=0;D<C.samples.length;D++){var T=C.samples[D].bytes;if(T){var m=this.extractCea608Data(T);b.addData(C.samples[D].pts,m[0]),x.addData(C.samples[D].pts,m[1])}}},r.onBufferFlushing=function(l,C){var b=C.startOffset,x=C.endOffset,D=C.endOffsetSubtitles,T=C.type,m=this.media;if(!m||m.currentTime<x)return;if(!T||T==="video"){var v=this.captionsTracks;Object.keys(v).forEach(function(s){return Object(R.removeCuesInRange)(v[s],b,x)})}if(this.config.renderTextTracksNatively&&(b===0&&D!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(s){return Object(R.removeCuesInRange)(u[s],b,D)})}},r.extractCea608Data=function(l){for(var C=l[0]&31,b=2,x=[[],[]],D=0;D<C;D++){var T=l[b++],m=127&l[b++],v=127&l[b++],u=(4&T)!==0,s=3&T;if(m===0&&v===0)continue;u&&((s===0||s===1)&&(x[s].push(m),x[s].push(v)))}return x},a}();function p(a,r){return a&&a.label===r.name&&!(a.textTrack1||a.textTrack2)}function f(a,r,o,l){return Math.min(r,l)-Math.max(a,o)}function g(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return $});var $=function(){function N(K,F){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=F}var L=N.prototype;return L.decrypt=function(F,R){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},R,F)},N}()},"./src/crypt/aes-decryptor.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"removePadding",function(){return N}),P.d(V,"default",function(){return L});var $=P("./src/utils/typed-array.ts");function N(K){var F=K.byteLength,R=F&&new DataView(K.buffer).getUint8(F-1);return R?Object($.sliceUint8)(K,0,F-R):K}var L=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var F=K.prototype;return F.uint8ArrayToUint32Array_=function(A){for(var h=new DataView(A),y=new Uint32Array(4),w=0;w<4;w++)y[w]=h.getUint32(w*4);return y},F.initTable=function(){var A=this.sBox,h=this.invSBox,y=this.subMix,w=y[0],p=y[1],f=y[2],g=y[3],a=this.invSubMix,r=a[0],o=a[1],l=a[2],C=a[3],b=new Uint32Array(256),x=0,D=0,T=0;for(T=0;T<256;T++)T<128?b[T]=T<<1:b[T]=T<<1^283;for(T=0;T<256;T++){var m=D^D<<1^D<<2^D<<3^D<<4;m=m>>>8^m&255^99,A[x]=m,h[m]=x;var v=b[x],u=b[v],s=b[u],S=b[m]*257^m*16843008;w[x]=S<<24|S>>>8,p[x]=S<<16|S>>>16,f[x]=S<<8|S>>>24,g[x]=S,S=s*16843009^u*65537^v*257^x*16843008,r[m]=S<<24|S>>>8,o[m]=S<<16|S>>>16,l[m]=S<<8|S>>>24,C[m]=S,x?(x=v^b[b[b[s^v]]],D^=b[b[D]]):x=D=1}},F.expandKey=function(A){for(var h=this.uint8ArrayToUint32Array_(A),y=!0,w=0;w<h.length&&y;)y=h[w]===this.key[w],w++;if(y)return;this.key=h;var p=this.keySize=h.length;if(p!==4&&p!==6&&p!==8)throw new Error("Invalid aes key size="+p);var f=this.ksRows=(p+6+1)*4,g,a,r=this.keySchedule=new Uint32Array(f),o=this.invKeySchedule=new Uint32Array(f),l=this.sBox,C=this.rcon,b=this.invSubMix,x=b[0],D=b[1],T=b[2],m=b[3],v,u;for(g=0;g<f;g++){if(g<p){v=r[g]=h[g];continue}u=v,g%p===0?(u=u<<8|u>>>24,u=l[u>>>24]<<24|l[u>>>16&255]<<16|l[u>>>8&255]<<8|l[u&255],u^=C[g/p|0]<<24):p>6&&g%p===4&&(u=l[u>>>24]<<24|l[u>>>16&255]<<16|l[u>>>8&255]<<8|l[u&255]),r[g]=v=(r[g-p]^u)>>>0}for(a=0;a<f;a++)g=f-a,a&3?u=r[g]:u=r[g-4],a<4||g<=4?o[a]=u:o[a]=x[l[u>>>24]]^D[l[u>>>16&255]]^T[l[u>>>8&255]]^m[l[u&255]],o[a]=o[a]>>>0},F.networkToHostOrderSwap=function(A){return A<<24|(A&65280)<<8|(A&16711680)>>8|A>>>24},F.decrypt=function(A,h,y){for(var w=this.keySize+6,p=this.invKeySchedule,f=this.invSBox,g=this.invSubMix,a=g[0],r=g[1],o=g[2],l=g[3],C=this.uint8ArrayToUint32Array_(y),b=C[0],x=C[1],D=C[2],T=C[3],m=new Int32Array(A),v=new Int32Array(m.length),u,s,S,c,O,M,B,j,H,I,U,J,ne,he,Ee=this.networkToHostOrderSwap;h<m.length;){for(H=Ee(m[h]),I=Ee(m[h+1]),U=Ee(m[h+2]),J=Ee(m[h+3]),O=H^p[0],M=J^p[1],B=U^p[2],j=I^p[3],ne=4,he=1;he<w;he++)u=a[O>>>24]^r[M>>16&255]^o[B>>8&255]^l[j&255]^p[ne],s=a[M>>>24]^r[B>>16&255]^o[j>>8&255]^l[O&255]^p[ne+1],S=a[B>>>24]^r[j>>16&255]^o[O>>8&255]^l[M&255]^p[ne+2],c=a[j>>>24]^r[O>>16&255]^o[M>>8&255]^l[B&255]^p[ne+3],O=u,M=s,B=S,j=c,ne=ne+4;u=f[O>>>24]<<24^f[M>>16&255]<<16^f[B>>8&255]<<8^f[j&255]^p[ne],s=f[M>>>24]<<24^f[B>>16&255]<<16^f[j>>8&255]<<8^f[O&255]^p[ne+1],S=f[B>>>24]<<24^f[j>>16&255]<<16^f[O>>8&255]<<8^f[M&255]^p[ne+2],c=f[j>>>24]<<24^f[O>>16&255]<<16^f[M>>8&255]<<8^f[B&255]^p[ne+3],v[h]=Ee(u^b),v[h+1]=Ee(c^x),v[h+2]=Ee(S^D),v[h+3]=Ee(s^T),b=H,x=I,D=U,T=J,h=h+4}return v.buffer},K}()},"./src/crypt/decrypter.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return h});var $=P("./src/crypt/aes-crypto.ts"),N=P("./src/crypt/fast-aes-key.ts"),L=P("./src/crypt/aes-decryptor.ts"),K=P("./src/utils/logger.ts"),F=P("./src/utils/mp4-tools.ts"),R=P("./src/utils/typed-array.ts"),A=16,h=function(){function y(p,f,g){var a=g===void 0?{}:g,r=a.removePKCS7Padding,o=r===void 0?!0:r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=p,this.config=f,this.removePKCS7Padding=o,o)try{var l=self.crypto;l&&(this.subtle=l.subtle||l.webkitSubtle)}catch(C){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var w=y.prototype;return w.destroy=function(){this.observer=null},w.isSync=function(){return this.config.enableSoftwareAES},w.flush=function(){var f=this.currentResult;if(!f){this.reset();return}var g=new Uint8Array(f);return this.reset(),this.removePKCS7Padding?Object(L.removePadding)(g):g},w.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},w.decrypt=function(f,g,a,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(f),g,a);var o=this.flush();o&&r(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(f),g,a).then(r)},w.softwareDecrypt=function(f,g,a){var r=this.currentIV,o=this.currentResult,l=this.remainderData;this.logOnce("JS AES decrypt"),l&&(f=Object(F.appendUint8Array)(l,f),this.remainderData=null);var C=this.getValidChunk(f);if(!C.length)return null;r&&(a=r);var b=this.softwareDecrypter;b||(b=this.softwareDecrypter=new L.default),b.expandKey(g);var x=o;return this.currentResult=b.decrypt(C.buffer,0,a),this.currentIV=Object(R.sliceUint8)(C,-16).buffer,x||null},w.webCryptoDecrypt=function(f,g,a){var r=this,o=this.subtle;return(this.key!==g||!this.fastAesKey)&&(this.key=g,this.fastAesKey=new N.default(o,g)),this.fastAesKey.expandKey().then(function(l){if(!o)return Promise.reject(new Error("web crypto not initialized"));var C=new $.default(o,a);return C.decrypt(f.buffer,l)}).catch(function(l){return r.onWebCryptoError(l,f,g,a)})},w.onWebCryptoError=function(f,g,a,r){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",f),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(g,a,r)},w.getValidChunk=function(f){var g=f,a=f.length-f.length%A;return a!==f.length&&(g=Object(R.sliceUint8)(f,0,a),this.remainderData=Object(R.sliceUint8)(f,a)),g},w.logOnce=function(f){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+f),this.logEnabled=!1},y}()},"./src/crypt/fast-aes-key.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return $});var $=function(){function N(K,F){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=F}var L=N.prototype;return L.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},N}()},"./src/demux/aacdemuxer.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/demux/base-audio-demuxer.ts"),N=P("./src/demux/adts.ts"),L=P("./src/utils/logger.ts"),K=P("./src/demux/id3.ts");function F(h,y){h.prototype=Object.create(y.prototype),h.prototype.constructor=h,R(h,y)}function R(h,y){return R=Object.setPrototypeOf||function(p,f){return p.__proto__=f,p},R(h,y)}var A=function(h){F(y,h);function y(p,f){var g;return g=h.call(this)||this,g.observer=void 0,g.config=void 0,g.observer=p,g.config=f,g}var w=y.prototype;return w.resetInitSegment=function(f,g,a){h.prototype.resetInitSegment.call(this,f,g,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:f,duration:a,inputTimeScale:9e4,dropped:0}},y.probe=function(f){if(!f)return!1;for(var g=K.getID3Data(f,0)||[],a=g.length,r=f.length;a<r;a++)if(N.probe(f,a))return L.logger.log("ADTS sync word found !"),!0;return!1},w.canParse=function(f,g){return N.canParse(f,g)},w.appendFrame=function(f,g,a){N.initTrackConfig(f,this.observer,g,a,f.manifestCodec);var r=N.appendFrame(f,g,a,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},y}($.default);A.minProbeByteLength=9,V.default=A},"./src/demux/adts.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"getAudioConfig",function(){return K}),P.d(V,"isHeaderPattern",function(){return F}),P.d(V,"getHeaderLength",function(){return R}),P.d(V,"getFullFrameLength",function(){return A}),P.d(V,"canGetFrameLength",function(){return h}),P.d(V,"isHeader",function(){return y}),P.d(V,"canParse",function(){return w}),P.d(V,"probe",function(){return p}),P.d(V,"initTrackConfig",function(){return f}),P.d(V,"getFrameDuration",function(){return g}),P.d(V,"parseFrameHeader",function(){return a}),P.d(V,"appendFrame",function(){return r});var $=P("./src/utils/logger.ts"),N=P("./src/errors.ts"),L=P("./src/events.ts");function K(o,l,C,b){var x,D,T,m,v=navigator.userAgent.toLowerCase(),u=b,s=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((l[C+2]&192)>>>6)+1;var S=(l[C+2]&60)>>>2;if(S>s.length-1){o.trigger(L.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return T=(l[C+2]&1)<<2,T|=(l[C+3]&192)>>>6,$.logger.log("manifest codec:"+b+", ADTS type:"+x+", samplingIndex:"+S),/firefox/i.test(v)?S>=6?(x=5,m=new Array(4),D=S-3):(x=2,m=new Array(2),D=S):v.indexOf("android")!==-1?(x=2,m=new Array(2),D=S):(x=5,m=new Array(4),b&&(b.indexOf("mp4a.40.29")!==-1||b.indexOf("mp4a.40.5")!==-1)||!b&&S>=6?D=S-3:((b&&b.indexOf("mp4a.40.2")!==-1&&(S>=6&&T===1||/vivaldi/i.test(v))||!b&&T===1)&&(x=2,m=new Array(2)),D=S)),m[0]=x<<3,m[0]|=(S&14)>>1,m[1]|=(S&1)<<7,m[1]|=T<<3,x===5&&(m[1]|=(D&14)>>1,m[2]=(D&1)<<7,m[2]|=2<<2,m[3]=0),{config:m,samplerate:s[S],channelCount:T,codec:"mp4a.40."+x,manifestCodec:u}}function F(o,l){return o[l]===255&&(o[l+1]&246)===240}function R(o,l){return o[l+1]&1?7:9}function A(o,l){return(o[l+3]&3)<<11|o[l+4]<<3|(o[l+5]&224)>>>5}function h(o,l){return l+5<o.length}function y(o,l){return l+1<o.length&&F(o,l)}function w(o,l){return h(o,l)&&F(o,l)&&A(o,l)<=o.length-l}function p(o,l){if(y(o,l)){var C=R(o,l);if(l+C>=o.length)return!1;var b=A(o,l);if(b<=C)return!1;var x=l+b;return x===o.length||y(o,x)}return!1}function f(o,l,C,b,x){if(!o.samplerate){var D=K(l,C,b,x);if(!D)return;o.config=D.config,o.samplerate=D.samplerate,o.channelCount=D.channelCount,o.codec=D.codec,o.manifestCodec=D.manifestCodec,$.logger.log("parsed codec:"+o.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function g(o){return 1024*9e4/o}function a(o,l,C,b,x){var D=R(o,l),T=A(o,l);if(T-=D,T>0){var m=C+b*x;return{headerLength:D,frameLength:T,stamp:m}}}function r(o,l,C,b,x){var D=g(o.samplerate),T=a(l,C,b,x,D);if(T){var m=T.frameLength,v=T.headerLength,u=T.stamp,s=v+m,S=Math.max(0,C+s-l.length),c;S?(c=new Uint8Array(s-v),c.set(l.subarray(C+v,l.length),0)):c=l.subarray(C+v,C+s);var O={unit:c,pts:u};return S||o.samples.push(O),{sample:O,length:s,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"initPTSFn",function(){return A});var $=P("./src/polyfills/number.ts"),N=P("./src/demux/id3.ts"),L=P("./src/demux/dummy-demuxed-track.ts"),K=P("./src/utils/mp4-tools.ts"),F=P("./src/utils/typed-array.ts"),R=function(){function h(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var y=h.prototype;return y.resetInitSegment=function(p,f,g){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},y.resetTimeStamp=function(){},y.resetContiguity=function(){},y.canParse=function(p,f){return!1},y.appendFrame=function(p,f,g){},y.demux=function(p,f){this.cachedData&&(p=Object(K.appendUint8Array)(this.cachedData,p),this.cachedData=null);var g=N.getID3Data(p,0),a=g?g.length:0,r,o,l=this._audioTrack,C=this._id3Track,b=g?N.getTimeStamp(g):void 0,x=p.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=A(b,f)),g&&g.length>0&&C.samples.push({pts:this.initPTS,dts:this.initPTS,data:g}),o=this.initPTS;a<x;){if(this.canParse(p,a)){var D=this.appendFrame(l,p,a);D?(this.frameIndex++,o=D.sample.pts,a+=D.length,r=a):a=x}else N.canParse(p,a)?(g=N.getID3Data(p,a),C.samples.push({pts:o,dts:o,data:g}),a+=g.length,r=a):a++;if(a===x&&r!==x){var T=Object(F.sliceUint8)(p,r);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,T):this.cachedData=T}}return{audioTrack:l,avcTrack:Object(L.dummyTrack)(),id3Track:C,textTrack:Object(L.dummyTrack)()}},y.demuxSampleAes=function(p,f,g){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},y.flush=function(p){var f=this.cachedData;return f&&(this.cachedData=null,this.demux(f,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(L.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(L.dummyTrack)()}},y.destroy=function(){},h}(),A=function(y,w){return Object($.isFiniteNumber)(y)?y*90:w*9e4};V.default=R},"./src/demux/chunk-cache.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return $});var $=function(){function L(){this.chunks=[],this.dataLength=0}var K=L.prototype;return K.push=function(R){this.chunks.push(R),this.dataLength+=R.length},K.flush=function(){var R=this.chunks,A=this.dataLength,h;if(R.length)R.length===1?h=R[0]:h=N(R,A);else return new Uint8Array(0);return this.reset(),h},K.reset=function(){this.chunks.length=0,this.dataLength=0},L}();function N(L,K){for(var F=new Uint8Array(K),R=0,A=0;A<L.length;A++){var h=L[A];F.set(h,R),R+=h.length}return F}},"./src/demux/dummy-demuxed-track.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"dummyTrack",function(){return $});function $(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/utils/logger.ts"),N=function(){function L(F){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=F,this.bytesAvailable=F.byteLength,this.word=0,this.bitsAvailable=0}var K=L.prototype;return K.loadWord=function(){var R=this.data,A=this.bytesAvailable,h=R.byteLength-A,y=new Uint8Array(4),w=Math.min(4,A);if(w===0)throw new Error("no bytes available");y.set(R.subarray(h,h+w)),this.word=new DataView(y.buffer).getUint32(0),this.bitsAvailable=w*8,this.bytesAvailable-=w},K.skipBits=function(R){var A;this.bitsAvailable>R?(this.word<<=R,this.bitsAvailable-=R):(R-=this.bitsAvailable,A=R>>3,R-=A>>3,this.bytesAvailable-=A,this.loadWord(),this.word<<=R,this.bitsAvailable-=R)},K.readBits=function(R){var A=Math.min(this.bitsAvailable,R),h=this.word>>>32-A;return R>32&&$.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=A,this.bitsAvailable>0?this.word<<=A:this.bytesAvailable>0&&this.loadWord(),A=R-A,A>0&&this.bitsAvailable?h<<A|this.readBits(A):h},K.skipLZ=function(){var R;for(R=0;R<this.bitsAvailable;++R)if((this.word&2147483648>>>R)!==0)return this.word<<=R,this.bitsAvailable-=R,R;return this.loadWord(),R+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var R=this.skipLZ();return this.readBits(R+1)-1},K.readEG=function(){var R=this.readUEG();return 1&R?1+R>>>1:-1*(R>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(R){for(var A=8,h=8,y,w=0;w<R;w++)h!==0&&(y=this.readEG(),h=(A+y+256)%256),A=h===0?A:h},K.readSPS=function(){var R=0,A=0,h=0,y=0,w,p,f,g=this.readUByte.bind(this),a=this.readBits.bind(this),r=this.readUEG.bind(this),o=this.readBoolean.bind(this),l=this.skipBits.bind(this),C=this.skipEG.bind(this),b=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);g();var D=g();if(a(5),l(3),g(),b(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var T=r();if(T===3&&l(1),b(),b(),l(1),o())for(p=T!==3?8:12,f=0;f<p;f++)o()&&(f<6?x(16):x(64))}b();var m=r();if(m===0)r();else if(m===1)for(l(1),C(),C(),w=r(),f=0;f<w;f++)C();b(),l(1);var v=r(),u=r(),s=a(1);s===0&&l(1),l(1),o()&&(R=r(),A=r(),h=r(),y=r());var S=[1,1];if(o()&&o()){var c=g();switch(c){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:{S=[g()<<8|g(),g()<<8|g()];break}}}return{width:Math.ceil((v+1)*16-R*2-A*2),height:(2-s)*(u+1)*16-(s?2:4)*(h+y),pixelRatio:S}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},L}();V.default=N},"./src/demux/id3.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"isHeader",function(){return $}),P.d(V,"isFooter",function(){return N}),P.d(V,"getID3Data",function(){return L}),P.d(V,"canParse",function(){return F}),P.d(V,"getTimeStamp",function(){return R}),P.d(V,"isTimeStampFrame",function(){return A}),P.d(V,"getID3Frames",function(){return y}),P.d(V,"decodeFrame",function(){return w}),P.d(V,"utf8ArrayToStr",function(){return r}),P.d(V,"testables",function(){return o});var $=function(x,D){return D+10<=x.length&&(x[D]===73&&x[D+1]===68&&x[D+2]===51&&(x[D+3]<255&&x[D+4]<255&&(x[D+6]<128&&x[D+7]<128&&x[D+8]<128&&x[D+9]<128)))},N=function(x,D){return D+10<=x.length&&(x[D]===51&&x[D+1]===68&&x[D+2]===73&&(x[D+3]<255&&x[D+4]<255&&(x[D+6]<128&&x[D+7]<128&&x[D+8]<128&&x[D+9]<128)))},L=function(x,D){for(var T=D,m=0;$(x,D);){m+=10;var v=K(x,D+6);m+=v,N(x,D+10)&&(m+=10),D+=m}return m>0?x.subarray(T,T+m):void 0},K=function(x,D){var T=0;return T=(x[D]&127)<<21,T|=(x[D+1]&127)<<14,T|=(x[D+2]&127)<<7,T|=x[D+3]&127,T},F=function(x,D){return $(x,D)&&K(x,D+6)+10<=x.length-D},R=function(x){for(var D=y(x),T=0;T<D.length;T++){var m=D[T];if(A(m))return a(m)}return},A=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},h=function(x){var D=String.fromCharCode(x[0],x[1],x[2],x[3]),T=K(x,4),m=10;return{type:D,size:T,data:x.subarray(m,m+T)}},y=function(x){for(var D=0,T=[];$(x,D);){var m=K(x,D+6);D+=10;for(var v=D+m;D+8<v;){var u=h(x.subarray(D)),s=w(u);s&&T.push(s),D+=u.size+10}N(x,D)&&(D+=10)}return T},w=function(x){return x.type==="PRIV"?p(x):x.type[0]==="W"?g(x):f(x)},p=function(x){if(x.size<2)return;var D=r(x.data,!0),T=new Uint8Array(x.data.subarray(D.length+1));return{key:x.type,info:D,data:T.buffer}},f=function(x){if(x.size<2)return;if(x.type==="TXXX"){var D=1,T=r(x.data.subarray(D),!0);D+=T.length+1;var m=r(x.data.subarray(D));return{key:x.type,info:T,data:m}}var v=r(x.data.subarray(1));return{key:x.type,data:v}},g=function(x){if(x.type==="WXXX"){if(x.size<2)return;var D=1,T=r(x.data.subarray(D),!0);D+=T.length+1;var m=r(x.data.subarray(D));return{key:x.type,info:T,data:m}}var v=r(x.data);return{key:x.type,data:v}},a=function(x){if(x.data.byteLength===8){var D=new Uint8Array(x.data),T=D[3]&1,m=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return m/=45,T&&(m+=4772185884e-2),Math.round(m)}return},r=function(x,D){D===void 0&&(D=!1);var T=C();if(T){var m=T.decode(x);if(D){var v=m.indexOf("\0");return v!==-1?m.substring(0,v):m}return m.replace(/\0/g,"")}for(var u=x.length,s,S,c,O="",M=0;M<u;){if(s=x[M++],s===0&&D)return O;if(s===0||s===3)continue;switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:O+=String.fromCharCode(s);break;case 12:case 13:S=x[M++],O+=String.fromCharCode((s&31)<<6|S&63);break;case 14:S=x[M++],c=x[M++],O+=String.fromCharCode((s&15)<<12|(S&63)<<6|(c&63)<<0);break;default:}}return O},o={decodeTextFrame:f},l;function C(){return!l&&typeof self.TextDecoder!="undefined"&&(l=new self.TextDecoder("utf-8")),l}},"./src/demux/mp3demuxer.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/demux/base-audio-demuxer.ts"),N=P("./src/demux/id3.ts"),L=P("./src/utils/logger.ts"),K=P("./src/demux/mpegaudio.ts");function F(h,y){h.prototype=Object.create(y.prototype),h.prototype.constructor=h,R(h,y)}function R(h,y){return R=Object.setPrototypeOf||function(p,f){return p.__proto__=f,p},R(h,y)}var A=function(h){F(y,h);function y(){return h.apply(this,arguments)||this}var w=y.prototype;return w.resetInitSegment=function(f,g,a){h.prototype.resetInitSegment.call(this,f,g,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:f,duration:a,inputTimeScale:9e4,dropped:0}},y.probe=function(f){if(!f)return!1;for(var g=N.getID3Data(f,0)||[],a=g.length,r=f.length;a<r;a++)if(K.probe(f,a))return L.logger.log("MPEG Audio sync word found !"),!0;return!1},w.canParse=function(f,g){return K.canParse(f,g)},w.appendFrame=function(f,g,a){return this.initPTS===null?void 0:K.appendFrame(f,g,a,this.initPTS,this.frameIndex)},y}($.default);A.minProbeByteLength=4,V.default=A},"./src/demux/mp4demuxer.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/utils/mp4-tools.ts"),N=P("./src/demux/dummy-demuxed-track.ts"),L=function(){function K(R,A){this.remainderData=null,this.config=void 0,this.config=A}var F=K.prototype;return F.resetTimeStamp=function(){},F.resetInitSegment=function(){},F.resetContiguity=function(){},K.probe=function(A){return Object($.findBox)({data:A,start:0,end:Math.min(A.length,16384)},["moof"]).length>0},F.demux=function(A){var h=A,y=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(h=Object($.appendUint8Array)(this.remainderData,A));var w=Object($.segmentValidRange)(h);this.remainderData=w.remainder,y.samples=w.valid||new Uint8Array}else y.samples=h;return{audioTrack:Object(N.dummyTrack)(),avcTrack:y,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},F.flush=function(){var A=Object(N.dummyTrack)();return A.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:A,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},F.demuxSampleAes=function(A,h,y){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},F.destroy=function(){},K}();L.minProbeByteLength=1024,V.default=L},"./src/demux/mpegaudio.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"appendFrame",function(){return R}),P.d(V,"parseHeader",function(){return A}),P.d(V,"isHeaderPattern",function(){return h}),P.d(V,"isHeader",function(){return y}),P.d(V,"canParse",function(){return w}),P.d(V,"probe",function(){return p});var $=null,N=[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],L=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],F=[0,1,1,4];function R(f,g,a,r,o){if(a+24>g.length)return;var l=A(g,a);if(l&&a+l.frameLength<=g.length){var C=l.samplesPerFrame*9e4/l.sampleRate,b=r+o*C,x={unit:g.subarray(a,a+l.frameLength),pts:b,dts:b};return f.config=[],f.channelCount=l.channelCount,f.samplerate=l.sampleRate,f.samples.push(x),{sample:x,length:l.frameLength,missing:0}}}function A(f,g){var a=f[g+1]>>3&3,r=f[g+1]>>1&3,o=f[g+2]>>4&15,l=f[g+2]>>2&3;if(a!==1&&o!==0&&o!==15&&l!==3){var C=f[g+2]>>1&1,b=f[g+3]>>6,x=a===3?3-r:r===3?3:4,D=N[x*14+o-1]*1e3,T=a===3?0:a===2?1:2,m=L[T*3+l],v=b===3?1:2,u=K[a][r],s=F[r],S=u*8*s,c=Math.floor(u*D/m+C)*s;if($===null){var O=navigator.userAgent||"",M=O.match(/Chrome\/(\d+)/i);$=M?parseInt(M[1]):0}var B=!!$&&$<=87;return B&&r===2&&D>=224e3&&b===0&&(f[g+3]=f[g+3]|128),{sampleRate:m,channelCount:v,frameLength:c,samplesPerFrame:S}}}function h(f,g){return f[g]===255&&(f[g+1]&224)===224&&(f[g+1]&6)!==0}function y(f,g){return g+1<f.length&&h(f,g)}function w(f,g){var a=4;return h(f,g)&&a<=f.length-g}function p(f,g){if(g+1<f.length&&h(f,g)){var a=4,r=A(f,g),o=a;r!=null&&r.frameLength&&(o=r.frameLength);var l=g+o;return l===f.length||y(f,l)}return!1}},"./src/demux/sample-aes.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/crypt/decrypter.ts"),N=P("./src/demux/tsdemuxer.ts"),L=function(){function K(R,A,h){this.keyData=void 0,this.decrypter=void 0,this.keyData=h,this.decrypter=new $.default(R,A,{removePKCS7Padding:!1})}var F=K.prototype;return F.decryptBuffer=function(A,h){this.decrypter.decrypt(A,this.keyData.key.buffer,this.keyData.iv.buffer,h)},F.decryptAacSample=function(A,h,y,w){var p=A[h].unit,f=p.subarray(16,p.length-p.length%16),g=f.buffer.slice(f.byteOffset,f.byteOffset+f.length),a=this;this.decryptBuffer(g,function(r){var o=new Uint8Array(r);p.set(o,16),w||a.decryptAacSamples(A,h+1,y)})},F.decryptAacSamples=function(A,h,y){for(;;h++){if(h>=A.length){y();return}if(A[h].unit.length<32)continue;var w=this.decrypter.isSync();if(this.decryptAacSample(A,h,y,w),!w)return}},F.getAvcEncryptedData=function(A){for(var h=Math.floor((A.length-48)/160)*16+16,y=new Int8Array(h),w=0,p=32;p<=A.length-16;p+=160,w+=16)y.set(A.subarray(p,p+16),w);return y},F.getAvcDecryptedUnit=function(A,h){for(var y=new Uint8Array(h),w=0,p=32;p<=A.length-16;p+=160,w+=16)A.set(y.subarray(w,w+16),p);return A},F.decryptAvcSample=function(A,h,y,w,p,f){var g=Object(N.discardEPB)(p.data),a=this.getAvcEncryptedData(g),r=this;this.decryptBuffer(a.buffer,function(o){p.data=r.getAvcDecryptedUnit(g,o),f||r.decryptAvcSamples(A,h,y+1,w)})},F.decryptAvcSamples=function(A,h,y,w){if(A instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;h++,y=0){if(h>=A.length){w();return}for(var p=A[h].units;!(y>=p.length);y++){var f=p[y];if(f.data.length<=48||f.type!==1&&f.type!==5)continue;var g=this.decrypter.isSync();if(this.decryptAvcSample(A,h,y,w,f,g),!g)return}}},K}();V.default=L},"./src/demux/transmuxer-interface.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return p});var $=P("./node_modules/webworkify-webpack/index.js"),N=P.n($),L=P("./src/events.ts"),K=P("./src/demux/transmuxer.ts"),F=P("./src/utils/logger.ts"),R=P("./src/errors.ts"),A=P("./src/utils/mediasource-helper.ts"),h=P("./node_modules/eventemitter3/index.js"),y=P.n(h),w=Object(A.getMediaSource)()||{isTypeSupported:function(){return!1}},p=function(){function f(a,r,o,l){var C=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=a,this.id=r,this.onTransmuxComplete=o,this.onFlush=l;var b=a.config,x=function(u,s){s=s||{},s.frag=C.frag,s.id=C.id,a.trigger(u,s)};this.observer=new h.EventEmitter,this.observer.on(L.Events.FRAG_DECRYPTED,x),this.observer.on(L.Events.ERROR,x);var D={mp4:w.isTypeSupported("video/mp4"),mpeg:w.isTypeSupported("audio/mpeg"),mp3:w.isTypeSupported('audio/mp4; codecs="mp3"')},T=navigator.vendor;if(b.enableWorker&&typeof Worker!="undefined"){F.logger.log("demuxing in webworker");var m;try{m=this.worker=$("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(v){a.trigger(L.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(v.message+" ("+v.filename+":"+v.lineno+")")})},m.postMessage({cmd:"init",typeSupported:D,vendor:T,id:r,config:JSON.stringify(b)})}catch(v){F.logger.warn("Error in worker:",v),F.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new K.default(this.observer,D,b,T,r),this.worker=null}}else this.transmuxer=new K.default(this.observer,D,b,T,r)}var g=f.prototype;return g.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var l=this.observer;l&&l.removeAllListeners(),this.observer=null},g.push=function(r,o,l,C,b,x,D,T,m,v){var u=this;m.transmuxing.start=self.performance.now();var s=this.transmuxer,S=this.worker,c=x?x.start:b.start,O=b.decryptdata,M=this.frag,B=!(M&&b.cc===M.cc),j=!(M&&m.level===M.level),H=M?m.sn-M.sn:-1,I=this.part?m.part-this.part.index:1,U=!j&&(H===1||H===0&&I===1),J=self.performance.now();(j||H||b.stats.parsing.start===0)&&(b.stats.parsing.start=J),x&&(I||!U)&&(x.stats.parsing.start=J);var ne=new K.TransmuxState(B,U,T,j,c);if(!U||B){F.logger.log("[transmuxer-interface, "+b.type+"]: Starting new transmux session for sn: "+m.sn+" p: "+m.part+" level: "+m.level+" id: "+m.id+`
discontinuity: `+B+`
trackSwitch: `+j+`
contiguous: `+U+`
accurateTimeOffset: `+T+`
timeOffset: `+c);var he=new K.TransmuxConfig(l,C,o,D,v);this.configureTransmuxer(he)}if(this.frag=b,this.part=x,S)S.postMessage({cmd:"demux",data:r,decryptdata:O,chunkMeta:m,state:ne},r instanceof ArrayBuffer?[r]:[]);else if(s){var Ee=s.push(r,O,m,ne);Object(K.isPromise)(Ee)?Ee.then(function(Ae){u.handleTransmuxComplete(Ae)}):this.handleTransmuxComplete(Ee)}},g.flush=function(r){var o=this;r.transmuxing.start=self.performance.now();var l=this.transmuxer,C=this.worker;if(C)C.postMessage({cmd:"flush",chunkMeta:r});else if(l){var b=l.flush(r);Object(K.isPromise)(b)?b.then(function(x){o.handleFlushResult(x,r)}):this.handleFlushResult(b,r)}},g.handleFlushResult=function(r,o){var l=this;r.forEach(function(C){l.handleTransmuxComplete(C)}),this.onFlush(o)},g.onWorkerMessage=function(r){var o=r.data,l=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,l.trigger(o.event,o.data);break}}},g.configureTransmuxer=function(r){var o=this.worker,l=this.transmuxer;o?o.postMessage({cmd:"configure",config:r}):l&&l.configure(r)},g.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},f}()},"./src/demux/transmuxer-worker.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return R});var $=P("./src/demux/transmuxer.ts"),N=P("./src/events.ts"),L=P("./src/utils/logger.ts"),K=P("./node_modules/eventemitter3/index.js"),F=P.n(K);function R(p){var f=new K.EventEmitter,g=function(r,o){p.postMessage({event:r,data:o})};f.on(N.Events.FRAG_DECRYPTED,g),f.on(N.Events.ERROR,g),p.addEventListener("message",function(a){var r=a.data;switch(r.cmd){case"init":{var o=JSON.parse(r.config);p.transmuxer=new $.default(f,r.typeSupported,o,r.vendor,r.id),Object(L.enableLogs)(o.debug),g("init",null);break}case"configure":{p.transmuxer.configure(r.config);break}case"demux":{var l=p.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object($.isPromise)(l)?l.then(function(x){A(p,x)}):A(p,l);break}case"flush":{var C=r.chunkMeta,b=p.transmuxer.flush(C);Object($.isPromise)(b)?b.then(function(x){y(p,x,C)}):y(p,b,C);break}default:break}})}function A(p,f){if(w(f.remuxResult))return;var g=[],a=f.remuxResult,r=a.audio,o=a.video;r&&h(g,r),o&&h(g,o),p.postMessage({event:"transmuxComplete",data:f},g)}function h(p,f){f.data1&&p.push(f.data1.buffer),f.data2&&p.push(f.data2.buffer)}function y(p,f,g){f.forEach(function(a){A(p,a)}),p.postMessage({event:"flush",data:g})}function w(p){return!p.audio&&!p.video&&!p.text&&!p.id3&&!p.initSegment}},"./src/demux/transmuxer.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return o}),P.d(V,"isPromise",function(){return b}),P.d(V,"TransmuxConfig",function(){return x}),P.d(V,"TransmuxState",function(){return D});var $=P("./src/events.ts"),N=P("./src/errors.ts"),L=P("./src/crypt/decrypter.ts"),K=P("./src/demux/aacdemuxer.ts"),F=P("./src/demux/mp4demuxer.ts"),R=P("./src/demux/tsdemuxer.ts"),A=P("./src/demux/mp3demuxer.ts"),h=P("./src/remux/mp4-remuxer.ts"),y=P("./src/remux/passthrough-remuxer.ts"),w=P("./src/demux/chunk-cache.ts"),p=P("./src/utils/mp4-tools.ts"),f=P("./src/utils/logger.ts"),g;try{g=self.performance.now.bind(self.performance)}catch(T){f.logger.debug("Unable to use Performance API on this environment"),g=self.Date.now}var a=[{demux:R.default,remux:h.default},{demux:F.default,remux:y.default},{demux:K.default,remux:h.default},{demux:A.default,remux:h.default}],r=1024;a.forEach(function(T){var m=T.demux;r=Math.max(r,m.minProbeByteLength)});var o=function(){function T(v,u,s,S,c){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 w.default,this.observer=v,this.typeSupported=u,this.config=s,this.vendor=S,this.id=c}var m=T.prototype;return m.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},m.push=function(u,s,S,c){var O=this,M=S.transmuxing;M.executeStart=g();var B=new Uint8Array(u),j=this.cache,H=this.config,I=this.currentTransmuxState,U=this.transmuxConfig;c&&(this.currentTransmuxState=c);var J=l(B,s);if(J&&J.method==="AES-128"){var ne=this.getDecrypter();if(H.enableSoftwareAES){var he=ne.softwareDecrypt(B,J.key.buffer,J.iv.buffer);if(!he)return M.executeEnd=g(),C(S);B=new Uint8Array(he)}else return this.decryptionPromise=ne.webCryptoDecrypt(B,J.key.buffer,J.iv.buffer).then(function(xe){var _e=O.push(xe,null,S);return O.decryptionPromise=null,_e}),this.decryptionPromise}var Ee=c||I,Ae=Ee.contiguous,Oe=Ee.discontinuity,me=Ee.trackSwitch,de=Ee.accurateTimeOffset,pe=Ee.timeOffset,se=U.audioCodec,ce=U.videoCodec,Z=U.defaultInitPts,te=U.duration,le=U.initSegmentData;if((Oe||me)&&this.resetInitSegment(le,se,ce,te),Oe&&this.resetInitialTimestamp(Z),Ae||this.resetContiguity(),this.needsProbing(B,Oe,me)){if(j.dataLength){var ve=j.flush();B=Object(p.appendUint8Array)(ve,B)}this.configureTransmuxer(B,U)}var ie=this.transmux(B,J,pe,de,S),oe=this.currentTransmuxState;return oe.contiguous=!0,oe.discontinuity=!1,oe.trackSwitch=!1,M.executeEnd=g(),ie},m.flush=function(u){var s=this,S=u.transmuxing;S.executeStart=g();var c=this.decrypter,O=this.cache,M=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return s.flush(u)});var j=[],H=M.timeOffset;if(c){var I=c.flush();I&&j.push(this.push(I,null,u))}var U=O.dataLength;O.reset();var J=this.demuxer,ne=this.remuxer;if(!J||!ne)return U>=r&&this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=g(),[C(u)];var he=J.flush(H);return b(he)?he.then(function(Ee){return s.flushRemux(j,Ee,u),j}):(this.flushRemux(j,he,u),j)},m.flushRemux=function(u,s,S){var c=s.audioTrack,O=s.avcTrack,M=s.id3Track,B=s.textTrack,j=this.currentTransmuxState,H=j.accurateTimeOffset,I=j.timeOffset;f.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var U=this.remuxer.remux(c,O,M,B,I,H,!0,this.id);u.push({remuxResult:U,chunkMeta:S}),S.transmuxing.executeEnd=g()},m.resetInitialTimestamp=function(u){var s=this.demuxer,S=this.remuxer;if(!s||!S)return;s.resetTimeStamp(u),S.resetTimeStamp(u)},m.resetContiguity=function(){var u=this.demuxer,s=this.remuxer;if(!u||!s)return;u.resetContiguity(),s.resetNextTimestamp()},m.resetInitSegment=function(u,s,S,c){var O=this.demuxer,M=this.remuxer;if(!O||!M)return;O.resetInitSegment(s,S,c),M.resetInitSegment(u,s,S)},m.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},m.transmux=function(u,s,S,c,O){var M;return s&&s.method==="SAMPLE-AES"?M=this.transmuxSampleAes(u,s,S,c,O):M=this.transmuxUnencrypted(u,S,c,O),M},m.transmuxUnencrypted=function(u,s,S,c){var O=this.demuxer.demux(u,s,!1,!this.config.progressive),M=O.audioTrack,B=O.avcTrack,j=O.id3Track,H=O.textTrack,I=this.remuxer.remux(M,B,j,H,s,S,!1,this.id);return{remuxResult:I,chunkMeta:c}},m.transmuxSampleAes=function(u,s,S,c,O){var M=this;return this.demuxer.demuxSampleAes(u,s,S).then(function(B){var j=M.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,S,c,!1,M.id);return{remuxResult:j,chunkMeta:O}})},m.configureTransmuxer=function(u,s){for(var S=this.config,c=this.observer,O=this.typeSupported,M=this.vendor,B=s.audioCodec,j=s.defaultInitPts,H=s.duration,I=s.initSegmentData,U=s.videoCodec,J,ne=0,he=a.length;ne<he;ne++)if(a[ne].demux.probe(u)){J=a[ne];break}J||(f.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),J={demux:F.default,remux:y.default});var Ee=this.demuxer,Ae=this.remuxer,Oe=J.remux,me=J.demux;(!Ae||!(Ae instanceof Oe))&&(this.remuxer=new Oe(c,S,O,M)),(!Ee||!(Ee instanceof me))&&(this.demuxer=new me(c,S,O),this.probe=me.probe),this.resetInitSegment(I,B,U,H),this.resetInitialTimestamp(j)},m.needsProbing=function(u,s,S){return!this.demuxer||!this.remuxer||s||S},m.getDecrypter=function(){var u=this.decrypter;return u||(u=this.decrypter=new L.default(this.observer,this.config)),u},T}();function l(T,m){var v=null;return T.byteLength>0&&m!=null&&m.key!=null&&m.iv!==null&&m.method!=null&&(v=m),v}var C=function(m){return{remuxResult:{},chunkMeta:m}};function b(T){return"then"in T&&T.then instanceof Function}var x=function(m,v,u,s,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=m,this.videoCodec=v,this.initSegmentData=u,this.duration=s,this.defaultInitPts=S},D=function(m,v,u,s,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=m,this.contiguous=v,this.accurateTimeOffset=u,this.trackSwitch=s,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"discardEPB",function(){return C});var $=P("./src/demux/adts.ts"),N=P("./src/demux/mpegaudio.ts"),L=P("./src/demux/exp-golomb.ts"),K=P("./src/demux/id3.ts"),F=P("./src/demux/sample-aes.ts"),R=P("./src/events.ts"),A=P("./src/utils/mp4-tools.ts"),h=P("./src/utils/logger.ts"),y=P("./src/errors.ts"),w={video:1,audio:2,id3:3,text:4},p=function(){function b(D,T,m){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=D,this.config=T,this.typeSupported=m}b.probe=function(T){var m=b.syncOffset(T);return m<0?!1:(m&&h.logger.warn("MPEG2-TS detected but first sync word found @ offset "+m+", junk ahead ?"),!0)},b.syncOffset=function(T){for(var m=Math.min(1e3,T.length-3*188),v=0;v<m;){if(T[v]===71&&T[v+188]===71&&T[v+2*188]===71)return v;v++}return-1},b.createTrack=function(T,m){return{container:T==="video"||T==="audio"?"video/mp2t":void 0,type:T,id:w[T],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:T==="audio"?m:void 0}};var x=b.prototype;return x.resetInitSegment=function(T,m,v){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=b.createTrack("video",v),this._audioTrack=b.createTrack("audio",v),this._id3Track=b.createTrack("id3",v),this._txtTrack=b.createTrack("text",v),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=T,this.videoCodec=m,this._duration=v},x.resetTimeStamp=function(){},x.resetContiguity=function(){var T=this._audioTrack,m=this._avcTrack,v=this._id3Track;T&&(T.pesData=null),m&&(m.pesData=null),v&&(v.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(T,m,v,u){v===void 0&&(v=!1),u===void 0&&(u=!1),v||(this.sampleAes=null);var s,S=this._avcTrack,c=this._audioTrack,O=this._id3Track,M=S.pid,B=S.pesData,j=c.pid,H=O.pid,I=c.pesData,U=O.pesData,J=!1,ne=this.pmtParsed,he=this._pmtId,Ee=T.length;if(this.remainderData&&(T=Object(A.appendUint8Array)(this.remainderData,T),Ee=T.length,this.remainderData=null),Ee<188&&!u)return this.remainderData=T,{audioTrack:c,avcTrack:S,id3Track:O,textTrack:this._txtTrack};var Ae=Math.max(0,b.syncOffset(T));Ee-=(Ee+Ae)%188,Ee<T.byteLength&&!u&&(this.remainderData=new Uint8Array(T.buffer,Ee,T.buffer.byteLength-Ee));for(var Oe=Ae;Oe<Ee;Oe+=188)if(T[Oe]===71){var me=!!(T[Oe+1]&64),de=((T[Oe+1]&31)<<8)+T[Oe+2],pe=(T[Oe+3]&48)>>4,se=void 0;if(pe>1){if(se=Oe+5+T[Oe+4],se===Oe+188)continue}else se=Oe+4;switch(de){case M:me&&(B&&(s=r(B))&&this.parseAVCPES(s,!1),B={data:[],size:0}),B&&(B.data.push(T.subarray(se,Oe+188)),B.size+=Oe+188-se);break;case j:me&&(I&&(s=r(I))&&(c.isAAC?this.parseAACPES(s):this.parseMPEGPES(s)),I={data:[],size:0}),I&&(I.data.push(T.subarray(se,Oe+188)),I.size+=Oe+188-se);break;case H:me&&(U&&(s=r(U))&&this.parseID3PES(s),U={data:[],size:0}),U&&(U.data.push(T.subarray(se,Oe+188)),U.size+=Oe+188-se);break;case 0:me&&(se+=T[se]+1),he=this._pmtId=g(T,se);break;case he:{me&&(se+=T[se]+1);var ce=a(T,se,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,v);M=ce.avc,M>0&&(S.pid=M),j=ce.audio,j>0&&(c.pid=j,c.isAAC=ce.isAAC),H=ce.id3,H>0&&(O.pid=H),J&&!ne&&(h.logger.log("reparse from beginning"),J=!1,Oe=Ae-188),ne=this.pmtParsed=!0;break}case 17:case 8191:break;default:J=!0;break}}else this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=B,c.pesData=I,O.pesData=U;var Z={audioTrack:c,avcTrack:S,id3Track:O,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(Z),Z},x.flush=function(){var T=this.remainderData;this.remainderData=null;var m;return T?m=this.demux(T,-1,!1,!0):m={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(m),this.sampleAes?this.decrypt(m,this.sampleAes):m},x.extractRemainingSamples=function(T){var m=T.audioTrack,v=T.avcTrack,u=T.id3Track,s=v.pesData,S=m.pesData,c=u.pesData,O;s&&(O=r(s))?(this.parseAVCPES(O,!0),v.pesData=null):v.pesData=s,S&&(O=r(S))?(m.isAAC?this.parseAACPES(O):this.parseMPEGPES(O),m.pesData=null):(S!=null&&S.size&&h.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=S),c&&(O=r(c))?(this.parseID3PES(O),u.pesData=null):u.pesData=c},x.demuxSampleAes=function(T,m,v){var u=this.demux(T,v,!0,!this.config.progressive),s=this.sampleAes=new F.default(this.observer,this.config,m);return this.decrypt(u,s)},x.decrypt=function(T,m){return new Promise(function(v){var u=T.audioTrack,s=T.avcTrack;u.samples&&u.isAAC?m.decryptAacSamples(u.samples,0,function(){s.samples?m.decryptAvcSamples(s.samples,0,0,function(){v(T)}):v(T)}):s.samples&&m.decryptAvcSamples(s.samples,0,0,function(){v(T)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(T,m){var v=this,u=this._avcTrack,s=this.parseAVCNALu(T.data),S=!1,c=this.avcSample,O,M=!1;T.data=null,c&&s.length&&!u.audFound&&(o(c,u),c=this.avcSample=f(!1,T.pts,T.dts,"")),s.forEach(function(B){switch(B.type){case 1:{O=!0,c||(c=v.avcSample=f(!0,T.pts,T.dts,"")),S&&(c.debug+="NDR "),c.frame=!0;var j=B.data;if(M&&j.length>4){var H=new L.default(j).readSliceType();(H===2||H===4||H===7||H===9)&&(c.key=!0)}break}case 5:O=!0,c||(c=v.avcSample=f(!0,T.pts,T.dts,"")),S&&(c.debug+="IDR "),c.key=!0,c.frame=!0;break;case 6:{O=!0,S&&c&&(c.debug+="SEI ");var I=new L.default(C(B.data));I.readUByte();for(var U=0,J=0,ne=!1,he=0;!ne&&I.bytesAvailable>1;){U=0;do he=I.readUByte(),U+=he;while(he===255);J=0;do he=I.readUByte(),J+=he;while(he===255);if(U===4&&I.bytesAvailable!==0){ne=!0;var Ee=I.readUByte();if(Ee===181){var Ae=I.readUShort();if(Ae===49){var Oe=I.readUInt();if(Oe===1195456820){var me=I.readUByte();if(me===3){for(var de=I.readUByte(),pe=I.readUByte(),se=31&de,ce=[de,pe],Z=0;Z<se;Z++)ce.push(I.readUByte()),ce.push(I.readUByte()),ce.push(I.readUByte());l(v._txtTrack.samples,{type:3,pts:T.pts,bytes:ce})}}}}}else if(U===5&&I.bytesAvailable!==0){if(ne=!0,J>16){for(var te=[],le=0;le<16;le++)te.push(I.readUByte().toString(16)),(le===3||le===5||le===7||le===9)&&te.push("-");for(var ve=J-16,ie=new Uint8Array(ve),oe=0;oe<ve;oe++)ie[oe]=I.readUByte();l(v._txtTrack.samples,{pts:T.pts,payloadType:U,uuid:te.join(""),userData:Object(K.utf8ArrayToStr)(ie),userDataBytes:ie})}}else if(J<I.bytesAvailable)for(var xe=0;xe<J;xe++)I.readUByte()}break}case 7:if(O=!0,M=!0,S&&c&&(c.debug+="SPS "),!u.sps){var _e=new L.default(B.data),Me=_e.readSPS();u.width=Me.width,u.height=Me.height,u.pixelRatio=Me.pixelRatio,u.sps=[B.data],u.duration=v._duration;for(var Ue=B.data.subarray(1,4),He="avc1.",Be=0;Be<3;Be++){var tt=Ue[Be].toString(16);tt.length<2&&(tt="0"+tt),He+=tt}u.codec=He}break;case 8:O=!0,S&&c&&(c.debug+="PPS "),u.pps||(u.pps=[B.data]);break;case 9:O=!1,u.audFound=!0,c&&o(c,u),c=v.avcSample=f(!1,T.pts,T.dts,S?"AUD ":"");break;case 12:O=!1;break;default:O=!1,c&&(c.debug+="unknown NAL "+B.type+" ");break}if(c&&O){var Je=c.units;Je.push(B)}}),m&&c&&(o(c,u),this.avcSample=null)},x.getLastNalUnit=function(){var T,m=this.avcSample,v;if(!m||m.units.length===0){var u=this._avcTrack.samples;m=u[u.length-1]}if((T=m)!==null&&T!==void 0&&T.units){var s=m.units;v=s[s.length-1]}return v},x.parseAVCNALu=function(T){var m=T.byteLength,v=this._avcTrack,u=v.naluState||0,s=u,S=[],c=0,O,M,B,j=-1,H=0;for(u===-1&&(j=0,H=T[0]&31,u=0,c=1);c<m;){if(O=T[c++],!u){u=O?0:1;continue}if(u===1){u=O?0:2;continue}if(!O)u=3;else if(O===1){if(j>=0){var I={data:T.subarray(j,c-u-1),type:H};S.push(I)}else{var U=this.getLastNalUnit();if(U&&(s&&c<=4-s&&(U.state&&(U.data=U.data.subarray(0,U.data.byteLength-s))),M=c-u-1,M>0)){var J=new Uint8Array(U.data.byteLength+M);J.set(U.data,0),J.set(T.subarray(0,M),U.data.byteLength),U.data=J,U.state=0}}c<m?(B=T[c]&31,j=c,H=B,u=0):u=-1}else u=0}if(j>=0&&u>=0){var ne={data:T.subarray(j,m),type:H,state:u};S.push(ne)}if(S.length===0){var he=this.getLastNalUnit();if(he){var Ee=new Uint8Array(he.data.byteLength+T.byteLength);Ee.set(he.data,0),Ee.set(T,he.data.byteLength),he.data=Ee}}return v.naluState=u,S},x.parseAACPES=function(T){var m=0,v=this._audioTrack,u=this.aacOverFlow,s=T.data;if(u){this.aacOverFlow=null;var S=u.sample.unit.byteLength,c=Math.min(u.missing,S),O=S-c;u.sample.unit.set(s.subarray(0,c),O),v.samples.push(u.sample),m=u.missing}var M,B;for(M=m,B=s.length;M<B-1&&!$.isHeader(s,M);M++);if(M!==m){var j,H;if(M<B-1?(j="AAC PES did not start with ADTS header,offset:"+M,H=!1):(j="no ADTS header found in AAC PES",H=!0),h.logger.warn("parsing error:"+j),this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:j}),H)return}$.initTrackConfig(v,this.observer,s,M,this.audioCodec);var I;if(T.pts!==void 0)I=T.pts;else if(u){var U=$.getFrameDuration(v.samplerate);I=u.sample.pts+U}else{h.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var J=0;M<B;)if($.isHeader(s,M)){if(M+5<B){var ne=$.appendFrame(v,s,M,I,J);if(ne)if(ne.missing)this.aacOverFlow=ne;else{M+=ne.length,J++;continue}}break}else M++},x.parseMPEGPES=function(T){var m=T.data,v=m.length,u=0,s=0,S=T.pts;if(S===void 0){h.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<v;)if(N.isHeader(m,s)){var c=N.appendFrame(this._audioTrack,m,s,S,u);if(c)s+=c.length,u++;else break}else s++},x.parseID3PES=function(T){if(T.pts===void 0){h.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(T)},b}();p.minProbeByteLength=188;function f(b,x,D,T){return{key:b,frame:!1,pts:x,dts:D,units:[],debug:T,length:0}}function g(b,x){return(b[x+10]&31)<<8|b[x+11]}function a(b,x,D,T){var m={audio:-1,avc:-1,id3:-1,isAAC:!0},v=(b[x+1]&15)<<8|b[x+2],u=x+3+v-4,s=(b[x+10]&15)<<8|b[x+11];for(x+=12+s;x<u;){var S=(b[x+1]&31)<<8|b[x+2];switch(b[x]){case 207:if(!T){h.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:m.audio===-1&&(m.audio=S);break;case 21:m.id3===-1&&(m.id3=S);break;case 219:if(!T){h.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:m.avc===-1&&(m.avc=S);break;case 3:case 4:D?m.audio===-1&&(m.audio=S,m.isAAC=!1):h.logger.log("MPEG audio found, not supported in this browser");break;case 36:h.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((b[x+3]&15)<<8|b[x+4])+5}return m}function r(b){var x=0,D,T,m,v,u,s=b.data;if(!b||b.size===0)return null;for(;s[0].length<19&&s.length>1;){var S=new Uint8Array(s[0].length+s[1].length);S.set(s[0]),S.set(s[1],s[0].length),s[0]=S,s.splice(1,1)}D=s[0];var c=(D[0]<<16)+(D[1]<<8)+D[2];if(c===1){if(T=(D[4]<<8)+D[5],T&&T>b.size-6)return null;var O=D[7];O&192&&(v=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,O&64?(u=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,v-u>60*9e4&&(h.logger.warn(Math.round((v-u)/9e4)+"s delta between PTS and DTS, align them"),v=u)):u=v),m=D[8];var M=m+9;if(b.size<=M)return null;b.size-=M;for(var B=new Uint8Array(b.size),j=0,H=s.length;j<H;j++){D=s[j];var I=D.byteLength;if(M)if(M>I){M-=I;continue}else D=D.subarray(M),I-=M,M=0;B.set(D,x),x+=I}return T&&(T-=m+3),{data:B,pts:v,dts:u,len:T}}return null}function o(b,x){if(b.units.length&&b.frame){if(b.pts===void 0){var D=x.samples,T=D.length;if(T){var m=D[T-1];b.pts=m.pts,b.dts=m.dts}else{x.dropped++;return}}x.samples.push(b)}b.debug.length&&h.logger.log(b.pts+"/"+b.dts+":"+b.debug)}function l(b,x){var D=b.length;if(D>0){if(x.pts>=b[D-1].pts)b.push(x);else for(var T=D-1;T>=0;T--)if(x.pts<b[T].pts){b.splice(T,0,x);break}}else b.push(x)}function C(b){for(var x=b.byteLength,D=[],T=1;T<x-2;)b[T]===0&&b[T+1]===0&&b[T+2]===3?(D.push(T+2),T+=2):T++;if(D.length===0)return b;var m=x-D.length,v=new Uint8Array(m),u=0;for(T=0;T<m;u++,T++)u===D[0]&&(u++,D.shift()),v[T]=b[u];return v}V.default=p},"./src/errors.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"ErrorTypes",function(){return $}),P.d(V,"ErrorDetails",function(){return N});var $;(function(L){L.NETWORK_ERROR="networkError",L.MEDIA_ERROR="mediaError",L.KEY_SYSTEM_ERROR="keySystemError",L.MUX_ERROR="muxError",L.OTHER_ERROR="otherError"})($||($={}));var N;(function(L){L.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",L.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",L.KEY_SYSTEM_NO_SESSION="keySystemNoSession",L.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",L.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",L.MANIFEST_LOAD_ERROR="manifestLoadError",L.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",L.MANIFEST_PARSING_ERROR="manifestParsingError",L.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",L.LEVEL_EMPTY_ERROR="levelEmptyError",L.LEVEL_LOAD_ERROR="levelLoadError",L.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",L.LEVEL_SWITCH_ERROR="levelSwitchError",L.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",L.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",L.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",L.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",L.FRAG_LOAD_ERROR="fragLoadError",L.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",L.FRAG_DECRYPT_ERROR="fragDecryptError",L.FRAG_PARSING_ERROR="fragParsingError",L.REMUX_ALLOC_ERROR="remuxAllocError",L.KEY_LOAD_ERROR="keyLoadError",L.KEY_LOAD_TIMEOUT="keyLoadTimeOut",L.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",L.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",L.BUFFER_APPEND_ERROR="bufferAppendError",L.BUFFER_APPENDING_ERROR="bufferAppendingError",L.BUFFER_STALLED_ERROR="bufferStalledError",L.BUFFER_FULL_ERROR="bufferFullError",L.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",L.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",L.INTERNAL_EXCEPTION="internalException",L.INTERNAL_ABORTED="aborted",L.UNKNOWN="unknown"})(N||(N={}))},"./src/events.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"Events",function(){return $});var $;(function(N){N.MEDIA_ATTACHING="hlsMediaAttaching",N.MEDIA_ATTACHED="hlsMediaAttached",N.MEDIA_DETACHING="hlsMediaDetaching",N.MEDIA_DETACHED="hlsMediaDetached",N.BUFFER_RESET="hlsBufferReset",N.BUFFER_CODECS="hlsBufferCodecs",N.BUFFER_CREATED="hlsBufferCreated",N.BUFFER_APPENDING="hlsBufferAppending",N.BUFFER_APPENDED="hlsBufferAppended",N.BUFFER_EOS="hlsBufferEos",N.BUFFER_FLUSHING="hlsBufferFlushing",N.BUFFER_FLUSHED="hlsBufferFlushed",N.MANIFEST_LOADING="hlsManifestLoading",N.MANIFEST_LOADED="hlsManifestLoaded",N.MANIFEST_PARSED="hlsManifestParsed",N.LEVEL_SWITCHING="hlsLevelSwitching",N.LEVEL_SWITCHED="hlsLevelSwitched",N.LEVEL_LOADING="hlsLevelLoading",N.LEVEL_LOADED="hlsLevelLoaded",N.LEVEL_UPDATED="hlsLevelUpdated",N.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",N.LEVELS_UPDATED="hlsLevelsUpdated",N.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",N.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",N.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",N.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",N.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",N.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",N.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",N.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",N.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",N.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",N.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",N.CUES_PARSED="hlsCuesParsed",N.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",N.INIT_PTS_FOUND="hlsInitPtsFound",N.FRAG_LOADING="hlsFragLoading",N.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",N.FRAG_LOADED="hlsFragLoaded",N.FRAG_DECRYPTED="hlsFragDecrypted",N.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",N.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",N.FRAG_PARSING_METADATA="hlsFragParsingMetadata",N.FRAG_PARSED="hlsFragParsed",N.FRAG_BUFFERED="hlsFragBuffered",N.FRAG_CHANGED="hlsFragChanged",N.FPS_DROP="hlsFpsDrop",N.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",N.ERROR="hlsError",N.DESTROYING="hlsDestroying",N.KEY_LOADING="hlsKeyLoading",N.KEY_LOADED="hlsKeyLoaded",N.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",N.BACK_BUFFER_REACHED="hlsBackBufferReached"})($||($={}))},"./src/hls.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return b});var $=P("./node_modules/url-toolkit/src/url-toolkit.js"),N=P.n($),L=P("./src/loader/playlist-loader.ts"),K=P("./src/loader/key-loader.ts"),F=P("./src/controller/id3-track-controller.ts"),R=P("./src/controller/latency-controller.ts"),A=P("./src/controller/level-controller.ts"),h=P("./src/controller/fragment-tracker.ts"),y=P("./src/controller/stream-controller.ts"),w=P("./src/is-supported.ts"),p=P("./src/utils/logger.ts"),f=P("./src/config.ts"),g=P("./node_modules/eventemitter3/index.js"),a=P.n(g),r=P("./src/events.ts"),o=P("./src/errors.ts");function l(x,D){for(var T=0;T<D.length;T++){var m=D[T];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(x,m.key,m)}}function C(x,D,T){return D&&l(x.prototype,D),T&&l(x,T),x}var b=function(){x.isSupported=function(){return Object(w.isSupported)()};function x(T){T===void 0&&(T={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new g.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var m=this.config=Object(f.mergeConfig)(x.DefaultConfig,T);this.userConfig=T,Object(p.enableLogs)(m.debug),this._autoLevelCapping=-1,m.progressive&&Object(f.enableStreamingMode)(m);var v=m.abrController,u=m.bufferController,s=m.capLevelController,S=m.fpsController,c=this.abrController=new v(this),O=this.bufferController=new u(this),M=this.capLevelController=new s(this),B=new S(this),j=new L.default(this),H=new K.default(this),I=new F.default(this),U=this.levelController=new A.default(this),J=new h.FragmentTracker(this),ne=this.streamController=new y.default(this,J);M.setStreamController(ne),B.setStreamController(ne);var he=[U,ne];this.networkControllers=he;var Ee=[j,H,c,O,M,B,I,J];this.audioTrackController=this.createController(m.audioTrackController,null,he),this.createController(m.audioStreamController,J,he),this.subtitleTrackController=this.createController(m.subtitleTrackController,null,he),this.createController(m.subtitleStreamController,J,he),this.createController(m.timelineController,null,Ee),this.emeController=this.createController(m.emeController,null,Ee),this.cmcdController=this.createController(m.cmcdController,null,Ee),this.latencyController=this.createController(R.default,null,Ee),this.coreComponents=Ee}var D=x.prototype;return D.createController=function(m,v,u){if(m){var s=v?new m(this,v):new m(this);return u&&u.push(s),s}return null},D.on=function(m,v,u){u===void 0&&(u=this),this._emitter.on(m,v,u)},D.once=function(m,v,u){u===void 0&&(u=this),this._emitter.once(m,v,u)},D.removeAllListeners=function(m){this._emitter.removeAllListeners(m)},D.off=function(m,v,u,s){u===void 0&&(u=this),this._emitter.off(m,v,u,s)},D.listeners=function(m){return this._emitter.listeners(m)},D.emit=function(m,v,u){return this._emitter.emit(m,v,u)},D.trigger=function(m,v){if(this.config.debug)return this.emit(m,m,v);try{return this.emit(m,m,v)}catch(u){p.logger.error("An internal error happened while handling event "+m+'. Error message: "'+u.message+'". Here is a stacktrace:',u),this.trigger(r.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:m,error:u})}return!1},D.listenerCount=function(m){return this._emitter.listenerCount(m)},D.destroy=function(){p.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(m){return m.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(m){return m.destroy()}),this.coreComponents.length=0},D.attachMedia=function(m){p.logger.log("attachMedia"),this._media=m,this.trigger(r.Events.MEDIA_ATTACHING,{media:m})},D.detachMedia=function(){p.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(m){this.stopLoad();var v=this.media,u=this.url,s=this.url=$.buildAbsoluteURL(self.location.href,m,{alwaysNormalize:!0});p.logger.log("loadSource:"+s),v&&u&&u!==s&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(v)),this.trigger(r.Events.MANIFEST_LOADING,{url:m})},D.startLoad=function(m){m===void 0&&(m=-1),p.logger.log("startLoad("+m+")"),this.networkControllers.forEach(function(v){v.startLoad(m)})},D.stopLoad=function(){p.logger.log("stopLoad"),this.networkControllers.forEach(function(m){m.stopLoad()})},D.swapAudioCodec=function(){p.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){p.logger.log("recoverMediaError");var m=this._media;this.detachMedia(),m&&this.attachMedia(m)},D.removeLevel=function(m,v){v===void 0&&(v=0),this.levelController.removeLevel(m,v)},C(x,[{key:"levels",get:function(){var m=this.levelController.levels;return m||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(m){p.logger.log("set currentLevel:"+m),this.loadLevel=m,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(m){p.logger.log("set nextLevel:"+m),this.levelController.manualLevel=m,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(m){p.logger.log("set loadLevel:"+m),this.levelController.manualLevel=m}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(m){this.levelController.nextLoadLevel=m}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(m){p.logger.log("set firstLevel:"+m),this.levelController.firstLevel=m}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(m){p.logger.log("set startLevel:"+m),m!==-1&&(m=Math.max(m,this.minAutoLevel)),this.levelController.startLevel=m}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(m){var v=!!m;v!==this.config.capLevelToPlayerSize&&(v?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=v)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(m){this._autoLevelCapping!==m&&(p.logger.log("set autoLevelCapping:"+m),this._autoLevelCapping=m)}},{key:"bandwidthEstimate",get:function(){var m=this.abrController.bwEstimator;return m?m.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var m=this.levels,v=this.config.minAutoBitrate;if(!m)return 0;for(var u=m.length,s=0;s<u;s++)if(m[s].maxBitrate>v)return s;return 0}},{key:"maxAutoLevel",get:function(){var m=this.levels,v=this.autoLevelCapping,u;return v===-1&&m&&m.length?u=m.length-1:u=v,u}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(m){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,m)}},{key:"audioTracks",get:function(){var m=this.audioTrackController;return m?m.audioTracks:[]}},{key:"audioTrack",get:function(){var m=this.audioTrackController;return m?m.audioTrack:-1},set:function(m){var v=this.audioTrackController;v&&(v.audioTrack=m)}},{key:"subtitleTracks",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTrack:-1},set:function(m){var v=this.subtitleTrackController;v&&(v.subtitleTrack=m)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var m=this.subtitleTrackController;return m?m.subtitleDisplay:!1},set:function(m){var v=this.subtitleTrackController;v&&(v.subtitleDisplay=m)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(m){this.config.lowLatencyMode=m}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return r.Events}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:f.hlsDefaultConfig},set:function(m){x.defaultConfig=m}}]),x}();b.defaultConfig=void 0},"./src/is-supported.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"isSupported",function(){return L}),P.d(V,"changeTypeSupported",function(){return K});var $=P("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function L(){var F=Object($.getMediaSource)();if(!F)return!1;var R=N(),A=F&&typeof F.isTypeSupported=="function"&&F.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),h=!R||R.prototype&&typeof R.prototype.appendBuffer=="function"&&typeof R.prototype.remove=="function";return!!A&&!!h}function K(){var F,R=N();return typeof(R==null||((F=R.prototype)===null||F===void 0)?void 0:F.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return p}),P.d(V,"LoadError",function(){return g});var $=P("./src/polyfills/number.ts"),N=P("./src/errors.ts");function L(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,h(a,r)}function K(a){var r=typeof Map=="function"?new Map:void 0;return K=function(l){if(l===null||!A(l))return l;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(l))return r.get(l);r.set(l,C)}function C(){return F(l,arguments,y(this).constructor)}return C.prototype=Object.create(l.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),h(C,l)},K(a)}function F(a,r,o){return R()?F=Reflect.construct:F=function(C,b,x){var D=[null];D.push.apply(D,b);var T=Function.bind.apply(C,D),m=new T;return x&&h(m,x.prototype),m},F.apply(null,arguments)}function R(){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(a){return!1}}function A(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function h(a,r){return h=Object.setPrototypeOf||function(l,C){return l.__proto__=C,l},h(a,r)}function y(a){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},y(a)}var w=Math.pow(2,17),p=function(){function a(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var r=a.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(l,C){var b=this,x=l.url;if(!x)return Promise.reject(new g({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var D=this.config,T=D.fLoader,m=D.loader;return new Promise(function(v,u){b.loader&&b.loader.destroy();var s=b.loader=l.loader=T?new T(D):new m(D),S=f(l),c={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:w};l.stats=s.stats,s.load(S,c,{onSuccess:function(M,B,j,H){b.resetLoader(l,s),v({frag:l,part:null,payload:M.data,networkDetails:H})},onError:function(M,B,j){b.resetLoader(l,s),u(new g({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,response:M,networkDetails:j}))},onAbort:function(M,B,j){b.resetLoader(l,s),u(new g({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,networkDetails:j}))},onTimeout:function(M,B,j){b.resetLoader(l,s),u(new g({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,networkDetails:j}))},onProgress:function(M,B,j,H){C&&C({frag:l,part:null,payload:j,networkDetails:H})}})})},r.loadPart=function(l,C,b){var x=this;this.abort();var D=this.config,T=D.fLoader,m=D.loader;return new Promise(function(v,u){x.loader&&x.loader.destroy();var s=x.loader=l.loader=T?new T(D):new m(D),S=f(l,C),c={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:w};C.stats=s.stats,s.load(S,c,{onSuccess:function(M,B,j,H){x.resetLoader(l,s),x.updateStatsFromPart(l,C);var I={frag:l,part:C,payload:M.data,networkDetails:H};b(I),v(I)},onError:function(M,B,j){x.resetLoader(l,s),u(new g({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,part:C,response:M,networkDetails:j}))},onAbort:function(M,B,j){l.stats.aborted=C.stats.aborted,x.resetLoader(l,s),u(new g({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,part:C,networkDetails:j}))},onTimeout:function(M,B,j){x.resetLoader(l,s),u(new g({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,part:C,networkDetails:j}))}})})},r.updateStatsFromPart=function(l,C){var b=l.stats,x=C.stats,D=x.total;if(b.loaded+=x.loaded,D){var T=Math.round(l.duration/C.duration),m=Math.min(Math.round(b.loaded/D),T),v=T-m,u=v*Math.round(b.loaded/m);b.total=b.loaded+u}else b.total=Math.max(b.loaded,b.total);var s=b.loading,S=x.loading;s.start?s.first+=S.first-S.start:(s.start=S.start,s.first=S.first),s.end=S.end},r.resetLoader=function(l,C){l.loader=null,this.loader===C&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),C.destroy()},a}();function f(a,r){r===void 0&&(r=null);var o=r||a,l={frag:a,part:r,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},C=o.byteRangeStartOffset,b=o.byteRangeEndOffset;return Object($.isFiniteNumber)(C)&&Object($.isFiniteNumber)(b)&&(l.rangeStart=C,l.rangeEnd=b),l}var g=function(a){L(r,a);function r(o){for(var l,C=arguments.length,b=new Array(C>1?C-1:0),x=1;x<C;x++)b[x-1]=arguments[x];return l=a.call.apply(a,[this].concat(b))||this,l.data=void 0,l.data=o,l}return r}(K(Error))},"./src/loader/fragment.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"ElementaryStreamTypes",function(){return p}),P.d(V,"BaseSegment",function(){return f}),P.d(V,"Fragment",function(){return g}),P.d(V,"Part",function(){return a});var $=P("./src/polyfills/number.ts"),N=P("./node_modules/url-toolkit/src/url-toolkit.js"),L=P.n(N),K=P("./src/utils/logger.ts"),F=P("./src/loader/level-key.ts"),R=P("./src/loader/load-stats.ts");function A(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,h(r,o)}function h(r,o){return h=Object.setPrototypeOf||function(C,b){return C.__proto__=b,C},h(r,o)}function y(r,o){for(var l=0;l<o.length;l++){var C=o[l];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(r,C.key,C)}}function w(r,o,l){return o&&y(r.prototype,o),l&&y(r,l),r}var p;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(p||(p={}));var f=function(){function r(l){var C;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(C={},C[p.AUDIO]=null,C[p.VIDEO]=null,C[p.AUDIOVIDEO]=null,C),this.baseurl=l}var o=r.prototype;return o.setByteRange=function(C,b){var x=C.split("@",2),D=[];x.length===1?D[0]=b?b.byteRangeEndOffset:0:D[0]=parseInt(x[1]),D[1]=parseInt(x[0])+D[0],this._byteRange=D},w(r,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(N.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(C){this._url=C}}]),r}(),g=function(r){A(o,r);function o(C,b){var x;return x=r.call(this,b)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new R.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=C,x}var l=o.prototype;return l.createInitializationVector=function(b){for(var x=new Uint8Array(16),D=12;D<16;D++)x[D]=b>>8*(15-D)&255;return x},l.setDecryptDataFromLevelKey=function(b,x){var D=b;return(b==null?void 0:b.method)==="AES-128"&&b.uri&&!b.iv&&(D=F.LevelKey.fromURI(b.uri),D.method=b.method,D.iv=this.createInitializationVector(x),D.keyFormat="identity"),D},l.setElementaryStreamInfo=function(b,x,D,T,m,v){v===void 0&&(v=!1);var u=this.elementaryStreams,s=u[b];if(!s){u[b]={startPTS:x,endPTS:D,startDTS:T,endDTS:m,partial:v};return}s.startPTS=Math.min(s.startPTS,x),s.endPTS=Math.max(s.endPTS,D),s.startDTS=Math.min(s.startDTS,T),s.endDTS=Math.max(s.endDTS,m)},l.clearElementaryStreamInfo=function(){var b=this.elementaryStreams;b[p.AUDIO]=null,b[p.VIDEO]=null,b[p.AUDIOVIDEO]=null},w(o,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var b=this.sn;typeof b!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),b=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,b)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object($.isFiniteNumber)(this.programDateTime))return null;var b=Object($.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+b*1e3}},{key:"encrypted",get:function(){var b;return!!((b=this.decryptdata)!==null&&b!==void 0&&b.keyFormat&&this.decryptdata.uri)}}]),o}(f),a=function(r){A(o,r);function o(l,C,b,x,D){var T;T=r.call(this,b)||this,T.fragOffset=0,T.duration=0,T.gap=!1,T.independent=!1,T.relurl=void 0,T.fragment=void 0,T.index=void 0,T.stats=new R.LoadStats,T.duration=l.decimalFloatingPoint("DURATION"),T.gap=l.bool("GAP"),T.independent=l.bool("INDEPENDENT"),T.relurl=l.enumeratedString("URI"),T.fragment=C,T.index=x;var m=l.enumeratedString("BYTERANGE");return m&&T.setByteRange(m,D),D&&(T.fragOffset=D.fragOffset+D.duration),T}return w(o,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var C=this.elementaryStreams;return!!(C.audio||C.video||C.audiovideo)}}]),o}(f)},"./src/loader/key-loader.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return K});var $=P("./src/events.ts"),N=P("./src/errors.ts"),L=P("./src/utils/logger.ts"),K=function(){function F(A){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=A,this._registerListeners()}var R=F.prototype;return R._registerListeners=function(){this.hls.on($.Events.KEY_LOADING,this.onKeyLoading,this)},R._unregisterListeners=function(){this.hls.off($.Events.KEY_LOADING,this.onKeyLoading)},R.destroy=function(){this._unregisterListeners();for(var h in this.loaders){var y=this.loaders[h];y&&y.destroy()}this.loaders={}},R.onKeyLoading=function(h,y){var w=y.frag,p=w.type,f=this.loaders[p];if(!w.decryptdata){L.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var g=w.decryptdata.uri;if(g!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(f&&(L.logger.warn("abort previous key loader for type:"+p),f.abort()),!g){L.logger.warn("key uri is falsy");return}var r=a.loader,o=w.loader=this.loaders[p]=new r(a);this.decrypturl=g,this.decryptkey=null;var l={url:g,frag:w,responseType:"arraybuffer"},C={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(l,C,b)}else this.decryptkey&&(w.decryptdata.key=this.decryptkey,this.hls.trigger($.Events.KEY_LOADED,{frag:w}))},R.loadsuccess=function(h,y,w){var p=w.frag;if(!p.decryptdata){L.logger.error("after key load, decryptdata unset");return}this.decryptkey=p.decryptdata.key=new Uint8Array(h.data),p.loader=null,delete this.loaders[p.type],this.hls.trigger($.Events.KEY_LOADED,{frag:p})},R.loaderror=function(h,y){var w=y.frag,p=w.loader;p&&p.abort(),delete this.loaders[w.type],this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:w,response:h})},R.loadtimeout=function(h,y){var w=y.frag,p=w.loader;p&&p.abort(),delete this.loaders[w.type],this.hls.trigger($.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:w})},F}()},"./src/loader/level-details.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"LevelDetails",function(){return F});var $=P("./src/polyfills/number.ts");function N(R,A){for(var h=0;h<A.length;h++){var y=A[h];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(R,y.key,y)}}function L(R,A,h){return A&&N(R.prototype,A),h&&N(R,h),R}var K=10,F=function(){function R(h){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=h}var A=R.prototype;return A.reloaded=function(y){if(!y){this.advanced=!0,this.updated=!0;return}var w=this.lastPartSn-y.lastPartSn,p=this.lastPartIndex-y.lastPartIndex;this.updated=this.endSN!==y.endSN||!!p||!!w,this.advanced=this.endSN>y.endSN||w>0||w===0&&p>0,this.updated||this.advanced?this.misses=Math.floor(y.misses*.6):this.misses=y.misses+1,this.availabilityDelay=y.availabilityDelay},L(R,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object($.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var y=this.driftEndTime-this.driftStartTime;if(y>0){var w=this.driftEnd-this.driftStart;return w*1e3/y}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var y;return(y=this.fragments)!==null&&y!==void 0&&y.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 y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),R}()},"./src/loader/level-key.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"LevelKey",function(){return F});var $=P("./node_modules/url-toolkit/src/url-toolkit.js"),N=P.n($);function L(R,A){for(var h=0;h<A.length;h++){var y=A[h];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(R,y.key,y)}}function K(R,A,h){return A&&L(R.prototype,A),h&&L(R,h),R}var F=function(){R.fromURL=function(h,y){return new R(h,y)},R.fromURI=function(h){return new R(h)};function R(A,h){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,h?this._uri=Object($.buildAbsoluteURL)(A,h,{alwaysNormalize:!0}):this._uri=A}return K(R,[{key:"uri",get:function(){return this._uri}}]),R}()},"./src/loader/load-stats.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"LoadStats",function(){return $});var $=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return o});var $=P("./src/polyfills/number.ts"),N=P("./node_modules/url-toolkit/src/url-toolkit.js"),L=P.n(N),K=P("./src/loader/fragment.ts"),F=P("./src/loader/level-details.ts"),R=P("./src/loader/level-key.ts"),A=P("./src/utils/attr-list.ts"),h=P("./src/utils/logger.ts"),y=P("./src/utils/codecs.ts"),w=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,p=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),g=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),a=/\.(mp4|m4s|m4v|m4a)$/i;function r(D){var T,m;return a.test((T=(m=N.parseURL(D))===null||m===void 0?void 0:m.path)!=null?T:"")}var o=function(){function D(){}return D.findGroup=function(m,v){for(var u=0;u<m.length;u++){var s=m[u];if(s.id===v)return s}},D.convertAVC1ToAVCOTI=function(m){var v=m.split(".");if(v.length>2){var u=v.shift()+".";return u+=parseInt(v.shift()).toString(16),u+=("000"+parseInt(v.shift()).toString(16)).substr(-4),u}return m},D.resolve=function(m,v){return N.buildAbsoluteURL(v,m,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(m,v){var u=[],s={},S=!1;w.lastIndex=0;for(var c;(c=w.exec(m))!=null;)if(c[1]){var O=new A.AttrList(c[1]),M={attrs:O,bitrate:O.decimalInteger("AVERAGE-BANDWIDTH")||O.decimalInteger("BANDWIDTH"),name:O.NAME,url:D.resolve(c[2],v)},B=O.decimalResolution("RESOLUTION");B&&(M.width=B.width,M.height=B.height),l((O.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),M),M.videoCodec&&M.videoCodec.indexOf("avc1")!==-1&&(M.videoCodec=D.convertAVC1ToAVCOTI(M.videoCodec)),u.push(M)}else if(c[3]){var j=new A.AttrList(c[3]);j["DATA-ID"]&&(S=!0,s[j["DATA-ID"]]=j)}return{levels:u,sessionData:S?s:null}},D.parseMasterPlaylistMedia=function(m,v,u,s){s===void 0&&(s=[]);var S,c=[],O=0;for(p.lastIndex=0;(S=p.exec(m))!==null;){var M=new A.AttrList(S[1]);if(M.TYPE===u){var B={attrs:M,bitrate:0,id:O++,groupId:M["GROUP-ID"],instreamId:M["INSTREAM-ID"],name:M.NAME||M.LANGUAGE||"",type:u,default:M.bool("DEFAULT"),autoselect:M.bool("AUTOSELECT"),forced:M.bool("FORCED"),lang:M.LANGUAGE,url:M.URI?D.resolve(M.URI,v):""};if(s.length){var j=D.findGroup(s,B.groupId)||s[0];C(B,j,"audioCodec"),C(B,j,"textCodec")}c.push(B)}}return c},D.parseLevelPlaylist=function(m,v,u,s,S){var c=new F.LevelDetails(v),O=c.fragments,M=null,B=0,j=0,H=0,I=0,U=null,J=new K.Fragment(s,v),ne,he,Ee,Ae=-1,Oe=!1;for(f.lastIndex=0,c.m3u8=m;(ne=f.exec(m))!==null;){Oe&&(Oe=!1,J=new K.Fragment(s,v),J.start=H,J.sn=B,J.cc=I,J.level=u,M&&(J.initSegment=M,J.rawProgramDateTime=M.rawProgramDateTime));var me=ne[1];if(me){J.duration=parseFloat(me);var de=(" "+ne[2]).slice(1);J.title=de||null,J.tagList.push(de?["INF",me,de]:["INF",me])}else if(ne[3])Object($.isFiniteNumber)(J.duration)&&(J.start=H,Ee&&(J.levelkey=Ee),J.sn=B,J.level=u,J.cc=I,J.urlId=S,O.push(J),J.relurl=(" "+ne[3]).slice(1),x(J,U),U=J,H+=J.duration,B++,j=0,Oe=!0);else if(ne[4]){var pe=(" "+ne[4]).slice(1);U?J.setByteRange(pe,U):J.setByteRange(pe)}else if(ne[5])J.rawProgramDateTime=(" "+ne[5]).slice(1),J.tagList.push(["PROGRAM-DATE-TIME",J.rawProgramDateTime]),Ae===-1&&(Ae=O.length);else{if(ne=ne[0].match(g),!ne){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(he=1;he<ne.length&&!(typeof ne[he]!="undefined");he++);var se=(" "+ne[he]).slice(1),ce=(" "+ne[he+1]).slice(1),Z=ne[he+2]?(" "+ne[he+2]).slice(1):"";switch(se){case"PLAYLIST-TYPE":c.type=ce.toUpperCase();break;case"MEDIA-SEQUENCE":B=c.startSN=parseInt(ce);break;case"SKIP":{var te=new A.AttrList(ce),le=te.decimalInteger("SKIPPED-SEGMENTS");if(Object($.isFiniteNumber)(le)){c.skippedSegments=le;for(var ve=le;ve--;)O.unshift(null);B+=le}var ie=te.enumeratedString("RECENTLY-REMOVED-DATERANGES");ie&&(c.recentlyRemovedDateranges=ie.split(" "));break}case"TARGETDURATION":c.targetduration=parseFloat(ce);break;case"VERSION":c.version=parseInt(ce);break;case"EXTM3U":break;case"ENDLIST":c.live=!1;break;case"#":(ce||Z)&&J.tagList.push(Z?[ce,Z]:[ce]);break;case"DIS":I++;case"GAP":J.tagList.push([se]);break;case"BITRATE":J.tagList.push([se,ce]);break;case"DISCONTINUITY-SEQ":I=parseInt(ce);break;case"KEY":{var oe,xe=new A.AttrList(ce),_e=xe.enumeratedString("METHOD"),Me=xe.URI,Ue=xe.hexadecimalInteger("IV"),He=xe.enumeratedString("KEYFORMATVERSIONS"),Be=xe.enumeratedString("KEYID"),tt=(oe=xe.enumeratedString("KEYFORMAT"))!=null?oe:"identity",Je=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Je.indexOf(tt)>-1){h.logger.warn("Keyformat "+tt+" is not supported from the manifest");continue}else if(tt!=="identity")continue;_e&&(Ee=R.LevelKey.fromURL(v,Me),Me&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(_e)>=0&&(Ee.method=_e,Ee.keyFormat=tt,Be&&(Ee.keyID=Be),He&&(Ee.keyFormatVersions=He),Ee.iv=Ue));break}case"START":{var st=new A.AttrList(ce),nt=st.decimalFloatingPoint("TIME-OFFSET");Object($.isFiniteNumber)(nt)&&(c.startTimeOffset=nt);break}case"MAP":{var pt=new A.AttrList(ce);J.relurl=pt.URI,pt.BYTERANGE&&J.setByteRange(pt.BYTERANGE),J.level=u,J.sn="initSegment",Ee&&(J.levelkey=Ee),J.initSegment=null,M=J,Oe=!0;break}case"SERVER-CONTROL":{var mt=new A.AttrList(ce);c.canBlockReload=mt.bool("CAN-BLOCK-RELOAD"),c.canSkipUntil=mt.optionalFloat("CAN-SKIP-UNTIL",0),c.canSkipDateRanges=c.canSkipUntil>0&&mt.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=mt.optionalFloat("PART-HOLD-BACK",0),c.holdBack=mt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ke=new A.AttrList(ce);c.partTarget=ke.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Le=c.partList;Le||(Le=c.partList=[]);var We=j>0?Le[Le.length-1]:void 0,Ve=j++,Ne=new K.Part(new A.AttrList(ce),J,v,Ve,We);Le.push(Ne),J.duration+=Ne.duration;break}case"PRELOAD-HINT":{var Ke=new A.AttrList(ce);c.preloadHint=Ke;break}case"RENDITION-REPORT":{var we=new A.AttrList(ce);c.renditionReports=c.renditionReports||[],c.renditionReports.push(we);break}default:h.logger.warn("line parsed but not handled: "+ne);break}}}U&&!U.relurl?(O.pop(),H-=U.duration,c.partList&&(c.fragmentHint=U)):c.partList&&(x(J,U),J.cc=I,c.fragmentHint=J);var ye=O.length,ge=O[0],ae=O[ye-1];if(H+=c.skippedSegments*c.targetduration,H>0&&ye&&ae){c.averagetargetduration=H/ye;var re=ae.sn;c.endSN=re!=="initSegment"?re:0,ge&&(c.startCC=ge.cc,ge.initSegment||c.fragments.every(function(be){return be.relurl&&r(be.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),J=new K.Fragment(s,v),J.relurl=ae.relurl,J.level=u,J.sn="initSegment",ge.initSegment=J,c.needSidxRanges=!0))}else c.endSN=0,c.startCC=0;return c.fragmentHint&&(H+=c.fragmentHint.duration),c.totalduration=H,c.endCC=I,Ae>0&&b(O,Ae),c},D}();function l(D,T){["video","audio","text"].forEach(function(m){var v=D.filter(function(s){return Object(y.isCodecType)(s,m)});if(v.length){var u=v.filter(function(s){return s.lastIndexOf("avc1",0)===0||s.lastIndexOf("mp4a",0)===0});T[m+"Codec"]=u.length>0?u[0]:v[0],D=D.filter(function(s){return v.indexOf(s)===-1})}}),T.unknownCodecs=D}function C(D,T,m){var v=T[m];v&&(D[m]=v)}function b(D,T){for(var m=D[T],v=T;v--;){var u=D[v];if(!u)return;u.programDateTime=m.programDateTime-u.duration*1e3,m=u}}function x(D,T){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):T!=null&&T.programDateTime&&(D.programDateTime=T.endProgramDateTime),Object($.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/polyfills/number.ts"),N=P("./src/events.ts"),L=P("./src/errors.ts"),K=P("./src/utils/logger.ts"),F=P("./src/utils/mp4-tools.ts"),R=P("./src/loader/m3u8-parser.ts"),A=P("./src/types/loader.ts"),h=P("./src/utils/attr-list.ts");function y(f){var g=f.type;switch(g){case A.PlaylistContextType.AUDIO_TRACK:return A.PlaylistLevelType.AUDIO;case A.PlaylistContextType.SUBTITLE_TRACK:return A.PlaylistLevelType.SUBTITLE;default:return A.PlaylistLevelType.MAIN}}function w(f,g){var a=f.url;return(a===void 0||a.indexOf("data:")===0)&&(a=g.url),a}var p=function(){function f(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var g=f.prototype;return g.registerListeners=function(){var r=this.hls;r.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.unregisterListeners=function(){var r=this.hls;r.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.createInternalLoader=function(r){var o=this.hls.config,l=o.pLoader,C=o.loader,b=l||C,x=new b(o);return r.loader=x,this.loaders[r.type]=x,x},g.getInternalLoader=function(r){return this.loaders[r.type]},g.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},g.destroyInternalLoaders=function(){for(var r in this.loaders){var o=this.loaders[r];o&&o.destroy(),this.resetInternalLoader(r)}},g.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},g.onManifestLoading=function(r,o){var l=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:A.PlaylistContextType.MANIFEST,url:l,deliveryDirectives:null})},g.onLevelLoading=function(r,o){var l=o.id,C=o.level,b=o.url,x=o.deliveryDirectives;this.load({id:l,groupId:null,level:C,responseType:"text",type:A.PlaylistContextType.LEVEL,url:b,deliveryDirectives:x})},g.onAudioTrackLoading=function(r,o){var l=o.id,C=o.groupId,b=o.url,x=o.deliveryDirectives;this.load({id:l,groupId:C,level:null,responseType:"text",type:A.PlaylistContextType.AUDIO_TRACK,url:b,deliveryDirectives:x})},g.onSubtitleTrackLoading=function(r,o){var l=o.id,C=o.groupId,b=o.url,x=o.deliveryDirectives;this.load({id:l,groupId:C,level:null,responseType:"text",type:A.PlaylistContextType.SUBTITLE_TRACK,url:b,deliveryDirectives:x})},g.load=function(r){var o,l=this.hls.config,C=this.getInternalLoader(r);if(C){var b=C.context;if(b&&b.url===r.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),C.abort()}var x,D,T,m;switch(r.type){case A.PlaylistContextType.MANIFEST:x=l.manifestLoadingMaxRetry,D=l.manifestLoadingTimeOut,T=l.manifestLoadingRetryDelay,m=l.manifestLoadingMaxRetryTimeout;break;case A.PlaylistContextType.LEVEL:case A.PlaylistContextType.AUDIO_TRACK:case A.PlaylistContextType.SUBTITLE_TRACK:x=0,D=l.levelLoadingTimeOut;break;default:x=l.levelLoadingMaxRetry,D=l.levelLoadingTimeOut,T=l.levelLoadingRetryDelay,m=l.levelLoadingMaxRetryTimeout;break}if(C=this.createInternalLoader(r),(o=r.deliveryDirectives)!==null&&o!==void 0&&o.part){var v;if(r.type===A.PlaylistContextType.LEVEL&&r.level!==null?v=this.hls.levels[r.level].details:r.type===A.PlaylistContextType.AUDIO_TRACK&&r.id!==null?v=this.hls.audioTracks[r.id].details:r.type===A.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(v=this.hls.subtitleTracks[r.id].details),v){var u=v.partTarget,s=v.targetduration;u&&s&&(D=Math.min(Math.max(u*3,s*.8)*1e3,D))}}var S={timeout:D,maxRetry:x,retryDelay:T,maxRetryDelay:m,highWaterMark:0},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};C.load(r,S,c)},g.loadsuccess=function(r,o,l,C){if(C===void 0&&(C=null),l.isSidxRequest){this.handleSidxRequest(r,l),this.handlePlaylistLoaded(r,o,l,C);return}this.resetInternalLoader(l.type);var b=r.data;if(b.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,l,"no EXTM3U delimiter",C);return}o.parsing.start=performance.now(),b.indexOf("#EXTINF:")>0||b.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,o,l,C):this.handleMasterPlaylist(r,o,l,C)},g.loaderror=function(r,o,l){l===void 0&&(l=null),this.handleNetworkError(o,l,!1,r)},g.loadtimeout=function(r,o,l){l===void 0&&(l=null),this.handleNetworkError(o,l,!0)},g.handleMasterPlaylist=function(r,o,l,C){var b=this.hls,x=r.data,D=w(r,l),T=R.default.parseMasterPlaylist(x,D),m=T.levels,v=T.sessionData;if(!m.length){this.handleManifestParsingError(r,l,"no level found in manifest",C);return}var u=m.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),s=m.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),S=R.default.parseMasterPlaylistMedia(x,D,"AUDIO",u),c=R.default.parseMasterPlaylistMedia(x,D,"SUBTITLES",s),O=R.default.parseMasterPlaylistMedia(x,D,"CLOSED-CAPTIONS");if(S.length){var M=S.some(function(B){return!B.url});!M&&m[0].audioCodec&&!m[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new h.AttrList({}),bitrate:0,url:""}))}b.trigger(N.Events.MANIFEST_LOADED,{levels:m,audioTracks:S,subtitles:c,captions:O,url:D,stats:o,networkDetails:C,sessionData:v})},g.handleTrackOrLevelPlaylist=function(r,o,l,C){var b=this.hls,x=l.id,D=l.level,T=l.type,m=w(r,l),v=Object($.isFiniteNumber)(x)?x:0,u=Object($.isFiniteNumber)(D)?D:v,s=y(l),S=R.default.parseLevelPlaylist(r.data,m,u,s,v);if(!S.fragments.length){b.trigger(N.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,reason:"no fragments found in level",level:typeof l.level=="number"?l.level:void 0});return}if(T===A.PlaylistContextType.MANIFEST){var c={attrs:new h.AttrList({}),bitrate:0,details:S,name:"",url:m};b.trigger(N.Events.MANIFEST_LOADED,{levels:[c],audioTracks:[],url:m,stats:o,networkDetails:C,sessionData:null})}if(o.parsing.end=performance.now(),S.needSidxRanges){var O,M=(O=S.fragments[0].initSegment)===null||O===void 0?void 0:O.url;this.load({url:M,isSidxRequest:!0,type:T,level:D,levelDetails:S,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}l.levelDetails=S,this.handlePlaylistLoaded(r,o,l,C)},g.handleSidxRequest=function(r,o){var l=Object(F.parseSegmentIndex)(new Uint8Array(r.data));if(!l)return;var C=l.references,b=o.levelDetails;C.forEach(function(x,D){var T=x.info,m=b.fragments[D];m.byteRange.length===0&&m.setByteRange(String(1+T.end-T.start)+"@"+String(T.start)),m.initSegment&&m.initSegment.setByteRange(String(l.moovEndOffset)+"@0")})},g.handleManifestParsingError=function(r,o,l,C){this.hls.trigger(N.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===A.PlaylistContextType.MANIFEST,url:r.url,reason:l,response:r,context:o,networkDetails:C})},g.handleNetworkError=function(r,o,l,C){l===void 0&&(l=!1),K.logger.warn("[playlist-loader]: A network "+(l?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var b=L.ErrorDetails.UNKNOWN,x=!1,D=this.getInternalLoader(r);switch(r.type){case A.PlaylistContextType.MANIFEST:b=l?L.ErrorDetails.MANIFEST_LOAD_TIMEOUT:L.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case A.PlaylistContextType.LEVEL:b=l?L.ErrorDetails.LEVEL_LOAD_TIMEOUT:L.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case A.PlaylistContextType.AUDIO_TRACK:b=l?L.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case A.PlaylistContextType.SUBTITLE_TRACK:b=l?L.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:L.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}D&&this.resetInternalLoader(r.type);var T={type:L.ErrorTypes.NETWORK_ERROR,details:b,fatal:x,url:r.url,loader:D,context:r,networkDetails:o};C&&(T.response=C),this.hls.trigger(N.Events.ERROR,T)},g.handlePlaylistLoaded=function(r,o,l,C){var b=l.type,x=l.level,D=l.id,T=l.groupId,m=l.loader,v=l.levelDetails,u=l.deliveryDirectives;if(!(v!=null&&v.targetduration)){this.handleManifestParsingError(r,l,"invalid target duration",C);return}if(!m)return;v.live&&(m.getCacheAge&&(v.ageHeader=m.getCacheAge()||0),(!m.getCacheAge||isNaN(v.ageHeader))&&(v.ageHeader=0));switch(b){case A.PlaylistContextType.MANIFEST:case A.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:v,level:x||0,id:D||0,stats:o,networkDetails:C,deliveryDirectives:u});break;case A.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:v,id:D||0,groupId:T||"",stats:o,networkDetails:C,deliveryDirectives:u});break;case A.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:v,id:D||0,groupId:T||"",stats:o,networkDetails:C,deliveryDirectives:u});break}},f}();V.default=p},"./src/polyfills/number.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"isFiniteNumber",function(){return $}),P.d(V,"MAX_SAFE_INTEGER",function(){return N});var $=Number.isFinite||function(L){return typeof L=="number"&&isFinite(L)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ue,V,P){"use strict";P.r(V);var $=function(){function N(){}return N.getSilentFrame=function(K,F){switch(K){case"mp4a.40.2":if(F===1)return new Uint8Array([0,200,0,128,35,128]);if(F===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(F===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(F===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(F===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(F===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(F===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(F===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(F===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},N}();V.default=$},"./src/remux/mp4-generator.ts":function(ue,V,P){"use strict";P.r(V);var $=Math.pow(2,32)-1,N=function(){function L(){}return L.init=function(){L.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 F;for(F in L.types)L.types.hasOwnProperty(F)&&(L.types[F]=[F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2),F.charCodeAt(3)]);var R=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),A=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);L.HDLR_TYPES={video:R,audio:A};var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),y=new Uint8Array([0,0,0,0,0,0,0,0]);L.STTS=L.STSC=L.STCO=y,L.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),L.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),L.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var w=new Uint8Array([105,115,111,109]),p=new Uint8Array([97,118,99,49]),f=new Uint8Array([0,0,0,1]);L.FTYP=L.box(L.types.ftyp,w,f,w,p),L.DINF=L.box(L.types.dinf,L.box(L.types.dref,h))},L.box=function(F){for(var R=8,A=arguments.length,h=new Array(A>1?A-1:0),y=1;y<A;y++)h[y-1]=arguments[y];for(var w=h.length,p=w;w--;)R+=h[w].byteLength;var f=new Uint8Array(R);for(f[0]=R>>24&255,f[1]=R>>16&255,f[2]=R>>8&255,f[3]=R&255,f.set(F,4),w=0,R=8;w<p;w++)f.set(h[w],R),R+=h[w].byteLength;return f},L.hdlr=function(F){return L.box(L.types.hdlr,L.HDLR_TYPES[F])},L.mdat=function(F){return L.box(L.types.mdat,F)},L.mdhd=function(F,R){R*=F;var A=Math.floor(R/($+1)),h=Math.floor(R%($+1));return L.box(L.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,A>>24,A>>16&255,A>>8&255,A&255,h>>24,h>>16&255,h>>8&255,h&255,85,196,0,0]))},L.mdia=function(F){return L.box(L.types.mdia,L.mdhd(F.timescale,F.duration),L.hdlr(F.type),L.minf(F))},L.mfhd=function(F){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,F>>24,F>>16&255,F>>8&255,F&255]))},L.minf=function(F){return F.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(F)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(F))},L.moof=function(F,R,A){return L.box(L.types.moof,L.mfhd(F),L.traf(A,R))},L.moov=function(F){for(var R=F.length,A=[];R--;)A[R]=L.trak(F[R]);return L.box.apply(null,[L.types.moov,L.mvhd(F[0].timescale,F[0].duration)].concat(A).concat(L.mvex(F)))},L.mvex=function(F){for(var R=F.length,A=[];R--;)A[R]=L.trex(F[R]);return L.box.apply(null,[L.types.mvex].concat(A))},L.mvhd=function(F,R){R*=F;var A=Math.floor(R/($+1)),h=Math.floor(R%($+1)),y=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,A>>24,A>>16&255,A>>8&255,A&255,h>>24,h>>16&255,h>>8&255,h&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 L.box(L.types.mvhd,y)},L.sdtp=function(F){var R=F.samples||[],A=new Uint8Array(4+R.length),h,y;for(h=0;h<R.length;h++)y=R[h].flags,A[h+4]=y.dependsOn<<4|y.isDependedOn<<2|y.hasRedundancy;return L.box(L.types.sdtp,A)},L.stbl=function(F){return L.box(L.types.stbl,L.stsd(F),L.box(L.types.stts,L.STTS),L.box(L.types.stsc,L.STSC),L.box(L.types.stsz,L.STSZ),L.box(L.types.stco,L.STCO))},L.avc1=function(F){var R=[],A=[],h,y,w;for(h=0;h<F.sps.length;h++)y=F.sps[h],w=y.byteLength,R.push(w>>>8&255),R.push(w&255),R=R.concat(Array.prototype.slice.call(y));for(h=0;h<F.pps.length;h++)y=F.pps[h],w=y.byteLength,A.push(w>>>8&255),A.push(w&255),A=A.concat(Array.prototype.slice.call(y));var p=L.box(L.types.avcC,new Uint8Array([1,R[3],R[4],R[5],252|3,224|F.sps.length].concat(R).concat([F.pps.length]).concat(A))),f=F.width,g=F.height,a=F.pixelRatio[0],r=F.pixelRatio[1];return L.box(L.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,f>>8&255,f&255,g>>8&255,g&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]),p,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&255])))},L.esds=function(F){var R=F.config.length;return new Uint8Array([0,0,0,0,3,23+R,0,1,0,4,15+R,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([R]).concat(F.config).concat([6,1,2]))},L.mp4a=function(F){var R=F.samplerate;return L.box(L.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,R>>8&255,R&255,0,0]),L.box(L.types.esds,L.esds(F)))},L.mp3=function(F){var R=F.samplerate;return L.box(L.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,R>>8&255,R&255,0,0]))},L.stsd=function(F){return F.type==="audio"?!F.isAAC&&F.codec==="mp3"?L.box(L.types.stsd,L.STSD,L.mp3(F)):L.box(L.types.stsd,L.STSD,L.mp4a(F)):L.box(L.types.stsd,L.STSD,L.avc1(F))},L.tkhd=function(F){var R=F.id,A=F.duration*F.timescale,h=F.width,y=F.height,w=Math.floor(A/($+1)),p=Math.floor(A%($+1));return L.box(L.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,R>>24&255,R>>16&255,R>>8&255,R&255,0,0,0,0,w>>24,w>>16&255,w>>8&255,w&255,p>>24,p>>16&255,p>>8&255,p&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,h>>8&255,h&255,0,0,y>>8&255,y&255,0,0]))},L.traf=function(F,R){var A=L.sdtp(F),h=F.id,y=Math.floor(R/($+1)),w=Math.floor(R%($+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,y>>24,y>>16&255,y>>8&255,y&255,w>>24,w>>16&255,w>>8&255,w&255])),L.trun(F,A.length+16+20+8+16+8+8),A)},L.trak=function(F){return F.duration=F.duration||4294967295,L.box(L.types.trak,L.tkhd(F),L.mdia(F))},L.trex=function(F){var R=F.id;return L.box(L.types.trex,new Uint8Array([0,0,0,0,R>>24,R>>16&255,R>>8&255,R&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},L.trun=function(F,R){var A=F.samples||[],h=A.length,y=12+16*h,w=new Uint8Array(y),p,f,g,a,r,o;for(R+=8+y,w.set([0,0,15,1,h>>>24&255,h>>>16&255,h>>>8&255,h&255,R>>>24&255,R>>>16&255,R>>>8&255,R&255],0),p=0;p<h;p++)f=A[p],g=f.duration,a=f.size,r=f.flags,o=f.cts,w.set([g>>>24&255,g>>>16&255,g>>>8&255,g&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*p);return L.box(L.types.trun,w)},L.initSegment=function(F){L.types||L.init();var R=L.moov(F),A=new Uint8Array(L.FTYP.byteLength+R.byteLength);return A.set(L.FTYP),A.set(R,L.FTYP.byteLength),A},L}();N.types=void 0,N.HDLR_TYPES=void 0,N.STTS=void 0,N.STSC=void 0,N.STCO=void 0,N.STSZ=void 0,N.VMHD=void 0,N.SMHD=void 0,N.STSD=void 0,N.FTYP=void 0,N.DINF=void 0,V.default=N},"./src/remux/mp4-remuxer.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return o}),P.d(V,"normalizePts",function(){return l});var $=P("./src/polyfills/number.ts"),N=P("./src/remux/aac-helper.ts"),L=P("./src/remux/mp4-generator.ts"),K=P("./src/events.ts"),F=P("./src/errors.ts"),R=P("./src/utils/logger.ts"),A=P("./src/types/loader.ts"),h=P("./src/utils/timescale-conversion.ts");function y(){return y=Object.assign||function(D){for(var T=1;T<arguments.length;T++){var m=arguments[T];for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(D[v]=m[v])}return D},y.apply(this,arguments)}var w=10*1e3,p=1024,f=1152,g=null,a=null,r=!1,o=function(){function D(m,v,u,s){if(s===void 0&&(s=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=m,this.config=v,this.typeSupported=u,this.ISGenerated=!1,g===null){var S=navigator.userAgent||"",c=S.match(/Chrome\/(\d+)/i);g=c?parseInt(c[1]):0}if(a===null){var O=navigator.userAgent.match(/Safari\/(\d+)/i);a=O?parseInt(O[1]):0}r=!!g&&g<75||!!a&&a<600}var T=D.prototype;return T.destroy=function(){},T.resetTimeStamp=function(v){R.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=v},T.resetNextTimestamp=function(){R.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},T.resetInitSegment=function(){R.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},T.getVideoStartPts=function(v){var u=!1,s=v.reduce(function(S,c){var O=c.pts-S;return O<-4294967296?(u=!0,l(S,c.pts)):O>0?S:c.pts},v[0].pts);return u&&R.logger.debug("PTS rollover detected"),s},T.remux=function(v,u,s,S,c,O,M,B){var j,H,I,U,J,ne,he=c,Ee=c,Ae=v.pid>-1,Oe=u.pid>-1,me=u.samples.length,de=v.samples.length>0,pe=me>1,se=(!Ae||de)&&(!Oe||pe)||this.ISGenerated||M;if(se){this.ISGenerated||(I=this.generateIS(v,u,c));var ce=this.isVideoContiguous,Z=-1;if(pe&&(Z=C(u.samples),!ce&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,Z>0){R.logger.warn("[mp4-remuxer]: Dropped "+Z+" out of "+me+" video samples due to a missing keyframe");var te=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(Z),u.dropped+=Z,Ee+=(u.samples[0].pts-te)/(u.timescale||9e4)}else Z===-1&&(R.logger.warn("[mp4-remuxer]: No keyframe found out of "+me+" video samples"),ne=!1);if(this.ISGenerated){if(de&&pe){var le=this.getVideoStartPts(u.samples),ve=l(v.samples[0].pts,le)-le,ie=ve/u.inputTimeScale;he+=Math.max(0,ie),Ee+=Math.max(0,-ie)}if(de){if(v.samplerate||(R.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(v,u,c)),H=this.remuxAudio(v,he,this.isAudioContiguous,O,Oe||pe||B===A.PlaylistLevelType.AUDIO?Ee:void 0),pe){var oe=H?H.endPTS-H.startPTS:0;u.inputTimeScale||(R.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(v,u,c)),j=this.remuxVideo(u,Ee,ce,oe)}}else pe&&(j=this.remuxVideo(u,Ee,ce,0));j&&(j.firstKeyFrame=Z,j.independent=Z!==-1)}}return this.ISGenerated&&(s.samples.length&&(J=this.remuxID3(s,c)),S.samples.length&&(U=this.remuxText(S,c))),{audio:H,video:j,initSegment:I,independent:ne,text:U,id3:J}},T.generateIS=function(v,u,s){var S=v.samples,c=u.samples,O=this.typeSupported,M={},B=!Object($.isFiniteNumber)(this._initPTS),j="audio/mp4",H,I,U;if(B&&(H=I=Infinity),v.config&&S.length&&(v.timescale=v.samplerate,v.isAAC||(O.mpeg?(j="audio/mpeg",v.codec=""):O.mp3&&(v.codec="mp3")),M.audio={id:"audio",container:j,codec:v.codec,initSegment:!v.isAAC&&O.mpeg?new Uint8Array(0):L.default.initSegment([v]),metadata:{channelCount:v.channelCount}},B&&(U=v.inputTimeScale,H=I=S[0].pts-Math.round(U*s))),u.sps&&u.pps&&c.length&&(u.timescale=u.inputTimeScale,M.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:L.default.initSegment([u]),metadata:{width:u.width,height:u.height}},B)){U=u.inputTimeScale;var J=this.getVideoStartPts(c),ne=Math.round(U*s);I=Math.min(I,l(c[0].dts,J)-ne),H=Math.min(H,J-ne)}if(Object.keys(M).length)return this.ISGenerated=!0,B&&(this._initPTS=H,this._initDTS=I),{tracks:M,initPTS:H,timescale:U}},T.remuxVideo=function(v,u,s,S){var c=v.inputTimeScale,O=v.samples,M=[],B=O.length,j=this._initPTS,H=this.nextAvcDts,I=8,U,J,ne,he=Number.POSITIVE_INFINITY,Ee=Number.NEGATIVE_INFINITY,Ae=0,Oe=!1;if(!s||H===null){var me=u*c,de=O[0].pts-l(O[0].dts,O[0].pts);H=me-de}for(var pe=0;pe<B;pe++){var se=O[pe];if(se.pts=l(se.pts-j,H),se.dts=l(se.dts-j,H),se.dts>se.pts){var ce=9e4*.2;Ae=Math.max(Math.min(Ae,se.pts-se.dts),-1*ce)}se.dts<O[pe>0?pe-1:pe].dts&&(Oe=!0)}Oe&&O.sort(function(ht,ft){var at=ht.dts-ft.dts,Dt=ht.pts-ft.pts;return at||Dt}),J=O[0].dts,ne=O[O.length-1].dts;var Z=Math.round((ne-J)/(B-1));if(Ae<0){if(Ae<Z*-2){R.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(h.toMsFromMpegTsClock)(-Z,!0)+" ms");for(var te=Ae,le=0;le<B;le++)O[le].dts=te=Math.max(te,O[le].pts-Z),O[le].pts=Math.max(te,O[le].pts)}else{R.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(h.toMsFromMpegTsClock)(Ae,!0)+" ms to overcome this issue");for(var ve=0;ve<B;ve++)O[ve].dts=O[ve].dts+Ae}J=O[0].dts}if(s){var ie=J-H,oe=ie>Z,xe=ie<-1;if(oe||xe){oe?R.logger.warn("AVC: "+Object(h.toMsFromMpegTsClock)(ie,!0)+" ms ("+ie+"dts) hole between fragments detected, filling it"):R.logger.warn("AVC: "+Object(h.toMsFromMpegTsClock)(-ie,!0)+" ms ("+ie+"dts) overlapping between fragments detected"),J=H;var _e=O[0].pts-ie;O[0].dts=J,O[0].pts=_e,R.logger.log("Video: First PTS/DTS adjusted: "+Object(h.toMsFromMpegTsClock)(_e,!0)+"/"+Object(h.toMsFromMpegTsClock)(J,!0)+", delta: "+Object(h.toMsFromMpegTsClock)(ie,!0)+" ms")}}r&&(J=Math.max(0,J));for(var Me=0,Ue=0,He=0;He<B;He++){for(var Be=O[He],tt=Be.units,Je=tt.length,st=0,nt=0;nt<Je;nt++)st+=tt[nt].data.length;Ue+=st,Me+=Je,Be.length=st,Be.dts=Math.max(Be.dts,J),Be.pts=Math.max(Be.pts,Be.dts,0),he=Math.min(Be.pts,he),Ee=Math.max(Be.pts,Ee)}ne=O[B-1].dts;var pt=Ue+4*Me+8,mt;try{mt=new Uint8Array(pt)}catch(ht){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:pt,reason:"fail allocating video mdat "+pt});return}var ke=new DataView(mt.buffer);ke.setUint32(0,pt),mt.set(L.default.types.mdat,4);for(var Le=0;Le<B;Le++){for(var We=O[Le],Ve=We.units,Ne=0,Ke=0,we=Ve.length;Ke<we;Ke++){var ye=Ve[Ke],ge=ye.data,ae=ye.data.byteLength;ke.setUint32(I,ae),I+=4,mt.set(ge,I),I+=ae,Ne+=4+ae}if(Le<B-1)U=O[Le+1].dts-We.dts;else{var re=this.config,be=We.dts-O[Le>0?Le-1:Le].dts;if(re.stretchShortVideoTrack&&this.nextAudioPts!==null){var Ce=Math.floor(re.maxBufferHole*c),Ie=(S?he+S*c:this.nextAudioPts)-We.pts;Ie>Ce?(U=Ie-be,U<0&&(U=be),R.logger.log("[mp4-remuxer]: It is approximately "+Ie/90+" ms to the next segment; using duration "+U/90+" ms for the last video frame.")):U=be}else U=be}var De=Math.round(We.pts-We.dts);M.push(new b(We.key,U,Ne,De))}if(M.length&&g&&g<70){var Ge=M[0].flags;Ge.dependsOn=2,Ge.isNonSync=0}console.assert(U!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=ne+U,this.isVideoContiguous=!0;var Qe=L.default.moof(v.sequenceNumber++,J,y({},v,{samples:M})),dt="video",rt={data1:Qe,data2:mt,startPTS:he/c,endPTS:(Ee+U)/c,startDTS:J/c,endDTS:H/c,type:dt,hasAudio:!1,hasVideo:!0,nb:M.length,dropped:v.dropped};return v.samples=[],v.dropped=0,console.assert(mt.length,"MDAT length must not be zero"),rt},T.remuxAudio=function(v,u,s,S,c){var O=v.inputTimeScale,M=v.samplerate?v.samplerate:O,B=O/M,j=v.isAAC?p:f,H=j*B,I=this._initPTS,U=!v.isAAC&&this.typeSupported.mpeg,J=[],ne=v.samples,he=U?0:8,Ee=this.nextAudioPts||-1,Ae=u*O;if(this.isAudioContiguous=s=s||ne.length&&Ee>0&&(S&&Math.abs(Ae-Ee)<9e3||Math.abs(l(ne[0].pts-I,Ae)-Ee)<20*H),ne.forEach(function(ge){ge.pts=l(ge.pts-I,Ae)}),!s||Ee<0){if(ne=ne.filter(function(ge){return ge.pts>=0}),!ne.length)return;c===0?Ee=0:S?Ee=Math.max(0,Ae):Ee=ne[0].pts}if(v.isAAC)for(var Oe=c!==void 0,me=this.config.maxAudioFramesDrift,de=0,pe=Ee;de<ne.length;de++){var se=ne[de],ce=se.pts,Z=ce-pe,te=Math.abs(1e3*Z/O);if(Z<=-me*H&&Oe)de===0&&(R.logger.warn("Audio frame @ "+(ce/O).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Z/O)+" ms."),this.nextAudioPts=Ee=pe=ce);else if(Z>=me*H&&te<w&&Oe){var le=Math.round(Z/H);pe=ce-le*H,pe<0&&(le--,pe+=H),de===0&&(this.nextAudioPts=Ee=pe),R.logger.warn("[mp4-remuxer]: Injecting "+le+" audio frame @ "+(pe/O).toFixed(3)+"s due to "+Math.round(1e3*Z/O)+" ms gap.");for(var ve=0;ve<le;ve++){var ie=Math.max(pe,0),oe=N.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);oe||(R.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),oe=se.unit.subarray()),ne.splice(de,0,{unit:oe,pts:ie}),pe+=H,de++}}se.pts=pe,pe+=H}for(var xe=null,_e=null,Me,Ue=0,He=ne.length;He--;)Ue+=ne[He].unit.byteLength;for(var Be=0,tt=ne.length;Be<tt;Be++){var Je=ne[Be],st=Je.unit,nt=Je.pts;if(_e!==null){var pt=J[Be-1];pt.duration=Math.round((nt-_e)/B)}else if(s&&v.isAAC&&(nt=Ee),xe=nt,Ue>0){Ue+=he;try{Me=new Uint8Array(Ue)}catch(ge){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ue,reason:"fail allocating audio mdat "+Ue});return}if(!U){var mt=new DataView(Me.buffer);mt.setUint32(0,Ue),Me.set(L.default.types.mdat,4)}}else return;Me.set(st,he);var ke=st.byteLength;he+=ke,J.push(new b(!0,j,ke,0)),_e=nt}var Le=J.length;if(!Le)return;var We=J[J.length-1];this.nextAudioPts=Ee=_e+B*We.duration;var Ve=U?new Uint8Array(0):L.default.moof(v.sequenceNumber++,xe/B,y({},v,{samples:J}));v.samples=[];var Ne=xe/O,Ke=Ee/O,we="audio",ye={data1:Ve,data2:Me,startPTS:Ne,endPTS:Ke,startDTS:Ne,endDTS:Ke,type:we,hasAudio:!0,hasVideo:!1,nb:Le};return this.isAudioContiguous=!0,console.assert(Me.length,"MDAT length must not be zero"),ye},T.remuxEmptyAudio=function(v,u,s,S){var c=v.inputTimeScale,O=v.samplerate?v.samplerate:c,M=c/O,B=this.nextAudioPts,j=(B!==null?B:S.startDTS*c)+this._initDTS,H=S.endDTS*c+this._initDTS,I=M*p,U=Math.ceil((H-j)/I),J=N.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);if(R.logger.warn("[mp4-remuxer]: remux empty Audio"),!J){R.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ne=[],he=0;he<U;he++){var Ee=j+he*I;ne.push({unit:J,pts:Ee,dts:Ee})}return v.samples=ne,this.remuxAudio(v,u,s,!1)},T.remuxID3=function(v,u){var s=v.samples.length;if(!s)return;for(var S=v.inputTimeScale,c=this._initPTS,O=this._initDTS,M=0;M<s;M++){var B=v.samples[M];B.pts=l(B.pts-c,u*S)/S,B.dts=l(B.dts-O,u*S)/S}var j=v.samples;return v.samples=[],{samples:j}},T.remuxText=function(v,u){var s=v.samples.length;if(!s)return;for(var S=v.inputTimeScale,c=this._initPTS,O=0;O<s;O++){var M=v.samples[O];M.pts=l(M.pts-c,u*S)/S}v.samples.sort(function(j,H){return j.pts-H.pts});var B=v.samples;return v.samples=[],{samples:B}},D}();function l(D,T){var m;if(T===null)return D;for(T<D?m=-8589934592:m=8589934592;Math.abs(D-T)>4294967296;)D+=m;return D}function C(D){for(var T=0;T<D.length;T++)if(D[T].key)return T;return-1}var b=function(T,m,v,u){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=m,this.size=v,this.cts=u,this.flags=new x(T)},x=function(T){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=T?2:1,this.isNonSync=T?0:1}},"./src/remux/passthrough-remuxer.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/polyfills/number.ts"),N=P("./src/utils/mp4-tools.ts"),L=P("./src/loader/fragment.ts"),K=P("./src/utils/logger.ts"),F=function(){function h(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var y=h.prototype;return y.destroy=function(){},y.resetTimeStamp=function(p){this.initPTS=p,this.lastEndDTS=null},y.resetNextTimestamp=function(){this.lastEndDTS=null},y.resetInitSegment=function(p,f,g){this.audioCodec=f,this.videoCodec=g,this.generateInitSegment(p),this.emitInitSegment=!0},y.generateInitSegment=function(p){var f=this.audioCodec,g=this.videoCodec;if(!p||!p.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=Object(N.parseInitSegment)(p);f||(f=A(a.audio,L.ElementaryStreamTypes.AUDIO)),g||(g=A(a.video,L.ElementaryStreamTypes.VIDEO));var r={};a.audio&&a.video?r.audiovideo={container:"video/mp4",codec:f+","+g,initSegment:p,id:"main"}:a.audio?r.audio={container:"audio/mp4",codec:f,initSegment:p,id:"audio"}:a.video?r.video={container:"video/mp4",codec:g,initSegment:p,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},y.remux=function(p,f,g,a,r){var o=this.initPTS,l=this.lastEndDTS,C={audio:void 0,video:void 0,text:a,id3:g,initSegment:void 0};Object($.isFiniteNumber)(l)||(l=this.lastEndDTS=r||0);var b=f.samples;if(!b||!b.length)return C;var x={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(b),D=this.initData),!D||!D.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),C;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object($.isFiniteNumber)(o)||(this.initPTS=x.initPTS=o=R(D,b,l));var T=Object(N.getDuration)(b,D),m=l,v=T+m;Object(N.offsetStartDTS)(D,b,o),T>0?this.lastEndDTS=v:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!D.audio,s=!!D.video,S="";u&&(S+="audio"),s&&(S+="video");var c={data1:b,startPTS:m,startDTS:m,endPTS:v,endDTS:v,type:S,hasAudio:u,hasVideo:s,nb:1,dropped:0};return C.audio=c.type==="audio"?c:void 0,C.video=c.type!=="audio"?c:void 0,C.text=a,C.id3=g,C.initSegment=x,C},h}(),R=function(y,w,p){return Object(N.getStartDTS)(y,w)-p};function A(h,y){var w=h==null?void 0:h.codec;return w&&w.length>4?w:w==="hvc1"?"hvc1.1.c.L120.90":w==="av01"?"av01.0.04M.08":w==="avc1"||y===L.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=F},"./src/task-loop.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return $});var $=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var L=N.prototype;return L.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},L.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},L.onHandlerDestroyed=function(){},L.hasInterval=function(){return!!this._tickInterval},L.hasNextTick=function(){return!!this._tickTimer},L.setInterval=function(F){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,F),!0)},L.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},L.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},L.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},L.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},L.doTick=function(){},N}()},"./src/types/cmcd.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"CMCDVersion",function(){return $}),P.d(V,"CMCDObjectType",function(){return N}),P.d(V,"CMCDStreamingFormat",function(){return L}),P.d(V,"CMCDStreamType",function(){return K});var $=1,N;(function(F){F.MANIFEST="m",F.AUDIO="a",F.VIDEO="v",F.MUXED="av",F.INIT="i",F.CAPTION="c",F.TIMED_TEXT="tt",F.KEY="k",F.OTHER="o"})(N||(N={}));var L;(function(F){F.DASH="d",F.HLS="h",F.SMOOTH="s",F.OTHER="o"})(L||(L={}));var K;(function(F){F.VOD="v",F.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"HlsSkip",function(){return L}),P.d(V,"getSkipValue",function(){return K}),P.d(V,"HlsUrlParameters",function(){return F}),P.d(V,"Level",function(){return R});function $(A,h){for(var y=0;y<h.length;y++){var w=h[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(A,w.key,w)}}function N(A,h,y){return h&&$(A.prototype,h),y&&$(A,y),A}var L;(function(A){A.No="",A.Yes="YES",A.v2="v2"})(L||(L={}));function K(A,h){var y=A.canSkipUntil,w=A.canSkipDateRanges,p=A.endSN,f=h!==void 0?h-p:0;return y&&f<y?w?L.v2:L.Yes:L.No}var F=function(){function A(y,w,p){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=y,this.part=w,this.skip=p}var h=A.prototype;return h.addDirectives=function(w){var p=new self.URL(w);return this.msn!==void 0&&p.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&p.searchParams.set("_HLS_part",this.part.toString()),this.skip&&p.searchParams.set("_HLS_skip",this.skip),p.toString()},A}(),R=function(){function A(h){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[h.url],this.attrs=h.attrs,this.bitrate=h.bitrate,h.details&&(this.details=h.details),this.id=h.id||0,this.name=h.name,this.width=h.width||0,this.height=h.height||0,this.audioCodec=h.audioCodec,this.videoCodec=h.videoCodec,this.unknownCodecs=h.unknownCodecs,this.codecSet=[h.videoCodec,h.audioCodec].filter(function(y){return y}).join(",").replace(/\.[^.,]+/g,"")}return N(A,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(y){var w=y%this.url.length;this._urlId!==w&&(this.details=void 0,this._urlId=w)}}]),A}()},"./src/types/loader.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"PlaylistContextType",function(){return $}),P.d(V,"PlaylistLevelType",function(){return N});var $;(function(L){L.MANIFEST="manifest",L.LEVEL="level",L.AUDIO_TRACK="audioTrack",L.SUBTITLE_TRACK="subtitleTrack"})($||($={}));var N;(function(L){L.MAIN="main",L.AUDIO="audio",L.SUBTITLE="subtitle"})(N||(N={}))},"./src/types/transmuxer.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"ChunkMetadata",function(){return $});var $=function(K,F,R,A,h,y){A===void 0&&(A=0),h===void 0&&(h=-1),y===void 0&&(y=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=N(),this.buffering={audio:N(),video:N(),audiovideo:N()},this.level=K,this.sn=F,this.id=R,this.size=A,this.part=h,this.partial=y};function N(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"AttrList",function(){return L});var $=/^(\d+)x(\d+)$/,N=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,L=function(){function K(R){typeof R=="string"&&(R=K.parseAttrList(R));for(var A in R)R.hasOwnProperty(A)&&(this[A]=R[A])}var F=K.prototype;return F.decimalInteger=function(A){var h=parseInt(this[A],10);return h>Number.MAX_SAFE_INTEGER?Infinity:h},F.hexadecimalInteger=function(A){if(this[A]){var h=(this[A]||"0x").slice(2);h=(h.length&1?"0":"")+h;for(var y=new Uint8Array(h.length/2),w=0;w<h.length/2;w++)y[w]=parseInt(h.slice(w*2,w*2+2),16);return y}else return null},F.hexadecimalIntegerAsNumber=function(A){var h=parseInt(this[A],16);return h>Number.MAX_SAFE_INTEGER?Infinity:h},F.decimalFloatingPoint=function(A){return parseFloat(this[A])},F.optionalFloat=function(A,h){var y=this[A];return y?parseFloat(y):h},F.enumeratedString=function(A){return this[A]},F.bool=function(A){return this[A]==="YES"},F.decimalResolution=function(A){var h=$.exec(this[A]);return h===null?void 0:{width:parseInt(h[1],10),height:parseInt(h[2],10)}},K.parseAttrList=function(A){var h,y={},w='"';for(N.lastIndex=0;(h=N.exec(A))!==null;){var p=h[2];p.indexOf(w)===0&&p.lastIndexOf(w)===p.length-1&&(p=p.slice(1,-1)),y[h[1]]=p}return y},K}()},"./src/utils/binary-search.ts":function(ue,V,P){"use strict";P.r(V);var $={search:function(L,K){for(var F=0,R=L.length-1,A=null,h=null;F<=R;){A=(F+R)/2|0,h=L[A];var y=K(h);if(y>0)F=A+1;else if(y<0)R=A-1;else return h}return null}};V.default=$},"./src/utils/buffer-helper.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"BufferHelper",function(){return L});var $=P("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},L=function(){function K(){}return K.isBuffered=function(R,A){try{if(R){for(var h=K.getBuffered(R),y=0;y<h.length;y++)if(A>=h.start(y)&&A<=h.end(y))return!0}}catch(w){}return!1},K.bufferInfo=function(R,A,h){try{if(R){var y=K.getBuffered(R),w=[],p;for(p=0;p<y.length;p++)w.push({start:y.start(p),end:y.end(p)});return this.bufferedInfo(w,A,h)}}catch(f){}return{len:0,start:A,end:A,nextStart:void 0}},K.bufferedInfo=function(R,A,h){A=Math.max(0,A),R.sort(function(x,D){var T=x.start-D.start;return T||D.end-x.end});var y=[];if(h)for(var w=0;w<R.length;w++){var p=y.length;if(p){var f=y[p-1].end;R[w].start-f<h?R[w].end>f&&(y[p-1].end=R[w].end):y.push(R[w])}else y.push(R[w])}else y=R;for(var g=0,a,r=A,o=A,l=0;l<y.length;l++){var C=y[l].start,b=y[l].end;if(A+h>=C&&A<b)r=C,o=b,g=o-A;else if(A+h<C){a=C;break}}return{len:g,start:r||0,end:o||0,nextStart:a}},K.getBuffered=function(R){try{return R.buffered}catch(A){return $.logger.log("failed to get media.buffered",A),N}},K}()},"./src/utils/cea-608-parser.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"Row",function(){return o}),P.d(V,"CaptionScreen",function(){return l});var $=P("./src/utils/logger.ts"),N={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},L=function(v){var u=v;return N.hasOwnProperty(v)&&(u=N[v]),String.fromCharCode(u)},K=15,F=100,R={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},A={17:2,18:4,21:6,22:8,23:10,19:13,20:15},h={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},y={25:2,26:4,29:6,30:8,31:10,27:13,28:15},w=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],p;(function(m){m[m.ERROR=0]="ERROR",m[m.TEXT=1]="TEXT",m[m.WARNING=2]="WARNING",m[m.INFO=2]="INFO",m[m.DEBUG=3]="DEBUG",m[m.DATA=3]="DATA"})(p||(p={}));var f=function(){function m(){this.time=null,this.verboseLevel=p.ERROR}var v=m.prototype;return v.log=function(s,S){this.verboseLevel>=s&&$.logger.log(this.time+" ["+s+"] "+S)},m}(),g=function(v){for(var u=[],s=0;s<v.length;s++)u.push(v[s].toString(16));return u},a=function(){function m(u,s,S,c,O){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=u||"white",this.underline=s||!1,this.italics=S||!1,this.background=c||"black",this.flash=O||!1}var v=m.prototype;return v.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},v.setStyles=function(s){for(var S=["foreground","underline","italics","background","flash"],c=0;c<S.length;c++){var O=S[c];s.hasOwnProperty(O)&&(this[O]=s[O])}},v.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},v.equals=function(s){return this.foreground===s.foreground&&this.underline===s.underline&&this.italics===s.italics&&this.background===s.background&&this.flash===s.flash},v.copy=function(s){this.foreground=s.foreground,this.underline=s.underline,this.italics=s.italics,this.background=s.background,this.flash=s.flash},v.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},m}(),r=function(){function m(u,s,S,c,O,M){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new a(s,S,c,O,M)}var v=m.prototype;return v.reset=function(){this.uchar=" ",this.penState.reset()},v.setChar=function(s,S){this.uchar=s,this.penState.copy(S)},v.setPenState=function(s){this.penState.copy(s)},v.equals=function(s){return this.uchar===s.uchar&&this.penState.equals(s.penState)},v.copy=function(s){this.uchar=s.uchar,this.penState.copy(s.penState)},v.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},m}(),o=function(){function m(u){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var s=0;s<F;s++)this.chars.push(new r);this.logger=u,this.pos=0,this.currPenState=new a}var v=m.prototype;return v.equals=function(s){for(var S=!0,c=0;c<F;c++)if(!this.chars[c].equals(s.chars[c])){S=!1;break}return S},v.copy=function(s){for(var S=0;S<F;S++)this.chars[S].copy(s.chars[S])},v.isEmpty=function(){for(var s=!0,S=0;S<F;S++)if(!this.chars[S].isEmpty()){s=!1;break}return s},v.setCursor=function(s){this.pos!==s&&(this.pos=s),this.pos<0?(this.logger.log(p.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>F&&(this.logger.log(p.DEBUG,"Too large cursor position "+this.pos),this.pos=F)},v.moveCursor=function(s){var S=this.pos+s;if(s>1)for(var c=this.pos+1;c<S+1;c++)this.chars[c].setPenState(this.currPenState);this.setCursor(S)},v.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},v.insertChar=function(s){s>=144&&this.backSpace();var S=L(s);if(this.pos>=F){this.logger.log(p.ERROR,"Cannot insert "+s.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},v.clearFromPos=function(s){var S;for(S=s;S<F;S++)this.chars[S].reset()},v.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},v.clearToEndOfRow=function(){this.clearFromPos(this.pos)},v.getTextString=function(){for(var s=[],S=!0,c=0;c<F;c++){var O=this.chars[c].uchar;O!==" "&&(S=!1),s.push(O)}return S?"":s.join("")},v.setPenStyles=function(s){this.currPenState.setStyles(s);var S=this.chars[this.pos];S.setPenState(this.currPenState)},m}(),l=function(){function m(u){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var s=0;s<K;s++)this.rows.push(new o(u));this.logger=u,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var v=m.prototype;return v.reset=function(){for(var s=0;s<K;s++)this.rows[s].clear();this.currRow=K-1},v.equals=function(s){for(var S=!0,c=0;c<K;c++)if(!this.rows[c].equals(s.rows[c])){S=!1;break}return S},v.copy=function(s){for(var S=0;S<K;S++)this.rows[S].copy(s.rows[S])},v.isEmpty=function(){for(var s=!0,S=0;S<K;S++)if(!this.rows[S].isEmpty()){s=!1;break}return s},v.backSpace=function(){var s=this.rows[this.currRow];s.backSpace()},v.clearToEndOfRow=function(){var s=this.rows[this.currRow];s.clearToEndOfRow()},v.insertChar=function(s){var S=this.rows[this.currRow];S.insertChar(s)},v.setPen=function(s){var S=this.rows[this.currRow];S.setPenStyles(s)},v.moveCursor=function(s){var S=this.rows[this.currRow];S.moveCursor(s)},v.setCursor=function(s){this.logger.log(p.INFO,"setCursor: "+s);var S=this.rows[this.currRow];S.setCursor(s)},v.setPAC=function(s){this.logger.log(p.INFO,"pacData = "+JSON.stringify(s));var S=s.row-1;if(this.nrRollUpRows&&S<this.nrRollUpRows-1&&(S=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==S){for(var c=0;c<K;c++)this.rows[c].clear();var O=this.currRow+1-this.nrRollUpRows,M=this.lastOutputScreen;if(M){var B=M.rows[O].cueStartTime,j=this.logger.time;if(B&&j!==null&&B<j)for(var H=0;H<this.nrRollUpRows;H++)this.rows[S-this.nrRollUpRows+H+1].copy(M.rows[O+H])}}this.currRow=S;var I=this.rows[this.currRow];if(s.indent!==null){var U=s.indent,J=Math.max(U-1,0);I.setCursor(s.indent),s.color=I.chars[J].penState.foreground}var ne={foreground:s.color,underline:s.underline,italics:s.italics,background:"black",flash:!1};this.setPen(ne)},v.setBkgData=function(s){this.logger.log(p.INFO,"bkgData = "+JSON.stringify(s)),this.backSpace(),this.setPen(s),this.insertChar(32)},v.setRollUpRows=function(s){this.nrRollUpRows=s},v.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(p.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(p.TEXT,this.getDisplayText());var s=this.currRow+1-this.nrRollUpRows,S=this.rows.splice(s,1)[0];S.clear(),this.rows.splice(this.currRow,0,S),this.logger.log(p.INFO,"Rolling up")},v.getDisplayText=function(s){s=s||!1;for(var S=[],c="",O=-1,M=0;M<K;M++){var B=this.rows[M].getTextString();B&&(O=M+1,s?S.push("Row "+O+": '"+B+"'"):S.push(B.trim()))}return S.length>0&&(s?c="["+S.join(" | ")+"]":c=S.join(`
`)),c},v.getTextAndFormat=function(){return this.rows},m}(),C=function(){function m(u,s,S){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=s,this.mode=null,this.verbose=0,this.displayedMemory=new l(S),this.nonDisplayedMemory=new l(S),this.lastOutputScreen=new l(S),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var v=m.prototype;return v.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},v.getHandler=function(){return this.outputFilter},v.setHandler=function(s){this.outputFilter=s},v.setPAC=function(s){this.writeScreen.setPAC(s)},v.setBkgData=function(s){this.writeScreen.setBkgData(s)},v.setMode=function(s){if(s===this.mode)return;this.mode=s,this.logger.log(p.INFO,"MODE="+s),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=s},v.insertChars=function(s){for(var S=0;S<s.length;S++)this.writeScreen.insertChar(s[S]);var c=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(p.INFO,c+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(p.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},v.ccRCL=function(){this.logger.log(p.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},v.ccBS=function(){if(this.logger.log(p.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},v.ccAOF=function(){},v.ccAON=function(){},v.ccDER=function(){this.logger.log(p.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},v.ccRU=function(s){this.logger.log(p.INFO,"RU("+s+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(s)},v.ccFON=function(){this.logger.log(p.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},v.ccRDC=function(){this.logger.log(p.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},v.ccTR=function(){this.logger.log(p.INFO,"TR"),this.setMode("MODE_TEXT")},v.ccRTD=function(){this.logger.log(p.INFO,"RTD"),this.setMode("MODE_TEXT")},v.ccEDM=function(){this.logger.log(p.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},v.ccCR=function(){this.logger.log(p.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},v.ccENM=function(){this.logger.log(p.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},v.ccEOC=function(){if(this.logger.log(p.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var s=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=s,this.writeScreen=this.nonDisplayedMemory,this.logger.log(p.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},v.ccTO=function(s){this.logger.log(p.INFO,"TO("+s+") - Tab Offset"),this.writeScreen.moveCursor(s)},v.ccMIDROW=function(s){var S={flash:!1};if(S.underline=s%2===1,S.italics=s>=46,S.italics)S.foreground="white";else{var c=Math.floor(s/2)-16,O=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=O[c]}this.logger.log(p.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},v.outputDataUpdate=function(s){s===void 0&&(s=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),s&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},v.cueSplitAtTime=function(s){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,s,this.displayedMemory),this.cueStartTime=s))},m}(),b=function(){function m(u,s,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var c=new f;this.channels=[null,new C(u,s,c),new C(u+1,S,c)],this.cmdHistory=T(),this.logger=c}var v=m.prototype;return v.getHandler=function(s){return this.channels[s].getHandler()},v.setHandler=function(s,S){this.channels[s].setHandler(S)},v.addData=function(s,S){var c,O,M,B=!1;this.logger.time=s;for(var j=0;j<S.length;j+=2){if(O=S[j]&127,M=S[j+1]&127,O===0&&M===0)continue;if(this.logger.log(p.DATA,"["+g([S[j],S[j+1]])+"] -> ("+g([O,M])+")"),c=this.parseCmd(O,M),c||(c=this.parseMidrow(O,M)),c||(c=this.parsePAC(O,M)),c||(c=this.parseBackgroundAttributes(O,M)),!c&&(B=this.parseChars(O,M),B)){var H=this.currentChannel;if(H&&H>0){var I=this.channels[H];I.insertChars(B)}else this.logger.log(p.WARNING,"No channel found yet. TEXT-MODE?")}!c&&!B&&this.logger.log(p.WARNING,"Couldn't parse cleaned data "+g([O,M])+" orig: "+g([S[j],S[j+1]]))}},v.parseCmd=function(s,S){var c=this.cmdHistory,O=(s===20||s===28||s===21||s===29)&&S>=32&&S<=47,M=(s===23||s===31)&&S>=33&&S<=35;if(!(O||M))return!1;if(D(s,S,c))return x(null,null,c),this.logger.log(p.DEBUG,"Repeated command ("+g([s,S])+") is dropped"),!0;var B=s===20||s===21||s===23?1:2,j=this.channels[B];return s===20||s===21||s===28||s===29?S===32?j.ccRCL():S===33?j.ccBS():S===34?j.ccAOF():S===35?j.ccAON():S===36?j.ccDER():S===37?j.ccRU(2):S===38?j.ccRU(3):S===39?j.ccRU(4):S===40?j.ccFON():S===41?j.ccRDC():S===42?j.ccTR():S===43?j.ccRTD():S===44?j.ccEDM():S===45?j.ccCR():S===46?j.ccENM():S===47&&j.ccEOC():j.ccTO(S-32),x(s,S,c),this.currentChannel=B,!0},v.parseMidrow=function(s,S){var c=0;if((s===17||s===25)&&S>=32&&S<=47){if(s===17?c=1:c=2,c!==this.currentChannel)return this.logger.log(p.ERROR,"Mismatch channel in midrow parsing"),!1;var O=this.channels[c];return O?(O.ccMIDROW(S),this.logger.log(p.DEBUG,"MIDROW ("+g([s,S])+")"),!0):!1}return!1},v.parsePAC=function(s,S){var c,O=this.cmdHistory,M=(s>=17&&s<=23||s>=25&&s<=31)&&S>=64&&S<=127,B=(s===16||s===24)&&S>=64&&S<=95;if(!(M||B))return!1;if(D(s,S,O))return x(null,null,O),!0;var j=s<=23?1:2;S>=64&&S<=95?c=j===1?R[s]:h[s]:c=j===1?A[s]:y[s];var H=this.channels[j];return H?(H.setPAC(this.interpretPAC(c,S)),x(s,S,O),this.currentChannel=j,!0):!1},v.interpretPAC=function(s,S){var c,O={color:null,italics:!1,indent:null,underline:!1,row:s};return S>95?c=S-96:c=S-64,O.underline=(c&1)===1,c<=13?O.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(c/2)]:c<=15?(O.italics=!0,O.color="white"):O.indent=Math.floor((c-16)/2)*4,O},v.parseChars=function(s,S){var c,O=null,M=null;if(s>=25?(c=2,M=s-8):(c=1,M=s),M>=17&&M<=19){var B;M===17?B=S+80:M===18?B=S+112:B=S+144,this.logger.log(p.INFO,"Special char '"+L(B)+"' in channel "+c),O=[B]}else s>=32&&s<=127&&(O=S===0?[s]:[s,S]);if(O){var j=g(O);this.logger.log(p.DEBUG,"Char codes = "+j.join(",")),x(s,S,this.cmdHistory)}return O},v.parseBackgroundAttributes=function(s,S){var c=(s===16||s===24)&&S>=32&&S<=47,O=(s===23||s===31)&&S>=45&&S<=47;if(!(c||O))return!1;var M,B={};s===16||s===24?(M=Math.floor((S-32)/2),B.background=w[M],S%2===1&&(B.background=B.background+"_semi")):S===45?B.background="transparent":(B.foreground="black",S===47&&(B.underline=!0));var j=s<=23?1:2,H=this.channels[j];return H.setBkgData(B),x(s,S,this.cmdHistory),!0},v.reset=function(){for(var s=0;s<Object.keys(this.channels).length;s++){var S=this.channels[s];S&&S.reset()}this.cmdHistory=T()},v.cueSplitAtTime=function(s){for(var S=0;S<this.channels.length;S++){var c=this.channels[S];c&&c.cueSplitAtTime(s)}},m}();function x(m,v,u){u.a=m,u.b=v}function D(m,v,u){return u.a===m&&u.b===v}function T(){return{a:null,b:null}}V.default=b},"./src/utils/codecs.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"isCodecType",function(){return N}),P.d(V,"isCodecSupportedInMp4",function(){return L});var $={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function N(K,F){var R=$[F];return!!R&&R[K.slice(0,4)]===!0}function L(K,F){return MediaSource.isTypeSupported((F||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/utils/vttparser.ts"),N=P("./src/utils/webvtt-parser.ts"),L=P("./src/utils/texttrack-utils.ts"),K=/\s/,F={newCue:function(A,h,y,w){for(var p=[],f,g,a,r,o,l=self.VTTCue||self.TextTrackCue,C=0;C<w.rows.length;C++)if(f=w.rows[C],a=!0,r=0,o="",!f.isEmpty()){for(var b=0;b<f.chars.length;b++)K.test(f.chars[b].uchar)&&a?r++:(o+=f.chars[b].uchar,a=!1);f.cueStartTime=h,h===y&&(y+=1e-4),r>=16?r--:r++;var x=Object($.fixLineBreaks)(o.trim()),D=Object(N.generateCueId)(h,y,x);(!A||!A.cues||!A.cues.getCueById(D))&&(g=new l(h,y,x),g.id=D,g.line=C+1,g.align="left",g.position=10+Math.min(80,Math.floor(r*8/32)*10),p.push(g))}return A&&p.length&&(p.sort(function(T,m){return T.line==="auto"||m.line==="auto"?0:T.line>8&&m.line>8?m.line-T.line:T.line-m.line}),p.forEach(function(T){return Object(L.addCueToTrack)(A,T)})),p}};V.default=F},"./src/utils/discontinuities.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"findFirstFragWithCC",function(){return K}),P.d(V,"shouldAlignOnDiscontinuities",function(){return F}),P.d(V,"findDiscontinuousReferenceFrag",function(){return R}),P.d(V,"adjustSlidingStart",function(){return h}),P.d(V,"alignStream",function(){return y}),P.d(V,"alignPDT",function(){return p}),P.d(V,"alignFragmentByPDTDelta",function(){return f}),P.d(V,"alignMediaPlaylistByPDT",function(){return g});var $=P("./src/polyfills/number.ts"),N=P("./src/utils/logger.ts"),L=P("./src/controller/level-helper.ts");function K(a,r){for(var o=null,l=0,C=a.length;l<C;l++){var b=a[l];if(b&&b.cc===r){o=b;break}}return o}function F(a,r,o){return!!(r.details&&(o.endCC>o.startCC||a&&a.cc<o.startCC))}function R(a,r){var o=a.fragments,l=r.fragments;if(!l.length||!o.length){N.logger.log("No fragments to align");return}var C=K(o,l[0].cc);if(!C||C&&!C.startPTS){N.logger.log("No frag in previous level to align on");return}return C}function A(a,r){if(a){var o=a.start+r;a.start=a.startPTS=o,a.endPTS=o+a.duration}}function h(a,r){for(var o=r.fragments,l=0,C=o.length;l<C;l++)A(o[l],a);r.fragmentHint&&A(r.fragmentHint,a),r.alignedSliding=!0}function y(a,r,o){if(!r)return;w(a,o,r),!o.alignedSliding&&r.details&&p(o,r.details),!o.alignedSliding&&r.details&&!o.skippedSegments&&Object(L.adjustSliding)(r.details,o)}function w(a,r,o){if(F(a,o,r)){var l=R(o.details,r);l&&Object($.isFiniteNumber)(l.start)&&(N.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),h(l.start,r))}}function p(a,r){if(!r.fragments.length||!a.hasProgramDateTime||!r.hasProgramDateTime)return;var o=r.fragments[0].programDateTime,l=a.fragments[0].programDateTime,C=(l-o)/1e3+r.fragments[0].start;C&&Object($.isFiniteNumber)(C)&&(N.logger.log("Adjusting PTS using programDateTime delta "+(l-o)+"ms, sliding:"+C.toFixed(3)+" "+a.url+" "),h(C,a))}function f(a,r){var o=a.programDateTime;if(!o)return;var l=(o-r)/1e3;a.start=a.startPTS=l,a.endPTS=l+a.duration}function g(a,r){if(!r.fragments.length||!a.hasProgramDateTime||!r.hasProgramDateTime)return;var o=r.fragments[0].programDateTime,l=r.fragments[0].start,C=o-l*1e3;a.fragments.forEach(function(b){f(b,C)}),a.fragmentHint&&f(a.fragmentHint,C),a.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/utils/ewma.ts"),N=function(){function L(F,R,A){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=A,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new $.default(F),this.fast_=new $.default(R)}var K=L.prototype;return K.update=function(R,A){var h=this.slow_,y=this.fast_;this.slow_.halfLife!==R&&(this.slow_=new $.default(R,h.getEstimate(),h.getTotalWeight())),this.fast_.halfLife!==A&&(this.fast_=new $.default(A,y.getEstimate(),y.getTotalWeight()))},K.sample=function(R,A){R=Math.max(R,this.minDelayMs_);var h=8*A,y=R/1e3,w=h/y;this.fast_.sample(y,w),this.slow_.sample(y,w)},K.canEstimate=function(){var R=this.fast_;return R&&R.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},L}();V.default=N},"./src/utils/ewma.ts":function(ue,V,P){"use strict";P.r(V);var $=function(){function N(K,F,R){F===void 0&&(F=0),R===void 0&&(R=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=F,this.totalWeight_=R}var L=N.prototype;return L.sample=function(F,R){var A=Math.pow(this.alpha_,F);this.estimate_=R*(1-A)+A*this.estimate_,this.totalWeight_+=F},L.getTotalWeight=function(){return this.totalWeight_},L.getEstimate=function(){if(this.alpha_){var F=1-Math.pow(this.alpha_,this.totalWeight_);if(F)return this.estimate_/F}return this.estimate_},N}();V.default=$},"./src/utils/fetch-loader.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"fetchSupported",function(){return f});var $=P("./src/polyfills/number.ts"),N=P("./src/loader/load-stats.ts"),L=P("./src/demux/chunk-cache.ts");function K(l,C){l.prototype=Object.create(C.prototype),l.prototype.constructor=l,y(l,C)}function F(l){var C=typeof Map=="function"?new Map:void 0;return F=function(x){if(x===null||!h(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof C!="undefined"){if(C.has(x))return C.get(x);C.set(x,D)}function D(){return R(x,arguments,w(this).constructor)}return D.prototype=Object.create(x.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),y(D,x)},F(l)}function R(l,C,b){return A()?R=Reflect.construct:R=function(D,T,m){var v=[null];v.push.apply(v,T);var u=Function.bind.apply(D,v),s=new u;return m&&y(s,m.prototype),s},R.apply(null,arguments)}function A(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function h(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function y(l,C){return y=Object.setPrototypeOf||function(x,D){return x.__proto__=D,x},y(l,C)}function w(l){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(b){return b.__proto__||Object.getPrototypeOf(b)},w(l)}function p(){return p=Object.assign||function(l){for(var C=1;C<arguments.length;C++){var b=arguments[C];for(var x in b)Object.prototype.hasOwnProperty.call(b,x)&&(l[x]=b[x])}return l},p.apply(this,arguments)}function f(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(l){}return!1}var g=function(){function l(b){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=b.fetchSetup||r,this.controller=new self.AbortController,this.stats=new N.LoadStats}var C=l.prototype;return C.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},C.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},C.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},C.load=function(x,D,T){var m=this,v=this.stats;if(v.loading.start)throw new Error("Loader can only be used once.");v.loading.start=self.performance.now();var u=a(x,this.controller.signal),s=T.onProgress,S=x.responseType==="arraybuffer",c=S?"byteLength":"length";this.context=x,this.config=D,this.callbacks=T,this.request=this.fetchSetup(x,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){m.abortInternal(),T.onTimeout(v,x,m.response)},D.timeout),self.fetch(this.request).then(function(O){if(m.response=m.loader=O,!O.ok){var M=O.status,B=O.statusText;throw new o(B||"fetch, bad network response",M,O)}return v.loading.first=Math.max(self.performance.now(),v.loading.start),v.total=parseInt(O.headers.get("Content-Length")||"0"),s&&Object($.isFiniteNumber)(D.highWaterMark)?m.loadProgressively(O,v,x,D.highWaterMark,s):S?O.arrayBuffer():O.text()}).then(function(O){var M=m.response;self.clearTimeout(m.requestTimeout),v.loading.end=Math.max(self.performance.now(),v.loading.first),v.loaded=v.total=O[c];var B={url:M.url,data:O};s&&!Object($.isFiniteNumber)(D.highWaterMark)&&s(v,x,O,M),T.onSuccess(B,v,x,M)}).catch(function(O){if(self.clearTimeout(m.requestTimeout),v.aborted)return;var M=O.code||0;T.onError({code:M,text:O.message},x,O.details)})},C.getCacheAge=function(){var x=null;if(this.response){var D=this.response.headers.get("age");x=D?parseFloat(D):null}return x},C.loadProgressively=function(x,D,T,m,v){m===void 0&&(m=0);var u=new L.default,s=x.body.getReader(),S=function c(){return s.read().then(function(O){if(O.done)return u.dataLength&&v(D,T,u.flush(),x),Promise.resolve(new ArrayBuffer(0));var M=O.value,B=M.length;return D.loaded+=B,B<m||u.dataLength?(u.push(M),u.dataLength>=m&&v(D,T,u.flush(),x)):v(D,T,M,x),c()}).catch(function(){return Promise.reject()})};return S()},l}();function a(l,C){var b={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(p({},l.headers))};return l.rangeEnd&&b.headers.set("Range","bytes="+l.rangeStart+"-"+String(l.rangeEnd-1)),b}function r(l,C){return new self.Request(l.url,C)}var o=function(l){K(C,l);function C(b,x,D){var T;return T=l.call(this,b)||this,T.code=void 0,T.details=void 0,T.code=x,T.details=D,T}return C}(F(Error));V.default=g},"./src/utils/imsc1-ttml-parser.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"IMSC1_CODEC",function(){return h}),P.d(V,"parseIMSC1",function(){return f});var $=P("./src/utils/mp4-tools.ts"),N=P("./src/utils/vttparser.ts"),L=P("./src/utils/vttcue.ts"),K=P("./src/demux/id3.ts"),F=P("./src/utils/timescale-conversion.ts"),R=P("./src/utils/webvtt-parser.ts");function A(){return A=Object.assign||function(m){for(var v=1;v<arguments.length;v++){var u=arguments[v];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(m[s]=u[s])}return m},A.apply(this,arguments)}var h="stpp.ttml.im1t",y=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,w=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,p={left:"start",center:"center",right:"end",start:"start",end:"end"};function f(m,v,u,s,S){var c=Object($.findBox)(new Uint8Array(m),["mdat"]);if(c.length===0){S(new Error("Could not parse IMSC1 mdat"));return}var O=c[0],M=Object(K.utf8ArrayToStr)(new Uint8Array(m,O.start,O.end-O.start)),B=Object(F.toTimescaleFromScale)(v,1,u);try{s(g(M,B))}catch(j){S(j)}}function g(m,v){var u=new DOMParser,s=u.parseFromString(m,"text/xml"),S=s.getElementsByTagName("tt")[0];if(!S)throw new Error("Invalid ttml");var c={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},O=Object.keys(c).reduce(function(I,U){return I[U]=S.getAttribute("ttp:"+U)||c[U],I},{}),M=S.getAttribute("xml:space")!=="preserve",B=r(a(S,"styling","style")),j=r(a(S,"layout","region")),H=a(S,"body","[begin]");return[].map.call(H,function(I){var U=o(I,M);if(!U||!I.hasAttribute("begin"))return null;var J=x(I.getAttribute("begin"),O),ne=x(I.getAttribute("dur"),O),he=x(I.getAttribute("end"),O);if(J===null)throw b(I);if(he===null){if(ne===null)throw b(I);he=J+ne}var Ee=new L.default(J-v,he-v,U);Ee.id=Object(R.generateCueId)(Ee.startTime,Ee.endTime,Ee.text);var Ae=j[I.getAttribute("region")],Oe=B[I.getAttribute("style")];Ee.position=10,Ee.size=80;var me=l(Ae,Oe),de=me.textAlign;if(de){var pe=p[de];pe&&(Ee.lineAlign=pe),Ee.align=de}return A(Ee,me),Ee}).filter(function(I){return I!==null})}function a(m,v,u){var s=m.getElementsByTagName(v)[0];return s?[].slice.call(s.querySelectorAll(u)):[]}function r(m){return m.reduce(function(v,u){var s=u.getAttribute("xml:id");return s&&(v[s]=u),v},{})}function o(m,v){return[].slice.call(m.childNodes).reduce(function(u,s,S){var c;return s.nodeName==="br"&&S?u+`
`:(c=s.childNodes)!==null&&c!==void 0&&c.length?o(s,v):v?u+s.textContent.trim().replace(/\s+/g," "):u+s.textContent},"")}function l(m,v){var u="http://www.w3.org/ns/ttml#styling",s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return s.reduce(function(S,c){var O=C(v,u,c)||C(m,u,c);return O&&(S[c]=O),S},{})}function C(m,v,u){return m.hasAttributeNS(v,u)?m.getAttributeNS(v,u):null}function b(m){return new Error("Could not parse ttml timestamp "+m)}function x(m,v){if(!m)return null;var u=Object(N.parseTimeStamp)(m);return u===null&&(y.test(m)?u=D(m,v):w.test(m)&&(u=T(m,v))),u}function D(m,v){var u=y.exec(m),s=(u[4]|0)+(u[5]|0)/v.subFrameRate;return(u[1]|0)*3600+(u[2]|0)*60+(u[3]|0)+s/v.frameRate}function T(m,v){var u=w.exec(m),s=Number(u[1]),S=u[2];switch(S){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/v.frameRate;case"t":return s/v.tickRate}return s}},"./src/utils/logger.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"enableLogs",function(){return R}),P.d(V,"logger",function(){return A});var $=function(){},N={trace:$,debug:$,log:$,warn:$,info:$,error:$},L=N;function K(h){var y=self.console[h];return y?y.bind(self.console,"["+h+"] >"):$}function F(h){for(var y=arguments.length,w=new Array(y>1?y-1:0),p=1;p<y;p++)w[p-1]=arguments[p];w.forEach(function(f){L[f]=h[f]?h[f].bind(h):K(f)})}function R(h){if(self.console&&h===!0||typeof h=="object"){F(h,"debug","log","info","warn","error");try{L.log()}catch(y){L=N}}else L=N}var A=L},"./src/utils/mediakeys-helper.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"KeySystems",function(){return $}),P.d(V,"requestMediaKeySystemAccess",function(){return N});var $;(function(L){L.WIDEVINE="com.widevine.alpha",L.PLAYREADY="com.microsoft.playready"})($||($={}));var N=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"getMediaSource",function(){return $});function $(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"bin2str",function(){return F}),P.d(V,"readUint16",function(){return R}),P.d(V,"readUint32",function(){return A}),P.d(V,"writeUint32",function(){return h}),P.d(V,"findBox",function(){return y}),P.d(V,"parseSegmentIndex",function(){return w}),P.d(V,"parseInitSegment",function(){return p}),P.d(V,"getStartDTS",function(){return f}),P.d(V,"getDuration",function(){return g}),P.d(V,"computeRawDurationFromSamples",function(){return a}),P.d(V,"offsetStartDTS",function(){return r}),P.d(V,"segmentValidRange",function(){return o}),P.d(V,"appendUint8Array",function(){return l});var $=P("./src/utils/typed-array.ts"),N=P("./src/loader/fragment.ts"),L=Math.pow(2,32)-1,K=[].push;function F(C){return String.fromCharCode.apply(null,C)}function R(C,b){"data"in C&&(b+=C.start,C=C.data);var x=C[b]<<8|C[b+1];return x<0?65536+x:x}function A(C,b){"data"in C&&(b+=C.start,C=C.data);var x=C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3];return x<0?4294967296+x:x}function h(C,b,x){"data"in C&&(b+=C.start,C=C.data),C[b]=x>>24,C[b+1]=x>>16&255,C[b+2]=x>>8&255,C[b+3]=x&255}function y(C,b){var x=[];if(!b.length)return x;var D,T,m;"data"in C?(D=C.data,T=C.start,m=C.end):(D=C,T=0,m=D.byteLength);for(var v=T;v<m;){var u=A(D,v),s=F(D.subarray(v+4,v+8)),S=u>1?v+u:m;if(s===b[0])if(b.length===1)x.push({data:D,start:v+8,end:S});else{var c=y({data:D,start:v+8,end:S},b.slice(1));c.length&&K.apply(x,c)}v=S}return x}function w(C){var b=y(C,["moov"]),x=b[0],D=x?x.end:null,T=y(C,["sidx"]);if(!T||!T[0])return null;var m=[],v=T[0],u=v.data[0],s=u===0?8:16,S=A(v,s);s+=4;var c=0,O=0;u===0?s+=8:s+=16,s+=2;var M=v.end+O,B=R(v,s);s+=2;for(var j=0;j<B;j++){var H=s,I=A(v,H);H+=4;var U=I&2147483647,J=(I&2147483648)>>>31;if(J===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=A(v,H);H+=4,m.push({referenceSize:U,subsegmentDuration:ne,info:{duration:ne/S,start:M,end:M+U-1}}),M+=U,H+=4,s=H}return{earliestPresentationTime:c,timescale:S,version:u,referencesCount:B,references:m,moovEndOffset:D}}function p(C){for(var b=[],x=y(C,["moov","trak"]),D=0;D<x.length;D++){var T=x[D],m=y(T,["tkhd"])[0];if(m){var v=m.data[m.start],u=v===0?12:20,s=A(m,u),S=y(T,["mdia","mdhd"])[0];if(S){v=S.data[S.start],u=v===0?12:20;var c=A(S,u),O=y(T,["mdia","hdlr"])[0];if(O){var M=F(O.data.subarray(O.start+8,O.start+12)),B={soun:N.ElementaryStreamTypes.AUDIO,vide:N.ElementaryStreamTypes.VIDEO}[M];if(B){var j=y(T,["mdia","minf","stbl","stsd"])[0],H=void 0;j&&(H=F(j.data.subarray(j.start+12,j.start+16))),b[s]={timescale:c,type:B},b[B]={timescale:c,id:s,codec:H}}}}}}var I=y(C,["moov","mvex","trex"]);return I.forEach(function(U){var J=A(U,4),ne=b[J];ne&&(ne.default={duration:A(U,12),flags:A(U,20)})}),b}function f(C,b){return y(b,["moof","traf"]).reduce(function(x,D){var T=y(D,["tfdt"])[0],m=T.data[T.start],v=y(D,["tfhd"]).reduce(function(u,s){var S=A(s,4),c=C[S];if(c){var O=A(T,4);m===1&&(O*=Math.pow(2,32),O+=A(T,8));var M=c.timescale||9e4,B=O/M;if(isFinite(B)&&(u===null||B<u))return B}return u},null);return v!==null&&isFinite(v)&&(x===null||v<x)?v:x},null)||0}function g(C,b){for(var x=0,D=0,T=0,m=y(C,["moof","traf"]),v=0;v<m.length;v++){var u=m[v],s=y(u,["tfhd"])[0],S=A(s,4),c=b[S];if(!c)continue;var O=c.default,M=A(s,0)|(O==null?void 0:O.flags),B=O==null?void 0:O.duration;M&8&&(M&2?B=A(s,12):B=A(s,8));for(var j=c.timescale||9e4,H=y(u,["trun"]),I=0;I<H.length;I++){if(B){var U=A(H[I],4);x=B*U}else x=a(H[I]);c.type===N.ElementaryStreamTypes.VIDEO?D+=x/j:c.type===N.ElementaryStreamTypes.AUDIO&&(T+=x/j)}}if(D===0&&T===0){var J=w(C);if(J!=null&&J.references)return J.references.reduce(function(ne,he){return ne+he.info.duration||0},0)}return D||T}function a(C){var b=A(C,0),x=8;b&1&&(x+=4),b&4&&(x+=4);for(var D=0,T=A(C,4),m=0;m<T;m++){if(b&256){var v=A(C,x);D+=v,x+=4}b&512&&(x+=4),b&1024&&(x+=4),b&2048&&(x+=4)}return D}function r(C,b,x){y(b,["moof","traf"]).forEach(function(D){y(D,["tfhd"]).forEach(function(T){var m=A(T,4),v=C[m];if(!v)return;var u=v.timescale||9e4;y(D,["tfdt"]).forEach(function(s){var S=s.data[s.start],c=A(s,4);if(S===0)h(s,4,c-x*u);else{c*=Math.pow(2,32),c+=A(s,8),c-=x*u,c=Math.max(c,0);var O=Math.floor(c/(L+1)),M=Math.floor(c%(L+1));h(s,4,O),h(s,8,M)}})})})}function o(C){var b={valid:null,remainder:null},x=y(C,["moof"]);if(x){if(x.length<2)return b.remainder=C,b}else return b;var D=x[x.length-1];return b.valid=Object($.sliceUint8)(C,0,D.start-8),b.remainder=Object($.sliceUint8)(C,D.start-8),b}function l(C,b){var x=new Uint8Array(C.length+b.length);return x.set(C),x.set(b,C.length),x}},"./src/utils/output-filter.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"default",function(){return $});var $=function(){function N(K,F){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=F}var L=N.prototype;return L.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},L.newCue=function(F,R,A){(this.startTime===null||this.startTime>F)&&(this.startTime=F),this.endTime=R,this.screen=A,this.timelineController.createCaptionsTrack(this.trackName)},L.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"sendAddTrackEvent",function(){return N}),P.d(V,"addCueToTrack",function(){return L}),P.d(V,"clearCurrentCues",function(){return K}),P.d(V,"removeCuesInRange",function(){return F}),P.d(V,"getCuesInRange",function(){return A});var $=P("./src/utils/logger.ts");function N(h,y){var w;try{w=new Event("addtrack")}catch(p){w=document.createEvent("Event"),w.initEvent("addtrack",!1,!1)}w.track=h,y.dispatchEvent(w)}function L(h,y){var w=h.mode;if(w==="disabled"&&(h.mode="hidden"),h.cues&&!h.cues.getCueById(y.id))try{if(h.addCue(y),!h.cues.getCueById(y.id))throw new Error("addCue is failed for: "+y)}catch(f){$.logger.debug("[texttrack-utils]: "+f);var p=new self.TextTrackCue(y.startTime,y.endTime,y.text);p.id=y.id,h.addCue(p)}w==="disabled"&&(h.mode=w)}function K(h){var y=h.mode;if(y==="disabled"&&(h.mode="hidden"),h.cues)for(var w=h.cues.length;w--;)h.removeCue(h.cues[w]);y==="disabled"&&(h.mode=y)}function F(h,y,w){var p=h.mode;if(p==="disabled"&&(h.mode="hidden"),h.cues&&h.cues.length>0)for(var f=A(h.cues,y,w),g=0;g<f.length;g++)h.removeCue(f[g]);p==="disabled"&&(h.mode=p)}function R(h,y){if(y<h[0].startTime)return 0;var w=h.length-1;if(y>h[w].endTime)return-1;for(var p=0,f=w;p<=f;){var g=Math.floor((f+p)/2);if(y<h[g].startTime)f=g-1;else if(y>h[g].startTime&&p<w)p=g+1;else return g}return h[p].startTime-y<y-h[f].startTime?p:f}function A(h,y,w){var p=[],f=R(h,y);if(f>-1)for(var g=f,a=h.length;g<a;g++){var r=h[g];if(r.startTime>=y&&r.endTime<=w)p.push(r);else if(r.startTime>w)return p}return p}},"./src/utils/time-ranges.ts":function(ue,V,P){"use strict";P.r(V);var $={toString:function(L){for(var K="",F=L.length,R=0;R<F;R++)K+="["+L.start(R).toFixed(3)+","+L.end(R).toFixed(3)+"]";return K}};V.default=$},"./src/utils/timescale-conversion.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"toTimescaleFromBase",function(){return N}),P.d(V,"toTimescaleFromScale",function(){return L}),P.d(V,"toMsFromMpegTsClock",function(){return K}),P.d(V,"toMpegTsClockFromTimescale",function(){return F});var $=9e4;function N(R,A,h,y){h===void 0&&(h=1),y===void 0&&(y=!1);var w=R*A*h;return y?Math.round(w):w}function L(R,A,h,y){return h===void 0&&(h=1),y===void 0&&(y=!1),N(R,A,1/h,y)}function K(R,A){return A===void 0&&(A=!1),N(R,1e3,1/$,A)}function F(R,A){return A===void 0&&(A=1),N(R,$,1/A)}},"./src/utils/typed-array.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"sliceUint8",function(){return $});function $(N,L,K){return Uint8Array.prototype.slice?N.slice(L,K):new Uint8Array(Array.prototype.slice.call(N,L,K))}},"./src/utils/vttcue.ts":function(ue,V,P){"use strict";P.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var $=["","lr","rl"],N=["start","middle","end","left","right"];function L(h,y){if(typeof y!="string")return!1;if(!Array.isArray(h))return!1;var w=y.toLowerCase();return~h.indexOf(w)?w:!1}function K(h){return L($,h)}function F(h){return L(N,h)}function R(h){for(var y=arguments.length,w=new Array(y>1?y-1:0),p=1;p<y;p++)w[p-1]=arguments[p];for(var f=1;f<arguments.length;f++){var g=arguments[f];for(var a in g)h[a]=g[a]}return h}function A(h,y,w){var p=this,f={enumerable:!0};p.hasBeenReset=!1;var g="",a=!1,r=h,o=y,l=w,C=null,b="",x=!0,D="auto",T="start",m=50,v="middle",u=50,s="middle";Object.defineProperty(p,"id",R({},f,{get:function(){return g},set:function(c){g=""+c}})),Object.defineProperty(p,"pauseOnExit",R({},f,{get:function(){return a},set:function(c){a=!!c}})),Object.defineProperty(p,"startTime",R({},f,{get:function(){return r},set:function(c){if(typeof c!="number")throw new TypeError("Start time must be set to a number.");r=c,this.hasBeenReset=!0}})),Object.defineProperty(p,"endTime",R({},f,{get:function(){return o},set:function(c){if(typeof c!="number")throw new TypeError("End time must be set to a number.");o=c,this.hasBeenReset=!0}})),Object.defineProperty(p,"text",R({},f,{get:function(){return l},set:function(c){l=""+c,this.hasBeenReset=!0}})),Object.defineProperty(p,"region",R({},f,{get:function(){return C},set:function(c){C=c,this.hasBeenReset=!0}})),Object.defineProperty(p,"vertical",R({},f,{get:function(){return b},set:function(c){var O=K(c);if(O===!1)throw new SyntaxError("An invalid or illegal string was specified.");b=O,this.hasBeenReset=!0}})),Object.defineProperty(p,"snapToLines",R({},f,{get:function(){return x},set:function(c){x=!!c,this.hasBeenReset=!0}})),Object.defineProperty(p,"line",R({},f,{get:function(){return D},set:function(c){if(typeof c!="number"&&c!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=c,this.hasBeenReset=!0}})),Object.defineProperty(p,"lineAlign",R({},f,{get:function(){return T},set:function(c){var O=F(c);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");T=O,this.hasBeenReset=!0}})),Object.defineProperty(p,"position",R({},f,{get:function(){return m},set:function(c){if(c<0||c>100)throw new Error("Position must be between 0 and 100.");m=c,this.hasBeenReset=!0}})),Object.defineProperty(p,"positionAlign",R({},f,{get:function(){return v},set:function(c){var O=F(c);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");v=O,this.hasBeenReset=!0}})),Object.defineProperty(p,"size",R({},f,{get:function(){return u},set:function(c){if(c<0||c>100)throw new Error("Size must be between 0 and 100.");u=c,this.hasBeenReset=!0}})),Object.defineProperty(p,"align",R({},f,{get:function(){return s},set:function(c){var O=F(c);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");s=O,this.hasBeenReset=!0}})),p.displayState=void 0}return A.prototype.getCueAsHTML=function(){var h=self.WebVTT;return h.convertCueToDOMTree(self,this.text)},A}()},"./src/utils/vttparser.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"parseTimeStamp",function(){return L}),P.d(V,"fixLineBreaks",function(){return y}),P.d(V,"VTTParser",function(){return w});var $=P("./src/utils/vttcue.ts"),N=function(){function p(){}var f=p.prototype;return f.decode=function(a,r){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},p}();function L(p){function f(a,r,o,l){return(a|0)*3600+(r|0)*60+(o|0)+parseFloat(l||0)}var g=p.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return g?parseFloat(g[2])>59?f(g[2],g[3],0,g[4]):f(g[1],g[2],g[3],g[4]):null}var K=function(){function p(){this.values=Object.create(null)}var f=p.prototype;return f.set=function(a,r){!this.get(a)&&r!==""&&(this.values[a]=r)},f.get=function(a,r,o){return o?this.has(a)?this.values[a]:r[o]:this.has(a)?this.values[a]:r},f.has=function(a){return a in this.values},f.alt=function(a,r,o){for(var l=0;l<o.length;++l)if(r===o[l]){this.set(a,r);break}},f.integer=function(a,r){/^-?\d+$/.test(r)&&this.set(a,parseInt(r,10))},f.percent=function(a,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var o=parseFloat(r);if(o>=0&&o<=100)return this.set(a,o),!0}return!1},p}();function F(p,f,g,a){var r=a?p.split(a):[p];for(var o in r){if(typeof r[o]!="string")continue;var l=r[o].split(g);if(l.length!==2)continue;var C=l[0],b=l[1];f(C,b)}}var R=new $.default(0,0,""),A=R.align==="middle"?"middle":"center";function h(p,f,g){var a=p;function r(){var C=L(p);if(C===null)throw new Error("Malformed timestamp: "+a);return p=p.replace(/^[^\sa-zA-Z-]+/,""),C}function o(C,b){var x=new K;F(C,function(m,v){var u;switch(m){case"region":for(var s=g.length-1;s>=0;s--)if(g[s].id===v){x.set(m,g[s].region);break}break;case"vertical":x.alt(m,v,["rl","lr"]);break;case"line":u=v.split(","),x.integer(m,u[0]),x.percent(m,u[0])&&x.set("snapToLines",!1),x.alt(m,u[0],["auto"]),u.length===2&&x.alt("lineAlign",u[1],["start",A,"end"]);break;case"position":u=v.split(","),x.percent(m,u[0]),u.length===2&&x.alt("positionAlign",u[1],["start",A,"end","line-left","line-right","auto"]);break;case"size":x.percent(m,v);break;case"align":x.alt(m,v,["start",A,"end","left","right"]);break}},/:/,/\s/),b.region=x.get("region",null),b.vertical=x.get("vertical","");var D=x.get("line","auto");D==="auto"&&R.line===-1&&(D=-1),b.line=D,b.lineAlign=x.get("lineAlign","start"),b.snapToLines=x.get("snapToLines",!0),b.size=x.get("size",100),b.align=x.get("align",A);var T=x.get("position","auto");T==="auto"&&R.position===50&&(T=b.align==="start"||b.align==="left"?0:b.align==="end"||b.align==="right"?100:50),b.position=T}function l(){p=p.replace(/^\s+/,"")}if(l(),f.startTime=r(),l(),p.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);p=p.substr(3),l(),f.endTime=r(),l(),o(p,f)}function y(p){return p.replace(/<br(?: \/)?>/gi,`
`)}var w=function(){function p(){this.state="INITIAL",this.buffer="",this.decoder=new N,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var f=p.prototype;return f.parse=function(a){var r=this;a&&(r.buffer+=r.decoder.decode(a,{stream:!0}));function o(){var T=r.buffer,m=0;for(T=y(T);m<T.length&&T[m]!=="\r"&&T[m]!==`
`;)++m;var v=T.substr(0,m);return T[m]==="\r"&&++m,T[m]===`
`&&++m,r.buffer=T.substr(m),v}function l(T){F(T,function(m,v){},/:/)}try{var C="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;C=o();var b=C.match(/^()?WEBVTT([ \t].*)?$/);if(!b||!b[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var x=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;x?x=!1:C=o();switch(r.state){case"HEADER":/:/.test(C)?l(C):C||(r.state="ID");continue;case"NOTE":C||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(C)){r.state="NOTE";break}if(!C)continue;if(r.cue=new $.default(0,0,""),r.state="CUE",C.indexOf("-->")===-1){r.cue.id=C;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{h(C,r.cue,r.regionList)}catch(T){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var D=C.indexOf("-->")!==-1;if(!C||D&&(x=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
`),r.cue.text+=C}continue;case"BADCUE":C||(r.state="ID")}}}catch(T){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},f.flush=function(){var a=this;try{if((a.cue||a.state==="HEADER")&&(a.buffer+=`
`,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){a.onparsingerror&&a.onparsingerror(r)}return a.onflush&&a.onflush(),this},p}()},"./src/utils/webvtt-parser.ts":function(ue,V,P){"use strict";P.r(V),P.d(V,"generateCueId",function(){return w}),P.d(V,"parseWebVTT",function(){return f});var $=P("./src/polyfills/number.ts"),N=P("./src/utils/vttparser.ts"),L=P("./src/demux/id3.ts"),K=P("./src/utils/timescale-conversion.ts"),F=P("./src/remux/mp4-remuxer.ts"),R=/\r\n|\n\r|\n|\r/g,A=function(a,r,o){return o===void 0&&(o=0),a.substr(o,r.length)===r},h=function(a){var r=parseInt(a.substr(-3)),o=parseInt(a.substr(-6,2)),l=parseInt(a.substr(-9,2)),C=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object($.isFiniteNumber)(r)||!Object($.isFiniteNumber)(o)||!Object($.isFiniteNumber)(l)||!Object($.isFiniteNumber)(C))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return r+=1e3*o,r+=60*1e3*l,r+=60*60*1e3*C,r},y=function(a){for(var r=5381,o=a.length;o;)r=r*33^a.charCodeAt(--o);return(r>>>0).toString()};function w(g,a,r){return y(g.toString())+y(a.toString())+y(r)}var p=function(a,r,o){var l=a[r],C=a[l.prevCC];if(!C||!C.new&&l.new){a.ccOffset=a.presentationOffset=l.start,l.new=!1;return}for(;(b=C)!==null&&b!==void 0&&b.new;){var b;a.ccOffset+=l.start-C.start,l.new=!1,l=C,C=a[l.prevCC]}a.presentationOffset=o};function f(g,a,r,o,l,C,b,x){var D=new N.VTTParser,T=Object(L.utf8ArrayToStr)(new Uint8Array(g)).trim().replace(R,`
`).split(`
`),m=[],v=Object(K.toMpegTsClockFromTimescale)(a,r),u="00:00.000",s=0,S=0,c,O=!0,M=!1;D.oncue=function(B){var j=o[l],H=o.ccOffset,I=(s-v)/9e4;if(j!=null&&j.new&&(S!==void 0?H=o.ccOffset=j.start:p(o,l,I)),I&&(H=I-o.presentationOffset),M){var U=B.endTime-B.startTime,J=Object(F.normalizePts)((B.startTime+H-S)*9e4,C*9e4)/9e4;B.startTime=J,B.endTime=J+U}var ne=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(ne)),B.id||(B.id=w(B.startTime,B.endTime,ne)),B.endTime>0&&m.push(B)},D.onparsingerror=function(B){c=B},D.onflush=function(){if(c){x(c);return}b(m)},T.forEach(function(B){if(O)if(A(B,"X-TIMESTAMP-MAP=")){O=!1,M=!0,B.substr(16).split(",").forEach(function(j){A(j,"LOCAL:")?u=j.substr(6):A(j,"MPEGTS:")&&(s=parseInt(j.substr(7)))});try{S=h(u)/1e3}catch(j){M=!1,c=j}return}else B===""&&(O=!1);D.parse(B+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(ue,V,P){"use strict";P.r(V);var $=P("./src/utils/logger.ts"),N=P("./src/loader/load-stats.ts"),L=/^age:\s*[\d.]+\s*$/m,K=function(){function F(A){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=A?A.xhrSetup:null,this.stats=new N.LoadStats,this.retryDelay=0}var R=F.prototype;return R.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},R.abortInternal=function(){var h=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),h&&(h.onreadystatechange=null,h.onprogress=null,h.readyState!==4&&(this.stats.aborted=!0,h.abort()))},R.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},R.load=function(h,y,w){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=h,this.config=y,this.callbacks=w,this.retryDelay=y.retryDelay,this.loadInternal()},R.loadInternal=function(){var h=this.config,y=this.context;if(!h)return;var w=this.loader=new self.XMLHttpRequest,p=this.stats;p.loading.first=0,p.loaded=0;var f=this.xhrSetup;try{if(f)try{f(w,y.url)}catch(r){w.open("GET",y.url,!0),f(w,y.url)}w.readyState||w.open("GET",y.url,!0);var g=this.context.headers;if(g)for(var a in g)w.setRequestHeader(a,g[a])}catch(r){this.callbacks.onError({code:w.status,text:r.message},y,w);return}y.rangeEnd&&w.setRequestHeader("Range","bytes="+y.rangeStart+"-"+(y.rangeEnd-1)),w.onreadystatechange=this.readystatechange.bind(this),w.onprogress=this.loadprogress.bind(this),w.responseType=y.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),h.timeout),w.send()},R.readystatechange=function(){var h=this.context,y=this.loader,w=this.stats;if(!h||!y)return;var p=y.readyState,f=this.config;if(w.aborted)return;if(p>=2)if(self.clearTimeout(this.requestTimeout),w.loading.first===0&&(w.loading.first=Math.max(self.performance.now(),w.loading.start)),p===4){y.onreadystatechange=null,y.onprogress=null;var g=y.status;if(g>=200&&g<300){w.loading.end=Math.max(self.performance.now(),w.loading.first);var a,r;if(h.responseType==="arraybuffer"?(a=y.response,r=a.byteLength):(a=y.responseText,r=a.length),w.loaded=w.total=r,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(w,h,a,y),!this.callbacks)return;var l={url:y.responseURL,data:a};this.callbacks.onSuccess(l,w,h,y)}else w.retry>=f.maxRetry||g>=400&&g<499?($.logger.error(g+" while loading "+h.url),this.callbacks.onError({code:g,text:y.statusText},h,y)):($.logger.warn(g+" while loading "+h.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,f.maxRetryDelay),w.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),f.timeout)},R.loadtimeout=function(){$.logger.warn("timeout while loading "+this.context.url);var h=this.callbacks;h&&(this.abortInternal(),h.onTimeout(this.stats,this.context,this.loader))},R.loadprogress=function(h){var y=this.stats;y.loaded=h.loaded,h.lengthComputable&&(y.total=h.total)},R.getCacheAge=function(){var h=null;if(this.loader&&L.test(this.loader.getAllResponseHeaders())){var y=this.loader.getResponseHeader("age");h=y?parseFloat(y):null}return h},F}();V.default=K}}).default})},vHTk:function(ct,Te,W){ct.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return st});var ue=W("rePB"),V=W("VTBJ"),P=W("KQm4"),$=W("U8pU"),N=W("ODXe"),L=W("q1tI"),K=W("TSYQ"),F=W.n(K),R=W("Gytx"),A=W.n(R),h=W("Kwbf"),y=W("t23M"),w=W("qx4F"),p=W("6eGT"),f=W("IBYe"),g=W("Ff2n"),a=W("c+Xe"),r=W("fyJ8"),o=W("biw7");function l(ke,Le,We,Ve,Ne){var Ke=We[ke]||{},we=We[Le]||{},ye,ge;Ke.fixed==="left"?ye=Ve.left[ke]:we.fixed==="right"&&(ge=Ve.right[Le]);var ae=!1,re=!1,be=!1,Ce=!1,Ie=We[Le+1],De=We[ke-1];if(Ne==="rtl"){if(ye!==void 0){var Ge=De&&De.fixed==="left";Ce=!Ge}else if(ge!==void 0){var Qe=Ie&&Ie.fixed==="right";be=!Qe}}else if(ye!==void 0){var dt=Ie&&Ie.fixed==="left";ae=!dt}else if(ge!==void 0){var rt=De&&De.fixed==="right";re=!rt}return{fixLeft:ye,fixRight:ge,lastFixLeft:ae,firstFixRight:re,lastFixRight:be,firstFixLeft:Ce,isSticky:Ve.isSticky}}var C=W("sR1s");function b(ke){var Le=ke.cells,We=ke.stickyOffsets,Ve=ke.flattenColumns,Ne=ke.rowComponent,Ke=ke.cellComponent,we=ke.onHeaderRow,ye=ke.index,ge=L.useContext(o.a),ae=ge.prefixCls,re=ge.direction,be;we&&(be=we(Le.map(function(Ie){return Ie.column}),ye));var Ce=Object(C.a)(Le.map(function(Ie){return Ie.column}));return L.createElement(Ne,Object.assign({},be),Le.map(function(Ie,De){var Ge=Ie.column,Qe=l(Ie.colStart,Ie.colEnd,Ve,We,re),dt;return Ge&&Ge.onHeaderCell&&(dt=Ie.column.onHeaderCell(Ge)),L.createElement(r.a,Object.assign({},Ie,{ellipsis:Ge.ellipsis,align:Ge.align,component:Ke,prefixCls:ae,key:Ce[De]},Qe,{additionalProps:dt,rowType:"header"}))}))}b.displayName="HeaderRow";var x=b;function D(ke){var Le=[];function We(we,ye){var ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Le[ge]=Le[ge]||[];var ae=ye,re=we.filter(Boolean).map(function(be){var Ce={key:be.key,className:be.className||"",children:be.title,column:be,colStart:ae},Ie=1,De=be.children;return De&&De.length>0&&(Ie=We(De,ae,ge+1).reduce(function(Ge,Qe){return Ge+Qe},0),Ce.hasSubColumns=!0),"colSpan"in be&&(Ie=be.colSpan),"rowSpan"in be&&(Ce.rowSpan=be.rowSpan),Ce.colSpan=Ie,Ce.colEnd=Ce.colStart+Ie-1,Le[ge].push(Ce),ae+=Ie,Ie});return re}We(ke,0);for(var Ve=Le.length,Ne=function(ye){Le[ye].forEach(function(ge){!("rowSpan"in ge)&&!ge.hasSubColumns&&(ge.rowSpan=Ve-ye)})},Ke=0;Ke<Ve;Ke+=1)Ne(Ke);return Le}function T(ke){var Le=ke.stickyOffsets,We=ke.columns,Ve=ke.flattenColumns,Ne=ke.onHeaderRow,Ke=L.useContext(o.a),we=Ke.prefixCls,ye=Ke.getComponent,ge=L.useMemo(function(){return D(We)},[We]),ae=ye(["header","wrapper"],"thead"),re=ye(["header","row"],"tr"),be=ye(["header","cell"],"th");return L.createElement(ae,{className:"".concat(we,"-thead")},ge.map(function(Ce,Ie){var De=L.createElement(x,{key:Ie,flattenColumns:Ve,cells:Ce,stickyOffsets:Le,rowComponent:re,cellComponent:be,onHeaderRow:Ne,index:Ie});return De}))}var m=T,v=W("hW8S");function u(ke){for(var Le=ke.colWidths,We=ke.columns,Ve=ke.columCount,Ne=[],Ke=Ve||We.length,we=!1,ye=Ke-1;ye>=0;ye-=1){var ge=Le[ye],ae=We&&We[ye],re=ae&&ae[v.a];(ge||re||we)&&(Ne.unshift(L.createElement("col",Object.assign({key:ye,style:{width:ge,minWidth:ge}},re))),we=!0)}return L.createElement("colgroup",null,Ne)}var s=u;function S(ke,Le){return Object(L.useMemo)(function(){for(var We=[],Ve=0;Ve<Le;Ve+=1){var Ne=ke[Ve];if(Ne!==void 0)We[Ve]=Ne;else return null}return We},[ke.join("_"),Le])}var c=L.forwardRef(function(ke,Le){var We=ke.noData,Ve=ke.columns,Ne=ke.flattenColumns,Ke=ke.colWidths,we=ke.columCount,ye=ke.stickyOffsets,ge=ke.direction,ae=ke.fixHeader,re=ke.offsetHeader,be=ke.stickyClassName,Ce=ke.onScroll,Ie=Object(g.a)(ke,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),De=L.useContext(o.a),Ge=De.prefixCls,Qe=De.scrollbarSize,dt=De.isSticky,rt=dt&&!ae?0:Qe,ht=L.useRef(null),ft=L.useCallback(function(Ut){Object(a.b)(Le,Ut),Object(a.b)(ht,Ut)},[]);L.useEffect(function(){var Ut;function Nt(qe){var Ze=qe.currentTarget,ze=qe.deltaX;ze&&(Ce({currentTarget:Ze,scrollLeft:Ze.scrollLeft+ze}),qe.preventDefault())}return(Ut=ht.current)===null||Ut===void 0||Ut.addEventListener("wheel",Nt),function(){var qe;(qe=ht.current)===null||qe===void 0||qe.removeEventListener("wheel",Nt)}},[]);var at=Ne[Ne.length-1],Dt={fixed:at?at.fixed:null,onHeaderCell:function(){return{className:"".concat(Ge,"-cell-scrollbar")}}},Lt=Object(L.useMemo)(function(){return rt?[].concat(Object(P.a)(Ve),[Dt]):Ve},[rt,Ve]),Tt=Object(L.useMemo)(function(){return rt?[].concat(Object(P.a)(Ne),[Dt]):Ne},[rt,Ne]),Rt=Object(L.useMemo)(function(){var Ut=ye.right,Nt=ye.left;return Object(V.a)(Object(V.a)({},ye),{},{left:ge==="rtl"?[].concat(Object(P.a)(Nt.map(function(qe){return qe+rt})),[0]):Nt,right:ge==="rtl"?Ut:[].concat(Object(P.a)(Ut.map(function(qe){return qe+rt})),[0]),isSticky:dt})},[rt,ye,dt]),wt=S(Ke,we);return L.createElement("div",{style:Object(V.a)({overflow:"hidden"},dt?{top:re}:{}),ref:ft,className:F()("".concat(Ge,"-header"),Object(ue.a)({},be,!!be))},L.createElement("table",{style:{tableLayout:"fixed",visibility:We||wt?null:"hidden"}},L.createElement(s,{colWidths:wt?[].concat(Object(P.a)(wt),[rt]):[],columCount:we+1,columns:Tt}),L.createElement(m,Object.assign({},Ie,{stickyOffsets:Rt,columns:Lt,flattenColumns:Tt}))))});c.displayName="FixedHeader";var O=c,M=L.createContext(null),B=M;function j(ke){var Le=ke.prefixCls,We=ke.children,Ve=ke.component,Ne=ke.cellComponent,Ke=ke.fixHeader,we=ke.fixColumn,ye=ke.horizonScroll,ge=ke.className,ae=ke.expanded,re=ke.componentWidth,be=ke.colSpan,Ce=L.useContext(o.a),Ie=Ce.scrollbarSize;return L.useMemo(function(){var De=We;return we&&(De=L.createElement("div",{style:{width:re-(Ke?Ie:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Le,"-expanded-row-fixed")},De)),L.createElement(Ve,{className:ge,style:{display:ae?null:"none"}},L.createElement(r.a,{component:Ne,prefixCls:Le,colSpan:be},De))},[We,Ve,Ke,ye,ge,ae,re,be,Ie])}var H=j;function I(ke){var Le=ke.className,We=ke.style,Ve=ke.record,Ne=ke.index,Ke=ke.rowKey,we=ke.getRowKey,ye=ke.rowExpandable,ge=ke.expandedKeys,ae=ke.onRow,re=ke.indent,be=re===void 0?0:re,Ce=ke.rowComponent,Ie=ke.cellComponent,De=ke.childrenColumnName,Ge=L.useContext(o.a),Qe=Ge.prefixCls,dt=Ge.fixedInfoList,rt=L.useContext(B),ht=rt.fixHeader,ft=rt.fixColumn,at=rt.horizonScroll,Dt=rt.componentWidth,Lt=rt.flattenColumns,Tt=rt.expandableType,Rt=rt.expandRowByClick,wt=rt.onTriggerExpand,Ut=rt.rowClassName,Nt=rt.expandedRowClassName,qe=rt.indentSize,Ze=rt.expandIcon,ze=rt.expandedRowRender,Ye=rt.expandIconColumnIndex,ot=L.useState(!1),gt=Object(N.a)(ot,2),Mt=gt[0],Et=gt[1],lt=ge&&ge.has(ke.recordKey);L.useEffect(function(){lt&&Et(!0)},[lt]);var Jt=Tt==="row"&&(!ye||ye(Ve)),vr=Tt==="nest",$t=De&&Ve&&Ve[De],vt=Jt||vr,zt;ae&&(zt=ae(Ve,Ne));var Qt=function(E){if(Rt&&vt&&wt(Ve,E),zt&&zt.onClick){for(var _,z=arguments.length,Q=new Array(z>1?z-1:0),Y=1;Y<z;Y++)Q[Y-1]=arguments[Y];(_=zt).onClick.apply(_,[E].concat(Q))}},or;typeof Ut=="string"?or=Ut:typeof Ut=="function"&&(or=Ut(Ve,Ne,be));var Xe=Object(C.a)(Lt),xt=L.createElement(Ce,Object.assign({},zt,{"data-row-key":Ke,className:F()(Le,"".concat(Qe,"-row"),"".concat(Qe,"-row-level-").concat(be),or,zt&&zt.className),style:Object(V.a)(Object(V.a)({},We),zt?zt.style:null),onClick:Qt}),Lt.map(function(G,E){var _=G.render,z=G.dataIndex,Q=G.className,Y=Xe[E],Re=dt[E],et;E===(Ye||0)&&vr&&(et=L.createElement(L.Fragment,null,L.createElement("span",{style:{paddingLeft:"".concat(qe*be,"px")},className:"".concat(Qe,"-row-indent indent-level-").concat(be)}),Ze({prefixCls:Qe,expanded:lt,expandable:$t,record:Ve,onExpand:wt})));var yt;return G.onCell&&(yt=G.onCell(Ve,Ne)),L.createElement(r.a,Object.assign({className:Q,ellipsis:G.ellipsis,align:G.align,component:Ie,prefixCls:Qe,key:Y,record:Ve,index:Ne,dataIndex:z,render:_,shouldCellUpdate:G.shouldCellUpdate},Re,{appendNode:et,additionalProps:yt}))})),Pt;if(Jt&&(Mt||lt)){var At=ze(Ve,Ne,be+1,lt),Ft=Nt&&Nt(Ve,Ne,be);Pt=L.createElement(H,{expanded:lt,className:F()("".concat(Qe,"-expanded-row"),"".concat(Qe,"-expanded-row-level-").concat(be+1),Ft),prefixCls:Qe,fixHeader:ht,fixColumn:ft,horizonScroll:at,component:Ce,componentWidth:Dt,cellComponent:Ie,colSpan:Lt.length},At)}var Yt;return $t&&lt&&(Yt=(Ve[De]||[]).map(function(G,E){var _=we(G,E);return L.createElement(I,Object.assign({},ke,{key:_,rowKey:_,record:G,recordKey:_,index:E,indent:be+1}))})),L.createElement(L.Fragment,null,xt,Pt,Yt)}I.displayName="BodyRow";var U=I,J=L.createContext(null),ne=J;function he(ke){var Le=ke.columnKey,We=ke.onColumnResize,Ve=L.useRef();return L.useEffect(function(){Ve.current&&We(Le,Ve.current.offsetWidth)},[]),L.createElement(y.a,{onResize:function(Ke){var we=Ke.offsetWidth;We(Le,we)}},L.createElement("td",{ref:Ve,style:{padding:0,border:0,height:0}},L.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Ee(ke){var Le=ke.data,We=ke.getRowKey,Ve=ke.measureColumnWidth,Ne=ke.expandedKeys,Ke=ke.onRow,we=ke.rowExpandable,ye=ke.emptyNode,ge=ke.childrenColumnName,ae=L.useContext(ne),re=ae.onColumnResize,be=L.useContext(o.a),Ce=be.prefixCls,Ie=be.getComponent,De=L.useContext(B),Ge=De.fixHeader,Qe=De.horizonScroll,dt=De.flattenColumns,rt=De.componentWidth;return L.useMemo(function(){var ht=Ie(["body","wrapper"],"tbody"),ft=Ie(["body","row"],"tr"),at=Ie(["body","cell"],"td"),Dt;Le.length?Dt=Le.map(function(Tt,Rt){var wt=We(Tt,Rt);return L.createElement(U,{key:wt,rowKey:wt,record:Tt,recordKey:wt,index:Rt,rowComponent:ft,cellComponent:at,expandedKeys:Ne,onRow:Ke,getRowKey:We,rowExpandable:we,childrenColumnName:ge})}):Dt=L.createElement(H,{expanded:!0,className:"".concat(Ce,"-placeholder"),prefixCls:Ce,fixHeader:Ge,fixColumn:Qe,horizonScroll:Qe,component:ft,componentWidth:rt,cellComponent:at,colSpan:dt.length},ye);var Lt=Object(C.a)(dt);return L.createElement(ht,{className:"".concat(Ce,"-tbody")},Ve&&L.createElement("tr",{"aria-hidden":"true",className:"".concat(Ce,"-measure-row"),style:{height:0}},Lt.map(function(Tt){return L.createElement(he,{key:Tt,columnKey:Tt,onColumnResize:re})})),Dt)},[Le,Ce,Ke,Ve,Ne,We,Ie,rt,ye,dt])}var Ae=L.memo(Ee);Ae.displayName="Body";var Oe=Ae,me=W("wRmb"),de=W("xEkU"),pe=W.n(de);function se(ke){var Le=Object(L.useRef)(ke),We=Object(L.useState)({}),Ve=Object(N.a)(We,2),Ne=Ve[1],Ke=Object(L.useRef)(null),we=Object(L.useRef)([]);function ye(ge){Ke.current===null&&(we.current=[],Ke.current=pe()(function(){we.current.forEach(function(ae){Le.current=ae(Le.current)}),Ke.current=null,Ne({})})),we.current.push(ge)}return Object(L.useEffect)(function(){return function(){pe.a.cancel(Ke.current)}},[]),[Le.current,ye]}function ce(ke){var Le=Object(L.useRef)(ke),We=Object(L.useRef)(null);function Ve(){window.clearTimeout(We.current)}function Ne(we){Le.current=we,Ve(),We.current=window.setTimeout(function(){Le.current=null,We.current=null},100)}function Ke(){return Le.current}return Object(L.useEffect)(function(){return Ve},[]),[Ne,Ke]}function Z(ke,Le,We){var Ve=Object(L.useMemo)(function(){for(var Ne=[],Ke=[],we=0,ye=0,ge=0;ge<Le;ge+=1)if(We==="rtl"){Ke[ge]=ye,ye+=ke[ge]||0;var ae=Le-ge-1;Ne[ae]=we,we+=ke[ae]||0}else{Ne[ge]=we,we+=ke[ge]||0;var re=Le-ge-1;Ke[re]=ye,ye+=ke[re]||0}return{left:Ne,right:Ke}},[ke,Le,We]);return Ve}var te=Z;function le(ke){var Le=ke.className,We=ke.children;return L.createElement("div",{className:Le},We)}var ve=le,ie=W("n6Qo");function oe(ke){var Le,We=ke.prefixCls,Ve=ke.record,Ne=ke.onExpand,Ke=ke.expanded,we=ke.expandable,ye="".concat(We,"-row-expand-icon");if(!we)return L.createElement("span",{className:F()(ye,"".concat(We,"-row-spaced"))});var ge=function(re){Ne(Ve,re),re.stopPropagation()};return L.createElement("span",{className:F()(ye,(Le={},Object(ue.a)(Le,"".concat(We,"-row-expanded"),Ke),Object(ue.a)(Le,"".concat(We,"-row-collapsed"),!Ke),Le)),onClick:ge})}function xe(ke,Le,We){var Ve=[];function Ne(Ke){(Ke||[]).forEach(function(we,ye){Ve.push(Le(we,ye)),Ne(we[We])})}return Ne(ke),Ve}var _e=W("zT1h"),Me=W("y0+3"),Ue=function(Le,We){var Ve,Ne,Ke=Le.scrollBodyRef,we=Le.onScroll,ye=Le.offsetScroll,ge=L.useContext(o.a),ae=ge.prefixCls,re=((Ve=Ke.current)===null||Ve===void 0?void 0:Ve.scrollWidth)||0,be=((Ne=Ke.current)===null||Ne===void 0?void 0:Ne.clientWidth)||0,Ce=re&&be*(be/re),Ie=L.useRef(),De=se({scrollLeft:0,isHiddenScrollBar:!1}),Ge=Object(N.a)(De,2),Qe=Ge[0],dt=Ge[1],rt=L.useRef({delta:0,x:0}),ht=L.useState(!1),ft=Object(N.a)(ht,2),at=ft[0],Dt=ft[1],Lt=function(){Dt(!1)},Tt=function(qe){qe.persist(),rt.current.delta=qe.pageX-Qe.scrollLeft,rt.current.x=0,Dt(!0),qe.preventDefault()},Rt=function(qe){var Ze,ze=qe||((Ze=window)===null||Ze===void 0?void 0:Ze.event),Ye=ze.buttons;if(!at||Ye===0){at&&Dt(!1);return}var ot=rt.current.x+qe.pageX-rt.current.x-rt.current.delta;ot<=0&&(ot=0),ot+Ce>=be&&(ot=be-Ce),we({scrollLeft:ot/be*(re+2)}),rt.current.x=qe.pageX},wt=function(){var qe=Object(Me.b)(Ke.current).top,Ze=qe+Ke.current.offsetHeight,ze=document.documentElement.scrollTop+window.innerHeight;Ze-Object(w.a)()<=ze||qe>=ze-ye?dt(function(Ye){return Object(V.a)(Object(V.a)({},Ye),{},{isHiddenScrollBar:!0})}):dt(function(Ye){return Object(V.a)(Object(V.a)({},Ye),{},{isHiddenScrollBar:!1})})},Ut=function(qe){dt(function(Ze){return Object(V.a)(Object(V.a)({},Ze),{},{scrollLeft:qe/re*be||0})})};return L.useImperativeHandle(We,function(){return{setScrollLeft:Ut}}),L.useEffect(function(){var Nt=Object(_e.a)(document.body,"mouseup",Lt,!1),qe=Object(_e.a)(document.body,"mousemove",Rt,!1);return wt(),function(){Nt.remove(),qe.remove()}},[Ce,at]),L.useEffect(function(){var Nt=Object(_e.a)(window,"scroll",wt,!1),qe=Object(_e.a)(window,"resize",wt,!1);return function(){Nt.remove(),qe.remove()}},[]),L.useEffect(function(){Qe.isHiddenScrollBar||dt(function(Nt){var qe,Ze;return Object(V.a)(Object(V.a)({},Nt),{},{scrollLeft:Ke.current.scrollLeft/((qe=Ke.current)===null||qe===void 0?void 0:qe.scrollWidth)*((Ze=Ke.current)===null||Ze===void 0?void 0:Ze.clientWidth)})})},[Qe.isHiddenScrollBar]),re<=be||!Ce||Qe.isHiddenScrollBar?null:L.createElement("div",{style:{height:Object(w.a)(),width:be,bottom:ye},className:"".concat(ae,"-sticky-scroll")},L.createElement("div",{onMouseDown:Tt,ref:Ie,className:F()("".concat(ae,"-sticky-scroll-bar"),Object(ue.a)({},"".concat(ae,"-sticky-scroll-bar-active"),at)),style:{width:"".concat(Ce,"px"),transform:"translate3d(".concat(Qe.scrollLeft,"px, 0, 0)")}}))},He=L.forwardRef(Ue);function Be(ke,Le){return L.useMemo(function(){var We=!!ke;return{isSticky:We,stickyClassName:We?"".concat(Le,"-sticky-header"):"",offsetHeader:Object($.a)(ke)==="object"&&ke.offsetHeader||0,offsetScroll:Object($.a)(ke)==="object"&&ke.offsetScroll||0}},[ke,Le])}var tt=[],Je={},st="rc-table-internal-hook",nt=L.memo(function(ke){var Le=ke.children;return Le},function(ke,Le){return A()(ke.props,Le.props)?ke.pingLeft!==Le.pingLeft||ke.pingRight!==Le.pingRight:!1});function pt(ke){var Le,We=ke.prefixCls,Ve=ke.className,Ne=ke.rowClassName,Ke=ke.style,we=ke.data,ye=ke.rowKey,ge=ke.scroll,ae=ke.tableLayout,re=ke.direction,be=ke.title,Ce=ke.footer,Ie=ke.summary,De=ke.id,Ge=ke.showHeader,Qe=ke.components,dt=ke.emptyText,rt=ke.onRow,ht=ke.onHeaderRow,ft=ke.internalHooks,at=ke.transformColumns,Dt=ke.internalRefs,Lt=ke.sticky,Tt=we||tt,Rt=!!Tt.length,wt=L.useState(0),Ut=Object(N.a)(wt,2),Nt=Ut[0],qe=Ut[1];L.useEffect(function(){qe(Object(w.a)())});var Ze=L.useMemo(function(){return Object(C.c)(Qe,{})},[Qe]),ze=L.useCallback(function(hr,fr){return Object(C.b)(Ze,hr)||fr},[Ze]),Ye=L.useMemo(function(){return typeof ye=="function"?ye:function(hr){var fr=hr&&hr[ye];return fr}},[ye]),ot=Object(v.c)(ke),gt=ot.expandIcon,Mt=ot.expandedRowKeys,Et=ot.defaultExpandedRowKeys,lt=ot.defaultExpandAllRows,Jt=ot.expandedRowRender,vr=ot.onExpand,$t=ot.onExpandedRowsChange,vt=ot.expandRowByClick,zt=ot.rowExpandable,Qt=ot.expandIconColumnIndex,or=ot.expandedRowClassName,Xe=ot.childrenColumnName,xt=ot.indentSize,Pt=gt||oe,At=Xe||"children",Ft=L.useMemo(function(){return Jt?"row":ke.expandable&&ft===st&&ke.expandable.__PARENT_RENDER_ICON__||Tt.some(function(hr){return hr&&Object($.a)(hr)==="object"&&hr[At]})?"nest":!1},[!!Jt,Tt]),Yt=L.useState(function(){return Et||(lt?xe(Tt,Ye,At):[])}),G=Object(N.a)(Yt,2),E=G[0],_=G[1],z=L.useMemo(function(){return new Set(Mt||E||[])},[Mt,E]),Q=L.useCallback(function(hr){var fr=Ye(hr,Tt.indexOf(hr)),mr,gn=z.has(fr);gn?(z.delete(fr),mr=Object(P.a)(z)):mr=[].concat(Object(P.a)(z),[fr]),_(mr),vr&&vr(!gn,hr),$t&&$t(mr)},[Ye,z,Tt,vr,$t]),Y=L.useState(0),Re=Object(N.a)(Y,2),et=Re[0],yt=Re[1],_t=Object(me.b)(Object(V.a)(Object(V.a)(Object(V.a)({},ke),ot),{},{expandable:!!Jt,expandedKeys:z,getRowKey:Ye,onTriggerExpand:Q,expandIcon:Pt,expandIconColumnIndex:Qt,direction:re}),ft===st?at:null),it=Object(N.a)(_t,2),Kt=it[0],Bt=it[1],gr=L.useMemo(function(){return{columns:Kt,flattenColumns:Bt}},[Kt,Bt]),Kr=L.useRef(),Yr=L.useRef(),Er=L.useRef(),tn=L.useState(!1),Cn=Object(N.a)(tn,2),Ur=Cn[0],Qr=Cn[1],Zt=L.useState(!1),Vt=Object(N.a)(Zt,2),Xt=Vt[0],er=Vt[1],ur=se(new Map),sr=Object(N.a)(ur,2),Tr=sr[0],Lr=sr[1],wr=Object(C.a)(Bt),Mr=wr.map(function(hr){return Tr.get(hr)}),Zr=L.useMemo(function(){return Mr},[Mr.join("_")]),sn=te(Zr,Bt.length,re),dr=ge&&Object(C.d)(ge.y),qt=ge&&Object(C.d)(ge.x),Ar=qt&&Bt.some(function(hr){var fr=hr.fixed;return fr}),rr=L.useRef(),Cr=Be(Lt,We),nr=Cr.isSticky,Dr=Cr.offsetHeader,_r=Cr.offsetScroll,Fr=Cr.stickyClassName,Sn,yr,rn;dr&&(yr={overflowY:"scroll",maxHeight:ge.y}),qt&&(Sn={overflowX:"auto"},dr||(yr={overflowY:"hidden"}),rn={width:ge.x===!0?"auto":ge.x,minWidth:"100%"});var Tn=L.useCallback(function(hr,fr){Lr(function(mr){var gn=new Map(mr);return gn.set(hr,fr),gn})},[]),nn=ce(null),Nn=Object(N.a)(nn,2),bn=Nn[0],Pn=Nn[1];function Un(hr,fr){if(!fr)return;typeof fr=="function"?fr(hr):fr.scrollLeft!==hr&&(fr.scrollLeft=hr)}var fn=function(fr){var mr=fr.currentTarget,gn=fr.scrollLeft,Fn=typeof gn=="number"?gn:mr.scrollLeft,Bn=mr||Je;if(!Pn()||Pn()===Bn){var Si;bn(Bn),Un(Fn,Yr.current),Un(Fn,Er.current),Un(Fn,(Si=rr.current)===null||Si===void 0?void 0:Si.setScrollLeft)}if(mr){var Xi=mr.scrollWidth,ga=mr.clientWidth;Qr(Fn>0),er(Fn<Xi-ga)}},ii=function(){Er.current&&fn({currentTarget:Er.current})},Ci=function(fr){var mr=fr.width;ii(),yt(Kr.current?Kr.current.offsetWidth:mr)};L.useEffect(function(){return ii},[]),L.useEffect(function(){qt&&ii()},[qt]),L.useEffect(function(){ft===st&&Dt&&(Dt.body.current=Er.current)});var It=ze(["table"],"table"),Ht=L.useMemo(function(){return ae||(Ar?ge.x==="max-content"?"auto":"fixed":dr||Bt.some(function(hr){var fr=hr.ellipsis;return fr})?"fixed":"auto")},[dr,Ar,Bt,ae]),jt,tr={colWidths:Zr,columCount:Bt.length,stickyOffsets:sn,onHeaderRow:ht,fixHeader:dr},pr=L.useMemo(function(){return Rt?null:typeof dt=="function"?dt():dt},[Rt,dt]),br=L.createElement(Oe,{data:Tt,measureColumnWidth:dr||qt||nr,expandedKeys:z,rowExpandable:zt,getRowKey:Ye,onRow:rt,emptyNode:pr,childrenColumnName:At}),lr=L.createElement(s,{colWidths:Bt.map(function(hr){var fr=hr.width;return fr}),columns:Bt}),Pr=Ie&&L.createElement(ie.b,null,Ie(Tt)),$r=ze(["body"]);if(dr||nr){var ir;typeof $r=="function"?(ir=$r(Tt,{scrollbarSize:Nt,ref:Er,onScroll:fn}),tr.colWidths=Bt.map(function(hr,fr){var mr=hr.width,gn=fr===Kt.length-1?mr-Nt:mr;return typeof gn=="number"&&!Number.isNaN(gn)?gn:(Object(h.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):ir=L.createElement("div",{style:Object(V.a)(Object(V.a)({},Sn),yr),onScroll:fn,ref:Er,className:F()("".concat(We,"-body"))},L.createElement(It,{style:Object(V.a)(Object(V.a)({},rn),{},{tableLayout:Ht})},lr,br,Pr),nr&&L.createElement(He,{ref:rr,offsetScroll:_r,scrollBodyRef:Er,onScroll:fn})),jt=L.createElement(L.Fragment,null,Ge!==!1&&L.createElement(O,Object.assign({noData:!Tt.length},tr,gr,{direction:re,offsetHeader:Dr,stickyClassName:Fr,ref:Yr,onScroll:fn})),ir)}else jt=L.createElement("div",{style:Object(V.a)(Object(V.a)({},Sn),yr),className:F()("".concat(We,"-content")),onScroll:fn,ref:Er},L.createElement(It,{style:Object(V.a)(Object(V.a)({},rn),{},{tableLayout:Ht})},lr,Ge!==!1&&L.createElement(m,Object.assign({},tr,gr)),br,Pr));var On=Object(v.b)(ke),cr=L.createElement("div",Object.assign({className:F()(We,Ve,(Le={},Object(ue.a)(Le,"".concat(We,"-rtl"),re==="rtl"),Object(ue.a)(Le,"".concat(We,"-ping-left"),Ur),Object(ue.a)(Le,"".concat(We,"-ping-right"),Xt),Object(ue.a)(Le,"".concat(We,"-layout-fixed"),ae==="fixed"),Object(ue.a)(Le,"".concat(We,"-fixed-header"),dr),Object(ue.a)(Le,"".concat(We,"-fixed-column"),Ar),Object(ue.a)(Le,"".concat(We,"-scroll-horizontal"),qt),Object(ue.a)(Le,"".concat(We,"-has-fix-left"),Bt[0]&&Bt[0].fixed),Object(ue.a)(Le,"".concat(We,"-has-fix-right"),Bt[Bt.length-1]&&Bt[Bt.length-1].fixed==="right"),Le)),style:Ke,id:De,ref:Kr},On),L.createElement(nt,{pingLeft:Ur,pingRight:Xt,props:Object(V.a)(Object(V.a)({},ke),{},{stickyOffsets:sn,mergedExpandedKeys:z})},be&&L.createElement(ve,{className:"".concat(We,"-title")},be(Tt)),L.createElement("div",{className:"".concat(We,"-container")},jt),Ce&&L.createElement(ve,{className:"".concat(We,"-footer")},Ce(Tt))));qt&&(cr=L.createElement(y.a,{onResize:Ci},cr));var Br=L.useMemo(function(){return{prefixCls:We,getComponent:ze,scrollbarSize:Nt,direction:re,fixedInfoList:Bt.map(function(hr,fr){return l(fr,fr,Bt,sn,re)}),isSticky:nr}},[We,ze,Nt,re,Bt,sn,re,nr]),pn=L.useMemo(function(){return Object(V.a)(Object(V.a)({},gr),{},{tableLayout:Ht,rowClassName:Ne,expandedRowClassName:or,componentWidth:et,fixHeader:dr,fixColumn:Ar,horizonScroll:qt,expandIcon:Pt,expandableType:Ft,expandRowByClick:vt,expandedRowRender:Jt,onTriggerExpand:Q,expandIconColumnIndex:Qt,indentSize:xt})},[gr,Ht,Ne,or,et,dr,Ar,qt,Pt,Ft,vt,Jt,Q,Qt,xt]),mn=L.useMemo(function(){return{onColumnResize:Tn}},[Tn]);return L.createElement(o.a.Provider,{value:Br},L.createElement(B.Provider,{value:pn},L.createElement(ne.Provider,{value:mn},cr)))}pt.Column=f.a,pt.ColumnGroup=p.a,pt.Summary=ie.a,pt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var mt=Te.b=pt},wRmb:function(ct,Te,W){"use strict";W.d(Te,"a",function(){return A});var ue=W("rePB"),V=W("KQm4"),P=W("VTBJ"),$=W("Ff2n"),N=W("q1tI"),L=W.n(N),K=W("Kwbf"),F=W("Zm9Q"),R=W("hW8S");function A(f){return Object(F.a)(f).filter(function(g){return N.isValidElement(g)}).map(function(g){var a=g.key,r=g.props,o=r.children,l=Object($.a)(r,["children"]),C=Object(P.a)({key:a},l);return o&&(C.children=A(o)),C})}function h(f){return f.reduce(function(g,a){var r=a.fixed,o=r===!0?"left":r,l=a.children;return l&&l.length>0?[].concat(Object(V.a)(g),Object(V.a)(h(l).map(function(C){return Object(P.a)({fixed:o},C)}))):[].concat(Object(V.a)(g),[Object(P.a)(Object(P.a)({},a),{},{fixed:o})])},[])}function y(f){for(var g=!0,a=0;a<f.length;a+=1){var r=f[a];if(g&&r.fixed!=="left")g=!1;else if(!g&&r.fixed==="left"){Object(K.a)(!1,"Index ".concat(a-1," of `columns` missing `fixed='left'` prop."));break}}for(var o=!0,l=f.length-1;l>=0;l-=1){var C=f[l];if(o&&C.fixed!=="right")o=!1;else if(!o&&C.fixed==="right"){Object(K.a)(!1,"Index ".concat(l+1," of `columns` missing `fixed='right'` prop."));break}}}function w(f){return f.map(function(g){var a=g.fixed,r=Object($.a)(g,["fixed"]),o=a;return a==="left"?o="right":a==="right"&&(o="left"),Object(P.a)({fixed:o},r)})}function p(f,g){var a=f.prefixCls,r=f.columns,o=f.children,l=f.expandable,C=f.expandedKeys,b=f.getRowKey,x=f.onTriggerExpand,D=f.expandIcon,T=f.rowExpandable,m=f.expandIconColumnIndex,v=f.direction,u=f.expandRowByClick,s=N.useMemo(function(){return r||A(o)},[r,o]),S=N.useMemo(function(){if(l){var M,B=m||0,j=s[B],H=(M={},Object(ue.a)(M,R.a,{className:"".concat(a,"-expand-icon-col")}),Object(ue.a)(M,"title",""),Object(ue.a)(M,"fixed",j?j.fixed:null),Object(ue.a)(M,"className","".concat(a,"-row-expand-icon-cell")),Object(ue.a)(M,"render",function(J,ne,he){var Ee=b(ne,he),Ae=C.has(Ee),Oe=T?T(ne):!0,me=D({prefixCls:a,expanded:Ae,expandable:Oe,record:ne,onExpand:x});return u?N.createElement("span",{onClick:function(pe){return pe.stopPropagation()}},me):me}),M),I=s.slice();return B>=0&&I.splice(B,0,H),I}return s},[l,s,b,C,D,v]),c=N.useMemo(function(){var M=S;return g&&(M=g(M)),M.length||(M=[{render:function(){return null}}]),M},[g,S,v]),O=N.useMemo(function(){return v==="rtl"?w(h(c)):h(c)},[c,v]);return[c,O]}Te.b=p},"y0+3":function(ct,Te,W){"use strict";W.d(Te,"a",function(){return h}),W.d(Te,"b",function(){return w});var ue=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function $(p){return p.nodeType===1?p.ownerDocument.defaultView.getComputedStyle(p,null):{}}function N(p,f,g){if(f=f.toLowerCase(),g==="auto"){if(f==="height")return p.offsetHeight;if(f==="width")return p.offsetWidth}return f in V||(V[f]=ue.test(f)),V[f]?parseFloat(g)||0:g}function L(p,f){var g=arguments.length,a=$(p);return f=P[f]?"cssFloat"in p.style?"cssFloat":"styleFloat":f,g===1?a:N(p,f,a[f]||p.style[f])}function K(p,f,g){var a=arguments.length;if(f=P[f]?"cssFloat"in p.style?"cssFloat":"styleFloat":f,a===3)return typeof g=="number"&&ue.test(f)&&(g="".concat(g,"px")),p.style[f]=g,g;for(var r in f)f.hasOwnProperty(r)&&K(p,r,f[r]);return $(p)}function F(p){return p===document.body?document.documentElement.clientWidth:p.offsetWidth}function R(p){return p===document.body?window.innerHeight||document.documentElement.clientHeight:p.offsetHeight}function A(){var p=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),f=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:p,height:f}}function h(){var p=document.documentElement.clientWidth,f=window.innerHeight||document.documentElement.clientHeight;return{width:p,height:f}}function y(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function w(p){var f=p.getBoundingClientRect(),g=document.documentElement;return{left:f.left+(window.pageXOffset||g.scrollLeft)-(g.clientLeft||document.body.clientLeft||0),top:f.top+(window.pageYOffset||g.scrollTop)-(g.clientTop||document.body.clientTop||0)}}},yFVG:function(ct,Te,W){ct.exports={bg:"bg___239CK",main:"main___rgkgN",formWrap:"formWrap___18Cpt",knowledgeWrap:"knowledgeWrap___rGX80",knowledgeIcon:"knowledgeIcon___2ajWi",knowledgeContent:"knowledgeContent___Qaosn",knowledgeItem:"knowledgeItem___1db86",knowledgeItemName:"knowledgeItemName___34_4x",knowledgeItemIcon:"knowledgeItemIcon___1O9dB",button:"button___3a82z",buttonFixed:"buttonFixed___2PTyf",buttonWrap:"buttonWrap___2c5Pc",topicWrap:"topicWrap____aMgV"}}}]);