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__Paperlibrary__EditPaper_...

514 lines
1.6 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[218,4,6,7,8,11,20],{"+BqJ":function(Et,Pe,F){Et.exports={wrap:"wrap___25UhO",img:"img___2akIE",table:"table___3IRHj",totalScore:"totalScore___2JN2k",people:"people___1rT7q",glassSeal:"glassSeal___2gAyY"}},"+NIl":function(Et,Pe,F){(function(ne){ne(F("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function(Q,U){"use strict";function Z(a,c){a.cmdState.push(c)}function G(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function M(a){var c=a.cmdState.pop();c&&c.closeBracket()}function Y(a){for(var c=a.cmdState,s=c.length-1;s>=0;s--){var i=c[s];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function X(a,c,s){return function(){this.name=a,this.bracketNo=0,this.style=c,this.styles=s,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=X("importmodule","tag",["string","builtin"]),r.documentclass=X("documentclass","tag",["","atom"]),r.usepackage=X("usepackage","tag",["atom"]),r.begin=X("begin","tag",["atom"]),r.end=X("end","tag",["atom"]),r.label=X("label","tag",["atom"]),r.ref=X("ref","tag",["atom"]),r.eqref=X("eqref","tag",["atom"]),r.cite=X("cite","tag",["atom"]),r.bibitem=X("bibitem","tag",["atom"]),r.Bibitem=X("Bibitem","tag",["atom"]),r.RBibitem=X("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function A(a,c){a.f=c}function m(a,c){var s;if(a.match(/^\\[a-zA-Z@]+/)){var i=a.current().slice(1);return s=r.hasOwnProperty(i)?r[i]:r.DEFAULT,s=new s,Z(c,s),A(c,p),s.style}if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/\\]/))return"tag";if(a.match("\\["))return A(c,function(u,o){return f(u,o,"\\]")}),"keyword";if(a.match("\\("))return A(c,function(u,o){return f(u,o,"\\)")}),"keyword";if(a.match("$$"))return A(c,function(u,o){return f(u,o,"$$")}),"keyword";if(a.match("$"))return A(c,function(u,o){return f(u,o,"$")}),"keyword";var t=a.next();if(t=="%")return a.skipToEnd(),"comment";if(t=="}"||t=="]"){if(s=G(c),s)s.closeBracket(t),A(c,p);else return"error";return"bracket"}else return t=="{"||t=="["?(s=r.DEFAULT,s=new s,Z(c,s),"bracket"):/\d/.test(t)?(a.eatWhile(/[\w.%]/),"atom"):(a.eatWhile(/[\w\-_]/),s=Y(c),s.name=="begin"&&(s.argument=a.current()),s.styleIdentifier())}function f(a,c,s){if(a.eatSpace())return null;if(s&&a.match(s))return A(c,m),"keyword";if(a.match(/^\\[a-zA-Z@]+/))return"tag";if(a.match(/^[a-zA-Z]+/))return"variable-2";if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/]/))return"tag";if(a.match(/^[\^_&]/))return"tag";if(a.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(a.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=a.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(a.skipToEnd(),"comment"):"error"}function p(a,c){var s=a.peek(),i;return s=="{"||s=="["?(i=G(c),i.openBracket(s),a.eat(s),A(c,m),"bracket"):/[ \t\r]/.test(s)?(a.eat(s),null):(A(c,m),M(c),m(a,c))}return{startState:function(){var a=U.inMathMode?function(c,s){return f(c,s)}:m;return{cmdState:[],f:a}},copyState:function(a){return{cmdState:a.cmdState.slice(),f:a.f}},token:function(a,c){return c.f(a,c)},blankLine:function(a){a.f=m,a.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(Et,Pe,F){},"/cxE":function(Et,Pe,F){"use strict";F.d(Pe,"f",function(){return U}),F.d(Pe,"g",function(){return Z}),F.d(Pe,"h",function(){return G}),F.d(Pe,"e",function(){return Y}),F.d(Pe,"b",function(){return X}),F.d(Pe,"c",function(){return r}),F.d(Pe,"d",function(){return A}),F.d(Pe,"a",function(){return m});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}emit(f){this.listeners.forEach(p=>{p(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const Q=new ne;function U(f){Y(f)||Q.onUnexpectedError(f);return}function Z(f){Y(f)||Q.onUnexpectedExternalError(f);return}function G(f){if(f instanceof Error){let{name:p,message:a}=f;const c=f.stacktrace||f.stack;return{$isError:!0,name:p,message:a,stack:c}}return f}const M="Canceled";function Y(f){return f instanceof Error&&f.name===M&&f.message===M}function X(){const f=new Error(M);return f.name=f.message,f}function r(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function A(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class m extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"19Vz":function(Et,Pe,F){(function(ne){ne(F("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(X,r,A){var m=A&&A!=ne.Init;if(r&&!m)X.on("blur",G),X.on("change",M),X.on("swapDoc",M),ne.on(X.getInputField(),"compositionupdate",X.state.placeholderCompose=function(){Z(X)}),M(X);else if(!r&&m){X.off("blur",G),X.off("change",M),X.off("swapDoc",M),ne.off(X.getInputField(),"compositionupdate",X.state.placeholderCompose),Q(X);var f=X.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}r&&!X.hasFocus()&&G(X)});function Q(X){X.state.placeholder&&(X.state.placeholder.parentNode.removeChild(X.state.placeholder),X.state.placeholder=null)}function U(X){Q(X);var r=X.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=X.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var A=X.getOption("placeholder");typeof A=="string"&&(A=document.createTextNode(A)),r.appendChild(A),X.display.lineSpace.insertBefore(r,X.display.lineSpace.firstChild)}function Z(X){setTimeout(function(){var r=!1,A=X.getInputField();A.nodeName=="TEXTAREA"?r=!A.value:X.lineCount()==1&&(r=!/[^\u200b]/.test(A.querySelector(".CodeMirror-line").textContent)),r?U(X):Q(X)},20)}function G(X){Y(X)&&U(X)}function M(X){var r=X.getWrapperElement(),A=Y(X);r.className=r.className.replace(" CodeMirror-empty","")+(A?" CodeMirror-empty":""),A?U(X):Q(X)}function Y(X){return X.lineCount()===1&&X.getLine(0)===""}})},"1eCo":function(Et,Pe,F){(function(ne){ne(F("VrN/"))})(function(ne){"use strict";var Q={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},U={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(Z,G){var M=Z.indentUnit,Y={},X=G.htmlMode?Q:U;for(var r in X)Y[r]=X[r];for(var r in G)Y[r]=G[r];var A,m;function f(h,O){function w(j){return O.tokenize=j,j(h,O)}var b=h.next();if(b=="<")return h.eat("!")?h.eat("[")?h.match("CDATA[")?w(c("atom","]]>")):null:h.match("--")?w(c("comment","-->")):h.match("DOCTYPE",!0,!0)?(h.eatWhile(/[\w\._\-]/),w(s(1))):null:h.eat("?")?(h.eatWhile(/[\w\._\-]/),O.tokenize=c("meta","?>"),"meta"):(A=h.eat("/")?"closeTag":"openTag",O.tokenize=p,"tag bracket");if(b=="&"){var W;return h.eat("#")?h.eat("x")?W=h.eatWhile(/[a-fA-F\d]/)&&h.eat(";"):W=h.eatWhile(/[\d]/)&&h.eat(";"):W=h.eatWhile(/[\w\.\-:]/)&&h.eat(";"),W?"atom":"error"}else return h.eatWhile(/[^&<]/),null}f.isInText=!0;function p(h,O){var w=h.next();if(w==">"||w=="/"&&h.eat(">"))return O.tokenize=f,A=w==">"?"endTag":"selfcloseTag","tag bracket";if(w=="=")return A="equals",null;if(w=="<"){O.tokenize=f,O.state=o,O.tagName=O.tagStart=null;var b=O.tokenize(h,O);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(w)?(O.tokenize=a(w),O.stringStartCol=h.column(),O.tokenize(h,O)):(h.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(h){var O=function(w,b){for(;!w.eol();)if(w.next()==h){b.tokenize=p;break}return"string"};return O.isInAttribute=!0,O}function c(h,O){return function(w,b){for(;!w.eol();){if(w.match(O)){b.tokenize=f;break}w.next()}return h}}function s(h){return function(O,w){for(var b;(b=O.next())!=null;){if(b=="<")return w.tokenize=s(h+1),w.tokenize(O,w);if(b==">")if(h==1){w.tokenize=f;break}else return w.tokenize=s(h-1),w.tokenize(O,w)}return"meta"}}function i(h,O,w){this.prev=h.context,this.tagName=O,this.indent=h.indented,this.startOfLine=w,(Y.doNotIndent.hasOwnProperty(O)||h.context&&h.context.noIndent)&&(this.noIndent=!0)}function t(h){h.context&&(h.context=h.context.prev)}function u(h,O){for(var w;;){if(!h.context)return;if(w=h.context.tagName,!Y.contextGrabbers.hasOwnProperty(w)||!Y.contextGrabbers[w].hasOwnProperty(O))return;t(h)}}function o(h,O,w){return h=="openTag"?(w.tagStart=O.column(),R):h=="closeTag"?T:o}function R(h,O,w){return h=="word"?(w.tagName=O.current(),m="tag",I):Y.allowMissingTagName&&h=="endTag"?(m="tag bracket",I(h,O,w)):(m="error",R)}function T(h,O,w){if(h=="word"){var b=O.current();return w.context&&w.context.tagName!=b&&Y.implicitlyClosed.hasOwnProperty(w.context.tagName)&&t(w),w.context&&w.context.tagName==b||Y.matchClosing===!1?(m="tag",S):(m="tag error",D)}else return Y.allowMissingTagName&&h=="endTag"?(m="tag bracket",S(h,O,w)):(m="error",D)}function S(h,O,w){return h!="endTag"?(m="error",S):(t(w),o)}function D(h,O,w){return m="error",S(h,O,w)}function I(h,O,w){if(h=="word")return m="attribute",E;if(h=="endTag"||h=="selfcloseTag"){var b=w.tagName,W=w.tagStart;return w.tagName=w.tagStart=null,h=="selfcloseTag"||Y.autoSelfClosers.hasOwnProperty(b)?u(w,b):(u(w,b),w.context=new i(w,b,W==w.indented)),o}return m="error",I}function E(h,O,w){return h=="equals"?x:(Y.allowMissing||(m="error"),I(h,O,w))}function x(h,O,w){return h=="string"?g:h=="word"&&Y.allowUnquoted?(m="string",I):(m="error",I(h,O,w))}function g(h,O,w){return h=="string"?g:I(h,O,w)}return{startState:function(h){var O={tokenize:f,state:o,indented:h||0,tagName:null,tagStart:null,context:null};return h!=null&&(O.baseIndent=h),O},token:function(h,O){if(!O.tagName&&h.sol()&&(O.indented=h.indentation()),h.eatSpace())return null;A=null;var w=O.tokenize(h,O);return(w||A)&&w!="comment"&&(m=null,O.state=O.state(A||w,h,O),m&&(w=m=="error"?w+" error":m)),w},indent:function(h,O,w){var b=h.context;if(h.tokenize.isInAttribute)return h.tagStart==h.indented?h.stringStartCol+1:h.indented+M;if(b&&b.noIndent)return ne.Pass;if(h.tokenize!=p&&h.tokenize!=f)return w?w.match(/^(\s*)/)[0].length:0;if(h.tagName)return Y.multilineTagIndentPastTag!==!1?h.tagStart+h.tagName.length+2:h.tagStart+M*(Y.multilineTagIndentFactor||1);if(Y.alignCDATA&&/<!\[CDATA\[/.test(O))return 0;var W=O&&/^<(\/)?([\w_:\.-]*)/.exec(O);if(W&&W[1])for(;b;)if(b.tagName==W[2]){b=b.prev;break}else if(Y.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(W)for(;b;){var j=Y.contextGrabbers[b.tagName];if(j&&j.hasOwnProperty(W[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+M:h.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Y.htmlMode?"html":"xml",helperType:Y.htmlMode?"html":"xml",skipAttribute:function(h){h.state==x&&(h.state=I)},xmlCurrentTag:function(h){return h.tagName?{name:h.tagName,close:h.type=="closeTag"}:null},xmlCurrentContext:function(h){for(var O=[],w=h.context;w;w=w.prev)w.tagName&&O.push(w.tagName);return O.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Q});class ne{constructor(U){this.element=U,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class Q{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let U=this._first;for(;U!==ne.Undefined;){const Z=U.next;U.prev=ne.Undefined,U.next=ne.Undefined,U=Z}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(U){return this._insert(U,!1)}push(U){return this._insert(U,!0)}_insert(U,Z){const G=new ne(U);if(this._first===ne.Undefined)this._first=G,this._last=G;else if(Z){const Y=this._last;this._last=G,G.prev=Y,Y.next=G}else{const Y=this._first;this._first=G,G.next=Y,Y.prev=G}this._size+=1;let M=!1;return()=>{M||(M=!0,this._remove(G))}}shift(){if(this._first===ne.Undefined)return;{const U=this._first.element;return this._remove(this._first),U}}pop(){if(this._last===ne.Undefined)return;{const U=this._last.element;return this._remove(this._last),U}}_remove(U){if(U.prev!==ne.Undefined&&U.next!==ne.Undefined){const Z=U.prev;Z.next=U.next,U.next.prev=Z}else U.prev===ne.Undefined&&U.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):U.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):U.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let U=this._first;for(;U!==ne.Undefined;)yield U.element,U=U.next}}},"2aBv":function(Et,Pe,F){"use strict";var ne=F("2qtc"),Q=F("kLXV"),U=F("0Owb"),Z=F("14J3"),G=F("BMrR"),M=F("jCWc"),Y=F("kPKH"),X=F("+L6B"),r=F("2/Rp"),A=F("oBTY"),m=F("tJVT"),f=F("q1tI"),p=F.n(f),a=F("ngQI"),c=F("Ty5D"),s=F("YIbm"),i=F.n(s),t=function(o){var R=o.visible,T=o.onOk,S=o.onCancel,D=o.data,I=Object(f.useState)([]),E=Object(m.a)(I,2),x=E[0],g=E[1],h=Object(f.useState)(!1),O=Object(m.a)(h,2),w=O[0],b=O[1],W=Object(c.i)();Object(f.useEffect)(function(){if(!R){g([]),b(!1);return}g(Object(A.a)(D)||[])},[R]);var j=function(){b(!0),T(x,function(){b(!1)})},C=function(){S()},B=function(H,J,se){var fe=Array.from(H),ve=fe.splice(J,1),Se=Object(m.a)(ve,1),Ue=Se[0];return fe.splice(se,0,Ue),fe},k=function(H,J){if(!H.destination)return;var se=B(J,H.source.index,H.destination.index);g(se)};return p.a.createElement(Q.a,{title:"\u9898\u578B\u6392\u5E8F",visible:R,centered:!0,onCancel:C,footer:p.a.createElement("div",null,p.a.createElement("span",{style:{float:"left",color:"#999",paddingTop:5}},"\u63D0\u793A:\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u4E0A\u4E0B\u62D6\u52A8\u6392\u5E8F"),p.a.createElement(r.a,{onClick:C},"\u53D6\u6D88"),p.a.createElement(r.a,{type:"primary",loading:w,onClick:j},"\u786E\u8BA4")),width:"680px"},p.a.createElement("div",{className:i.a.content},p.a.createElement(G.a,null,p.a.createElement(Y.a,{span:12},"\u5E8F\u53F7"),p.a.createElement(Y.a,{span:12},"\u9898\u578B\u540D\u79F0")),p.a.createElement(a.a,{onDragEnd:function(H){return k(H,x)}},p.a.createElement(a.c,{droppableId:"droppable"},function(y,H){return p.a.createElement("div",Object(U.a)({ref:y.innerRef},y.droppableProps,{style:{width:"100%"}}),x.map(function(J,se){return p.a.createElement(a.b,{key:se,draggableId:se.toString(),index:se},function(fe,ve){return p.a.createElement("aside",Object(U.a)({ref:fe.innerRef},fe.draggableProps,fe.dragHandleProps),p.a.createElement("div",null,p.a.createElement(G.a,{style:{backgroundColor:se%2===0?"#f5f5f5":"#fff"}},p.a.createElement(Y.a,{span:12},se+1),p.a.createElement(Y.a,{span:12},J))))})}))}))))};Pe.a=t},"3/fG":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Q});function ne(U,Z){let G;return Z.length===0?G=U:G=U.replace(/\{(\d+)\}/g,function(M,Y){const X=Y[0];return typeof Z[X]!="undefined"?Z[X]:M}),G}function Q(U,Z,...G){return ne(Z,G)}},"55Ip":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return u});var ne=F("Ty5D"),Q=F("dI71"),U=F("q1tI"),Z=F.n(U),G=F("YS25"),M=F("17x9"),Y=F.n(M),X=F("wx14"),r=F("zLVn"),A=F("9R94"),m=function(x){Object(Q.a)(g,x);function g(){for(var O,w=arguments.length,b=new Array(w),W=0;W<w;W++)b[W]=arguments[W];return O=x.call.apply(x,[this].concat(b))||this,O.history=Object(G.a)(O.props),O}var h=g.prototype;return h.render=function(){return Z.a.createElement(ne.c,{history:this.history,children:this.props.children})},g}(Z.a.Component),f=function(x){Object(Q.a)(g,x);function g(){for(var O,w=arguments.length,b=new Array(w),W=0;W<w;W++)b[W]=arguments[W];return O=x.call.apply(x,[this].concat(b))||this,O.history=Object(G.b)(O.props),O}var h=g.prototype;return h.render=function(){return Z.a.createElement(ne.c,{history:this.history,children:this.props.children})},g}(Z.a.Component),p=function(g,h){return typeof g=="function"?g(h):g},a=function(g,h){return typeof g=="string"?Object(G.c)(g,null,null,h):g},c=function(g){return g},s=Z.a.forwardRef;typeof s=="undefined"&&(s=c);function i(x){return!!(x.metaKey||x.altKey||x.ctrlKey||x.shiftKey)}var t=s(function(x,g){var h=x.innerRef,O=x.navigate,w=x.onClick,b=Object(r.a)(x,["innerRef","navigate","onClick"]),W=b.target,j=Object(X.a)({},b,{onClick:function(B){try{w&&w(B)}catch(k){throw B.preventDefault(),k}!B.defaultPrevented&&B.button===0&&(!W||W==="_self")&&!i(B)&&(B.preventDefault(),O())}});return c!==s?j.ref=g||h:j.ref=h,Z.a.createElement("a",j)}),u=s(function(x,g){var h=x.component,O=h===void 0?t:h,w=x.replace,b=x.to,W=x.innerRef,j=Object(r.a)(x,["component","replace","to","innerRef"]);return Z.a.createElement(ne.e.Consumer,null,function(C){C||Object(A.a)(!1);var B=C.history,k=a(p(b,C.location),C.location),y=k?B.createHref(k):"",H=Object(X.a)({},j,{href:y,navigate:function(){var se=p(b,C.location),fe=w?B.replace:B.push;fe(se)}});return c!==s?H.ref=g||W:H.innerRef=W,Z.a.createElement(O,H)})});if(!1)var o,R;var T=function(g){return g},S=Z.a.forwardRef;typeof S=="undefined"&&(S=T);function D(){for(var x=arguments.length,g=new Array(x),h=0;h<x;h++)g[h]=arguments[h];return g.filter(function(O){return O}).join(" ")}var I=S(function(x,g){var h=x["aria-current"],O=h===void 0?"page":h,w=x.activeClassName,b=w===void 0?"active":w,W=x.activeStyle,j=x.className,C=x.exact,B=x.isActive,k=x.location,y=x.sensitive,H=x.strict,J=x.style,se=x.to,fe=x.innerRef,ve=Object(r.a)(x,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Z.a.createElement(ne.e.Consumer,null,function(Se){Se||Object(A.a)(!1);var Ue=k||Se.location,Te=a(p(se,Ue),Ue),Ie=Te.pathname,be=Ie&&Ie.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),q=be?Object(ne.f)(Ue.pathname,{path:be,exact:C,sensitive:y,strict:H}):null,_=!!(B?B(q,Ue):q),L=_?D(j,b):j,z=_?Object(X.a)({},J,{},W):J,ee=Object(X.a)({"aria-current":_&&O||null,className:L,style:z,to:Te},ve);return T!==S?ee.ref=g||fe:ee.innerRef=fe,Z.a.createElement(u,ee)})});if(!1)var E},"5VLF":function(Et,Pe,F){"use strict";var ne,Q;function U(Z,G,M){var Y=function(X,r){return Z.js_beautify(X,r)};return Y.js=Z.js_beautify,Y.css=G.css_beautify,Y.html=M.html_beautify,Y.js_beautify=Z.js_beautify,Y.css_beautify=G.css_beautify,Y.html_beautify=M.html_beautify,Y}!(ne=[F("6UM0"),F("TXwP"),F("psGv")],Q=function(Z,G,M){return U(Z,G,M)}.apply(Pe,ne),Q!==void 0&&(Et.exports=Q))},"5Y4S":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return U});var ne=F("MNsG");const Q=ne.b.performance&&typeof ne.b.performance.now=="function";class U{constructor(Z){this._highResolution=Q&&Z,this._startTime=this._now(),this._stopTime=-1}static create(Z=!0){return new U(Z)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ne.b.performance.now():Date.now()}}},"69hG":function(Et,Pe,F){Et.exports={customModal:"customModal___1AnAw",content:"content___1zYYV",upload:"upload___1W2G-"}},"6RRn":function(Et,Pe,F){"use strict";var ne=F("wCXF"),Q=F("n6Qo");F.d(Pe,"b",function(){return Q.a});var U=F("IBYe"),Z=F("6eGT"),G=F("hW8S");F.d(Pe,"a",function(){return G.a}),Pe.c=ne.b},"6UM0":function(Et,Pe,F){var ne,Q;(function(){var U;(function(){"use strict";var G=[function(r,A,m){var f=m(1).Beautifier,p=m(5).Options;function a(c,s){var i=new f(c,s);return i.beautify()}r.exports=a,r.exports.defaultOptions=function(){return new p}},function(r,A,m){var f=m(2).Output,p=m(3).Token,a=m(4),c=m(5).Options,s=m(7).Tokenizer,i=m(7).line_starters,t=m(7).positionable_operators,u=m(7).TOKEN;function o(y,H){return H.indexOf(y)!==-1}function R(y){return y.replace(/^\s+/g,"")}function T(y){for(var H={},J=0;J<y.length;J++)H[y[J].replace(/-/g,"_")]=y[J];return H}function S(y,H){return y&&y.type===u.RESERVED&&y.text===H}function D(y,H){return y&&y.type===u.RESERVED&&o(y.text,H)}var I=["case","return","do","if","throw","else","await","break","continue","async"],E=["before-newline","after-newline","preserve-newline"],x=T(E),g=[x.before_newline,x.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function O(y,H){if(H.multiline_frame||H.mode===h.ForInitializer||H.mode===h.Conditional)return;y.remove_indent(H.start_line_index)}function w(y){y=y.replace(a.allLineBreaks,`
`);for(var H=[],J=y.indexOf(`
`);J!==-1;)H.push(y.substring(0,J)),y=y.substring(J+1),J=y.indexOf(`
`);return y.length&&H.push(y),H}function b(y){return y===h.ArrayLiteral}function W(y){return o(y,[h.Expression,h.ForInitializer,h.Conditional])}function j(y,H){for(var J=0;J<y.length;J++){var se=y[J].trim();if(se.charAt(0)!==H)return!1}return!0}function C(y,H){for(var J=0,se=y.length,fe;J<se;J++)if(fe=y[J],fe&&fe.indexOf(H)!==0)return!1;return!0}function B(y,H){H=H||{},this._source_text=y||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new c(H)}B.prototype.create_flags=function(y,H){var J=0;y&&(J=y.indentation_level,!this._output.just_added_newline()&&y.line_indent_level>J&&(J=y.line_indent_level));var se={mode:H,parent:y,last_token:y?y.last_token:new p(u.START_BLOCK,""),last_word:y?y.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:J,alignment:0,line_indent_level:y?y.line_indent_level:J,start_line_index:this._output.get_line_number(),ternary_depth:0};return se},B.prototype._reset=function(y){var H=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var J=new s(y,this._options);return this._tokens=J.tokenize(),y},B.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,H=this._reset(this._source_text),J=this._options.eol;this._options.eol==="auto"&&(J=`
`,H&&a.lineBreak.test(H||"")&&(J=H.match(a.lineBreak)[0]));for(var se=this._tokens.next();se;)this.handle_token(se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=se,se=this._tokens.next();return y=this._output.get_code(J),y},B.prototype.handle_token=function(y,H){y.type===u.START_EXPR?this.handle_start_expr(y):y.type===u.END_EXPR?this.handle_end_expr(y):y.type===u.START_BLOCK?this.handle_start_block(y):y.type===u.END_BLOCK?this.handle_end_block(y):y.type===u.WORD?this.handle_word(y):y.type===u.RESERVED?this.handle_word(y):y.type===u.SEMICOLON?this.handle_semicolon(y):y.type===u.STRING?this.handle_string(y):y.type===u.EQUALS?this.handle_equals(y):y.type===u.OPERATOR?this.handle_operator(y):y.type===u.COMMA?this.handle_comma(y):y.type===u.BLOCK_COMMENT?this.handle_block_comment(y,H):y.type===u.COMMENT?this.handle_comment(y,H):y.type===u.DOT?this.handle_dot(y):y.type===u.EOF?this.handle_eof(y):y.type===u.UNKNOWN?this.handle_unknown(y,H):this.handle_unknown(y,H)},B.prototype.handle_whitespace_and_comments=function(y,H){var J=y.newlines,se=this._options.keep_array_indentation&&b(this._flags.mode);if(y.comments_before)for(var fe=y.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,H),this.handle_token(fe,H),fe=y.comments_before.next();if(se)for(var ve=0;ve<J;ve+=1)this.print_newline(ve>0,H);else if(this._options.max_preserve_newlines&&J>this._options.max_preserve_newlines&&(J=this._options.max_preserve_newlines),this._options.preserve_newlines&&J>1){this.print_newline(!1,H);for(var Se=1;Se<J;Se+=1)this.print_newline(!0,H)}};var k=["async","break","continue","return","throw","yield"];B.prototype.allow_wrap_or_preserved_newline=function(y,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var J=this._options.preserve_newlines&&y.newlines||H,se=o(this._flags.last_token.text,t)||o(y.text,t);if(se){var fe=o(this._flags.last_token.text,t)&&o(this._options.operator_position,g)||o(y.text,t);J=J&&fe}if(J)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,k))return;this._output.set_wrap_point()}},B.prototype.print_newline=function(y,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var J=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&S(J,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(y)&&(this._flags.multiline_frame=!0)},B.prototype.print_token_line_indentation=function(y){this._output.just_added_newline()&&(this._options.keep_array_indentation&&y.newlines&&(y.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(y.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},B.prototype.print_token=function(y){if(this._output.raw){this._output.add_raw_token(y);return}if(this._options.comma_first&&y.previous&&y.previous.type===u.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(y),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(y),this._output.non_breaking_space=!0,this._output.add_token(y.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},B.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},B.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},B.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},B.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&O(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},B.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},B.prototype.start_of_statement=function(y){var H=!1;return H=H||D(this._flags.last_token,["var","let","const"])&&y.type===u.WORD,H=H||S(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&D(this._flags.last_token,k)&&!y.newlines,H=H||S(this._flags.last_token,"else")&&!(S(y,"if")&&!y.comments_before),H=H||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),H=H||this._flags.last_token.type===u.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==u.WORD&&y.type!==u.RESERVED,H=H||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),H?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,D(y,["do","for","if","while"])),!0):!1},B.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var H=h.Expression;if(y.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(y),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=h.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),o(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=h.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=h.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var J=this._tokens.peek(-3);if(this._options.space_after_named_function&&J){var se=this._tokens.peek(-4);D(J,["async","function"])||J.text==="*"&&D(se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?(J.text==="{"||J.text===","||J.text==="*"&&(se.text==="{"||se.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(y);(this._flags.last_token.type===u.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&o(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===u.START_BLOCK?this.print_newline():(this._flags.last_token.type===u.END_EXPR||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===u.COMMA)&&this.allow_wrap_or_preserved_newline(y,y.newlines),this.print_token(y),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},B.prototype.handle_end_expr=function(y){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===u.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(y),this.restore_mode(),O(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},B.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var H=this._tokens.peek(),J=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):J&&(o(J.text,[":",","])&&o(H.type,[u.STRING,u.WORD,u.RESERVED])||o(H.text,["get","set","..."])&&o(J.type,[u.WORD,u.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(J.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===u.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):o(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var se=!H.comments_before&&H.text==="}",fe=se&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var ve=0,Se=null;this._flags.inline_frame=!0;do if(ve+=1,Se=this._tokens.peek(ve-1),Se.newlines){this._flags.inline_frame=!1;break}while(Se.type!==u.EOF&&!(Se.type===u.END_BLOCK&&Se.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(fe||this._flags.last_token.type===u.EQUALS||D(this._flags.last_token,I)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.COMMA)&&((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(y),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(this._flags.last_token.type===u.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(y),this.indent(),!se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},B.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===h.Statement;)this.restore_mode();var H=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(y)},B.prototype.handle_word=function(y){if(y.type===u.RESERVED){if(o(y.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)y.type=u.WORD;else if(y.text==="import"&&o(this._tokens.peek().text,["(","."]))y.type=u.WORD;else if(o(y.text,["as","from"])&&!this._flags.import_block)y.type=u.WORD;else if(this._flags.mode===h.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(y.type=u.WORD)}}if(this.start_of_statement(y)?D(this._flags.last_token,["var","let","const"])&&y.type===u.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!W(this._flags.mode)&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==u.EQUALS&&(this._options.preserve_newlines||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(S(y,"while")){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(y,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(y,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(y),this._flags.in_case=!0;return}if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y)),S(y,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===u.OPERATOR))&&(!this._output.just_added_blankline()&&!y.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,k)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===u.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(W(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var J="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?J="SPACE":D(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?J="NEWLINE":(J="SPACE",this._output.space_before_token=!0):J="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===h.BlockStatement?J="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&W(this._flags.mode)?J="SPACE":this._flags.last_token.type===u.STRING?J="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&o(this._last_last_text,["{",","]))?J="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?J="SPACE":J="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,J="NEWLINE"),D(y,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?J="SPACE":J="NEWLINE"),D(y,["else","catch","finally"]))if((!(this._flags.last_token.type===u.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var se=this._output.current_line;se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else J==="NEWLINE"?D(this._flags.last_token,I)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(y,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?(this._flags.last_token.type!==u.START_EXPR||!D(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(y,"if")&&S(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(y,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():J==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===u.WORD||y.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===u.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(y,"from")&&(this._flags.import_block=!1))},B.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var H=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&S(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},B.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y):y.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},B.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},B.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(W(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)},B.prototype.handle_operator=function(y){var H=y.text==="*"&&(D(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),J=o(y.text,["-","+"])&&(o(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||o(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(y)){var se=!H;this.handle_whitespace_and_comments(y,se)}if(y.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(this._flags.last_token.type===u.OPERATOR&&o(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==u.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var fe=!0,ve=!0,Se=!1;if(y.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,Se=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!J&&!H&&this._options.preserve_newlines&&o(y.text,t)){var Ue=y.text===":",Te=Ue&&Se,Ie=Ue&&!Se;switch(this._options.operator_position){case x.before_newline:this._output.space_before_token=!Ie,this.print_token(y),(!Ue||Te)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case x.after_newline:this._output.space_before_token=!0,!Ue||Te?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case x.preserve_newline:Ie||this.allow_wrap_or_preserved_newline(y),fe=!(this._output.just_added_newline()||Ie),this._output.space_before_token=fe,this.print_token(y),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(y),fe=!1;var be=this._tokens.peek();ve=be&&o(be.type,[u.WORD,u.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),fe=this._flags.last_token.type===u.START_BLOCK,ve=!1;else if(o(y.text,["--","++","!","~"])||J){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),fe=!1,ve=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var q=D(this._flags.last_token,I)&&y.newlines;q&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(q,!0)}this._flags.last_token.text===";"&&W(this._flags.mode)&&(fe=!0),this._flags.last_token.type===u.RESERVED?fe=!0:this._flags.last_token.type===u.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===u.OPERATOR&&(fe=o(y.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(y.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(ve=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||fe,this.print_token(y),this._output.space_before_token=ve},B.prototype.handle_block_comment=function(y,H){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,H),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,H)},B.prototype.print_block_commment=function(y,H){var J=w(y.text),se,fe=!1,ve=!1,Se=y.whitespace_before,Ue=Se.length;if(this.print_newline(!1,H),this.print_token_line_indentation(y),this._output.add_token(J[0]),this.print_newline(!1,H),J.length>1){for(J=J.slice(1),fe=j(J,"*"),ve=C(J,Se),fe&&(this._flags.alignment=1),se=0;se<J.length;se++)fe?(this.print_token_line_indentation(y),this._output.add_token(R(J[se]))):ve&&J[se]?(this.print_token_line_indentation(y),this._output.add_token(J[se].substring(Ue))):(this._output.current_line.set_indent(-1),this._output.add_token(J[se])),this.print_newline(!1,H);this._flags.alignment=0}},B.prototype.handle_comment=function(y,H){y.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(y),this.print_newline(!1,H)},B.prototype.handle_dot=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,I)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(y,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(y)},B.prototype.handle_unknown=function(y,H){this.print_token(y),y.text[y.text.length-1]===`
`&&this.print_newline(!1,H)},B.prototype.handle_eof=function(y){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y)},r.exports.Beautifier=B},function(r){function A(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}A.prototype.clone_empty=function(){var p=new A(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},A.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},A.prototype.has_match=function(p){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(p))return!0;return!1},A.prototype.set_indent=function(p,a){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},A.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},A.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(p){this.__items.push(p);var a=p.lastIndexOf(`
`);a!==-1?this.__character_count=p.length-a:this.__character_count+=p.length},A.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function m(p,a){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),a=a||"",p.indent_level>0&&(a=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(p,a){var c=this.__base_string_length;return a=a||0,p<0&&(c=0),c+=p*this.__indent_size,c+=a,c},m.prototype.get_indent_string=function(p,a){var c=this.__base_string;return a=a||0,p<0&&(p=0,c=""),a+=p*this.__indent_size,this.__ensure_cache(a),c+=this.__cache[a],c},m.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var p=this.__cache.length,a=0,c="";this.__indent_size&&p>=this.__indent_size&&(a=Math.floor(p/this.__indent_size),p-=a*this.__indent_size,c=new Array(a+1).join(this.__indent_string)),p&&(c+=new Array(p+1).join(" ")),this.__cache.push(c)};function f(p,a){this.__indent_cache=new m(p,a),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(p,a){return this.__indent_cache.get_indent_string(p,a)},f.prototype.get_indent_size=function(p,a){return this.__indent_cache.get_indent_size(p,a)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(p){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
`);return p!==`
`&&(c=c.replace(/[\n]/g,p)),c},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(p,a){return p=p||0,a=a||0,this.next_line.set_indent(p,a),this.__lines.length>1?(this.current_line.set_indent(p,a),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(p){for(var a=0;a<p.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(p){for(var a=this.__lines.length;p<a;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(p,a){for(var c=this.__lines.length-2;c>=0;){var s=this.__lines[c];if(s.is_empty())break;if(s.item(0).indexOf(p)!==0&&s.item(-1)!==a){this.__lines.splice(c+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},r.exports.Output=f},function(r){function A(m,f,p,a){this.type=m,this.text=f,this.comments_before=null,this.newlines=p||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=A},function(r,A){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",a="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",c="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+f+p+a+"])*";A.identifier=new RegExp(c+s,"g"),A.identifierStart=new RegExp(c),A.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+p+a+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;A.newline=/[\n\r\u2028\u2029]/,A.lineBreak=new RegExp(`\r
|`+A.newline.source),A.allLineBreaks=new RegExp(A.lineBreak.source,"g")},function(r,A,m){var f=m(6).Options,p=["before-newline","after-newline","preserve-newline"];function a(c){f.call(this,c,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var t=0;t<i.length;t++)i[t]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[t];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new f,r.exports.Options=a},function(r){function A(p,a){this.raw_options=m(p,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}A.prototype._get_array=function(p,a){var c=this.raw_options[p],s=a||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(s=c.concat()):typeof c=="string"&&(s=c.split(/[^a-zA-Z0-9_\/\-]+/)),s},A.prototype._get_boolean=function(p,a){var c=this.raw_options[p],s=c===void 0?!!a:!!c;return s},A.prototype._get_characters=function(p,a){var c=this.raw_options[p],s=a||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},A.prototype._get_number=function(p,a){var c=this.raw_options[p];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(c,10);return isNaN(s)&&(s=a),s},A.prototype._get_selection=function(p,a,c){var s=this._get_selection_list(p,a,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[p]+"'");return s[0]},A.prototype._get_selection_list=function(p,a,c){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[a[0]],!this._is_valid_selection(c,a))throw new Error("Invalid Default Value!");var s=this._get_array(p,c);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[p]+"'");return s},A.prototype._is_valid_selection=function(p,a){return p.length&&a.length&&!p.some(function(c){return a.indexOf(c)===-1})};function m(p,a){var c={};p=f(p);var s;for(s in p)s!==a&&(c[s]=p[s]);if(a&&p[a])for(s in p[a])c[s]=p[a][s];return c}function f(p){var a={},c;for(c in p){var s=c.replace(/-/g,"_");a[s]=p[c]}return a}r.exports.Options=A,r.exports.normalizeOpts=f,r.exports.mergeOpts=m},function(r,A,m){var f=m(8).InputScanner,p=m(9).Tokenizer,a=m(9).TOKEN,c=m(13).Directives,s=m(4),i=m(12).Pattern,t=m(14).TemplatablePattern;function u(j,C){return C.indexOf(j)!==-1}var o={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},R=new c(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,D=/[^\d\.]/,I=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),E=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";E=E.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),E="\\?\\.(?!\\d) "+E,E=E.replace(/ /g,"|");var x=new RegExp(E),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),O=new RegExp("^(?:"+h.join("|")+")$"),w,b=function(j,C){p.call(this,j,C),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var B=new i(this._input),k=new t(this._input).read_options(this._options);this.__patterns={template:k,identifier:k.starting_with(s.identifier).matching(s.identifierMatch),number:B.matching(T),punct:B.matching(x),comment:B.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:B.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:B.matching(/<!--/),html_comment_end:B.matching(/-->/),include:B.starting_with(/#include/).until_after(s.lineBreak),shebang:B.starting_with(/#!/).until_after(s.lineBreak),xml:B.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:k.until(/['\\\n\r\u2028\u2029]/),double_quote:k.until(/["\\\n\r\u2028\u2029]/),template_text:k.until(/[`\\$]/),template_expression:k.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(j){return j.type===o.COMMENT||j.type===o.BLOCK_COMMENT||j.type===o.UNKNOWN},b.prototype._is_opening=function(j){return j.type===o.START_BLOCK||j.type===o.START_EXPR},b.prototype._is_closing=function(j,C){return(j.type===o.END_BLOCK||j.type===o.END_EXPR)&&C&&(j.text==="]"&&C.text==="["||j.text===")"&&C.text==="("||j.text==="}"&&C.text==="{")},b.prototype._reset=function(){w=!1},b.prototype._get_next_token=function(j,C){var B=null;this._readWhitespace();var k=this._input.peek();return k===null?this._create_token(o.EOF,""):(B=B||this._read_non_javascript(k),B=B||this._read_string(k),B=B||this._read_word(j),B=B||this._read_singles(k),B=B||this._read_comment(k),B=B||this._read_regexp(k,j),B=B||this._read_xml(k,j),B=B||this._read_punctuation(),B=B||this._create_token(o.UNKNOWN,this._input.next()),B)},b.prototype._read_word=function(j){var C;if(C=this.__patterns.identifier.read(),C!=="")return C=C.replace(s.allLineBreaks,`
`),!(j.type===o.DOT||j.type===o.RESERVED&&(j.text==="set"||j.text==="get"))&&O.test(C)?(C==="in"||C==="of")&&(j.type===o.WORD||j.type===o.STRING)?this._create_token(o.OPERATOR,C):this._create_token(o.RESERVED,C):this._create_token(o.WORD,C);if(C=this.__patterns.number.read(),C!=="")return this._create_token(o.WORD,C)},b.prototype._read_singles=function(j){var C=null;return j==="("||j==="["?C=this._create_token(o.START_EXPR,j):j===")"||j==="]"?C=this._create_token(o.END_EXPR,j):j==="{"?C=this._create_token(o.START_BLOCK,j):j==="}"?C=this._create_token(o.END_BLOCK,j):j===";"?C=this._create_token(o.SEMICOLON,j):j==="."&&D.test(this._input.peek(1))?C=this._create_token(o.DOT,j):j===","&&(C=this._create_token(o.COMMA,j)),C&&this._input.next(),C},b.prototype._read_punctuation=function(){var j=this.__patterns.punct.read();if(j!=="")return j==="="?this._create_token(o.EQUALS,j):j==="?."?this._create_token(o.DOT,j):this._create_token(o.OPERATOR,j)},b.prototype._read_non_javascript=function(j){var C="";if(j==="#"){if(this._is_first_token()&&(C=this.__patterns.shebang.read(),C))return this._create_token(o.UNKNOWN,C.trim()+`
`);if(C=this.__patterns.include.read(),C)return this._create_token(o.UNKNOWN,C.trim()+`
`);j=this._input.next();var B="#";if(this._input.hasNext()&&this._input.testChar(S)){do j=this._input.next(),B+=j;while(this._input.hasNext()&&j!=="#"&&j!=="=");return j==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(B+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(B+="{}",this._input.next(),this._input.next())),this._create_token(o.WORD,B)}this._input.back()}else if(j==="<"&&this._is_first_token()){if(C=this.__patterns.html_comment_start.read(),C){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)C+=this._input.next();return w=!0,this._create_token(o.COMMENT,C)}}else if(w&&j==="-"&&(C=this.__patterns.html_comment_end.read(),C))return w=!1,this._create_token(o.COMMENT,C);return null},b.prototype._read_comment=function(j){var C=null;if(j==="/"){var B="";if(this._input.peek(1)==="*"){B=this.__patterns.block_comment.read();var k=R.get_directives(B);k&&k.ignore==="start"&&(B+=R.readIgnored(this._input)),B=B.replace(s.allLineBreaks,`
`),C=this._create_token(o.BLOCK_COMMENT,B),C.directives=k}else this._input.peek(1)==="/"&&(B=this.__patterns.comment.read(),C=this._create_token(o.COMMENT,B))}return C},b.prototype._read_string=function(j){if(j==="`"||j==="'"||j==='"'){var C=this._input.next();return this.has_char_escapes=!1,j==="`"?C+=this._read_string_recursive("`",!0,"${"):C+=this._read_string_recursive(j),this.has_char_escapes&&this._options.unescape_strings&&(C=W(C)),this._input.peek()===j&&(C+=this._input.next()),C=C.replace(s.allLineBreaks,`
`),this._create_token(o.STRING,C)}return null},b.prototype._allow_regexp_or_xml=function(j){return j.type===o.RESERVED&&u(j.text,["return","case","throw","else","do","typeof","yield"])||j.type===o.END_EXPR&&j.text===")"&&j.opened.previous.type===o.RESERVED&&u(j.opened.previous.text,["if","while","for"])||u(j.type,[o.COMMENT,o.START_EXPR,o.START_BLOCK,o.START,o.END_BLOCK,o.OPERATOR,o.EQUALS,o.EOF,o.SEMICOLON,o.COMMA])},b.prototype._read_regexp=function(j,C){if(j==="/"&&this._allow_regexp_or_xml(C)){for(var B=this._input.next(),k=!1,y=!1;this._input.hasNext()&&(k||y||this._input.peek()!==j)&&!this._input.testChar(s.newline);)B+=this._input.peek(),k?k=!1:(k=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===j&&(B+=this._input.next(),B+=this._input.read(s.identifier)),this._create_token(o.STRING,B)}return null},b.prototype._read_xml=function(j,C){if(this._options.e4x&&j==="<"&&this._allow_regexp_or_xml(C)){var B="",k=this.__patterns.xml.read_match();if(k){for(var y=k[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=y.indexOf("{")===0,J=0;k;){var se=!!k[1],fe=k[2],ve=!!k[k.length-1]||fe.slice(0,8)==="![CDATA[";if(!ve&&(fe===y||H&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--J:++J),B+=k[0],J<=0)break;k=this.__patterns.xml.read_match()}return k||(B+=this._input.match(/[\s\S]*/g)[0]),B=B.replace(s.allLineBreaks,`
`),this._create_token(o.STRING,B)}}return null};function W(j){for(var C="",B=0,k=new f(j),y=null;k.hasNext();)if(y=k.match(/([\s]|[^\\]|\\\\)+/g),y&&(C+=y[0]),k.peek()==="\\"){if(k.next(),k.peek()==="x")y=k.match(/x([0-9A-Fa-f]{2})/g);else if(k.peek()==="u")y=k.match(/u([0-9A-Fa-f]{4})/g);else{C+="\\",k.hasNext()&&(C+=k.next());continue}if(!y)return j;if(B=parseInt(y[1],16),B>126&&B<=255&&y[0].indexOf("x")===0)return j;if(B>=0&&B<32){C+="\\"+y[0];continue}else B===34||B===39||B===92?C+="\\"+String.fromCharCode(B):C+=String.fromCharCode(B)}return C}b.prototype._read_string_recursive=function(j,C,B){var k,y;j==="'"?y=this.__patterns.single_quote:j==='"'?y=this.__patterns.double_quote:j==="`"?y=this.__patterns.template_text:j==="}"&&(y=this.__patterns.template_expression);for(var H=y.read(),J="";this._input.hasNext();){if(J=this._input.next(),J===j||!C&&s.newline.test(J)){this._input.back();break}else J==="\\"&&this._input.hasNext()?(k=this._input.peek(),k==="x"||k==="u"?this.has_char_escapes=!0:k==="\r"&&this._input.peek(1)===`
`&&this._input.next(),J+=this._input.next()):B&&(B==="${"&&J==="$"&&this._input.peek()==="{"&&(J+=this._input.next()),B===J&&(j==="`"?J+=this._read_string_recursive("}",C,"`"):J+=this._read_string_recursive("`",C,"${"),this._input.hasNext()&&(J+=this._input.next())));J+=y.read(),H+=J}return H},r.exports.Tokenizer=b,r.exports.TOKEN=o,r.exports.positionable_operators=I.slice(),r.exports.line_starters=g.slice()},function(r){var A=RegExp.prototype.hasOwnProperty("sticky");function m(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},m.prototype.peek=function(f){var p=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(p=this.__input.charAt(f)),p},m.prototype.__match=function(f,p){f.lastIndex=p;var a=f.exec(this.__input);return a&&!(A&&f.sticky)&&(a.index!==p&&(a=null)),a},m.prototype.test=function(f,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(f,p):!1},m.prototype.testChar=function(f,p){var a=this.peek(p);return f.lastIndex=0,a!==null&&f.test(a)},m.prototype.match=function(f){var p=this.__match(f,this.__position);return p?this.__position+=p[0].length:p=null,p},m.prototype.read=function(f,p,a){var c="",s;return f&&(s=this.match(f),s&&(c+=s[0])),p&&(s||!f)&&(c+=this.readUntil(p,a)),c},m.prototype.readUntil=function(f,p){var a="",c=this.__position;f.lastIndex=this.__position;var s=f.exec(this.__input);return s?(c=s.index,p&&(c+=s[0].length)):c=this.__input_length,a=this.__input.substring(this.__position,c),this.__position=c,a},m.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},m.prototype.get_regexp=function(f,p){var a=null,c="g";return p&&A&&(c="y"),typeof f=="string"&&f!==""?a=new RegExp(f,c):f&&(a=new RegExp(f.source,c)),a},m.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(f){var p=this.__position,a=this.readUntilAfter(f);return this.__position=p,a},m.prototype.lookBack=function(f){var p=this.__position-1;return p>=f.length&&this.__input.substring(p-f.length,p).toLowerCase()===f},r.exports.InputScanner=m},function(r,A,m){var f=m(8).InputScanner,p=m(3).Token,a=m(10).TokenStream,c=m(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,u){this._input=new f(t),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new c(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var t,u=new p(s.START,""),o=null,R=[],T=new a;u.type!==s.EOF;){for(t=this._get_next_token(u,o);this._is_comment(t);)T.add(t),t=this._get_next_token(u,o);T.isEmpty()||(t.comments_before=T,T=new a),t.parent=o,this._is_opening(t)?(R.push(o),o=t):o&&this._is_closing(t,o)&&(t.opened=o,o.closed=t,o=R.pop(),t.parent=o),t.previous=u,u.next=t,this.__tokens.add(t),u=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,u){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(s.RAW,o):this._create_token(s.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,u){return!1},i.prototype._create_token=function(t,u){var o=new p(t,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=i,r.exports.TOKEN=s},function(r){function A(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}A.prototype.restart=function(){this.__position=0},A.prototype.isEmpty=function(){return this.__tokens_length===0},A.prototype.hasNext=function(){return this.__position<this.__tokens_length},A.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},A.prototype.peek=function(m){var f=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(f=this.__tokens[m]),f},A.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},r.exports.TokenStream=A},function(r,A,m){var f=m(12).Pattern;function p(a,c){f.call(this,a,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new f,p.prototype.__set_whitespace_patterns=function(a,c){a+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+c+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+c+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var c=this.__split(this._newline_regexp,a);this.newline_count=c.length-1,this.whitespace_before_token=c[this.newline_count]}return a},p.prototype.matching=function(a,c){var s=this._create();return s.__set_whitespace_patterns(a,c),s._update(),s},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(a,c){a.lastIndex=0;for(var s=0,i=[],t=a.exec(c);t;)i.push(c.substring(s,t.index)),s=t.index+t[0].length,t=a.exec(c);return s<c.length?i.push(c.substring(s,c.length)):i.push(""),i},r.exports.WhitespacePattern=p},function(r){function A(m,f){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}A.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},A.prototype.read_match=function(){return this._input.match(this._match_pattern)},A.prototype.until_after=function(m){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(m),f._update(),f},A.prototype.until=function(m){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(m),f._update(),f},A.prototype.starting_with=function(m){var f=this._create();return f._starting_pattern=this._input.get_regexp(m,!0),f._update(),f},A.prototype.matching=function(m){var f=this._create();return f._match_pattern=this._input.get_regexp(m,!0),f._update(),f},A.prototype._create=function(){return new A(this._input,this)},A.prototype._update=function(){},r.exports.Pattern=A},function(r){function A(m,f){m=typeof m=="string"?m:m.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+f,"g")}A.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(m);p;)f[p[1]]=p[2],p=this.__directive_pattern.exec(m);return f},A.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=A},function(r,A,m){var f=m(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(c,s){f.call(this,c,s),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var i=new f(c);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new f,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(c){var s=this._create();return s._disabled[c]=!0,s._update(),s},a.prototype.read_options=function(c){var s=this._create();for(var i in p)s._disabled[i]=c.templating.indexOf(i)===-1;return s._update(),s},a.prototype.exclude=function(c){var s=this._create();return s._excluded[c]=!0,s._update(),s},a.prototype.read=function(){var c="";this._match_pattern?c=this._input.read(this._starting_pattern):c=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),c+=s,s=this._read_template();return this._until_after&&(c+=this._input.readUntilAfter(this._until_pattern)),c},a.prototype.__set_templated_pattern=function(){var c=[];this._disabled.php||c.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||c.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||c.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(c.push(this.__patterns.django._starting_pattern.source),c.push(this.__patterns.django_value._starting_pattern.source),c.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||c.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&c.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+c.join("|")+")")},a.prototype._read_template=function(){var c="",s=this._input.peek();if(s==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(c=c||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(c=c||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(c=c||this.__patterns.handlebars_comment.read(),c=c||this.__patterns.handlebars_unescaped.read(),c=c||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(c=c||this.__patterns.django_value.read()),this._excluded.django||(c=c||this.__patterns.django_comment.read(),c=c||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(c=c||this.__patterns.smarty_comment.read(),c=c||this.__patterns.smarty_literal.read(),c=c||this.__patterns.smarty.read()));return c},r.exports.TemplatablePattern=a}],M={};function Y(r){var A=M[r];if(A!==void 0)return A.exports;var m=M[r]={exports:{}};return G[r](m,m.exports,Y),m.exports}var X=Y(0);U=X})();var Z=U;!(ne=[],Q=function(){return{js_beautify:Z}}.apply(Pe,ne),Q!==void 0&&(Et.exports=Q))})()},"6eGT":function(Et,Pe,F){"use strict";function ne(Q){return null}Pe.a=ne},"746U":function(Et,Pe,F){"use strict";F.d(Pe,"f",function(){return ne}),F.d(Pe,"l",function(){return Q}),F.d(Pe,"k",function(){return U}),F.d(Pe,"j",function(){return Z}),F.d(Pe,"g",function(){return G}),F.d(Pe,"m",function(){return M}),F.d(Pe,"h",function(){return Y}),F.d(Pe,"n",function(){return X}),F.d(Pe,"c",function(){return r}),F.d(Pe,"a",function(){return A}),F.d(Pe,"i",function(){return m}),F.d(Pe,"o",function(){return f}),F.d(Pe,"e",function(){return c}),F.d(Pe,"d",function(){return s}),F.d(Pe,"p",function(){return i}),F.d(Pe,"b",function(){return t});function ne(u){return Array.isArray(u)}function Q(u){return typeof u=="string"}function U(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)&&!(u instanceof RegExp)&&!(u instanceof Date)}function Z(u){return typeof u=="number"&&!isNaN(u)}function G(u){return u===!0||u===!1}function M(u){return typeof u=="undefined"}function Y(u){return!X(u)}function X(u){return M(u)||u===null}function r(u,o){if(!u)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function A(u){if(X(u))throw new Error("Assertion Failed: argument is undefined or null");return u}function m(u){return typeof u=="function"}function f(u,o){const R=Math.min(u.length,o.length);for(let T=0;T<R;T++)p(u[T],o[T])}function p(u,o){if(Q(o)){if(typeof u!==o)throw new Error(`argument does not match constraint: typeof ${o}`)}else if(m(o)){try{if(u instanceof o)return}catch(R){}if(!X(u)&&u.constructor===o)return;if(o.length===1&&o.call(void 0,u)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(u){let o=[],R=Object.getPrototypeOf(u);for(;Object.prototype!==R;)o=o.concat(Object.getOwnPropertyNames(R)),R=Object.getPrototypeOf(R);return o}function c(u){const o=[];for(const R of a(u))typeof u[R]=="function"&&o.push(R);return o}function s(u,o){const R=S=>function(){const D=Array.prototype.slice.call(arguments,0);return o(S,D)};let T={};for(const S of u)T[S]=R(S);return T}function i(u){return u===null?void 0:u}function t(u,o="Unreachable"){throw new Error(o)}},"7Cbv":function(Et,Pe,F){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Q=new Uint8Array(16);function U(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(Q)}var Z=/^(?:[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 G(p){return typeof p=="string"&&Z.test(p)}for(var M=G,Y=[],X=0;X<256;++X)Y.push((X+256).toString(16).substr(1));function r(p){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=(Y[p[a+0]]+Y[p[a+1]]+Y[p[a+2]]+Y[p[a+3]]+"-"+Y[p[a+4]]+Y[p[a+5]]+"-"+Y[p[a+6]]+Y[p[a+7]]+"-"+Y[p[a+8]]+Y[p[a+9]]+"-"+Y[p[a+10]]+Y[p[a+11]]+Y[p[a+12]]+Y[p[a+13]]+Y[p[a+14]]+Y[p[a+15]]).toLowerCase();if(!M(c))throw TypeError("Stringified UUID is invalid");return c}var A=r;function m(p,a,c){p=p||{};var s=p.random||(p.rng||U)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,a){c=c||0;for(var i=0;i<16;++i)a[c+i]=s[i];return a}return A(s)}var f=Pe.a=m},"7ahc":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return R});var ne=F("k1fw"),Q=F("0Owb"),U=F("+L6B"),Z=F("2/Rp"),G=F("y8nQ"),M=F("Vl3Y"),Y=F("tJVT"),X=F("OaEy"),r=F("2fM7"),A=F("q1tI"),m=F.n(A),f=F("VrN/"),p=F.n(f),a=F("p77/"),c=F.n(a),s=F("c5Ni"),i=F.n(s),t=r.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},o={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"]};Pe.b=function(T){var S=T.callback,D=T.onCancel,I=Object(A.useState)("python"),E=Object(Y.a)(I,2),x=E[0],g=E[1];function h(w){g(o[w][1])}function O(w){S(w)}return m.a.createElement(M.a,Object(Q.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:O}),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(r.a,{onChange:h},Object.keys(o).map(function(w){return m.a.createElement(t,{key:w,value:w},o[w][0])}))),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(R,{mode:x})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(Z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(Z.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function R(T){var S=T.value,D=T.onChange,I=T.mode,E=T.options,x=E===void 0?{}:E,g=Object(A.useRef)(),h=Object(A.useState)(),O=Object(Y.a)(h,2),w=O[0],b=O[1];return Object(A.useEffect)(function(){if(w){function W(j){var C=j.getValue();D&&D(C)}return w.on("change",W),function(){w.off("change",W)}}},[w,D]),Object(A.useEffect)(function(){w&&w.setOption("mode",I)},[w,I]),Object(A.useEffect)(function(){w&&((S!==w.getValue()||S==="")&&setTimeout(function(){w.setValue(S||" ")},300))},[w,S]),Object(A.useEffect)(function(){if(g.current&&!w){var W=p.a.fromTextArea(g.current,Object(ne.a)({mode:I,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},x));b(W)}},[g.current,w]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:g}))}},"7qnI":function(Et,Pe,F){"use strict";var ne=F("5Dmo"),Q=F("3S7+"),U=F("fWQN"),Z=F("mtLc"),G=F("yKVA"),M=F("879j"),Y=F("5NDa"),X=F("5rEg"),r=F("q1tI"),A=F.n(r),m=F("O2Wb"),f=F.n(m),p=X.a.TextArea,a=function(c){Object(G.a)(i,c);var s=Object(M.a)(i);function i(){return Object(U.a)(this,i),s.apply(this,arguments)}return Object(Z.a)(i,[{key:"render",value:function(){var u=this,o=this.props,R=o.index,T=o.onAnswerChange,S=o.addChildAnswer,D=o.exerciseIsPublish,I=o.answers,E=o.activeOptionErrorIndex,x=o.flex,g=x===void 0?"0 0 1000px":x;return A.a.createElement("div",{className:f.a.flex},A.a.createElement("div",{className:"".concat(f.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",R+1,"):"),A.a.createElement("div",{className:"".concat(f.a.flex," ").concat(f.a.flex1),style:{flexDirection:"column"}},I.map(function(h,O){var w="".concat(R,"-").concat(O);return A.a.createElement("div",{className:"".concat(f.a.flex," ").concat(f.a.flex1),key:O},A.a.createElement("div",{className:f.a.flex1,style:{flex:g}},A.a.createElement("div",null,A.a.createElement(p,{className:w===E?f.a.error:"",spellCheck:!1,rows:4,value:h||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(O==0?"":"(\u53EF\u9009)"),onChange:function(W){return T(R,O,W.target.value)},style:{minHeight:95}}))),!D&&A.a.createElement(A.a.Fragment,null,O!=0&&A.a.createElement(Q.a,{title:"\u5220\u9664"},A.a.createElement("i",{className:"".concat(f.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswer(R,O)},style:{float:"right"}})),O===0&&A.a.createElement(Q.a,{title:"\u5220\u9664"},A.a.createElement("i",{className:"".concat(f.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswermain(R,O)},style:{float:"right"}})),A.a.createElement(Q.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},A.a.createElement("i",{className:"".concat(f.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return S(R)},style:{float:"right",visibility:O==I.length-1?"":"hidden"}}))))})))}}]),i}(r.Component);Pe.a=a},"815F":function(Et,Pe,F){"use strict";F.d(Pe,"e",function(){return Y}),F.d(Pe,"c",function(){return r}),F.d(Pe,"d",function(){return A}),F.d(Pe,"a",function(){return f}),F.d(Pe,"f",function(){return p}),F.d(Pe,"b",function(){return a});var ne=F("KQm4"),Q=F("VTBJ"),U=F("Ff2n"),Z=F("Zm9Q"),G=F("Kwbf"),M=F("OZM5");function Y(c,s){return c!=null?c:s}function X(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function i(t){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(o){var R=o.key,T=o.children;Object(G.a)(R!=null,"Tree node must have a certain key: [".concat(u).concat(R,"]"));var S=String(R);Object(G.a)(!s.has(S)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(S)),s.set(S,!0),i(T,"".concat(u).concat(S," > "))})}i(c)}function r(c){function s(i){var t=Object(Z.a)(i);return t.map(function(u){if(!Object(M.i)(u))return Object(G.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var o=u.key,R=u.props,T=R.children,S=Object(U.a)(R,["children"]),D=Object(Q.a)({key:o},S),I=s(T);return I.length&&(D.children=I),D}).filter(function(u){return u})}return s(c)}function A(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(s===!0?[]:s),t=[];function u(o){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(T,S){var D=Object(M.h)(R?R.pos:"0",S),I=Y(T.key,D),E=Object(Q.a)(Object(Q.a)({},T),{},{parent:R,pos:D,children:null,data:T,isStart:[].concat(Object(ne.a)(R?R.isStart:[]),[S===0]),isEnd:[].concat(Object(ne.a)(R?R.isEnd:[]),[S===o.length-1])});return t.push(E),s===!0||i.has(I)?E.children=u(T.children||[],E):E.children=[],E})}return u(c),t}function m(c,s,i){var t;i?typeof i=="string"?t=function(R){return R[i]}:typeof i=="function"&&(t=function(R){return i(R)}):t=function(R,T){return Y(R.key,T)};function u(o,R,T){var S=o?o.children:c,D=o?Object(M.h)(T.pos,R):"0";if(o){var I=t(o,D),E={node:o,index:R,pos:D,key:I,parentPos:T.node?T.pos:null,level:T.level+1};s(E)}S&&S.forEach(function(x,g){u(x,g,{node:o,pos:D,level:T?T.level+1:-1})})}u(null)}function f(c){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=s.initWrapper,t=s.processEntity,u=s.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,R={},T={},S={posEntities:R,keyEntities:T};return i&&(S=i(S)||S),m(c,function(D){var I=D.node,E=D.index,x=D.pos,g=D.key,h=D.parentPos,O=D.level,w={node:I,index:E,key:g,pos:x,level:O},b=Y(g,x);R[x]=w,T[b]=w,w.parent=R[h],w.parent&&(w.parent.children=w.parent.children||[],w.parent.children.push(w)),t&&t(w,S)},o),u&&u(S),S}function p(c,s){var i=s.expandedKeys,t=s.selectedKeys,u=s.loadedKeys,o=s.loadingKeys,R=s.checkedKeys,T=s.halfCheckedKeys,S=s.dragOverNodeKey,D=s.dropPosition,I=s.keyEntities,E=I[c],x={eventKey:c,expanded:i.indexOf(c)!==-1,selected:t.indexOf(c)!==-1,loaded:u.indexOf(c)!==-1,loading:o.indexOf(c)!==-1,checked:R.indexOf(c)!==-1,halfChecked:T.indexOf(c)!==-1,pos:String(E?E.pos:""),dragOver:S===c&&D===0,dragOverGapTop:S===c&&D===-1,dragOverGapBottom:S===c&&D===1};return x}function a(c){var s=c.data,i=c.expanded,t=c.selected,u=c.checked,o=c.loaded,R=c.loading,T=c.halfChecked,S=c.dragOver,D=c.dragOverGapTop,I=c.dragOverGapBottom,E=c.pos,x=c.active,g=Object(Q.a)(Object(Q.a)({},s),{},{expanded:i,selected:t,checked:u,loaded:o,loading:R,halfChecked:T,dragOver:S,dragOverGapTop:D,dragOverGapBottom:I,pos:E,active:x});return"props"in g||Object.defineProperty(g,"props",{get:function(){return Object(G.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),c}}),g}},"8EBN":function(Et,Pe,F){(function(ne){ne(F("VrN/"))})(function(ne){"use strict";ne.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 Q=0;Q<ne.modeInfo.length;Q++){var U=ne.modeInfo[Q];U.mimes&&(U.mime=U.mimes[0])}ne.findModeByMIME=function(Z){Z=Z.toLowerCase();for(var G=0;G<ne.modeInfo.length;G++){var M=ne.modeInfo[G];if(M.mime==Z)return M;if(M.mimes){for(var Y=0;Y<M.mimes.length;Y++)if(M.mimes[Y]==Z)return M}}if(/\+xml$/.test(Z))return ne.findModeByMIME("application/xml");if(/\+json$/.test(Z))return ne.findModeByMIME("application/json")},ne.findModeByExtension=function(Z){Z=Z.toLowerCase();for(var G=0;G<ne.modeInfo.length;G++){var M=ne.modeInfo[G];if(M.ext){for(var Y=0;Y<M.ext.length;Y++)if(M.ext[Y]==Z)return M}}},ne.findModeByFileName=function(Z){for(var G=0;G<ne.modeInfo.length;G++){var M=ne.modeInfo[G];if(M.file&&M.file.test(Z))return M}var Y=Z.lastIndexOf("."),X=Y>-1&&Z.substring(Y+1,Z.length);if(X)return ne.findModeByExtension(X)},ne.findModeByName=function(Z){Z=Z.toLowerCase();for(var G=0;G<ne.modeInfo.length;G++){var M=ne.modeInfo[G];if(M.name.toLowerCase()==Z)return M;if(M.alias){for(var Y=0;Y<M.alias.length;Y++)if(M.alias[Y].toLowerCase()==Z)return M}}}})},"8HAY":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return G}),F.d(Pe,"b",function(){return M}),F.d(Pe,"d",function(){return Y}),F.d(Pe,"e",function(){return X}),F.d(Pe,"c",function(){return r});var ne=F("MI8n"),Q=F("pmY6"),U=F("3/fG"),Z=function(A,m,f,p){function a(c){return c instanceof f?c:new f(function(s){s(c)})}return new(f||(f=Promise))(function(c,s){function i(o){try{u(p.next(o))}catch(R){s(R)}}function t(o){try{u(p.throw(o))}catch(R){s(R)}}function u(o){o.done?c(o.value):a(o.value).then(i,t)}u((p=p.apply(A,m||[])).next())})};class G extends Q.a{constructor(A,m="",f="",p=!0,a){super();this._onDidChange=this._register(new ne.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=A,this._label=m,this._cssClass=f,this._enabled=p,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(A){this._setLabel(A)}_setLabel(A){this._label!==A&&(this._label=A,this._onDidChange.fire({label:A}))}get tooltip(){return this._tooltip||""}set tooltip(A){this._setTooltip(A)}_setTooltip(A){this._tooltip!==A&&(this._tooltip=A,this._onDidChange.fire({tooltip:A}))}get class(){return this._cssClass}set class(A){this._setClass(A)}_setClass(A){this._cssClass!==A&&(this._cssClass=A,this._onDidChange.fire({class:A}))}get enabled(){return this._enabled}set enabled(A){this._setEnabled(A)}_setEnabled(A){this._enabled!==A&&(this._enabled=A,this._onDidChange.fire({enabled:A}))}get checked(){return this._checked}set checked(A){this._setChecked(A)}_setChecked(A){this._checked!==A&&(this._checked=A,this._onDidChange.fire({checked:A}))}run(A,m){return Z(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(A))})}}class M extends Q.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ne.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ne.b),this.onDidRun=this._onDidRun.event}run(A,m){return Z(this,void 0,void 0,function*(){if(!A.enabled)return;this._onBeforeRun.fire({action:A});let f;try{yield this.runAction(A,m)}catch(p){f=p}this._onDidRun.fire({action:A,error:f})})}runAction(A,m){return Z(this,void 0,void 0,function*(){yield A.run(m)})}}class Y extends G{constructor(A){super(Y.ID,A,A?"separator text":"separator");this.checked=!1,this.enabled=!1}}Y.ID="vs.actions.separator";class X{constructor(A,m,f,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=A,this.label=m,this.class=p,this._actions=f}get actions(){return this._actions}dispose(){}run(){return Z(this,void 0,void 0,function*(){})}}class r extends G{constructor(){super(r.ID,U.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(Et,Pe,F){Et.exports={button:"button___1wy9m"}},"9Bee":function(Et,Pe,F){"use strict";var ne=F("DYRE"),Q=F("zeV3"),U=F("+L6B"),Z=F("2/Rp"),G=F("k1fw"),M=F("9og8"),Y=F("tJVT"),X=F("WmNS"),r=F.n(X),A=F("q1tI"),m=F.n(A),f=F("vg9a"),p=F("DlQD"),a=F.n(p),c=F("rUJ1");function s(ye,ae){var le=ye.match(/^(\s+)(?:```)/);if(le===null)return ae;var me=le[1];return ae.split(`
`).map(function(Ce){var de=Ce.match(/^\s+/);if(de===null)return Ce;var pe=Object(Y.a)(de,1),De=pe[0];return De.length>=me.length?Ce.slice(me.length):Ce}).join(`
`)}var i=[],t=["<ul>"],u=new a.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){i.length=0,t=["<ul>"]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(ye,ae,le,me){if(ae>=ye.length||ye[ae].level<=le)return ae;var Ce=ye[ae];me.push("<li><a href='#"+Ce.anchor+"'>"+Ce.text+"</a>"),ae++;var de=[];return ae=S(ye,ae,Ce.level,de),de.length>0&&(me.push("<ul>"),de.forEach(function(pe){me.push(pe)}),me.push("</ul>")),me.push("</li>"),ae=S(ye,ae,le,me),ae}function D(){return S(i,0,0,t),t.push("</ul>"),t.join("")}var I={heading:function(ae){var le=o.exec(ae);if(le)return{type:"heading",raw:le[0],depth:le[1].length,text:le[2]}},fences:function(ae){var le=this.rules.block.fences.exec(ae);if(le){var me=le[0],Ce=s(me,le[3]||""),de=le[2]?le[2].trim():le[2];if(["latex","katex","math"].indexOf(de)>=0){var pe=g(),De=Ce;Ce=pe,h[pe]={type:"block",expression:De}}return{type:"code",raw:me,lang:de,text:Ce}}}},E=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,g=function(){return"__special_katext_id_".concat(x++,"__")},h={};function O(){return h}function w(){x=0,h={}}function b(ye){return ye=ye.replace(E,function(ae,le){var me=g();return h[me]={type:"inline",expression:le},me}),ye}var W=u.listitem;u.listitem=function(ye){return W(b(ye))};var j=u.paragraph;u.paragraph=function(ye){return j(b(ye))};var C=u.tablecell;u.tablecell=function(ye,ae){return C(b(ye),ae)},u.code=function(ye,ae,le){var me=(ae||"").match(/\S*/)[0];return me?["latex","katex","math"].indexOf(me)>=0?"<p class='editormd-tex'>".concat(ye,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ae,'">').concat(le?ye:Object(c.escape)(ye,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(le?ye:Object(c.escape)(ye,!0))+"</code></pre>"},u.heading=function(ye,ae,le){var me=this.options.headerPrefix+le.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:me,level:ae,text:ye}),"<h"+ae+' id="'+me+'">'+ye+"</h"+ae+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:I,renderer:u});var B=a.a,k=F("SJMd"),y=F("ulZh"),H=F.n(y),J=F("m3rI"),se=F("Oy/b"),fe=F("p5ED"),ve=F("ErOA"),Se=F("STEk");/* **********************************
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 Ue=function(ye,ae){return(Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(le,me){le.__proto__=me}||function(le,me){for(var Ce in me)Object.prototype.hasOwnProperty.call(me,Ce)&&(le[Ce]=me[Ce])})(ye,ae)};function Te(ye,ae){if(typeof ae!="function"&&ae!==null)throw new TypeError("Class extends value "+String(ae)+" is not a constructor or null");function le(){this.constructor=ye}Ue(ye,ae),ye.prototype=ae===null?Object.create(ae):(le.prototype=ae.prototype,new le)}function Ie(ye,ae,le,me){return new(le||(le=Promise))(function(Ce,de){function pe(Me){try{ue(me.next(Me))}catch(We){de(We)}}function De(Me){try{ue(me.throw(Me))}catch(We){de(We)}}function ue(Me){var We;Me.done?Ce(Me.value):(We=Me.value,We instanceof le?We:new le(function(lt){lt(We)})).then(pe,De)}ue((me=me.apply(ye,ae||[])).next())})}function be(ye,ae){var le,me,Ce,de,pe={label:0,sent:function(){if(1&Ce[0])throw Ce[1];return Ce[1]},trys:[],ops:[]};return de={next:De(0),throw:De(1),return:De(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function De(ue){return function(Me){return function(We){if(le)throw new TypeError("Generator is already executing.");for(;pe;)try{if(le=1,me&&(Ce=2&We[0]?me.return:We[0]?me.throw||((Ce=me.return)&&Ce.call(me),0):me.next)&&!(Ce=Ce.call(me,We[1])).done)return Ce;switch(me=0,Ce&&(We=[2&We[0],Ce.value]),We[0]){case 0:case 1:Ce=We;break;case 4:return pe.label++,{value:We[1],done:!1};case 5:pe.label++,me=We[1],We=[0];continue;case 7:We=pe.ops.pop(),pe.trys.pop();continue;default:if(!(Ce=pe.trys,(Ce=Ce.length>0&&Ce[Ce.length-1])||We[0]!==6&&We[0]!==2)){pe=0;continue}if(We[0]===3&&(!Ce||We[1]>Ce[0]&&We[1]<Ce[3])){pe.label=We[1];break}if(We[0]===6&&pe.label<Ce[1]){pe.label=Ce[1],Ce=We;break}if(Ce&&pe.label<Ce[2]){pe.label=Ce[2],pe.ops.push(We);break}Ce[2]&&pe.ops.pop(),pe.trys.pop();continue}We=ae.call(ye,pe)}catch(lt){We=[6,lt],me=0}finally{le=Ce=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([ue,Me])}}}var q=function(){function ye(){}return ye.addKey=function(ae){ye.key=ae},Object.defineProperty(ye,"isLicensed",{get:function(){return!!ye.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ye.key)},enumerable:!1,configurable:!0}),ye}(),_=function(){function ye(){}return ye.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ye.setAttributes=function(ae,le){for(var me=0,Ce=le;me<Ce.length;me++){var de=Ce[me],pe=de[0],De=de[1];ae.setAttribute(pe,De)}},ye.createRect=function(ae,le,me){var Ce=document.createElementNS("http://www.w3.org/2000/svg","rect");return Ce.setAttribute("width",ae.toString()),Ce.setAttribute("height",le.toString()),me&&ye.setAttributes(Ce,me),Ce},ye.createLine=function(ae,le,me,Ce,de){var pe=document.createElementNS("http://www.w3.org/2000/svg","line");return pe.setAttribute("x1",ae.toString()),pe.setAttribute("y1",le.toString()),pe.setAttribute("x2",me.toString()),pe.setAttribute("y2",Ce.toString()),de&&ye.setAttributes(pe,de),pe},ye.createPolygon=function(ae,le){var me=document.createElementNS("http://www.w3.org/2000/svg","polygon");return me.setAttribute("points",ae),le&&ye.setAttributes(me,le),me},ye.createCircle=function(ae,le){var me=document.createElementNS("http://www.w3.org/2000/svg","circle");return me.setAttribute("cx",(ae/2).toString()),me.setAttribute("cy",(ae/2).toString()),me.setAttribute("r",ae.toString()),le&&ye.setAttributes(me,le),me},ye.createEllipse=function(ae,le,me){var Ce=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Ce.setAttribute("cx",(ae/2).toString()),Ce.setAttribute("cy",(le/2).toString()),Ce.setAttribute("rx",(ae/2).toString()),Ce.setAttribute("ry",(le/2).toString()),me&&ye.setAttributes(Ce,me),Ce},ye.createGroup=function(ae){var le=document.createElementNS("http://www.w3.org/2000/svg","g");return ae&&ye.setAttributes(le,ae),le},ye.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ye.createMarker=function(ae,le,me,Ce,de,pe,De){var ue=document.createElementNS("http://www.w3.org/2000/svg","marker");return ye.setAttributes(ue,[["id",ae],["orient",le],["markerWidth",me.toString()],["markerHeight",Ce.toString()],["refX",de.toString()],["refY",pe.toString()]]),ue.appendChild(De),ue},ye.createText=function(ae){var le=document.createElementNS("http://www.w3.org/2000/svg","text");return le.setAttribute("x","0"),le.setAttribute("y","0"),ae&&ye.setAttributes(le,ae),le},ye.createTSpan=function(ae,le){var me=document.createElementNS("http://www.w3.org/2000/svg","tspan");return me.textContent=ae,le&&ye.setAttributes(me,le),me},ye.createImage=function(ae){var le=document.createElementNS("http://www.w3.org/2000/svg","image");return ae&&ye.setAttributes(le,ae),le},ye.createPoint=function(ae,le){var me=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return me.x=ae,me.y=le,me},ye.createPath=function(ae,le){var me=document.createElementNS("http://www.w3.org/2000/svg","path");return me.setAttribute("d",ae),le&&ye.setAttributes(me,le),me},ye.createElement=function(ae,le){var me=document.createElementNS("http://www.w3.org/2000/svg",ae);return le&&ye.setAttributes(me,le),me},ye.getHollowRectanglePath=function(ae,le,me,Ce,de,pe,De,ue){return"M"+ae+","+le+"V"+(le+Ce)+"H"+(ae+me)+"V"+le+"H"+de+"V"+pe+"H"+(de+De)+"V"+(pe+ue)+"H"+de+"V"+le+"Z"},ye}(),L=function(){function ye(ae){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ae+"_"}return Object.defineProperty(ye.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ye.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(ye.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ye.prototype.addClass=function(ae){return this.styleSheet===void 0&&this.addStyleSheet(),ae.name=""+this.classNamePrefix+ae.localName,this.classes.push(ae),this.styleSheet.sheet.insertRule("."+ae.name+" {"+ae.style+"}",this.styleSheet.sheet.cssRules.length),ae},ye.prototype.addRule=function(ae){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ae),this.styleSheet.sheet.insertRule(ae.selector+" {"+ae.style+"}",this.styleSheet.sheet.cssRules.length)},ye.prototype.addStyleSheet=function(){var ae;this.styleSheet=document.createElement("style"),((ae=this.styleSheetRoot)!==null&&ae!==void 0?ae:document.head).appendChild(this.styleSheet),this.addRule(new z("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new z("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new z("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ee("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ee("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ye.prototype.removeStyleSheet=function(){var ae;this.styleSheet&&(((ae=this.styleSheetRoot)!==null&&ae!==void 0?ae:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ye}(),z=function(ye,ae){this.selector=ye,this.style=ae},ee=function(ye,ae){this.localName=ye,this.style=ae},$=function(){function ye(){this.blocks=[],this.display=""}return ye.prototype.addButtonBlock=function(ae){ae.className=this.blockClassName,ae.buttonClassName=this.buttonClassName,ae.buttonColorsClassName=this.buttonColorsClassName,ae.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(ae)},ye.prototype.addElementBlock=function(ae){ae.className===void 0&&(ae.className=this.blockClassName),this.blocks.push(ae)},ye.prototype.getUI=function(){var ae=document.createElement("div");return ae.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,ae.style.display=this.display,this.blocks.forEach(function(le){return ae.appendChild(le.getUI())}),ae},ye}(),Ee=function(){function ye(){}return ye.prototype.getUI=function(){var ae=document.createElement("div");if(ae.className=this.className,this.minWidth!==void 0&&(ae.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":ae.style.justifyContent="flex-start";break;case"center":ae.style.justifyContent="center";break;case"end":ae.style.justifyContent="flex-end"}return ae.style.whiteSpace="nowrap",ae},ye}(),Be=function(ye){function ae(){var le=ye!==null&&ye.apply(this,arguments)||this;return le.buttons=[],le}return Te(ae,ye),ae.prototype.addButton=function(le){le.className=this.buttonClassName,le.colorsClassName=this.buttonColorsClassName,le.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(le)},ae.prototype.getUI=function(){var le=ye.prototype.getUI.call(this);return this.buttons.forEach(function(me){return le.appendChild(me.getUI())}),le},ae}(Ee),nt=function(){function ye(ae,le){this._isActive=!1,this._isHidden=!1,this._icon=ae,this.title=le,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ye.prototype,"icon",{get:function(){return this._icon},set:function(ae){this._icon=ae,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isActive",{get:function(){return this._isActive},set:function(ae){this._isActive=ae,this.adjustClassName()},enumerable:!1,configurable:!0}),ye.prototype.getUI=function(){var ae=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 ae.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ye.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,"")))},ye.prototype.hide=function(){this._isHidden=!0},ye}(),we=function(ye){function ae(){var le=ye!==null&&ye.apply(this,arguments)||this;return le.elements=[],le}return Te(ae,ye),ae.prototype.addElement=function(le){this.elements.push(le)},ae.prototype.getUI=function(){var le=ye.prototype.getUI.call(this);return this.elements.forEach(function(me){return le.appendChild(me)}),le},ae}(Ee),Ne=function(){function ye(ae,le){this.horizontal=ae,this.vertical=le}return Object.defineProperty(ye.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ye.prototype.getVerticalLength=function(ae){return ae/this.ratio},ye.prototype.getHorizontalLength=function(ae){return ae*this.ratio},ye}(),Ye=function(){function ye(){}return ye.getIcon=function(ae,le){if(ae>0&&le>0){var me=new Ne(ae,le),Ce=me.ratio>=1?20:me.getHorizontalLength(20),de=me.ratio<1?20:me.getVerticalLength(20),pe=document.createElementNS("http://www.w3.org/2000/svg","svg");pe.setAttribute("xmlns","http://www.w3.org/2000/svg"),pe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(pe);var De=_.createDefs();pe.appendChild(De);var ue=_.createElement("clipPath",[["id","text-bg-clip"]]);De.appendChild(ue);var Me=_.createPath(_.getHollowRectanglePath((24-Ce)/2,(24-de)/2,Ce,de,(24-Ce)/2+2,(24-de)/2+2,Ce-4,de-4));pe.appendChild(Me);var We=_.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);We.appendChild(_.createTSpan(ae+":"+le)),pe.appendChild(We);var lt=We.getBBox();_.setAttributes(We,[["x",((24-lt.width)/2).toString()],["y",((24-lt.height)/2-lt.y).toString()]]);var Ct=_.createPath(_.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(lt.width))/2,(24-Math.ceil(lt.height))/2,Math.ceil(lt.width),Math.ceil(lt.height)));return ue.appendChild(Ct),_.setAttributes(Me,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(pe),pe.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>'},ye}(),Xe=function(ye){function ae(le,me,Ce){var de=ye.call(this,le,me)||this;return de.isDropdownOpen=!1,de.onClick=de.dropdownButtonClicked,de.dropdownButtons=Ce,de}return Te(ae,ye),ae.prototype.setupDropdown=function(){var le=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(me){me.className=le.className,me.colorsClassName=le.colorsClassName,le.dropdownBlock.appendChild(me.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ae.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ae.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ae.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ae.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ae.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ae}(nt),ht=function(){function ye(ae,le){this.GRIP_SIZE=10,this.color=ae,this.fillColor=le,this.visual=_.createGroup(),this.visual.appendChild(_.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ye.prototype.ownsTarget=function(ae){return ae===this.visual||ae===this.visual.childNodes[0]||ae===this.visual.childNodes[1]},ye.prototype.setCenter=function(ae,le){this.visual.childNodes.forEach(function(me){return _.setAttributes(me,[["cx",ae.toString()],["cy",le.toString()]])})},ye}(),wt=function(){function ye(ae,le,me,Ce){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ae,this.canvasHeight=le,this.margin=me,this.container=Ce,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(ye.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ae){this._aspectRatio=ae,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ae){this._isGridVisible=ae,this.gridContainer&&_.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ae){this._zoomFactor=ae,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ye.prototype.open=function(){var ae=this;this.cropShadeElement=_.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=_.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var le=0;le<this.numberOfGridLines;le++)this.horizontalGridLines.push(_.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(_.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(me){return ae.gridContainer.appendChild(me)}),this.verticalGridLines.forEach(function(me){return ae.gridContainer.appendChild(me)}),this.cropRectElement=_.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ye.prototype.setCropRectangle=function(ae){this.cropRect=ae;var le=Object.assign({},this.cropRect);this.zoomFactor!==1&&(le.width=this.cropRect.width*this.zoomFactor,le.height=this.cropRect.height*this.zoomFactor,le.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-le.width/2,le.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-le.height/2),_.setAttributes(this.cropRectElement,[["x",le.x.toString()],["y",le.y.toString()],["width",le.width.toString()],["height",le.height.toString()]]);var me=le.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(de,pe){var De=le.y+me*(pe+1);_.setAttributes(de,[["x1",""+le.x],["y1",""+De],["x2",""+(le.x+le.width)],["y2",""+De]])});var Ce=le.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(de,pe){var De=le.x+Ce*(pe+1);_.setAttributes(de,[["x1",""+De],["y1",""+le.y],["x2",""+De],["y2",""+(le.y+le.height)]])}),_.setAttributes(this.cropShadeElement,[["d",_.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,le.x,le.y,le.width,le.height)]]),this.topLeftGrip.setCenter(le.x,le.y),this.topRightGrip.setCenter(le.x+le.width,le.y),this.bottomLeftGrip.setCenter(le.x,le.y+le.height),this.bottomRightGrip.setCenter(le.x+le.width,le.y+le.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ye.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)},ye.prototype.clientToLocalCoordinates=function(ae,le){var me=this.container.getBoundingClientRect();return{x:ae-me.left+this.margin,y:le-me.top+this.margin}},ye.prototype.onPointerDown=function(ae){this.container.setPointerCapture(ae.pointerId),this.previousPoint=this.clientToLocalCoordinates(ae.clientX,ae.clientY),this.cropRectElement===ae.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ae.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ae.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ae.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ae.target)&&(this.activeGrip=this.bottomRightGrip)},ye.prototype.onPointerMove=function(ae){if(this.isMoving)this.move(this.clientToLocalCoordinates(ae.clientX,ae.clientY));else if(this.activeGrip){var le=this.clientToLocalCoordinates(ae.clientX,ae.clientY);this.resize(le)}ae.preventDefault()},ye.prototype.onPointerUp=function(ae){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ae.pointerId)},ye.prototype.move=function(ae){var le=ae.x-this.previousPoint.x,me=ae.y-this.previousPoint.y;this.zoomFactor!==1&&(le=-le/this.zoomFactor,me=-me/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+le),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+me),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ae},ye.prototype.resize=function(ae){var le=Object.assign({},this.cropRect),me=ae.x-this.previousPoint.x,Ce=ae.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:le.x+me<this.margin&&(me=this.margin-le.x),le.x+=me,le.width=this.cropRect.x+this.cropRect.width-le.x;break;case this.bottomRightGrip:case this.topRightGrip:le.width+me>this.canvasWidth*this.zoomFactor&&(me=this.canvasWidth*this.zoomFactor-le.width),le.width+=me}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(le.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(me),le.height=this.aspectRatio.getVerticalLength(le.width)):(le.y+=Ce,le.height=this.cropRect.y+this.cropRect.height-le.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?le.height=this.aspectRatio.getVerticalLength(le.width):le.height+=Ce}le.width<10&&(le.x=this.cropRect.x,le.width=10),le.height<10&&(le.y=this.cropRect.y,le.height=10),this.previousPoint=ae,le.x>=this.margin&&le.y>=this.margin&&le.x-this.margin+le.width<=this.canvasWidth&&le.y-this.margin+le.height<=this.canvasHeight&&(this.cropRect=le,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ye.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ae=this.cropRect.x+this.cropRect.width/2,le=this.cropRect.y+this.cropRect.height/2,me=this.aspectRatio.getHorizontalLength(this.cropRect.height),Ce=this.aspectRatio.getVerticalLength(this.cropRect.width);me/this.canvasWidth<Ce/this.canvasHeight?this.cropRect.width=me:this.cropRect.height=Ce,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=ae-this.cropRect.width/2,this.cropRect.y=le-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)}},ye.prototype.getRescaledRect=function(ae,le,me,Ce,de,pe){var De=me/ae,ue=Ce/le;return{x:(de.x-pe)*De+pe,y:(de.y-pe)*ue+pe,width:de.width*De,height:de.height*ue}},ye.prototype.scaleCanvas=function(ae,le){var me=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ae,le,this.cropRect,this.margin);this.canvasWidth=ae,this.canvasHeight=le,this.onCropChange&&this.onCropChange(me),this.setCropRectangle(me)},ye}(),Bt=function(){function ye(ae){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ae,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(ye.prototype,"angle",{get:function(){return this._angle},set:function(ae){this._angle=ae,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ye.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},ye.prototype.onPointerDown=function(ae){this.controlContainer.setPointerCapture(ae.pointerId),this.isDragging=!0,this.previousPoint={x:ae.clientX,y:ae.clientY}},ye.prototype.onPointerMove=function(ae){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ae.clientX-this.previousPoint.x)/5),this.previousPoint.x=ae.clientX)},ye.prototype.onPointerUp=function(ae){this.isDragging&&this.onAngleChange&&this.onAngleChange((ae.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ae.pointerId)},ye.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ae=this.angleLabelText.getBBox();_.setAttributes(this.angleLabelElement,[["x",((this.width-ae.width)/2).toString()],["y",(this.height/2).toString()]])}},ye.prototype.positionScaleShape=function(){if(this.scaleShape){var ae=this.scaleShape.transform.baseVal.getItem(0);ae.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ae,0)}},ye.prototype.getVisual=function(){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg");ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),ae.setAttribute("width",this.width+"px"),ae.setAttribute("height",this.height+"px"),ae.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ae.style.flexShrink="0",document.body.appendChild(ae);for(var le="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,me=1;me<=this.width/5+10;me++){var Ce=me%5==0?this.height/3:this.height/6;le+="h4v"+-Ce+"h1v"+Ce}le+="v1H0Z",this.scaleShape=_.createPath(le);var de=_.createTransform();this.scaleShape.transform.baseVal.appendItem(de),ae.appendChild(this.scaleShape),this.angleLabelElement=_.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=_.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var pe=_.createTSpan("");return pe.innerHTML="&deg;",this.angleLabelElement.appendChild(pe),ae.appendChild(this.angleLabelElement),document.body.removeChild(ae),ae},ye}(),Wt=function(){function ye(){this.naturalSize=!1,this.imageType="image/png"}return ye.prototype.rasterize=function(ae,le,me,Ce,de,pe,De){var ue=this;return new Promise(function(Me){var We=document.createElement("canvas");We.width=ae.width.baseVal.value-2*Ce,We.height=ae.height.baseVal.value-2*Ce;var lt=1,Ct=1;ue.naturalSize===!0?(lt=le.naturalWidth/(ae.width.baseVal.value-2*Ce)/pe,Ct=le.naturalHeight/(ae.height.baseVal.value-2*Ce)/De,We.width=le.naturalWidth/pe,We.height=le.naturalHeight/De):ue.width!==void 0&&ue.height!==void 0&&(lt=ue.width/me.width,Ct=ue.height/me.height,We.width*=lt,We.height*=Ct);var Ot=We.getContext("2d");Ot.translate(We.width/2,We.height/2),Ot.rotate(de*Math.PI/180),Ot.scale(pe,De),Ot.translate(-We.width/2,-We.height/2),Ot.drawImage(le,0,0,We.width,We.height);var Nt=document.createElement("canvas");Nt.width=me.width*lt,Nt.height=me.height*Ct,Nt.getContext("2d").putImageData(Ot.getImageData((me.x-Ce)*lt,(me.y-Ce)*Ct,me.width*lt,me.height*Ct),0,0),Me(Nt.toDataURL(ue.imageType,ue.imageQuality))})},ye}(),an=function(){function ye(ae){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=ye.instanceCounter++,this.styles=new L(this.instanceNo),this.target=ae,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(ye.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ae){this._zoomToCropEnabled=ae,ae?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ae){this._isGridVisible=ae,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ae){this._gridLines=ae,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ae){this._rotationAngle=ae,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"aspectRatio",{get:function(){var ae;return(ae=this._aspectRatio)!==null&&ae!==void 0?ae:this.aspectRatios[0]},set:function(ae){this._aspectRatio=ae},enumerable:!1,configurable:!0}),ye.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},ye.prototype.show=function(){this.showUI(),this.open()},ye.prototype.close=function(ae){ae===void 0&&(ae=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ae||this.closeEventListeners.forEach(function(le){return le()}),this._isOpen=!1)},ye.prototype.addRenderEventListener=function(ae){this.renderEventListeners.push(ae)},ye.prototype.removeRenderEventListener=function(ae){this.renderEventListeners.indexOf(ae)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ae),1)},ye.prototype.addCloseEventListener=function(ae){this.closeEventListeners.push(ae)},ye.prototype.removeCloseEventListener=function(ae){this.closeEventListeners.indexOf(ae)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ae),1)},ye.prototype.setupResizeObserver=function(){var ae=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ae.resize(ae.target.clientWidth,ae.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))},ye.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ae=1*this.target.clientWidth/this.target.clientHeight,le=this.contentDiv.clientWidth/ae>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ae:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,me=le+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/ae;this.resize(le,me)}},ye.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ye.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",_.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ye.prototype.resize=function(ae,le){this.imageWidth=Math.round(ae),this.imageHeight=Math.round(le),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()},ye.prototype.setEditingTarget=function(){var ae=document.createElement("canvas");ae.width=this.target.naturalWidth,ae.height=this.target.naturalHeight,ae.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var le=ae.toDataURL();_.setAttributes(this.editingTarget,[["href",le]]),this.setEditingTargetSize()},ye.prototype.setTopLeft=function(){var ae=this.target.getBoundingClientRect(),le=this.editorCanvas.getBoundingClientRect();this.left=ae.left-le.left-this.CANVAS_MARGIN,this.top=ae.top-le.top-this.CANVAS_MARGIN},ye.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=_.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=_.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=_.createGroup(),this.editingTargetRotationScaleContainer=_.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var ae=_.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(ae);var le=_.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(le),this.editingTargetContainer=_.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)},ye.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ye.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=_.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new wt(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()},ye.prototype.zoomToCrop=function(){if(this.cropRect){var ae=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,le=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=ae+"px "+le+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-ae+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-le+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ye.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)},ye.prototype.cropRectChanged=function(ae){this.cropRect=ae,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ye.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ye.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"},ye.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ye.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 ae=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,le=this.target.offsetTop>ae+this.CANVAS_MARGIN?this.target.offsetTop-(ae+this.CANVAS_MARGIN):0;this.coverDiv.style.top=le+"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},ye.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ye.prototype.addTopToolbar=function(){var ae=this;this.topToolbar=new $,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 le=new Be;le.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(le);var me=[];this.aspectRatios.forEach(function(Ct){var Ot=new nt(Ye.getIcon(Ct.horizontal,Ct.vertical),Ct.horizontal===0&&Ct.vertical===0?"FREE":Ct.horizontal+":"+Ct.vertical);Ot.onClick=function(){return ae.ratioButtonClicked(Ct)},me.push(Ot)}),this.aspectRatioButton=new Xe(Ye.getIcon(0,0),"Aspect ratio",me),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,le.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Ce=new nt('<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");Ce.isActive=this.isGridVisible,Ce.onClick=function(){ae.isGridVisible=!ae.isGridVisible,Ce.isActive=ae.isGridVisible},le.addButton(Ce);var de=new nt('<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(de.isActive=this.zoomToCropEnabled,de.onClick=function(){ae.zoomToCropEnabled=!ae.zoomToCropEnabled,de.isActive=ae.zoomToCropEnabled},le.addButton(de),!q.isLicensed){var pe=new we;this.topToolbar.addElementBlock(pe);var De=document.createElement("div");De.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ue=document.createElement("a");ue.style.color="currentColor",ue.href="https://markerjs.com/products/cropro",ue.target="_blank",ue.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>',De.appendChild(ue),pe.addElement(De)}var Me=new Be;Me.minWidth=3*this.toolbarHeight+"px",Me.contentAlign="end",this.topToolbar.addButtonBlock(Me);var We=new nt('<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");We.onClick=this.startRenderAndClose,Me.addButton(We),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(We.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var lt=new nt('<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");lt.onClick=this.close,Me.addButton(lt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(lt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ye.prototype.addBottomToolbar=function(){var ae=this;this.bottomToolbar=new $,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 le=new Be;le.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(le);var me=new nt('<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");me.onClick=this.rotateLeftButtonClicked,le.addButton(me);var Ce=new nt('<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");Ce.onClick=this.rotateRightButtonClicked,le.addButton(Ce);var de=new we;de.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(de),this.straightener=new Bt("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Me){ae.rotateBy(Me),ae.straightener.angle=ae.rotationAngle},de.addElement(this.straightener.getUI());var pe=new Be;pe.minWidth=2*this.toolbarHeight+"px",pe.contentAlign="end",this.bottomToolbar.addButtonBlock(pe);var De=new nt('<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");De.onClick=this.flipHorizontallyButtonClicked,pe.addButton(De);var ue=new nt('<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");ue.onClick=this.flipVerticallyButtonClicked,pe.addButton(ue)},ye.prototype.ratioButtonClicked=function(ae){this.aspectRatio=ae,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ye.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ye.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ye.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ne(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ye.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ye.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ye.prototype.restoreState=function(ae){if(ae){var le=this.cropLayer.getRescaledRect(ae.width,ae.height,this.imageWidth,this.imageHeight,ae.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(le),this.cropRectChanged(le),this.flippedHorizontally=ae.flippedHorizontally,this.flippedVertically=ae.flippedVertically,this.applyFlip(),this.rotationAngle=ae.rotationAngle,this.applyRotation()}},ye.prototype.clientToLocalCoordinates=function(ae,le){var me=this.cropImage.getBoundingClientRect();return{x:ae-me.left,y:le-me.top}},ye.prototype.onWindowResize=function(){this.positionUI()},ye.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ae=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ae+"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()},ye.prototype.rotateLeftButtonClicked=function(){var ae=this.rotationAngle-90;this.rotationAngle%90!=0&&(ae+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ae)},ye.prototype.rotateRightButtonClicked=function(){var ae=this.rotationAngle+90;this.rotationAngle%90!=0&&(ae-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ae)},ye.prototype.rotateTo=function(ae){ae=(ae=ae>180?ae-360:ae)<=-180?ae+360:ae,this.rotationAngle=ae,this.applyRotation()},ye.prototype.rotateBy=function(ae){this.rotateTo((this.rotationAngle+ae)%360)},ye.prototype.applyRotation=function(){var ae=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var le=this.editingTargetRotationContainer.transform.baseVal.getItem(0);le.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(le,0);var me=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/me.width,this.imageHeight/me.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ae},ye.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ye.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ye.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ye.prototype.startRenderAndClose=function(){return Ie(this,void 0,void 0,function(){var ae,le;return be(this,function(me){switch(me.label){case 0:return[4,this.render()];case 1:return ae=me.sent(),le=this.getState(),this.renderEventListeners.forEach(function(Ce){return Ce(ae,le)}),this.close(!0),[2]}})})},ye.prototype.render=function(){return Ie(this,void 0,void 0,function(){var ae;return be(this,function(le){switch(le.label){case 0:return(ae=new Wt).naturalSize=this.renderAtNaturalSize,ae.imageType=this.renderImageType,ae.imageQuality=this.renderImageQuality,ae.width=this.renderWidth,ae.height=this.renderHeight,this.unzoomFromCrop(),_.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ae.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 le.sent(),[4,ae.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,le.sent()]}})})},ye.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ee("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 ee("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ee("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var ae=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ee("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*ae)+`px;
height: `+(this.toolbarHeight-2*ae)+`px;
padding: `+ae+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ee("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ee("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new z("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new z("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ee("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 ee("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ee("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 ee("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*ae)+`px;
padding: `+ae+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ee("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},ye.instanceCounter=0,ye}(),Yt=F("8hTe"),qe=F.n(Yt),Qe=/<pre[^>]*>/g;function bt(ye){var ae=document.createElement("div");return ae.innerHTML=ye,ae.childNodes.length===0?"":ae.childNodes[0].nodeValue}var xt=Pe.a=function(ye){var ae=ye.value,le=ae===void 0?"":ae,me=ye.edit,Ce=me===void 0?!1:me,de=ye.className,pe=ye.showTextOnly,De=ye.showLines,ue=ye.replaces,Me=ye.zoomImg,We=ye.hasMask,lt=ye.style,Ct=lt===void 0?{}:lt,Ot=ye.stylesPrev,Nt=Ot===void 0?{}:Ot,ir=String(le),Jt=Object(A.useRef)(),cn=Object(A.useRef)(),rn=Object(A.useState)(""),In=Object(Y.a)(rn,2),ur=In[0],mr=In[1],Qn=Object(A.useState)("office"),yr=Object(Y.a)(Qn,2),Sr=yr[0],Nn=yr[1],Ar=function(){var Fe=new an(cn.current);Fe.displayMode="popup",Fe.addRenderEventListener(function(){var pt=Object(M.a)(r.a.mark(function Le(xe){var ge;return r.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:return Jt.current.style.display="none",Lt.next=3,Object(ve.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:xe}});case 3:ge=Lt.sent,ge!=null&&ge.id&&ue(cn.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(ge==null?void 0:ge.id,"?type=").concat(ge.content_type));case 5:case"end":return Lt.stop()}},Le)}));return function(Le){return pt.apply(this,arguments)}}()),Fe.show()},An=function(){var Fe=new Se.a(cn.current);Fe.settings.displayMode="popup",Fe.addEventListener("render",function(){var pt=Object(M.a)(r.a.mark(function Le(xe){var ge;return r.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:if(Jt.current.style.display="none",!cn.current){Lt.next=6;break}return Lt.next=4,Object(ve.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:xe.dataUrl}});case 4:ge=Lt.sent,ge!=null&&ge.id&&ue(cn.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(ge==null?void 0:ge.id,"?type=").concat(ge.content_type));case 6:case"end":return Lt.stop()}},Le)}));return function(Le){return pt.apply(this,arguments)}}()),Fe.show(),window.markerArea=Fe},Dn=Object(A.useMemo)(function(){Jt.current&&(Jt.current.style.zIndex=-1);try{var at=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Fe=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ir=ir.replace(at,"("+J.a.API_SERVER+"/api/attachments/").replace(Fe,'"'+J.a.API_SERVER+"/api/attachments/").replace(pt,'"'+J.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Hn){}var Le=B(ir),xe=O();if(ir.match(/\[TOC\]/)&&(Le=Le.replace("<p>[TOC]</p>",D()),R()),Le=Le.replace(/(__special_katext_id_\d+__)/g,function(Hn,Lt){var ke=xe[Lt],ut=ke.type,Re=ke.expression;return Object(se.renderToString)(bt(Re)||"",{displayMode:ut==="block",throwOnError:!1,output:"html"})}),Le=Le.replace(/▁/g,"\u2581\u2581\u2581"),w(),pe){var ge=document.createElement("div");return ge.innerHTML=Le,ge.innerText}return setTimeout(function(){return Lr()},500),Le},[ir]),qn=Object(A.useRef)();T.WebkitLineClamp=De,De&&(Ct=Object(G.a)(Object(G.a)({},Ct),T));function fr(at){var Fe=at.target;if(Fe.tagName.toUpperCase()==="IMG"){if(Me){var pt=Fe.getAttribute("src");mr(pt),Nn("image")}}else if(Fe.tagName.toUpperCase()==="A"){var Le=Fe.getAttribute("href");if(Le.indexOf("office")>-1)at.preventDefault(),mr(Le),Nn("office");else if(Le.indexOf("application/pdf")>-1)at.preventDefault(),mr(Le),Nn("pdf");else if(Le.indexOf("text/html")>-1)at.preventDefault(),mr(Le),Nn("html");else if(Le.startsWith("#")){at.preventDefault();var xe=document.getElementById(Le.replace("#",""));xe&&xe.scrollIntoView(!0)}}}var Lr=function(){var Fe,pt=(Fe=qn.current)===null||Fe===void 0?void 0:Fe.querySelectorAll("video");pt==null||pt.forEach(function(Le){if(Le.oncontextmenu=function(){return!1},Le.src.indexOf(".m3u8")>-1&&!Le.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var xe=new H.a;xe.loadSource(Le.src),xe.attachMedia(Le)}}})};Object(A.useEffect)(function(){if(qn.current&&Dn&&(Dn.match(Qe)&&window.PR.prettyPrint()),qn.current)return qn.current.addEventListener("click",fr),function(){qn.current.removeEventListener("click",fr),w(),R()}},[Dn,qn.current,fr]);var Or=function(Fe){if(!Ce)return;Fe.target.nodeName==="IMG"?(Jt.current.style.zIndex=1,Jt.current.style.display="flex",Jt.current.style.width=Fe.target.clientWidth+"px",Jt.current.style.height=Fe.target.clientHeight+"px",Jt.current.style.top=Fe.target.offsetTop+"px",Jt.current.style.left=Fe.target.offsetLeft+"px",cn.current.src=Fe.target.getAttribute("src")):Jt.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:qn,style:Object(G.a)({},Ct),className:"".concat(de||""," markdown-body ").concat(qe.a.mdBody),onMouseOver:Or,dangerouslySetInnerHTML:{__html:Dn}}),m.a.createElement("div",{ref:Jt,className:qe.a.button},m.a.createElement(Q.a,null,m.a.createElement(Z.a,{onClick:function(){return Ar()}},"\u88C1\u526A"),m.a.createElement(Z.a,{onClick:function(){return An()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:cn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(fe.a,{close:!0,data:ur,type:ur!=null&&ur.length?Sr:"",style:Object(G.a)({},Nt),onClose:function(){return mr("")}}))}},"9VGf":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return U});var ne=F("q1tI"),Q=F.n(ne);function U(Z,G){var M=Object(ne.useRef)();Object(ne.useEffect)(function(){M.current=Z}),Object(ne.useEffect)(function(){function Y(){M.current()}if(G!==null){var X=setInterval(Y,G);return function(){return clearInterval(X)}}},[G])}},"9z17":function(Et,Pe,F){"use strict";F.d(Pe,"b",function(){return S});var ne=F("g9YV"),Q=F("wCAj"),U=F("5NDa"),Z=F("5rEg"),G=F("y8nQ"),M=F("Vl3Y"),Y=F("2qtc"),X=F("kLXV"),r=F("7Kak"),A=F("9yH6"),m=F("9og8"),f=F("tJVT"),p=F("WmNS"),a=F.n(p),c=F("q1tI"),s=F.n(c),i=F("ie49"),t=F.n(i),u=F("HBuW"),o=function(x){var g=x.total,h=x.used,O=x.copy,w=x.canNotCopy,b=x.inPaper,W="";return O>0&&w>0?W="\u5176\u4E2D\u6709".concat(O,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236\uFF0C\u6709").concat(w,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236"):O>0&&w===0?W="\u5176\u4E2D\u6709".concat(O,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236"):O===0&&w>0&&(W="\u5176\u4E2D\u6709".concat(w,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236")),"\u5F53\u524D\u9009\u4E2D".concat(g,"\u4E2A\u5B9E\u8BAD\u4E2D\uFF0C\u6709").concat(h,"\u4E2A\u5B9E\u8BAD\u5DF2\u5728\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C").concat(W).concat(b?"\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4F7F\u7528\u8BD5\u5377\uFF1F":"")},R=function(x){return x?{reproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u91CD\u590D\u4F7F\u7528\u7684\u5B9E\u8BAD\u672A\u5F00\u542F\u590D\u5236\u6743\u9650\uFF0C\u82E5\u7EE7\u7EED\u4F7F\u7528\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD"}:{reproducible:"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\u548C\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F"}},T=function(x){var g=x.onCancel,h=x.onOk,O=x.visible,w=x.inPaper,b=x.renderData,W=x.type,j=Object(c.useState)(1),C=Object(f.a)(j,2),B=C[0],k=C[1],y=Object(c.useState)(!1),H=Object(f.a)(y,2),J=H[0],se=H[1],fe=Object(c.useMemo)(function(){return(b==null?void 0:b.total_num)===1&&(b==null?void 0:b.can_copy_num)===1},[b]);return s.a.createElement(s.a.Fragment,null,fe?s.a.createElement(X.a,{centered:!0,closable:!0,visible:O,title:"\u63D0\u793A",width:600,confirmLoading:J,onCancel:g,onOk:Object(m.a)(a.a.mark(function ve(){return a.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return se(!0),Ue.next=3,h(B);case 3:se(!1);case 4:case"end":return Ue.stop()}},ve)}))},s.a.createElement("div",{className:t.a.content,style:{marginBottom:20}},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u95EE\u662F\u5426\u590D\u5236\u6210\u65B0\u5B9E\u8BAD\u53D1\u9001\u81F3\u6559\u5B66\u8BFE\u5802\u4E2D\uFF1F"),s.a.createElement(A.a.Group,{value:B,onChange:function(Se){return k(Se.target.value)},className:t.a.content,style:{marginBottom:30}},s.a.createElement(A.a,{value:1,style:{color:"#464f66"}},"\u590D\u5236\u5B9E\u8BAD"),s.a.createElement(A.a,{value:0,style:{color:"#464f66"}},"\u4E0D\u590D\u5236\u5B9E\u8BAD")),s.a.createElement("div",{className:t.a.content,style:{marginBottom:10}},"\u8BF4\u660E\uFF1A"),s.a.createElement("div",{className:t.a.content},"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),s.a.createElement("div",{className:t.a.content},"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")):s.a.createElement(X.a,{centered:!0,closable:!0,visible:O,title:"\u63D0\u793A",width:600,onCancel:g,onOk:Object(m.a)(a.a.mark(function ve(){return a.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return se(!0),Ue.next=3,h(0);case 3:se(!1);case 4:case"end":return Ue.stop()}},ve)}))},s.a.createElement("div",{className:t.a.content},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F")))},S=function(){var x=Object(c.useState)(!1),g=Object(f.a)(x,2),h=g[0],O=g[1],w=Object(c.useState)(),b=Object(f.a)(w,2),W=b[0],j=b[1],C=function(){return O(!1)},B=function(){var k=Object(m.a)(a.a.mark(function y(H){var J;return a.a.wrap(function(fe){for(;;)switch(fe.prev=fe.next){case 0:return fe.next=2,Object(u.p)(H);case 2:if(J=fe.sent,!("status"in J)){fe.next=5;break}return fe.abrupt("return",!1);case 5:if(!(J.repeat_shixun_num===0)){fe.next=7;break}return fe.abrupt("return",!1);case 7:return j(J),O(!0),fe.abrupt("return",!0);case 10:case"end":return fe.stop()}},y)}));return function(H){return k.apply(this,arguments)}}();return[h,C,W,B]},D=function(x){var g=M.a.useForm(),h=Object(f.a)(g,1),O=h[0],w=Object(c.useState)(!1),b=Object(f.a)(w,2),W=b[0],j=b[1],C=x.onCancel,B=x.onOk,k=x.visible,y=x.inPaper,H=y===void 0?!1:y,J=x.renderData,se=x.type,fe=Object(c.useMemo)(function(){return H?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Ie,be){return s.a.createElement(s.a.Fragment,null,s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?be.stage_shixun_id:be.id),"is_copy"],initialValue:1},s.a.createElement(A.a.Group,null,s.a.createElement(A.a,{value:1},"\u662F"),s.a.createElement(A.a,{value:0},"\u5426"))),s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(Z.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Ie,be){return s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?be.stage_shixun_id:be.id),"is_use"],initialValue:1},s.a.createElement(A.a.Group,null,s.a.createElement(A.a,{value:1},"\u662F"),s.a.createElement(A.a,{value:0},"\u5426")))}},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Ie,be){return s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?be.stage_shixun_id:be.id),"is_copy"],initialValue:1},s.a.createElement(A.a.Group,null,s.a.createElement(A.a,{value:1},"\u662F"),s.a.createElement(A.a,{value:0},"\u5426")))}}]},[H]),ve=Object(c.useMemo)(function(){return H?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center",render:function(Ie,be){return s.a.createElement(s.a.Fragment,null,s.a.createElement("span",null,Ie),s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(Z.a,{type:"hidden"})),s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(Z.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center"},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Ie,be){return s.a.createElement(s.a.Fragment,null,s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_use"],initialValue:0},s.a.createElement(A.a.Group,null,s.a.createElement(A.a,{value:1},"\u662F"),s.a.createElement(A.a,{value:0},"\u5426"))),s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(Z.a,{type:"hidden"})))}}]},[H]),Se=Object(c.useMemo)(function(){return o({total:J==null?void 0:J.total_num,used:J==null?void 0:J.repeat_shixun_num,copy:J==null?void 0:J.can_copy_num,canNotCopy:J==null?void 0:J.no_copy_num,inPaper:H})},[J,H]),Ue=Object(c.useMemo)(function(){return R(H)},[H]);return s.a.createElement(X.a,{title:"\u5B9E\u8BAD\u91CD\u590D\u4F7F\u7528\u63D0\u793A",centered:!0,visible:k,confirmLoading:W,onOk:Object(m.a)(a.a.mark(function Te(){var Ie,be;return a.a.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return j(!0),Ie=O.getFieldsValue(),be=Object.keys(Ie).map(function(L){return{id:parseInt(L),is_use:Ie[L].is_use,is_copy:Ie[L].is_copy}}),_.next=5,B(be);case 5:j(!1);case 6:case"end":return _.stop()}},Te)})),onCancel:C,width:800,okText:"\u786E\u8BA4",className:t.a.antdModal,destroyOnClose:!0},s.a.createElement(M.a,{form:O,preserve:!1},s.a.createElement("div",{className:t.a.brief},Se),(J==null?void 0:J.can_copy_num)>0&&s.a.createElement("div",null,s.a.createElement("div",{className:t.a.contentTitle},"\u53EF\u590D\u5236\u5B9E\u8BAD"),s.a.createElement("div",{className:t.a.content},Ue.reproducible),s.a.createElement("div",{className:t.a.tips},s.a.createElement("div",null,"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),s.a.createElement("div",null,"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")),s.a.createElement(Q.a,{columns:fe,className:t.a.antdTable,dataSource:J==null?void 0:J.can_copy_list,rowKey:se==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})),(J==null?void 0:J.no_copy_num)>0&&s.a.createElement("div",null,s.a.createElement("div",{className:t.a.contentTitle},"\u4E0D\u53EF\u590D\u5236\u5B9E\u8BAD"),s.a.createElement("div",{className:t.a.content},Ue.irreproducible),s.a.createElement(Q.a,{columns:ve,className:t.a.antdTable,dataSource:J==null?void 0:J.no_copy_list,rowKey:se==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})),(J==null?void 0:J.no_use_list.length)>0&&(J==null?void 0:J.no_use_list.map(function(Te){return s.a.createElement("div",{key:se==="subject"?Te.stage_shixun_id:Te.id},s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?Te==null?void 0:Te.stage_shixun_id:Te.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(Z.a,{type:"hidden"})),s.a.createElement(M.a.Item,{name:["".concat(se==="subject"?Te==null?void 0:Te.stage_shixun_id:Te.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(Z.a,{type:"hidden"})))}))))},I=function(x){var g=x.modalType;return g==="multiple"?s.a.createElement(D,x):s.a.createElement(T,x)};Pe.a=I},BU3w:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return M});var ne=F("MNnm"),Q="rc-util-key";function U(Y){if(Y.attachTo)return Y.attachTo;var X=document.querySelector("head");return X||document.body}function Z(Y){var X,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var A=document.createElement("style");if((X=r.csp)===null||X===void 0?void 0:X.nonce){var m;A.nonce=(m=r.csp)===null||m===void 0?void 0:m.nonce}A.innerHTML=Y;var f=U(r),p=f.firstChild;return r.prepend&&f.prepend?f.prepend(A):r.prepend&&p?f.insertBefore(A,p):f.appendChild(A),A}var G=new Map;function M(Y,X){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=U(r);if(!G.has(A)){var m=Z("",r),f=m.parentNode;G.set(A,f),f.removeChild(m)}var p=Array.from(G.get(A).children).find(function(t){return t.tagName==="STYLE"&&t[Q]===X});if(p){var a,c;if(((a=r.csp)===null||a===void 0?void 0:a.nonce)&&p.nonce!==((c=r.csp)===null||c===void 0?void 0:c.nonce)){var s;p.nonce=(s=r.csp)===null||s===void 0?void 0:s.nonce}return p.innerHTML!==Y&&(p.innerHTML=Y),p}var i=Z(Y,r);return i[Q]=X,i}},Bd2K:function(Et,Pe,F){(function(ne){ne(F("VrN/"),F("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(r,A,m){if(m!=ne.Init&&m&&r.removeKeyMap("autoCloseTags"),!A)return;var f={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(f["'/'"]=function(p){return M(p)}),(typeof A!="object"||A.whenOpening!==!1)&&(f["'>'"]=function(p){return Z(p)}),r.addKeyMap(f)});var Q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],U=["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 Z(r){if(r.getOption("disableInput"))return ne.Pass;for(var A=r.listSelections(),m=[],f=r.getOption("autoCloseTags"),p=0;p<A.length;p++){if(!A[p].empty())return ne.Pass;var a=A[p].head,c=r.getTokenAt(a),s=ne.innerMode(r.getMode(),c.state),i=s.state,t=s.mode.xmlCurrentTag&&s.mode.xmlCurrentTag(i),u=t&&t.name;if(!u)return ne.Pass;var o=s.mode.configuration=="html",R=typeof f=="object"&&f.dontCloseTags||o&&Q,T=typeof f=="object"&&f.indentTags||o&&U;c.end>a.ch&&(u=u.slice(0,u.length-c.end+a.ch));var S=u.toLowerCase();if(!u||c.type=="string"&&(c.end!=a.ch||!/[\"\']/.test(c.string.charAt(c.string.length-1))||c.string.length==1)||c.type=="tag"&&t.close||c.string.indexOf("/")==a.ch-c.start-1||R&&Y(R,S)>-1||X(r,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(i)||[],u,a,!0))return ne.Pass;var D=typeof f=="object"&&f.emptyTags;if(D&&Y(D,u)>-1){m[p]={text:"/>",newPos:ne.Pos(a.line,a.ch+2)};continue}var I=T&&Y(T,S)>-1;m[p]={indent:I,text:">"+(I?`
`:"")+"</"+u+">",newPos:I?ne.Pos(a.line+1,0):ne.Pos(a.line,a.ch+1)}}for(var E=typeof f=="object"&&f.dontIndentOnAutoClose,p=A.length-1;p>=0;p--){var x=m[p];r.replaceRange(x.text,A[p].head,A[p].anchor,"+insert");var g=r.listSelections().slice(0);g[p]={head:x.newPos,anchor:x.newPos},r.setSelections(g),!E&&x.indent&&(r.indentLine(x.newPos.line,null,!0),r.indentLine(x.newPos.line+1,null,!0))}}function G(r,A){for(var m=r.listSelections(),f=[],p=A?"/":"</",a=r.getOption("autoCloseTags"),c=typeof a=="object"&&a.dontIndentOnSlash,s=0;s<m.length;s++){if(!m[s].empty())return ne.Pass;var i=m[s].head,t=r.getTokenAt(i),u=ne.innerMode(r.getMode(),t.state),o=u.state;if(A&&(t.type=="string"||t.string.charAt(0)!="<"||t.start!=i.ch-1))return ne.Pass;var R,T=u.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(T&&u.mode.name=="javascript")R=p+"script";else if(T&&u.mode.name=="css")R=p+"style";else{var S=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(o);if(!S||S.length&&X(r,S,S[S.length-1],i))return ne.Pass;R=p+S[S.length-1]}r.getLine(i.line).charAt(t.end)!=">"&&(R+=">"),f[s]=R}if(r.replaceSelections(f),m=r.listSelections(),!c)for(var s=0;s<m.length;s++)(s==m.length-1||m[s].head.line<m[s+1].head.line)&&r.indentLine(m[s].head.line)}function M(r){return r.getOption("disableInput")?ne.Pass:G(r,!0)}ne.commands.closeTag=function(r){return G(r)};function Y(r,A){if(r.indexOf)return r.indexOf(A);for(var m=0,f=r.length;m<f;++m)if(r[m]==A)return m;return-1}function X(r,A,m,f,p){if(!ne.scanForClosingTag)return!1;var a=Math.min(r.lastLine()+1,f.line+500),c=ne.scanForClosingTag(r,f,null,a);if(!c||c.tag!=m)return!1;for(var s=p?1:0,i=A.length-1;i>=0&&A[i]==m;i--)++s;f=c.to;for(var i=1;i<s;i++){var t=ne.scanForClosingTag(r,f,null,a);if(!t||t.tag!=m)return!1;f=t.to}return!0}})},BjJ7:function(Et,Pe,F){"use strict";F.d(Pe,"d",function(){return Q}),F.d(Pe,"c",function(){return U}),F.d(Pe,"e",function(){return Z}),F.d(Pe,"b",function(){return G}),F.d(Pe,"a",function(){return Y});var ne=F("m3rI");function Q(X){var r=!0;if(X.length>0){for(var A=0;A<X.length;A++)if(X[A].compile_success==0||!X[A].compile_success){r=!1;break}}else r=!1;return r}function U(X){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",A=[],m=0;m<X.length;m++){var f=X[m],p=r?"".concat(r,"/").concat(f.name):"".concat(f.name);A.push({title:f.name,isLeaf:!(f.type==="tree"),key:p})}return A}function Z(X,r,A){for(var m=0;m<X.length;m++){var f=X[m];if(f.key===r){f.children=A;break}f.children&&Z(f.children,r,A)}return X}function G(X,r,A){var m;return function(){var f=this,p=arguments,a=function(){m=null,A||X.apply(f,p)},c=A&&!m;clearTimeout(m),m=setTimeout(a,r),c&&X.apply(f,p)}}var M=!0,Y=ne.a.API_SERVER},"C+DQ":function(Et,Pe,F){},"C/vA":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return ne});function ne(Q){const U=this;let Z=!1,G;return function(){return Z||(Z=!0,G=Q.apply(U,arguments)),G}}},"Cg/j":function(Et,Pe,F){"use strict";F.d(Pe,"b",function(){return ne}),F.d(Pe,"a",function(){return Q}),F.d(Pe,"c",function(){return Z}),F.d(Pe,"d",function(){return G});var ne;(function(M){M.serviceIds=new Map,M.DI_TARGET="$di$target",M.DI_DEPENDENCIES="$di$dependencies";function Y(X){return X[M.DI_DEPENDENCIES]||[]}M.getServiceDependencies=Y})(ne||(ne={}));const Q=Z("instantiationService");function U(M,Y,X,r){Y[ne.DI_TARGET]===Y?Y[ne.DI_DEPENDENCIES].push({id:M,index:X,optional:r}):(Y[ne.DI_DEPENDENCIES]=[{id:M,index:X,optional:r}],Y[ne.DI_TARGET]=Y)}function Z(M){if(ne.serviceIds.has(M))return ne.serviceIds.get(M);const Y=function(X,r,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");U(Y,X,A,!1)};return Y.toString=()=>M,ne.serviceIds.set(M,Y),Y}function G(M){return function(Y,X,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");U(M,Y,r,!0)}}},DlQD:function(Et,Pe,F){(function(ne,Q){Et.exports=Q()})(this,function(){"use strict";function ne(le,me){for(var Ce=0;Ce<me.length;Ce++){var de=me[Ce];de.enumerable=de.enumerable||!1,de.configurable=!0,"value"in de&&(de.writable=!0),Object.defineProperty(le,de.key,de)}}function Q(le,me,Ce){return me&&ne(le.prototype,me),Ce&&ne(le,Ce),le}function U(le,me){if(!le)return;if(typeof le=="string")return Z(le,me);var Ce=Object.prototype.toString.call(le).slice(8,-1);if(Ce==="Object"&&le.constructor&&(Ce=le.constructor.name),Ce==="Map"||Ce==="Set")return Array.from(le);if(Ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ce))return Z(le,me)}function Z(le,me){(me==null||me>le.length)&&(me=le.length);for(var Ce=0,de=new Array(me);Ce<me;Ce++)de[Ce]=le[Ce];return de}function G(le,me){var Ce;if(typeof Symbol=="undefined"||le[Symbol.iterator]==null){if(Array.isArray(le)||(Ce=U(le))||me&&le&&typeof le.length=="number"){Ce&&(le=Ce);var de=0;return function(){return de>=le.length?{done:!0}:{done:!1,value:le[de++]}}}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 Ce=le[Symbol.iterator](),Ce.next.bind(Ce)}function M(le,me){return me={exports:{}},le(me,me.exports),me.exports}var Y=M(function(le){function me(){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 Ce(de){le.exports.defaults=de}le.exports={defaults:me(),getDefaults:me,changeDefaults:Ce}}),X=Y.defaults,r=Y.getDefaults,A=Y.changeDefaults,m=/[&<>"']/,f=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s=function(me){return c[me]};function i(le,me){if(me){if(m.test(le))return le.replace(f,s)}else if(p.test(le))return le.replace(a,s);return le}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(le){return le.replace(t,function(me,Ce){return Ce=Ce.toLowerCase(),Ce==="colon"?":":Ce.charAt(0)==="#"?Ce.charAt(1)==="x"?String.fromCharCode(parseInt(Ce.substring(2),16)):String.fromCharCode(+Ce.substring(1)):""})}var o=/(^|[^\[])\^/g;function R(le,me){le=le.source||le,me=me||"";var Ce={replace:function(pe,De){return De=De.source||De,De=De.replace(o,"$1"),le=le.replace(pe,De),Ce},getRegex:function(){return new RegExp(le,me)}};return Ce}var T=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(le,me,Ce){if(le){var de;try{de=decodeURIComponent(u(Ce)).replace(T,"").toLowerCase()}catch(pe){return null}if(de.indexOf("javascript:")===0||de.indexOf("vbscript:")===0||de.indexOf("data:")===0)return null}me&&!S.test(Ce)&&(Ce=h(me,Ce));try{Ce=encodeURI(Ce).replace(/%25/g,"%")}catch(pe){return null}return Ce}var I={},E=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(le,me){I[" "+le]||(E.test(le)?I[" "+le]=le+"/":I[" "+le]=W(le,"/",!0)),le=I[" "+le];var Ce=le.indexOf(":")===-1;return me.substring(0,2)==="//"?Ce?me:le.replace(x,"$1")+me:me.charAt(0)==="/"?Ce?me:le.replace(g,"$1")+me:le+me}var O={exec:function(){}};function w(le){for(var me=1,Ce,de;me<arguments.length;me++){Ce=arguments[me];for(de in Ce)Object.prototype.hasOwnProperty.call(Ce,de)&&(le[de]=Ce[de])}return le}function b(le,me){var Ce=le.replace(/\|/g,function(De,ue,Me){for(var We=!1,lt=ue;--lt>=0&&Me[lt]==="\\";)We=!We;return We?"|":" |"}),de=Ce.split(/ \|/),pe=0;if(de.length>me)de.splice(me);else for(;de.length<me;)de.push("");for(;pe<de.length;pe++)de[pe]=de[pe].trim().replace(/\\\|/g,"|");return de}function W(le,me,Ce){var de=le.length;if(de===0)return"";for(var pe=0;pe<de;){var De=le.charAt(de-pe-1);if(De===me&&!Ce)pe++;else if(De!==me&&Ce)pe++;else break}return le.substr(0,de-pe)}function j(le,me){if(le.indexOf(me[1])===-1)return-1;for(var Ce=le.length,de=0,pe=0;pe<Ce;pe++)if(le[pe]==="\\")pe++;else if(le[pe]===me[0])de++;else if(le[pe]===me[1]&&(de--,de<0))return pe;return-1}function C(le){le&&le.sanitize&&!le.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 B={escape:i,unescape:u,edit:R,cleanUrl:D,resolveUrl:h,noopTest:O,merge:w,splitCells:b,rtrim:W,findClosingBracket:j,checkSanitizeDeprecation:C},k=Y.defaults,y=B.rtrim,H=B.splitCells,J=B.escape,se=B.findClosingBracket;function fe(le,me,Ce){var de=me.href,pe=me.title?J(me.title):null,De=le[1].replace(/\\([\[\]])/g,"$1");return le[0].charAt(0)!=="!"?{type:"link",raw:Ce,href:de,title:pe,text:De}:{type:"image",raw:Ce,href:de,title:pe,text:J(De)}}function ve(le,me){var Ce=le.match(/^(\s+)(?:```)/);if(Ce===null)return me;var de=Ce[1];return me.split(`
`).map(function(pe){var De=pe.match(/^\s+/);if(De===null)return pe;var ue=De[0];return ue.length>=de.length?pe.slice(de.length):pe}).join(`
`)}var Se=function(){function le(Ce){this.options=Ce||k}var me=le.prototype;return me.space=function(de){var pe=this.rules.block.newline.exec(de);if(pe)return pe[0].length>1?{type:"space",raw:pe[0]}:{raw:`
`}},me.code=function(de,pe){var De=this.rules.block.code.exec(de);if(De){var ue=pe[pe.length-1];if(ue&&ue.type==="paragraph")return{raw:De[0],text:De[0].trimRight()};var Me=De[0].replace(/^ {4}/gm,"");return{type:"code",raw:De[0],codeBlockStyle:"indented",text:this.options.pedantic?Me:y(Me,`
`)}}},me.fences=function(de){var pe=this.rules.block.fences.exec(de);if(pe){var De=pe[0],ue=ve(De,pe[3]||"");return{type:"code",raw:De,lang:pe[2]?pe[2].trim():pe[2],text:ue}}},me.heading=function(de){var pe=this.rules.block.heading.exec(de);if(pe)return{type:"heading",raw:pe[0],depth:pe[1].length,text:pe[2]}},me.nptable=function(de){var pe=this.rules.block.nptable.exec(de);if(pe){var De={type:"table",header:H(pe[1].replace(/^ *| *\| *$/g,"")),align:pe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:pe[3]?pe[3].replace(/\n$/,"").split(`
`):[],raw:pe[0]};if(De.header.length===De.align.length){var ue=De.align.length,Me;for(Me=0;Me<ue;Me++)/^ *-+: *$/.test(De.align[Me])?De.align[Me]="right":/^ *:-+: *$/.test(De.align[Me])?De.align[Me]="center":/^ *:-+ *$/.test(De.align[Me])?De.align[Me]="left":De.align[Me]=null;for(ue=De.cells.length,Me=0;Me<ue;Me++)De.cells[Me]=H(De.cells[Me],De.header.length);return De}}},me.hr=function(de){var pe=this.rules.block.hr.exec(de);if(pe)return{type:"hr",raw:pe[0]}},me.blockquote=function(de){var pe=this.rules.block.blockquote.exec(de);if(pe){var De=pe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:pe[0],text:De}}},me.list=function(de){var pe=this.rules.block.list.exec(de);if(pe){for(var De=pe[0],ue=pe[2],Me=ue.length>1,We=ue[ue.length-1]===")",lt={type:"list",raw:De,ordered:Me,start:Me?+ue.slice(0,-1):"",loose:!1,items:[]},Ct=pe[0].match(this.rules.block.item),Ot=!1,Nt,ir,Jt,cn,rn,In,ur,mr=Ct.length,Qn=0;Qn<mr;Qn++)Nt=Ct[Qn],De=Nt,ir=Nt.length,Nt=Nt.replace(/^ *([*+-]|\d+[.)]) */,""),~Nt.indexOf(`
`)&&(ir-=Nt.length,Nt=this.options.pedantic?Nt.replace(/^ {1,4}/gm,""):Nt.replace(new RegExp("^ {1,"+ir+"}","gm"),"")),Qn!==mr-1&&(Jt=this.rules.block.bullet.exec(Ct[Qn+1])[0],(Me?Jt.length===1||!We&&Jt[Jt.length-1]===")":Jt.length>1||this.options.smartLists&&Jt!==ue)&&(cn=Ct.slice(Qn+1).join(`
`),lt.raw=lt.raw.substring(0,lt.raw.length-cn.length),Qn=mr-1)),rn=Ot||/\n\n(?!\s*$)/.test(Nt),Qn!==mr-1&&(Ot=Nt.charAt(Nt.length-1)===`
`,rn||(rn=Ot)),rn&&(lt.loose=!0),In=/^\[[ xX]\] /.test(Nt),ur=void 0,In&&(ur=Nt[1]!==" ",Nt=Nt.replace(/^\[[ xX]\] +/,"")),lt.items.push({type:"list_item",raw:De,task:In,checked:ur,loose:rn,text:Nt});return lt}},me.html=function(de){var pe=this.rules.block.html.exec(de);if(pe)return{type:this.options.sanitize?"paragraph":"html",raw:pe[0],pre:!this.options.sanitizer&&(pe[1]==="pre"||pe[1]==="script"||pe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):J(pe[0]):pe[0]}},me.def=function(de){var pe=this.rules.block.def.exec(de);if(pe){pe[3]&&(pe[3]=pe[3].substring(1,pe[3].length-1));var De=pe[1].toLowerCase().replace(/\s+/g," ");return{tag:De,raw:pe[0],href:pe[2],title:pe[3]}}},me.table=function(de){var pe=this.rules.block.table.exec(de);if(pe){var De={type:"table",header:H(pe[1].replace(/^ *| *\| *$/g,"")),align:pe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:pe[3]?pe[3].replace(/\n$/,"").split(`
`):[]};if(De.header.length===De.align.length){De.raw=pe[0];var ue=De.align.length,Me;for(Me=0;Me<ue;Me++)/^ *-+: *$/.test(De.align[Me])?De.align[Me]="right":/^ *:-+: *$/.test(De.align[Me])?De.align[Me]="center":/^ *:-+ *$/.test(De.align[Me])?De.align[Me]="left":De.align[Me]=null;for(ue=De.cells.length,Me=0;Me<ue;Me++)De.cells[Me]=H(De.cells[Me].replace(/^ *\| *| *\| *$/g,""),De.header.length);return De}}},me.lheading=function(de){var pe=this.rules.block.lheading.exec(de);if(pe)return{type:"heading",raw:pe[0],depth:pe[2].charAt(0)==="="?1:2,text:pe[1]}},me.paragraph=function(de){var pe=this.rules.block.paragraph.exec(de);if(pe)return{type:"paragraph",raw:pe[0],text:pe[1].charAt(pe[1].length-1)===`
`?pe[1].slice(0,-1):pe[1]}},me.text=function(de,pe){var De=this.rules.block.text.exec(de);if(De){var ue=pe[pe.length-1];return ue&&ue.type==="text"?{raw:De[0],text:De[0]}:{type:"text",raw:De[0],text:De[0]}}},me.escape=function(de){var pe=this.rules.inline.escape.exec(de);if(pe)return{type:"escape",raw:pe[0],text:J(pe[1])}},me.tag=function(de,pe,De){var ue=this.rules.inline.tag.exec(de);if(ue)return!pe&&/^<a /i.test(ue[0])?pe=!0:pe&&/^<\/a>/i.test(ue[0])&&(pe=!1),!De&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?De=!0:De&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(De=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:pe,inRawBlock:De,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):J(ue[0]):ue[0]}},me.link=function(de){var pe=this.rules.inline.link.exec(de);if(pe){var De=se(pe[2],"()");if(De>-1){var ue=pe[0].indexOf("!")===0?5:4,Me=ue+pe[1].length+De;pe[2]=pe[2].substring(0,De),pe[0]=pe[0].substring(0,Me).trim(),pe[3]=""}var We=pe[2],lt="";if(this.options.pedantic){var Ct=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(We);Ct?(We=Ct[1],lt=Ct[3]):lt=""}else lt=pe[3]?pe[3].slice(1,-1):"";We=We.trim().replace(/^<([\s\S]*)>$/,"$1");var Ot=fe(pe,{href:We&&We.replace(this.rules.inline._escapes,"$1"),title:lt&&lt.replace(this.rules.inline._escapes,"$1")},pe[0]);return Ot}},me.reflink=function(de,pe){var De;if((De=this.rules.inline.reflink.exec(de))||(De=this.rules.inline.nolink.exec(de))){var ue=(De[2]||De[1]).replace(/\s+/g," ");if(ue=pe[ue.toLowerCase()],!ue||!ue.href){var Me=De[0].charAt(0);return{type:"text",raw:Me,text:Me}}var We=fe(De,ue,De[0]);return We}},me.strong=function(de,pe,De){De===void 0&&(De="");var ue=this.rules.inline.strong.start.exec(de);if(ue&&(!ue[1]||ue[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){pe=pe.slice(-1*de.length);var Me=ue[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Me.lastIndex=0;for(var We;(ue=Me.exec(pe))!=null;)if(We=this.rules.inline.strong.middle.exec(pe.slice(0,ue.index+3)),We)return{type:"strong",raw:de.slice(0,We[0].length),text:de.slice(2,We[0].length-2)}}},me.em=function(de,pe,De){De===void 0&&(De="");var ue=this.rules.inline.em.start.exec(de);if(ue&&(!ue[1]||ue[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){pe=pe.slice(-1*de.length);var Me=ue[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Me.lastIndex=0;for(var We;(ue=Me.exec(pe))!=null;)if(We=this.rules.inline.em.middle.exec(pe.slice(0,ue.index+2)),We)return{type:"em",raw:de.slice(0,We[0].length),text:de.slice(1,We[0].length-1)}}},me.codespan=function(de){var pe=this.rules.inline.code.exec(de);if(pe){var De=pe[2].replace(/\n/g," "),ue=/[^ ]/.test(De),Me=De.startsWith(" ")&&De.endsWith(" ");return ue&&Me&&(De=De.substring(1,De.length-1)),De=J(De,!0),{type:"codespan",raw:pe[0],text:De}}},me.br=function(de){var pe=this.rules.inline.br.exec(de);if(pe)return{type:"br",raw:pe[0]}},me.del=function(de){var pe=this.rules.inline.del.exec(de);if(pe)return{type:"del",raw:pe[0],text:pe[1]}},me.autolink=function(de,pe){var De=this.rules.inline.autolink.exec(de);if(De){var ue,Me;return De[2]==="@"?(ue=J(this.options.mangle?pe(De[1]):De[1]),Me="mailto:"+ue):(ue=J(De[1]),Me=ue),{type:"link",raw:De[0],text:ue,href:Me,tokens:[{type:"text",raw:ue,text:ue}]}}},me.url=function(de,pe){var De;if(De=this.rules.inline.url.exec(de)){var ue,Me;if(De[2]==="@")ue=J(this.options.mangle?pe(De[0]):De[0]),Me="mailto:"+ue;else{var We;do We=De[0],De[0]=this.rules.inline._backpedal.exec(De[0])[0];while(We!==De[0]);ue=J(De[0]),De[1]==="www."?Me="http://"+ue:Me=ue}return{type:"link",raw:De[0],text:ue,href:Me,tokens:[{type:"text",raw:ue,text:ue}]}}},me.inlineText=function(de,pe,De){var ue=this.rules.inline.text.exec(de);if(ue){var Me;return pe?Me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):J(ue[0]):ue[0]:Me=J(this.options.smartypants?De(ue[0]):ue[0]),{type:"text",raw:ue[0],text:Me}}},le}(),Ue=B.noopTest,Te=B.edit,Ie=B.merge,be={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:Ue,table:Ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Te(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Te(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Te(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._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",be._comment=/<!--(?!-?>)[\s\S]*?-->/,be.html=Te(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Te(be._paragraph).replace("hr",be.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",be._tag).getRegex(),be.blockquote=Te(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=Ie({},be),be.gfm=Ie({},be.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*|$)"}),be.gfm.nptable=Te(be.gfm.nptable).replace("hr",be.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",be._tag).getRegex(),be.gfm.table=Te(be.gfm.table).replace("hr",be.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",be._tag).getRegex(),be.pedantic=Ie({},be.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._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:Ue,paragraph:Te(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ue,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:Ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",q.punctuation=Te(q.punctuation).replace(/punctuation/g,q._punctuation).getRegex(),q._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",q._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",q.em.start=Te(q.em.start).replace(/punctuation/g,q._punctuation).getRegex(),q.em.middle=Te(q.em.middle).replace(/punctuation/g,q._punctuation).replace(/overlapSkip/g,q._overlapSkip).getRegex(),q.em.endAst=Te(q.em.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.em.endUnd=Te(q.em.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.start=Te(q.strong.start).replace(/punctuation/g,q._punctuation).getRegex(),q.strong.middle=Te(q.strong.middle).replace(/punctuation/g,q._punctuation).replace(/blockSkip/g,q._blockSkip).getRegex(),q.strong.endAst=Te(q.strong.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.endUnd=Te(q.strong.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.blockSkip=Te(q._blockSkip,"g").getRegex(),q.overlapSkip=Te(q._overlapSkip,"g").getRegex(),q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,q._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])?)+(?![-_])/,q.autolink=Te(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex(),q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,q.tag=Te(q.tag).replace("comment",be._comment).replace("attribute",q._attribute).getRegex(),q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,q._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,q.link=Te(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex(),q.reflink=Te(q.reflink).replace("label",q._label).getRegex(),q.reflinkSearch=Te(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex(),q.normal=Ie({},q),q.pedantic=Ie({},q.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",q._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()}),q.gfm=Ie({},q.normal,{escape:Te(q.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),q.gfm.url=Te(q.gfm.url,"i").replace("email",q.gfm._extended_email).getRegex(),q.breaks=Ie({},q.gfm,{br:Te(q.br).replace("{2,}","*").getRegex(),text:Te(q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var _={block:be,inline:q},L=Y.defaults,z=_.block,ee=_.inline;function $(le){return le.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 Ee(le){var me="",Ce,de,pe=le.length;for(Ce=0;Ce<pe;Ce++)de=le.charCodeAt(Ce),Math.random()>.5&&(de="x"+de.toString(16)),me+="&#"+de+";";return me}var Be=function(){function le(Ce){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ce||L,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var de={block:z.normal,inline:ee.normal};this.options.pedantic?(de.block=z.pedantic,de.inline=ee.pedantic):this.options.gfm&&(de.block=z.gfm,this.options.breaks?de.inline=ee.breaks:de.inline=ee.gfm),this.tokenizer.rules=de}le.lex=function(de,pe){var De=new le(pe);return De.lex(de)};var me=le.prototype;return me.lex=function(de){return de=de.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(de,this.tokens,!0),this.inline(this.tokens),this.tokens},me.blockTokens=function(de,pe,De){pe===void 0&&(pe=[]),De===void 0&&(De=!0),de=de.replace(/^ +$/gm,"");for(var ue,Me,We,lt;de;){if(ue=this.tokenizer.space(de)){de=de.substring(ue.raw.length),ue.type&&pe.push(ue);continue}if(ue=this.tokenizer.code(de,pe)){de=de.substring(ue.raw.length),ue.type?pe.push(ue):(lt=pe[pe.length-1],lt.raw+=`
`+ue.raw,lt.text+=`
`+ue.text);continue}if(ue=this.tokenizer.fences(de)){de=de.substring(ue.raw.length),pe.push(ue);continue}if(ue=this.tokenizer.heading(de)){de=de.substring(ue.raw.length),pe.push(ue);continue}if(ue=this.tokenizer.nptable(de)){de=de.substring(ue.raw.length),pe.push(ue);continue}if(ue=this.tokenizer.hr(de)){de=de.substring(ue.raw.length),pe.push(ue);continue}if(ue=this.tokenizer.blockquote(de)){de=de.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],De),pe.push(ue);continue}if(ue=this.tokenizer.list(de)){for(de=de.substring(ue.raw.length),We=ue.items.length,Me=0;Me<We;Me++)ue.items[Me].tokens=this.blockTokens(ue.items[Me].text,[],!1);pe.push(ue);continue}if(ue=this.tokenizer.html(de)){de=de.substring(ue.raw.length),pe.push(ue);continue}if(De&&(ue=this.tokenizer.def(de))){de=de.substring(ue.raw.length),this.tokens.links[ue.tag]||(this.tokens.links[ue.tag]={href:ue.href,title:ue.title});continue}if(ue=this.tokenizer.table(de)){de=de.substring(ue.raw.length),pe.push(ue);continue}if(ue=this.tokenizer.lheading(de)){de=de.substring(ue.raw.length),pe.push(ue);continue}if(De&&(ue=this.tokenizer.paragraph(de))){de=de.substring(ue.raw.length),pe.push(ue);continue}if(ue=this.tokenizer.text(de,pe)){de=de.substring(ue.raw.length),ue.type?pe.push(ue):(lt=pe[pe.length-1],lt.raw+=`
`+ue.raw,lt.text+=`
`+ue.text);continue}if(de){var Ct="Infinite loop on byte: "+de.charCodeAt(0);if(this.options.silent){console.error(Ct);break}else throw new Error(Ct)}}return pe},me.inline=function(de){var pe,De,ue,Me,We,lt,Ct=de.length;for(pe=0;pe<Ct;pe++){lt=de[pe];switch(lt.type){case"paragraph":case"text":case"heading":{lt.tokens=[],this.inlineTokens(lt.text,lt.tokens);break}case"table":{for(lt.tokens={header:[],cells:[]},Me=lt.header.length,De=0;De<Me;De++)lt.tokens.header[De]=[],this.inlineTokens(lt.header[De],lt.tokens.header[De]);for(Me=lt.cells.length,De=0;De<Me;De++)for(We=lt.cells[De],lt.tokens.cells[De]=[],ue=0;ue<We.length;ue++)lt.tokens.cells[De][ue]=[],this.inlineTokens(We[ue],lt.tokens.cells[De][ue]);break}case"blockquote":{this.inline(lt.tokens);break}case"list":{for(Me=lt.items.length,De=0;De<Me;De++)this.inline(lt.items[De].tokens);break}}}return de},me.inlineTokens=function(de,pe,De,ue,Me){pe===void 0&&(pe=[]),De===void 0&&(De=!1),ue===void 0&&(ue=!1),Me===void 0&&(Me="");var We,lt=de,Ct;if(this.tokens.links){var Ot=Object.keys(this.tokens.links);if(Ot.length>0)for(;(Ct=this.tokenizer.rules.inline.reflinkSearch.exec(lt))!=null;)Ot.includes(Ct[0].slice(Ct[0].lastIndexOf("[")+1,-1))&&(lt=lt.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ct=this.tokenizer.rules.inline.blockSkip.exec(lt))!=null;)lt=lt.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;de;){if(We=this.tokenizer.escape(de)){de=de.substring(We.raw.length),pe.push(We);continue}if(We=this.tokenizer.tag(de,De,ue)){de=de.substring(We.raw.length),De=We.inLink,ue=We.inRawBlock,pe.push(We);continue}if(We=this.tokenizer.link(de)){de=de.substring(We.raw.length),We.type==="link"&&(We.tokens=this.inlineTokens(We.text,[],!0,ue)),pe.push(We);continue}if(We=this.tokenizer.reflink(de,this.tokens.links)){de=de.substring(We.raw.length),We.type==="link"&&(We.tokens=this.inlineTokens(We.text,[],!0,ue)),pe.push(We);continue}if(We=this.tokenizer.strong(de,lt,Me)){de=de.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],De,ue),pe.push(We);continue}if(We=this.tokenizer.em(de,lt,Me)){de=de.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],De,ue),pe.push(We);continue}if(We=this.tokenizer.codespan(de)){de=de.substring(We.raw.length),pe.push(We);continue}if(We=this.tokenizer.br(de)){de=de.substring(We.raw.length),pe.push(We);continue}if(We=this.tokenizer.del(de)){de=de.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],De,ue),pe.push(We);continue}if(We=this.tokenizer.autolink(de,Ee)){de=de.substring(We.raw.length),pe.push(We);continue}if(!De&&(We=this.tokenizer.url(de,Ee))){de=de.substring(We.raw.length),pe.push(We);continue}if(We=this.tokenizer.inlineText(de,ue,$)){de=de.substring(We.raw.length),Me=We.raw.slice(-1),pe.push(We);continue}if(de){var Nt="Infinite loop on byte: "+de.charCodeAt(0);if(this.options.silent){console.error(Nt);break}else throw new Error(Nt)}}return pe},Q(le,null,[{key:"rules",get:function(){return{block:z,inline:ee}}}]),le}(),nt=Y.defaults,we=B.cleanUrl,Ne=B.escape,Ye=function(){function le(Ce){this.options=Ce||nt}var me=le.prototype;return me.code=function(de,pe,De){var ue=(pe||"").match(/\S*/)[0];if(this.options.highlight){var Me=this.options.highlight(de,ue);Me!=null&&Me!==de&&(De=!0,de=Me)}return ue?'<pre><code class="'+this.options.langPrefix+Ne(ue,!0)+'">'+(De?de:Ne(de,!0))+`</code></pre>
`:"<pre><code>"+(De?de:Ne(de,!0))+`</code></pre>
`},me.blockquote=function(de){return`<blockquote>
`+de+`</blockquote>
`},me.html=function(de){return de},me.heading=function(de,pe,De,ue){return this.options.headerIds?"<h"+pe+' id="'+this.options.headerPrefix+ue.slug(De)+'">'+de+"</h"+pe+`>
`:"<h"+pe+">"+de+"</h"+pe+`>
`},me.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},me.list=function(de,pe,De){var ue=pe?"ol":"ul",Me=pe&&De!==1?' start="'+De+'"':"";return"<"+ue+Me+`>
`+de+"</"+ue+`>
`},me.listitem=function(de){return"<li>"+de+`</li>
`},me.checkbox=function(de){return"<input "+(de?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},me.paragraph=function(de){return"<p>"+de+`</p>
`},me.table=function(de,pe){return pe&&(pe="<tbody>"+pe+"</tbody>"),`<table>
<thead>
`+de+`</thead>
`+pe+`</table>
`},me.tablerow=function(de){return`<tr>
`+de+`</tr>
`},me.tablecell=function(de,pe){var De=pe.header?"th":"td",ue=pe.align?"<"+De+' align="'+pe.align+'">':"<"+De+">";return ue+de+"</"+De+`>
`},me.strong=function(de){return"<strong>"+de+"</strong>"},me.em=function(de){return"<em>"+de+"</em>"},me.codespan=function(de){return"<code>"+de+"</code>"},me.br=function(){return this.options.xhtml?"<br/>":"<br>"},me.del=function(de){return"<del>"+de+"</del>"},me.link=function(de,pe,De){if(de=we(this.options.sanitize,this.options.baseUrl,de),de===null)return De;var ue='<a href="'+Ne(de)+'"';return pe&&(ue+=' title="'+pe+'"'),ue+=">"+De+"</a>",ue},me.image=function(de,pe,De){if(de=we(this.options.sanitize,this.options.baseUrl,de),de===null)return De;var ue='<img src="'+de+'" alt="'+De+'"';return pe&&(ue+=' title="'+pe+'"'),ue+=this.options.xhtml?"/>":">",ue},me.text=function(de){return de},le}(),Xe=function(){function le(){}var me=le.prototype;return me.strong=function(de){return de},me.em=function(de){return de},me.codespan=function(de){return de},me.del=function(de){return de},me.html=function(de){return de},me.text=function(de){return de},me.link=function(de,pe,De){return""+De},me.image=function(de,pe,De){return""+De},me.br=function(){return""},le}(),ht=function(){function le(){this.seen={}}var me=le.prototype;return me.slug=function(de){var pe=de.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(pe)){var De=pe;do this.seen[De]++,pe=De+"-"+this.seen[De];while(this.seen.hasOwnProperty(pe))}return this.seen[pe]=0,pe},le}(),wt=Y.defaults,Bt=B.unescape,Wt=function(){function le(Ce){this.options=Ce||wt,this.options.renderer=this.options.renderer||new Ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new ht}le.parse=function(de,pe){var De=new le(pe);return De.parse(de)};var me=le.prototype;return me.parse=function(de,pe){pe===void 0&&(pe=!0);var De="",ue,Me,We,lt,Ct,Ot,Nt,ir,Jt,cn,rn,In,ur,mr,Qn,yr,Sr,Nn,Ar=de.length;for(ue=0;ue<Ar;ue++){cn=de[ue];switch(cn.type){case"space":continue;case"hr":{De+=this.renderer.hr();continue}case"heading":{De+=this.renderer.heading(this.parseInline(cn.tokens),cn.depth,Bt(this.parseInline(cn.tokens,this.textRenderer)),this.slugger);continue}case"code":{De+=this.renderer.code(cn.text,cn.lang,cn.escaped);continue}case"table":{for(ir="",Nt="",lt=cn.header.length,Me=0;Me<lt;Me++)Nt+=this.renderer.tablecell(this.parseInline(cn.tokens.header[Me]),{header:!0,align:cn.align[Me]});for(ir+=this.renderer.tablerow(Nt),Jt="",lt=cn.cells.length,Me=0;Me<lt;Me++){for(Ot=cn.tokens.cells[Me],Nt="",Ct=Ot.length,We=0;We<Ct;We++)Nt+=this.renderer.tablecell(this.parseInline(Ot[We]),{header:!1,align:cn.align[We]});Jt+=this.renderer.tablerow(Nt)}De+=this.renderer.table(ir,Jt);continue}case"blockquote":{Jt=this.parse(cn.tokens),De+=this.renderer.blockquote(Jt);continue}case"list":{for(rn=cn.ordered,In=cn.start,ur=cn.loose,lt=cn.items.length,Jt="",Me=0;Me<lt;Me++)Qn=cn.items[Me],yr=Qn.checked,Sr=Qn.task,mr="",Qn.task&&(Nn=this.renderer.checkbox(yr),ur?Qn.tokens.length>0&&Qn.tokens[0].type==="text"?(Qn.tokens[0].text=Nn+" "+Qn.tokens[0].text,Qn.tokens[0].tokens&&Qn.tokens[0].tokens.length>0&&Qn.tokens[0].tokens[0].type==="text"&&(Qn.tokens[0].tokens[0].text=Nn+" "+Qn.tokens[0].tokens[0].text)):Qn.tokens.unshift({type:"text",text:Nn}):mr+=Nn),mr+=this.parse(Qn.tokens,ur),Jt+=this.renderer.listitem(mr,Sr,yr);De+=this.renderer.list(Jt,rn,In);continue}case"html":{De+=this.renderer.html(cn.text);continue}case"paragraph":{De+=this.renderer.paragraph(this.parseInline(cn.tokens));continue}case"text":{for(Jt=cn.tokens?this.parseInline(cn.tokens):cn.text;ue+1<Ar&&de[ue+1].type==="text";)cn=de[++ue],Jt+=`
`+(cn.tokens?this.parseInline(cn.tokens):cn.text);De+=pe?this.renderer.paragraph(Jt):Jt;continue}default:{var An='Token with "'+cn.type+'" type was not found.';if(this.options.silent){console.error(An);return}else throw new Error(An)}}}return De},me.parseInline=function(de,pe){pe=pe||this.renderer;var De="",ue,Me,We=de.length;for(ue=0;ue<We;ue++){Me=de[ue];switch(Me.type){case"escape":{De+=pe.text(Me.text);break}case"html":{De+=pe.html(Me.text);break}case"link":{De+=pe.link(Me.href,Me.title,this.parseInline(Me.tokens,pe));break}case"image":{De+=pe.image(Me.href,Me.title,Me.text);break}case"strong":{De+=pe.strong(this.parseInline(Me.tokens,pe));break}case"em":{De+=pe.em(this.parseInline(Me.tokens,pe));break}case"codespan":{De+=pe.codespan(Me.text);break}case"br":{De+=pe.br();break}case"del":{De+=pe.del(this.parseInline(Me.tokens,pe));break}case"text":{De+=pe.text(Me.text);break}default:{var lt='Token with "'+Me.type+'" type was not found.';if(this.options.silent){console.error(lt);return}else throw new Error(lt)}}}return De},le}(),an=B.merge,Yt=B.checkSanitizeDeprecation,qe=B.escape,Qe=Y.getDefaults,bt=Y.changeDefaults,xt=Y.defaults;function ye(le,me,Ce){if(typeof le=="undefined"||le===null)throw new Error("marked(): input parameter is undefined or null");if(typeof le!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(le)+", string expected");if(typeof me=="function"&&(Ce=me,me=null),me=an({},ye.defaults,me||{}),Yt(me),Ce){var de=me.highlight,pe;try{pe=Be.lex(le,me)}catch(We){return Ce(We)}var De=function(lt){var Ct;if(!lt)try{Ct=Wt.parse(pe,me)}catch(Ot){lt=Ot}return me.highlight=de,lt?Ce(lt):Ce(null,Ct)};if(!de||de.length<3)return De();if(delete me.highlight,!pe.length)return De();var ue=0;ye.walkTokens(pe,function(We){We.type==="code"&&(ue++,setTimeout(function(){de(We.text,We.lang,function(lt,Ct){if(lt)return De(lt);Ct!=null&&Ct!==We.text&&(We.text=Ct,We.escaped=!0),ue--,ue===0&&De()})},0))}),ue===0&&De();return}try{var Me=Be.lex(le,me);return me.walkTokens&&ye.walkTokens(Me,me.walkTokens),Wt.parse(Me,me)}catch(We){if(We.message+=`
Please report this to https://github.com/markedjs/marked.`,me.silent)return"<p>An error occurred:</p><pre>"+qe(We.message+"",!0)+"</pre>";throw We}}ye.options=ye.setOptions=function(le){return an(ye.defaults,le),bt(ye.defaults),ye},ye.getDefaults=Qe,ye.defaults=xt,ye.use=function(le){var me=an({},le);if(le.renderer&&function(){var de=ye.defaults.renderer||new Ye,pe=function(Me){var We=de[Me];de[Me]=function(){for(var lt=arguments.length,Ct=new Array(lt),Ot=0;Ot<lt;Ot++)Ct[Ot]=arguments[Ot];var Nt=le.renderer[Me].apply(de,Ct);return Nt===!1&&(Nt=We.apply(de,Ct)),Nt}};for(var De in le.renderer)pe(De);me.renderer=de}(),le.tokenizer&&function(){var de=ye.defaults.tokenizer||new Se,pe=function(Me){var We=de[Me];de[Me]=function(){for(var lt=arguments.length,Ct=new Array(lt),Ot=0;Ot<lt;Ot++)Ct[Ot]=arguments[Ot];var Nt=le.tokenizer[Me].apply(de,Ct);return Nt===!1&&(Nt=We.apply(de,Ct)),Nt}};for(var De in le.tokenizer)pe(De);me.tokenizer=de}(),le.walkTokens){var Ce=ye.defaults.walkTokens;me.walkTokens=function(de){le.walkTokens(de),Ce&&Ce(de)}}ye.setOptions(me)},ye.walkTokens=function(le,me){for(var Ce=G(le),de;!(de=Ce()).done;){var pe=de.value;me(pe);switch(pe.type){case"table":{for(var De=G(pe.tokens.header),ue;!(ue=De()).done;){var Me=ue.value;ye.walkTokens(Me,me)}for(var We=G(pe.tokens.cells),lt;!(lt=We()).done;)for(var Ct=lt.value,Ot=G(Ct),Nt;!(Nt=Ot()).done;){var ir=Nt.value;ye.walkTokens(ir,me)}break}case"list":{ye.walkTokens(pe.items,me);break}default:pe.tokens&&ye.walkTokens(pe.tokens,me)}}},ye.Parser=Wt,ye.parser=Wt.parse,ye.Renderer=Ye,ye.TextRenderer=Xe,ye.Lexer=Be,ye.lexer=Be.lex,ye.Tokenizer=Se,ye.Slugger=ht,ye.parse=ye;var ae=ye;return ae})},ELLl:function(Et,Pe,F){(function(ne){ne(F("VrN/"))})(function(ne){var Q={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},U=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(c,s,i){i&&i!=ne.Init&&(c.removeKeyMap(G),c.state.closeBrackets=null),s&&(M(Z(s,"pairs")),c.state.closeBrackets=s,c.addKeyMap(G))});function Z(c,s){return s=="pairs"&&typeof c=="string"?c:typeof c=="object"&&c[s]!=null?c[s]:Q[s]}var G={Backspace:r,Enter:A};function M(c){for(var s=0;s<c.length;s++){var i=c.charAt(s),t="'"+i+"'";G[t]||(G[t]=Y(i))}}M(Q.pairs+"`");function Y(c){return function(s){return f(s,c)}}function X(c){var s=c.state.closeBrackets;if(!s||s.override)return s;var i=c.getModeAt(c.getCursor());return i.closeBrackets||s}function r(c){var s=X(c);if(!s||c.getOption("disableInput"))return ne.Pass;for(var i=Z(s,"pairs"),t=c.listSelections(),u=0;u<t.length;u++){if(!t[u].empty())return ne.Pass;var o=p(c,t[u].head);if(!o||i.indexOf(o)%2!=0)return ne.Pass}for(var u=t.length-1;u>=0;u--){var R=t[u].head;c.replaceRange("",U(R.line,R.ch-1),U(R.line,R.ch+1),"+delete")}}function A(c){var s=X(c),i=s&&Z(s,"explode");if(!i||c.getOption("disableInput"))return ne.Pass;for(var t=c.listSelections(),u=0;u<t.length;u++){if(!t[u].empty())return ne.Pass;var o=p(c,t[u].head);if(!o||i.indexOf(o)%2!=0)return ne.Pass}c.operation(function(){var R=c.lineSeparator()||`
`;c.replaceSelection(R+R,null),c.execCommand("goCharLeft"),t=c.listSelections();for(var T=0;T<t.length;T++){var S=t[T].head.line;c.indentLine(S,null,!0),c.indentLine(S+1,null,!0)}})}function m(c){var s=ne.cmpPos(c.anchor,c.head)>0;return{anchor:new U(c.anchor.line,c.anchor.ch+(s?-1:1)),head:new U(c.head.line,c.head.ch+(s?1:-1))}}function f(c,s){var i=X(c);if(!i||c.getOption("disableInput"))return ne.Pass;var t=Z(i,"pairs"),u=t.indexOf(s);if(u==-1)return ne.Pass;for(var o=Z(i,"closeBefore"),R=Z(i,"triples"),T=t.charAt(u+1)==s,S=c.listSelections(),D=u%2==0,I,E=0;E<S.length;E++){var x=S[E],g=x.head,h,O=c.getRange(g,U(g.line,g.ch+1));if(D&&!x.empty())h="surround";else if((T||!D)&&O==s)T&&a(c,g)?h="both":R.indexOf(s)>=0&&c.getRange(g,U(g.line,g.ch+3))==s+s+s?h="skipThree":h="skip";else if(T&&g.ch>1&&R.indexOf(s)>=0&&c.getRange(U(g.line,g.ch-2),g)==s+s){if(g.ch>2&&/\bstring/.test(c.getTokenTypeAt(U(g.line,g.ch-2))))return ne.Pass;h="addFour"}else if(T){var w=g.ch==0?" ":c.getRange(U(g.line,g.ch-1),g);if(!ne.isWordChar(O)&&w!=s&&!ne.isWordChar(w))h="both";else return ne.Pass}else if(D&&(O.length===0||/\s/.test(O)||o.indexOf(O)>-1))h="both";else return ne.Pass;if(!I)I=h;else if(I!=h)return ne.Pass}var b=u%2?t.charAt(u-1):s,W=u%2?s:t.charAt(u+1);c.operation(function(){if(I=="skip")c.execCommand("goCharRight");else if(I=="skipThree")for(var j=0;j<3;j++)c.execCommand("goCharRight");else if(I=="surround"){for(var C=c.getSelections(),j=0;j<C.length;j++)C[j]=b+C[j]+W;c.replaceSelections(C,"around"),C=c.listSelections().slice();for(var j=0;j<C.length;j++)C[j]=m(C[j]);c.setSelections(C)}else I=="both"?(c.replaceSelection(b+W,null),c.triggerElectric(b+W),c.execCommand("goCharLeft")):I=="addFour"&&(c.replaceSelection(b+b+b+b,"before"),c.execCommand("goCharRight"))})}function p(c,s){var i=c.getRange(U(s.line,s.ch-1),U(s.line,s.ch+1));return i.length==2?i:null}function a(c,s){var i=c.getTokenAt(U(s.line,s.ch+1));return/\bstring/.test(i.type)&&i.start==s.ch&&(s.ch==0||!/\bstring/.test(c.getTokenTypeAt(s)))}})},FWmy:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return ne});function ne(Q,U){if(!Q)throw new Error(U?`Assertion failed (${U})`:"Assertion Failed")}},GfqC:function(Et,Pe,F){"use strict";var ne=F("q1tI"),Q=F.n(ne),U=F("TSYQ"),Z=F.n(U);function G(B,k){var y="cannot "+B.method+" "+B.action+" "+k.status+"'",H=new Error(y);return H.status=k.status,H.method=B.method,H.url=B.action,H}function M(B){var k=B.responseText||B.response;if(!k)return k;try{return JSON.parse(k)}catch(y){return k}}function Y(B){var k=new XMLHttpRequest;B.onProgress&&k.upload&&(k.upload.onprogress=function(se){se.total>0&&(se.percent=se.loaded/se.total*100),B.onProgress(se)});var y=new FormData;B.data&&Object.keys(B.data).forEach(function(J){var se=B.data[J];if(Array.isArray(se)){se.forEach(function(fe){y.append(J+"[]",fe)});return}y.append(J,B.data[J])}),B.file instanceof Blob?y.append(B.filename,B.file,B.file.name):y.append(B.filename,B.file),k.onerror=function(se){B.onError(se)},k.onload=function(){return k.status<200||k.status>=300?B.onError(G(B,k),M(k)):B.onSuccess(M(k),k)},k.open(B.method,B.action,!0),B.withCredentials&&"withCredentials"in k&&(k.withCredentials=!0);var H=B.headers||{};return H["X-Requested-With"]!==null&&k.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function(J){H[J]!==null&&k.setRequestHeader(J,H[J])}),k.send(y),{abort:function(){k.abort()}}}var X=+new Date,r=0;function A(){return"rc-upload-"+X+"-"+ ++r}function m(B,k){return B.indexOf(k,B.length-k.length)!==-1}var f=function(B,k){if(B&&k){var y=Array.isArray(k)?k:k.split(","),H=B.name||"",J=B.type||"",se=J.replace(/\/.*$/,"");return y.some(function(fe){var ve=fe.trim();return ve.charAt(0)==="."?m(H.toLowerCase(),ve.toLowerCase()):/\/\*$/.test(ve)?se===ve.replace(/\/.*$/,""):J===ve})}return!0};function p(B,k){var y=B.createReader(),H=[];function J(){y.readEntries(function(se){var fe=Array.prototype.slice.apply(se);H=H.concat(fe);var ve=!fe.length;ve?k(H):J()})}J()}var a=function(k,y,H){var J=function se(fe,ve){ve=ve||"",fe.isFile?fe.file(function(Se){H(Se)&&(fe.fullPath&&!Se.webkitRelativePath&&(Object.defineProperties(Se,{webkitRelativePath:{writable:!0}}),Se.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(Se,{webkitRelativePath:{writable:!1}})),y([Se]))}):fe.isDirectory&&p(fe,function(Se){Se.forEach(function(Ue){se(Ue,""+ve+fe.name+"/")})})};k.forEach(function(se){J(se.webkitGetAsEntry())})},c=a,s=Object.assign||function(B){for(var k=1;k<arguments.length;k++){var y=arguments[k];for(var H in y)Object.prototype.hasOwnProperty.call(y,H)&&(B[H]=y[H])}return B},i=function(){function B(k,y){var H=[],J=!0,se=!1,fe=void 0;try{for(var ve=k[Symbol.iterator](),Se;!(J=(Se=ve.next()).done)&&!(H.push(Se.value),y&&H.length===y);J=!0);}catch(Ue){se=!0,fe=Ue}finally{try{!J&&ve.return&&ve.return()}finally{if(se)throw fe}}return H}return function(k,y){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return B(k,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function B(k,y){for(var H=0;H<y.length;H++){var J=y[H];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(k,J.key,J)}}return function(k,y,H){return y&&B(k.prototype,y),H&&B(k,H),k}}();function u(B,k,y){return k in B?Object.defineProperty(B,k,{value:y,enumerable:!0,configurable:!0,writable:!0}):B[k]=y,B}function o(B,k){var y={};for(var H in B){if(k.indexOf(H)>=0)continue;if(!Object.prototype.hasOwnProperty.call(B,H))continue;y[H]=B[H]}return y}function R(B,k){if(!(B instanceof k))throw new TypeError("Cannot call a class as a function")}function T(B,k){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:B}function S(B,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);B.prototype=Object.create(k&&k.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(B,k):B.__proto__=k)}var D=function(k){return Object.keys(k).reduce(function(y,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(y[H]=k[H]),y},{})},I=function(B){S(k,B);function k(){var y,H,J,se;R(this,k);for(var fe=arguments.length,ve=Array(fe),Se=0;Se<fe;Se++)ve[Se]=arguments[Se];return se=(H=(J=T(this,(y=k.__proto__||Object.getPrototypeOf(k)).call.apply(y,[this].concat(ve))),J),J.state={uid:A()},J.reqs={},J.onChange=function(Ue){var Te=Ue.target.files;J.uploadFiles(Te),J.reset()},J.onClick=function(Ue){var Te=J.fileInput;if(!Te)return;var Ie=J.props,be=Ie.children,q=Ie.onClick;be&&be.type==="button"&&(Te.parentNode.focus(),Te.parentNode.querySelector("button").blur()),Te.click(),q&&q(Ue)},J.onKeyDown=function(Ue){Ue.key==="Enter"&&J.onClick()},J.onFileDrop=function(Ue){var Te=J.props.multiple;if(Ue.preventDefault(),Ue.type==="dragover")return;if(J.props.directory)c(Array.prototype.slice.call(Ue.dataTransfer.items),J.uploadFiles,function(be){return f(be,J.props.accept)});else{var Ie=Array.prototype.slice.call(Ue.dataTransfer.files).filter(function(be){return f(be,J.props.accept)});Te===!1&&(Ie=Ie.slice(0,1)),J.uploadFiles(Ie)}},J.uploadFiles=function(Ue){var Te=Array.prototype.slice.call(Ue);Te.map(function(Ie){return Ie.uid=A(),Ie}).forEach(function(Ie){J.upload(Ie,Te)})},J.saveFileInput=function(Ue){J.fileInput=Ue},H),T(J,se)}return t(k,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(H,J){var se=this,fe=this.props;if(!fe.beforeUpload)return setTimeout(function(){return se.post(H)},0);var ve=fe.beforeUpload(H,J);ve&&ve.then?ve.then(function(Se){var Ue=Object.prototype.toString.call(Se);return Ue==="[object File]"||Ue==="[object Blob]"?se.post(Se):se.post(H)}).catch(function(Se){console.log(Se)}):ve!==!1&&setTimeout(function(){return se.post(H)},0);return}},{key:"post",value:function(H){var J=this;if(!this._isMounted)return;var se=this.props,fe=se.onStart,ve=se.onProgress,Se=se.transformFile,Ue=Se===void 0?function(Te){return Te}:Se;new Promise(function(Te){var Ie=se.action;return typeof Ie=="function"&&(Ie=Ie(H)),Te(Ie)}).then(function(Te){var Ie=H.uid,be=se.customRequest||Y,q=Promise.resolve(Ue(H)).then(function(_){var L=se.data;return typeof L=="function"&&(L=L(_)),Promise.all([_,L])}).catch(function(_){console.error(_)});q.then(function(_){var L=i(_,2),z=L[0],ee=L[1],$={action:Te,filename:se.name,data:ee,file:z,headers:se.headers,withCredentials:se.withCredentials,method:se.method||"post",onProgress:ve?function(Ee){ve(Ee,H)}:null,onSuccess:function(Be,nt){delete J.reqs[Ie],se.onSuccess(Be,H,nt)},onError:function(Be,nt){delete J.reqs[Ie],se.onError(Be,nt,H)}};fe(H),J.reqs[Ie]=be($)})})}},{key:"reset",value:function(){this.setState({uid:A()})}},{key:"abort",value:function(H){var J=this.reqs;if(H){var se=H;H&&H.uid&&(se=H.uid),J[se]&&J[se].abort&&J[se].abort(),delete J[se]}else Object.keys(J).forEach(function(fe){J[fe]&&J[fe].abort&&J[fe].abort(),delete J[fe]})}},{key:"render",value:function(){var H,J=this.props,se=J.component,fe=J.prefixCls,ve=J.className,Se=J.disabled,Ue=J.id,Te=J.style,Ie=J.multiple,be=J.accept,q=J.children,_=J.directory,L=J.openFileDialogOnClick,z=J.onMouseEnter,ee=J.onMouseLeave,$=o(J,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Ee=Z()((H={},u(H,fe,!0),u(H,fe+"-disabled",Se),u(H,ve,ve),H)),Be=Se?{}:{onClick:L?this.onClick:function(){},onKeyDown:L?this.onKeyDown:function(){},onMouseEnter:z,onMouseLeave:ee,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Q.a.createElement(se,s({},Be,{className:Ee,role:"button",style:Te}),Q.a.createElement("input",s({},D($),{id:Ue,type:"file",ref:this.saveFileInput,onClick:function(we){return we.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:be,directory:_?"directory":null,webkitdirectory:_?"webkitdirectory":null,multiple:Ie,onChange:this.onChange})),q)}}]),k}(ne.Component),E=I,x=Object.assign||function(B){for(var k=1;k<arguments.length;k++){var y=arguments[k];for(var H in y)Object.prototype.hasOwnProperty.call(y,H)&&(B[H]=y[H])}return B},g=function(){function B(k,y){for(var H=0;H<y.length;H++){var J=y[H];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(k,J.key,J)}}return function(k,y,H){return y&&B(k.prototype,y),H&&B(k,H),k}}();function h(B,k){if(!(B instanceof k))throw new TypeError("Cannot call a class as a function")}function O(B,k){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:B}function w(B,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);B.prototype=Object.create(k&&k.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(B,k):B.__proto__=k)}function b(){}var W=function(B){w(k,B);function k(){var y,H,J,se;h(this,k);for(var fe=arguments.length,ve=Array(fe),Se=0;Se<fe;Se++)ve[Se]=arguments[Se];return se=(H=(J=O(this,(y=k.__proto__||Object.getPrototypeOf(k)).call.apply(y,[this].concat(ve))),J),J.saveUploader=function(Ue){J.uploader=Ue},H),O(J,se)}return g(k,[{key:"abort",value:function(H){this.uploader.abort(H)}},{key:"render",value:function(){return Q.a.createElement(E,x({},this.props,{ref:this.saveUploader}))}}]),k}(ne.Component);W.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:b,onError:b,onSuccess:b,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var j=W,C=Pe.a=j},HmJG:function(Et,Pe,F){},IBYe:function(Et,Pe,F){"use strict";function ne(Q){return null}Pe.a=ne},JYp7:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return ne});var ne;(function(Q){function U(o){return o&&typeof o=="object"&&typeof o[Symbol.iterator]=="function"}Q.is=U;const Z=Object.freeze([]);function G(){return Z}Q.empty=G;function*M(o){yield o}Q.single=M;function Y(o){return o||Z}Q.from=Y;function X(o){return!o||o[Symbol.iterator]().next().done===!0}Q.isEmpty=X;function r(o){return o[Symbol.iterator]().next().value}Q.first=r;function A(o,R){for(const T of o)if(R(T))return!0;return!1}Q.some=A;function m(o,R){for(const T of o)if(R(T))return T;return}Q.find=m;function*f(o,R){for(const T of o)R(T)&&(yield T)}Q.filter=f;function*p(o,R){let T=0;for(const S of o)yield R(S,T++)}Q.map=p;function*a(...o){for(const R of o)for(const T of R)yield T}Q.concat=a;function*c(o){for(const R of o)for(const T of R)yield T}Q.concatNested=c;function s(o,R,T){let S=T;for(const D of o)S=R(S,D);return S}Q.reduce=s;function*i(o,R,T=o.length){for(R<0&&(R+=o.length),T<0?T+=o.length:T>o.length&&(T=o.length);R<T;R++)yield o[R]}Q.slice=i;function t(o,R=Number.POSITIVE_INFINITY){const T=[];if(R===0)return[T,o];const S=o[Symbol.iterator]();for(let D=0;D<R;D++){const I=S.next();if(I.done)return[T,Q.empty()];T.push(I.value)}return[T,{[Symbol.iterator](){return S}}]}Q.consume=t;function u(o,R,T=(S,D)=>S===D){const S=o[Symbol.iterator](),D=R[Symbol.iterator]();for(;;){const I=S.next(),E=D.next();if(I.done!==E.done)return!1;if(I.done)return!0;if(!T(I.value,E.value))return!1}}Q.equals=u})(ne||(ne={}))},LYsE:function(Et,Pe,F){"use strict";var ne=F("9og8"),Q=F("giR+"),U=F("fyUT"),Z=F("2qtc"),G=F("kLXV"),M=F("/zsF"),Y=F("PArb"),X=F("14J3"),r=F("BMrR"),A=F("+L6B"),m=F("2/Rp"),f=F("k1fw"),p=F("0Owb"),a=F("tJVT"),c=F("WmNS"),s=F.n(c),i=F("q1tI"),t=F.n(i),u=F("5Dmo"),o=F("3S7+"),R=F("5NDa"),T=F("5rEg"),S=F("jCWc"),D=F("kPKH"),I=F("BoS7"),E=F("Sdc0"),x=F("7Kak"),g=F("9yH6"),h=F("sRBo"),O=F("kaz8"),w=F("miYZ"),b=F("tsqr"),W=F("oBTY"),j=F("PpiC"),C=F("Ty5D"),B=F("9kvl"),k=F("V0Rq"),y=F("Ot1p"),H=F("kqOp"),J=F("7qnI"),se=F("1vsH"),fe=F("YJx+"),ve=F.n(fe),Se=F("9Bee"),Ue=F("u2Z1"),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"],Ie="\u2581",be=function(Fe,pt){var Le=Fe.problemset,xe=Fe.globalSetting,ge=Fe.exercise,Hn=Fe.loading,Lt=Fe.dispatch,ke=Fe.editData,ut=Fe.editKey,Re=Fe.setEditKey,tn=Re===void 0?function(){}:Re,cr=Fe.cancelAdd,pr=cr===void 0?function(){}:cr,Kn=Fe.addCallback,jt=Kn===void 0?function(){}:Kn,dr=Fe.reload,ct=dr===void 0?function(){}:dr,Un=Fe.setIsClaer,yn=Un===void 0?function(){}:Un,ln=Object(j.a)(Fe,["problemset","globalSetting","exercise","loading","dispatch","editData","editKey","setEditKey","cancelAdd","addCallback","reload","setIsClaer"]),Xt=Object(i.useState)(""),Pn=Object(a.a)(Xt,2),hn=Pn[0],qt=Pn[1],Mt=Object(i.useState)(""),Kt=Object(a.a)(Mt,2),ar=Kt[0],sr=Kt[1],Fn=Object(i.useState)([]),bn=Object(a.a)(Fn,2),Ut=bn[0],Vt=bn[1],Gt=Object(i.useState)(""),Dt=Object(a.a)(Gt,2),Zn=Dt[0],On=Dt[1],fn=Object(i.useState)(),Vn=Object(a.a)(fn,2),un=Vn[0],_n=Vn[1],Zt=Object(i.useState)(!1),kn=Object(a.a)(Zt,2),er=kn[0],tr=kn[1],wn=Object(i.useState)(),Mn=Object(a.a)(wn,2),dn=Mn[0],or=Mn[1],Xn=Object(i.useState)(0),vr=Object(a.a)(Xn,2),gr=vr[0],Gn=vr[1],Bn=Object(i.useState)(!1),_r=Object(a.a)(Bn,2),Rn=_r[0],En=_r[1],Cn=Object(i.useState)(!1),vn=Object(a.a)(Cn,2),Qt=vn[0],St=vn[1],It=Object(i.useState)([]),kt=Object(a.a)(It,2),At=kt[0],zt=kt[1],sn=Object(i.useState)(1),nn=Object(a.a)(sn,2),ft=nn[0],rt=nn[1],$e=Object(i.useState)(!1),Ze=Object(a.a)($e,2),He=Ze[0],ot=Ze[1],et=Object(i.useRef)(!1),mt=Object(C.i)(),Tt=Object(i.useState)([]),gt=Object(a.a)(Tt,2),Pt=gt[0],vt=gt[1],yt=function(Jn){vt([].concat(Object(W.a)(Pt),[Object(f.a)({},Jn)]))};Object(i.useEffect)(function(){if(et.current)return;if(!(ke!=null&&ke.question_title)){En(!0),qt(""),_n(!1),or(2),Vt([]),On(""),tr(!1);return}qt(ke==null?void 0:ke.question_title),_n(ke==null?void 0:ke.is_ordered),rt(ke==null?void 0:ke.difficulty),ot(!(ke!=null&&ke.repeat_answer)),or(ke==null?void 0:ke.question_score);var Er=ke==null?void 0:ke.standard_answer.map(function(Jn){return Jn.answer_text});Vt(Object(W.a)(Er)),zt(ke.tag_discipline_ids),sr(ke==null?void 0:ke.analysis)},[ke,Rn]),Object(i.useEffect)(function(){tr(!1),Rn&&Er();function Er(){return Jn.apply(this,arguments)}function Jn(){return Jn=Object(ne.a)(s.a.mark(function xr(){var br,wr,Ur;return s.a.wrap(function(Fr){for(;;)switch(Fr.prev=Fr.next){case 0:return Fr.next=2,Object(k.I)({sub_discipline_id:(br=ge.editData)===null||br===void 0||((wr=br.exercise)===null||wr===void 0)?void 0:wr.sub_discipline_id});case 2:Ur=Fr.sent,vt(Ur.tag_disciplines);case 4:case"end":return Fr.stop()}},xr)})),Jn.apply(this,arguments)}},[Rn]),Object(i.useImperativeHandle)(pt,function(){return{onSave:$t,isEdit:Rn}}),Object(i.useEffect)(function(){var Er,Jn=ge!=null&&(Er=ge.tagDisciplineData)!==null&&Er!==void 0&&Er.tag_disciplines&&Array.isArray(ge.tagDisciplineData.tag_disciplines)?ge.tagDisciplineData.tag_disciplines:[];vt(Jn)},[ge.tagDisciplineData]);var on=function(Jn){(Jn==null?void 0:Jn.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),En(!1),tn(-1),et.current=!1,ct())},$t=function(){var Er=Object(ne.a)(s.a.mark(function Jn(){var xr,br,wr,Ur,Vr,Fr,kr;return s.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:if(xr=[],br=!1,St(!0),Ut.forEach(function(Si,qr){xr.push({choice_id:qr+1,answer_text:[]}),Si.forEach(function(ei,yi){xr[qr].answer_text.push(ei),(!ei||!Object(se.eb)(ei,1e4))&&(On("".concat(qr,"-").concat(yi)),b.b.info(ei?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),br=!0)})}),!br){Kr.next=7;break}return St(!1),Kr.abrupt("return",!1);case 7:if(et.current=!0,!ke.question_id){Kr.next=19;break}if(!((ke==null?void 0:ke.is_my)===1)){Kr.next=13;break}G.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Si=Object(ne.a)(s.a.mark(function ei(){var yi,Ri;return s.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return fi.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:ke.question_id,question_title:hn,question_type:3,question_score:dn,is_ordered:un,standard_answers:xr,tag_discipline_ids:At,sub_discipline_id:(yi=ge.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:ft,is_cover:1,repeat_answer:!He,analysis:ar}});case 2:wr=fi.sent,on(wr);case 4:case"end":return fi.stop()}},ei)}));function qr(){return Si.apply(this,arguments)}return qr}(),onCancel:function(){var Si=Object(ne.a)(s.a.mark(function ei(){var yi,Ri;return s.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return fi.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:ke.question_id,question_title:hn,question_type:3,question_score:dn,is_ordered:un,standard_answers:xr,tag_discipline_ids:At,sub_discipline_id:(yi=ge.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:ft,repeat_answer:!He,analysis:ar}});case 2:wr=fi.sent,on(wr);case 4:case"end":return fi.stop()}},ei)}));function qr(){return Si.apply(this,arguments)}return qr}()}),Kr.next=17;break;case 13:return Kr.next=15,Lt({type:"exercise/editExerciseQuestion",payload:{id:ke.question_id,question_title:hn,question_type:3,question_score:dn,is_ordered:un,standard_answers:xr,tag_discipline_ids:At,sub_discipline_id:(Ur=ge.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,difficulty:ft,repeat_answer:!He,analysis:ar}});case 15:wr=Kr.sent,on(wr);case 17:Kr.next=23;break;case 19:return Kr.next=21,Lt({type:"exercise/addExerciseQuestion",payload:{insert_id:ke==null?void 0:ke.insert_id,categoryId:mt.categoryId,question_title:hn,question_type:3,question_score:dn,is_ordered:un,standard_answers:xr,tag_discipline_ids:At,sub_discipline_id:(Fr=ge.editData)===null||Fr===void 0||((kr=Fr.exercise)===null||kr===void 0)?void 0:kr.sub_discipline_id,difficulty:ft,repeat_answer:!He,analysis:ar}});case 21:wr=Kr.sent,on(wr);case 23:return St(!1),Kr.abrupt("return",{name:hn,analysis:ar,standard_answers:xr,is_ordered:un});case 25:case"end":return Kr.stop()}},Jn)}));return function(){return Er.apply(this,arguments)}}(),hr=function(Jn,xr,br){var wr=Ut.slice();if(xr&&wr.splice(Jn,xr),br&&er||!ke.question_id)for(var Ur=0;Ur<br;Ur++)wr.splice(Jn+Ur,0,[""]);Gn(wr==null?void 0:wr.length),tr(!0),console.log(wr,"newStandardAnswers"),Vt(wr)},jn=function(Jn,xr,br){On("");var wr=Ut.slice();wr[Jn][xr]=br,Vt(wr)},Wn=function(Jn){var xr=Ut.slice();xr[Jn]=[].concat(Object(W.a)(xr[Jn]),[""]),Vt(xr)},Ft=function(Jn,xr){var br=Ut.slice();if(!br[Jn][xr]){br[Jn]=br[Jn].filter(function(wr,Ur){return Ur!==xr}),Vt(br);return}G.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:ve.a.modal,onOk:function(){br[Jn]=br[Jn].filter(function(Ur,Vr){return Vr!==xr}),Vt(br)}})},pn=function(Jn){G.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:ve.a.modal,onOk:function(){var br=0;qt(hn.replace(/\▁/g,function(wr){return br++,br-1===Jn?"":wr})),setTimeout(function(){var wr=Ut.slice();wr=Ut.filter(function(Ur,Vr){return Jn!==Vr}),Vt(wr)},500)}})},Ln=function(){},zn=function(){var Jn,xr,br,wr,Ur,Vr;return console.log(Ut,"answers"),t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),t.a.createElement("div",null,t.a.createElement(H.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:hn,onChange:function(kr){return qt(kr)},showNullButton:((Jn=ge.editData)===null||Jn===void 0||((xr=Jn.exercise)===null||xr===void 0)?void 0:xr.exercise_status)===1,deleteEmptyDisabled:!(((br=ge.editData)===null||br===void 0||((wr=br.exercise)===null||wr===void 0)?void 0:wr.exercise_status)===1)||Qt,onPlaceholderChange:hr})),t.a.createElement("div",{className:"mt20"},Ut.map(function(Fr,kr){var Ti,Kr;return t.a.createElement(J.a,{key:kr,answers:Fr,index:kr,is_md:!0,exerciseIsPublish:((Ti=ge.editData)===null||Ti===void 0||((Kr=Ti.exercise)===null||Kr===void 0)?void 0:Kr.exercise_status)!==1,activeOptionErrorIndex:Zn,onAnswerChange:jn,addChildAnswer:Wn,deleteChildAnswer:Ft,deleteChildAnswermain:pn})})),t.a.createElement("div",{className:"mt20"},Ut.length>1&&t.a.createElement("span",null,t.a.createElement(O.a,{checked:un,onChange:function(kr){return _n(kr.target.checked)},className:"".concat(ve.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ve.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:ar,onChange:function(kr){return sr(kr)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:dn,max:1e4,min:0,onChange:function(kr){or(kr)}})," ","\u5206 \xA0"," ",!!dn&&!!gr&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(dn/gr).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:ve.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:ft,onChange:function(kr){rt(kr.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:"".concat(ve.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{value:At,selectvalues:ke==null?void 0:ke.tag_discipline_ids,onChange:zt,subId:(Ur=ge.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,knowledgeOptions:Pt,onAddKnowledgeFinish:yt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:He,onChange:function(kr){ot(kr)}}))),t.a.createElement("aside",{className:"tr"},(ut!==-1||ke.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){pr(),En(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){$t()}},"\u4FDD\u5B58")))},mn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Er){var Jn,xr;return(ge==null||((Jn=ge.editData)===null||Jn===void 0||((xr=Jn.exercise)===null||xr===void 0))?void 0:xr.exercise_status)===1?Er:Er.id!=="del"&&Er.id!=="add"}),Ir=function(){var Er=Object(ne.a)(s.a.mark(function Jn(xr){return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:if(!(ut!==-1)){wr.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),wr.abrupt("return");case 3:wr.t0=xr.id,wr.next=wr.t0==="del"?6:wr.t0==="up"||wr.t0==="down"?8:wr.t0==="edit"?12:wr.t0==="add"?15:17;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function Vr(){return s.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:return kr.next=2,Object(k.n)({id:ke.question_id});case 2:Lt({type:"exercise/editExercise",payload:Object(f.a)({},mt)});case 3:case"end":return kr.stop()}},Vr)}))()}}),wr.abrupt("break",17);case 8:return wr.next=10,Lt({type:"exercise/exeriseMoveUpDown",payload:{id:ke.question_id,opr:xr.id}});case 10:return Lt({type:"exercise/editExercise",payload:Object(f.a)({},mt)}),wr.abrupt("break",17);case 12:return tn(ke.dragKey),En(!0),wr.abrupt("break",17);case 15:return jt({key:ke.key,insert_id:ke==null?void 0:ke.question_id,question_type:3}),wr.abrupt("break",17);case 17:case"end":return wr.stop()}},Jn)}));return function(xr){return Er.apply(this,arguments)}}(),jr=function(){var Jn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},!(ke!=null&&ke.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ke.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",ke.question_score,"\u5206\uFF09")),ke!=null&&ke.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ke.key,"."),t.a.createElement(Se.a,{value:ke.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ke.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:ke.question_title})),t.a.createElement("div",{className:ve.a.questionChoices},ke==null||((Jn=ke.standard_answer)===null||Jn===void 0)?void 0:Jn.map(function(xr,br){return t.a.createElement(r.a,{key:br,align:"middle"},t.a.createElement(D.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",xr.choice_id,"\uFF09\uFF1A"),t.a.createElement(D.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},xr.answer_text.map(function(wr,Ur){return t.a.createElement(D.a,{span:24,key:Ur},t.a.createElement(T.a,{key:br,checked:ke.standard_answer.includes(br),disabled:!0,value:wr}))}))))})),t.a.createElement("div",{className:ve.a.action},!ke.hideAction&&mn.map(function(xr,br){return xr.id==="up"&&ke.key===1||xr.id==="down"&&ke.key===ke.len?null:t.a.createElement(o.a,{key:br,placement:"bottom",title:xr.name},t.a.createElement("span",{onClick:function(){return Ir(xr)},className:xr.icon}))})))};return t.a.createElement("section",{className:ve.a.wrap},!Rn&&jr(),Rn&&zn())},q=Object(B.a)(function(at){var Fe=at.problemset,pt=at.loading,Le=at.exercise,xe=at.globalSetting;return{problemset:Fe,globalSetting:xe,exercise:Le,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(be)),_=["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"],L=function(Fe,pt){var Le=Fe.problemset,xe=Fe.globalSetting,ge=Fe.exercise,Hn=Fe.loading,Lt=Fe.dispatch,ke=Fe.onRef,ut=ke===void 0?function(){}:ke,Re=Fe.editData,tn=Fe.editKey,cr=Fe.setEditKey,pr=cr===void 0?function(){}:cr,Kn=Fe.cancelAdd,jt=Kn===void 0?function(){}:Kn,dr=Fe.reload,ct=dr===void 0?function(){}:dr,Un=Fe.addCallback,yn=Un===void 0?function(){}:Un,ln=Fe.setIsClaer,Xt=ln===void 0?function(){}:ln,Pn=Object(j.a)(Fe,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","editKey","setEditKey","cancelAdd","reload","addCallback","setIsClaer"]),hn=Object(i.useState)(),qt=Object(a.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(i.useState)(""),sr=Object(a.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(i.useState)(!1),Vt=Object(a.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(i.useState)(),On=Object(a.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(i.useState)([]),_n=Object(a.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(i.useState)([]),tr=Object(a.a)(er,2),wn=tr[0],Mn=tr[1],dn=Object(i.useState)(1),or=Object(a.a)(dn,2),Xn=or[0],vr=or[1],gr=Object(i.useState)(!1),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(i.useState)(""),En=Object(a.a)(Rn,2),Cn=En[0],vn=En[1],Qt=Object(i.useRef)(!1),St=function($e){Mn([].concat(Object(W.a)(wn),[Object(f.a)({},$e)]))},It=Object(C.i)();Object(i.useEffect)(function(){if(Qt.current)return;if(!(Re!=null&&Re.question_choices)){Dt(!0),bn(""),Vn(2),Kt("");return}_r(!(Re!=null&&Re.repeat_answer)),bn(Re==null?void 0:Re.question_title),Vn(Re==null?void 0:Re.question_score),vr(Re==null?void 0:Re.difficulty),Kt(Re.standard_answer[0]+""),kn(Re.tag_discipline_ids),vn(Re==null?void 0:Re.analysis)},[Re,Gt]),Object(i.useEffect)(function(){Gt&&rt();function rt(){return $e.apply(this,arguments)}function $e(){return $e=Object(ne.a)(s.a.mark(function Ze(){var He,ot,et;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(k.I)({sub_discipline_id:(He=ge.editData)===null||He===void 0||((ot=He.exercise)===null||ot===void 0)?void 0:ot.sub_discipline_id});case 2:et=Tt.sent,Mn(et.tag_disciplines);case 4:case"end":return Tt.stop()}},Ze)})),$e.apply(this,arguments)}},[Gt]),Object(i.useImperativeHandle)(pt,function(){return{onSave:At,isEdit:Gt}}),Object(i.useEffect)(function(){var rt,$e=ge!=null&&(rt=ge.tagDisciplineData)!==null&&rt!==void 0&&rt.tag_disciplines&&Array.isArray(ge.tagDisciplineData.tag_disciplines)?ge.tagDisciplineData.tag_disciplines:[];Mn($e)},[ge.tagDisciplineData]);var kt=function($e){($e==null?void 0:$e.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),Dt(!1),pr(-1),Qt.current=!1,ct())},At=function(){var rt=Object(ne.a)(s.a.mark(function $e(){var Ze,He,ot,et,mt,Tt;return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(Fn){Pt.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Pt.abrupt("return",!1);case 3:if(Mt){Pt.next=6;break}return b.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Pt.abrupt("return",!1);case 6:if(Ze=[{choice_text:"\u6B63\u786E",is_answer:Mt==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Mt==="2"?2:0}],Qt.current=!0,!Re.question_id){Pt.next=19;break}if(!((Re==null?void 0:Re.is_my)===1)){Pt.next=13;break}G.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var vt=Object(ne.a)(s.a.mark(function on(){var $t,hr;return s.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Wn.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Fn,question_type:2,question_score:fn,question_choices:Ze.map(function(Ft){return Ft.choice_text}),standard_answers:Ze.filter(function(Ft){return Ft.is_answer}).map(function(Ft){return Ft.is_answer}),tag_discipline_ids:Zt,sub_discipline_id:($t=ge.editData)===null||$t===void 0||((hr=$t.exercise)===null||hr===void 0)?void 0:hr.sub_discipline_id,difficulty:Xn,is_cover:1,repeat_answer:!Bn,analysis:Cn}});case 2:He=Wn.sent,kt(He);case 4:case"end":return Wn.stop()}},on)}));function yt(){return vt.apply(this,arguments)}return yt}(),onCancel:function(){var vt=Object(ne.a)(s.a.mark(function on(){var $t,hr;return s.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Wn.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Fn,question_type:2,question_score:fn,question_choices:Ze.map(function(Ft){return Ft.choice_text}),standard_answers:Ze.filter(function(Ft){return Ft.is_answer}).map(function(Ft){return Ft.is_answer}),tag_discipline_ids:Zt,sub_discipline_id:($t=ge.editData)===null||$t===void 0||((hr=$t.exercise)===null||hr===void 0)?void 0:hr.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Cn}});case 2:He=Wn.sent,kt(He);case 4:case"end":return Wn.stop()}},on)}));function yt(){return vt.apply(this,arguments)}return yt}()}),Pt.next=17;break;case 13:return Pt.next=15,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Fn,question_type:2,question_score:fn,question_choices:Ze.map(function(vt){return vt.choice_text}),standard_answers:Ze.filter(function(vt){return vt.is_answer}).map(function(vt){return vt.is_answer}),tag_discipline_ids:Zt,sub_discipline_id:(ot=ge.editData)===null||ot===void 0||((et=ot.exercise)===null||et===void 0)?void 0:et.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Cn}});case 15:He=Pt.sent,kt(He);case 17:Pt.next=23;break;case 19:return Pt.next=21,Lt({type:"exercise/addExerciseQuestion",payload:{insert_id:Re==null?void 0:Re.insert_id,categoryId:It.categoryId,question_title:Fn,question_type:2,question_score:fn,question_choices:Ze.map(function(vt){return vt.choice_text}),standard_answers:Ze.filter(function(vt){return vt.is_answer}).map(function(vt){return vt.is_answer}),tag_discipline_ids:Zt,sub_discipline_id:(mt=ge.editData)===null||mt===void 0||((Tt=mt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Cn}});case 21:He=Pt.sent,kt(He);case 23:return Pt.abrupt("return",{name:Fn,choices:Ze});case 24:case"end":return Pt.stop()}},$e)}));return function(){return rt.apply(this,arguments)}}(),zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(rt){var $e,Ze;return(ge==null||(($e=ge.editData)===null||$e===void 0||((Ze=$e.exercise)===null||Ze===void 0))?void 0:Ze.exercise_status)===1?rt:rt.id!=="del"&&rt.id!=="add"}),sn=function(){var rt=Object(ne.a)(s.a.mark(function $e(Ze){return s.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:if(!(tn!==-1)){ot.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),ot.abrupt("return");case 3:ot.t0=Ze.id,ot.next=ot.t0==="del"?6:ot.t0==="up"||ot.t0==="down"?8:ot.t0==="edit"?12:ot.t0==="add"?15:17;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function mt(){return s.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(k.n)({id:Re.question_id});case 2:Lt({type:"exercise/editExercise",payload:Object(f.a)({},It)});case 3:case"end":return gt.stop()}},mt)}))()}}),ot.abrupt("break",17);case 8:return ot.next=10,Lt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:Ze.id}});case 10:return Lt({type:"exercise/editExercise",payload:Object(f.a)({},It)}),ot.abrupt("break",17);case 12:return pr(Re.dragKey),Dt(!0),ot.abrupt("break",17);case 15:return yn({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:2}),ot.abrupt("break",17);case 17:case"end":return ot.stop()}},$e)}));return function(Ze){return rt.apply(this,arguments)}}(),nn=function(){var $e;return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Se.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:Re.question_title})),t.a.createElement("div",{className:ve.a.questionChoices},Re==null||(($e=Re.question_choices)===null||$e===void 0)?void 0:$e.map(function(Ze,He){return t.a.createElement(g.a,{key:He,checked:Re.standard_answer.includes(He+1),disabled:!0},_[He],"."," ",t.a.createElement("span",{className:"c-black font14"},Ze.choice_text))})),t.a.createElement("div",{className:ve.a.action},!Re.hideAction&&zt.map(function(Ze,He){return Ze.id==="up"&&Re.key===1||Ze.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:He,placement:"bottom",title:Ze.name},t.a.createElement("span",{onClick:function(){return sn(Ze)},className:Ze.icon}))})))},ft=function(){var $e,Ze;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.required},"*"),t.a.createElement("span",{className:ve.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Fn,onChange:function(ot){return bn(ot)}}),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.required},"*"),t.a.createElement("span",{className:ve.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(g.a.Group,{buttonStyle:"solid",value:Mt,onChange:function(ot){return Kt(ot.target.value)}},t.a.createElement(g.a.Button,{value:"1",className:"".concat(ve.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(g.a.Button,{value:"2",className:ve.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Cn,onChange:function(ot){return vn(ot)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:fn,max:1e4,min:0,onChange:function(ot){Vn(ot)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ve.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:Xn,onChange:function(ot){vr(ot.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:"".concat(ve.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{value:Zt,selectvalues:Re==null?void 0:Re.tag_discipline_ids,onChange:kn,subId:($e=ge.editData)===null||$e===void 0||((Ze=$e.exercise)===null||Ze===void 0)?void 0:Ze.sub_discipline_id,knowledgeOptions:wn,onAddKnowledgeFinish:St})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Bn,onChange:function(ot){_r(ot)}}))),t.a.createElement("aside",{className:"tr"},(tn!==-1||Re.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){jt(),Dt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){At()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ve.a.wrap},!Gt&&nn(),Gt&&ft())},z=Object(B.a)(function(at){var Fe=at.problemset,pt=at.loading,Le=at.exercise,xe=at.globalSetting;return{problemset:Fe,globalSetting:xe,exercise:Le,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(L)),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"],$=Object(i.forwardRef)(function(at,Fe){var pt=at.problemset,Le=at.globalSetting,xe=at.exercise,ge=at.loading,Hn=at.dispatch,Lt=at.onRef,ke=Lt===void 0?function(){}:Lt,ut=at.editData,Re=at.cancelAdd,tn=Re===void 0?function(){}:Re,cr=at.editKey,pr=at.setEditKey,Kn=pr===void 0?function(){}:pr,jt=at.setIsClaer,dr=jt===void 0?function(){}:jt,ct=at.addCallback,Un=ct===void 0?function(Tt){}:ct,yn=at.reload,ln=yn===void 0?function(){}:yn,Xt=Object(j.a)(at,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),Pn=Object(i.useState)([]),hn=Object(a.a)(Pn,2),qt=hn[0],Mt=hn[1],Kt=Object(i.useState)(),ar=Object(a.a)(Kt,2),sr=ar[0],Fn=ar[1],bn=Object(i.useState)([]),Ut=Object(a.a)(bn,2),Vt=Ut[0],Gt=Ut[1],Dt=Object(i.useState)(""),Zn=Object(a.a)(Dt,2),On=Zn[0],fn=Zn[1],Vn=Object(i.useState)(),un=Object(a.a)(Vn,2),_n=un[0],Zt=un[1],kn=Object(i.useState)(!1),er=Object(a.a)(kn,2),tr=er[0],wn=er[1],Mn=Object(i.useState)([]),dn=Object(a.a)(Mn,2),or=dn[0],Xn=dn[1],vr=Object(i.useState)(1),gr=Object(a.a)(vr,2),Gn=gr[0],Bn=gr[1],_r=Object(i.useState)(!1),Rn=Object(a.a)(_r,2),En=Rn[0],Cn=Rn[1],vn=Object(i.useState)(""),Qt=Object(a.a)(vn,2),St=Qt[0],It=Qt[1],kt=Object(i.useState)([]),At=Object(a.a)(kt,2),zt=At[0],sn=At[1],nn=Object(i.useRef)(!1),ft=function(gt){sn([].concat(Object(W.a)(zt),[Object(f.a)({},gt)]))},rt=Object(C.i)();Object(i.useEffect)(function(){Mt(["","","",""])},[]),Object(i.useEffect)(function(){if(nn.current)return;if(!(ut!=null&&ut.question_choices)){wn(!0),fn(""),Zt(5),Mt(["","","",""]),Gt([]);return}fn(ut==null?void 0:ut.question_title),Zt(ut==null?void 0:ut.question_score),Cn(!(ut!=null&&ut.repeat_answer)),Bn(ut==null?void 0:ut.difficulty),Mt(ut==null?void 0:ut.question_choices.map(function(gt){return gt.choice_text}));var Tt=[];ut==null||ut.standard_answer.map(function(gt,Pt){Tt.push(gt-1)}),Gt(Tt),Xn(ut.tag_discipline_ids),It(ut==null?void 0:ut.analysis)},[ut,tr]),Object(i.useEffect)(function(){tr&&Tt();function Tt(){return gt.apply(this,arguments)}function gt(){return gt=Object(ne.a)(s.a.mark(function Pt(){var vt,yt,on;return s.a.wrap(function(hr){for(;;)switch(hr.prev=hr.next){case 0:return hr.next=2,Object(k.I)({sub_discipline_id:(vt=xe.editData)===null||vt===void 0||((yt=vt.exercise)===null||yt===void 0)?void 0:yt.sub_discipline_id});case 2:on=hr.sent,sn(on.tag_disciplines);case 4:case"end":return hr.stop()}},Pt)})),gt.apply(this,arguments)}},[tr]),Object(i.useImperativeHandle)(Fe,function(){return{onSave:Ze,isEdit:tr}}),Object(i.useEffect)(function(){var Tt,gt=xe!=null&&(Tt=xe.tagDisciplineData)!==null&&Tt!==void 0&&Tt.tag_disciplines&&Array.isArray(xe.tagDisciplineData.tag_disciplines)?xe.tagDisciplineData.tag_disciplines:[];sn(gt)},[xe.tagDisciplineData]);var $e=function(gt){(gt==null?void 0:gt.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),wn(!1),Kn(-1),nn.current=!1,ln())},Ze=function(){var Tt=Object(ne.a)(s.a.mark(function gt(){var Pt,vt,yt,on,$t,hr,jn;return s.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:if(On){Ft.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ft.abrupt("return",!1);case 3:if(Pt=qt.findIndex(function(pn){return!pn}),!(Pt>-1)){Ft.next=7;break}return b.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ee[Pt]," \u9009\u9879\u7684\u5185\u5BB9")),Ft.abrupt("return",!1);case 7:if(Vt.length){Ft.next=10;break}return b.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ft.abrupt("return",!1);case 10:if(!(Vt.length<1)){Ft.next=13;break}return b.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ft.abrupt("return",!1);case 13:if(vt=qt.map(function(pn,Ln){return{choice_text:pn,is_answer:Vt.includes(Ln)?Ln+1:0}}),nn.current=!0,!ut.question_id){Ft.next=26;break}if(!((ut==null?void 0:ut.is_my)===1)){Ft.next=20;break}G.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var pn=Object(ne.a)(s.a.mark(function zn(){var mn,Ir;return s.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,Hn({type:"exercise/editExerciseQuestion",payload:{id:ut.question_id,question_title:On,question_type:1,question_score:_n,question_choices:vt.map(function(Jn){return Jn.choice_text}),standard_answers:vt.filter(function(Jn){return Jn.is_answer}).map(function(Jn){return Jn.is_answer}),tag_discipline_ids:or,sub_discipline_id:(mn=xe.editData)===null||mn===void 0||((Ir=mn.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:Gn,is_cover:1,repeat_answer:!En,analysis:St}});case 2:yt=Er.sent,$e(yt);case 4:case"end":return Er.stop()}},zn)}));function Ln(){return pn.apply(this,arguments)}return Ln}(),onCancel:function(){var pn=Object(ne.a)(s.a.mark(function zn(){var mn,Ir;return s.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,Hn({type:"exercise/editExerciseQuestion",payload:{id:ut.question_id,question_title:On,question_type:1,question_score:_n,question_choices:vt.map(function(Jn){return Jn.choice_text}),standard_answers:vt.filter(function(Jn){return Jn.is_answer}).map(function(Jn){return Jn.is_answer}),tag_discipline_ids:or,sub_discipline_id:(mn=xe.editData)===null||mn===void 0||((Ir=mn.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:Gn,repeat_answer:!En,analysis:St}});case 2:yt=Er.sent,$e(yt);case 4:case"end":return Er.stop()}},zn)}));function Ln(){return pn.apply(this,arguments)}return Ln}()}),Ft.next=24;break;case 20:return Ft.next=22,Hn({type:"exercise/editExerciseQuestion",payload:{id:ut.question_id,question_title:On,question_type:1,question_score:_n,question_choices:vt.map(function(pn){return pn.choice_text}),standard_answers:vt.filter(function(pn){return pn.is_answer}).map(function(pn){return pn.is_answer}),tag_discipline_ids:or,sub_discipline_id:(on=xe.editData)===null||on===void 0||(($t=on.exercise)===null||$t===void 0)?void 0:$t.sub_discipline_id,difficulty:Gn,repeat_answer:!En,analysis:St}});case 22:yt=Ft.sent,$e(yt);case 24:Ft.next=30;break;case 26:return Ft.next=28,Hn({type:"exercise/addExerciseQuestion",payload:{insert_id:ut==null?void 0:ut.insert_id,categoryId:rt.categoryId,question_title:On,question_type:1,question_score:_n,question_choices:vt.map(function(pn){return pn.choice_text}),standard_answers:vt.filter(function(pn){return pn.is_answer}).map(function(pn){return pn.is_answer}),tag_discipline_ids:or,sub_discipline_id:(hr=xe.editData)===null||hr===void 0||((jn=hr.exercise)===null||jn===void 0)?void 0:jn.sub_discipline_id,difficulty:Gn,repeat_answer:!En,analysis:St}});case 28:yt=Ft.sent,$e(yt);case 30:case"end":return Ft.stop()}},gt)}));return function(){return Tt.apply(this,arguments)}}(),He=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Tt){var gt,Pt;return(xe==null||((gt=xe.editData)===null||gt===void 0||((Pt=gt.exercise)===null||Pt===void 0))?void 0:Pt.exercise_status)===1?Tt:Tt.id!=="del"&&Tt.id!=="add"}),ot=function(){var Tt=Object(ne.a)(s.a.mark(function gt(Pt){return s.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:if(!(cr!==-1)){yt.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),yt.abrupt("return");case 3:yt.t0=Pt.id,yt.next=yt.t0==="del"?6:yt.t0==="up"||yt.t0==="down"?8:yt.t0==="edit"?12:yt.t0==="add"?15:17;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function $t(){return s.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:return jn.next=2,Object(k.n)({id:ut.question_id});case 2:Hn({type:"exercise/editExercise",payload:Object(f.a)({},rt)});case 3:case"end":return jn.stop()}},$t)}))()}}),yt.abrupt("break",17);case 8:return yt.next=10,Hn({type:"exercise/exeriseMoveUpDown",payload:{id:ut.question_id,opr:Pt.id}});case 10:return Hn({type:"exercise/editExercise",payload:Object(f.a)({},rt)}),yt.abrupt("break",17);case 12:return Kn(ut.dragKey),wn(!0),yt.abrupt("break",17);case 15:return Un({key:ut.key,insert_id:ut==null?void 0:ut.question_id,question_type:1}),yt.abrupt("break",17);case 17:case"end":return yt.stop()}},gt)}));return function(Pt){return Tt.apply(this,arguments)}}(),et=function(){var gt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},!(ut!=null&&ut.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ut.key,"\u3001\u591A\u9009\u9898"),"\uFF08",ut.question_score,"\u5206\uFF09")),ut!=null&&ut.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ut.key,"."),t.a.createElement(Se.a,{value:ut.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ut.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:ut.question_title})),t.a.createElement("div",{className:ve.a.questionChoices},ut==null||((gt=ut.question_choices)===null||gt===void 0)?void 0:gt.map(function(Pt,vt){return t.a.createElement(r.a,{key:vt},t.a.createElement(D.a,null,t.a.createElement(O.a,{key:vt,checked:ut.standard_answer.includes(vt+1),disabled:!0},ee[vt],".")),t.a.createElement(D.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Se.a,{value:Pt.choice_text}))))})),t.a.createElement("div",{className:ve.a.action},!ut.hideAction&&He.map(function(Pt,vt){return Pt.id==="up"&&ut.key===1||Pt.id==="down"&&ut.key===ut.len?null:t.a.createElement(o.a,{key:vt,placement:"bottom",title:Pt.name},t.a.createElement("span",{onClick:function(){return ot(Pt)},className:Pt.icon}))})))},mt=function(){var gt,Pt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.required},"*"),t.a.createElement("span",{className:ve.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:On,onChange:function(yt){return fn(yt)}}),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.required},"*"),t.a.createElement("span",{className:ve.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),qt.map(function(vt,yt){var on,$t;return t.a.createElement("div",{className:ve.a.choiceWrap,key:yt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ve.a.answer," ").concat(Vt.includes(yt)?ve.a.activeAnswer:""),onClick:function(){Vt.includes(yt)?Gt(Vt.filter(function(jn){return jn!==yt})):Gt([].concat(Object(W.a)(Vt),[yt]))}},ee[yt])),t.a.createElement("div",{className:ve.a.editorWrap},sr===yt?t.a.createElement(y.a,{id:"single-question-option-".concat(yt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:vt,onChange:function(jn){qt[yt]=jn,Mt(qt)}}):t.a.createElement("div",{className:ve.a.htmlWrap,onClick:function(){return Fn(yt)}},t.a.createElement(Se.a,{value:vt}))),((on=xe.editData)===null||on===void 0||(($t=on.exercise)===null||$t===void 0)?void 0:$t.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,yt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ve.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Mt(qt.filter(function(jn,Wn){return Wn!==yt}))}})),yt<7&&yt===qt.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ve.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Mt([].concat(Object(W.a)(qt),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:St,onChange:function(yt){return It(yt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:_n,max:1e4,min:0,onChange:function(yt){Zt(yt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ve.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:Gn,onChange:function(yt){Bn(yt.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:"".concat(ve.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{value:or,selectvalues:ut==null?void 0:ut.tag_discipline_ids,onChange:Xn,subId:(gt=xe.editData)===null||gt===void 0||((Pt=gt.exercise)===null||Pt===void 0)?void 0:Pt.sub_discipline_id,knowledgeOptions:zt,onAddKnowledgeFinish:ft})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:En,onChange:function(yt){Cn(yt)}}))),t.a.createElement("aside",{className:"tr"},(cr!==-1||ut.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){tn(),wn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Ze()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ve.a.wrap},!tr&&et(),tr&&mt())}),Ee=Object(B.a)(function(at){var Fe=at.problemset,pt=at.loading,Le=at.exercise,xe=at.globalSetting;return{problemset:Fe,globalSetting:xe,exercise:Le,loading:pt.effects}},null,null,{forwardRef:!0})($),Be=F("55Ip"),nt=["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"],we=function(Fe,pt){var Le=Fe.problemset,xe=Fe.globalSetting,ge=Fe.exercise,Hn=Fe.loading,Lt=Fe.dispatch,ke=Fe.editData,ut=Fe.cancelAdd,Re=ut===void 0?function(){}:ut,tn=Fe.editKey,cr=Fe.setEditKey,pr=cr===void 0?function(){}:cr,Kn=Fe.addCallback,jt=Kn===void 0?function(){}:Kn,dr=Fe.reload,ct=dr===void 0?function(){}:dr,Un=Fe.setIsClaer,yn=Un===void 0?function(){}:Un,ln=Object(j.a)(Fe,["problemset","globalSetting","exercise","loading","dispatch","editData","cancelAdd","editKey","setEditKey","addCallback","reload","setIsClaer"]),Xt=Object(i.useState)(""),Pn=Object(a.a)(Xt,2),hn=Pn[0],qt=Pn[1],Mt=Object(i.useState)(""),Kt=Object(a.a)(Mt,2),ar=Kt[0],sr=Kt[1],Fn=Object(i.useState)(""),bn=Object(a.a)(Fn,2),Ut=bn[0],Vt=bn[1],Gt=Object(i.useState)([]),Dt=Object(a.a)(Gt,2),Zn=Dt[0],On=Dt[1],fn=Object(i.useState)(""),Vn=Object(a.a)(fn,2),un=Vn[0],_n=Vn[1],Zt=Object(i.useState)(),kn=Object(a.a)(Zt,2),er=kn[0],tr=kn[1],wn=Object(i.useState)(!1),Mn=Object(a.a)(wn,2),dn=Mn[0],or=Mn[1],Xn=Object(i.useState)([]),vr=Object(a.a)(Xn,2),gr=vr[0],Gn=vr[1],Bn=Object(i.useState)(!1),_r=Object(a.a)(Bn,2),Rn=_r[0],En=_r[1],Cn=Object(i.useState)(!1),vn=Object(a.a)(Cn,2),Qt=vn[0],St=vn[1],It=Object(C.i)(),kt=Object(i.useRef)(!1);Object(i.useEffect)(function(){var $e;if(kt.current)return;ke.edit&&(En(!0),sr(""),qt(""),Gn([])),qt(ke.shixun_name),sr(ke.question_title);var Ze=[];($e=ke.shixun)===null||$e===void 0||$e.map(function(He){Ze.push(He.challenge_score)}),Gn(Ze)},[ke]),Object(i.useEffect)(function(){or(!1)},[Rn]),Object(i.useImperativeHandle)(pt,function(){return{onSave:zt,isEdit:Rn}});var At=function(Ze){(Ze==null?void 0:Ze.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),En(!1),pr(-1),kt.current=!1,ct())},zt=function(){var $e=Object(ne.a)(s.a.mark(function Ze(){var He,ot,et;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:if(He=[],ot=!1,!ot){Tt.next=4;break}return Tt.abrupt("return",!1);case 4:if(kt.current=!0,St(!0),!ke.question_id){Tt.next=12;break}return Tt.next=9,Lt({type:"exercise/editExerciseQuestion",payload:{id:ke.question_id,question_title:ar,shixun_name:hn,shixun_id:ke.shixun_id,question_type:5,question_scores:gr}});case 9:et=Tt.sent,Tt.next=15;break;case 12:return Tt.next=14,Lt({type:"exercise/addExerciseQuestion",payload:{insert_id:ke==null?void 0:ke.insert_id,categoryId:It.categoryId,question_title:ar,shixun_name:hn,shixun_id:ke.shixun_id,question_type:5,question_scores:gr,is_copy:ke.is_copy}});case 14:et=Tt.sent;case 15:return At(et),St(!1),Tt.abrupt("return",{name:ar,analysis:Ut,standard_answers:He,is_ordered:er});case 18:case"end":return Tt.stop()}},Ze)}));return function(){return $e.apply(this,arguments)}}(),sn=function(){var Ze;return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(T.a,{defaultValue:hn,onChange:function(ot){qt(ot.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(y.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:ar,onChange:function(ot){sr(ot)}})),t.a.createElement("div",{className:"mt20"},(Ze=ke.shixun)===null||Ze===void 0?void 0:Ze.map(function(He,ot){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(D.a,{flex:"1"},ot+1,".",He.challenge_name),t.a.createElement(D.a,null,t.a.createElement(U.a,{defaultValue:gr[ot],onChange:function(mt){gr[ot]=mt,Gn(gr),console.log("srore:L",gr[ot])}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Zn.length>1&&t.a.createElement("span",null,t.a.createElement(O.a,{checked:er,onChange:function(ot){return tr(ot.target.checked)},className:"".concat(ve.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ve.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(tn!==-1||!(ke!=null&&ke.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){Re(),En(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:Qt,className:"ml20",type:"primary",onClick:function(){zt()}},"\u4FDD\u5B58")))},nn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function($e){var Ze,He;return(ge==null||((Ze=ge.editData)===null||Ze===void 0||((He=Ze.exercise)===null||He===void 0))?void 0:He.exercise_status)===1?$e:$e.id!=="del"&&$e.id!=="add"}),ft=function(){var $e=Object(ne.a)(s.a.mark(function Ze(He){return s.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:if(!(tn!==-1)){et.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),et.abrupt("return");case 3:et.t0=He.id,et.next=et.t0==="del"?6:et.t0==="up"||et.t0==="down"?8:et.t0==="edit"?12:et.t0==="add"?15:17;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function Tt(){return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(k.n)({id:ke.question_id});case 2:Lt({type:"exercise/editExercise",payload:Object(f.a)({},It)});case 3:case"end":return Pt.stop()}},Tt)}))()}}),et.abrupt("break",17);case 8:return et.next=10,Lt({type:"exercise/exeriseMoveUpDown",payload:{id:ke.question_id,opr:He.id}});case 10:return Lt({type:"exercise/editExercise",payload:Object(f.a)({},It)}),et.abrupt("break",17);case 12:return pr(ke.dragKey),En(!0),et.abrupt("break",17);case 15:return Lt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:ke.key,insert_id:ke==null?void 0:ke.question_id,question_type:5}}}),et.abrupt("break",17);case 17:case"end":return et.stop()}},Ze)}));return function(He){return $e.apply(this,arguments)}}(),rt=function(){var Ze,He;return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},!(ke!=null&&ke.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ke.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",ke.question_score,"\u5206\uFF09")),ke!=null&&ke.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ke.key,"."),t.a.createElement(Se.a,{value:ke.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ke.question_score,"\u5206\uFF09"),!!((Ze=ke.schools)!==null&&Ze!==void 0&&Ze.length)&&t.a.createElement(o.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:ke.shixun_name})),t.a.createElement("div",{className:"mt30"}),(He=ke.shixun)===null||He===void 0?void 0:He.map(function(ot,et){return t.a.createElement("div",{key:et},"\u7B2C",et+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},ot.challenge_name)," ",t.a.createElement("span",{className:"ml10"},ot.challenge_score," \u5206"))}),t.a.createElement("div",{className:ve.a.action},t.a.createElement(Be.a,{target:"_blank",to:"/shixuns/".concat(ke.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!ke.hideAction&&nn.map(function(ot,et){return ot.id==="up"&&ke.key===1||ot.id==="down"&&ke.key===ke.len?null:t.a.createElement(o.a,{key:et,placement:"bottom",title:ot.name},t.a.createElement("span",{onClick:function(){return ft(ot)},className:ot.icon}))})))};return t.a.createElement("section",{className:ve.a.wrap},!Rn&&rt(),Rn&&sn())},Ne=Object(B.a)(function(at){var Fe=at.problemset,pt=at.loading,Le=at.globalSetting,xe=at.exercise;return{problemset:Fe,globalSetting:Le,exercise:xe,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(we)),Ye=["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"],Xe=function(Fe,pt){var Le=Fe.problemset,xe=Fe.exercise,ge=Fe.globalSetting,Hn=Fe.loading,Lt=Fe.dispatch,ke=Fe.onRef,ut=ke===void 0?function(){}:ke,Re=Fe.editData,tn=Fe.cancelAdd,cr=tn===void 0?function(){}:tn,pr=Fe.editKey,Kn=Fe.setEditKey,jt=Kn===void 0?function(){}:Kn,dr=Fe.setIsClaer,ct=dr===void 0?function(){}:dr,Un=Fe.reload,yn=Un===void 0?function(){}:Un,ln=Fe.addCallback,Xt=ln===void 0?function(Pt){}:ln,Pn=Object(j.a)(Fe,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","reload","addCallback"]),hn=Object(i.useState)([]),qt=Object(a.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(i.useState)(),sr=Object(a.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(i.useState)([]),Vt=Object(a.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(i.useState)(""),On=Object(a.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(i.useState)(),_n=Object(a.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(i.useState)([]),tr=Object(a.a)(er,2),wn=tr[0],Mn=tr[1],dn=Object(i.useState)(!1),or=Object(a.a)(dn,2),Xn=or[0],vr=or[1],gr=Object(i.useState)(1),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(i.useState)(!1),En=Object(a.a)(Rn,2),Cn=En[0],vn=En[1],Qt=Object(i.useState)(""),St=Object(a.a)(Qt,2),It=St[0],kt=St[1],At=Object(C.i)(),zt=Object(i.useRef)(null),sn=Object(i.useRef)(!1),nn=Object(i.useState)([]),ft=Object(a.a)(nn,2),rt=ft[0],$e=ft[1],Ze=function(vt){$e([].concat(Object(W.a)(rt),[Object(f.a)({},vt)]))};Object(i.useEffect)(function(){Kt(["","","",""])},[]),Object(i.useEffect)(function(){if(sn.current)return;if(!(Re!=null&&Re.question_choices)){vr(!0),Vn(""),kn(5),Kt(["","","",""]),Dt([]);return}Vn(Re==null?void 0:Re.question_title),kn(Re==null?void 0:Re.question_score),vn(!(Re!=null&&Re.repeat_answer)),kt(Re==null?void 0:Re.analysis),_r(Re==null?void 0:Re.difficulty),Kt(Re==null?void 0:Re.question_choices.map(function(vt){return vt.choice_text}));var Pt=[];Re==null||Re.standard_answer.map(function(vt,yt){Pt.push(vt-1)}),Mn(Re.tag_discipline_ids),Dt(Pt)},[Re,Xn]),Object(i.useEffect)(function(){Xn&&Pt();function Pt(){return vt.apply(this,arguments)}function vt(){return vt=Object(ne.a)(s.a.mark(function yt(){var on,$t,hr;return s.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Wn.next=2,Object(k.I)({sub_discipline_id:(on=xe.editData)===null||on===void 0||(($t=on.exercise)===null||$t===void 0)?void 0:$t.sub_discipline_id});case 2:hr=Wn.sent,$e(hr.tag_disciplines);case 4:case"end":return Wn.stop()}},yt)})),vt.apply(this,arguments)}},[Xn]),Object(i.useEffect)(function(){var Pt,vt=xe!=null&&(Pt=xe.tagDisciplineData)!==null&&Pt!==void 0&&Pt.tag_disciplines&&Array.isArray(xe.tagDisciplineData.tag_disciplines)?xe.tagDisciplineData.tag_disciplines:[];$e(vt)},[xe.tagDisciplineData]),Object(i.useImperativeHandle)(pt,function(){return{onSave:ot,isEdit:Xn}});var He=function(vt){(vt==null?void 0:vt.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),vr(!1),jt(-1),sn.current=!1,yn())},ot=function(){var Pt=Object(ne.a)(s.a.mark(function vt(){var yt,on,$t,hr,jn,Wn,Ft;return s.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(fn){Ln.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ln.abrupt("return",!1);case 3:if(yt=Mt.findIndex(function(zn){return!zn}),!(yt>-1)){Ln.next=7;break}return b.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ye[yt]," \u9009\u9879\u7684\u5185\u5BB9")),Ln.abrupt("return",!1);case 7:if(Gt.length){Ln.next=10;break}return b.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ln.abrupt("return",!1);case 10:if(!(Gt.length<1)){Ln.next=13;break}return b.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ln.abrupt("return",!1);case 13:if(on=Mt.map(function(zn,mn){return{choice_text:zn,is_answer:Gt.includes(mn)?mn+1:0}}),sn.current=!0,!Re.question_id){Ln.next=26;break}if(!((Re==null?void 0:Re.is_my)===1)){Ln.next=20;break}G.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var zn=Object(ne.a)(s.a.mark(function Ir(){var jr,Er;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:fn,question_type:1,question_score:Zt,question_choices:on.map(function(br){return br.choice_text}),standard_answers:on.filter(function(br){return br.is_answer}).map(function(br){return br.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(jr=xe.editData)===null||jr===void 0||((Er=jr.exercise)===null||Er===void 0)?void 0:Er.sub_discipline_id,difficulty:Bn,is_cover:1,repeat_answer:!Cn,analysis:It}});case 2:$t=xr.sent,He($t);case 4:case"end":return xr.stop()}},Ir)}));function mn(){return zn.apply(this,arguments)}return mn}(),onCancel:function(){var zn=Object(ne.a)(s.a.mark(function Ir(){var jr,Er;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:fn,question_type:1,question_score:Zt,question_choices:on.map(function(br){return br.choice_text}),standard_answers:on.filter(function(br){return br.is_answer}).map(function(br){return br.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(jr=xe.editData)===null||jr===void 0||((Er=jr.exercise)===null||Er===void 0)?void 0:Er.sub_discipline_id,difficulty:Bn,repeat_answer:!Cn,analysis:It}});case 2:$t=xr.sent,He($t);case 4:case"end":return xr.stop()}},Ir)}));function mn(){return zn.apply(this,arguments)}return mn}()}),Ln.next=24;break;case 20:return Ln.next=22,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:fn,question_type:1,question_score:Zt,question_choices:on.map(function(zn){return zn.choice_text}),standard_answers:on.filter(function(zn){return zn.is_answer}).map(function(zn){return zn.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(hr=xe.editData)===null||hr===void 0||((jn=hr.exercise)===null||jn===void 0)?void 0:jn.sub_discipline_id,difficulty:Bn,repeat_answer:!Cn,analysis:It}});case 22:$t=Ln.sent,He($t);case 24:Ln.next=30;break;case 26:return Ln.next=28,Lt({type:"exercise/addExerciseQuestion",payload:{insert_id:Re==null?void 0:Re.insert_id,categoryId:At.categoryId,question_title:fn,question_type:1,question_score:Zt,question_choices:on.map(function(zn){return zn.choice_text}),standard_answers:on.filter(function(zn){return zn.is_answer}).map(function(zn){return zn.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(Wn=xe.editData)===null||Wn===void 0||((Ft=Wn.exercise)===null||Ft===void 0)?void 0:Ft.sub_discipline_id,difficulty:Bn,repeat_answer:!Cn,analysis:It}});case 28:$t=Ln.sent,He($t);case 30:case"end":return Ln.stop()}},vt)}));return function(){return Pt.apply(this,arguments)}}(),et=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Pt){var vt,yt;return(xe==null||((vt=xe.editData)===null||vt===void 0||((yt=vt.exercise)===null||yt===void 0))?void 0:yt.exercise_status)===1?Pt:Pt.id!=="del"&&Pt.id!=="add"}),mt=function(){var Pt=Object(ne.a)(s.a.mark(function vt(yt){return s.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:if(!(pr!==-1)){$t.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),$t.abrupt("return");case 3:$t.t0=yt.id,$t.next=$t.t0==="del"?6:$t.t0==="up"||$t.t0==="down"?8:$t.t0==="edit"?12:$t.t0==="add"?15:17;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function jn(){return s.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return Ft.next=2,Object(k.n)({id:Re.question_id});case 2:Lt({type:"exercise/editExercise",payload:Object(f.a)({},At)});case 3:case"end":return Ft.stop()}},jn)}))()}}),$t.abrupt("break",17);case 8:return $t.next=10,Lt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:yt.id}});case 10:return Lt({type:"exercise/editExercise",payload:Object(f.a)({},At)}),$t.abrupt("break",17);case 12:return jt(Re.dragKey),vr(!0),$t.abrupt("break",17);case 15:return Xt({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:0}),$t.abrupt("break",17);case 17:case"end":return $t.stop()}},vt)}));return function(yt){return Pt.apply(this,arguments)}}(),Tt=function(){var vt;return t.a.createElement("aside",{ref:zt},t.a.createElement("div",{className:ve.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u5355\u9009\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Se.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:Re.question_title})),t.a.createElement("div",{className:ve.a.questionChoices},Re==null||((vt=Re.question_choices)===null||vt===void 0)?void 0:vt.map(function(yt,on){return t.a.createElement(r.a,{key:on},t.a.createElement(D.a,null,t.a.createElement(g.a,{key:on,checked:Re.standard_answer.includes(on+1),disabled:!0},Ye[on],".")),t.a.createElement(D.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Se.a,{value:yt.choice_text}))))})),t.a.createElement("div",{className:ve.a.action},!Re.hideAction&&et.map(function(yt,on){return yt.id==="up"&&Re.key===1||yt.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:on,placement:"bottom",title:yt.name},t.a.createElement("span",{onClick:function(){return mt(yt)},className:yt.icon}))})))},gt=function(){var vt,yt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.required},"*"),t.a.createElement("span",{className:ve.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:fn,onChange:function($t){return Vn($t)}}),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.required},"*"),t.a.createElement("span",{className:ve.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Mt.map(function(on,$t){var hr,jn;return t.a.createElement("div",{className:ve.a.choiceWrap,key:$t},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ve.a.answer," ").concat(Gt.includes($t)?ve.a.activeAnswer:""),onClick:function(){Gt.includes($t)?Dt(Gt.filter(function(Ft){return Ft!==$t})):Dt([].concat(Object(W.a)(Gt),[$t]))}},Ye[$t])),t.a.createElement("div",{className:ve.a.editorWrap},Fn===$t?t.a.createElement(y.a,{id:"single-question-option-".concat($t),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:on,onChange:function(Ft){Mt[$t]=Ft,Kt(Mt)}}):t.a.createElement("div",{className:ve.a.htmlWrap,onClick:function(){return bn($t)}},t.a.createElement(Se.a,{value:on}))),((hr=xe.editData)===null||hr===void 0||((jn=hr.exercise)===null||jn===void 0)?void 0:jn.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,$t>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ve.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Kt(Mt.filter(function(Ft,pn){return pn!==$t}))}})),$t<7&&$t===Mt.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ve.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Kt([].concat(Object(W.a)(Mt),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:It,onChange:function($t){return kt($t)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Zt,max:1e4,min:0,onChange:function($t){kn($t)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ve.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:Bn,onChange:function($t){_r($t.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:ve.a.titleWrap},t.a.createElement("span",{className:"".concat(ve.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{selectvalues:Re==null?void 0:Re.tag_discipline_ids,value:wn,onChange:Mn,subId:(vt=xe.editData)===null||vt===void 0||((yt=vt.exercise)===null||yt===void 0)?void 0:yt.sub_discipline_id,knowledgeOptions:rt,onAddKnowledgeFinish:Ze})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Cn,onChange:function($t){vn($t)}}))),t.a.createElement("aside",{className:"tr"},(pr!==-1||Re.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){cr(),vr(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){ot()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ve.a.wrap},!Xn&&Tt(),Xn&&gt())},ht=Object(B.a)(function(at){var Fe=at.problemset,pt=at.loading,Le=at.globalSetting,xe=at.exercise;return{problemset:Fe,globalSetting:Le,exercise:xe,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Xe)),wt=F("Z9P2"),Bt=["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"],Wt=function(Fe,pt){var Le=Fe.problemset,xe=Fe.exercise,ge=Fe.globalSetting,Hn=Fe.loading,Lt=Fe.dispatch,ke=Fe.onRef,ut=ke===void 0?function(){}:ke,Re=Fe.editData,tn=Fe.cancelAdd,cr=tn===void 0?function(){}:tn,pr=Fe.editKey,Kn=Fe.setEditKey,jt=Kn===void 0?function(){}:Kn,dr=Fe.reload,ct=dr===void 0?function(){}:dr,Un=Fe.addCallback,yn=Un===void 0?function(){}:Un,ln=Fe.setIsClaer,Xt=ln===void 0?function(){}:ln,Pn=Object(j.a)(Fe,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","reload","addCallback","setIsClaer"]),hn=Object(i.useState)(""),qt=Object(a.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(i.useState)(""),sr=Object(a.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(i.useState)(""),Vt=Object(a.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(i.useState)(),On=Object(a.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(i.useState)(!1),_n=Object(a.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(i.useState)([]),tr=Object(a.a)(er,2),wn=tr[0],Mn=tr[1],dn=Object(i.useState)(1),or=Object(a.a)(dn,2),Xn=or[0],vr=or[1],gr=Object(i.useState)(!1),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(i.useState)([[],[]]),En=Object(a.a)(Rn,2),Cn=En[0],vn=En[1],Qt=Object(i.useRef)(!1),St=Object(C.i)(),It=Object(i.useState)([]),kt=Object(a.a)(It,2),At=kt[0],zt=kt[1],sn=function(et){zt([].concat(Object(W.a)(At),[Object(f.a)({},et)]))};Object(i.useEffect)(function(){var ot;if(Qt.current)return;if(!(Re!=null&&Re.question_title)){kn(!0),Kt(""),Dt(""),Vn(10);return}_r(!(Re!=null&&Re.repeat_answer)),Kt(Re==null?void 0:Re.question_title),Dt(Re==null||((ot=Re.standard_answer)===null||ot===void 0)?void 0:ot[0]),Vn(Re==null?void 0:Re.question_score),Mn(Re.tag_discipline_ids),vr(Re==null?void 0:Re.difficulty),bn(Re==null?void 0:Re.analysis),vn([Re==null?void 0:Re.normal_keywords,Re==null?void 0:Re.main_keywords])},[Le.editData,Zt]),Object(i.useEffect)(function(){var ot,et=xe!=null&&(ot=xe.tagDisciplineData)!==null&&ot!==void 0&&ot.tag_disciplines&&Array.isArray(xe.tagDisciplineData.tag_disciplines)?xe.tagDisciplineData.tag_disciplines:[];zt(et)},[xe.tagDisciplineData]),Object(i.useEffect)(function(){Zt&&ot();function ot(){return et.apply(this,arguments)}function et(){return et=Object(ne.a)(s.a.mark(function mt(){var Tt,gt,Pt;return s.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(k.I)({sub_discipline_id:(Tt=xe.editData)===null||Tt===void 0||((gt=Tt.exercise)===null||gt===void 0)?void 0:gt.sub_discipline_id});case 2:Pt=yt.sent,zt(Pt.tag_disciplines);case 4:case"end":return yt.stop()}},mt)})),et.apply(this,arguments)}},[Zt]),Object(i.useImperativeHandle)(pt,function(){return{onSave:ft,isEdit:Zt}});var nn=function(et){(et==null?void 0:et.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),kn(!1),jt(-1),Qt.current=!1,ct())},ft=function(){var ot=Object(ne.a)(s.a.mark(function et(){var mt,Tt,gt,Pt,vt,yt,on;return s.a.wrap(function(hr){for(;;)switch(hr.prev=hr.next){case 0:if(Mt){hr.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),hr.abrupt("return",!1);case 3:if(mt=Cn[0],Tt=Cn[1],Qt.current=!0,!Re.question_id){hr.next=17;break}if(!((Re==null?void 0:Re.is_my)===1)){hr.next=11;break}G.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var jn=Object(ne.a)(s.a.mark(function Ft(){var pn,Ln;return s.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Mt,question_type:4,question_score:fn,standard_answers:[Gt],tag_discipline_ids:wn,sub_discipline_id:(pn=xe.editData)===null||pn===void 0||((Ln=pn.exercise)===null||Ln===void 0)?void 0:Ln.sub_discipline_id,difficulty:Xn,is_cover:1,repeat_answer:!Bn,analysis:Fn,normal_keywords:mt,main_keywords:Tt}});case 2:gt=mn.sent,nn(gt);case 4:case"end":return mn.stop()}},Ft)}));function Wn(){return jn.apply(this,arguments)}return Wn}(),onCancel:function(){var jn=Object(ne.a)(s.a.mark(function Ft(){var pn,Ln;return s.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Mt,question_type:4,question_score:fn,standard_answers:[Gt],tag_discipline_ids:wn,sub_discipline_id:(pn=xe.editData)===null||pn===void 0||((Ln=pn.exercise)===null||Ln===void 0)?void 0:Ln.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Fn,normal_keywords:mt,main_keywords:Tt}});case 2:gt=mn.sent,nn(gt);case 4:case"end":return mn.stop()}},Ft)}));function Wn(){return jn.apply(this,arguments)}return Wn}()}),hr.next=15;break;case 11:return hr.next=13,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Mt,question_type:4,question_score:fn,standard_answers:[Gt],tag_discipline_ids:wn,sub_discipline_id:(Pt=xe.editData)===null||Pt===void 0||((vt=Pt.exercise)===null||vt===void 0)?void 0:vt.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Fn,normal_keywords:mt,main_keywords:Tt}});case 13:gt=hr.sent,nn(gt);case 15:hr.next=21;break;case 17:return hr.next=19,Lt({type:"exercise/addExerciseQuestion",payload:{insert_id:Re==null?void 0:Re.insert_id,categoryId:St.categoryId,exercise_bank_id:St.categoryId,question_title:Mt,question_type:4,question_score:fn,standard_answers:[Gt],tag_discipline_ids:wn,sub_discipline_id:(yt=xe.editData)===null||yt===void 0||((on=yt.exercise)===null||on===void 0)?void 0:on.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Fn,normal_keywords:mt,main_keywords:Tt}});case 19:gt=hr.sent,nn(gt);case 21:return hr.abrupt("return",{name:Mt,answer_texts:[Gt],analysis:Fn,normal_keywords:mt,main_keywords:Tt});case 22:case"end":return hr.stop()}},et)}));return function(){return ot.apply(this,arguments)}}(),rt=function(){var et,mt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Mt,onChange:function(gt){return Kt(gt)}}),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(y.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Gt,onChange:function(gt){return Dt(gt)}}),t.a.createElement(wt.a,{value:Cn,onChange:vn}),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Fn,onChange:function(gt){return bn(gt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:fn,max:1e4,min:0,onChange:function(gt){Vn(gt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ve.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:Xn,onChange:function(gt){vr(gt.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:"".concat(ve.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{value:wn,selectvalues:Re==null?void 0:Re.tag_discipline_ids,onChange:Mn,subId:(et=xe.editData)===null||et===void 0||((mt=et.exercise)===null||mt===void 0)?void 0:mt.sub_discipline_id,knowledgeOptions:At,onAddKnowledgeFinish:sn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Bn,onChange:function(gt){_r(gt)}}))),t.a.createElement("aside",{className:"tr"},(pr!==-1||Re.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){cr(),kn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){ft()}},"\u4FDD\u5B58")))},$e=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(ot){var et,mt;return(xe==null||((et=xe.editData)===null||et===void 0||((mt=et.exercise)===null||mt===void 0))?void 0:mt.exercise_status)===1?ot:ot.id!=="del"&&ot.id!=="add"}),Ze=function(){var ot=Object(ne.a)(s.a.mark(function et(mt){return s.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:if(!(pr!==-1)){gt.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),gt.abrupt("return");case 3:gt.t0=mt.id,gt.next=gt.t0==="del"?6:gt.t0==="up"||gt.t0==="down"?8:gt.t0==="edit"?12:gt.t0==="add"?15:17;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function vt(){return s.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(k.n)({id:Re.question_id});case 2:Lt({type:"exercise/editExercise",payload:Object(f.a)({},St)});case 3:case"end":return on.stop()}},vt)}))()}}),gt.abrupt("break",17);case 8:return gt.next=10,Lt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:mt.id}});case 10:return Lt({type:"exercise/editExercise",payload:Object(f.a)({},St)}),gt.abrupt("break",17);case 12:return jt(Re.dragKey),kn(!0),gt.abrupt("break",17);case 15:return yn({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:4}),gt.abrupt("break",17);case 17:case"end":return gt.stop()}},et)}));return function(mt){return ot.apply(this,arguments)}}(),He=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Se.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:Re.question_title})),t.a.createElement("div",{className:ve.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(Se.a,{value:Gt||""})),t.a.createElement("div",{className:ve.a.action},!Re.hideAction&&$e.map(function(et,mt){return et.id==="up"&&Re.key===1||et.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:mt,placement:"bottom",title:et.name},t.a.createElement("span",{onClick:function(){return Ze(et)},className:et.icon}))})))};return t.a.createElement("section",{className:ve.a.wrap},!Zt&&He(),Zt&&rt())},an=Object(B.a)(function(at){var Fe=at.problemset,pt=at.loading,Le=at.exercise,xe=at.globalSetting;return{problemset:Fe,globalSetting:xe,exercise:Le,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Wt)),Yt=["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"],qe=function(Fe,pt){var Le=Fe.problemset,xe=Fe.exercise,ge=Fe.globalSetting,Hn=Fe.loading,Lt=Fe.dispatch,ke=Fe.onRef,ut=ke===void 0?function(){}:ke,Re=Fe.editData,tn=Fe.cancelAdd,cr=tn===void 0?function(){}:tn,pr=Fe.editKey,Kn=Fe.setEditKey,jt=Kn===void 0?function(){}:Kn,dr=Fe.addCallback,ct=dr===void 0?function(){}:dr,Un=Fe.setIsClaer,yn=Un===void 0?function(){}:Un,ln=Object(j.a)(Fe,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","addCallback","setIsClaer"]),Xt=Object(i.useState)([]),Pn=Object(a.a)(Xt,2),hn=Pn[0],qt=Pn[1],Mt=Object(i.useState)(),Kt=Object(a.a)(Mt,2),ar=Kt[0],sr=Kt[1],Fn=Object(i.useState)([]),bn=Object(a.a)(Fn,2),Ut=bn[0],Vt=bn[1],Gt=Object(i.useState)(""),Dt=Object(a.a)(Gt,2),Zn=Dt[0],On=Dt[1],fn=Object(i.useState)(5),Vn=Object(a.a)(fn,2),un=Vn[0],_n=Vn[1],Zt=Object(i.useState)(!1),kn=Object(a.a)(Zt,2),er=kn[0],tr=kn[1],wn=Object(C.g)(),Mn=Object(C.i)();Object(i.useEffect)(function(){qt(["","","",""])},[]),Object(i.useEffect)(function(){if(!(Re!=null&&Re.question_choices)){tr(!0),On(""),_n(5),qt(["","","",""]),Vt([]);return}On(Re==null?void 0:Re.question_title),_n(Re==null?void 0:Re.question_score),qt(Re==null?void 0:Re.question_choices.map(function(Bn){return Bn.choice_text}));var Gn=[];Re==null||Re.standard_answer.map(function(Bn,_r){Gn.push(Bn-1)}),Vt(Gn)},[Re]),Object(i.useImperativeHandle)(pt,function(){return{onSave:dn,isEdit:er}});var dn=function(){var Gn=Object(ne.a)(s.a.mark(function Bn(){var _r,Rn,En;return s.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:if(Zn){vn.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),vn.abrupt("return",!1);case 3:if(_r=hn.findIndex(function(Qt){return!Qt}),!(_r>-1)){vn.next=7;break}return b.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Yt[_r]," \u9009\u9879\u7684\u5185\u5BB9")),vn.abrupt("return",!1);case 7:if(Ut.length){vn.next=10;break}return b.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),vn.abrupt("return",!1);case 10:if(!(Ut.length<1)){vn.next=13;break}return b.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),vn.abrupt("return",!1);case 13:if(Rn=hn.map(function(Qt,St){return{choice_text:Qt,is_answer:Ut.includes(St)?St+1:0}}),!Re.question_id){vn.next=20;break}return vn.next=17,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Zn,question_type:1,question_score:un,question_choices:Rn.map(function(Qt){return Qt.choice_text}),standard_answers:Rn.filter(function(Qt){return Qt.is_answer}).map(function(Qt){return Qt.is_answer})}});case 17:En=vn.sent,vn.next=23;break;case 20:return vn.next=22,Lt({type:"exercise/addExerciseQuestion",payload:{insert_id:Re==null?void 0:Re.insert_id,categoryId:Mn.categoryId,question_title:Zn,question_type:1,question_score:"5.0",question_choices:Rn.map(function(Qt){return Qt.choice_text}),standard_answers:Rn.filter(function(Qt){return Qt.is_answer}).map(function(Qt){return Qt.is_answer})}});case 22:En=vn.sent;case 23:En.status===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),tr(!1),Lt({type:"exercise/editExercise",payload:Object(f.a)({},Mn)}));case 24:case"end":return vn.stop()}},Bn)}));return function(){return Gn.apply(this,arguments)}}(),or=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Gn){var Bn,_r;return(xe==null||((Bn=xe.editData)===null||Bn===void 0||((_r=Bn.exercise)===null||_r===void 0))?void 0:_r.exercise_status)===1?Gn:Gn.id!=="del"&&Gn.id!=="add"}),Xn=function(){var Gn=Object(ne.a)(s.a.mark(function Bn(_r){return s.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(!(pr!==-1)){En.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),En.abrupt("return");case 3:En.t0=_r.id,En.next=En.t0==="del"?6:En.t0==="up"||En.t0==="down"?8:En.t0==="edit"?12:En.t0==="add"?14:16;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function vn(){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(k.n)({id:Re.question_id});case 2:Lt({type:"exercise/editExercise",payload:Object(f.a)({},Mn)});case 3:case"end":return St.stop()}},vn)}))()}}),En.abrupt("break",16);case 8:return En.next=10,Lt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:_r.id}});case 10:return Lt({type:"exercise/editExercise",payload:Object(f.a)({},Mn)}),En.abrupt("break",16);case 12:return wn.push("/problems/".concat(Re==null?void 0:Re.hack_identifier,"/edit?type=exercises&express_id=").concat(Mn.categoryId,"&question_id=").concat(Re==null?void 0:Re.question_id,"&score=").concat(Re==null?void 0:Re.question_score,"&exercise=true&callback_url=").concat(location.pathname)),En.abrupt("break",16);case 14:return ct({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:6}),En.abrupt("break",16);case 16:case"end":return En.stop()}},Bn)}));return function(_r){return Gn.apply(this,arguments)}}(),vr=function(){var Gn=Object(ne.a)(s.a.mark(function Bn(_r){var Rn;return s.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return _r.preventDefault(),Cn.next=3,Object(k.Y)({id:Re==null?void 0:Re.hack_identifier});case 3:Rn=Cn.sent,Rn.status===0&&Object(se.S)("/myproblems/".concat(Rn==null?void 0:Rn.identifier));case 5:case"end":return Cn.stop()}},Bn)}));return function(_r){return Gn.apply(this,arguments)}}(),gr=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Se.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:Re.question_title})),t.a.createElement("div",{className:ve.a.questionChoices},t.a.createElement(Se.a,{value:Re.description||""})),t.a.createElement("div",{className:ve.a.action},!Re.hideAction&&or.map(function(Bn,_r){return Bn.id==="up"&&Re.key===1||Bn.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:_r,placement:"bottom",title:Bn.name},t.a.createElement("span",{onClick:function(){return Xn(Bn)},className:Bn.icon}))})))};return t.a.createElement("section",{className:ve.a.wrap},gr())},Qe=Object(B.a)(function(at){var Fe=at.problemset,pt=at.loading,Le=at.globalSetting,xe=at.exercise;return{problemset:Fe,globalSetting:Le,exercise:xe,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(qe)),bt=F("LvDl"),xt=["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"],ye=function(Fe,pt){var Le=Fe.problemset,xe=Fe.exercise,ge=Fe.globalSetting,Hn=Fe.loading,Lt=Fe.dispatch,ke=Fe.onRef,ut=ke===void 0?function(){}:ke,Re=Fe.editData,tn=Fe.cancelAdd,cr=tn===void 0?function(){}:tn,pr=Fe.editKey,Kn=Fe.setEditKey,jt=Kn===void 0?function(){}:Kn,dr=Fe.setIsClaer,ct=dr===void 0?function(){}:dr,Un=Fe.addCallback,yn=Un===void 0?function(ft){}:Un,ln=Fe.reload,Xt=ln===void 0?function(){}:ln,Pn=Object(j.a)(Fe,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),hn=Object(i.useState)([]),qt=Object(a.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(i.useState)(!1),sr=Object(a.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(i.useState)(!0),Vt=Object(a.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(i.useState)(1),On=Object(a.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(i.useState)(!1),_n=Object(a.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(i.useState)([]),tr=Object(a.a)(er,2),wn=tr[0],Mn=tr[1],dn=Object(C.i)(),or=Object(i.useRef)(null),Xn=Object(i.useState)(""),vr=Object(a.a)(Xn,2),gr=vr[0],Gn=vr[1],Bn=Object(i.useState)([]),_r=Object(a.a)(Bn,2),Rn=_r[0],En=_r[1],Cn=Object(i.useRef)(!1),vn=function(rt){Mn([].concat(Object(W.a)(wn),[Object(f.a)({},rt)]))};Object(i.useEffect)(function(){var ft;if(Cn.current)return;if(!(Re!=null&&Re.question_title)){bn(!0),Gn("");return}Gn(Re==null?void 0:Re.question_title),kn(!(Re!=null&&Re.repeat_answer)),Vn(Re==null?void 0:Re.difficulty),Kt(Re.tag_discipline_ids);var rt=Re==null||((ft=Re.sub_exercise_questions)===null||ft===void 0)?void 0:ft.map(function($e){var Ze,He,ot;return Object(f.a)(Object(f.a)({},$e),{},{id:$e.question_id,name:$e.question_title,open:!1,score:$e.question_score,qusList:$e==null||((Ze=$e.question_choices)===null||Ze===void 0)?void 0:Ze.map(function(et){return et.choice_text}),activeQusEditor:null,qusAnswer:(He=[$e==null||((ot=$e.question_choices)===null||ot===void 0)?void 0:ot.findIndex(function(et){return et.standard_boolean})])===null||He===void 0?void 0:He.filter(function(et){return et!==-1})})});En(rt)},[Re,Fn]),Object(i.useEffect)(function(){Fn&&ft();function ft(){return rt.apply(this,arguments)}function rt(){return rt=Object(ne.a)(s.a.mark(function $e(){var Ze,He,ot;return s.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(k.I)({sub_discipline_id:(Ze=xe.editData)===null||Ze===void 0||((He=Ze.exercise)===null||He===void 0)?void 0:He.sub_discipline_id});case 2:ot=mt.sent,Mn(ot.tag_disciplines);case 4:case"end":return mt.stop()}},$e)})),rt.apply(this,arguments)}},[Fn]),Object(i.useEffect)(function(){var ft,rt=xe!=null&&(ft=xe.tagDisciplineData)!==null&&ft!==void 0&&ft.tag_disciplines&&Array.isArray(xe.tagDisciplineData.tag_disciplines)?xe.tagDisciplineData.tag_disciplines:[];Mn(rt)},[xe.tagDisciplineData]),Object(i.useImperativeHandle)(pt,function(){return{onSave:St,isEdit:Fn}});var Qt=function(rt){(rt==null?void 0:rt.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),bn(!1),jt(-1),Cn.current=!1,Xt())},St=function(){var ft=Object(ne.a)(s.a.mark(function rt(){var $e,Ze,He,ot,et,mt,Tt,gt;return s.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(gr){vt.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),vt.abrupt("return",!1);case 3:if(!(Rn.length===0)){vt.next=6;break}return b.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),vt.abrupt("return",!1);case 6:$e=0;case 7:if(!($e<Rn.length)){vt.next=25;break}if(He=Rn[$e],He!=null&&He.name){vt.next=12;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat($e+1,"\u5C0F\u9898\u9898\u5E72")),vt.abrupt("return",!1);case 12:if(He!=null&&He.score){vt.next=15;break}return b.b.info("\u7B2C".concat($e+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),vt.abrupt("return",!1);case 15:if(ot=He==null||((Ze=He.qusList)===null||Ze===void 0)?void 0:Ze.findIndex(function(yt){return!yt}),!(ot>-1)){vt.next=19;break}return b.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat($e+1,"\u5C0F\u9898").concat(xt[ot],"\u9009\u9879\u7684\u5185\u5BB9")),vt.abrupt("return",!1);case 19:if(He!=null&&He.qusAnswer.length){vt.next=22;break}return b.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat($e+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),vt.abrupt("return",!1);case 22:$e++,vt.next=7;break;case 25:if(et=Rn.map(function(yt){var on;return{id:yt.id>1?yt.id:null,question_title:yt.name,question_type:1,question_choices:yt.qusList,question_score:yt.score,standard_answers:[((on=yt.qusAnswer)===null||on===void 0?void 0:on[0])+1]}}),Cn.current=!0,!Re.question_id){vt.next=36;break}if(!((Re==null?void 0:Re.is_my)===1)){vt.next=32;break}G.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var yt=Object(ne.a)(s.a.mark(function $t(){var hr,jn;return s.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return Ft.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:gr,question_type:7,sub_questions:et,tag_discipline_ids:Mt,sub_discipline_id:(hr=xe.editData)===null||hr===void 0||((jn=hr.exercise)===null||jn===void 0)?void 0:jn.sub_discipline_id,difficulty:fn,is_cover:1,repeat_answer:!Zt}});case 2:mt=Ft.sent,Qt(mt);case 4:case"end":return Ft.stop()}},$t)}));function on(){return yt.apply(this,arguments)}return on}(),onCancel:function(){var yt=Object(ne.a)(s.a.mark(function $t(){var hr,jn;return s.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return Ft.next=2,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:gr,question_type:7,sub_questions:et,tag_discipline_ids:Mt,sub_discipline_id:(hr=xe.editData)===null||hr===void 0||((jn=hr.exercise)===null||jn===void 0)?void 0:jn.sub_discipline_id,difficulty:fn,repeat_answer:!Zt}});case 2:mt=Ft.sent,Qt(mt);case 4:case"end":return Ft.stop()}},$t)}));function on(){return yt.apply(this,arguments)}return on}()}),vt.next=36;break;case 32:return vt.next=34,Lt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:gr,question_type:7,sub_questions:et,tag_discipline_ids:Mt,sub_discipline_id:(Tt=xe.editData)===null||Tt===void 0||((gt=Tt.exercise)===null||gt===void 0)?void 0:gt.sub_discipline_id,difficulty:fn,repeat_answer:!Zt}});case 34:mt=vt.sent,Qt(mt);case 36:case"end":return vt.stop()}},rt)}));return function(){return ft.apply(this,arguments)}}(),It=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(ft){var rt,$e;return(xe==null||((rt=xe.editData)===null||rt===void 0||(($e=rt.exercise)===null||$e===void 0))?void 0:$e.exercise_status)===1?ft:ft.id!=="del"&&ft.id!=="add"}),kt=function(){var ft=Object(ne.a)(s.a.mark(function rt($e){return s.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:if(!(pr!==-1)){He.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),He.abrupt("return");case 3:He.t0=$e.id,He.next=He.t0==="del"?6:He.t0==="up"||He.t0==="down"?8:He.t0==="edit"?12:He.t0==="add"?15:17;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function et(){return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(k.n)({id:Re.question_id});case 2:Lt({type:"exercise/editExercise",payload:Object(f.a)({},dn)});case 3:case"end":return Tt.stop()}},et)}))()}}),He.abrupt("break",17);case 8:return He.next=10,Lt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:$e.id}});case 10:return Lt({type:"exercise/editExercise",payload:Object(f.a)({},dn)}),He.abrupt("break",17);case 12:return jt(Re.dragKey),bn(!0),He.abrupt("break",17);case 15:return yn({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:0}),He.abrupt("break",17);case 17:case"end":return He.stop()}},rt)}));return function($e){return ft.apply(this,arguments)}}(),At=function(){var rt;return t.a.createElement("aside",{ref:or},t.a.createElement("div",{className:ve.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Se.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",Re==null?void 0:Re.sub_q_count,"\u5C0F\u9898\uFF0C",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:Re.question_title})),t.a.createElement("div",{style:{display:Gt?"block":"none"},className:ve.a.questionChoices},Re==null||((rt=Re.sub_exercise_questions)===null||rt===void 0)?void 0:rt.map(function($e,Ze){var He;return t.a.createElement("div",{key:Ze},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,".",Ze+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(Se.a,{value:$e.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",$e.question_score,"\u5206\uFF09")),$e==null||((He=$e.question_choices)===null||He===void 0)?void 0:He.map(function(ot,et){return t.a.createElement(r.a,{key:et},t.a.createElement(D.a,null,t.a.createElement(g.a,{key:et,checked:$e.standard_answer.includes(et+1),disabled:!0},xt[et],".")),t.a.createElement(D.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Se.a,{value:ot.choice_text}))))}))})),t.a.createElement("div",{className:ve.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Dt(!Gt)},style:{}},Gt?"\u6536\u8D77":"\u5C55\u5F00"),!Re.hideAction&&It.map(function($e,Ze){return $e.id==="up"&&Re.key===1||$e.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:Ze,placement:"bottom",title:$e.name},t.a.createElement("span",{onClick:function(){return kt($e)},className:$e.icon}))})))},zt=function(){var rt,$e;return t.a.createElement("aside",null,t.a.createElement("div",{className:ve.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:ve.a.wrap,style:{padding:0}},t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.required},"*"),t.a.createElement("span",{className:ve.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:gr,onChange:function(He){return Gn(He)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",Rn==null?void 0:Rn.length),Rn==null?void 0:Rn.map(function(Ze,He){var ot;return t.a.createElement("div",{className:ve.a.fold,key:Ze.id},t.a.createElement("div",{onClick:function(){return nn("open",He)},className:ve.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Ze.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",He+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(mt){mt.stopPropagation(),nn("delete",He)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:Ze.open?"block":"none"}},t.a.createElement(y.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ze==null?void 0:Ze.name,onChange:function(mt){return nn("value",He,mt)}}),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:ve.a.required},"*"),t.a.createElement("span",{className:ve.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Ze==null||((ot=Ze.qusList)===null||ot===void 0)?void 0:ot.map(function(et,mt){var Tt,gt;return t.a.createElement("div",{className:ve.a.choiceWrap,key:mt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ve.a.answer," ").concat(Ze!=null&&(Tt=Ze.qusAnswer)!==null&&Tt!==void 0&&Tt.includes(mt)?ve.a.activeAnswer:""),onClick:function(){return nn("answer",He,mt)}},xt[mt])),t.a.createElement("div",{className:ve.a.editorWrap},(Ze==null?void 0:Ze.activeQusEditor)===mt?t.a.createElement(y.a,{id:"single-question-option-".concat(mt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:et,onChange:function(vt){return nn("details",He,vt)}}):t.a.createElement("div",{className:ve.a.htmlWrap,onClick:function(){return nn("edit",He,mt)}},t.a.createElement(Se.a,{value:et}))),mt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ve.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return nn("deleteQus",He,mt)}})),mt<7&&mt===(Ze==null||((gt=Ze.qusList)===null||gt===void 0)?void 0:gt.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ve.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return nn("addQus",He)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Ze.score,max:1e4,min:0,onChange:function(mt){return nn("score",He,mt)}})," ","\u5206")))}),Rn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:sn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:ve.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:fn,onChange:function(He){Vn(He.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ve.a.titleWrap},t.a.createElement("span",{className:"".concat(ve.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ve.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{selectvalues:Re==null?void 0:Re.tag_discipline_ids,value:Mt,onChange:Kt,subId:(rt=xe.editData)===null||rt===void 0||(($e=rt.exercise)===null||$e===void 0)?void 0:$e.sub_discipline_id,knowledgeOptions:wn,onAddKnowledgeFinish:vn}))),t.a.createElement("aside",{className:"tr"},(pr!==-1||Re.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){cr(),bn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){St()}},"\u4FDD\u5B58")))},sn=function(){var rt={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};En(Rn.concat(rt))},nn=function(rt,$e,Ze){var He=Object(bt.cloneDeep)(Rn);if(rt==="open"&&(He[$e].open=!He[$e].open),rt==="delete"&&He.splice($e,1),rt==="value"&&(He[$e].name=Ze),rt==="answer"&&(He[$e].qusAnswer=[Ze]),rt==="edit"&&(He[$e].activeQusEditor=Ze),rt==="details"&&(He[$e].qusList[He[$e].activeQusEditor]=Ze),rt==="addQus"&&(He[$e].qusList=He[$e].qusList.concat("")),rt==="deleteQus"){var ot;He[$e].qusList=He[$e].qusList.filter(function(et,mt){return mt!==Ze}),He[$e].qusAnswer=(ot=He[$e].qusAnswer)===null||ot===void 0?void 0:ot.filter(function(et){return et!==Ze})}rt==="analysis"&&(He[$e].analysis=Ze),rt==="score"&&(He[$e].score=Ze),En(He)};return t.a.createElement("section",{className:ve.a.wrap},!Fn&&At(),Fn&&zt())},ae=Object(B.a)(function(at){var Fe=at.problemset,pt=at.loading,Le=at.globalSetting,xe=at.exercise;return{problemset:Fe,globalSetting:Le,exercise:xe,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(ye)),le=F("ngQI"),me=F("loLm"),Ce=F.n(me),de=F("ErOA"),pe=F("vCeJ"),De=F("Nog9"),ue=F.n(De),Me=F("hQp1"),We=["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"],lt=function(Fe,pt){var Le=Fe.newExercisePaper,xe=Fe.dispatch,ge=Fe.editData,Hn=Fe.cancelAdd,Lt=Hn===void 0?function(){}:Hn,ke=Fe.editKey,ut=Fe.setEditKey,Re=ut===void 0?function(){}:ut,tn=Fe.reload,cr=tn===void 0?function(){}:tn,pr=Fe.addCallback,Kn=pr===void 0?function($e){}:pr,jt=Object(i.useState)([]),dr=Object(a.a)(jt,2),ct=dr[0],Un=dr[1],yn=Object(i.useState)(),ln=Object(a.a)(yn,2),Xt=ln[0],Pn=ln[1],hn=Object(i.useState)([]),qt=Object(a.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(i.useState)(""),sr=Object(a.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(i.useState)(),Vt=Object(a.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(i.useState)([]),On=Object(a.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(i.useState)(!1),_n=Object(a.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(i.useState)(1),tr=Object(a.a)(er,2),wn=tr[0],Mn=tr[1],dn=Object(i.useState)(!1),or=Object(a.a)(dn,2),Xn=or[0],vr=or[1],gr=Object(i.useState)(""),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(C.i)(),En=Object(i.useRef)(null),Cn=Object(i.useRef)(!1),vn=Object(i.useState)([]),Qt=Object(a.a)(vn,2),St=Qt[0],It=Qt[1],kt=function(Ze){It([].concat(Object(W.a)(St),[Object(f.a)({},Ze)]))};Object(i.useEffect)(function(){Un(["","","",""])},[]),Object(i.useEffect)(function(){if(Cn.current)return;if(!(ge!=null&&ge.question_choices)){kn(!0),bn(""),Dt(5),Un(["","","",""]),Kt([]);return}bn(ge==null?void 0:ge.question_title),Dt(ge==null?void 0:ge.question_score),vr(!(ge!=null&&ge.repeat_answer)),_r(ge==null?void 0:ge.analysis),Mn(ge==null?void 0:ge.difficulty),Un(ge==null?void 0:ge.question_choices.map(function(Ze){return Ze.choice_text}));var $e=[];ge==null||ge.standard_answer.map(function(Ze,He){$e.push(Ze-1)}),Vn(ge.tag_discipline_ids),Kt($e)},[ge,Zt]),Object(i.useEffect)(function(){Zt&&$e();function $e(){return Ze.apply(this,arguments)}function Ze(){return Ze=Object(ne.a)(s.a.mark(function He(){var ot,et,mt;return s.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(k.I)({sub_discipline_id:(ot=Le.editData)===null||ot===void 0||((et=ot.exercise)===null||et===void 0)?void 0:et.sub_discipline_id});case 2:mt=gt.sent,It(mt.tag_disciplines);case 4:case"end":return gt.stop()}},He)})),Ze.apply(this,arguments)}},[Zt]),Object(i.useEffect)(function(){var $e,Ze=Le!=null&&($e=Le.tagDisciplineData)!==null&&$e!==void 0&&$e.tag_disciplines&&Array.isArray(Le.tagDisciplineData.tag_disciplines)?Le.tagDisciplineData.tag_disciplines:[];It(Ze)},[Le.tagDisciplineData]),Object(i.useImperativeHandle)(pt,function(){return{onSave:zt,isEdit:Zt}});var At=function(Ze){(Ze==null?void 0:Ze.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),kn(!1),Re(-1),Cn.current=!1,cr())},zt=function(){var $e=Object(ne.a)(s.a.mark(function Ze(){var He,ot,et,mt,Tt,gt,Pt;return s.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:if(Fn){yt.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),yt.abrupt("return",!1);case 3:if(He=ct.findIndex(function(on){return!on}),!(He>-1)){yt.next=7;break}return b.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(We[He]," \u9009\u9879\u7684\u5185\u5BB9")),yt.abrupt("return",!1);case 7:if(Mt.length){yt.next=10;break}return b.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),yt.abrupt("return",!1);case 10:if(!(Mt.length<1)){yt.next=13;break}return b.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),yt.abrupt("return",!1);case 13:if(ot=ct.map(function(on,$t){return{choice_text:on,is_answer:Mt.includes($t)?1:0}}),Cn.current=!0,!ge.question_id){yt.next=22;break}return yt.next=18,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:Rn.id,question_id:ge.question_id,name:Fn,item_type:Mt.length>1?Me.a.Multiple:Me.a.Single,question_score:Gt,choices:ot,tag_discipline_ids:fn,sub_discipline_id:(mt=Le.editData)===null||mt===void 0||((Tt=mt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,difficulty:wn,repeat_answer:!Xn,analysis:Bn}});case 18:et=yt.sent,At(et),yt.next=26;break;case 22:return yt.next=24,xe({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ge==null?void 0:ge.insert_id,id:Rn.id,name:Fn,item_type:Mt.length>1?Me.a.Multiple:Me.a.Single,question_score:Gt,choices:ot,tag_discipline_ids:fn,sub_discipline_id:(gt=Le.editData)===null||gt===void 0||((Pt=gt.exercise)===null||Pt===void 0)?void 0:Pt.sub_discipline_id,difficulty:wn,repeat_answer:!Xn,analysis:Bn}});case 24:et=yt.sent,At(et);case 26:case"end":return yt.stop()}},Ze)}));return function(){return $e.apply(this,arguments)}}(),sn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],nn=function(){var $e=Object(ne.a)(s.a.mark(function Ze(He){return s.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:if(!(ke!==-1)){et.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),et.abrupt("return");case 3:et.t0=He.id,et.next=et.t0==="del"?6:et.t0==="edit"?8:et.t0==="add"?11:13;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function Tt(){return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(pe.g)({exam_id:Rn.id,question_id:ge.question_id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(f.a)({},Rn)});case 3:case"end":return Pt.stop()}},Tt)}))()}}),et.abrupt("break",13);case 8:return Re(ge.dragKey),kn(!0),et.abrupt("break",13);case 11:return Kn({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:0}),et.abrupt("break",13);case 13:case"end":return et.stop()}},Ze)}));return function(He){return $e.apply(this,arguments)}}(),ft=function(){var Ze;return t.a.createElement("aside",{ref:En},t.a.createElement("div",{className:ue.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u5355\u9009\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(Se.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:ge.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ge==null||((Ze=ge.question_choices)===null||Ze===void 0)?void 0:Ze.map(function(He,ot){return t.a.createElement(r.a,{key:ot},t.a.createElement(D.a,null,t.a.createElement(g.a,{key:ot,checked:ge.standard_answer.includes(ot+1),disabled:!0},We[ot],".")),t.a.createElement(D.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Se.a,{value:He.choice_text}))))})),t.a.createElement("div",{className:ue.a.action},!ge.hideAction&&sn.map(function(He,ot){return t.a.createElement(o.a,{key:ot,placement:"bottom",title:He.name},t.a.createElement("span",{onClick:function(){return nn(He)},className:He.icon}))})))},rt=function(){var Ze,He;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Fn,onChange:function(et){return bn(et)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ct.map(function(ot,et){return t.a.createElement("div",{className:ue.a.choiceWrap,key:et},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(Mt.includes(et)?ue.a.activeAnswer:""),onClick:function(){Mt.includes(et)?Kt(function(Tt){return Tt.filter(function(gt){return gt!==et})}):Kt(function(Tt){return[].concat(Object(W.a)(Tt),[et])})}},We[et])),t.a.createElement("div",{className:ue.a.editorWrap},Xt===et?t.a.createElement(y.a,{id:"single-question-option-".concat(et),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:ot,onChange:function(Tt){ct[et]=Tt,Un(ct)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return Pn(et)}},t.a.createElement(Se.a,{value:ot}))),t.a.createElement(t.a.Fragment,null,et>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Un(ct.filter(function(Tt,gt){return gt!==et}))}})),et<7&&et===ct.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Un([].concat(Object(W.a)(ct),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Bn,onChange:function(et){return _r(et)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Gt,max:1e4,min:0,onChange:function(et){Dt(et)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:wn,onChange:function(et){Mn(et.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{selectvalues:ge==null?void 0:ge.tag_discipline_ids,value:fn,onChange:Vn,subId:(Ze=Le.editData)===null||Ze===void 0||((He=Ze.exercise)===null||He===void 0)?void 0:He.sub_discipline_id,knowledgeOptions:St,onAddKnowledgeFinish:kt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Xn,onChange:function(et){vr(et)}}))),t.a.createElement("aside",{className:"tr"},(ke!==-1||ge.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Lt(),kn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){zt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!Zt&&ft(),Zt&&rt())},Ct=Object(B.a)(function(at){var Fe=at.newExercisePaper;return{newExercisePaper:Fe}},null,null,{forwardRef:!0})(Object(i.forwardRef)(lt)),Ot=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Nt=Object(i.forwardRef)(function(at,Fe){var pt=at.newExercisePaper,Le=at.dispatch,xe=at.editData,ge=at.cancelAdd,Hn=ge===void 0?function(){}:ge,Lt=at.editKey,ke=at.setEditKey,ut=ke===void 0?function(){}:ke,Re=at.addCallback,tn=Re===void 0?function(ft){}:Re,cr=at.reload,pr=cr===void 0?function(){}:cr,Kn=Object(i.useState)([]),jt=Object(a.a)(Kn,2),dr=jt[0],ct=jt[1],Un=Object(i.useState)(),yn=Object(a.a)(Un,2),ln=yn[0],Xt=yn[1],Pn=Object(i.useState)([]),hn=Object(a.a)(Pn,2),qt=hn[0],Mt=hn[1],Kt=Object(i.useState)(""),ar=Object(a.a)(Kt,2),sr=ar[0],Fn=ar[1],bn=Object(i.useState)(),Ut=Object(a.a)(bn,2),Vt=Ut[0],Gt=Ut[1],Dt=Object(i.useState)(!1),Zn=Object(a.a)(Dt,2),On=Zn[0],fn=Zn[1],Vn=Object(i.useState)([]),un=Object(a.a)(Vn,2),_n=un[0],Zt=un[1],kn=Object(i.useState)(1),er=Object(a.a)(kn,2),tr=er[0],wn=er[1],Mn=Object(i.useState)(!1),dn=Object(a.a)(Mn,2),or=dn[0],Xn=dn[1],vr=Object(i.useState)(""),gr=Object(a.a)(vr,2),Gn=gr[0],Bn=gr[1],_r=Object(i.useState)([]),Rn=Object(a.a)(_r,2),En=Rn[0],Cn=Rn[1],vn=Object(i.useRef)(!1),Qt=function(rt){Cn([].concat(Object(W.a)(En),[Object(f.a)({},rt)]))},St=Object(C.i)();Object(i.useEffect)(function(){ct(["","","",""])},[]),Object(i.useEffect)(function(){if(vn.current)return;if(!(xe!=null&&xe.question_choices)){fn(!0),Fn(""),Gt(5),ct(["","","",""]),Mt([]);return}Fn(xe==null?void 0:xe.question_title),Gt(xe==null?void 0:xe.question_score),Xn(!(xe!=null&&xe.repeat_answer)),wn(xe==null?void 0:xe.difficulty),ct(xe==null?void 0:xe.question_choices.map(function(rt){return rt.choice_text}));var ft=[];xe==null||xe.standard_answer.map(function(rt,$e){ft.push(rt-1)}),Mt(ft),Zt(xe.tag_discipline_ids),Bn(xe==null?void 0:xe.analysis)},[xe,On]),Object(i.useEffect)(function(){On&&ft();function ft(){return rt.apply(this,arguments)}function rt(){return rt=Object(ne.a)(s.a.mark(function $e(){var Ze,He,ot;return s.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(k.I)({sub_discipline_id:(Ze=pt.editData)===null||Ze===void 0||((He=Ze.exercise)===null||He===void 0)?void 0:He.sub_discipline_id});case 2:ot=mt.sent,Cn(ot.tag_disciplines);case 4:case"end":return mt.stop()}},$e)})),rt.apply(this,arguments)}},[On]),Object(i.useImperativeHandle)(Fe,function(){return{onSave:kt,isEdit:On}}),Object(i.useEffect)(function(){var ft,rt=pt!=null&&(ft=pt.tagDisciplineData)!==null&&ft!==void 0&&ft.tag_disciplines&&Array.isArray(pt.tagDisciplineData.tag_disciplines)?pt.tagDisciplineData.tag_disciplines:[];Cn(rt)},[pt.tagDisciplineData]);var It=function(rt){(rt==null?void 0:rt.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),fn(!1),ut(-1),vn.current=!1,pr())},kt=function(){var ft=Object(ne.a)(s.a.mark(function rt(){var $e,Ze,He,ot,et,mt,Tt;return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(sr){Pt.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Pt.abrupt("return",!1);case 3:if($e=dr.findIndex(function(vt){return!vt}),!($e>-1)){Pt.next=7;break}return b.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ot[$e]," \u9009\u9879\u7684\u5185\u5BB9")),Pt.abrupt("return",!1);case 7:if(qt.length){Pt.next=10;break}return b.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Pt.abrupt("return",!1);case 10:if(!(qt.length<1)){Pt.next=13;break}return b.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Pt.abrupt("return",!1);case 13:if(Ze=dr.map(function(vt,yt){return{choice_text:vt,is_answer:qt.includes(yt)?1:0}}),vn.current=!0,!xe.question_id){Pt.next=22;break}return Pt.next=18,Le({type:"newExercisePaper/editExerciseQuestion",payload:{id:St.id,question_id:xe.question_id,name:sr,item_type:qt.length>1?Me.a.Multiple:Me.a.Single,question_score:Vt,choices:Ze,tag_discipline_ids:_n,sub_discipline_id:(ot=pt.editData)===null||ot===void 0||((et=ot.exercise)===null||et===void 0)?void 0:et.sub_discipline_id,difficulty:tr,repeat_answer:!or,analysis:Gn}});case 18:He=Pt.sent,It(He),Pt.next=26;break;case 22:return Pt.next=24,Le({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:xe==null?void 0:xe.insert_id,id:St.id,name:sr,item_type:qt.length>1?Me.a.Multiple:Me.a.Single,question_score:Vt,choices:Ze,tag_discipline_ids:_n,sub_discipline_id:(mt=pt.editData)===null||mt===void 0||((Tt=mt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,difficulty:tr,repeat_answer:!or,analysis:Gn}});case 24:He=Pt.sent,It(He);case 26:case"end":return Pt.stop()}},rt)}));return function(){return ft.apply(this,arguments)}}(),At=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u591A\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],zt=function(){var ft=Object(ne.a)(s.a.mark(function rt($e){return s.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:if(!(Lt!==-1)){He.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),He.abrupt("return");case 3:He.t0=$e.id,He.next=He.t0==="del"?6:He.t0==="edit"?8:He.t0==="add"?11:13;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function et(){return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(pe.g)({question_id:xe.question_id,exam_id:St.id});case 2:Le({type:"newExercisePaper/editExercise",payload:Object(f.a)({},St)});case 3:case"end":return Tt.stop()}},et)}))()}}),He.abrupt("break",13);case 8:return ut(xe.dragKey),fn(!0),He.abrupt("break",13);case 11:return tn({key:xe.key,insert_id:xe==null?void 0:xe.question_id,question_type:1}),He.abrupt("break",13);case 13:case"end":return He.stop()}},rt)}));return function($e){return ft.apply(this,arguments)}}(),sn=function(){var rt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(xe!=null&&xe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},xe.key,"\u3001\u591A\u9009\u9898"),"\uFF08",xe.question_score,"\u5206\uFF09")),xe!=null&&xe.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},xe.key,"."),t.a.createElement(Se.a,{value:xe.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",xe.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:xe.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},xe==null||((rt=xe.question_choices)===null||rt===void 0)?void 0:rt.map(function($e,Ze){return t.a.createElement(r.a,{key:Ze},t.a.createElement(D.a,null,t.a.createElement(O.a,{key:Ze,checked:xe.standard_answer.includes(Ze+1),disabled:!0},Ot[Ze],".")),t.a.createElement(D.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Se.a,{value:$e.choice_text}))))})),t.a.createElement("div",{className:ue.a.action},!xe.hideAction&&At.map(function($e,Ze){return t.a.createElement(o.a,{key:Ze,placement:"bottom",title:$e.name},t.a.createElement("span",{onClick:function(){return zt($e)},className:$e.icon}))})))},nn=function(){var rt,$e;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:sr,onChange:function(He){return Fn(He)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),dr.map(function(Ze,He){var ot,et;return t.a.createElement("div",{className:ue.a.choiceWrap,key:He},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(qt.includes(He)?ue.a.activeAnswer:""),onClick:function(){qt.includes(He)?Mt(qt.filter(function(Tt){return Tt!==He})):Mt([].concat(Object(W.a)(qt),[He]))}},Ot[He])),t.a.createElement("div",{className:ue.a.editorWrap},ln===He?t.a.createElement(y.a,{id:"single-question-option-".concat(He),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Ze,onChange:function(Tt){dr[He]=Tt,ct(dr)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return Xt(He)}},t.a.createElement(Se.a,{value:Ze}))),((ot=pt.editData)===null||ot===void 0||((et=ot.exercise)===null||et===void 0)?void 0:et.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,He>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return ct(dr.filter(function(Tt,gt){return gt!==He}))}})),He<7&&He===dr.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return ct([].concat(Object(W.a)(dr),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gn,onChange:function(He){return Bn(He)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Vt,max:1e4,min:0,onChange:function(He){Gt(He)}}),"\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:tr,onChange:function(He){wn(He.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{value:_n,selectvalues:xe==null?void 0:xe.tag_discipline_ids,onChange:Zt,subId:(rt=pt.editData)===null||rt===void 0||(($e=rt.exercise)===null||$e===void 0)?void 0:$e.sub_discipline_id,knowledgeOptions:En,onAddKnowledgeFinish:Qt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:or,onChange:function(He){Xn(He)}}))),t.a.createElement("aside",{className:"tr"},(Lt!==-1||xe.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Hn(),fn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){kt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!On&&sn(),On&&nn())}),ir=Object(B.a)(function(at){var Fe=at.newExercisePaper;return{newExercisePaper:Fe}},null,null,{forwardRef:!0})(Nt),Jt=["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"],cn=function(Fe,pt){var Le=Fe.newExercisePaper,xe=Fe.dispatch,ge=Fe.editData,Hn=Fe.editKey,Lt=Fe.setEditKey,ke=Lt===void 0?function(){}:Lt,ut=Fe.cancelAdd,Re=ut===void 0?function(){}:ut,tn=Fe.reload,cr=tn===void 0?function(){}:tn,pr=Fe.addCallback,Kn=pr===void 0?function(){}:pr,jt=Object(i.useState)(),dr=Object(a.a)(jt,2),ct=dr[0],Un=dr[1],yn=Object(i.useState)(""),ln=Object(a.a)(yn,2),Xt=ln[0],Pn=ln[1],hn=Object(i.useState)(!1),qt=Object(a.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(i.useState)(),sr=Object(a.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(i.useState)([]),Vt=Object(a.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(i.useState)([]),On=Object(a.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(i.useState)(1),_n=Object(a.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(i.useState)(!1),tr=Object(a.a)(er,2),wn=tr[0],Mn=tr[1],dn=Object(i.useState)(""),or=Object(a.a)(dn,2),Xn=or[0],vr=or[1],gr=Object(i.useRef)(!1),Gn=function(It){Vn([].concat(Object(W.a)(fn),[Object(f.a)({},It)]))},Bn=Object(C.i)();Object(i.useEffect)(function(){if(gr.current)return;if(!(ge!=null&&ge.question_choices)){Kt(!0),Pn(""),bn(2),Un("");return}Mn(!(ge!=null&&ge.repeat_answer)),Pn(ge==null?void 0:ge.question_title),bn(ge==null?void 0:ge.question_score),kn(ge==null?void 0:ge.difficulty),Un(ge.standard_answer[0]+""),Dt(ge.tag_discipline_ids),vr(ge==null?void 0:ge.analysis)},[ge,Mt]),Object(i.useEffect)(function(){Mt&&St();function St(){return It.apply(this,arguments)}function It(){return It=Object(ne.a)(s.a.mark(function kt(){var At,zt,sn;return s.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(k.I)({sub_discipline_id:(At=Le.editData)===null||At===void 0||((zt=At.exercise)===null||zt===void 0)?void 0:zt.sub_discipline_id});case 2:sn=ft.sent,Vn(sn.tag_disciplines);case 4:case"end":return ft.stop()}},kt)})),It.apply(this,arguments)}},[Mt]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Rn,isEdit:Mt}}),Object(i.useEffect)(function(){var St,It=Le!=null&&(St=Le.tagDisciplineData)!==null&&St!==void 0&&St.tag_disciplines&&Array.isArray(Le.tagDisciplineData.tag_disciplines)?Le.tagDisciplineData.tag_disciplines:[];Vn(It)},[Le.tagDisciplineData]);var _r=function(It){(It==null?void 0:It.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),Kt(!1),ke(-1),gr.current=!1,cr())},Rn=function(){var St=Object(ne.a)(s.a.mark(function It(){var kt,At,zt,sn,nn,ft;return s.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:if(Xt){$e.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),$e.abrupt("return",!1);case 3:if(ct){$e.next=6;break}return b.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),$e.abrupt("return",!1);case 6:if(kt=[{choice_text:"\u6B63\u786E",is_answer:ct==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:ct==="2"?1:0}],gr.current=!0,!ge.question_id){$e.next=15;break}return $e.next=11,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:Bn.id,question_id:ge.question_id,name:Xt,item_type:Me.a.Judge,question_score:Fn,choices:kt,tag_discipline_ids:Gt,sub_discipline_id:(zt=Le.editData)===null||zt===void 0||((sn=zt.exercise)===null||sn===void 0)?void 0:sn.sub_discipline_id,difficulty:Zt,repeat_answer:!wn,analysis:Xn}});case 11:At=$e.sent,_r(At),$e.next=19;break;case 15:return $e.next=17,xe({type:"newExercisePaper/addExerciseQuestion",payload:{id:Bn.id,insert_id:ge==null?void 0:ge.insert_id,name:Xt,item_type:Me.a.Judge,question_score:Fn,choices:kt,tag_discipline_ids:Gt,sub_discipline_id:(nn=Le.editData)===null||nn===void 0||((ft=nn.exercise)===null||ft===void 0)?void 0:ft.sub_discipline_id,difficulty:Zt,repeat_answer:!wn,analysis:Xn}});case 17:At=$e.sent,_r(At);case 19:return $e.abrupt("return",{name:Xt,choices:kt});case 20:case"end":return $e.stop()}},It)}));return function(){return St.apply(this,arguments)}}(),En=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5224\u65AD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Cn=function(){var St=Object(ne.a)(s.a.mark(function It(kt){return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:if(!(Hn!==-1)){zt.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),zt.abrupt("return");case 3:zt.t0=kt.id,zt.next=zt.t0==="del"?6:zt.t0==="edit"?8:zt.t0==="add"?11:13;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function nn(){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return rt.next=2,Object(pe.g)({question_id:ge.question_id,exam_id:Bn.id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(f.a)({},Bn)});case 3:case"end":return rt.stop()}},nn)}))()}}),zt.abrupt("break",13);case 8:return ke(ge.dragKey),Kt(!0),zt.abrupt("break",13);case 11:return Kn({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:2}),zt.abrupt("break",13);case 13:case"end":return zt.stop()}},It)}));return function(kt){return St.apply(this,arguments)}}(),vn=function(){var It;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(Se.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:ge.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ge==null||((It=ge.question_choices)===null||It===void 0)?void 0:It.map(function(kt,At){return t.a.createElement(g.a,{key:At,checked:ge.standard_answer.includes(At+1),disabled:!0},Jt[At],"."," ",t.a.createElement("span",{className:"c-black font14"},kt.choice_text))})),t.a.createElement("div",{className:ue.a.action},!ge.hideAction&&En.map(function(kt,At){return t.a.createElement(o.a,{key:At,placement:"bottom",title:kt.name},t.a.createElement("span",{onClick:function(){return Cn(kt)},className:kt.icon}))})))},Qt=function(){var It,kt;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xt,onChange:function(zt){return Pn(zt)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(g.a.Group,{buttonStyle:"solid",value:ct,onChange:function(zt){return Un(zt.target.value)}},t.a.createElement(g.a.Button,{value:"1",className:"".concat(ue.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(g.a.Button,{value:"2",className:ue.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Xn,onChange:function(zt){return vr(zt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Fn,max:1e4,min:0,onChange:function(zt){bn(zt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:Zt,onChange:function(zt){kn(zt.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{value:Gt,selectvalues:ge==null?void 0:ge.tag_discipline_ids,onChange:Dt,subId:(It=Le.editData)===null||It===void 0||((kt=It.exercise)===null||kt===void 0)?void 0:kt.sub_discipline_id,knowledgeOptions:fn,onAddKnowledgeFinish:Gn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:wn,onChange:function(zt){Mn(zt)}}))),t.a.createElement("aside",{className:"tr"},(Hn!==-1||ge.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Re(),Kt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Rn()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!Mt&&vn(),Mt&&Qt())},rn=Object(B.a)(function(at){var Fe=at.newExercisePaper;return{newExercisePaper:Fe}},null,null,{forwardRef:!0})(Object(i.forwardRef)(cn)),In=function(Fe,pt){var Le=Fe.newExercisePaper,xe=Fe.dispatch,ge=Fe.editData,Hn=Fe.editKey,Lt=Fe.setEditKey,ke=Lt===void 0?function(){}:Lt,ut=Fe.cancelAdd,Re=ut===void 0?function(){}:ut,tn=Fe.addCallback,cr=tn===void 0?function(){}:tn,pr=Fe.reload,Kn=pr===void 0?function(){}:pr,jt=Object(i.useState)(""),dr=Object(a.a)(jt,2),ct=dr[0],Un=dr[1],yn=Object(i.useState)(""),ln=Object(a.a)(yn,2),Xt=ln[0],Pn=ln[1],hn=Object(i.useState)([]),qt=Object(a.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(i.useState)(""),sr=Object(a.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(i.useState)(),Vt=Object(a.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(i.useState)(!1),On=Object(a.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(i.useState)(),_n=Object(a.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(i.useState)(0),tr=Object(a.a)(er,2),wn=tr[0],Mn=tr[1],dn=Object(i.useState)(!1),or=Object(a.a)(dn,2),Xn=or[0],vr=or[1],gr=Object(i.useState)(!1),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(i.useState)([]),En=Object(a.a)(Rn,2),Cn=En[0],vn=En[1],Qt=Object(i.useState)(1),St=Object(a.a)(Qt,2),It=St[0],kt=St[1],At=Object(i.useState)(!1),zt=Object(a.a)(At,2),sn=zt[0],nn=zt[1],ft=Object(i.useRef)(!1),rt=Object(C.i)(),$e=Object(i.useState)([]),Ze=Object(a.a)($e,2),He=Ze[0],ot=Ze[1],et=function(pn){ot([].concat(Object(W.a)(He),[Object(f.a)({},pn)]))};Object(i.useEffect)(function(){if(ft.current)return;if(!(ge!=null&&ge.question_title)){vr(!0),Un(""),Dt(!1),kn(2),Kt([]),bn(""),Vn(!1);return}Un(ge==null?void 0:ge.question_title),Dt(ge==null?void 0:ge.is_ordered),kt(ge==null?void 0:ge.difficulty),nn(!(ge!=null&&ge.repeat_answer)),kn(ge==null?void 0:ge.question_score);var Ft=ge==null?void 0:ge.standard_answer.map(function(pn){return pn.answer_text});Kt(Object(W.a)(Ft)),vn(ge.tag_discipline_ids),Pn(ge==null?void 0:ge.analysis)},[ge,Xn]),Object(i.useEffect)(function(){Vn(!1),Xn&&Ft();function Ft(){return pn.apply(this,arguments)}function pn(){return pn=Object(ne.a)(s.a.mark(function Ln(){var zn,mn,Ir;return s.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,Object(k.I)({sub_discipline_id:(zn=Le.editData)===null||zn===void 0||((mn=zn.exercise)===null||mn===void 0)?void 0:mn.sub_discipline_id});case 2:Ir=Er.sent,ot(Ir.tag_disciplines);case 4:case"end":return Er.stop()}},Ln)})),pn.apply(this,arguments)}},[Xn]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Tt,isEdit:Xn}}),Object(i.useEffect)(function(){var Ft,pn=Le!=null&&(Ft=Le.tagDisciplineData)!==null&&Ft!==void 0&&Ft.tag_disciplines&&Array.isArray(Le.tagDisciplineData.tag_disciplines)?Le.tagDisciplineData.tag_disciplines:[];ot(pn)},[Le.tagDisciplineData]);var mt=function(pn){(pn==null?void 0:pn.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),vr(!1),ke(-1),ft.current=!1,Kn())},Tt=function(){var Ft=Object(ne.a)(s.a.mark(function pn(){var Ln,zn,mn,Ir,jr,Er,Jn;return s.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:if(Ln=[],zn=!1,_r(!0),Mt.forEach(function(wr,Ur){Ln.push({position:Ur+1,answer_text:[]}),wr.forEach(function(Vr,Fr){Ln[Ur].answer_text.push(Vr),(!Vr||!Object(se.eb)(Vr,1e4))&&(bn("".concat(Ur,"-").concat(Fr)),b.b.info(Vr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),zn=!0)})}),!zn){br.next=7;break}return _r(!1),br.abrupt("return",!1);case 7:if(ft.current=!0,!ge.question_id){br.next=15;break}return br.next=11,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:rt.id,question_id:ge.question_id,name:ct,item_type:3,question_score:Zt,is_ordered:Gt,standard_answers:Ln,tag_discipline_ids:Cn,sub_discipline_id:(Ir=Le.editData)===null||Ir===void 0||((jr=Ir.exercise)===null||jr===void 0)?void 0:jr.sub_discipline_id,difficulty:It,repeat_answer:!sn,analysis:Xt}});case 11:mn=br.sent,mt(mn),br.next=19;break;case 15:return br.next=17,xe({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ge==null?void 0:ge.insert_id,id:rt.id,name:ct,item_type:3,question_score:Zt,is_ordered:Gt,standard_answers:Ln,tag_discipline_ids:Cn,sub_discipline_id:(Er=Le.editData)===null||Er===void 0||((Jn=Er.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:It,repeat_answer:!sn,analysis:Xt}});case 17:mn=br.sent,mt(mn);case 19:return _r(!1),br.abrupt("return",{name:ct,analysis:Xt,standard_answers:Ln,is_ordered:Gt});case 21:case"end":return br.stop()}},pn)}));return function(){return Ft.apply(this,arguments)}}(),gt=function(pn,Ln,zn){var mn=Mt.slice();if(Ln&&mn.splice(pn,Ln),zn&&fn||!ge.question_id)for(var Ir=0;Ir<zn;Ir++)mn.splice(pn+Ir,0,[""]);Mn(mn==null?void 0:mn.length),Vn(!0),Kt(mn)},Pt=function(pn,Ln,zn){bn("");var mn=Mt.slice();mn[pn][Ln]=zn,Kt(mn)},vt=function(pn){var Ln=Mt.slice();Ln[pn]=[].concat(Object(W.a)(Ln[pn]),[""]),Kt(Ln)},yt=function(pn,Ln){var zn=Mt.slice();if(!zn[pn][Ln]){zn[pn]=zn[pn].filter(function(mn,Ir){return Ir!==Ln}),Kt(zn);return}G.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:ue.a.modal,onOk:function(){zn[pn]=zn[pn].filter(function(Ir,jr){return jr!==Ln}),Kt(zn)}})},on=function(pn){G.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:ue.a.modal,onOk:function(){var zn=0;Un(ct.replace(/\▁/g,function(mn){return zn++,zn-1===pn?"":mn})),setTimeout(function(){var mn=Mt.slice();mn=Mt.filter(function(Ir,jr){return pn!==jr}),Kt(mn)},500)}})},$t=function(){var pn,Ln;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),t.a.createElement("div",null,t.a.createElement(H.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:ct,onChange:function(mn){return Un(mn)},showNullButton:!0,deleteEmptyDisabled:Bn,onPlaceholderChange:gt})),t.a.createElement("div",{className:"mt20"},Mt.map(function(zn,mn){return t.a.createElement(J.a,{key:mn,answers:zn,index:mn,is_md:!0,exerciseIsPublish:!1,activeOptionErrorIndex:Fn,onAnswerChange:Pt,addChildAnswer:vt,deleteChildAnswer:yt,deleteChildAnswermain:on})})),t.a.createElement("div",{className:"mt20"},Mt.length>1&&t.a.createElement("span",null,t.a.createElement(O.a,{checked:Gt,onChange:function(mn){return Dt(mn.target.checked)},className:"".concat(ue.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ue.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Xt,onChange:function(mn){return Pn(mn)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Zt,max:1e4,min:0,onChange:function(mn){kn(mn)}})," ","\u5206 \xA0"," ",!!Zt&&!!wn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(Zt/wn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:It,onChange:function(mn){kt(mn.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{value:Cn,selectvalues:ge==null?void 0:ge.tag_discipline_ids,onChange:vn,subId:(pn=Le.editData)===null||pn===void 0||((Ln=pn.exercise)===null||Ln===void 0)?void 0:Ln.sub_discipline_id,knowledgeOptions:He,onAddKnowledgeFinish:et})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:sn,onChange:function(mn){nn(mn)}}))),t.a.createElement("aside",{className:"tr"},(Hn!==-1||ge.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Re(),vr(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Tt()}},"\u4FDD\u5B58")))},hr=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u586B\u7A7A\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],jn=function(){var Ft=Object(ne.a)(s.a.mark(function pn(Ln){return s.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:if(!(Hn!==-1)){mn.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),mn.abrupt("return");case 3:mn.t0=Ln.id,mn.next=mn.t0==="del"?6:mn.t0==="edit"?8:mn.t0==="add"?11:13;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function jr(){return s.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.next=2,Object(pe.g)({question_id:ge.question_id,exam_id:rt.id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(f.a)({},rt)});case 3:case"end":return Jn.stop()}},jr)}))()}}),mn.abrupt("break",13);case 8:return ke(ge.dragKey),vr(!0),mn.abrupt("break",13);case 11:return cr({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:3}),mn.abrupt("break",13);case 13:case"end":return mn.stop()}},pn)}));return function(Ln){return Ft.apply(this,arguments)}}(),Wn=function(){var pn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(Se.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:ge.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ge==null||((pn=ge.standard_answer)===null||pn===void 0)?void 0:pn.map(function(Ln,zn){return t.a.createElement(r.a,{key:zn,align:"middle"},t.a.createElement(D.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Ln.choice_id,"\uFF09\uFF1A"),t.a.createElement(D.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},Ln.answer_text.map(function(mn,Ir){return t.a.createElement(D.a,{span:24,key:Ir},t.a.createElement(T.a,{key:zn,checked:ge.standard_answer.includes(zn),disabled:!0,value:mn}))}))))})),t.a.createElement("div",{className:ue.a.action},!ge.hideAction&&hr.map(function(Ln,zn){return Ln.id==="up"&&ge.key===1||Ln.id==="down"&&ge.key===ge.len?null:t.a.createElement(o.a,{key:zn,placement:"bottom",title:Ln.name},t.a.createElement("span",{onClick:function(){return jn(Ln)},className:Ln.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!Xn&&Wn(),Xn&&$t())},ur=Object(B.a)(function(at){var Fe=at.newExercisePaper;return{newExercisePaper:Fe}},null,null,{forwardRef:!0})(Object(i.forwardRef)(In)),mr=function(Fe,pt){var Le=Fe.newExercisePaper,xe=Fe.dispatch,ge=Fe.editData,Hn=Fe.cancelAdd,Lt=Hn===void 0?function(){}:Hn,ke=Fe.editKey,ut=Fe.setEditKey,Re=ut===void 0?function(){}:ut,tn=Fe.reload,cr=tn===void 0?function(){}:tn,pr=Fe.addCallback,Kn=pr===void 0?function(){}:pr,jt=Object(i.useState)(""),dr=Object(a.a)(jt,2),ct=dr[0],Un=dr[1],yn=Object(i.useState)(""),ln=Object(a.a)(yn,2),Xt=ln[0],Pn=ln[1],hn=Object(i.useState)(""),qt=Object(a.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(i.useState)(),sr=Object(a.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(i.useState)(!1),Vt=Object(a.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(i.useState)([]),On=Object(a.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(i.useState)(1),_n=Object(a.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(i.useState)(!1),tr=Object(a.a)(er,2),wn=tr[0],Mn=tr[1],dn=Object(i.useState)([[],[]]),or=Object(a.a)(dn,2),Xn=or[0],vr=or[1],gr=Object(i.useRef)(!1),Gn=Object(C.i)(),Bn=Object(i.useState)([]),_r=Object(a.a)(Bn,2),Rn=_r[0],En=_r[1],Cn=function(sn){En([].concat(Object(W.a)(Rn),[Object(f.a)({},sn)]))};Object(i.useEffect)(function(){var zt;if(gr.current)return;if(!(ge!=null&&ge.question_title)){Dt(!0),Un(""),Kt(""),bn(10);return}Mn(!(ge!=null&&ge.repeat_answer)),Un(ge==null?void 0:ge.question_title),Kt(ge==null||((zt=ge.standard_answer)===null||zt===void 0)?void 0:zt[0]),bn(ge==null?void 0:ge.question_score),Vn(ge.tag_discipline_ids),kn(ge==null?void 0:ge.difficulty),Pn(ge==null?void 0:ge.analysis),vr([ge==null?void 0:ge.normal_keywords,ge==null?void 0:ge.main_keywords])},[Le.editData,Gt]),Object(i.useEffect)(function(){var zt,sn=Le!=null&&(zt=Le.tagDisciplineData)!==null&&zt!==void 0&&zt.tag_disciplines&&Array.isArray(Le.tagDisciplineData.tag_disciplines)?Le.tagDisciplineData.tag_disciplines:[];En(sn)},[Le.tagDisciplineData]),Object(i.useEffect)(function(){Gt&&zt();function zt(){return sn.apply(this,arguments)}function sn(){return sn=Object(ne.a)(s.a.mark(function nn(){var ft,rt,$e;return s.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:return He.next=2,Object(k.I)({sub_discipline_id:(ft=Le.editData)===null||ft===void 0||((rt=ft.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id});case 2:$e=He.sent,En($e.tag_disciplines);case 4:case"end":return He.stop()}},nn)})),sn.apply(this,arguments)}},[Gt]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Qt,isEdit:Gt}});var vn=function(sn){(sn==null?void 0:sn.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),Dt(!1),Re(-1),gr.current=!1,cr())},Qt=function(){var zt=Object(ne.a)(s.a.mark(function sn(){var nn,ft,rt,$e,Ze,He,ot;return s.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:if(ct){mt.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),mt.abrupt("return",!1);case 3:if(nn=Xn[0],ft=Xn[1],gr.current=!0,!ge.question_id){mt.next=13;break}return mt.next=9,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:Gn.id,question_id:ge.question_id,name:ct,item_type:4,question_score:Fn,answer_texts:[Mt],tag_discipline_ids:fn,sub_discipline_id:($e=Le.editData)===null||$e===void 0||((Ze=$e.exercise)===null||Ze===void 0)?void 0:Ze.sub_discipline_id,difficulty:Zt,repeat_answer:!wn,analysis:Xt,normal_keywords:nn,main_keywords:ft}});case 9:rt=mt.sent,vn(rt),mt.next=17;break;case 13:return mt.next=15,xe({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ge==null?void 0:ge.insert_id,id:Gn.id,name:ct,item_type:4,question_score:Fn,answer_texts:[Mt],tag_discipline_ids:fn,sub_discipline_id:(He=Le.editData)===null||He===void 0||((ot=He.exercise)===null||ot===void 0)?void 0:ot.sub_discipline_id,difficulty:Zt,repeat_answer:!wn,analysis:Xt,normal_keywords:nn,main_keywords:ft}});case 15:rt=mt.sent,vn(rt);case 17:return mt.abrupt("return",{name:ct,answer_texts:[Mt],analysis:Xt,normal_keywords:nn,main_keywords:ft});case 18:case"end":return mt.stop()}},sn)}));return function(){return zt.apply(this,arguments)}}(),St=function(){var sn,nn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ct,onChange:function(rt){return Un(rt)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(y.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Mt,onChange:function(rt){return Kt(rt)}}),t.a.createElement(wt.a,{value:Xn,onChange:vr}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Xt,onChange:function(rt){return Pn(rt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Fn,max:1e4,min:0,onChange:function(rt){bn(rt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:Zt,onChange:function(rt){kn(rt.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{value:fn,selectvalues:ge==null?void 0:ge.tag_discipline_ids,onChange:Vn,subId:(sn=Le.editData)===null||sn===void 0||((nn=sn.exercise)===null||nn===void 0)?void 0:nn.sub_discipline_id,knowledgeOptions:Rn,onAddKnowledgeFinish:Cn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:wn,onChange:function(rt){Mn(rt)}}))),t.a.createElement("aside",{className:"tr"},(ke!==-1||ge.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Lt(),Dt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Qt()}},"\u4FDD\u5B58")))},It=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7B80\u7B54\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],kt=function(){var zt=Object(ne.a)(s.a.mark(function sn(nn){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(!(ke!==-1)){rt.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),rt.abrupt("return");case 3:rt.t0=nn.id,rt.next=rt.t0==="del"?6:rt.t0==="up"||rt.t0==="down"?8:rt.t0==="edit"?12:rt.t0==="add"?15:17;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function Ze(){return s.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.next=2,Object(pe.g)({question_id:ge.question_id,exam_id:Gn.id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(f.a)({},Gn)});case 3:case"end":return ot.stop()}},Ze)}))()}}),rt.abrupt("break",17);case 8:return rt.next=10,xe({type:"newExercisePaper/exeriseMoveUpDown",payload:{id:ge.question_id,opr:nn.id}});case 10:return xe({type:"newExercisePaper/editExercise",payload:Object(f.a)({},Gn)}),rt.abrupt("break",17);case 12:return Re(ge.dragKey),Dt(!0),rt.abrupt("break",17);case 15:return Kn({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:4}),rt.abrupt("break",17);case 17:case"end":return rt.stop()}},sn)}));return function(nn){return zt.apply(this,arguments)}}(),At=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(Se.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:ge.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(Se.a,{value:Mt||""})),t.a.createElement("div",{className:ue.a.action},!ge.hideAction&&It.map(function(sn,nn){return t.a.createElement(o.a,{key:nn,placement:"bottom",title:sn.name},t.a.createElement("span",{onClick:function(){return kt(sn)},className:sn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!Gt&&At(),Gt&&St())},Qn=Object(B.a)(function(at){var Fe=at.newExercisePaper;return{newExercisePaper:Fe}},null,null,{forwardRef:!0})(Object(i.forwardRef)(mr)),yr=function(Fe,pt){var Le=Fe.dispatch,xe=Fe.editData,ge=Fe.cancelAdd,Hn=ge===void 0?function(){}:ge,Lt=Fe.editKey,ke=Fe.setEditKey,ut=ke===void 0?function(){}:ke,Re=Fe.reload,tn=Re===void 0?function(){}:Re,cr=Object(i.useState)(""),pr=Object(a.a)(cr,2),Kn=pr[0],jt=pr[1],dr=Object(i.useState)(""),ct=Object(a.a)(dr,2),Un=ct[0],yn=ct[1],ln=Object(i.useState)(""),Xt=Object(a.a)(ln,2),Pn=Xt[0],hn=Xt[1],qt=Object(i.useState)([]),Mt=Object(a.a)(qt,2),Kt=Mt[0],ar=Mt[1],sr=Object(i.useState)(),Fn=Object(a.a)(sr,2),bn=Fn[0],Ut=Fn[1],Vt=Object(i.useState)(!1),Gt=Object(a.a)(Vt,2),Dt=Gt[0],Zn=Gt[1],On=Object(i.useState)([]),fn=Object(a.a)(On,2),Vn=fn[0],un=fn[1],_n=Object(i.useState)(!1),Zt=Object(a.a)(_n,2),kn=Zt[0],er=Zt[1],tr=Object(i.useState)(!1),wn=Object(a.a)(tr,2),Mn=wn[0],dn=wn[1],or=Object(C.i)(),Xn=Object(i.useRef)(!1);Object(i.useEffect)(function(){var En;if(Xn.current)return;xe.edit&&(er(!0),yn(""),jt(""),un([])),jt(xe.shixun_name),yn(xe.question_title);var Cn=[];(En=xe.shixun)===null||En===void 0||En.map(function(vn){Cn.push(vn.challenge_score)}),un(Cn)},[xe]),Object(i.useEffect)(function(){Zn(!1)},[kn]),Object(i.useImperativeHandle)(pt,function(){return{onSave:gr,isEdit:kn}});var vr=function(Cn){(Cn==null?void 0:Cn.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),er(!1),ut(-1),Xn.current=!1,tn())},gr=function(){var En=Object(ne.a)(s.a.mark(function Cn(){var vn,Qt,St;return s.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(vn=[],Qt=!1,!Qt){kt.next=4;break}return kt.abrupt("return",!1);case 4:if(Xn.current=!0,dn(!0),!xe.question_id){kt.next=12;break}return kt.next=9,Le({type:"newExercisePaper/editExerciseQuestion",payload:{id:or.id,question_id:xe.question_id,name:Un,shixun_name:Kn,shixun_id:xe.shixun_id,item_type:5,question_scores:Vn}});case 9:St=kt.sent,kt.next=15;break;case 12:return kt.next=14,Le({type:"newExercisePaper/addExerciseQuestion",payload:{id:or.id,insert_id:xe==null?void 0:xe.insert_id,name:Un,shixun_name:Kn,shixun_id:xe.shixun_id,item_type:5,question_scores:Vn,is_copy:xe.is_copy}});case 14:St=kt.sent;case 15:return vr(St),dn(!1),kt.abrupt("return",{name:Un,analysis:Pn,standard_answers:vn,is_ordered:bn});case 18:case"end":return kt.stop()}},Cn)}));return function(){return En.apply(this,arguments)}}(),Gn=function(){var Cn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(T.a,{defaultValue:Kn,onChange:function(Qt){jt(Qt.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(y.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:Un,onChange:function(Qt){yn(Qt)}})),t.a.createElement("div",{className:"mt20"},(Cn=xe.shixun)===null||Cn===void 0?void 0:Cn.map(function(vn,Qt){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(D.a,{flex:"1"},Qt+1,".",vn.challenge_name),t.a.createElement(D.a,null,t.a.createElement(U.a,{defaultValue:Vn[Qt],onChange:function(It){Vn[Qt]=It,un(Vn)}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Kt.length>1&&t.a.createElement("span",null,t.a.createElement(O.a,{checked:bn,onChange:function(Qt){return Ut(Qt.target.checked)},className:"".concat(ue.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ue.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(Lt!==-1||!(xe!=null&&xe.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){Hn(),er(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:Mn,className:"ml20",type:"primary",onClick:function(){gr()}},"\u4FDD\u5B58")))},Bn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],_r=function(){var En=Object(ne.a)(s.a.mark(function Cn(vn){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(!(Lt!==-1)){St.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),St.abrupt("return");case 3:St.t0=vn.id,St.next=St.t0==="del"?6:St.t0==="edit"?8:St.t0==="add"?11:13;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function kt(){return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(pe.g)({question_id:xe.question_id,exam_id:or.id});case 2:Le({type:"newExercisePaper/editExercise",payload:Object(f.a)({},or)});case 3:case"end":return zt.stop()}},kt)}))()}}),St.abrupt("break",13);case 8:return ut(xe.dragKey),er(!0),St.abrupt("break",13);case 11:return Le({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:xe.key,insert_id:xe==null?void 0:xe.question_id,question_type:5}}}),St.abrupt("break",13);case 13:case"end":return St.stop()}},Cn)}));return function(vn){return En.apply(this,arguments)}}(),Rn=function(){var Cn,vn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(xe!=null&&xe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},xe.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",xe.question_score,"\u5206\uFF09")),xe!=null&&xe.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},xe.key,"."),t.a.createElement(Se.a,{value:xe.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",xe.question_score,"\u5206\uFF09"),!!((Cn=xe.schools)!==null&&Cn!==void 0&&Cn.length)&&t.a.createElement(o.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:xe.shixun_name})),t.a.createElement("div",{className:"mt30"}),(vn=xe.shixun)===null||vn===void 0?void 0:vn.map(function(Qt,St){return t.a.createElement("div",{key:St},"\u7B2C",St+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},Qt.challenge_name)," ",t.a.createElement("span",{className:"ml10"},Qt.challenge_score," \u5206"))}),t.a.createElement("div",{className:ue.a.action},t.a.createElement(Be.a,{target:"_blank",to:"/shixuns/".concat(xe.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!xe.hideAction&&Bn.map(function(Qt,St){return t.a.createElement(o.a,{key:St,placement:"bottom",title:Qt.name},t.a.createElement("span",{onClick:function(){return _r(Qt)},className:Qt.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!kn&&Rn(),kn&&Gn())},Sr=Object(B.a)(function(at){var Fe=at.newExercisePaper;return{newExercisePaper:Fe}},null,null,{forwardRef:!0})(Object(i.forwardRef)(yr)),Nn=["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"],Ar=function(Fe,pt){var Le=Fe.newExercisePaper,xe=Fe.dispatch,ge=Fe.editData,Hn=Fe.editKey,Lt=Fe.addCallback,ke=Lt===void 0?function(){}:Lt,ut=Object(i.useState)([]),Re=Object(a.a)(ut,2),tn=Re[0],cr=Re[1],pr=Object(i.useState)(),Kn=Object(a.a)(pr,2),jt=Kn[0],dr=Kn[1],ct=Object(i.useState)([]),Un=Object(a.a)(ct,2),yn=Un[0],ln=Un[1],Xt=Object(i.useState)(""),Pn=Object(a.a)(Xt,2),hn=Pn[0],qt=Pn[1],Mt=Object(i.useState)(5),Kt=Object(a.a)(Mt,2),ar=Kt[0],sr=Kt[1],Fn=Object(i.useState)(!1),bn=Object(a.a)(Fn,2),Ut=bn[0],Vt=bn[1],Gt=Object(C.i)();Object(i.useEffect)(function(){cr(["","","",""])},[]),Object(i.useEffect)(function(){if(!(ge!=null&&ge.question_choices)){Vt(!0),qt(""),sr(5),cr(["","","",""]),ln([]);return}qt(ge==null?void 0:ge.question_title),sr(ge==null?void 0:ge.question_score),cr(ge==null?void 0:ge.question_choices.map(function(_n){return _n.choice_text}));var un=[];ge==null||ge.standard_answer.map(function(_n,Zt){un.push(_n-1)}),ln(un)},[ge]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Dt,isEdit:Ut}});var Dt=function(){var un=Object(ne.a)(s.a.mark(function _n(){var Zt,kn,er;return s.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(hn){wn.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),wn.abrupt("return",!1);case 3:if(Zt=tn.findIndex(function(Mn){return!Mn}),!(Zt>-1)){wn.next=7;break}return b.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Nn[Zt]," \u9009\u9879\u7684\u5185\u5BB9")),wn.abrupt("return",!1);case 7:if(yn.length){wn.next=10;break}return b.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),wn.abrupt("return",!1);case 10:if(!(yn.length<1)){wn.next=13;break}return b.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),wn.abrupt("return",!1);case 13:if(kn=tn.map(function(Mn,dn){return{choice_text:Mn,is_answer:yn.includes(dn)?dn+1:0}}),!ge.question_id){wn.next=20;break}return wn.next=17,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:ge.question_id,question_title:hn,question_type:1,question_score:ar,question_choices:kn.map(function(Mn){return Mn.choice_text}),standard_answers:kn.filter(function(Mn){return Mn.is_answer}).map(function(Mn){return Mn.is_answer})}});case 17:er=wn.sent,wn.next=23;break;case 20:return wn.next=22,xe({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ge==null?void 0:ge.insert_id,categoryId:Gt.categoryId,question_title:hn,question_type:1,question_score:"5.0",question_choices:kn.map(function(Mn){return Mn.choice_text}),standard_answers:kn.filter(function(Mn){return Mn.is_answer}).map(function(Mn){return Mn.is_answer})}});case 22:er=wn.sent;case 23:er.status===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),Vt(!1),xe({type:"newExercisePaper/editExercise",payload:Object(f.a)({},Gt)}));case 24:case"end":return wn.stop()}},_n)}));return function(){return un.apply(this,arguments)}}(),Zn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7F16\u7A0B\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],On=function(){var un=Object(ne.a)(s.a.mark(function _n(Zt){return s.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:if(!(Hn!==-1)){er.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),er.abrupt("return");case 3:er.t0=Zt.id,er.next=er.t0==="del"?6:er.t0==="edit"?8:er.t0==="add"?10:12;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function wn(){return s.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:return dn.next=2,Object(pe.g)({exam_id:Gt.id,question_id:ge.question_id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(f.a)({},Gt)});case 3:case"end":return dn.stop()}},wn)}))()}}),er.abrupt("break",12);case 8:return B.d.push("/problems/".concat(ge==null?void 0:ge.hack_identifier,"/edit?type=exercises&express_id=").concat(Gt.id,"&question_id=").concat(ge==null?void 0:ge.question_id,"&score=").concat(ge==null?void 0:ge.question_score,"&exercise=true&callback_url=").concat(location.pathname)),er.abrupt("break",12);case 10:return ke({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:6}),er.abrupt("break",12);case 12:case"end":return er.stop()}},_n)}));return function(Zt){return un.apply(this,arguments)}}(),fn=function(){var un=Object(ne.a)(s.a.mark(function _n(Zt){var kn;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return Zt.preventDefault(),tr.next=3,Object(k.Y)({id:ge==null?void 0:ge.hack_identifier});case 3:kn=tr.sent,kn.status===0&&Object(se.S)("/myproblems/".concat(kn==null?void 0:kn.identifier));case 5:case"end":return tr.stop()}},_n)}));return function(Zt){return un.apply(this,arguments)}}(),Vn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(Se.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:ge.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},t.a.createElement(Se.a,{value:ge.description||""})),t.a.createElement("div",{className:ue.a.action},!ge.hideAction&&Zn.map(function(_n,Zt){return t.a.createElement(o.a,{key:Zt,placement:"bottom",title:_n.name},t.a.createElement("span",{onClick:function(){return On(_n)},className:_n.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},Vn())},An=Object(B.a)(function(at){var Fe=at.newExercisePaper;return{newExercisePaper:Fe}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ar)),Dn=["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"],qn=function(Fe,pt){var Le=Fe.newExercisePaper,xe=Fe.dispatch,ge=Fe.editData,Hn=Fe.cancelAdd,Lt=Hn===void 0?function(){}:Hn,ke=Fe.editKey,ut=Fe.setEditKey,Re=ut===void 0?function(){}:ut,tn=Fe.addCallback,cr=tn===void 0?function(Qt){}:tn,pr=Fe.reload,Kn=pr===void 0?function(){}:pr,jt=Object(i.useState)([]),dr=Object(a.a)(jt,2),ct=dr[0],Un=dr[1],yn=Object(i.useState)(!1),ln=Object(a.a)(yn,2),Xt=ln[0],Pn=ln[1],hn=Object(i.useState)(!0),qt=Object(a.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(i.useState)(1),sr=Object(a.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(i.useState)(!1),Vt=Object(a.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(i.useState)([]),On=Object(a.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(C.i)(),_n=Object(i.useRef)(null),Zt=Object(i.useState)(""),kn=Object(a.a)(Zt,2),er=kn[0],tr=kn[1],wn=Object(i.useState)([]),Mn=Object(a.a)(wn,2),dn=Mn[0],or=Mn[1],Xn=Object(i.useRef)(!1),vr=function(St){Vn([].concat(Object(W.a)(fn),[Object(f.a)({},St)]))};Object(i.useEffect)(function(){var Qt;if(Xn.current)return;if(!(ge!=null&&ge.question_title)){Pn(!0),tr("");return}tr(ge==null?void 0:ge.question_title),Dt(!(ge!=null&&ge.repeat_answer)),bn(ge==null?void 0:ge.difficulty),Un(ge.tag_discipline_ids);var St=ge==null||((Qt=ge.sub_exercise_questions)===null||Qt===void 0)?void 0:Qt.map(function(It){return Object(f.a)(Object(f.a)({},It),{},{id:It.question_id,name:It.question_title,open:!1,question_score:It.question_score,choices:It==null?void 0:It.question_choices.map(function(kt){return{choice_text:kt.choice_text,is_answer:kt.standard_boolean?1:0}}),activeQusEditor:null})});or(St)},[ge,Xt]),Object(i.useEffect)(function(){Xt&&Qt();function Qt(){return St.apply(this,arguments)}function St(){return St=Object(ne.a)(s.a.mark(function It(){var kt,At,zt;return s.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Object(k.I)({sub_discipline_id:(kt=Le.editData)===null||kt===void 0||((At=kt.exercise)===null||At===void 0)?void 0:At.sub_discipline_id});case 2:zt=nn.sent,Vn(zt.tag_disciplines);case 4:case"end":return nn.stop()}},It)})),St.apply(this,arguments)}},[Xt]),Object(i.useEffect)(function(){var Qt,St=Le!=null&&(Qt=Le.tagDisciplineData)!==null&&Qt!==void 0&&Qt.tag_disciplines&&Array.isArray(Le.tagDisciplineData.tag_disciplines)?Le.tagDisciplineData.tag_disciplines:[];Vn(St)},[Le.tagDisciplineData]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Gn,isEdit:Xt}});var gr=function(St){(St==null?void 0:St.status)===0&&(b.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),Re(-1),Xn.current=!1,Kn())},Gn=function(){var Qt=Object(ne.a)(s.a.mark(function St(){var It,kt,At,zt,sn,nn,ft,rt,$e,Ze,He;return s.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:if(er){et.next=3;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),et.abrupt("return",!1);case 3:if(!(dn.length===0)){et.next=6;break}return b.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),et.abrupt("return",!1);case 6:It=0;case 7:if(!(It<dn.length)){et.next=25;break}if(At=dn[It],At!=null&&At.name){et.next=12;break}return b.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(It+1,"\u5C0F\u9898\u9898\u5E72")),et.abrupt("return",!1);case 12:if(At!=null&&At.question_score){et.next=15;break}return b.b.info("\u7B2C".concat(It+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),et.abrupt("return",!1);case 15:if(zt=At==null||((kt=At.choices)===null||kt===void 0)?void 0:kt.findIndex(function(mt){return!mt}),!(zt>-1)){et.next=19;break}return b.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(It+1,"\u5C0F\u9898").concat(Dn[zt],"\u9009\u9879\u7684\u5185\u5BB9")),et.abrupt("return",!1);case 19:if(!(At.choices.findIndex(function(mt){return mt.is_answer===1})===-1)){et.next=22;break}return b.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(It+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),et.abrupt("return",!1);case 22:It++,et.next=7;break;case 25:if(sn=dn.map(function(mt){return{id:mt.id>1?mt.id:null,name:mt.name,item_type:Me.a.Single,choices:mt.choices,question_score:mt.question_score}}),Xn.current=!0,!ge.question_id){et.next=34;break}return et.next=30,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:un.id,question_id:ge.question_id,name:er,item_type:Me.a.Combine,sub_item_banks:sn,tag_discipline_ids:ct,sub_discipline_id:(ft=Le.editData)===null||ft===void 0||((rt=ft.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id,difficulty:Fn,repeat_answer:!Gt}});case 30:nn=et.sent,gr(nn),et.next=38;break;case 34:return et.next=36,xe({type:"newExercisePaper/addExerciseQuestion",payload:{id:un.id,insert_id:ge==null?void 0:ge.insert_id,name:er,item_type:Me.a.Combine,tag_discipline_ids:ct,sub_discipline_id:($e=Le.editData)===null||$e===void 0||((Ze=$e.exercise)===null||Ze===void 0)?void 0:Ze.sub_discipline_id,difficulty:Fn,repeat_answer:!Gt,sub_item_banks:sn}});case 36:nn=et.sent,((He=nn)===null||He===void 0?void 0:He.status)===0&&(Re(-1),b.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),xe({type:"newExercisePaper/editExercise",payload:Object(f.a)({},un)}));case 38:case"end":return et.stop()}},St)}));return function(){return Qt.apply(this,arguments)}}(),Bn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],_r=function(){var Qt=Object(ne.a)(s.a.mark(function St(It){return s.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(ke!==-1)){At.next=3;break}return b.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),At.abrupt("return");case 3:At.t0=It.id,At.next=At.t0==="del"?6:At.t0==="edit"?8:At.t0==="add"?11:13;break;case 6:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(ne.a)(s.a.mark(function sn(){return s.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(pe.g)({question_id:ge.question_id,exam_id:un.id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(f.a)({},un)});case 3:case"end":return ft.stop()}},sn)}))()}}),At.abrupt("break",13);case 8:return Re(ge.dragKey),Pn(!0),At.abrupt("break",13);case 11:return cr({key:ge.key,insert_id:ge==null?void 0:ge.question_id,item_type:Me.a.Single}),At.abrupt("break",13);case 13:case"end":return At.stop()}},St)}));return function(It){return Qt.apply(this,arguments)}}(),Rn=function(){var St;return t.a.createElement("aside",{ref:_n},t.a.createElement("div",{className:ue.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(Se.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",ge==null?void 0:ge.sub_q_count,"\u5C0F\u9898\uFF0C",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Se.a,{value:ge.question_title})),t.a.createElement("div",{style:{display:Mt?"block":"none"},className:ue.a.questionChoices},ge==null||((St=ge.sub_exercise_questions)===null||St===void 0)?void 0:St.map(function(It,kt){var At;return t.a.createElement("div",{key:kt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,".",kt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(Se.a,{value:It.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",It.question_score,"\u5206\uFF09")),It==null||((At=It.question_choices)===null||At===void 0)?void 0:At.map(function(zt,sn){return t.a.createElement(r.a,{key:sn},t.a.createElement(D.a,null,t.a.createElement(g.a,{key:sn,checked:zt.standard_boolean,disabled:!0},Dn[sn],".")),t.a.createElement(D.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Se.a,{value:zt.choice_text}))))}))})),t.a.createElement("div",{className:ue.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Kt(!Mt)},style:{}},Mt?"\u6536\u8D77":"\u5C55\u5F00"),!ge.hideAction&&Bn.map(function(It,kt){return t.a.createElement(o.a,{key:kt,placement:"bottom",title:It.name},t.a.createElement("span",{onClick:function(){return _r(It)},className:It.icon}))})))},En=function(){var St,It;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:ue.a.wrap,style:{padding:0}},t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:er,onChange:function(At){return tr(At)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",dn==null?void 0:dn.length),dn==null?void 0:dn.map(function(kt,At){var zt;return t.a.createElement("div",{className:ue.a.fold,key:kt.id},t.a.createElement("div",{onClick:function(){return vn("open",At)},className:ue.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:kt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",At+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(nn){nn.stopPropagation(),vn("delete",At)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:kt.open?"block":"none"}},t.a.createElement(y.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:kt==null?void 0:kt.name,onChange:function(nn){return vn("value",At,nn)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),kt==null||((zt=kt.choices)===null||zt===void 0)?void 0:zt.map(function(sn,nn){var ft;return t.a.createElement("div",{className:ue.a.choiceWrap,key:nn},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(sn.is_answer===1?ue.a.activeAnswer:""),onClick:function(){return vn("answer",At,nn)}},Dn[nn])),t.a.createElement("div",{className:ue.a.editorWrap},(kt==null?void 0:kt.activeQusEditor)===nn?t.a.createElement(y.a,{id:"single-question-option-".concat(nn),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:sn.choice_text,onChange:function($e){return vn("details",At,$e)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return vn("edit",At,nn)}},t.a.createElement(Se.a,{value:sn.choice_text}))),nn>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return vn("deleteQus",At,nn)}})),nn<7&&nn===(kt==null||((ft=kt.choices)===null||ft===void 0)?void 0:ft.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return vn("addQus",At)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:kt.question_score,max:1e4,min:0,onChange:function(nn){return vn("score",At,nn)}}),"\u5206")))}),dn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:Cn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(g.a.Group,{value:Fn,onChange:function(At){bn(At.target.value)}},t.a.createElement(g.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(g.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(g.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\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")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Ue.a,{selectvalues:ge==null?void 0:ge.tag_discipline_ids,value:ct,onChange:Un,subId:(St=Le.editData)===null||St===void 0||((It=St.exercise)===null||It===void 0)?void 0:It.sub_discipline_id,knowledgeOptions:fn,onAddKnowledgeFinish:vr}))),t.a.createElement("aside",{className:"tr"},(ke!==-1||ge.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Lt(),Pn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Gn()}},"\u4FDD\u5B58")))},Cn=function(){var St={id:Math.random(),item_type:"SINGLE",open:!1,name:"",choices:Array.from({length:4},function(){return{choice_text:"",is_answer:0}}),activeQusEditor:null,analysis:""};or(dn.concat(St))},vn=function(St,It,kt){var At=Object(bt.cloneDeep)(dn);St==="open"&&(At[It].open=!At[It].open),St==="delete"&&At.splice(It,1),St==="value"&&(At[It].name=kt),St==="answer"&&At[It].choices.forEach(function(zt,sn){zt.is_answer=kt===sn?1:0}),St==="edit"&&(At[It].activeQusEditor=kt),St==="details"&&(At[It].choices[At[It].activeQusEditor].choice_text=kt),St==="addQus"&&(At[It].choices=At[It].choices.concat({choice_text:"",is_answer:0})),St==="deleteQus"&&(At[It].choices=At[It].choices.filter(function(zt,sn){return sn!==kt})),St==="analysis"&&(At[It].analysis=kt),St==="score"&&(At[It].question_score=kt),or(At)};return t.a.createElement("section",{className:ue.a.wrap},!Xt&&Rn(),Xt&&En())},fr=Object(B.a)(function(at){var Fe=at.newExercisePaper;return{newExercisePaper:Fe}},null,null,{forwardRef:!0})(Object(i.forwardRef)(qn)),Lr=function(Fe){var pt=Fe.data,Le=Fe.isDragDisabled,xe=Le===void 0?!1:Le,ge=Fe.editorProps,Hn=ge===void 0?{}:ge,Lt=Fe.onDragEnd,ke=Lt===void 0?function(){}:Lt,ut=Fe.dispatch,Re=Fe.markBtnVisible,tn=Re===void 0?!1:Re,cr=Fe.batchScore,pr=cr===void 0?[]:cr,Kn=Fe.reload,jt=Kn===void 0?function(){}:Kn,dr=Fe.inNewPaperLibrary,ct=dr===void 0?!1:dr,Un=Object(i.useRef)(),yn=Object(C.i)(),ln=function(){var Ut,Vt,Gt,Dt,Zn,On,fn,Vn,un,_n,Zt,kn,er,tr,wn,Mn,dn=[{name:"\u5355\u9009\u9898",type:0,count:pt==null||((Ut=pt.exercise_types)===null||Ut===void 0)?void 0:Ut.q_singles,score:pt==null||((Vt=pt.exercise_types)===null||Vt===void 0)?void 0:Vt.q_singles_scores,items:[]},{name:"\u591A\u9009\u9898",type:1,count:pt==null||((Gt=pt.exercise_types)===null||Gt===void 0)?void 0:Gt.q_doubles,score:pt==null||((Dt=pt.exercise_types)===null||Dt===void 0)?void 0:Dt.q_doubles_scores,items:[]},{name:"\u5224\u65AD\u9898",type:2,count:pt==null||((Zn=pt.exercise_types)===null||Zn===void 0)?void 0:Zn.q_judges,score:pt==null||((On=pt.exercise_types)===null||On===void 0)?void 0:On.q_judges_scores,items:[]},{name:"\u586B\u7A7A\u9898",type:3,count:pt==null||((fn=pt.exercise_types)===null||fn===void 0)?void 0:fn.q_nulls,score:pt==null||((Vn=pt.exercise_types)===null||Vn===void 0)?void 0:Vn.q_nulls_scores,items:[]},{name:"\u7B80\u7B54\u9898",type:4,count:pt==null||((un=pt.exercise_types)===null||un===void 0)?void 0:un.q_mains,score:pt==null||((_n=pt.exercise_types)===null||_n===void 0)?void 0:_n.q_mains_scores,items:[]},{name:"\u5B9E\u8BAD\u9898",type:5,count:pt==null||((Zt=pt.exercise_types)===null||Zt===void 0)?void 0:Zt.q_shixuns,score:pt==null||((kn=pt.exercise_types)===null||kn===void 0)?void 0:kn.q_shixuns_scores,items:[]},{name:"\u7F16\u7A0B\u9898",type:6,count:pt==null||((er=pt.exercise_types)===null||er===void 0)?void 0:er.q_pros,score:pt==null||((tr=pt.exercise_types)===null||tr===void 0)?void 0:tr.q_pros_scores,items:[]},{name:"\u7EC4\u5408\u9898",type:7,count:pt==null||((wn=pt.exercise_types)===null||wn===void 0)?void 0:wn.q_combinations,score:pt==null||((Mn=pt.exercise_types)===null||Mn===void 0)?void 0:Mn.q_combination_scores,items:[]}];return dn},Xt=function(Ut,Vt,Gt){var Dt=Array.from(Ut),Zn=Dt.splice(Vt,1),On=Object(a.a)(Zn,1),fn=On[0];return Dt.splice(Gt,0,fn),Dt},Pn=function(Ut,Vt,Gt){if(!Ut.destination)return;var Dt=Xt(Vt,Ut.source.index,Ut.destination.index);ct?ke(Ut,Dt,Gt):ke(Dt,Gt)},hn=function(Ut){ut({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:Ut}})},qt=function(Ut,Vt){if(Vt===0)return ct?t.a.createElement(Ct,Object(p.a)({reload:jt,editData:Ut},Ut)):t.a.createElement(ht,Object(p.a)({reload:jt,editData:Ut},Ut));if(Vt===1)return ct?t.a.createElement(ir,Object(p.a)({reload:jt,editData:Ut},Ut)):t.a.createElement(Ee,Object(p.a)({reload:jt,editData:Ut},Ut));if(Vt===2)return ct?t.a.createElement(rn,Object(p.a)({reload:jt,editData:Ut},Ut)):t.a.createElement(z,Object(p.a)({reload:jt,editData:Ut},Ut));if(Vt===3)return ct?t.a.createElement(ur,Object(p.a)({reload:jt,editData:Ut},Ut)):t.a.createElement(q,Object(p.a)({reload:jt,editData:Ut},Ut));if(Vt===4)return ct?t.a.createElement(Qn,Object(p.a)({reload:jt,editData:Ut},Ut)):t.a.createElement(an,Object(p.a)({reload:jt,editData:Ut},Ut));if(Vt===5)return ct?t.a.createElement(Sr,Object(p.a)({reload:jt,editData:Ut},Ut)):t.a.createElement(Ne,Object(p.a)({reload:jt,editData:Ut},Ut));if(Vt===6)return ct?t.a.createElement(An,Object(p.a)({reload:jt,editData:Ut},Ut)):t.a.createElement(Qe,Object(p.a)({editData:Ut},Ut));if(Vt===7)return ct?t.a.createElement(fr,Object(p.a)({reload:jt,editData:Ut},Ut)):t.a.createElement(ae,Object(p.a)({reload:jt,editData:Ut},Ut))},Mt=function(Ut,Vt,Gt){return t.a.createElement(le.a,{onDragEnd:function(Zn){return Pn(Zn,Ut,Vt)}},t.a.createElement(le.c,{droppableId:"droppable"},function(Dt,Zn){return t.a.createElement("div",Object(p.a)({ref:Dt.innerRef},Dt.droppableProps,{style:{width:"100%"}}),Ut==null?void 0:Ut.map(function(On,fn){var Vn,un=Object(f.a)(Object(f.a)({},On),{},{key:fn+1,hideAction:!0,isPreview:!0,dragKey:Vt+"-"+fn},Hn);return t.a.createElement(le.b,{key:un==null?void 0:un.question_id,draggableId:un==null||((Vn=un.question_id)===null||Vn===void 0)?void 0:Vn.toString(),index:fn,isDragDisabled:xe},function(_n,Zt){return t.a.createElement("aside",Object(p.a)({ref:_n.innerRef},_n.draggableProps,_n.dragHandleProps),t.a.createElement("div",{className:Ce.a.posWarp,id:un.dragKey},qt(un,Vt),tn&&t.a.createElement(r.a,{className:Ce.a.markWrongBtnWrapper},t.a.createElement(m.a,{onClick:function(){return hn({value:un,type:Vt})}},un!=null&&un.is_wrong?"\u53D6\u6D88\u6807\u8BB0\u9519\u9898":"\u6807\u8BB0\u9519\u9898")),t.a.createElement(Y.a,null),!xe&&t.a.createElement("div",{className:Ce.a.pos},t.a.createElement("div",{className:Ce.a.tips},"\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u8BD5\u9898\u663E\u793A\u987A\u5E8F"))))})}))}))},Kt=function(Ut){var Vt=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],Gt=["","\u5341","\u767E","\u5343","\u4E07"];Ut=parseInt(Ut);var Dt=function(Vn){for(var un=Vn.toString().split("").reverse(),_n="",Zt=0;Zt<un.length;Zt++)_n=(Zt==0&&un[Zt]==0||Zt>0&&un[Zt]==0&&un[Zt-1]==0?"":Vt[un[Zt]]+(un[Zt]==0?Gt[0]:Gt[Zt]))+_n;return _n},Zn=Math.floor(Ut/1e4),On=Ut%1e4;return On.toString().length<4&&(On="0"+On),Zn?Dt(Zn)+"\u4E07"+Dt(On):Dt(Ut)},ar=function(Ut){var Vt={\u5355\u9009\u9898:2,\u591A\u9009\u9898:5,\u586B\u7A7A\u9898:2,\u5224\u65AD\u9898:2,\u7B80\u7B54\u9898:10,\u7F16\u7A0B\u9898:10,\u5B9E\u8BAD\u9898:5,\u7EC4\u5408\u9898:10};return Vt[Ut]||0},sr=function(Ut,Vt){Un.current=ar(Vt),G.a.confirm({centered:!0,title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u6570",content:t.a.createElement("div",{className:""},t.a.createElement("span",null,Vt==="\u7EC4\u5408\u9898"?"\u7EC4\u5408\u9898\u4E2D\u7684\u6BCF\u5C0F\u9898":Vt,"\uFF1A"),t.a.createElement(U.a,{min:1,defaultValue:Un.current,onChange:function(Dt){Un.current=Dt}}),t.a.createElement("span",{className:"ml5"},"\u5206/\u9898"),t.a.createElement("br",null),Vt==="\u586B\u7A7A\u9898"&&t.a.createElement("div",{style:{color:"rgb(255, 0, 0)"}},"\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Gt=Object(ne.a)(s.a.mark(function Zn(){var On,fn;return s.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:if(!ct){un.next=6;break}return un.next=3,Object(pe.t)(yn.id,{question_type:Ut,score:Un.current});case 3:return On=un.sent,On.status===0&&jt(),un.abrupt("return");case 6:return un.next=8,Object(de.a)("/api/exercises/".concat(yn.categoryId,"/batch_set_score.json"),{method:"post",body:{question_type:Ut,score:Un.current}});case 8:fn=un.sent,fn.status!==-1&&jt();case 10:case"end":return un.stop()}},Zn)}));function Dt(){return Gt.apply(this,arguments)}return Dt}()})},Fn=function(){var Ut,Vt=ln();pt==null||((Ut=pt.exercise_questions)===null||Ut===void 0)||Ut.forEach(function(Dt,Zn){if(Dt.question_type===0){var On,fn;(On=Vt[Dt.question_type])===null||On===void 0||((fn=On.items)===null||fn===void 0)||fn.push(Dt)}if(Dt.question_type===1){var Vn,un;(Vn=Vt[Dt.question_type])===null||Vn===void 0||((un=Vn.items)===null||un===void 0)||un.push(Dt)}if(Dt.question_type===2){var _n,Zt;(_n=Vt[Dt.question_type])===null||_n===void 0||((Zt=_n.items)===null||Zt===void 0)||Zt.push(Dt)}if(Dt.question_type===3){var kn,er;(kn=Vt[Dt.question_type])===null||kn===void 0||((er=kn.items)===null||er===void 0)||er.push(Dt)}if(Dt.question_type===4){var tr,wn;(tr=Vt[Dt.question_type])===null||tr===void 0||((wn=tr.items)===null||wn===void 0)||wn.push(Dt)}if(Dt.question_type===5){var Mn,dn;(Mn=Vt[Dt.question_type])===null||Mn===void 0||((dn=Mn.items)===null||dn===void 0)||dn.push(Dt)}if(Dt.question_type===6){var or,Xn;(or=Vt[Dt.question_type])===null||or===void 0||((Xn=or.items)===null||Xn===void 0)||Xn.push(Dt)}if(Dt.question_type===7){var vr,gr;(vr=Vt[Dt.question_type])===null||vr===void 0||((gr=vr.items)===null||gr===void 0)||gr.push(Dt)}});var Gt=pt==null?void 0:pt.map(function(Dt,Zn){return t.a.createElement(t.a.Fragment,{key:Zn},t.a.createElement("div",{className:"pl20"},t.a.createElement("span",{className:"font16 c-light-primary"},Kt(Zn+1),"\u3001",Dt.name),t.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",Dt.count,"\u9898",(Dt==null?void 0:Dt.question_type)===7?"\uFF0C\u5305\u542B".concat(Dt.sub_count,"\u5C0F\u9898"):"","\uFF1B\u5171",Dt.score,"\u5206\uFF09"),(pr==null?void 0:pr.includes(Dt==null?void 0:Dt.name))&&t.a.createElement(m.a,{onClick:function(){return sr(Dt==null?void 0:Dt.question_type,Dt==null?void 0:Dt.name)},style:{float:"right"},type:"primary",ghost:!0},"\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206")),Mt(Dt.items,Dt==null?void 0:Dt.question_type,Dt==null?void 0:Dt.name))});return Gt};return t.a.createElement("div",null," ",Fn()," ")},Or=Pe.a=Object(B.a)()(Lr)},M8RZ:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return r});var ne=F("fWQN"),Q=F("mtLc"),U=F("yKVA"),Z=F("879j"),G=F("q1tI"),M=F.n(G),Y=F("i8i4"),X=F.n(Y),r=function(A){Object(U.a)(f,A);var m=Object(Z.a)(f);function f(p){var a;Object(ne.a)(this,f),a=m.call(this,p);var c=window.document;return a.node=c.createElement("div"),c.body.appendChild(a.node),a}return Object(Q.a)(f,[{key:"render",value:function(){var a=this.props.children;return Object(Y.createPortal)(a,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(M.a.Component)},MI8n:function(Et,Pe,F){"use strict";F.d(Pe,"c",function(){return G}),F.d(Pe,"b",function(){return r}),F.d(Pe,"e",function(){return A}),F.d(Pe,"a",function(){return m}),F.d(Pe,"d",function(){return f}),F.d(Pe,"f",function(){return p});var ne=F("/cxE"),Q=F("pmY6"),U=F("24hK"),Z=F("5Y4S"),G;(function(a){a.None=()=>Q.a.None;function c(b){return(W,j=null,C)=>{let B=!1,k;return k=b(y=>B?void 0:(k?k.dispose():B=!0,W.call(j,y)),null,C),B&&k.dispose(),k}}a.once=c;function s(b,W){return T((j,C=null,B)=>b(k=>j.call(C,W(k)),null,B))}a.map=s;function i(b,W){return T((j,C=null,B)=>b(k=>{W(k),j.call(C,k)},null,B))}a.forEach=i;function t(b,W){return T((j,C=null,B)=>b(k=>W(k)&&j.call(C,k),null,B))}a.filter=t;function u(b){return b}a.signal=u;function o(...b){return(W,j=null,C)=>Object(Q.e)(...b.map(B=>B(k=>W.call(j,k),null,C)))}a.any=o;function R(b,W,j){let C=j;return s(b,B=>(C=W(C,B),C))}a.reduce=R;function T(b){let W;const j=new r({onFirstListenerAdd(){W=b(j.fire,j)},onLastListenerRemove(){W.dispose()}});return j.event}function S(b,W,j=100,C=!1,B){let k,y,H,J=0;const se=new r({leakWarningThreshold:B,onFirstListenerAdd(){k=b(fe=>{J++,y=W(y,fe),C&&!H&&(se.fire(y),y=void 0),clearTimeout(H),H=setTimeout(()=>{const ve=y;y=void 0,H=void 0,(!C||J>1)&&se.fire(ve),J=0},j)})},onLastListenerRemove(){k.dispose()}});return se.event}a.debounce=S;function D(b,W=(j,C)=>j===C){let j=!0,C;return t(b,B=>{const k=j||!W(B,C);return j=!1,C=B,k})}a.latch=D;function I(b,W){return[a.filter(b,W),a.filter(b,j=>!W(j))]}a.split=I;function E(b,W=!1,j=[]){let C=j.slice(),B=b(H=>{C?C.push(H):y.fire(H)});const k=()=>{C&&C.forEach(H=>y.fire(H)),C=null},y=new r({onFirstListenerAdd(){B||(B=b(H=>y.fire(H)))},onFirstListenerDidAdd(){C&&(W?setTimeout(k):k())},onLastListenerRemove(){B&&B.dispose(),B=null}});return y.event}a.buffer=E;class x{constructor(b){this.event=b}map(b){return new x(s(this.event,b))}forEach(b){return new x(i(this.event,b))}filter(b){return new x(t(this.event,b))}reduce(b,W){return new x(R(this.event,b,W))}latch(){return new x(D(this.event))}debounce(b,W=100,j=!1,C){return new x(S(this.event,b,W,j,C))}on(b,W,j){return this.event(b,W,j)}once(b,W,j){return c(this.event)(b,W,j)}}function g(b){return new x(b)}a.chain=g;function h(b,W,j=C=>C){const C=(...H)=>y.fire(j(...H)),B=()=>b.on(W,C),k=()=>b.removeListener(W,C),y=new r({onFirstListenerAdd:B,onLastListenerRemove:k});return y.event}a.fromNodeEventEmitter=h;function O(b,W,j=C=>C){const C=(...H)=>y.fire(j(...H)),B=()=>b.addEventListener(W,C),k=()=>b.removeEventListener(W,C),y=new r({onFirstListenerAdd:B,onLastListenerRemove:k});return y.event}a.fromDOMEventEmitter=O;function w(b){return new Promise(W=>c(b)(W))}a.toPromise=w})(G||(G={}));class M{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${M._idPool++}`}start(a){this._stopWatch=new Z.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}M._idPool=0;let Y=-1;class X{constructor(a,c=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=c,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let c=Y;if(typeof this.customThreshold=="number"&&(c=this.customThreshold),c<=0||a<c)return;this._stacks||(this._stacks=new Map);const s=new Error().stack.split(`
`).slice(3).join(`
`),i=this._stacks.get(s)||0;if(this._stacks.set(s,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=c*.5;let t,u=0;for(const[o,R]of this._stacks)(!t||u<R)&&(t=o,u=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${u}):`),console.warn(t)}return()=>{const t=this._stacks.get(s)||0;this._stacks.set(s,t-1)}}}class r{constructor(a){var c;this._disposed=!1,this._options=a,this._leakageMon=Y>0?new X(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((c=this._options)===null||c===void 0?void 0:c._profName)?new M(this._options._profName):void 0}get event(){return this._event||(this._event=(a,c,s)=>{var i;this._listeners||(this._listeners=new U.a);const t=this._listeners.isEmpty();t&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const u=this._listeners.push(c?[a,c]:a);t&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,c);const o=(i=this._leakageMon)===null||i===void 0?void 0:i.check(this._listeners.size),R=Object(Q.i)(()=>{if(o&&o(),!this._disposed&&(u(),this._options&&this._options.onLastListenerRemove)){const T=this._listeners&&!this._listeners.isEmpty();T||this._options.onLastListenerRemove(this)}});return s instanceof Q.b?s.add(R):Array.isArray(s)&&s.push(R),R}),this._event}fire(a){var c,s;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new U.a);for(let i of this._listeners)this._deliveryQueue.push([i,a]);for((c=this._perfMon)===null||c===void 0||c.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,t]=this._deliveryQueue.shift();try{typeof i=="function"?i.call(void 0,t):i[0].call(i[1],t)}catch(u){Object(ne.f)(u)}}(s=this._perfMon)===null||s===void 0||s.stop()}}dispose(){var a,c,s,i,t;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(c=this._deliveryQueue)===null||c===void 0||c.clear(),(i=(s=this._options)===null||s===void 0?void 0:s.onLastListenerRemove)===null||i===void 0||i.call(s),(t=this._leakageMon)===null||t===void 0||t.dispose())}}class A extends r{constructor(a){super(a);this._isPaused=0,this._eventQueue=new U.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class m extends A{constructor(a){var c;super(a);this._delay=(c=a.delay)!==null&&c!==void 0?c:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class f{constructor(){this.buffers=[]}wrapEvent(a){return(c,s,i)=>a(t=>{const u=this.buffers[this.buffers.length-1];u?u.push(()=>c.call(s,t)):c.call(s,t)},void 0,i)}bufferEvents(a){const c=[];this.buffers.push(c);const s=a();return this.buffers.pop(),c.forEach(i=>i()),s}}class p{constructor(){this.listening=!1,this.inputEvent=G.None,this.inputEventListener=Q.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Et,Pe,F){"use strict";(function(ne,Q){F.d(Pe,"b",function(){return s}),F.d(Pe,"i",function(){return o}),F.d(Pe,"f",function(){return R}),F.d(Pe,"d",function(){return T}),F.d(Pe,"g",function(){return S}),F.d(Pe,"h",function(){return D}),F.d(Pe,"c",function(){return I}),F.d(Pe,"k",function(){return E}),F.d(Pe,"j",function(){return x}),F.d(Pe,"a",function(){return g}),F.d(Pe,"e",function(){return w});var U;const Z="en";let G=!1,M=!1,Y=!1,X=!1,r=!1,A=!1,m=!1,f,p=Z,a,c;const s=typeof self=="object"?self:typeof ne=="object"?ne:{};let i;typeof s.vscode!="undefined"&&typeof s.vscode.process!="undefined"?i=s.vscode.process:typeof Q!="undefined"&&(i=Q);const t=typeof((U=i==null?void 0:i.versions)===null||U===void 0?void 0:U.electron)=="string"&&i.type==="renderer";if(typeof navigator=="object"&&!t)c=navigator.userAgent,G=c.indexOf("Windows")>=0,M=c.indexOf("Macintosh")>=0,m=(c.indexOf("Macintosh")>=0||c.indexOf("iPad")>=0||c.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Y=c.indexOf("Linux")>=0,A=!0,f=navigator.language,p=f;else if(typeof i=="object"){G=i.platform==="win32",M=i.platform==="darwin",Y=i.platform==="linux",X=Y&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,f=Z,p=Z;const b=i.env.VSCODE_NLS_CONFIG;if(b)try{const W=JSON.parse(b),j=W.availableLanguages["*"];f=W.locale,p=j||Z,a=W._translationsConfigFile}catch(W){}r=!0}else console.error("Unable to resolve platform.");let u=0;M?u=1:G?u=3:Y&&(u=2);const o=G,R=M,T=Y,S=r,D=A,I=m,E=c,x=function(){if(s.setImmediate)return s.setImmediate.bind(s);if(typeof s.postMessage=="function"&&!s.importScripts){let j=[];s.addEventListener("message",B=>{if(B.data&&B.data.vscodeSetImmediateId)for(let k=0,y=j.length;k<y;k++){const H=j[k];if(H.id===B.data.vscodeSetImmediateId){j.splice(k,1),H.callback();return}}});let C=0;return B=>{const k=++C;j.push({id:k,callback:B}),s.postMessage({vscodeSetImmediateId:k},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const W=Promise.resolve();return j=>W.then(j)}(),g=M||m?2:G?1:3;let h=!0,O=!1;function w(){if(!O){O=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const W=new Uint16Array(b.buffer);h=W[0]===(2<<8)+1}return h}}).call(this,F("IyRk"),F("Q2Ig"))},N0LK:function(Et,Pe,F){"use strict";F.d(Pe,"C",function(){return ne}),F.d(Pe,"v",function(){return U}),F.d(Pe,"s",function(){return Z}),F.d(Pe,"t",function(){return G}),F.d(Pe,"U",function(){return M}),F.d(Pe,"J",function(){return Y}),F.d(Pe,"O",function(){return X}),F.d(Pe,"p",function(){return r}),F.d(Pe,"T",function(){return A}),F.d(Pe,"q",function(){return m}),F.d(Pe,"N",function(){return f}),F.d(Pe,"M",function(){return p}),F.d(Pe,"Q",function(){return a}),F.d(Pe,"u",function(){return c}),F.d(Pe,"x",function(){return s}),F.d(Pe,"I",function(){return i}),F.d(Pe,"f",function(){return t}),F.d(Pe,"h",function(){return u}),F.d(Pe,"g",function(){return o}),F.d(Pe,"i",function(){return R}),F.d(Pe,"G",function(){return T}),F.d(Pe,"H",function(){return S}),F.d(Pe,"r",function(){return D}),F.d(Pe,"R",function(){return I}),F.d(Pe,"d",function(){return E}),F.d(Pe,"e",function(){return x}),F.d(Pe,"E",function(){return g}),F.d(Pe,"F",function(){return h}),F.d(Pe,"j",function(){return O}),F.d(Pe,"z",function(){return w}),F.d(Pe,"K",function(){return W}),F.d(Pe,"L",function(){return j}),F.d(Pe,"m",function(){return B}),F.d(Pe,"k",function(){return y}),F.d(Pe,"A",function(){return J}),F.d(Pe,"a",function(){return se}),F.d(Pe,"n",function(){return fe}),F.d(Pe,"l",function(){return ve}),F.d(Pe,"D",function(){return Se}),F.d(Pe,"B",function(){return Ue}),F.d(Pe,"b",function(){return Te}),F.d(Pe,"S",function(){return Ie}),F.d(Pe,"o",function(){return be}),F.d(Pe,"P",function(){return q}),F.d(Pe,"w",function(){return _}),F.d(Pe,"c",function(){return L}),F.d(Pe,"y",function(){return $});function ne(we){return!we||typeof we!="string"?!0:we.trim().length===0}const Q=/{(\d+)}/g;function U(we,...Ne){return Ne.length===0?we:we.replace(Q,function(Ye,Xe){const ht=parseInt(Xe,10);return isNaN(ht)||ht<0||ht>=Ne.length?Ye:Ne[ht]})}function Z(we){return we.replace(/[<>&]/g,function(Ne){switch(Ne){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Ne}})}function G(we){return we.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function M(we,Ne=" "){const Ye=Y(we,Ne);return X(Ye,Ne)}function Y(we,Ne){if(!we||!Ne)return we;const Ye=Ne.length;if(Ye===0||we.length===0)return we;let Xe=0;for(;we.indexOf(Ne,Xe)===Xe;)Xe=Xe+Ye;return we.substring(Xe)}function X(we,Ne){if(!we||!Ne)return we;const Ye=Ne.length,Xe=we.length;if(Ye===0||Xe===0)return we;let ht=Xe,wt=-1;for(;!(wt=we.lastIndexOf(Ne,ht-1),wt===-1||wt+Ye!==ht);){if(wt===0)return"";ht=wt}return we.substring(0,ht)}function r(we){return we.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function A(we){return we.replace(/\*/g,"")}function m(we,Ne,Ye={}){if(!we)throw new Error("Cannot create regex from empty string");Ne||(we=G(we)),Ye.wholeWord&&(/\B/.test(we.charAt(0))||(we="\\b"+we),/\B/.test(we.charAt(we.length-1))||(we=we+"\\b"));let Xe="";return Ye.global&&(Xe+="g"),Ye.matchCase||(Xe+="i"),Ye.multiline&&(Xe+="m"),Ye.unicode&&(Xe+="u"),new RegExp(we,Xe)}function f(we){if(we.source==="^"||we.source==="^$"||we.source==="$"||we.source==="^\\s*$")return!1;const Ne=we.exec("");return!!(Ne&&we.lastIndex===0)}function p(we){return(we.global?"g":"")+(we.ignoreCase?"i":"")+(we.multiline?"m":"")+(we.unicode?"u":"")}function a(we){return we.split(/\r\n|\r|\n/)}function c(we){for(let Ne=0,Ye=we.length;Ne<Ye;Ne++){const Xe=we.charCodeAt(Ne);if(Xe!==32&&Xe!==9)return Ne}return-1}function s(we,Ne=0,Ye=we.length){for(let Xe=Ne;Xe<Ye;Xe++){const ht=we.charCodeAt(Xe);if(ht!==32&&ht!==9)return we.substring(Ne,Xe)}return we.substring(Ne,Ye)}function i(we,Ne=we.length-1){for(let Ye=Ne;Ye>=0;Ye--){const Xe=we.charCodeAt(Ye);if(Xe!==32&&Xe!==9)return Ye}return-1}function t(we,Ne){return we<Ne?-1:we>Ne?1:0}function u(we,Ne,Ye=0,Xe=we.length,ht=0,wt=Ne.length){for(;Ye<Xe&&ht<wt;Ye++,ht++){let an=we.charCodeAt(Ye),Yt=Ne.charCodeAt(ht);if(an<Yt)return-1;if(an>Yt)return 1}const Bt=Xe-Ye,Wt=wt-ht;return Bt<Wt?-1:Bt>Wt?1:0}function o(we,Ne){return R(we,Ne,0,we.length,0,Ne.length)}function R(we,Ne,Ye=0,Xe=we.length,ht=0,wt=Ne.length){for(;Ye<Xe&&ht<wt;Ye++,ht++){let an=we.charCodeAt(Ye),Yt=Ne.charCodeAt(ht);if(an===Yt)continue;if(an>=128||Yt>=128)return u(we.toLowerCase(),Ne.toLowerCase(),Ye,Xe,ht,wt);T(an)&&(an-=32),T(Yt)&&(Yt-=32);const qe=an-Yt;if(qe===0)continue;return qe}const Bt=Xe-Ye,Wt=wt-ht;return Bt<Wt?-1:Bt>Wt?1:0}function T(we){return we>=97&&we<=122}function S(we){return we>=65&&we<=90}function D(we,Ne){return we.length===Ne.length&&R(we,Ne)===0}function I(we,Ne){const Ye=Ne.length;return Ne.length>we.length?!1:R(we,Ne,0,Ye)===0}function E(we,Ne){let Ye,Xe=Math.min(we.length,Ne.length);for(Ye=0;Ye<Xe;Ye++)if(we.charCodeAt(Ye)!==Ne.charCodeAt(Ye))return Ye;return Xe}function x(we,Ne){let Ye,Xe=Math.min(we.length,Ne.length);const ht=we.length-1,wt=Ne.length-1;for(Ye=0;Ye<Xe;Ye++)if(we.charCodeAt(ht-Ye)!==Ne.charCodeAt(wt-Ye))return Ye;return Xe}function g(we){return 55296<=we&&we<=56319}function h(we){return 56320<=we&&we<=57343}function O(we,Ne){return(we-55296<<10)+(Ne-56320)+65536}function w(we,Ne,Ye){const Xe=we.charCodeAt(Ye);if(g(Xe)&&Ye+1<Ne){const ht=we.charCodeAt(Ye+1);if(h(ht))return O(Xe,ht)}return Xe}function b(we,Ne){const Ye=we.charCodeAt(Ne-1);if(h(Ye)&&Ne>1){const Xe=we.charCodeAt(Ne-2);if(g(Xe))return O(Xe,Ye)}return Ye}function W(we,Ne){const Ye=z.getInstance(),Xe=Ne,ht=we.length,wt=w(we,ht,Ne);Ne+=wt>=65536?2:1;let Bt=Ye.getGraphemeBreakType(wt);for(;Ne<ht;){const Wt=w(we,ht,Ne),an=Ye.getGraphemeBreakType(Wt);if(L(Bt,an))break;Ne+=Wt>=65536?2:1,Bt=an}return Ne-Xe}function j(we,Ne){const Ye=z.getInstance(),Xe=Ne,ht=b(we,Ne);Ne-=ht>=65536?2:1;let wt=Ye.getGraphemeBreakType(ht);for(;Ne>0;){const Bt=b(we,Ne),Wt=Ye.getGraphemeBreakType(Bt);if(L(Wt,wt))break;Ne-=Bt>=65536?2:1,wt=Wt}return Xe-Ne}const C=/(?:[\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 B(we){return C.test(we)}const k=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function y(we){return k.test(we)}const H=/^[\t\n\r\x20-\x7E]*$/;function J(we){return H.test(we)}const se=/[\u2028\u2029]/;function fe(we){return se.test(we)}function ve(we){for(let Ne=0,Ye=we.length;Ne<Ye;Ne++)if(Se(we.charCodeAt(Ne)))return!0;return!1}function Se(we){return we=+we,we>=11904&&we<=55215||we>=63744&&we<=64255||we>=65281&&we<=65374}function Ue(we){return we>=127462&&we<=127487||we===8986||we===8987||we===9200||we===9203||we>=9728&&we<=10175||we===11088||we===11093||we>=127744&&we<=128591||we>=128640&&we<=128764||we>=128992&&we<=129003||we>=129280&&we<=129535||we>=129648&&we<=129750}const Te=String.fromCharCode(65279);function Ie(we){return!!(we&&we.length>0&&we.charCodeAt(0)===65279)}function be(we,Ne=!1){return we?(Ne&&(we=we.replace(/\\./g,"")),we.toLowerCase()!==we):!1}function q(we){const Ne=90-65+1;return we=we%(2*Ne),we<Ne?String.fromCharCode(97+we):String.fromCharCode(65+we-Ne)}function _(we){const Ne=z.getInstance();return Ne.getGraphemeBreakType(we)}function L(we,Ne){return we===0?Ne!==5&&Ne!==7:we===2&&Ne===3?!1:we===4||we===2||we===3||(Ne===4||Ne===2||Ne===3)?!0:we===8&&(Ne===8||Ne===9||Ne===11||Ne===12)||((we===11||we===9)&&(Ne===9||Ne===10)||((we===12||we===10)&&Ne===10||(Ne===5||Ne===13||(Ne===7||(we===1||we===13&&Ne===14)))))?!1:!(we===6&&Ne===6)}class z{constructor(){this._data=ee()}static getInstance(){return z._INSTANCE||(z._INSTANCE=new z),z._INSTANCE}getGraphemeBreakType(we){if(we<32)return we===10?3:we===13?2:4;if(we<127)return 0;const Ne=this._data,Ye=Ne.length/3;let Xe=1;for(;Xe<=Ye;)if(we<Ne[3*Xe])Xe=2*Xe;else if(we>Ne[3*Xe+1])Xe=2*Xe+1;else return Ne[3*Xe+2];return 0}}z._INSTANCE=null;function ee(){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]")}function $(we,Ne){if(we===0)return 0;const Ye=Ee(we,Ne);if(Ye!==void 0)return Ye;const Xe=b(Ne,we);return we-=Be(Xe),we}function Ee(we,Ne){let Ye=b(Ne,we);for(we-=Be(Ye);nt(Ye)||Ye===65039||Ye===8419;){if(we===0)return;Ye=b(Ne,we),we-=Be(Ye)}if(!Ue(Ye))return;if(we>=0){const Xe=b(Ne,we);Xe===8205&&(we-=Be(Xe))}return we}function Be(we){return we>=65536?2:1}function nt(we){return 127995<=we&&we<=127999}},NLgs:function(Et,Pe,F){"use strict";F.d(Pe,"e",function(){return i}),F.d(Pe,"f",function(){return t}),F.d(Pe,"d",function(){return o}),F.d(Pe,"c",function(){return R}),F.d(Pe,"a",function(){return T}),F.d(Pe,"b",function(){return S});var ne=F("miYZ"),Q=F("tsqr"),U=F("9og8"),Z=F("2qtc"),G=F("kLXV"),M=F("WmNS"),Y=F.n(M),X=F("q1tI"),r=F.n(X),A=F("9kvl"),m=F("xKgJ"),f=F("1vsH"),p=F("RCxd"),a=F("yTi+"),c=F.n(a),s=F("m3rI"),i=function(I){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(t(I)&&u(E))},t=function(I){return Object(m.p)()?!0:(I({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},u=function(){var I,E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,x=Object(A.c)()._store.getState(),g=x.user;return(I=g.userInfo)!==null&&I!==void 0&&I.profile_completed?!0:(G.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:E?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){A.d.push("/account/profile/edit")}}),!1)},o=function(){var I,E=Object(A.c)()._store.getState(),x=E.user;return(I=x.userInfo)!==null&&I!==void 0&&I.professional_certification?!0:(G.a.confirm({title:"\u63D0\u793A",centered:!0,content:r.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(f.S)("/account/certification")}}),!1)},R=function(){var I;if(Object(m.a)())return!0;var E=Object(A.c)()._store.getState(),x=E.user,g=E.globalSetting;return G.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("p",null,"\u626B\u7801\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),r.a.createElement("img",{src:s.a.IMG_SERVER+(g==null||((I=g.setting)===null||I===void 0)?void 0:I.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},T=function(I,E){var x;if(I)return!0;var g=Object(A.c)()._store.getState(),h=g.user,O=g.globalSetting;return G.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("p",null,E||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),r.a.createElement("div",{style:{marginLeft:"110px"}},r.a.createElement("img",{src:s.a.IMG_SERVER+(O==null||((x=O.setting)===null||x===void 0)?void 0:x.authority_qrcode_url),width:200}),r.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(f.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},S=function(I){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",x=Object(A.c)()._store.getState(),g=x.shixunsDetail.detail;return(g==null?void 0:g.public)===2||(g==null?void 0:g.public)===1||(g==null?void 0:g.shixun_status)===3?(G.a.info({centered:!0,icon:r.a.createElement(p.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(g==null?void 0:g.public)===2?"\u5DF2\u516C\u5F00":(g==null?void 0:g.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",E,"\u3002"),r.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),r.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:c.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(g==null?void 0:g.shixun_status)===2?(G.a.confirm({centered:!0,icon:r.a.createElement(p.a,null),title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",E,"\u3002"),r.a.createElement("br",null),r.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){G.a.confirm({width:440,centered:!0,icon:r.a.createElement(p.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var O=Object(U.a)(Y.a.mark(function b(){var W;return Y.a.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,I({type:"shixunsDetail/cancelRelease",payload:{id:g==null?void 0:g.identifier}});case 2:W=C.sent,W.status!==401&&(Q.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),I({type:"shixunsDetail/getShixunsDetail",payload:{id:g==null?void 0:g.identifier}}),I({type:"practiceSetting/getCommonData",payload:{id:g==null?void 0:g.identifier}}));case 4:case"end":return C.stop()}},b)}));function w(){return O.apply(this,arguments)}return w}()})}}),!0):!1}},Nog9:function(Et,Pe,F){Et.exports={flex_box_center:"flex_box_center___FKAcC",flex_space_between:"flex_space_between___1W0sn",flex_box_vertical_center:"flex_box_vertical_center___1ZtTo",flex_box_center_end:"flex_box_center_end___3Rjsx",flex_box_column:"flex_box_column___3qWVQ",wrap:"wrap___K2ugW",modal:"modal___3Jrop",titleWrap:"titleWrap___2PdmB",required:"required___XbmpK",title:"title___1w-JF",colorGray:"colorGray___2hKRg",choiceWrap:"choiceWrap___3oJpR",answer:"answer___1Kugg",activeAnswer:"activeAnswer___3MPrD",deleteIcon:"deleteIcon___2j8_2",addIcon:"addIcon___2lm8T",editorWrap:"editorWrap___1f48O",htmlWrap:"htmlWrap___2gSXb",radio:"radio___1S16G",color333:"color333___3rZXR",color999:"color999___2xzRf",questionType:"questionType___2l_WF",questionChoices:"questionChoices___hYMa9",action:"action___1DPov",difficult:"difficult___1CZwg",fold:"fold___2FQQU",head:"head___2Es3Y"}},NvD2:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return M});var ne=F("Kwbf");function Q(Y,X){var r=new Set;return Y.forEach(function(A){X.has(A)||r.add(A)}),r}function U(Y){var X=Y||{},r=X.disabled,A=X.disableCheckbox,m=X.checkable;return!!(r||A)||m===!1}function Z(Y,X,r,A){for(var m=new Set(Y),f=new Set,p=0;p<=r;p+=1){var a=X.get(p)||new Set;a.forEach(function(t){var u=t.key,o=t.node,R=t.children,T=R===void 0?[]:R;m.has(u)&&!A(o)&&T.filter(function(S){return!A(S.node)}).forEach(function(S){m.add(S.key)})})}for(var c=new Set,s=r;s>=0;s-=1){var i=X.get(s)||new Set;i.forEach(function(t){var u=t.parent,o=t.node;if(A(o)||!t.parent||c.has(t.parent.key))return;if(A(t.parent.node)){c.add(u.key);return}var R=!0,T=!1;(u.children||[]).filter(function(S){return!A(S.node)}).forEach(function(S){var D=S.key,I=m.has(D);R&&!I&&(R=!1),!T&&(I||f.has(D))&&(T=!0)}),R&&m.add(u.key),T&&f.add(u.key),c.add(u.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(Q(f,m))}}function G(Y,X,r,A,m){for(var f=new Set(Y),p=new Set(X),a=0;a<=A;a+=1){var c=r.get(a)||new Set;c.forEach(function(u){var o=u.key,R=u.node,T=u.children,S=T===void 0?[]:T;!f.has(o)&&!p.has(o)&&!m(R)&&S.filter(function(D){return!m(D.node)}).forEach(function(D){f.delete(D.key)})})}p=new Set;for(var s=new Set,i=A;i>=0;i-=1){var t=r.get(i)||new Set;t.forEach(function(u){var o=u.parent,R=u.node;if(m(R)||!u.parent||s.has(u.parent.key))return;if(m(u.parent.node)){s.add(o.key);return}var T=!0,S=!1;(o.children||[]).filter(function(D){return!m(D.node)}).forEach(function(D){var I=D.key,E=f.has(I);T&&!E&&(T=!1),!S&&(E||p.has(I))&&(S=!0)}),T||f.delete(o.key),S&&p.add(o.key),s.add(o.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(Q(p,f))}}function M(Y,X,r,A){var m=[],f;A?f=A:f=U;var p=new Set(Y.filter(function(i){var t=!!r[i];return t||m.push(i),t})),a=new Map,c=0;Object.keys(r).forEach(function(i){var t=r[i],u=t.level,o=a.get(u);o||(o=new Set,a.set(u,o)),o.add(t),c=Math.max(c,u)}),Object(ne.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var s;return X===!0?s=Z(p,a,c,f):s=G(p,X.halfCheckedKeys,a,c,f),s}},O2Wb:function(Et,Pe,F){Et.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(Et,Pe,F){"use strict";F.d(Pe,"b",function(){return A}),F.d(Pe,"a",function(){return m}),F.d(Pe,"k",function(){return f}),F.d(Pe,"h",function(){return p}),F.d(Pe,"i",function(){return a}),F.d(Pe,"g",function(){return c}),F.d(Pe,"c",function(){return s}),F.d(Pe,"d",function(){return i}),F.d(Pe,"j",function(){return o}),F.d(Pe,"e",function(){return R}),F.d(Pe,"f",function(){return T});var ne=F("KQm4"),Q=F("U8pU"),U=F("Ff2n"),Z=F("q1tI"),G=F.n(Z),M=F("Kwbf"),Y=F("WaYH"),X=.25,r=2;function A(S,D){var I=S.slice(),E=I.indexOf(D);return E>=0&&I.splice(E,1),I}function m(S,D){var I=S.slice();return I.indexOf(D)===-1&&I.push(D),I}function f(S){return S.split("-")}function p(S,D){return"".concat(S,"-").concat(D)}function a(S){return S&&S.type&&S.type.isTreeNode}function c(S,D){var I=[S],E=D[S];function x(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];g.forEach(function(h){var O=h.key,w=h.children;I.push(O),x(w)})}return x(E.children),I}function s(S,D){var I=S.clientY,E=D.selectHandle.getBoundingClientRect(),x=E.top,g=E.bottom,h=E.height,O=Math.max(h*X,r);return I<=x+O?-1:I>=g-O?1:0}function i(S,D){if(!S)return;var I=D.multiple;return I?S.slice():S.length?[S[0]]:S}var t=function(D){return D};function u(S,D){if(!S)return[];var I=D||{},E=I.processProps,x=E===void 0?t:E,g=Array.isArray(S)?S:[S];return g.map(function(h){var O=h.children,w=Object(U.a)(h,["children"]),b=u(O,D);return G.a.createElement(Y.a,Object.assign({},x(w)),b)})}function o(S){if(!S)return null;var D;if(Array.isArray(S))D={checkedKeys:S,halfCheckedKeys:void 0};else if(Object(Q.a)(S)==="object")D={checkedKeys:S.checked||void 0,halfCheckedKeys:S.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return D}function R(S,D){var I=new Set;function E(x){if(I.has(x))return;var g=D[x];if(!g)return;I.add(x);var h=g.parent,O=g.node;if(O.disabled)return;h&&E(h.key)}return(S||[]).forEach(function(x){E(x)}),Object(ne.a)(I)}function T(S){var D={};return Object.keys(S).forEach(function(I){(I.startsWith("data-")||I.startsWith("aria-"))&&(D[I]=S[I])}),D}},Ot1p:function(Et,Pe,F){"use strict";var ne=F("2qtc"),Q=F("kLXV"),U=F("rAM+"),Z=F("miYZ"),G=F("tsqr"),M=F("9og8"),Y=F("tJVT"),X=F("jrin"),r=F("WmNS"),A=F.n(r),m=F("q1tI"),f=F.n(m),p=F("VrN/"),a=F.n(p),c=F("bdgK"),s=F("p77/"),i=F("Bd2K"),t=F("ELLl"),u=F("19Vz"),o=F("lZu9"),R=F("+NIl"),T=F("kSUc"),S=F("9Bee"),D=function(Me){var We=Me.value,lt=We===void 0?"":We,Ct=Me.className,Ot=Me.showTextOnly,Nt=Me.showLines,ir=Me.style,Jt=ir===void 0?{}:ir,cn=Object(m.useMemo)(function(){return""},[lt]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:cn}}))},I=F("0Owb"),E=F("dejd"),x=F("C+DQ"),g=F("1vsH"),h=F("m3rI"),O=[{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 w(Me){var We=Me.onActionCallback,lt=Me.title,Ct=Me.icon,Ot=Me.actionName,Nt=Me.className,ir=Nt===void 0?"":Nt,Jt=Me.children;function cn(){We(Ot)}return f.a.createElement("a",{title:lt,className:ir,onClick:cn},f.a.createElement("i",{className:"md-iconfont ".concat(Ct)}),Jt)}var b=function(Me){var We=Me.watch,lt=Me.showNullButton,Ct=Me.onActionCallback,Ot=Me.fullScreen,Nt=Me.insertTemp,ir=Me.hidetoolBar,Jt=Me.uuid,cn=Me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(g.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(g.F)("_educoder_session"),"&key=").concat(Jt,"&api=").concat(encodeURIComponent(h.a.PROXY_SERVER)));var rn=[].concat(O,[{title:"".concat(We?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(We?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!ir&&rn.map(function(In,ur){return f.a.createElement("li",{key:ur},In.actionName?f.a.createElement(w,Object(I.a)({},In,{onActionCallback:Ct})):f.a.createElement("span",{className:"v-line"}))}),lt?f.a.createElement("li",null,f.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ct},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Nt&&f.a.createElement("li",null,f.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Nt),onActionCallback:Ct},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(w,{icon:"".concat(Ot?"icon-shrink":"icon-enlarge"),title:Ot?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ct})))},W=F("M8RZ"),j=F("+L6B"),C=F("2/Rp"),B=F("y8nQ"),k=F("Vl3Y"),y=F("5NDa"),H=F("5rEg"),J={labelCol:{span:4},wrapperCol:{span:20}},se=function(Me){var We=Me.callback,lt=Me.onCancel;function Ct(Ot){We(Ot)}return f.a.createElement(k.a,Object(I.a)({},J,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ct}),f.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(H.a,null)),f.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(H.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(C.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},fe=F("7ahc"),ve=F("HmJG"),Se=F("BjJ7"),Ue=k.a.useForm,Te={width:280,marginRight:10},Ie={labelCol:{span:5},wrapperCol:{span:19}},be=function(Me){var We=Me.callback,lt=Me.onCancel,Ct=Ue(),Ot=Object(Y.a)(Ct,1),Nt=Ot[0];function ir(rn){We(rn)}function Jt(rn,In){if(rn.status===-1){G.b.error(rn.message);return}Nt.setFieldsValue({src:"/api/attachments/".concat(rn.id),type:In.type})}function cn(rn){var In=rn.target.files[0];_(In,Jt)}return f.a.createElement(k.a,Object(I.a)({form:Nt},Ie,{className:"upload-image-panel",onFinish:ir}),f.a.createElement(k.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(k.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(H.a,{style:Te})),f.a.createElement(q,{onFileChange:cn}))),f.a.createElement(k.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(H.a,{style:{width:264}})),f.a.createElement(k.a.Item,{style:{textAlign:"right"}},f.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(C.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))};function q(Me){var We=Me.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:We}))}function _(Me,We){if(!Me)throw new String("\u6CA1\u6709\u6587\u4EF6");var lt=new FormData;lt.append("editormd-image-file",Me),lt.append("file_param_name","editormd-image-file"),lt.append("byxhr","true");var Ct=new window.XMLHttpRequest;Ct.withCredentials=!0,Ct.addEventListener("load",function(Ot){We(JSON.parse(Ot.target.responseText),Me)},!1),Ct.addEventListener("error",function(Ot){console.error(Ot)},!1),Ct.open("POST","".concat(Se.a,"/api/attachments.json")),Ct.send(lt)}var L=F("giR+"),z=F("fyUT"),ee=F("7Kak"),$=F("9yH6"),Ee=$.a.Group,Be={margin:"0 8px"},nt=function(Me){var We=Me.callback,lt=Me.onCancel;function Ct(Ot){We(Ot)}return f.a.createElement(k.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ct},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:Be},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:Be},"\u884C\u6570"),f.a.createElement(k.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(z.a,null)),f.a.createElement("span",{style:Be},"\u5217\u6570"),f.a.createElement(k.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(z.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:Be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(k.a.Item,{name:"align"},f.a.createElement(Ee,null,f.a.createElement($.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement($.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement($.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement($.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(C.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},we=F("ErOA"),Ne=F("7Cbv"),Ye="link",Xe="upload-image",ht="code-block",wt="add-table",Bt="------------",Wt={default:Bt,left:":".concat(Bt),center:":".concat(Bt,":"),right:"".concat(Bt,":")},an=F("9VGf"),Yt,qe;function Qe(){}var bt=0,xt=1e4,ye="\u2581",ae=`
**\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 le(Me){return/^\d+$/.test(Me)?"".concat(Me,"px"):Me}var me=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ce=me?"Cmd":"Ctrl",de=["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"],pe=(Yt={},Object(X.a)(Yt,Ce+"-B","bold"),Object(X.a)(Yt,Ce+"-I","italic"),Yt),De=(qe={},Object(X.a)(qe,Ye,"\u6DFB\u52A0\u94FE\u63A5"),Object(X.a)(qe,ht,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(X.a)(qe,Xe,"\u6DFB\u52A0\u6587\u4EF6"),Object(X.a)(qe,wt,"\u6DFB\u52A0\u8868\u683C"),qe),ue=Pe.a=function(Me){var We=Me.defaultValue,lt=We===void 0?"":We,Ct=Me.onChange,Ot=Me.width,Nt=Ot===void 0?"100%":Ot,ir=Me.height,Jt=ir===void 0?400:ir,cn=Me.miniToolbar,rn=cn===void 0?!1:cn,In=Me.isFocus,ur=In===void 0?!1:In,mr=Me.watch,Qn=Me.insertTemp,yr=Me.mode,Sr=yr===void 0?"markdown":yr,Nn=Me.id,Ar=Nn===void 0?"markdown-editor-id":Nn,An=Me.showResizeBar,Dn=An===void 0?!1:An,qn=Me.noStorage,fr=qn===void 0?!1:qn,Lr=Me.showNullButton,Or=Lr===void 0?!1:Lr,at=Me.hidetoolBar,Fe=at===void 0?!1:at,pt=Me.fullScreen,Le=pt===void 0?!1:pt,xe=Me.onBlur,ge=Me.onCMBeforeChange,Hn=Me.onFullScreen,Lt=Me.className,ke=Lt===void 0?"":Lt,ut=Me.disablePaste,Re=ut===void 0?!1:ut,tn=Me.placeholder,cr=tn===void 0?"":tn,pr=Me.values,Kn=pr===void 0?"":pr,jt=Object(m.useState)(null),dr=Object(Y.a)(jt,2),ct=dr[0],Un=dr[1],yn=Object(m.useState)(lt),ln=Object(Y.a)(yn,2),Xt=ln[0],Pn=ln[1],hn=Object(m.useState)(mr),qt=Object(Y.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=Object(m.useState)(Le),sr=Object(Y.a)(ar,2),Fn=sr[0],bn=sr[1],Ut=Object(m.useState)(""),Vt=Object(Y.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=Object(m.useState)(0),On=Object(Y.a)(Zn,2),fn=On[0],Vn=On[1],un=Object(m.useState)(Jt),_n=Object(Y.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(m.useState)(!1),tr=Object(Y.a)(er,2),wn=tr[0],Mn=tr[1],dn=Object(m.useRef)(Object(Ne.a)()),or=Object(m.useRef)(!1),Xn=Object(m.useRef)(),vr=Object(m.useRef)(),gr=Object(m.useRef)(),Gn=Object(m.useRef)(),Bn=Object(m.useRef)(),_r=function(){var ft=Object(M.a)(A.a.mark(function rt(){var $e,Ze;return A.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.next=2,Object(we.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:dn.current}});case 2:Ze=ot.sent,Ze!=null&&($e=Ze.attachments)!==null&&$e!==void 0&&$e.length&&(console.log("cm:",ct,vr),Ze.attachments.map(function(et){et.content_type.indexOf("image")>-1?ct.replaceSelection("![,](/api/attachments/".concat(et.id,"?type=").concat(et.content_type,")")):et.content_type.indexOf("video")>-1?ct.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):et.content_type.indexOf("pdf")>-1?ct.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(et.id,"?type=").concat(et.content_type,'&disposition=inline" target="_blank">').concat(et.name,"</a>")):ct.replaceSelection("[".concat(et.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(et.id,"?type=").concat(et.content_type,")"))}));case 4:case"end":return ot.stop()}},rt)}));return function(){return ft.apply(this,arguments)}}();Object(m.useEffect)(function(){Pn(Kn),ct==null||ct.setValue(Kn)},[Kn]),Object(m.useEffect)(function(){Hn==null||Hn(Fn)},[Fn]),Object(m.useEffect)(function(){if(vr.current){var ft=a.a.fromTextArea(vr.current,{mode:Sr,lineNumbers:!rn,lineWrapping:!0,value:lt,autoCloseTags:!0,autoCloseBrackets:!0});ur&&ft.focus();function rt($e,Ze){if(Re){Ze.preventDefault();return}var He=Ze.clipboardData;if(He){var ot=He.types.toString(),et=He.items;if(ot==="Files"||He.types.indexOf("Files")>-1){if(Ze.preventDefault(),Sr=="stex")return;try{var mt,Tt=et[1];((mt=et[0])===null||mt===void 0?void 0:mt.kind)==="file"&&(Tt=et[0]);var gt=Tt.getAsFile(),Pt=gt.name.split(".").pop();_(gt,function(vt){if(vt.id){var yt,on,$t;(gt==null||((yt=gt.type)===null||yt===void 0)?void 0:yt.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(vt.id,"?type=").concat(vt.content_type,")")):(gt==null||((on=gt.type)===null||on===void 0)?void 0:on.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(vt.id,'"></video>')):(gt==null||(($t=gt.type)===null||$t===void 0)?void 0:$t.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):de.includes(Pt)?ft.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(vt.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):ft.replaceSelection("[".concat(gt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})}catch(vt){G.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ft.on("paste",rt),ft.on("dragleave",function($e,Ze){gr.current.classList.remove("mouse-hover-md")}),ft.on("dragover",function($e,Ze){gr.current.classList.add("mouse-hover-md")}),ft.on("drop",function($e,Ze){gr.current.classList.add("mouse-hover-md");var He;if(He=Ze.dataTransfer.files,He.length>0){Ze.preventDefault(),Ze.stopPropagation();for(var ot=function(Tt){var gt=He[Tt],Pt=gt.name.split(".").pop();_(gt,function(vt){if(vt.id){var yt,on,$t;(gt==null||((yt=gt.type)===null||yt===void 0)?void 0:yt.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(vt.id,"?type=").concat(vt.content_type,")")):(gt==null||((on=gt.type)===null||on===void 0)?void 0:on.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(vt.id,'"></video>')):(gt==null||(($t=gt.type)===null||$t===void 0)?void 0:$t.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):de.includes(Pt)?ft.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(vt.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):ft.replaceSelection("[".concat(gt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})},et=0;et<He.length;et++)ot(et)}}),Un(ft),function(){ft.off("paste",rt)}}},[]);var Rn=Object(m.useCallback)(function(){if(gr.current)try{}catch(ft){console.log(ft,"---- to set md editor body height")}},[Zt,gr,Fn]);Object(m.useEffect)(function(){function ft(){var $e=new c.default(function(Ze){var He=Object(U.a)(Ze),ot;try{for(He.s();!(ot=He.n()).done;){var et=ot.value;(et.target.offsetHeight>0||et.target.offsetWidth>0)&&(Rn(),ct.setSize("100%","100%"),ct.refresh())}}catch(mt){He.e(mt)}finally{He.f()}});return $e.observe(vr.current.parentElement),$e}if(ct){var rt=ft();return function(){rt.unobserve(vr.current.parentElement)}}},[ct,Rn]),Object(m.useEffect)(function(){if(ct){for(var ft=[],rt=function(){var et=Ze[$e];He=Object(Y.a)(et,2);var mt=He[0],Tt=He[1],gt=Object(X.a)({},mt,function(){En(Tt)});ft.push(gt),ct.addKeyMap(gt)},$e=0,Ze=Object.entries(pe);$e<Ze.length;$e++){var He;rt()}return Xn.current=setInterval(function(){or.current&&_r()},4e3),function(){clearInterval(Xn.current);var ot=Object(U.a)(ft),et;try{for(ot.s();!(et=ot.n()).done;){var mt=et.value;ct.removeKeyMap(mt)}}catch(Tt){ot.e(Tt)}finally{ot.f()}}}},[ct]),Object(m.useEffect)(function(){Le!==Fn&&bn(Le)},[Le]),Object(an.a)(function(){if(!fr&&fn>0){var ft=new Date().getTime(),rt=window.sessionStorage.getItem(Ar);ft>=fn+xt&&(!rt||rt!==Xt)&&(window.sessionStorage.setItem(Ar,Xt),Mn(!0))}},xt),Object(m.useEffect)(function(){Kt(mr)},[ct,mr]),Object(m.useEffect)(function(){ct&&(ur&&ct.focus())},[ct,ur]),Object(m.useEffect)(function(){if(Mt&&ct){var ft=ct.getScrollerElement();function rt($e){var Ze=$e.target;if(Bn.current){var He=Ze.scrollTop/Ze.scrollHeight;Bn.current.scrollTop=Bn.current.scrollHeight*He}}return ft.addEventListener("scroll",rt),function(){ft.removeEventListener("scroll",rt)}}},[ct,Mt]),Object(m.useEffect)(function(){if(ct&&ge){function ft(rt,$e){ge(rt,$e)}return ct.on("beforeChange",ft),function(){ct.off("beforeChange",ft)}}},[ct,ge]),Object(m.useEffect)(function(){if(ct&&xe){function ft(){xe(ct.getValue())}return ct.on("blur",ft),function(){ct.off("blur",ft)}}},[ct,xe]),Object(m.useEffect)(function(){if(ct){function ft(rt){var $e=rt.getValue();Pn($e),Vn(new Date().getTime()),rt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ct&&Ct($e)}return ct.on("change",ft),function(){ct.off("change",ft)}}},[ct,Ct]),Object(m.useEffect)(function(){ct&&(lt==null?(ct.setValue(""),Pn("")):lt!==ct.getValue()&&(ct.setValue(lt),Pn(lt),ct.setCursor(ct.lineCount(),0)))},[ct,lt]);var En=Object(m.useCallback)(function(ft){var rt=ct.getCursor(),$e=ct.getSelection(),Ze=$e.split(`
`);switch(ft){case"bold":return ct.replaceSelection("**"+$e+"**"),$e===""&&ct.setCursor(rt.line,rt.ch+2),ct.focus();case"italic":return ct.replaceSelection("*"+$e+"*"),$e===""&&ct.setCursor(rt.line,rt.ch+1),ct.focus();case"code":return ct.replaceSelection("`"+$e+"`"),$e===""&&ct.setCursor(rt.line,rt.ch+1),ct.focus();case"inline-latex":return ct.replaceSelection("`$$"+$e+"$$`"),$e===""&&ct.setCursor(rt.line,rt.ch+3),ct.focus();case"latex":return ct.replaceSelection("```latex\n"+$e+"\n```"),ct.setCursor(rt.line+1,$e.length+1),ct.focus();case"line-break":return ct.replaceSelection(`<br/>
`),ct.focus();case"list-ul":return $e===""?ct.replaceSelection("- "+$e):ct.replaceSelection(Ze.map(function(He){return He===""?"":"- ".concat(He)}).join(`
`)),ct.focus();case"list-ol":return $e===""?ct.replaceSelection("1. "+$e):ct.replaceSelection(Ze.map(function(He,ot){return He===""?"":"".concat(ot+1,". ").concat(He)}).join(`
`)),ct.focus();case"add-null-ch":return $e===""&&ct.setCursor(rt.line,rt.ch+1),ct.replaceSelection(ye),ct.focus();case"inster-template-1":return $e===""&&ct.setCursor(rt.line,rt.ch),ct.replaceSelection(ae),ct.focus();case"eraser":return ct.setValue(""),ct.focus();case"trigger-watch":return Kt(!Mt),ct.focus();case"trigger-full-screen":return bn(!Fn),ct.focus();case Ye:Dt(Ye);return;case ht:Dt(ht);return;case Xe:Dt(Xe);return;case wt:Dt(wt);return;default:throw new Error}},[ct,Mt,Fn]),Cn=Object(m.useCallback)(function(ft){Dt("");switch(Gt){case Ye:var rt=ft.title,$e=ft.link;return ct.replaceSelection("[".concat(rt,"](").concat($e,")")),ct.focus();case ht:var Ze=ft.language,He=ft.content;return ct.replaceSelection(["```"+Ze,He,"```"].join(`
`)),ct.focus();case Xe:var ot=ft.src,et=ft.alt;return et?ct.replaceSelection("![ ".concat(et," ]( ").concat(ot,' "').concat(et,'" )')):ct.replaceSelection("![,](".concat(ot,")")),ct.focus();case wt:for(var mt=ft.row,Tt=ft.col,gt=ft.align,Pt=`
`,vt=0;vt<mt;vt++){for(var yt=[],on=[],$t=0;$t<Tt;$t++)vt===1&&on.push(Wt[gt]),yt.push(" ");vt===1&&(Pt+="| ".concat(on.join(" | "),` |
`)),Pt+="| ".concat(yt.join(Tt===1?"":" | "),` |
`)}return ct.replaceSelection(Pt+`
`),ct.focus();default:throw new Error}},[ct,Gt]),vn=Object(m.useMemo)(function(){switch(Gt){case Ye:return f.a.createElement(se,{callback:Cn,onCancel:Qt});case ht:return f.a.createElement(fe.b,{callback:Cn,onCancel:Qt});case Xe:return f.a.createElement(be,{callback:Cn,onCancel:Qt});case wt:return f.a.createElement(nt,{callback:Cn,onCancel:Qt});default:return null}},[Gt]);function Qt(){Dt("")}Object(m.useEffect)(function(){if(Gn.current){var ft=Gn.current,rt=!1,$e=0;function Ze(et){rt=!0,$e=et.pageY}function He(){rt=!1}function ot(et){if(rt){var mt=et.pageY-$e;mt<0&&(mt=0),mt>300&&(mt=300);var Tt=Jt+mt+"px";kn(Tt)}}return ft.addEventListener("mousedown",Ze),document.addEventListener("mousemove",ot),document.addEventListener("mouseup",He),function(){ft.removeEventListener("mousedown",Ze),document.removeEventListener("mousemove",ot),document.removeEventListener("mouseup",He)}}},[ct,Gn]),Object(m.useEffect)(function(){kn(Jt)},[Jt]);var St=le(Nt),It=le(Zt),kt={width:St,height:It},At=Object(m.useMemo)(function(){if(fn){var ft=new Date(fn),rt=ft.getHours(),$e=ft.getMinutes(),Ze=ft.getSeconds();return rt=rt<10?"0"+rt:rt,$e=$e<10?"0"+$e:$e,Ze=Ze<10?"0"+Ze:Ze,"".concat(rt,":").concat($e,":").concat(Ze)}return 0},[fn]);function zt(){window.sessionStorage.removeItem(Ar),Mn(!1),Vn(0)}function sn(){Mn(!1),Vn(0),ct.setValue(window.sessionStorage.getItem(Ar))}function nn(ft,rt){var $e=ct.getValue();$e=$e.replace(ft,rt),Pn($e),ct==null||ct.setValue($e)}return f.a.createElement(m.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:gr},f.a.createElement("div",{className:"markdown-editor-container ".concat(ke," ").concat(Mt?"on-preview":""," ").concat(rn?"mini":""," ").concat(Fn?"full-screen":""),style:kt},f.a.createElement(b,{insertTemp:Qn,watch:Mt,fullScreen:Fn,showNullButton:Or,onActionCallback:En,hidetoolBar:Fe,uuid:dn.current,setOpenPhones:function(){or.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:vr,placeholder:cr})),Mt?f.a.createElement("div",{ref:Bn,className:"preview-container"},Sr==="stex"&&f.a.createElement(D,{value:Xt}),Sr!=="stex"&&f.a.createElement(S.a,{edit:!0,value:Xt,replaces:nn})):null))),Dn?f.a.createElement("a",{ref:Gn,className:"editor-resize"}):null,f.a.createElement(W.a,null,De[Gt]?f.a.createElement(Q.a,{centered:!0,title:De[Gt],visible:!0,onCancel:Qt,footer:null,className:"markdown-popup-form"},vn):null))}},Pxm8:function(Et,Pe,F){Et.exports={flex_box_center:"flex_box_center___3O17H",flex_space_between:"flex_space_between___1PCIj",flex_box_vertical_center:"flex_box_vertical_center___3W4zT",flex_box_center_end:"flex_box_center_end___3TSxu",flex_box_column:"flex_box_column___3pTiU",bg:"bg___3XbLP",title:"title___3HsI1",titleLeft:"titleLeft___3MQGG",titleRight:"titleRight___2RPg2",formWrap:"formWrap___3LmMJ"}},RxwV:function(Et,Pe,F){"use strict";var ne=F("q1tI"),Q=F("uciX"),U=F("2W6z"),Z=F.n(U),G=F("4IlW"),M=F("uK0f"),Y=F.n(M);function X(Te,Ie){if(Te===Ie)return!0;if(!Te||!Ie)return!1;var be=Te.length;if(Ie.length!==be)return!1;for(var q=0;q<be;q++)if(Te[q]!==Ie[q])return!1;return!0}function r(Te){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r=function(be){return typeof be}:r=function(be){return be&&typeof Symbol=="function"&&be.constructor===Symbol&&be!==Symbol.prototype?"symbol":typeof be},r(Te)}function A(Te,Ie){if(!(Te instanceof Ie))throw new TypeError("Cannot call a class as a function")}function m(Te,Ie){for(var be=0;be<Ie.length;be++){var q=Ie[be];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(Te,q.key,q)}}function f(Te,Ie,be){return Ie&&m(Te.prototype,Ie),be&&m(Te,be),Te}function p(Te,Ie){if(typeof Ie!="function"&&Ie!==null)throw new TypeError("Super expression must either be null or a function");Te.prototype=Object.create(Ie&&Ie.prototype,{constructor:{value:Te,writable:!0,configurable:!0}}),Ie&&a(Te,Ie)}function a(Te,Ie){return a=Object.setPrototypeOf||function(q,_){return q.__proto__=_,q},a(Te,Ie)}function c(Te){var Ie=t();return function(){var be=u(Te),q;if(Ie){var _=u(this).constructor;q=Reflect.construct(be,arguments,_)}else q=be.apply(this,arguments);return s(this,q)}}function s(Te,Ie){return Ie&&(r(Ie)==="object"||typeof Ie=="function")?Ie:i(Te)}function i(Te){if(Te===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te}function t(){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(Te){return!1}}function u(Te){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(be){return be.__proto__||Object.getPrototypeOf(be)},u(Te)}var o=function(){var Te=function(Ie){p(q,Ie);var be=c(q);function q(){var _;return A(this,q),_=be.apply(this,arguments),_.menuItems={},_.saveMenuItem=function(L){return function(z){_.menuItems[L]=z}},_}return f(q,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(L){!L.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(L){var z=this.props,ee=z.fieldNames,$=z.defaultFieldNames;return ee[L]||$[L]}},{key:"getOption",value:function(L,z){var ee=this.props,$=ee.prefixCls,Ee=ee.expandTrigger,Be=ee.expandIcon,nt=ee.loadingIcon,we=this.props.onSelect.bind(this,L,z),Ne=this.props.onItemDoubleClick.bind(this,L,z),Ye={onClick:we,onDoubleClick:Ne},Xe="".concat($,"-menu-item"),ht=null,wt=L[this.getFieldName("children")]&&L[this.getFieldName("children")].length>0;(wt||L.isLeaf===!1)&&(Xe+=" ".concat($,"-menu-item-expand"),L.loading||(ht=ne.createElement("span",{className:"".concat($,"-menu-item-expand-icon")},Be))),Ee==="hover"&&(wt||L.isLeaf===!1)&&(Ye={onMouseEnter:this.delayOnSelect.bind(this,we),onMouseLeave:this.delayOnSelect.bind(this),onClick:we}),this.isActiveOption(L,z)&&(Xe+=" ".concat($,"-menu-item-active"),Ye.ref=this.saveMenuItem(z)),L.disabled&&(Xe+=" ".concat($,"-menu-item-disabled"));var Bt=null;L.loading&&(Xe+=" ".concat($,"-menu-item-loading"),Bt=nt||null);var Wt="";return"title"in L?Wt=L.title:typeof L[this.getFieldName("label")]=="string"&&(Wt=L[this.getFieldName("label")]),ne.createElement("li",Object.assign({key:L[this.getFieldName("value")],className:Xe,title:Wt},Ye,{role:"menuitem",onMouseDown:function(Yt){return Yt.preventDefault()}}),L[this.getFieldName("label")],ht,Bt)}},{key:"getActiveOptions",value:function(L){var z=this,ee=this.props.options,$=L||this.props.activeValue;return Y()(ee,function(Ee,Be){return Ee[z.getFieldName("value")]===$[Be]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var L=this,z=this.props.options,ee=this.getActiveOptions().map(function($){return $[L.getFieldName("children")]}).filter(function($){return!!$});return ee.unshift(z),ee}},{key:"delayOnSelect",value:function(L){for(var z=this,ee=arguments.length,$=new Array(ee>1?ee-1:0),Ee=1;Ee<ee;Ee++)$[Ee-1]=arguments[Ee];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof L=="function"&&(this.delayTimer=window.setTimeout(function(){L($),z.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var L=this.getShowOptions().length,z=0;z<L;z++){var ee=this.menuItems[z];ee&&ee.parentElement&&(ee.parentElement.scrollTop=ee.offsetTop)}}},{key:"isActiveOption",value:function(L,z){var ee=this.props.activeValue,$=ee===void 0?[]:ee;return $[z]===L[this.getFieldName("value")]}},{key:"render",value:function(){var L=this,z=this.props,ee=z.prefixCls,$=z.dropdownMenuColumnStyle;return ne.createElement("div",null,this.getShowOptions().map(function(Ee,Be){return ne.createElement("ul",{className:"".concat(ee,"-menu"),key:Be,style:$},Ee.map(function(nt){return L.getOption(nt,Be)}))}))}}]),q}(ne.Component);return Te.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},Te}(),R=o,T={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}}},S=T;function D(Te){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?D=function(be){return typeof be}:D=function(be){return be&&typeof Symbol=="function"&&be.constructor===Symbol&&be!==Symbol.prototype?"symbol":typeof be},D(Te)}function I(Te,Ie){if(Te==null)return{};var be=E(Te,Ie),q,_;if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(Te);for(_=0;_<L.length;_++){if(q=L[_],Ie.indexOf(q)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(Te,q))continue;be[q]=Te[q]}}return be}function E(Te,Ie){if(Te==null)return{};var be={},q=Object.keys(Te),_,L;for(L=0;L<q.length;L++){if(_=q[L],Ie.indexOf(_)>=0)continue;be[_]=Te[_]}return be}function x(Te){return w(Te)||O(Te)||h(Te)||g()}function g(){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 h(Te,Ie){if(!Te)return;if(typeof Te=="string")return b(Te,Ie);var be=Object.prototype.toString.call(Te).slice(8,-1);if(be==="Object"&&Te.constructor&&(be=Te.constructor.name),be==="Map"||be==="Set")return Array.from(Te);if(be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be))return b(Te,Ie)}function O(Te){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(Te))return Array.from(Te)}function w(Te){if(Array.isArray(Te))return b(Te)}function b(Te,Ie){(Ie==null||Ie>Te.length)&&(Ie=Te.length);for(var be=0,q=new Array(Ie);be<Ie;be++)q[be]=Te[be];return q}function W(Te,Ie){if(!(Te instanceof Ie))throw new TypeError("Cannot call a class as a function")}function j(Te,Ie){for(var be=0;be<Ie.length;be++){var q=Ie[be];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(Te,q.key,q)}}function C(Te,Ie,be){return Ie&&j(Te.prototype,Ie),be&&j(Te,be),Te}function B(Te,Ie){if(typeof Ie!="function"&&Ie!==null)throw new TypeError("Super expression must either be null or a function");Te.prototype=Object.create(Ie&&Ie.prototype,{constructor:{value:Te,writable:!0,configurable:!0}}),Ie&&k(Te,Ie)}function k(Te,Ie){return k=Object.setPrototypeOf||function(q,_){return q.__proto__=_,q},k(Te,Ie)}function y(Te){var Ie=se();return function(){var be=fe(Te),q;if(Ie){var _=fe(this).constructor;q=Reflect.construct(be,arguments,_)}else q=be.apply(this,arguments);return H(this,q)}}function H(Te,Ie){return Ie&&(D(Ie)==="object"||typeof Ie=="function")?Ie:J(Te)}function J(Te){if(Te===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te}function se(){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(Te){return!1}}function fe(Te){return fe=Object.setPrototypeOf?Object.getPrototypeOf:function(be){return be.__proto__||Object.getPrototypeOf(be)},fe(Te)}var ve=function(){var Te=function(Ie){B(q,Ie);var be=y(q);function q(_){var L;W(this,q),L=be.call(this,_),L.setPopupVisible=function(ee){var $=L.state.value;"popupVisible"in L.props||L.setState({popupVisible:ee}),ee&&!L.state.popupVisible&&L.setState({activeValue:$}),L.props.onPopupVisibleChange(ee)},L.handleChange=function(ee,$,Ee){var Be=$.visible;(Ee.type!=="keydown"||Ee.keyCode===G.a.ENTER)&&(L.props.onChange(ee.map(function(nt){return nt[L.getFieldName("value")]}),ee),L.setPopupVisible(Be))},L.handlePopupVisibleChange=function(ee){L.setPopupVisible(ee)},L.handleMenuSelect=function(ee,$,Ee){var Be=L.trigger.getRootDomNode();Be&&Be.focus&&Be.focus();var nt=L.props,we=nt.changeOnSelect,Ne=nt.loadData,Ye=nt.expandTrigger;if(!ee||ee.disabled)return;var Xe=L.state.activeValue;Xe=Xe.slice(0,$+1),Xe[$]=ee[L.getFieldName("value")];var ht=L.getActiveOptions(Xe);if(ee.isLeaf===!1&&!ee[L.getFieldName("children")]&&Ne){we&&L.handleChange(ht,{visible:!0},Ee),L.setState({activeValue:Xe}),Ne(ht);return}var wt={};!ee[L.getFieldName("children")]||!ee[L.getFieldName("children")].length?(L.handleChange(ht,{visible:!1},Ee),wt.value=Xe):we&&(Ee.type==="click"||Ee.type==="keydown")&&(Ye==="hover"?L.handleChange(ht,{visible:!1},Ee):L.handleChange(ht,{visible:!0},Ee),wt.value=Xe),wt.activeValue=Xe,("value"in L.props||Ee.type==="keydown"&&Ee.keyCode!==G.a.ENTER)&&delete wt.value,L.setState(wt)},L.handleItemDoubleClick=function(){var ee=L.props.changeOnSelect;ee&&L.setPopupVisible(!1)},L.handleKeyDown=function(ee){var $=L.props.children;if($&&$.props.onKeyDown){$.props.onKeyDown(ee);return}var Ee=x(L.state.activeValue),Be=Ee.length-1<0?0:Ee.length-1,nt=L.getCurrentLevelOptions(),we=nt.map(function(ht){return ht[L.getFieldName("value")]}).indexOf(Ee[Be]);if(ee.keyCode!==G.a.DOWN&&ee.keyCode!==G.a.UP&&ee.keyCode!==G.a.LEFT&&ee.keyCode!==G.a.RIGHT&&ee.keyCode!==G.a.ENTER&&ee.keyCode!==G.a.SPACE&&ee.keyCode!==G.a.BACKSPACE&&ee.keyCode!==G.a.ESC&&ee.keyCode!==G.a.TAB)return;if(!L.state.popupVisible&&ee.keyCode!==G.a.BACKSPACE&&ee.keyCode!==G.a.LEFT&&ee.keyCode!==G.a.RIGHT&&ee.keyCode!==G.a.ESC&&ee.keyCode!==G.a.TAB){L.setPopupVisible(!0);return}if(ee.keyCode===G.a.DOWN||ee.keyCode===G.a.UP){ee.preventDefault();var Ne=we;Ne!==-1?ee.keyCode===G.a.DOWN?(Ne+=1,Ne=Ne>=nt.length?0:Ne):(Ne-=1,Ne=Ne<0?nt.length-1:Ne):Ne=0,Ee[Be]=nt[Ne][L.getFieldName("value")]}else if(ee.keyCode===G.a.LEFT||ee.keyCode===G.a.BACKSPACE)ee.preventDefault(),Ee.splice(Ee.length-1,1);else if(ee.keyCode===G.a.RIGHT)ee.preventDefault(),nt[we]&&nt[we][L.getFieldName("children")]&&Ee.push(nt[we][L.getFieldName("children")][0][L.getFieldName("value")]);else if(ee.keyCode===G.a.ESC||ee.keyCode===G.a.TAB){L.setPopupVisible(!1);return}(!Ee||Ee.length===0)&&L.setPopupVisible(!1);var Ye=L.getActiveOptions(Ee),Xe=Ye[Ye.length-1];L.handleMenuSelect(Xe,Ye.length-1,ee),L.props.onKeyDown&&L.props.onKeyDown(ee)},L.saveTrigger=function(ee){L.trigger=ee};var z=[];return"value"in _?z=_.value||[]:"defaultValue"in _&&(z=_.defaultValue||[]),Z()(!("filedNames"in _),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),L.state={popupVisible:_.popupVisible,activeValue:z,value:z,prevProps:_},L.defaultFieldNames={label:"label",value:"value",children:"children"},L}return C(q,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(L){var z=this.defaultFieldNames,ee=this.props,$=ee.fieldNames,Ee=ee.filedNames;return"filedNames"in this.props?Ee[L]||z[L]:$[L]||z[L]}},{key:"getFieldNames",value:function(){var L=this.props,z=L.fieldNames,ee=L.filedNames;return"filedNames"in this.props?ee:z}},{key:"getCurrentLevelOptions",value:function(){var L=this,z=this.props.options,ee=z===void 0?[]:z,$=this.state.activeValue,Ee=$===void 0?[]:$,Be=Y()(ee,function(nt,we){return nt[L.getFieldName("value")]===Ee[we]},{childrenKeyName:this.getFieldName("children")});return Be[Be.length-2]?Be[Be.length-2][this.getFieldName("children")]:x(ee).filter(function(nt){return!nt.disabled})}},{key:"getActiveOptions",value:function(L){var z=this;return Y()(this.props.options||[],function(ee,$){return ee[z.getFieldName("value")]===L[$]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var L=this.props,z=L.prefixCls,ee=L.transitionName,$=L.popupClassName,Ee=L.options,Be=Ee===void 0?[]:Ee,nt=L.disabled,we=L.builtinPlacements,Ne=L.popupPlacement,Ye=L.children,Xe=L.dropdownRender,ht=I(L,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),wt=ne.createElement("div",null),Bt="";Be&&Be.length>0?wt=ne.createElement(R,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Bt=" ".concat(z,"-menus-empty");var Wt=wt;return Xe&&(Wt=Xe(wt)),ne.createElement(Q.a,Object.assign({ref:this.saveTrigger},ht,{popupPlacement:Ne,builtinPlacements:we,popupTransitionName:ee,action:nt?[]:["click"],popupVisible:nt?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(z,"-menus"),popupClassName:$+Bt,popup:Wt}),ne.cloneElement(Ye,{onKeyDown:this.handleKeyDown,tabIndex:nt?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(L,z){var ee=z.prevProps,$=ee===void 0?{}:ee,Ee={prevProps:L};return"value"in L&&!X($.value,L.value)&&(Ee.value=L.value||[],"loadData"in L||(Ee.activeValue=L.value||[])),"popupVisible"in L&&(Ee.popupVisible=L.popupVisible),Ee}}]),q}(ne.Component);return Te.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:S,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},Te}(),Se=ve,Ue=Pe.a=Se},"SA+Z":function(Et,Pe,F){var ne=F("wTVA"),Q=F("EbDI"),U=F("ZhPi"),Z=F("wkBT");function G(M){return ne(M)||Q(M)||U(M)||Z()}Et.exports=G,Et.exports.__esModule=!0,Et.exports.default=Et.exports},SJMd:function(Et,Pe){/**
* @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 F,ne,Q,U=!1,Z,G;window.PR_SHOULD_USE_CONTINUATION=!0;var M,Y;(function(){var X=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"],m=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[m,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[m,"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"],c="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",s=[m,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",t=[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"],u=[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"],o=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[f,a,p,s,i,t,u,o],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",D="kwd",I="com",E="typ",x="lit",g="pun",h="pln",O="tag",w="dec",b="src",W="atn",j="atv",C="nocode",B="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Ee){for(var Be=0,nt=!1,we=!1,Ne=0,Ye=Ee.length;Ne<Ye;++Ne){var Xe=Ee[Ne];if(Xe.ignoreCase)we=!0;else if(/[a-z]/i.test(Xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){nt=!0,we=!1;break}}var ht={b:8,t:9,n:10,v:11,f:12,r:13};function wt(qe){var Qe=qe.charCodeAt(0);if(Qe!==92)return Qe;var bt=qe.charAt(1);return Qe=ht[bt],Qe||("0"<=bt&&bt<="7"?parseInt(qe.substring(1),8):bt==="u"||bt==="x"?parseInt(qe.substring(2),16):qe.charCodeAt(1))}function Bt(qe){if(qe<32)return(qe<16?"\\x0":"\\x")+qe.toString(16);var Qe=String.fromCharCode(qe);return Qe==="\\"||Qe==="-"||Qe==="]"||Qe==="^"?"\\"+Qe:Qe}function Wt(qe){var Qe=qe.substring(1,qe.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")),bt=[],xt=Qe[0]==="^",ye=["["];xt&&ye.push("^");for(var ae=xt?1:0,le=Qe.length;ae<le;++ae){var me=Qe[ae];if(/\\[bdsw]/i.test(me))ye.push(me);else{var Ce=wt(me),de;ae+2<le&&Qe[ae+1]==="-"?(de=wt(Qe[ae+2]),ae+=2):de=Ce,bt.push([Ce,de]),de<65||Ce>122||(de<65||Ce>90||bt.push([Math.max(65,Ce)|32,Math.min(de,90)|32]),de<97||Ce>122||bt.push([Math.max(97,Ce)&~32,Math.min(de,122)&~32]))}}bt.sort(function(Me,We){return Me[0]-We[0]||We[1]-Me[1]});for(var pe=[],De=[],ae=0;ae<bt.length;++ae){var ue=bt[ae];ue[0]<=De[1]+1?De[1]=Math.max(De[1],ue[1]):pe.push(De=ue)}for(var ae=0;ae<pe.length;++ae){var ue=pe[ae];ye.push(Bt(ue[0])),ue[1]>ue[0]&&(ue[1]+1>ue[0]&&ye.push("-"),ye.push(Bt(ue[1])))}return ye.push("]"),ye.join("")}function an(qe){for(var Qe=qe.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")),bt=Qe.length,xt=[],ye=0,ae=0;ye<bt;++ye){var le=Qe[ye];if(le==="(")++ae;else if(le.charAt(0)==="\\"){var me=+le.substring(1);me&&(me<=ae?xt[me]=-1:Qe[ye]=Bt(me))}}for(var ye=1;ye<xt.length;++ye)xt[ye]===-1&&(xt[ye]=++Be);for(var ye=0,ae=0;ye<bt;++ye){var le=Qe[ye];if(le==="(")++ae,xt[ae]||(Qe[ye]="(?:");else if(le.charAt(0)==="\\"){var me=+le.substring(1);me&&me<=ae&&(Qe[ye]="\\"+xt[me])}}for(var ye=0;ye<bt;++ye)Qe[ye]==="^"&&Qe[ye+1]!=="^"&&(Qe[ye]="");if(qe.ignoreCase&&nt)for(var ye=0;ye<bt;++ye){var le=Qe[ye],Ce=le.charAt(0);le.length>=2&&Ce==="["?Qe[ye]=Wt(le):Ce!=="\\"&&(Qe[ye]=le.replace(/[a-zA-Z]/g,function(De){var ue=De.charCodeAt(0);return"["+String.fromCharCode(ue&~32,ue|32)+"]"}))}return Qe.join("")}for(var Yt=[],Ne=0,Ye=Ee.length;Ne<Ye;++Ne){var Xe=Ee[Ne];if(Xe.global||Xe.multiline)throw new Error(""+Xe);Yt.push("(?:"+an(Xe)+")")}return new RegExp(Yt.join("|"),we?"gi":"g")}function y(Ee,Be){var nt=/(?:^|\s)nocode(?:\s|$)/,we=[],Ne=0,Ye=[],Xe=0;function ht(wt){var Bt=wt.nodeType;if(Bt==1){if(nt.test(wt.className))return;for(var Wt=wt.firstChild;Wt;Wt=Wt.nextSibling)ht(Wt);var an=wt.nodeName.toLowerCase();(an==="br"||an==="li")&&(we[Xe]=`
`,Ye[Xe<<1]=Ne++,Ye[Xe++<<1|1]=wt)}else if(Bt==3||Bt==4){var Yt=wt.nodeValue;Yt.length&&(Be?Yt=Yt.replace(/\r\n?/g,`
`):Yt=Yt.replace(/[ \t\r\n]+/g," "),we[Xe]=Yt,Ye[Xe<<1]=Ne,Ne+=Yt.length,Ye[Xe++<<1|1]=wt)}}return ht(Ee),{sourceCode:we.join("").replace(/\n$/,""),spans:Ye}}function H(Ee,Be,nt,we,Ne){if(!nt)return;var Ye={sourceNode:Ee,pre:1,langExtension:null,numberLines:null,sourceCode:nt,spans:null,basePos:Be,decorations:null};we(Ye),Ne.push.apply(Ne,Ye.decorations)}var J=/\S/;function se(Ee){for(var Be=void 0,nt=Ee.firstChild;nt;nt=nt.nextSibling){var we=nt.nodeType;Be=we===1?Be?Ee:nt:we===3&&J.test(nt.nodeValue)?Ee:Be}return Be===Ee?void 0:Be}function fe(Ee,Be){var nt={},we;(function(){for(var Xe=Ee.concat(Be),ht=[],wt={},Bt=0,Wt=Xe.length;Bt<Wt;++Bt){var an=Xe[Bt],Yt=an[3];if(Yt)for(var qe=Yt.length;--qe>=0;)nt[Yt.charAt(qe)]=an;var Qe=an[1],bt=""+Qe;wt.hasOwnProperty(bt)||(ht.push(Qe),wt[bt]=null)}ht.push(/[\0-\uffff]/),we=k(ht)})();var Ne=Be.length,Ye=function(Xe){for(var ht=Xe.sourceCode,wt=Xe.basePos,Bt=Xe.sourceNode,Wt=[wt,h],an=0,Yt=ht.match(we)||[],qe={},Qe=0,bt=Yt.length;Qe<bt;++Qe){var xt=Yt[Qe],ye=qe[xt],ae=void 0,le;if(typeof ye=="string")le=!1;else{var me=nt[xt.charAt(0)];if(me)ae=xt.match(me[1]),ye=me[0];else{for(var Ce=0;Ce<Ne;++Ce)if(me=Be[Ce],ae=xt.match(me[1]),ae){ye=me[0];break}ae||(ye=h)}le=ye.length>=5&&ye.substring(0,5)==="lang-",le&&!(ae&&typeof ae[1]=="string")&&(le=!1,ye=b),le||(qe[xt]=ye)}var de=an;if(an+=xt.length,!le)Wt.push(wt+de,ye);else{var pe=ae[1],De=xt.indexOf(pe),ue=De+pe.length;ae[2]&&(ue=xt.length-ae[2].length,De=ue-pe.length);var Me=ye.substring(5);H(Bt,wt+de,xt.substring(0,De),Ye,Wt),H(Bt,wt+de+De,pe,q(Me,pe),Wt),H(Bt,wt+de+ue,xt.substring(ue),Ye,Wt)}}Xe.decorations=Wt};return Ye}function ve(Ee){var Be=[],nt=[];Ee.tripleQuotedStrings?Be.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ee.multiLineStrings?Be.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Be.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ee.verbatimStrings&&nt.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var we=Ee.hashComments;we&&(Ee.cStyleComments?(we>1?Be.push([I,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Be.push([I,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),nt.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Be.push([I,/^#[^\r\n]*/,null,"#"])),Ee.cStyleComments&&(nt.push([I,/^\/\/[^\r\n]*/,null]),nt.push([I,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ne=Ee.regexLiterals;if(Ne){var Ye=Ne>1?"":`
\r`,Xe=Ye?".":"[\\S\\s]",ht="/(?=[^/*"+Ye+"])(?:[^/\\x5B\\x5C"+Ye+"]|\\x5C"+Xe+"|\\x5B(?:[^\\x5C\\x5D"+Ye+"]|\\x5C"+Xe+")*(?:\\x5D|$))+/";nt.push(["lang-regex",RegExp("^"+B+"("+ht+")")])}var wt=Ee.types;wt&&nt.push([E,wt]);var Bt=(""+Ee.keywords).replace(/^ | $/g,"");Bt.length&&nt.push([D,new RegExp("^(?:"+Bt.replace(/[\s,]+/g,"|")+")\\b"),null]),Be.push([h,/^\s+/,null,` \r
\xA0`]);var Wt="^.[^\\s\\w.$@'\"`/\\\\]*";return Ee.regexLiterals&&(Wt+="(?!s*/)"),nt.push([x,/^@[a-z_$][a-z_$@0-9]*/i,null],[E,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[x,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[g,new RegExp(Wt),null]),fe(Be,nt)}var Se=ve({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ue(Ee,Be,nt){for(var we=/(?:^|\s)nocode(?:\s|$)/,Ne=/\r\n?|\n/,Ye=Ee.ownerDocument,Xe=Ye.createElement("li");Ee.firstChild;)Xe.appendChild(Ee.firstChild);var ht=[Xe];function wt(Qe){var bt=Qe.nodeType;if(bt==1&&!we.test(Qe.className))if(Qe.nodeName==="br")Bt(Qe),Qe.parentNode&&Qe.parentNode.removeChild(Qe);else for(var xt=Qe.firstChild;xt;xt=xt.nextSibling)wt(xt);else if((bt==3||bt==4)&&nt){var ye=Qe.nodeValue,ae=ye.match(Ne);if(ae){var le=ye.substring(0,ae.index);Qe.nodeValue=le;var me=ye.substring(ae.index+ae[0].length);if(me){var Ce=Qe.parentNode;Ce.insertBefore(Ye.createTextNode(me),Qe.nextSibling)}Bt(Qe),le||Qe.parentNode.removeChild(Qe)}}}function Bt(Qe){for(;!Qe.nextSibling;)if(Qe=Qe.parentNode,!Qe)return;function bt(ae,le){var me=le?ae.cloneNode(!1):ae,Ce=ae.parentNode;if(Ce){var de=bt(Ce,1),pe=ae.nextSibling;de.appendChild(me);for(var De=pe;De;De=pe)pe=De.nextSibling,de.appendChild(De)}return me}for(var xt=bt(Qe.nextSibling,0),ye;(ye=xt.parentNode)&&ye.nodeType===1;)xt=ye;ht.push(xt)}for(var Wt=0;Wt<ht.length;++Wt)wt(ht[Wt]);Be===(Be|0)&&ht[0].setAttribute("value",Be);var an=Ye.createElement("ol");an.className="linenums";for(var Yt=Math.max(0,Be-1|0)||0,Wt=0,qe=ht.length;Wt<qe;++Wt)Xe=ht[Wt],Xe.className="L"+(Wt+Yt)%10,Xe.firstChild||Xe.appendChild(Ye.createTextNode("\xA0")),an.appendChild(Xe);Ee.appendChild(an)}function Te(Ee){var Be=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Be=Be&&+Be[1]<=8;var nt=/\n/g,we=Ee.sourceCode,Ne=we.length,Ye=0,Xe=Ee.spans,ht=Xe.length,wt=0,Bt=Ee.decorations,Wt=Bt.length,an=0;Bt[Wt]=Ne;var Yt,qe;for(qe=Yt=0;qe<Wt;)Bt[qe]!==Bt[qe+2]?(Bt[Yt++]=Bt[qe++],Bt[Yt++]=Bt[qe++]):qe+=2;for(Wt=Yt,qe=Yt=0;qe<Wt;){for(var Qe=Bt[qe],bt=Bt[qe+1],xt=qe+2;xt+2<=Wt&&Bt[xt+1]===bt;)xt+=2;Bt[Yt++]=Qe,Bt[Yt++]=bt,qe=xt}Wt=Bt.length=Yt;var ye=Ee.sourceNode,ae="";ye&&(ae=ye.style.display,ye.style.display="none");try{for(var le=null;wt<ht;){var me=Xe[wt],Ce=Xe[wt+2]||Ne,de=Bt[an+2]||Ne,xt=Math.min(Ce,de),pe=Xe[wt+1],De;if(pe.nodeType!==1&&(De=we.substring(Ye,xt))){Be&&(De=De.replace(nt,"\r")),pe.nodeValue=De;var ue=pe.ownerDocument,Me=ue.createElement("span");Me.className=Bt[an+1];var We=pe.parentNode;We.replaceChild(Me,pe),Me.appendChild(pe),Ye<Ce&&(Xe[wt+1]=pe=ue.createTextNode(we.substring(xt,Ce)),We.insertBefore(pe,Me.nextSibling))}Ye=xt,Ye>=Ce&&(wt+=2),Ye>=de&&(an+=2)}}finally{ye&&(ye.style.display=ae)}}var Ie={};function be(Ee,Be){for(var nt=Be.length;--nt>=0;){var we=Be[nt];Ie.hasOwnProperty(we)?X.console&&console.warn("cannot override language handler %s",we):Ie[we]=Ee}}function q(Ee,Be){return Ee&&Ie.hasOwnProperty(Ee)||(Ee=/^\s*</.test(Be)?"default-markup":"default-code"),Ie[Ee]}be(Se,["default-code"]),be(fe([],[[h,/^[^<?]+/],[w,/^<!\w[^>]*(?:>|$)/],[I,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[g,/^(?:<[%?]|[%?]>)/],["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"]),be(fe([[h,/^[\s]+/,null,` \r
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[O,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[W,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[g,/^[=<>\/]+/],["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"]),be(fe([],[[j,/^[\s\S]+/]]),["uq.val"]),be(ve({keywords:f,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),be(ve({keywords:"null,true,false"}),["json"]),be(ve({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),be(ve({keywords:p,cStyleComments:!0}),["java"]),be(ve({keywords:o,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(ve({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(ve({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(ve({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(ve({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(ve({keywords:c,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(fe([],[[S,/^[\s\S]+/]]),["regex"]);function _(Ee){var Be=Ee.langExtension;try{var nt=y(Ee.sourceNode,Ee.pre),we=nt.sourceCode;Ee.sourceCode=we,Ee.spans=nt.spans,Ee.basePos=0,q(Be,we)(Ee),Te(Ee)}catch(Ne){X.console&&console.log(Ne&&Ne.stack||Ne)}}function L(Ee,Be,nt){var we=nt||!1,Ne=Be||null,Ye=document.createElement("div");Ye.innerHTML="<pre>"+Ee+"</pre>",Ye=Ye.firstChild,we&&Ue(Ye,we,!0);var Xe={langExtension:Ne,numberLines:we,sourceNode:Ye,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return _(Xe),Ye.innerHTML}function z(Ee,Be){var nt=Be||document.body,we=nt.ownerDocument||document;function Ne(me){return nt.getElementsByTagName(me)}for(var Ye=[Ne("pre"),Ne("code"),Ne("xmp")],Xe=[],ht=0;ht<Ye.length;++ht)for(var wt=0,Bt=Ye[ht].length;wt<Bt;++wt)Xe.push(Ye[ht][wt]);Ye=null;var Wt=Date;Wt.now||(Wt={now:function(){return+new Date}});var an=0,Yt=/\blang(?:uage)?-([\w.]+)(?!\S)/,qe=/\bprettyprint\b/,Qe=/\bprettyprinted\b/,bt=/pre|xmp/i,xt=/^code$/i,ye=/^(?:pre|code|xmp)$/i,ae={};function le(){for(var me=X.PR_SHOULD_USE_CONTINUATION?Wt.now()+250:Infinity;an<Xe.length&&Wt.now()<me;an++){for(var Ce=Xe[an],de=ae,pe=Ce;pe=pe.previousSibling;){var De=pe.nodeType,ue=(De===7||De===8)&&pe.nodeValue;if(ue?!/^\??prettify\b/.test(ue):De!==3||/\S/.test(pe.nodeValue))break;if(ue){de={},ue.replace(/\b(\w+)=([\w:.%+-]+)/g,function(mr,Qn,yr){de[Qn]=yr});break}}var Me=Ce.className;if((de!==ae||qe.test(Me))&&!Qe.test(Me)){for(var We=!1,lt=Ce.parentNode;lt;lt=lt.parentNode){var Ct=lt.tagName;if(ye.test(Ct)&&lt.className&&qe.test(lt.className)){We=!0;break}}if(!We){Ce.className+=" prettyprinted";var Ot=de.lang;if(!Ot){Ot=Me.match(Yt);var Nt;!Ot&&(Nt=se(Ce))&&xt.test(Nt.tagName)&&(Ot=Nt.className.match(Yt)),Ot&&(Ot=Ot[1])}var ir;if(bt.test(Ce.tagName))ir=1;else{var Jt=Ce.currentStyle,cn=we.defaultView,rn=Jt?Jt.whiteSpace:cn&&cn.getComputedStyle?cn.getComputedStyle(Ce,null).getPropertyValue("white-space"):0;ir=rn&&rn.substring(0,3)==="pre"}var In=de.linenums;(In=In==="true"||+In)||(In=Me.match(/\blinenums\b(?::(\d+))?/),In=In?In[1]&&In[1].length?+In[1]:!0:!1),In&&Ue(Ce,In,ir);var ur={langExtension:Ot,sourceNode:Ce,numberLines:In,pre:ir,sourceCode:null,basePos:null,spans:null,decorations:null};_(ur)}}}an<Xe.length?X.setTimeout(le,250):typeof Ee=="function"&&Ee()}le()}var ee=X.PR={createSimpleLexer:fe,registerLangHandler:be,sourceDecorator:ve,PR_ATTRIB_NAME:W,PR_ATTRIB_VALUE:j,PR_COMMENT:I,PR_DECLARATION:w,PR_KEYWORD:D,PR_LITERAL:x,PR_NOCODE:C,PR_PLAIN:h,PR_PUNCTUATION:g,PR_SOURCE:b,PR_STRING:S,PR_TAG:O,PR_TYPE:E,prettyPrintOne:U?X.prettyPrintOne=L:M=L,prettyPrint:Y=U?X.prettyPrint=z:Y=z},$=X.define;typeof $=="function"&&$.amd&&$("google-code-prettify",[],function(){return ee})})()},STEk:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return be});/*! *****************************************************************************
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 ne=function(q,_){return(ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,z){L.__proto__=z}||function(L,z){for(var ee in z)Object.prototype.hasOwnProperty.call(z,ee)&&(L[ee]=z[ee])})(q,_)};function Q(q,_){function L(){this.constructor=q}ne(q,_),q.prototype=_===null?Object.create(_):(L.prototype=_.prototype,new L)}function U(q,_,L,z){return new(L||(L=Promise))(function(ee,$){function Ee(we){try{nt(z.next(we))}catch(Ne){$(Ne)}}function Be(we){try{nt(z.throw(we))}catch(Ne){$(Ne)}}function nt(we){var Ne;we.done?ee(we.value):(Ne=we.value,Ne instanceof L?Ne:new L(function(Ye){Ye(Ne)})).then(Ee,Be)}nt((z=z.apply(q,_||[])).next())})}function Z(q,_){var L,z,ee,$,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return $={next:Be(0),throw:Be(1),return:Be(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function Be(nt){return function(we){return function(Ne){if(L)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(L=1,z&&(ee=2&Ne[0]?z.return:Ne[0]?z.throw||((ee=z.return)&&ee.call(z),0):z.next)&&!(ee=ee.call(z,Ne[1])).done)return ee;switch(z=0,ee&&(Ne=[2&Ne[0],ee.value]),Ne[0]){case 0:case 1:ee=Ne;break;case 4:return Ee.label++,{value:Ne[1],done:!1};case 5:Ee.label++,z=Ne[1],Ne=[0];continue;case 7:Ne=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ne[0]!==6&&Ne[0]!==2)){Ee=0;continue}if(Ne[0]===3&&(!ee||Ne[1]>ee[0]&&Ne[1]<ee[3])){Ee.label=Ne[1];break}if(Ne[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=Ne;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(Ne);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}Ne=_.call(q,Ee)}catch(Ye){Ne=[6,Ye],z=0}finally{L=ee=0}if(5&Ne[0])throw Ne[1];return{value:Ne[0]?Ne[1]:void 0,done:!0}}([nt,we])}}}function G(){for(var q=0,_=0,L=arguments.length;_<L;_++)q+=arguments[_].length;var z=Array(q),ee=0;for(_=0;_<L;_++)for(var $=arguments[_],Ee=0,Be=$.length;Ee<Be;Ee++,ee++)z[ee]=$[Ee];return z}var M=function(){function q(){}return q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},q.setAttributes=function(_,L){for(var z=0,ee=L;z<ee.length;z++){var $=ee[z],Ee=$[0],Be=$[1];_.setAttribute(Ee,Be)}},q.createRect=function(_,L,z){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",_.toString()),ee.setAttribute("height",L.toString()),z&&q.setAttributes(ee,z),ee},q.createLine=function(_,L,z,ee,$){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",_.toString()),Ee.setAttribute("y1",L.toString()),Ee.setAttribute("x2",z.toString()),Ee.setAttribute("y2",ee.toString()),$&&q.setAttributes(Ee,$),Ee},q.createPolygon=function(_,L){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",_),L&&q.setAttributes(z,L),z},q.createCircle=function(_,L){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(_/2).toString()),z.setAttribute("cy",(_/2).toString()),z.setAttribute("r",_.toString()),L&&q.setAttributes(z,L),z},q.createEllipse=function(_,L,z){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(_/2).toString()),ee.setAttribute("cy",(L/2).toString()),ee.setAttribute("rx",(_/2).toString()),ee.setAttribute("ry",(L/2).toString()),z&&q.setAttributes(ee,z),ee},q.createGroup=function(_){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return _&&q.setAttributes(L,_),L},q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},q.createMarker=function(_,L,z,ee,$,Ee,Be){var nt=document.createElementNS("http://www.w3.org/2000/svg","marker");return q.setAttributes(nt,[["id",_],["orient",L],["markerWidth",z.toString()],["markerHeight",ee.toString()],["refX",$.toString()],["refY",Ee.toString()]]),nt.appendChild(Be),nt},q.createText=function(_){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),_&&q.setAttributes(L,_),L},q.createTSpan=function(_,L){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=_,L&&q.setAttributes(z,L),z},q.createImage=function(_){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return _&&q.setAttributes(L,_),L},q.createPoint=function(_,L){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=_,z.y=L,z},q.createPath=function(_,L){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",_),L&&q.setAttributes(z,L),z},q}(),Y=function(){function q(){}return q.addKey=function(_){q.key=_},Object.defineProperty(q,"isLicensed",{get:function(){return!!q.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(q.key)},enumerable:!1,configurable:!0}),q}(),X=function(){function q(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return q.prototype.rasterize=function(_,L,z){var ee=this;return new Promise(function($){var Ee=z!==void 0?z:document.createElement("canvas");_===null&&(ee.markersOnly=!0,ee.naturalSize=!1);var Be=document.createElementNS("http://www.w3.org/2000/svg","svg");Be.setAttribute("xmlns","http://www.w3.org/2000/svg"),Be.setAttribute("width",L.width.baseVal.valueAsString),Be.setAttribute("height",L.height.baseVal.valueAsString),Be.setAttribute("viewBox","0 0 "+L.viewBox.baseVal.width.toString()+" "+L.viewBox.baseVal.height.toString()),Be.innerHTML=L.innerHTML,ee.naturalSize===!0?(Be.width.baseVal.value=_.naturalWidth,Be.height.baseVal.value=_.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(Be.width.baseVal.value=ee.width,Be.height.baseVal.value=ee.height),Ee.width=Be.width.baseVal.value,Ee.height=Be.height.baseVal.value;var nt=Be.outerHTML,we=Ee.getContext("2d");ee.markersOnly!==!0&&we.drawImage(_,0,0,Ee.width,Ee.height);var Ne=window.URL,Ye=new Image(Ee.width,Ee.height);Ye.setAttribute("crossOrigin","anonymous");var Xe=new Blob([nt],{type:"image/svg+xml"}),ht=Ne.createObjectURL(Xe);Ye.onload=function(){we.drawImage(Ye,0,0),Ne.revokeObjectURL(ht);var wt=Ee.toDataURL(ee.imageType,ee.imageQuality);$(wt)},Ye.src=ht})},q}(),r=function(){},A=function(){function q(_){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+_+"_"}return Object.defineProperty(q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(q.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(q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),q.prototype.addClass=function(_){return this.styleSheet===void 0&&this.addStyleSheet(),_.name=""+this.classNamePrefix+_.localName,this.classes.push(_),this.styleSheet.sheet.insertRule("."+_.name+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length),_},q.prototype.addRule=function(_){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(_),this.styleSheet.sheet.insertRule(_.selector+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length)},q.prototype.addStyleSheet=function(){var _;this.styleSheet=document.createElement("style"),((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).appendChild(this.styleSheet),this.addRule(new m("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new m("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new m("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new f("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new f("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},q.prototype.removeStyleSheet=function(){var _;this.styleSheet&&(((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},q}(),m=function(q,_){this.selector=q,this.style=_},f=function(q,_){this.localName=q,this.style=_},p=function(){function q(_,L,z,ee,$){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=_,this.displayMode=L,this.markerItems=z,this.uiStyleSettings=ee,this.styles=$,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return q.prototype.show=function(_){var L=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,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($){var Ee=document.createElement("div");Ee.className=""+L.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",$.typeName),Ee.innerHTML=$.icon,Ee.addEventListener("click",function(){L.markerToolbarButtonClicked(Ee,$)}),L.buttons.push(Ee),L.markerButtons.push(Ee)}),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 ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<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(ee,'<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()},q.prototype.addButtonClickListener=function(_){this.buttonClickListeners.push(_)},q.prototype.removeButtonClickListener=function(_){this.buttonClickListeners.indexOf(_)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(_),1)},q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var _=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var L=0;L<this.markerButtons.length;L++)L<_||L===_&&this.markerButtons.length-1===_?this.markerButtonBlock.appendChild(this.markerButtons[L]):(L===_&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[L]))}},q.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")},q.prototype.resetButtonStyles=function(){var _=this;this.buttons.forEach(function(L){L.className=L.className.replace(_.uiStyleSettings.toolbarButtonStyleColorsClassName?_.uiStyleSettings.toolbarButtonStyleColorsClassName:_.toolbarButtonStyleColorsClass.name,"").trim(),L.className=L.className.replace(_.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?_.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:_.toolbarActiveButtonStyleColorsClass.name,"").trim(),L.className+=" "+(_.uiStyleSettings.toolbarButtonStyleColorsClassName?_.uiStyleSettings.toolbarButtonStyleColorsClassName:_.toolbarButtonStyleColorsClass.name)})},q.prototype.addActionButton=function(_,L,z){var ee=this,$=document.createElement("div");switch($.className=""+this.toolbarButtonStyleClass.name,$.innerHTML=L,$.setAttribute("data-action",z),$.addEventListener("click",function(){ee.actionToolbarButtonClicked($,z)}),z){case"select":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":$.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":$.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":$.style.fill=this.uiStyleSettings.closeButtonColor}_.appendChild($),this.buttons.push($)},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new f("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 f("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new f("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new f("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 f("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var _=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new f("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
padding: `+_+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new f("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new m("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new m("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},q.prototype.markerToolbarButtonClicked=function(_,L){this.setActiveButton(_),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("marker",L)}),this.markerButtonOverflowBlock.style.display="none"},q.prototype.actionToolbarButtonClicked=function(_,L){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("action",L)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},q.prototype.setActiveButton=function(_){this.resetButtonStyles(),_.className=_.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),_.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},q.prototype.setActiveMarkerButton=function(_){var L=this.markerButtons.find(function(z){return z.getAttribute("data-type-name")===_});L&&this.setActiveButton(L)},q.prototype.setCurrentMarker=function(_){var L=this;this.currentMarker=_,this.buttons.filter(function(z){return/delete|notes/.test(z.getAttribute("data-action"))}).forEach(function(z){L.currentMarker===void 0?(z.style.fillOpacity="0.4",z.style.pointerEvents="none"):(z.style.fillOpacity="1",z.style.pointerEvents="all")})},q}(),a=function(){function q(_,L,z,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=_,this.displayMode=L,this.uiStyleSettings=z,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return q.prototype.addStyles=function(){var _;this.toolboxStyleClass=this.styles.addClass(new f("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 f("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("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 f("toolbox-panel-row_colors",`
background-color: `+((_=this.uiStyleSettings.toolboxBackgroundColor)!==null&&_!==void 0?_:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new f("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new f("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new m("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new m("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},q.prototype.show=function(_){var L;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,this.uiContainer.className=this.toolboxStyleClass.name+" "+((L=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},q.prototype.setPanelButtons=function(_){var L,z,ee=this;this.panels=_,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((L=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&L!==void 0?L: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($){var Ee;$.uiStyleSettings=ee.uiStyleSettings;var Be=document.createElement("div");Be.className=ee.toolboxButtonStyleClass.name+" "+((Ee=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:ee.toolboxButtonStyleColorsClass.name),Be.innerHTML=$.icon,Be.title=$.title,Be.addEventListener("click",function(){ee.panelButtonClick($)}),ee.panelButtons.push(Be),ee.buttonRow.appendChild(Be)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},q.prototype.panelButtonClick=function(_){var L=this,z=-1;if(_!==this.activePanel){z=this.panels.indexOf(_),this.panelRow.innerHTML="";var ee=_.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),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=_}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){L.displayMode==="inline"?L.panelRow.style.display="none":L.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function($,Ee){var Be,nt;$.className=L.toolboxButtonStyleClass.name+" "+(Ee===z?""+((Be=L.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Be!==void 0?Be:L.toolboxActiveButtonStyleColorsClass.name):""+((nt=L.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&nt!==void 0?nt:L.toolboxButtonStyleColorsClass.name))})},q}(),c=function(q,_){this.title=q,this.icon=_},s=function(q){function _(L,z,ee,$){var Ee=q.call(this,L,$||'<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 Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=z,Ee.currentColor=ee,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return Q(_,q),_.prototype.getUi=function(){var L=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var $=L.getColorBox(ee);z.appendChild($),L.colorBoxes.push($)}),z},_.prototype.getColorBox=function(L){var z=this,ee=this.uiStyleSettings.toolbarHeight/4,$=this.uiStyleSettings.toolbarHeight-ee,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=$-2+"px",Ee.style.height=$-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=($+2)/2+"px",Ee.style.borderColor=L===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){z.setCurrentColor(L,Ee)});var Be=document.createElement("div");return Be.style.display="inline-block",Be.style.width=$-2+"px",Be.style.height=$-2+"px",Be.style.backgroundColor=L,Be.style.borderRadius=$/2+"px",L==="transparent"&&(Be.style.fill=this.uiStyleSettings.toolboxAccentColor,Be.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>`),Ee.appendChild(Be),Ee},_.prototype.setCurrentColor=function(L,z){var ee=this;this.currentColor=L,this.colorBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(L)},_}(c),i=function(){function q(_,L,z){this._state="new",this._isSelected=!1,this._container=_,this._overlayContainer=L,this.globalSettings=z,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),q.prototype.ownsTarget=function(_){return!1},Object.defineProperty(q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},q.prototype.pointerDown=function(_,L){},q.prototype.dblClick=function(_,L){},q.prototype.manipulate=function(_){},q.prototype.pointerUp=function(_){this.stateChanged()},q.prototype.dispose=function(){},q.prototype.addMarkerVisualToContainer=function(_){this.container.childNodes.length>0?this.container.insertBefore(_,this.container.childNodes[0]):this.container.appendChild(_)},q.prototype.getState=function(){return{typeName:q.typeName,state:this.state,notes:this.notes}},q.prototype.restoreState=function(_){this._state=_.state,this.notes=_.notes},q.prototype.scale=function(_,L){},q.prototype.colorChanged=function(_){this.onColorChanged&&this.onColorChanged(_),this.stateChanged()},q.prototype.fillColorChanged=function(_){this.onFillColorChanged&&this.onFillColorChanged(_),this.stateChanged()},q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var _=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),_.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(_)&&this.onStateChanged(this)}},q.typeName="MarkerBase",q}(),t=function(){function q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return q.prototype.findGripByVisual=function(_){return this.topLeft.ownsTarget(_)?this.topLeft:this.topCenter.ownsTarget(_)?this.topCenter:this.topRight.ownsTarget(_)?this.topRight:this.centerLeft.ownsTarget(_)?this.centerLeft:this.centerRight.ownsTarget(_)?this.centerRight:this.bottomLeft.ownsTarget(_)?this.bottomLeft:this.bottomCenter.ownsTarget(_)?this.bottomCenter:this.bottomRight.ownsTarget(_)?this.bottomRight:void 0},q}(),u=function(){function q(){this.GRIP_SIZE=10,this.visual=M.createGroup(),this.visual.appendChild(M.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(M.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},q}(),o=function(){function q(){}return q.toITransformMatrix=function(_){return{a:_.a,b:_.b,c:_.c,d:_.d,e:_.e,f:_.f}},q.toSVGMatrix=function(_,L){return _.a=L.a,_.b=L.b,_.c=L.c,_.d=L.d,_.e=L.e,_.f=L.f,_},q}(),R=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.left=0,$.top=0,$.width=0,$.height=0,$.defaultSize={x:50,y:20},$.offsetX=0,$.offsetY=0,$.rotationAngle=0,$.CB_DISTANCE=10,$._suppressMarkerCreateEvent=!1,$.container.transform.baseVal.appendItem(M.createTransform()),$.setupControlBox(),$}return Q(_,q),Object.defineProperty(_.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"visual",{get:function(){return this._visual},set:function(L){this._visual=L;var z=M.createTransform();this._visual.transform.baseVal.appendItem(z)},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(L){return!!q.prototype.ownsTarget.call(this,L)||!!(this.controlGrips.findGripByVisual(L)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(L))},_.prototype.pointerDown=function(L,z){q.prototype.pointerDown.call(this,L,z),this.state==="new"&&(this.left=L.x,this.top=L.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(L);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.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 $=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=$.x-this.width/2,this.top=$.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},_.prototype.pointerUp=function(L){var z=this.state;q.prototype.pointerUp.call(this,L),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(L),this._state="select",z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},_.prototype.moveVisual=function(L){this.visual.style.transform="translate("+L.x+"px, "+L.y+"px)"},_.prototype.manipulate=function(L){var z=this.unrotatePoint(L);this.state==="creating"?this.resize(L):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(L)},_.prototype.resize=function(L){var z=this.manipulationStartLeft,ee=this.manipulationStartWidth,$=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:z=this.manipulationStartLeft+L.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+L.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:$=this.manipulationStartTop+L.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-$;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+L.y-this.manipulationStartY}ee>=0?(this.left=z,this.width=ee):(this.left=z+ee,this.width=-ee),Ee>=0?(this.top=$,this.height=Ee):(this.top=$+Ee,this.height=-Ee),this.setSize()},_.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},_.prototype.rotate=function(L){if(Math.abs(L.x-this.centerX)>.1){var z=Math.sign(L.x-this.centerX);this.rotationAngle=180*Math.atan((L.y-this.centerY)/(L.x-this.centerX))/Math.PI+90*z,this.applyRotation()}},_.prototype.applyRotation=function(){var L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,0)},_.prototype.rotatePoint=function(L){if(this.rotationAngle===0)return L;var z=this.container.getCTM(),ee=M.createPoint(L.x,L.y);return{x:(ee=ee.matrixTransform(z)).x,y:ee.y}},_.prototype.unrotatePoint=function(L){if(this.rotationAngle===0)return L;var z=this.container.getCTM();z=z.inverse();var ee=M.createPoint(L.x,L.y);return{x:(ee=ee.matrixTransform(z)).x,y:ee.y}},_.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=M.createGroup();var L=M.createTransform();L.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(L),this.container.appendChild(this.controlBox),this.controlRect=M.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=M.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 t,this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){var L=this.controlBox.transform.baseVal.getItem(0);L.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(L,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()},_.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()},_.prototype.createGrip=function(){var L=new u;return L.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(L.visual),L},_.prototype.positionGrips=function(){var L=this.controlGrips.topLeft.GRIP_SIZE,z=-L/2,ee=z,$=(this.width+this.CB_DISTANCE)/2-L/2,Ee=(this.height+this.CB_DISTANCE)/2-L/2,Be=this.height+this.CB_DISTANCE-L/2,nt=this.width+this.CB_DISTANCE-L/2;this.positionGrip(this.controlGrips.topLeft.visual,z,ee),this.positionGrip(this.controlGrips.topCenter.visual,$,ee),this.positionGrip(this.controlGrips.topRight.visual,nt,ee),this.positionGrip(this.controlGrips.centerLeft.visual,z,Ee),this.positionGrip(this.controlGrips.centerRight.visual,nt,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,z,Be),this.positionGrip(this.controlGrips.bottomCenter.visual,$,Be),this.positionGrip(this.controlGrips.bottomRight.visual,nt,Be),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,$,ee-3*this.CB_DISTANCE)},_.prototype.positionGrip=function(L,z,ee){var $=L.transform.baseVal.getItem(0);$.setTranslate(z,ee),L.transform.baseVal.replaceItem($,0)},_.prototype.hideControlBox=function(){this.controlBox.style.display="none"},_.prototype.showControlBox=function(){this.controlBox.style.display=""},_.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:o.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:o.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},q.prototype.getState.call(this))},_.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var z=L;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(o.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(o.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,z.containerTransformMatrix))},_.prototype.scale=function(L,z){q.prototype.scale.call(this,L,z);var ee=this.rotatePoint({x:this.left,y:this.top}),$=this.unrotatePoint({x:ee.x*L,y:ee.y*z});this.left=$.x,this.top=$.y,this.width=this.width*L,this.height=this.height*z,this.adjustControlBox()},_}(i),T=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.createVisual=$.createVisual.bind($),$}return Q(_,q),_.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual)},_.prototype.createVisual=function(){this.visual=M.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)},_.prototype.pointerDown=function(L,z){q.prototype.pointerDown.call(this,L,z),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},_.prototype.manipulate=function(L){q.prototype.manipulate.call(this,L)},_.prototype.resize=function(L){q.prototype.resize.call(this,L),this.setSize()},_.prototype.setSize=function(){q.prototype.setSize.call(this),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(L){q.prototype.pointerUp.call(this,L),this.setSize()},_.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},_.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},_.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this))},_.prototype.restoreState=function(L){var z=L;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),q.prototype.restoreState.call(this,L),this.setSize()},_.prototype.scale=function(L,z){q.prototype.scale.call(this,L,z),this.setSize()},_.title="Rectangle marker",_}(R),S=function(q){function _(L,z,ee,$){var Ee=q.call(this,L,$||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=z,Ee.currentWidth=ee,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return Q(_,q),_.prototype.getUi=function(){var L=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.widths.forEach(function(ee){var $=document.createElement("div");$.style.display="flex",$.style.flexGrow="2",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=ee===L.currentWidth?L.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){L.setCurrentWidth(ee,$)}),z.appendChild($);var Ee=document.createElement("div");Ee.innerText=ee.toString(),Ee.style.marginRight="5px",$.appendChild(Ee);var Be=document.createElement("div");Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.display="flex",Be.style.alignItems="center";var nt=document.createElement("hr");nt.style.minWidth="20px",nt.style.border="0px",nt.style.borderTop=ee+"px solid "+L.uiStyleSettings.toolboxColor,nt.style.flexGrow="2",Be.appendChild(nt),$.appendChild(Be),L.widthBoxes.push($)}),z},_.prototype.setCurrentWidth=function(L,z){var ee=this;this.currentWidth=L,this.widthBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},_}(c),D=function(q){function _(L,z,ee,$){var Ee=q.call(this,L,$||'<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 Ee.styles=[],Ee.styleBoxes=[],Ee.styles=z,Ee.currentStyle=ee,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return Q(_,q),_.prototype.getUi=function(){var L=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.styles.forEach(function(ee){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/L.styles.length-5+"%",$.style.borderColor=ee===L.currentStyle?L.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){L.setCurrentStyle(ee,$)}),z.appendChild($);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var Be=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+L.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
</svg>`;Ee.innerHTML=Be,$.appendChild(Ee),L.styleBoxes.push($)}),z},_.prototype.setCurrentStyle=function(L,z){var ee=this;this.currentStyle=L,this.styleBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},_}(c),I=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.strokeColor=ee.defaultColor,$.strokeWidth=ee.defaultStrokeWidth,$.strokeDasharray=ee.defaultStrokeDasharray,$.strokePanel=new s("Line color",ee.defaultColorSet,ee.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new S("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new D("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Q(_,q),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=_.typeName,L},_.typeName="FrameMarker",_.title="Frame marker",_.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',_}(T),E=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},x=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.x1=0,$.y1=0,$.x2=0,$.y2=0,$.defaultLength=50,$.manipulationStartX=0,$.manipulationStartY=0,$.manipulationStartX1=0,$.manipulationStartY1=0,$.manipulationStartX2=0,$.manipulationStartY2=0,$.setupControlBox(),$}return Q(_,q),_.prototype.ownsTarget=function(L){return!!q.prototype.ownsTarget.call(this,L)||!(!this.grip1.ownsTarget(L)&&!this.grip2.ownsTarget(L))},_.prototype.pointerDown=function(L,z){q.prototype.pointerDown.call(this,L,z),this.manipulationStartX=L.x,this.manipulationStartY=L.y,this.state==="new"&&(this.x1=L.x,this.y1=L.y,this.x2=L.x,this.y2=L.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")},_.prototype.pointerUp=function(L){var z=this.state;q.prototype.pointerUp.call(this,L),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(L),this._state="select",z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},_.prototype.adjustVisual=function(){},_.prototype.manipulate=function(L){this.state==="creating"?this.resize(L):this.state==="move"?(this.x1=this.manipulationStartX1+L.x-this.manipulationStartX,this.y1=this.manipulationStartY1+L.y-this.manipulationStartY,this.x2=this.manipulationStartX2+L.x-this.manipulationStartX,this.y2=this.manipulationStartY2+L.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(L)},_.prototype.resize=function(L){switch(this.activeGrip){case this.grip1:this.x1=L.x,this.y1=L.y;break;case this.grip2:case void 0:this.x2=L.x,this.y2=L.y}this.adjustVisual(),this.adjustControlBox()},_.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=M.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){this.positionGrips()},_.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},_.prototype.createGrip=function(){var L=new u;return L.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(L.visual),L},_.prototype.positionGrips=function(){var L=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-L/2,this.y1-L/2),this.positionGrip(this.grip2.visual,this.x2-L/2,this.y2-L/2)},_.prototype.positionGrip=function(L,z,ee){var $=L.transform.baseVal.getItem(0);$.setTranslate(z,ee),L.transform.baseVal.replaceItem($,0)},_.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},q.prototype.getState.call(this))},_.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var z=L;this.x1=z.x1,this.y1=z.y1,this.x2=z.x2,this.y2=z.y2},_.prototype.scale=function(L,z){q.prototype.scale.call(this,L,z),this.x1=this.x1*L,this.y1=this.y1*z,this.x2=this.x2*L,this.y2=this.y2*z,this.adjustVisual(),this.adjustControlBox()},_}(i),g=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.strokeColor=ee.defaultColor,$.strokeWidth=ee.defaultStrokeWidth,$.strokeDasharray=ee.defaultStrokeDasharray,$.strokePanel=new s("Line color",ee.defaultColorSet,ee.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new S("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new D("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Q(_,q),_.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorLine&&L!==this.visibleLine)},_.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorLine=M.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=M.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)},_.prototype.pointerDown=function(L,z){q.prototype.pointerDown.call(this,L,z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},_.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()),M.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},_.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},_.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},q.prototype.getState.call(this));return L.typeName=_.typeName,L},_.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var z=L;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.createVisual(),this.adjustVisual()},_.typeName="LineMarker",_.title="Line marker",_.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',_}(x),h=function(q){function _(L,z,ee,$){var Ee=q.call(this,L,$||'<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 Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=z,Ee.currentFont=ee,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return Q(_,q),_.prototype.getUi=function(){var L=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.flexGrow="2",this.fonts.forEach(function(ee){var $=document.createElement("div");$.style.display="inline-block",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/L.fonts.length-5+"%",$.style.borderColor=ee===L.currentFont?L.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){L.setCurrentFont(ee,$)}),z.appendChild($);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=ee,Ee.style.overflow="hidden";var Be=document.createElement("div");Be.style.whiteSpace="nowrap",Be.style.overflow="hidden",Be.style.textOverflow="ellipsis",Be.innerHTML="The quick brown fox jumps over the lazy dog",Ee.appendChild(Be),$.appendChild(Ee),L.fontBoxes.push($)}),z},_.prototype.setCurrentFont=function(L,z){var ee=this;this.currentFont=L,this.fontBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},_}(c),O=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.color="transparent",$.padding=5,$.DEFAULT_TEXT="your text here",$.text=$.DEFAULT_TEXT,$.isMoved=!1,$.color=ee.defaultColor,$.fontFamily=ee.defaultFontFamily,$.defaultSize={x:100,y:30},$.setColor=$.setColor.bind($),$.setFont=$.setFont.bind($),$.renderText=$.renderText.bind($),$.sizeText=$.sizeText.bind($),$.textEditDivClicked=$.textEditDivClicked.bind($),$.showTextEditor=$.showTextEditor.bind($),$.setSize=$.setSize.bind($),$.positionTextEditor=$.positionTextEditor.bind($),$.colorPanel=new s("Color",ee.defaultColorSet,ee.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.fontFamilyPanel=new h("Font",ee.defaultFontFamilies,ee.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$}return Q(_,q),_.prototype.ownsTarget=function(L){if(q.prototype.ownsTarget.call(this,L)||L===this.visual||L===this.textElement||L===this.bgRectangle)return!0;var z=!1;return this.textElement.childNodes.forEach(function(ee){ee===L&&(z=!0)}),z},_.prototype.createVisual=function(){this.visual=M.createGroup(),this.bgRectangle=M.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=M.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},_.prototype.pointerDown=function(L,z){q.prototype.pointerDown.call(this,L,z),this.isMoved=!1,this.pointerDownPoint=L,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},_.prototype.renderText=function(){var L=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){L.textElement.appendChild(M.createTSpan(z.trim()===""?" ":z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},_.prototype.getTextScale=function(){var L=this.textElement.getBBox(),z=1;if(L.width>0&&L.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/L.width,$=(1*this.height-this.height*this.padding*2/100)/L.height;z=Math.min(ee,$)}return z},_.prototype.getTextPosition=function(L){var z=this.textElement.getBBox(),ee=0,$=0;return z.width>0&&z.height>0&&(ee=(this.width-z.width*L)/2,$=this.height/2-z.height*L/2),{x:ee,y:$}},_.prototype.sizeText=function(){var L=this.textElement.getBBox(),z=this.getTextScale(),ee=this.getTextPosition(z);ee.y-=L.y*z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+z+", "+z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(z,z))},_.prototype.manipulate=function(L){q.prototype.manipulate.call(this,L),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(L.x-this.pointerDownPoint.x)>5||Math.abs(L.y-this.pointerDownPoint.y)>5)},_.prototype.resize=function(L){q.prototype.resize.call(this,L),this.isMoved=!0,this.setSize(),this.sizeText()},_.prototype.setSize=function(){q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},_.prototype.pointerUp=function(L){var z=this.state;z==="creating"&&(this._suppressMarkerCreateEvent=!0),q.prototype.pointerUp.call(this,L),this.setSize(),(z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},_.prototype.showTextEditor=function(){var L=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(L.textEditor.style.fontSize);L.textEditor.clientWidth>=Number.parseInt(L.textEditor.style.maxWidth)&&z>.9;)z-=.1,L.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 ee=z.clipboardData.getData("text"),$=window.getSelection();if(!$.rangeCount)return!1;$.deleteFromDocument(),$.getRangeAt(0).insertNode(document.createTextNode(ee)),z.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){L.textEditDivClicked(L.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},_.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var L=this.getTextScale(),z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),$={x:ee.width*L,y:ee.height*L};z.x-=$.x/2,z.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*L,12)+"px",this.textElement.style.display="none"}},_.prototype.textEditDivClicked=function(L){this.text=L.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},_.prototype.select=function(){q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},_.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),q.prototype.deselect.call(this)},_.prototype.dblClick=function(L,z){q.prototype.dblClick.call(this,L,z),this.showTextEditor()},_.prototype.setColor=function(L){this.textElement&&M.setAttributes(this.textElement,[["fill",L]]),this.color=L,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(L)},_.prototype.setFont=function(L){this.textElement&&M.setAttributes(this.textElement,[["font-family",L]]),this.fontFamily=L,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},_.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},_.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},q.prototype.getState.call(this));return L.typeName=_.typeName,L},_.prototype.restoreState=function(L){var z=L;this.color=z.color,this.fontFamily=z.fontFamily,this.padding=z.padding,this.text=z.text,this.createVisual(),q.prototype.restoreState.call(this,L),this.setSize()},_.prototype.scale=function(L,z){q.prototype.scale.call(this,L,z),this.setSize(),this.sizeText(),this.positionTextEditor()},_.typeName="TextMarker",_.title="Text marker",_.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>',_}(R),w=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.color="transparent",$.lineWidth=3,$.drawing=!1,$.pixelRatio=1,$.color=ee.defaultColor,$.lineWidth=ee.defaultStrokeWidth,$.pixelRatio=ee.freehandPixelRatio,$.setColor=$.setColor.bind($),$.addCanvas=$.addCanvas.bind($),$.finishCreation=$.finishCreation.bind($),$.setLineWidth=$.setLineWidth.bind($),$.colorPanel=new s("Color",ee.defaultColorSet,ee.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.lineWidthPanel=new S("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.lineWidthPanel.onWidthChanged=$.setLineWidth,$}return Q(_,q),_.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.drawingImage)},_.prototype.createVisual=function(){this.visual=M.createGroup(),this.drawingImage=M.createImage(),this.visual.appendChild(this.drawingImage);var L=M.createTransform();this.visual.transform.baseVal.appendItem(L),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(L,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(L.x,L.y),this.drawing=!0):q.prototype.pointerDown.call(this,L,z)},_.prototype.manipulate=function(L){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(L.x,L.y),this.canvasContext.stroke()):q.prototype.manipulate.call(this,L)},_.prototype.resize=function(L){q.prototype.resize.call(this,L),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(L){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):q.prototype.pointerUp.call(this,L)},_.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},_.prototype.select=function(){this.state==="creating"&&this.finishCreation(),q.prototype.select.call(this)},_.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),q.prototype.deselect.call(this)},_.prototype.finishCreation=function(){for(var L=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=z[0],$=z[1],Ee=z[2],Be=z[3],nt=!1,we=0;we<this.canvasElement.height;we++)for(var Ne=0;Ne<this.canvasElement.width;Ne++)L.data[we*this.canvasElement.width*4+4*Ne+3]>0&&(nt=!0,we<$&&($=we),Ne<ee&&(ee=Ne),we>Be&&(Be=we),Ne>Ee&&(Ee=Ne));if(nt){this.left=ee/this.pixelRatio,this.top=$/this.pixelRatio,this.width=(Ee-ee)/this.pixelRatio,this.height=(Be-$)/this.pixelRatio;var Ye=document.createElement("canvas");Ye.width=Ee-ee,Ye.height=Be-$,Ye.getContext("2d").putImageData(this.canvasContext.getImageData(ee,$,Ee-ee,Be-$),0,0),this.drawingImgUrl=Ye.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},_.prototype.setDrawingImage=function(){M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},_.prototype.setColor=function(L){this.color=L,this.colorChanged(L)},_.prototype.setLineWidth=function(L){this.lineWidth=L},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=Object.assign({drawingImgUrl:this.drawingImgUrl},q.prototype.getState.call(this));return L.typeName=_.typeName,L},_.prototype.restoreState=function(L){this.createVisual(),q.prototype.restoreState.call(this,L),this.drawingImgUrl=L.drawingImgUrl,this.setDrawingImage()},_.prototype.scale=function(L,z){q.prototype.scale.call(this,L,z),this.setDrawingImage()},_.typeName="FreehandMarker",_.title="Freehand marker",_.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>',_}(R),b=function(q){function _(L,z,ee){var $=q.call(this,L,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return $.typeBoxes=[],$.currentType=z,$.setCurrentType=$.setCurrentType.bind($),$}return Q(_,q),_.prototype.getUi=function(){var L=this,z=document.createElement("div");z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2";for(var ee=function(Be){var nt="both";switch(Be){case 0:nt="both";break;case 1:nt="start";break;case 2:nt="end";break;case 3:nt="none"}var we=document.createElement("div");if(we.style.display="flex",we.style.flexGrow="2",we.style.alignItems="center",we.style.justifyContent="space-between",we.style.padding="5px",we.style.borderWidth="2px",we.style.borderStyle="solid",we.style.borderColor=nt===$.currentType?$.uiStyleSettings.toolboxAccentColor:"transparent",we.addEventListener("click",function(){L.setCurrentType(nt,we)}),z.appendChild(we),nt==="both"||nt==="start"){var Ne=document.createElement("div");Ne.style.display="flex",Ne.style.alignItems="center",Ne.style.minHeight="20px",Ne.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ne.style.marginLeft="5px",we.appendChild(Ne)}var Ye=document.createElement("div");Ye.style.display="flex",Ye.style.alignItems="center",Ye.style.minHeight="20px",Ye.style.flexGrow="2";var Xe=document.createElement("hr");if(Xe.style.minWidth="20px",Xe.style.border="0px",Xe.style.borderTop="3px solid "+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee"),Xe.style.flexGrow="2",Ye.appendChild(Xe),we.appendChild(Ye),nt==="both"||nt==="end"){var ht=document.createElement("div");ht.style.display="flex",ht.style.alignItems="center",ht.style.minHeight="20px",ht.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="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ht.style.marginRight="5px",we.appendChild(ht)}$.typeBoxes.push(we)},$=this,Ee=0;Ee<4;Ee++)ee(Ee);return z},_.prototype.setCurrentType=function(L,z){var ee=this;this.currentType=L,this.typeBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},_}(c),W=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.arrowType="end",$.arrowBaseHeight=10,$.arrowBaseWidth=10,$.getArrowPoints=$.getArrowPoints.bind($),$.setArrowType=$.setArrowType.bind($),$.arrowTypePanel=new b("Arrow type","end"),$.arrowTypePanel.onArrowTypeChanged=$.setArrowType,$}return Q(_,q),_.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.arrow1&&L!==this.arrow2)},_.prototype.getArrowPoints=function(L,z){var ee=this.arrowBaseWidth+2*this.strokeWidth,$=this.arrowBaseHeight+2*this.strokeWidth;return L-ee/2+","+(z+$/2)+" "+L+","+(z-$/2)+" "+(L+ee/2)+","+(z+$/2)},_.prototype.createTips=function(){this.arrow1=M.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=M.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow2)},_.prototype.pointerDown=function(L,z){q.prototype.pointerDown.call(this,L,z),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(q.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",M.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),M.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var L=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(L,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(z,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(L+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},_.prototype.setArrowType=function(L){this.arrowType=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=Object.assign({arrowType:this.arrowType},q.prototype.getState.call(this));return L.typeName=_.typeName,L},_.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var z=L;this.arrowType=z.arrowType,this.createTips(),this.adjustVisual()},_.typeName="ArrowMarker",_.title="Arrow marker",_.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',_}(g),j=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.fillColor=ee.defaultFillColor,$.strokeWidth=0,$.fillPanel=new s("Color",ee.defaultColorSet,ee.defaultFillColor),$.fillPanel.onColorChanged=$.setFillColor,$}return Q(_,q),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=_.typeName,L},_.typeName="CoverMarker",_.title="Cover marker",_.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',_}(T),C=function(q){function _(L,z,ee,$){var Ee=q.call(this,L,$||'<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 Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=z,Ee.currentOpacity=ee,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return Q(_,q),_.prototype.getUi=function(){var L=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(ee){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="center",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=ee===L.currentOpacity?L.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){L.setCurrentOpacity(ee,$)}),z.appendChild($);var Ee=document.createElement("div");Ee.innerText=100*ee+"%",$.appendChild(Ee),L.opacityBoxes.push($)}),z},_.prototype.setCurrentOpacity=function(L,z){var ee=this;this.currentOpacity=L,this.opacityBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},_}(c),B=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.setOpacity=$.setOpacity.bind($),$.fillColor=ee.defaultHighlightColor,$.strokeWidth=0,$.opacity=ee.defaultHighlightOpacity,$.fillPanel=new s("Color",ee.defaultColorSet,$.fillColor),$.fillPanel.onColorChanged=$.setFillColor,$.opacityPanel=new C("Opacity",ee.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Q(_,q),_.prototype.setOpacity=function(L){this.opacity=L,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=_.typeName,L},_.typeName="HighlightMarker",_.title="Highlight marker",_.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>',_}(j),k='<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>',y=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.bgColor="transparent",$.tipPosition={x:0,y:0},$.tipBase1Position={x:0,y:0},$.tipBase2Position={x:0,y:0},$.tipMoving=!1,$.color=ee.defaultStrokeColor,$.bgColor=ee.defaultFillColor,$.fontFamily=ee.defaultFontFamily,$.defaultSize={x:100,y:30},$.setBgColor=$.setBgColor.bind($),$.getTipPoints=$.getTipPoints.bind($),$.positionTip=$.positionTip.bind($),$.setTipPoints=$.setTipPoints.bind($),$.colorPanel=new s("Text color",ee.defaultColorSet,$.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>'),$.colorPanel.onColorChanged=$.setColor,$.bgColorPanel=new s("Fill color",ee.defaultColorSet,$.bgColor,k),$.bgColorPanel.onColorChanged=$.setBgColor,$.fontFamilyPanel=new h("Font",ee.defaultFontFamilies,ee.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$.tipGrip=new u,$.tipGrip.visual.transform.baseVal.appendItem(M.createTransform()),$.controlBox.appendChild($.tipGrip.visual),$}return Q(_,q),_.prototype.ownsTarget=function(L){return q.prototype.ownsTarget.call(this,L)||this.tipGrip.ownsTarget(L)||this.tip===L},_.prototype.createTip=function(){M.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=M.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},_.prototype.pointerDown=function(L,z){this.state==="new"&&q.prototype.pointerDown.call(this,L,z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):q.prototype.pointerDown.call(this,L,z)},_.prototype.pointerUp=function(L){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,q.prototype.pointerUp.call(this,L);else{var z=this.state==="creating";q.prototype.pointerUp.call(this,L),this.setTipPoints(z),this.positionTip()}},_.prototype.manipulate=function(L){if(this.tipMoving){var z=this.unrotatePoint(L);this.tipPosition={x:z.x-this.manipulationStartLeft,y:z.y-this.manipulationStartTop},this.positionTip()}else q.prototype.manipulate.call(this,L)},_.prototype.setBgColor=function(L){this.bgRectangle&&this.tip&&(M.setAttributes(this.bgRectangle,[["fill",L]]),M.setAttributes(this.tip,[["fill",L]])),this.bgColor=L,this.fillColorChanged(L)},_.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},_.prototype.setTipPoints=function(L){L===void 0&&(L=!1);var z=Math.min(this.height/2,15),ee=this.height/5;L&&(this.tipPosition={x:z+ee/2,y:this.height+20});var $=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:0},this.tipBase2Position={x:z+ee,y:0}):(this.tipBase1Position={x:0,y:z},this.tipBase2Position={x:0,y:z+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ee,y:0},this.tipBase2Position={x:this.width-z,y:0}):(this.tipBase1Position={x:this.width,y:z},this.tipBase2Position={x:this.width,y:z+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?$<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ee,y:this.height},this.tipBase2Position={x:this.width-z,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-z-ee},this.tipBase2Position={x:this.width,y:this.height-z}):$<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:this.height},this.tipBase2Position={x:z+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-z},this.tipBase2Position={x:0,y:this.height-z-ee})},_.prototype.resize=function(L){q.prototype.resize.call(this,L),this.positionTip()},_.prototype.positionTip=function(){M.setAttributes(this.tip,[["points",this.getTipPoints()]]);var L=this.tipGrip.visual.transform.baseVal.getItem(0);L.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(L,0)},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.select=function(){this.positionTip(),q.prototype.select.call(this)},_.prototype.getState=function(){var L=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},q.prototype.getState.call(this));return L.typeName=_.typeName,L},_.prototype.restoreState=function(L){var z=L;this.bgColor=z.bgColor,this.tipPosition=z.tipPosition,q.prototype.restoreState.call(this,L),this.createTip(),this.setTipPoints()},_.prototype.scale=function(L,z){q.prototype.scale.call(this,L,z),this.tipPosition={x:this.tipPosition.x*L,y:this.tipPosition.y*z},this.positionTip()},_.typeName="CalloutMarker",_.title="Callout marker",_.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>',_}(O),H=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.strokeColor=ee.defaultColor,$.strokeWidth=ee.defaultStrokeWidth,$.strokeDasharray=ee.defaultStrokeDasharray,$.fillColor=ee.defaultFillColor,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.setOpacity=$.setOpacity.bind($),$.createVisual=$.createVisual.bind($),$.strokePanel=new s("Line color",G(ee.defaultColorSet,["transparent"]),ee.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.fillPanel=new s("Fill color",G(ee.defaultColorSet,["transparent"]),$.fillColor,k),$.fillPanel.onColorChanged=$.setFillColor,$.strokeWidthPanel=new S("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new D("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$.opacityPanel=new C("Opacity",ee.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Q(_,q),_.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual)},_.prototype.createVisual=function(){this.visual=M.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)},_.prototype.pointerDown=function(L,z){q.prototype.pointerDown.call(this,L,z),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},_.prototype.manipulate=function(L){q.prototype.manipulate.call(this,L)},_.prototype.resize=function(L){q.prototype.resize.call(this,L),this.setSize()},_.prototype.setSize=function(){q.prototype.setSize.call(this),M.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},_.prototype.pointerUp=function(L){q.prototype.pointerUp.call(this,L),this.setSize()},_.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},_.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(L),this.stateChanged()},_.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.setOpacity=function(L){this.opacity=L,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this));return L.typeName=_.typeName,L},_.prototype.restoreState=function(L){var z=L;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),q.prototype.restoreState.call(this,L),this.setSize()},_.prototype.scale=function(L,z){q.prototype.scale.call(this,L,z),this.setSize()},_.typeName="EllipseMarker",_.title="Ellipse marker",_.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>',_}(R),J=function(q){function _(L,z,ee){return q.call(this,L,z,ee)||this}return Q(_,q),Object.defineProperty(_.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.tip1&&L!==this.tip2)},_.prototype.createTips=function(){this.tip1=M.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(M.createTransform()),this.visual.appendChild(this.tip1),this.tip2=M.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(M.createTransform()),this.visual.appendChild(this.tip2)},_.prototype.pointerDown=function(L,z){q.prototype.pointerDown.call(this,L,z),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(M.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()]]),M.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 L=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(L,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(z,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(L+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=_.typeName,L},_.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L),this.createTips(),this.adjustVisual()},_.typeName="MeasurementMarker",_.title="Measurement marker",_.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>',_}(g),se=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.strokePanel.colors=ee.defaultColorSet,$.fillColor="transparent",$}return Q(_,q),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=_.typeName,L},_.typeName="EllipseFrameMarker",_.title="Ellipse frame marker",_.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>',_}(H),fe=function(){function q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),q.prototype.addUndoStep=function(_){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(_)||(this.undoStack.push(_),JSON.stringify(this.lastRedoStep)!==JSON.stringify(_)&&this.redoStack.splice(0,this.redoStack.length))},q.prototype.replaceLastUndoStep=function(_){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=_)},q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},q.prototype.undo=function(){if(this.undoStack.length>1){var _=this.undoStack.pop();return _!==void 0&&this.redoStack.push(_),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},q}(),ve=function(q){function _(L,z,ee){var $=q.call(this,L,z,ee)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.curveX=0,$.curveY=0,$.manipulationStartCurveX=0,$.manipulationStartCurveY=0,$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.positionGrips=$.positionGrips.bind($),$.addControlGrips=$.addControlGrips.bind($),$.adjustVisual=$.adjustVisual.bind($),$.setupControlBox=$.setupControlBox.bind($),$.resize=$.resize.bind($),$.strokeColor=ee.defaultColor,$.strokeWidth=ee.defaultStrokeWidth,$.strokeDasharray=ee.defaultStrokeDasharray,$.strokePanel=new s("Line color",ee.defaultColorSet,ee.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new S("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new D("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Q(_,q),_.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorCurve&&L!==this.visibleCurve&&!this.curveGrip.ownsTarget(L))},_.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},_.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorCurve=M.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=M.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)},_.prototype.pointerDown=function(L,z){q.prototype.pointerDown.call(this,L,z),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=L.x,this.curveY=L.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(z)&&(this.activeGrip=this.curveGrip,this._state="resize")},_.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),M.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setupControlBox=function(){q.prototype.setupControlBox.call(this),this.curveControlLine1=M.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=M.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)},_.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,q.prototype.addControlGrips.call(this)},_.prototype.positionGrips=function(){q.prototype.positionGrips.call(this);var L=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-L/2,this.curveY-L/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()))},_.prototype.manipulate=function(L){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+L.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+L.y-this.manipulationStartY),q.prototype.manipulate.call(this,L)},_.prototype.resize=function(L){this.activeGrip===this.curveGrip&&(this.curveX=L.x,this.curveY=L.y),q.prototype.resize.call(this,L),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},_.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},_.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},_.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual()},_.prototype.scale=function(L,z){this.curveX=this.curveX*L,this.curveY=this.curveY*z,q.prototype.scale.call(this,L,z)},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},q.prototype.getState.call(this));return L.typeName=_.typeName,L},_.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var z=L;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.curveX=z.curveX,this.curveY=z.curveY,this.createVisual(),this.adjustVisual()},_.typeName="CurveMarker",_.title="Curve marker",_.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>',_}(x),Se=function(){function q(_,L){L===void 0&&(L=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=_,this.cancelable=L}return Object.defineProperty(q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),q.prototype.preventDefault=function(){this._defaultPrevented=!0},q}(),Ue=function(q){function _(L,z,ee){var $=q.call(this,L,!1)||this;return $.dataUrl=z,$.state=ee,$}return Q(_,q),_}(Se),Te=function(q){function _(L,z,ee){ee===void 0&&(ee=!1);var $=q.call(this,L,ee)||this;return $.marker=z,$}return Q(_,q),_}(Se),Ie=function(){function q(){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 q.prototype.addEventListener=function(_,L){this[_].push(L)},q.prototype.removeEventListener=function(_,L){var z=this[_].indexOf(L);z>-1&&this[_].splice(z,1)},q}(),be=function(){function q(_){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new E,this._isOpen=!1,this.undoRedoManager=new fe,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 Ie,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=q.instanceCounter++,this.styles=new A(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=_,this.targetRoot=document.body,this.width=_.clientWidth,this.height=_.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(q.prototype,"ALL_MARKER_TYPES",{get:function(){return[I,w,W,O,se,H,B,y,J,j,g,ve]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[I,w,W,O,H,B,y]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[I,w,W,O,B]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(_){var L=this;this._availableMarkerTypes.splice(0),_.forEach(function(z){if(typeof z=="string"){var ee=L.ALL_MARKER_TYPES.find(function($){return $.typeName===z});ee!==void 0&&L._availableMarkerTypes.push(ee)}else L._availableMarkerTypes.push(z)})},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(_){this._zoomLevel=_,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(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Y.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},q.prototype.show=function(){var _=this;this.styles.styleSheetRoot===void 0&&r.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=r.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(L){return L(new Se(_))})},q.prototype.render=function(){return U(this,void 0,void 0,function(){var _;return Z(this,function(L){switch(L.label){case 0:return this.setCurrentMarker(),(_=new X).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.markersOnly=this.renderMarkersOnly,_.width=this.renderWidth,_.height=this.renderHeight,[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return L.sent(),[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,L.sent()]}})})},q.prototype.close=function(_){var L=this;if(_===void 0&&(_=!1),this.isOpen){var z=!1;_||this.eventListeners.beforeclose.forEach(function(ee){var $=new Se(L,!0);ee($),$.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(ee){return ee(new Se(L))}),this.detachEvents(),this._isOpen=!1)}},q.prototype.addMarkersToToolbar=function(){for(var _,L=[],z=0;z<arguments.length;z++)L[z]=arguments[z];(_=this._availableMarkerTypes).push.apply(_,L)},q.prototype.addRenderEventListener=function(_){this.addEventListener("render",function(L){_(L.dataUrl,L.state)})},q.prototype.removeRenderEventListener=function(_){},q.prototype.addCloseEventListener=function(_){this.addEventListener("close",function(){_()})},q.prototype.removeCloseEventListener=function(_){},q.prototype.setupResizeObserver=function(){var _=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){_.resize(_.target.clientWidth,_.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return _.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupTargetResize=function(){var _=1*this.target.clientWidth/this.target.clientHeight,L=this.editorCanvas.clientWidth/_>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*_:this.editorCanvas.clientWidth,z=L<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/_;this.resize(L,z)},q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},q.prototype.resize=function(_,L){this._isResizing=!0;var z=_/this.imageWidth,ee=L/this.imageHeight;this.imageWidth=Math.round(_),this.imageHeight=Math.round(L),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,ee),this._isResizing=!1},q.prototype.scaleMarkers=function(_,L){var z,ee=this;this._currentMarker&&this._currentMarker instanceof O?this._currentMarker.scale(_,L):(z=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function($){$!==ee._currentMarker&&$.scale(_,L)}),z!==void 0&&this.setCurrentMarker(z)},q.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"},q.prototype.setTopLeft=function(){var _=this.editingTarget.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=_.left-L.left,this.top=_.top-L.top},q.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)},q.prototype.addDefs=function(){for(var _,L=[],z=0;z<arguments.length;z++)L[z]=arguments[z];this.defs=M.createDefs(),this.addDefsToImage(),(_=this.defs).append.apply(_,L)},q.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},q.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)},q.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},q.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},q.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)},q.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},q.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)},q.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 _=document.createElement("a");_.href="https://markerjs.com/",_.target="_blank",_.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>',_.title="Powered by marker.js",_.style.display="grid",_.style.alignItems="center",_.style.justifyItems="center",_.style.padding="3px",_.style.width="20px",_.style.height="20px",this.logoUI.appendChild(_),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},q.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")},q.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"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.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 _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"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 p(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 a(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},q.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.removeMarker=function(_){this.markerImage.removeChild(_.container),this.markers.indexOf(_)>-1&&this.markers.splice(this.markers.indexOf(_),1),_.dispose()},q.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())},q.prototype.toolbarButtonClicked=function(_,L){if(_==="marker"&&L!==void 0)this.createNewMarker(L);else if(_==="action")switch(L){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()}},q.prototype.deleteSelectedMarker=function(){var _=this;if(this._currentMarker!==void 0){var L=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var $=new Te(_,_._currentMarker,!0);ee($),$.defaultPrevented&&(L=!0)}),!L){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(ee){return ee(new Te(_,z))})}}},q.prototype.clear=function(){var _=this,L=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var Be=new Te(_,void 0,!0);Ee(Be),Be.defaultPrevented&&(L=!0)}),!L)){this.setCurrentMarker();for(var z=function(Ee){var Be=ee.markers[Ee];ee.setCurrentMarker(ee.markers[Ee]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(nt){return nt(new Te(_,Be))})},ee=this,$=this.markers.length-1;$>=0;$--)z($);this.addUndoStep()}},Object.defineProperty(q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),q.prototype.showNotesEditor=function(){var _;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=(_=this._currentMarker.notes)!==null&&_!==void 0?_:"",this.overlayContainer.appendChild(this.notesArea))},q.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)},q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},q.prototype.addUndoStep=function(){var _=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var L=this.getState(),z=this.undoRedoManager.getLastUndoStep();if(!z||z.width===L.width&&z.height===L.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(L),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function($){return $(new Se(_))})}else this.undoRedoManager.replaceLastUndoStep(L),this.eventListeners.statechange.forEach(function($){return $(new Se(_))})}},q.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},q.prototype.undoStep=function(){var _=this,L=this.undoRedoManager.undo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new Se(_))}))},q.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},q.prototype.redoStep=function(){var _=this,L=this.undoRedoManager.redo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new Se(_))}))},q.prototype.stepZoom=function(){var _=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=_<this.zoomSteps.length-1?this.zoomSteps[_+1]:this.zoomSteps[0]},q.prototype.panTo=function(_){this.contentDiv.scrollBy({left:this.prevPanPoint.x-_.x,top:this.prevPanPoint.y-_.y}),this.prevPanPoint=_},q.prototype.startRenderAndClose=function(){return U(this,void 0,void 0,function(){var _,L,z=this;return Z(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return _=ee.sent(),L=this.getState(),this.eventListeners.render.forEach(function($){return $(new Ue(z,_,L))}),this.close(!0),[2]}})})},q.prototype.getState=function(_){_===!0&&this.setCurrentMarker();var L={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(z){return L.markers.push(z.getState())}),L},q.prototype.restoreState=function(_){var L=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);_.markers.forEach(function(z){var ee=L._availableMarkerTypes.find(function(Ee){return Ee.typeName===z.typeName});if(ee!==void 0){var $=L.addNewMarker(ee);$.restoreState(z),L.markers.push($)}}),_.width&&_.height&&(_.width!==this.imageWidth||_.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/_.width,this.imageHeight/_.height),this.eventListeners.restorestate.forEach(function(z){return z(new Se(L))})},q.prototype.addNewMarker=function(_){var L=M.createGroup();return this.markerImage.appendChild(L),new _(L,this.overlayContainer,this.settings)},q.prototype.createNewMarker=function(_){var L,z=this;(L=typeof _=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===_}):_)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(L),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(L.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new Te(z,z._currentMarker))}))},q.prototype.markerCreated=function(_){var L=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(_),this.setCurrentMarker(_),_ instanceof w&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(w):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(z){return z(new Te(L,L._currentMarker))})},q.prototype.colorChanged=function(_){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=_,this.settings.defaultStrokeColor=_)},q.prototype.fillColorChanged=function(_){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=_)},q.prototype.markerStateChanged=function(_){var L=this;this.eventListeners.markerchange.forEach(function(z){return z(new Te(L,_))})},q.prototype.setCurrentMarker=function(_){var L=this;this._currentMarker!==_&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(z){return z(new Te(L,L._currentMarker))})),this._currentMarker=_,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 Te(L,L._currentMarker))}))},q.prototype.onPointerDown=function(_){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||_.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var L=this.markers.find(function(z){return z.ownsTarget(_.target)});L!==void 0?(this.setCurrentMarker(L),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(_.clientX,_.clientY),_.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:_.clientX,y:_.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(_.clientX,_.clientY))},q.prototype.onDblClick=function(_){if(this._isFocused||this.focus(),this.mode==="select"){var L=this.markers.find(function(z){return z.ownsTarget(_.target)});L!==void 0&&L!==this._currentMarker&&this.setCurrentMarker(L),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(_.clientX,_.clientY),_.target):this.setCurrentMarker()}},q.prototype.onPointerMove=function(_){this.touchPoints!==1&&_.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||_.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(_.clientX,_.clientY)):this.zoomLevel>1&&this.panTo({x:_.clientX,y:_.clientY}))},q.prototype.onPointerUp=function(_){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(_.clientX,_.clientY)),this.isDragging=!1,this.addUndoStep()},q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},q.prototype.onKeyUp=function(_){this._currentMarker===void 0||this.notesArea!==void 0||_.key!=="Delete"&&_.key!=="Backspace"||this.deleteSelectedMarker()},q.prototype.clientToLocalCoordinates=function(_,L){var z=this.markerImage.getBoundingClientRect();return{x:(_-z.left)/this.zoomLevel,y:(L-z.top)/this.zoomLevel}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"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()},q.prototype.addLicenseKey=function(_){Y.addKey(_)},q.prototype.addEventListener=function(_,L){this.eventListeners.addEventListener(_,L)},q.prototype.removeEventListener=function(_,L){this.eventListeners.removeEventListener(_,L)},q.prototype.renderState=function(_){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(_),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),q.prototype.focus=function(){var _=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(L){return L(new Se(_))}))},q.prototype.blur=function(){var _=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(L){return L(new Se(_))}))},q.instanceCounter=0,q}()},T1X5:function(Et,Pe){Et.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(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Y}),F.d(Pe,"e",function(){return X}),F.d(Pe,"c",function(){return g}),F.d(Pe,"b",function(){return h}),F.d(Pe,"d",function(){return O}),F.d(Pe,"f",function(){return W});var ne=F("MNsG"),Q=F("N0LK"),U=F("Cg/j");let Z=ne.k||"";const G=new Map;G.set("false",!1),G.set("true",!0),G.set("isMac",ne.f),G.set("isLinux",ne.d),G.set("isWindows",ne.i),G.set("isWeb",ne.h),G.set("isMacNative",ne.f&&!ne.h),G.set("isEdge",Z.indexOf("Edg/")>=0),G.set("isFirefox",Z.indexOf("Firefox")>=0),G.set("isChrome",Z.indexOf("Chrome")>=0),G.set("isSafari",Z.indexOf("Safari")>=0);const M=Object.prototype.hasOwnProperty;class Y{static has(C){return f.create(C)}static equals(C,B){return p.create(C,B)}static regex(C,B){return S.create(C,B)}static not(C){return i.create(C)}static and(...C){return E.create(C,null)}static or(...C){return x.create(C,null,!0)}static deserialize(C,B=!1){return C?this._deserializeOrExpression(C,B):void 0}static _deserializeOrExpression(C,B){let k=C.split("||");return x.create(k.map(y=>this._deserializeAndExpression(y,B)),null,!0)}static _deserializeAndExpression(C,B){let k=C.split("&&");return E.create(k.map(y=>this._deserializeOne(y,B)),null)}static _deserializeOne(C,B){if(C=C.trim(),C.indexOf("!=")>=0){let k=C.split("!=");return s.create(k[0].trim(),this._deserializeValue(k[1],B))}if(C.indexOf("==")>=0){let k=C.split("==");return p.create(k[0].trim(),this._deserializeValue(k[1],B))}if(C.indexOf("=~")>=0){let k=C.split("=~");return S.create(k[0].trim(),this._deserializeRegexValue(k[1],B))}if(C.indexOf(" in ")>=0){let k=C.split(" in ");return a.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(C)){const k=C.split(">=");return o.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(C)){const k=C.split(">");return u.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(C)){const k=C.split("<=");return T.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(C)){const k=C.split("<");return R.create(k[0].trim(),k[1].trim())}return/^\!\s*/.test(C)?i.create(C.substr(1).trim()):f.create(C)}static _deserializeValue(C,B){if(C=C.trim(),C==="true")return!0;if(C==="false")return!1;let k=/^'([^']*)'$/.exec(C);return k?k[1].trim():C}static _deserializeRegexValue(C,B){if(Object(Q.C)(C)){if(B)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let k=C.indexOf("/"),y=C.lastIndexOf("/");if(k===y||k<0){if(B)throw new Error(`bad regexp-value '${C}', missing /-enclosure`);return console.warn(`bad regexp-value '${C}', missing /-enclosure`),null}let H=C.slice(k+1,y),J=C[y+1]==="i"?"i":"";try{return new RegExp(H,J)}catch(se){if(B)throw new Error(`bad regexp-value '${C}', parse error: ${se}`);return console.warn(`bad regexp-value '${C}', parse error: ${se}`),null}}}function X(C,B){const k=C?C.substituteConstants():void 0,y=B?B.substituteConstants():void 0;return!k&&!y?!0:!k||!y?!1:k.equals(y)}function r(C,B){return C.cmp(B)}class A{constructor(){this.type=0}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!1}serialize(){return"false"}keys(){return[]}negate(){return m.INSTANCE}}A.INSTANCE=new A;class m{constructor(){this.type=1}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!0}serialize(){return"true"}keys(){return[]}negate(){return A.INSTANCE}}m.INSTANCE=new m;class f{constructor(C,B){this.key=C,this.negated=B,this.type=2}static create(C,B=null){const k=G.get(C);return typeof k=="boolean"?k?m.INSTANCE:A.INSTANCE:new f(C,B)}cmp(C){return C.type!==this.type?this.type-C.type:w(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=G.get(this.key);return typeof C=="boolean"?C?m.INSTANCE:A.INSTANCE:this}evaluate(C){return!!C.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this)),this.negated}}class p{constructor(C,B,k){this.key=C,this.value=B,this.negated=k,this.type=4}static create(C,B,k=null){if(typeof B=="boolean")return B?f.create(C,k):i.create(C,k);const y=G.get(C);if(typeof y=="boolean"){const H=y?"true":"false";return B===H?m.INSTANCE:A.INSTANCE}return new p(C,B,k)}cmp(C){return C.type!==this.type?this.type-C.type:b(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=G.get(this.key);if(typeof C=="boolean"){const B=C?"true":"false";return this.value===B?m.INSTANCE:A.INSTANCE}return this}evaluate(C){return C.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class a{constructor(C,B){this.key=C,this.valueKey=B,this.type=10,this.negated=null}static create(C,B){return new a(C,B)}cmp(C){return C.type!==this.type?this.type-C.type:b(this.key,this.valueKey,C.key,C.valueKey)}equals(C){return C.type===this.type?this.key===C.key&&this.valueKey===C.valueKey:!1}substituteConstants(){return this}evaluate(C){const B=C.getValue(this.valueKey),k=C.getValue(this.key);return Array.isArray(B)?B.indexOf(k)>=0:typeof k=="string"&&typeof B=="object"&&B!==null?M.call(B,k):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=c.create(this)),this.negated}}class c{constructor(C){this._actual=C,this.type=11}static create(C){return new c(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class s{constructor(C,B,k){this.key=C,this.value=B,this.negated=k,this.type=5}static create(C,B,k=null){if(typeof B=="boolean")return B?i.create(C,k):f.create(C,k);const y=G.get(C);if(typeof y=="boolean"){const H=y?"true":"false";return B===H?A.INSTANCE:m.INSTANCE}return new s(C,B,k)}cmp(C){return C.type!==this.type?this.type-C.type:b(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=G.get(this.key);if(typeof C=="boolean"){const B=C?"true":"false";return this.value===B?A.INSTANCE:m.INSTANCE}return this}evaluate(C){return C.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class i{constructor(C,B){this.key=C,this.negated=B,this.type=3}static create(C,B=null){const k=G.get(C);return typeof k=="boolean"?k?A.INSTANCE:m.INSTANCE:new i(C,B)}cmp(C){return C.type!==this.type?this.type-C.type:w(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=G.get(this.key);return typeof C=="boolean"?C?A.INSTANCE:m.INSTANCE:this}evaluate(C){return!C.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function t(C,B){if(typeof C=="string"){const k=parseFloat(C);isNaN(k)||(C=k)}return typeof C=="string"||typeof C=="number"?B(C):A.INSTANCE}class u{constructor(C,B,k){this.key=C,this.value=B,this.negated=k,this.type=12}static create(C,B,k=null){return t(B,y=>new u(C,y,k))}cmp(C){return C.type!==this.type?this.type-C.type:b(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class o{constructor(C,B,k){this.key=C,this.value=B,this.negated=k,this.type=13}static create(C,B,k=null){return t(B,y=>new o(C,y,k))}cmp(C){return C.type!==this.type?this.type-C.type:b(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class R{constructor(C,B,k){this.key=C,this.value=B,this.negated=k,this.type=14}static create(C,B,k=null){return t(B,y=>new R(C,y,k))}cmp(C){return C.type!==this.type?this.type-C.type:b(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class T{constructor(C,B,k){this.key=C,this.value=B,this.negated=k,this.type=15}static create(C,B,k=null){return t(B,y=>new T(C,y,k))}cmp(C){return C.type!==this.type?this.type-C.type:b(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class S{constructor(C,B){this.key=C,this.regexp=B,this.type=7,this.negated=null}static create(C,B){return new S(C,B)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.key<C.key)return-1;if(this.key>C.key)return 1;const B=this.regexp?this.regexp.source:"",k=C.regexp?C.regexp.source:"";return B<k?-1:B>k?1:0}equals(C){if(C.type===this.type){const B=this.regexp?this.regexp.source:"",k=C.regexp?C.regexp.source:"";return this.key===C.key&&B===k}return!1}substituteConstants(){return this}evaluate(C){let B=C.getValue(this.key);return this.regexp?this.regexp.test(B):!1}serialize(){const C=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${C}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(C){this._actual=C,this.type=8}static create(C){return new D(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function I(C){let B=null;for(let k=0,y=C.length;k<y;k++){const H=C[k].substituteConstants();if(C[k]!==H&&B===null){B=[];for(let J=0;J<k;J++)B[J]=C[J]}B!==null&&(B[k]=H)}return B===null?C:B}class E{constructor(C,B){this.expr=C,this.negated=B,this.type=6}static create(C,B){return E._normalizeArr(C,B)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let B=0,k=this.expr.length;B<k;B++){const y=r(this.expr[B],C.expr[B]);if(y!==0)return y}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let B=0,k=this.expr.length;B<k;B++)if(!this.expr[B].equals(C.expr[B]))return!1;return!0}return!1}substituteConstants(){const C=I(this.expr);return C===this.expr?this:E.create(C,this.negated)}evaluate(C){for(let B=0,k=this.expr.length;B<k;B++)if(!this.expr[B].evaluate(C))return!1;return!0}static _normalizeArr(C,B){const k=[];let y=!1;for(const H of C){if(!H)continue;if(H.type===1){y=!0;continue}if(H.type===0)return A.INSTANCE;if(H.type===6){k.push(...H.expr);continue}k.push(H)}if(k.length===0&&y)return m.INSTANCE;if(k.length===0)return;if(k.length===1)return k[0];k.sort(r);for(let H=1;H<k.length;H++)k[H-1].equals(k[H])&&(k.splice(H,1),H--);if(k.length===1)return k[0];for(;k.length>1;){const H=k[k.length-1];if(H.type!==9)break;k.pop();const J=k.pop(),se=k.length===0,fe=x.create(H.expr.map(ve=>E.create([ve,J],null)),null,se);fe&&(k.push(fe),k.sort(r))}return k.length===1?k[0]:new E(k,B)}serialize(){return this.expr.map(C=>C.serialize()).join(" && ")}keys(){const C=[];for(let B of this.expr)C.push(...B.keys());return C}negate(){if(!this.negated){const C=[];for(let B of this.expr)C.push(B.negate());this.negated=x.create(C,this,!0)}return this.negated}}class x{constructor(C,B){this.expr=C,this.negated=B,this.type=9}static create(C,B,k){return x._normalizeArr(C,B,k)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let B=0,k=this.expr.length;B<k;B++){const y=r(this.expr[B],C.expr[B]);if(y!==0)return y}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let B=0,k=this.expr.length;B<k;B++)if(!this.expr[B].equals(C.expr[B]))return!1;return!0}return!1}substituteConstants(){const C=I(this.expr);return C===this.expr?this:x.create(C,this.negated,!1)}evaluate(C){for(let B=0,k=this.expr.length;B<k;B++)if(this.expr[B].evaluate(C))return!0;return!1}static _normalizeArr(C,B,k){let y=[],H=!1;if(C){for(let J=0,se=C.length;J<se;J++){const fe=C[J];if(!fe)continue;if(fe.type===0){H=!0;continue}if(fe.type===1)return m.INSTANCE;if(fe.type===9){y=y.concat(fe.expr);continue}y.push(fe)}if(y.length===0&&H)return A.INSTANCE;y.sort(r)}if(y.length===0)return;if(y.length===1)return y[0];for(let J=1;J<y.length;J++)y[J-1].equals(y[J])&&(y.splice(J,1),J--);if(y.length===1)return y[0];if(k){for(let J=0;J<y.length;J++)for(let se=J+1;se<y.length;se++)W(y[J],y[se])&&(y.splice(se,1),se--);if(y.length===1)return y[0]}return new x(y,B)}serialize(){return this.expr.map(C=>C.serialize()).join(" || ")}keys(){const C=[];for(let B of this.expr)C.push(...B.keys());return C}negate(){if(!this.negated){let C=[];for(let B of this.expr)C.push(B.negate());for(;C.length>1;){const B=C.shift(),k=C.shift(),y=[];for(const J of j(B))for(const se of j(k))y.push(E.create([J,se],null));const H=C.length===0;C.unshift(x.create(y,null,H))}this.negated=C[0]}return this.negated}}class g extends f{constructor(C,B,k){super(C,null);this._defaultValue=B,typeof k=="object"?g._info.push(Object.assign(Object.assign({},k),{key:C})):k!==!0&&g._info.push({key:C,description:k,type:B!=null?typeof B:void 0})}static all(){return g._info.values()}bindTo(C){return C.createKey(this.key,this._defaultValue)}getValue(C){return C.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(C){return p.create(this.key,C)}}g._info=[];const h=Object(U.c)("contextKeyService"),O="setContext";function w(C,B){return C<B?-1:C>B?1:0}function b(C,B,k,y){return C<k?-1:C>k?1:B<y?-1:B>y?1:0}function W(C,B){if(B.type===6&&C.type!==9&&C.type!==6){for(const H of B.expr)if(C.equals(H))return!0}const k=C.negate(),y=j(k).concat(j(B));y.sort(r);for(let H=0;H<y.length;H++){const J=y[H],se=J.negate();for(let fe=H+1;fe<y.length;fe++){const ve=y[fe];if(se.equals(ve))return!0}}return!1}function j(C){return C.type===9?C.expr:[C]}},TXwP:function(Et,Pe,F){var ne,Q;(function(){var U;(function(){"use strict";var G=[,,function(r){function A(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}A.prototype.clone_empty=function(){var p=new A(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},A.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},A.prototype.has_match=function(p){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(p))return!0;return!1},A.prototype.set_indent=function(p,a){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},A.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},A.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(p){this.__items.push(p);var a=p.lastIndexOf(`
`);a!==-1?this.__character_count=p.length-a:this.__character_count+=p.length},A.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function m(p,a){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),a=a||"",p.indent_level>0&&(a=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(p,a){var c=this.__base_string_length;return a=a||0,p<0&&(c=0),c+=p*this.__indent_size,c+=a,c},m.prototype.get_indent_string=function(p,a){var c=this.__base_string;return a=a||0,p<0&&(p=0,c=""),a+=p*this.__indent_size,this.__ensure_cache(a),c+=this.__cache[a],c},m.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var p=this.__cache.length,a=0,c="";this.__indent_size&&p>=this.__indent_size&&(a=Math.floor(p/this.__indent_size),p-=a*this.__indent_size,c=new Array(a+1).join(this.__indent_string)),p&&(c+=new Array(p+1).join(" ")),this.__cache.push(c)};function f(p,a){this.__indent_cache=new m(p,a),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(p,a){return this.__indent_cache.get_indent_string(p,a)},f.prototype.get_indent_size=function(p,a){return this.__indent_cache.get_indent_size(p,a)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(p){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
`);return p!==`
`&&(c=c.replace(/[\n]/g,p)),c},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(p,a){return p=p||0,a=a||0,this.next_line.set_indent(p,a),this.__lines.length>1?(this.current_line.set_indent(p,a),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(p){for(var a=0;a<p.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(p){for(var a=this.__lines.length;p<a;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(p,a){for(var c=this.__lines.length-2;c>=0;){var s=this.__lines[c];if(s.is_empty())break;if(s.item(0).indexOf(p)!==0&&s.item(-1)!==a){this.__lines.splice(c+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},r.exports.Output=f},,,,function(r){function A(p,a){this.raw_options=m(p,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}A.prototype._get_array=function(p,a){var c=this.raw_options[p],s=a||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(s=c.concat()):typeof c=="string"&&(s=c.split(/[^a-zA-Z0-9_\/\-]+/)),s},A.prototype._get_boolean=function(p,a){var c=this.raw_options[p],s=c===void 0?!!a:!!c;return s},A.prototype._get_characters=function(p,a){var c=this.raw_options[p],s=a||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},A.prototype._get_number=function(p,a){var c=this.raw_options[p];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(c,10);return isNaN(s)&&(s=a),s},A.prototype._get_selection=function(p,a,c){var s=this._get_selection_list(p,a,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[p]+"'");return s[0]},A.prototype._get_selection_list=function(p,a,c){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[a[0]],!this._is_valid_selection(c,a))throw new Error("Invalid Default Value!");var s=this._get_array(p,c);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[p]+"'");return s},A.prototype._is_valid_selection=function(p,a){return p.length&&a.length&&!p.some(function(c){return a.indexOf(c)===-1})};function m(p,a){var c={};p=f(p);var s;for(s in p)s!==a&&(c[s]=p[s]);if(a&&p[a])for(s in p[a])c[s]=p[a][s];return c}function f(p){var a={},c;for(c in p){var s=c.replace(/-/g,"_");a[s]=p[c]}return a}r.exports.Options=A,r.exports.normalizeOpts=f,r.exports.mergeOpts=m},,function(r){var A=RegExp.prototype.hasOwnProperty("sticky");function m(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},m.prototype.peek=function(f){var p=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(p=this.__input.charAt(f)),p},m.prototype.__match=function(f,p){f.lastIndex=p;var a=f.exec(this.__input);return a&&!(A&&f.sticky)&&(a.index!==p&&(a=null)),a},m.prototype.test=function(f,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(f,p):!1},m.prototype.testChar=function(f,p){var a=this.peek(p);return f.lastIndex=0,a!==null&&f.test(a)},m.prototype.match=function(f){var p=this.__match(f,this.__position);return p?this.__position+=p[0].length:p=null,p},m.prototype.read=function(f,p,a){var c="",s;return f&&(s=this.match(f),s&&(c+=s[0])),p&&(s||!f)&&(c+=this.readUntil(p,a)),c},m.prototype.readUntil=function(f,p){var a="",c=this.__position;f.lastIndex=this.__position;var s=f.exec(this.__input);return s?(c=s.index,p&&(c+=s[0].length)):c=this.__input_length,a=this.__input.substring(this.__position,c),this.__position=c,a},m.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},m.prototype.get_regexp=function(f,p){var a=null,c="g";return p&&A&&(c="y"),typeof f=="string"&&f!==""?a=new RegExp(f,c):f&&(a=new RegExp(f.source,c)),a},m.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(f){var p=this.__position,a=this.readUntilAfter(f);return this.__position=p,a},m.prototype.lookBack=function(f){var p=this.__position-1;return p>=f.length&&this.__input.substring(p-f.length,p).toLowerCase()===f},r.exports.InputScanner=m},,,,,function(r){function A(m,f){m=typeof m=="string"?m:m.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+f,"g")}A.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(m);p;)f[p[1]]=p[2],p=this.__directive_pattern.exec(m);return f},A.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=A},,function(r,A,m){var f=m(16).Beautifier,p=m(17).Options;function a(c,s){var i=new f(c,s);return i.beautify()}r.exports=a,r.exports.defaultOptions=function(){return new p}},function(r,A,m){var f=m(17).Options,p=m(2).Output,a=m(8).InputScanner,c=m(13).Directives,s=new c(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,u=/\s/,o=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(D,I){this._source_text=D||"",this._options=new f(I),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}S.prototype.eatString=function(D){var I="";for(this._ch=this._input.next();this._ch;){if(I+=this._ch,this._ch==="\\")I+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return I},S.prototype.eatWhitespace=function(D){for(var I=u.test(this._input.peek()),E=0;u.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===`
`&&((E===0||E<this._options.max_preserve_newlines)&&(E++,this._output.add_new_line(!0)));return I},S.prototype.foundNestedPseudoClass=function(){for(var D=0,I=1,E=this._input.peek(I);E;){if(E==="{")return!0;if(E==="(")D+=1;else if(E===")"){if(D===0)return!1;D-=1}else if(E===";"||E==="}")return!1;I++,E=this._input.peek(I)}return!1},S.prototype.print_string=function(D){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(D)},S.prototype.preserveSingleSpace=function(D){D&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,I=this._options.eol;I==="auto"&&(I=`
`,D&&i.test(D||"")&&(I=D.match(i)[0])),D=D.replace(t,`
`);var E=D.match(/^[\t ]*/)[0];this._output=new p(this._options,E),this._input=new a(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var x=0,g=!1,h=!1,O=!1,w=!1,b=!1,W=!1,j=this._ch,C=!1,B,k,y;B=this._input.read(o),k=B!=="",y=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(R),J=s.get_directives(H);J&&J.ignore==="start"&&(H+=s.readIgnored(this._input)),this.print_string(H),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(k),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);se.match(/[ :]$/)&&(se=this.eatString(": ").replace(/\s$/,""),this.print_string(se),this._output.space_before_token=!0),se=se.replace(/\s$/,""),se==="extend"?w=!0:se==="import"&&(b=!0),se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(O=!0)):!g&&x===0&&se.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(k),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),O?(O=!1,g=this._indentLevel>=this._nestedLevel):g=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&g&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(y==="("?this._output.space_before_token=!1:y!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),y==="{"&&this._output.trim(!0),b=!1,w=!1,h&&(this.outdent(),h=!1),this.print_string(this._ch),g=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var fe=0;fe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;fe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[fe])){C=!0;break}(g||O)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!w&&x===0?(this.print_string(":"),h||(h=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ve=y==='"'||y==="'";this.preserveSingleSpace(ve||k),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")C=!1,x===0?(h&&(this.outdent(),h=!1),w=!1,b=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),x++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),x&&(x--,this.outdent()));else{var Se=!1;this._input.lookBack("with")&&(Se=!0),this.preserveSingleSpace(k||Se),this.print_string(this._ch),h&&y==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),W=!0):(this.eatWhitespace(),x++,this.indent())}else if(this._ch===")")x&&(x--,this.outdent()),W&&this._input.peek()===";"&&this._options.selector_separator_newline&&(W=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!h||W)&&x===0&&!b&&!w?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&x===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&u.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(k),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),u.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Ue=y==='"'||y==="'";this.preserveSingleSpace(Ue||k),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&C&&this._output.add_new_line()}var Te=this._output.get_code(I);return Te},r.exports.Beautifier=S},function(r,A,m){var f=m(6).Options;function p(a){f.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var c=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||c;var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<s.length;i++)s[i]!=="expand"?this.brace_style="collapse":this.brace_style=s[i]}p.prototype=new f,r.exports.Options=p}],M={};function Y(r){var A=M[r];if(A!==void 0)return A.exports;var m=M[r]={exports:{}};return G[r](m,m.exports,Y),m.exports}var X=Y(15);U=X})();var Z=U;!(ne=[],Q=function(){return{css_beautify:Z}}.apply(Pe,ne),Q!==void 0&&(Et.exports=Q))})()},VYcG:function(Et,Pe,F){"use strict";F.r(Pe),F.d(Pe,"useCourseOptions",function(){return k});var ne=F("T2oS"),Q=F("W9HT"),U=F("+L6B"),Z=F("2/Rp"),G=F("7Kak"),M=F("9yH6"),Y=F("giR+"),X=F("fyUT"),r=F("5NDa"),A=F("5rEg"),m=F("6UJt"),f=F("DFOY"),p=F("14J3"),a=F("BMrR"),c=F("jCWc"),s=F("kPKH"),i=F("sPJy"),t=F("bE4q"),u=F("k1fw"),o=F("rAM+"),R=F("y8nQ"),T=F("Vl3Y"),S=F("9og8"),D=F("tJVT"),I=F("WmNS"),E=F.n(I),x=F("q1tI"),g=F.n(x),h=F("Ty5D"),O=F("55Ip"),w=F("9kvl"),b=F("Pxm8"),W=F.n(b),j=F("vCeJ"),C=F("6fQ5"),B=F("ZWs3"),k=function(){var J=Object(x.useState)([]),se=Object(D.a)(J,2),fe=se[0],ve=se[1];return Object(x.useEffect)(function(){var Se=function(){var Ue=Object(S.a)(E.a.mark(function Te(){var Ie;return E.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(j.k)({source:"new_question"});case 2:Ie=q.sent,Ie!=null&&Ie.disciplines&&ve(Object(C.a)(Ie==null?void 0:Ie.disciplines));case 4:case"end":return q.stop()}},Te)}));return function(){return Ue.apply(this,arguments)}}();Se()},[]),fe},y=function(J){var se=J.user,fe=Object(h.i)(),ve=k(),Se=T.a.useForm(),Ue=Object(D.a)(Se,1),Te=Ue[0],Ie=Object(x.useState)(),be=Object(D.a)(Ie,2),q=be[0],_=be[1],L=Object(x.useState)(!1),z=Object(D.a)(L,2),ee=z[0],$=z[1];return Object(x.useEffect)(function(){if(fe.id){var Ee=function(){var Be=Object(S.a)(E.a.mark(function nt(){var we,Ne,Ye,Xe,ht,wt,Bt,Wt,an,Yt,qe,Qe,bt;return E.a.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:return $(!0),ye.next=3,Object(j.l)({id:fe.id});case 3:Ye=ye.sent,$(!1),Xe=Ye==null||((we=Ye.exercise)===null||we===void 0)?void 0:we.sub_discipline_id,ht=[],wt=Object(o.a)(ve);try{for(wt.s();!(Bt=wt.n()).done;){Wt=Bt.value,an=Object(o.a)(Wt.children);try{for(an.s();!(Yt=an.n()).done;)qe=Yt.value,qe.value===Xe&&(ht=[Wt.value,qe.value])}catch(ae){an.e(ae)}finally{an.f()}}}catch(ae){wt.e(ae)}finally{wt.f()}Qe=Ye==null||((Ne=Ye.exercise)===null||Ne===void 0)?void 0:Ne.time,bt=Object(u.a)(Object(u.a)({},Ye.exercise),{},{sub_discipline_id:ht,time:Qe===-1?null:Qe}),_(bt);case 12:case"end":return ye.stop()}},nt)}));return function(){return Be.apply(this,arguments)}}();if(!ve.length)return;Ee()}else _({})},[ve]),g.a.createElement("section",{className:"edu-container"},g.a.createElement("section",{className:"animated fadeIn"},g.a.createElement("aside",{className:"mt10"},g.a.createElement(t.a,{separator:">"},g.a.createElement(t.a.Item,null,g.a.createElement(O.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),g.a.createElement(t.a.Item,null,"\u65B0\u5EFA\u8BD5\u5377"))),g.a.createElement("aside",{className:"".concat(W.a.title," mt20")},g.a.createElement(a.a,null,g.a.createElement(s.a,{flex:"1"},g.a.createElement("strong",{className:"font20 ml5"},"\u65B0\u5EFA\u8BD5\u5377"))))),g.a.createElement(Q.a,{spinning:ee,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},g.a.createElement("section",{className:[W.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},q&&g.a.createElement(T.a,{layout:"vertical",form:Te,className:W.a.formWrap,initialValues:q},g.a.createElement(T.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"sub_discipline_id",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},g.a.createElement(f.a,{placeholder:"\u8BF7\u9009\u62E9...",options:ve})),g.a.createElement(T.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},g.a.createElement(A.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),g.a.createElement(T.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F",style:{width:"300px"}},g.a.createElement("div",{style:{display:"flex"}},g.a.createElement(X.a,{min:1,max:9999,maxLength:60,placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"}),g.a.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"32px"}},"\u5206\u949F"))),g.a.createElement(T.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},g.a.createElement(M.a.Group,null,g.a.createElement(M.a.Button,{value:1},"\u7B80\u5355"),g.a.createElement(M.a.Button,{value:2},"\u9002\u4E2D"),g.a.createElement(M.a.Button,{value:3},"\u56F0\u96BE"))),g.a.createElement(T.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},g.a.createElement(A.a.TextArea,{rows:6,maxLength:65535,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u523665535\u4E2A\u5B57\u7B26"})))),g.a.createElement("div",{className:["mt20","pb20","pt20"].join(" ")},g.a.createElement(Z.a,{style:{marginRight:"5px"},onClick:function(){w.d.push("/paperlibrary")}},"\u53D6\u6D88"),g.a.createElement(B.a,{onClick:Object(S.a)(E.a.mark(function Ee(){var Be,nt,we,Ne;return E.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return Xe.next=2,Te.validateFields();case 2:if(Be=Te.getFieldsValue(),Be.sub_discipline_id=Be.sub_discipline_id[1],!fe.id){Xe.next=10;break}return Xe.next=7,Object(j.z)(Object(u.a)({id:fe.id},Be));case 7:return nt=Xe.sent,nt.status===0&&w.d.push("/paperlibrary/edit/".concat(fe.id,"?fromadd=1")),Xe.abrupt("return");case 10:return Xe.next=12,Object(j.e)(Be);case 12:we=Xe.sent,we.status===0&&w.d.push("/paperlibrary/edit/".concat(we==null||((Ne=we.data)===null||Ne===void 0)?void 0:Ne.exam_id,"?fromadd=1"));case 14:case"end":return Xe.stop()}},Ee)})),type:"primary",style:{marginLeft:"5px"}},"\u786E\u5B9A"))))};Pe.default=Object(w.a)(function(H){var J=H.user;return{user:J}})(y)},Vhoy:function(Et,Pe,F){"use strict";F.d(Pe,"d",function(){return Z}),F.d(Pe,"e",function(){return G}),F.d(Pe,"c",function(){return M}),F.d(Pe,"b",function(){return Y}),F.d(Pe,"a",function(){return X});var ne=F("MI8n");class Q{constructor(){this._icons=new Map,this._onDidRegister=new ne.b}add(r){const A=this._icons.get(r.id);A?r.description?A.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const U=new Q,Z=U;function G(r,A){return new Y(r,A)}function M(r){return r?r.replace(/\$\((.*?)\)/g,(A,m)=>` ${m} `).trim():""}class Y{constructor(r,A,m){this.id=r,this.definition=A,this.description=m,U.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var X;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const A=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function m(a){if(a instanceof Y)return["codicon","codicon-"+a.id];const c=A.exec(a.id);if(!c)return m(Y.error);let[,s,i]=c;const t=["codicon","codicon-"+s];return i&&t.push("codicon-modifier-"+i.substr(1)),t}r.asClassNameArray=m;function f(a){return m(a).join(" ")}r.asClassName=f;function p(a){return"."+m(a).join(".")}r.asCSSSelector=p})(X||(X={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(Y||(Y={}))},"VrN/":function(Et,Pe,F){(function(ne,Q){Et.exports=Q()})(this,function(){"use strict";var ne=navigator.userAgent,Q=navigator.platform,U=/gecko\/\d/i.test(ne),Z=/MSIE \d/.test(ne),G=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),M=/Edge\/(\d+)/.exec(ne),Y=Z||G||M,X=Y&&(Z?document.documentMode||6:+(M||G)[1]),r=!M&&/WebKit\//.test(ne),A=r&&/Qt\/\d+\.\d+/.test(ne),m=!M&&/Chrome\//.test(ne),f=/Opera\//.test(ne),p=/Apple Computer/.test(navigator.vendor),a=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ne),c=/PhantomJS/.test(ne),s=!M&&/AppleWebKit/.test(ne)&&/Mobile\/\w+/.test(ne),i=/Android/.test(ne),t=s||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ne),u=s||/Mac/.test(Q),o=/\bCrOS\b/.test(ne),R=/win/i.test(Q),T=f&&ne.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(f=!1,r=!0);var S=u&&(A||f&&(T==null||T<12.11)),D=U||Y&&X>=9;function I(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E=function(e,n){var d=e.className,l=I(n).exec(d);if(l){var v=d.slice(l.index+l[0].length);e.className=d.slice(0,l.index)+(v?l[1]+v:"")}};function x(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function g(e,n){return x(e).appendChild(n)}function h(e,n,d,l){var v=document.createElement(e);if(d&&(v.className=d),l&&(v.style.cssText=l),typeof n=="string")v.appendChild(document.createTextNode(n));else if(n)for(var K=0;K<n.length;++K)v.appendChild(n[K]);return v}function O(e,n,d,l){var v=h(e,n,d,l);return v.setAttribute("role","presentation"),v}var w;document.createRange?w=function(e,n,d,l){var v=document.createRange();return v.setEnd(l||e,d),v.setStart(e,n),v}:w=function(e,n,d){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(v){return l}return l.collapse(!0),l.moveEnd("character",d),l.moveStart("character",n),l};function b(e,n){if(n.nodeType==3&&(n=n.parentNode),e.contains)return e.contains(n);do if(n.nodeType==11&&(n=n.host),n==e)return!0;while(n=n.parentNode)}function W(){var e;try{e=document.activeElement}catch(n){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,n){var d=e.className;I(n).test(d)||(e.className+=(d?" ":"")+n)}function C(e,n){for(var d=e.split(" "),l=0;l<d.length;l++)d[l]&&!I(d[l]).test(n)&&(n+=" "+d[l]);return n}var B=function(e){e.select()};s?B=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Y&&(B=function(e){try{e.select()}catch(n){}});function k(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function y(e,n,d){n||(n={});for(var l in e)e.hasOwnProperty(l)&&(d!==!1||!n.hasOwnProperty(l))&&(n[l]=e[l]);return n}function H(e,n,d,l,v){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var K=l||0,te=v||0;;){var ie=e.indexOf(" ",K);if(ie<0||ie>=n)return te+(n-K);te+=ie-K,te+=d-te%d,K=ie+1}}var J=function(){this.id=null,this.f=null,this.time=0,this.handler=k(this.onTimeout,this)};J.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},J.prototype.set=function(e,n){this.f=n;var d=+new Date+e;(!this.id||d<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=d)};function se(e,n){for(var d=0;d<e.length;++d)if(e[d]==n)return d;return-1}var fe=50,ve={toString:function(){return"CodeMirror.Pass"}},Se={scroll:!1},Ue={origin:"*mouse"},Te={origin:"+move"};function Ie(e,n,d){for(var l=0,v=0;;){var K=e.indexOf(" ",l);K==-1&&(K=e.length);var te=K-l;if(K==e.length||v+te>=n)return l+Math.min(te,n-v);if(v+=K-l,v+=d-v%d,l=K+1,v>=n)return l}}var be=[""];function q(e){for(;be.length<=e;)be.push(_(be)+" ");return be[e]}function _(e){return e[e.length-1]}function L(e,n){for(var d=[],l=0;l<e.length;l++)d[l]=n(e[l],l);return d}function z(e,n,d){for(var l=0,v=d(n);l<e.length&&d(e[l])<=v;)l++;e.splice(l,0,n)}function ee(){}function $(e,n){var d;return Object.create?d=Object.create(e):(ee.prototype=e,d=new ee),n&&y(n,d),d}var Ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Be(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ee.test(e))}function nt(e,n){return n?n.source.indexOf("\\w")>-1&&Be(e)?!0:n.test(e):Be(e)}function we(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var Ne=/[\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 Ye(e){return e.charCodeAt(0)>=768&&Ne.test(e)}function Xe(e,n,d){for(;(d<0?n>0:n<e.length)&&Ye(e.charAt(n));)n+=d;return n}function ht(e,n,d){for(var l=n>d?-1:1;;){if(n==d)return n;var v=(n+d)/2,K=l<0?Math.ceil(v):Math.floor(v);if(K==n)return e(K)?n:d;e(K)?d=K:n=K+l}}function wt(e,n,d,l){if(!e)return l(n,d,"ltr",0);for(var v=!1,K=0;K<e.length;++K){var te=e[K];(te.from<d&&te.to>n||n==d&&te.to==n)&&(l(Math.max(te.from,n),Math.min(te.to,d),te.level==1?"rtl":"ltr",K),v=!0)}v||l(n,d,"ltr")}var Bt=null;function Wt(e,n,d){var l;Bt=null;for(var v=0;v<e.length;++v){var K=e[v];if(K.from<n&&K.to>n)return v;K.to==n&&(K.from!=K.to&&d=="before"?l=v:Bt=v),K.from==n&&(K.from!=K.to&&d!="before"?l=v:Bt=v)}return l!=null?l:Bt}var an=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function d(_e){return _e<=247?e.charAt(_e):1424<=_e&&_e<=1524?"R":1536<=_e&&_e<=1785?n.charAt(_e-1536):1774<=_e&&_e<=2220?"r":8192<=_e&&_e<=8203?"w":_e==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,v=/[stwN]/,K=/[LRr]/,te=/[Lb1n]/,ie=/[1n]/;function oe(_e,je,Ve){this.level=_e,this.from=je,this.to=Ve}return function(_e,je){var Ve=je=="ltr"?"L":"R";if(_e.length==0||je=="ltr"&&!l.test(_e))return!1;for(var dt=_e.length,st=[],Rt=0;Rt<dt;++Rt)st.push(d(_e.charCodeAt(Rt)));for(var Ht=0,en=Ve;Ht<dt;++Ht){var Tn=st[Ht];Tn=="m"?st[Ht]=en:en=Tn}for(var Yn=0,Sn=Ve;Yn<dt;++Yn){var lr=st[Yn];lr=="1"&&Sn=="r"?st[Yn]="n":K.test(lr)&&(Sn=lr,lr=="r"&&(st[Yn]="R"))}for(var Rr=1,Cr=st[0];Rr<dt-1;++Rr){var Dr=st[Rr];Dr=="+"&&Cr=="1"&&st[Rr+1]=="1"?st[Rr]="1":Dr==","&&Cr==st[Rr+1]&&(Cr=="1"||Cr=="n")&&(st[Rr]=Cr),Cr=Dr}for(var Wr=0;Wr<dt;++Wr){var ri=st[Wr];if(ri==",")st[Wr]="N";else if(ri=="%"){var zr=void 0;for(zr=Wr+1;zr<dt&&st[zr]=="%";++zr);for(var Ei=Wr&&st[Wr-1]=="!"||zr<dt&&st[zr]=="1"?"1":"N",gi=Wr;gi<zr;++gi)st[gi]=Ei;Wr=zr-1}}for(var Qr=0,vi=Ve;Qr<dt;++Qr){var oi=st[Qr];vi=="L"&&oi=="1"?st[Qr]="L":K.test(oi)&&(vi=oi)}for(var Zr=0;Zr<dt;++Zr)if(v.test(st[Zr])){var Jr=void 0;for(Jr=Zr+1;Jr<dt&&v.test(st[Jr]);++Jr);for(var Xr=(Zr?st[Zr-1]:Ve)=="L",_i=(Jr<dt?st[Jr]:Ve)=="L",vs=Xr==_i?Xr?"L":"R":Ve,wa=Zr;wa<Jr;++wa)st[wa]=vs;Zr=Jr-1}for(var di=[],Hi,ii=0;ii<dt;)if(te.test(st[ii])){var nu=ii;for(++ii;ii<dt&&te.test(st[ii]);++ii);di.push(new oe(0,nu,ii))}else{var Qi=ii,Ga=di.length,za=je=="rtl"?1:0;for(++ii;ii<dt&&st[ii]!="L";++ii);for(var hi=Qi;hi<ii;)if(ie.test(st[hi])){Qi<hi&&(di.splice(Ga,0,new oe(1,Qi,hi)),Ga+=za);var _s=hi;for(++hi;hi<ii&&ie.test(st[hi]);++hi);di.splice(Ga,0,new oe(2,_s,hi)),Ga+=za,Qi=hi}else++hi;Qi<ii&&di.splice(Ga,0,new oe(1,Qi,ii))}return je=="ltr"&&(di[0].level==1&&(Hi=_e.match(/^\s+/))&&(di[0].from=Hi[0].length,di.unshift(new oe(0,0,Hi[0].length))),_(di).level==1&&(Hi=_e.match(/\s+$/))&&(_(di).to-=Hi[0].length,di.push(new oe(0,dt-Hi[0].length,dt)))),je=="rtl"?di.reverse():di}}();function Yt(e,n){var d=e.order;return d==null&&(d=e.order=an(e.text,n)),d}var qe=[],Qe=function(e,n,d){if(e.addEventListener)e.addEventListener(n,d,!1);else if(e.attachEvent)e.attachEvent("on"+n,d);else{var l=e._handlers||(e._handlers={});l[n]=(l[n]||qe).concat(d)}};function bt(e,n){return e._handlers&&e._handlers[n]||qe}function xt(e,n,d){if(e.removeEventListener)e.removeEventListener(n,d,!1);else if(e.detachEvent)e.detachEvent("on"+n,d);else{var l=e._handlers,v=l&&l[n];if(v){var K=se(v,d);K>-1&&(l[n]=v.slice(0,K).concat(v.slice(K+1)))}}}function ye(e,n){var d=bt(e,n);if(!d.length)return;for(var l=Array.prototype.slice.call(arguments,2),v=0;v<d.length;++v)d[v].apply(null,l)}function ae(e,n,d){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),ye(e,d||n.type,e,n),De(n)||n.codemirrorIgnore}function le(e){var n=e._handlers&&e._handlers.cursorActivity;if(!n)return;for(var d=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<n.length;++l)se(d,n[l])==-1&&d.push(n[l])}function me(e,n){return bt(e,n).length>0}function Ce(e){e.prototype.on=function(n,d){Qe(this,n,d)},e.prototype.off=function(n,d){xt(this,n,d)}}function de(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function pe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ue(e){de(e),pe(e)}function Me(e){return e.target||e.srcElement}function We(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),u&&e.ctrlKey&&n==1&&(n=3),n}var lt=function(){if(Y&&X<9)return!1;var e=h("div");return"draggable"in e||"dragDrop"in e}(),Ct;function Ot(e){if(Ct==null){var n=h("span","\u200B");g(e,h("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ct=n.offsetWidth<=1&&n.offsetHeight>2&&!(Y&&X<8))}var d=Ct?h("span","\u200B"):h("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return d.setAttribute("cm-text",""),d}var Nt;function ir(e){if(Nt!=null)return Nt;var n=g(e,document.createTextNode("A\u062EA")),d=w(n,0,1).getBoundingClientRect(),l=w(n,1,2).getBoundingClientRect();return x(e),!d||d.left==d.right?!1:Nt=l.right-d.right<3}var Jt=`
b`.split(/\n/).length!=3?function(e){for(var n=0,d=[],l=e.length;n<=l;){var v=e.indexOf(`
`,n);v==-1&&(v=e.length);var K=e.slice(n,e.charAt(v-1)=="\r"?v-1:v),te=K.indexOf("\r");te!=-1?(d.push(K.slice(0,te)),n+=te+1):(d.push(K),n=v+1)}return d}:function(e){return e.split(/\r\n?|\n/)},cn=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(d){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},rn=function(){var e=h("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),In=null;function ur(e){if(In!=null)return In;var n=g(e,h("span","x")),d=n.getBoundingClientRect(),l=w(n,0,1).getBoundingClientRect();return In=Math.abs(d.left-l.left)>1}var mr={},Qn={};function yr(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),mr[e]=n}function Sr(e,n){Qn[e]=n}function Nn(e){if(typeof e=="string"&&Qn.hasOwnProperty(e))e=Qn[e];else if(e&&typeof e.name=="string"&&Qn.hasOwnProperty(e.name)){var n=Qn[e.name];typeof n=="string"&&(n={name:n}),e=$(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Nn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Nn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ar(e,n){n=Nn(n);var d=mr[n.name];if(!d)return Ar(e,"text/plain");var l=d(e,n);if(An.hasOwnProperty(n.name)){var v=An[n.name];for(var K in v){if(!v.hasOwnProperty(K))continue;l.hasOwnProperty(K)&&(l["_"+K]=l[K]),l[K]=v[K]}}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var te in n.modeProps)l[te]=n.modeProps[te];return l}var An={};function Dn(e,n){var d=An.hasOwnProperty(e)?An[e]:An[e]={};y(n,d)}function qn(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var d={};for(var l in n){var v=n[l];v instanceof Array&&(v=v.concat([])),d[l]=v}return d}function fr(e,n){for(var d;e.innerMode&&!(d=e.innerMode(n),!d||d.mode==e);)n=d.state,e=d.mode;return d||{mode:e,state:n}}function Lr(e,n,d){return e.startState?e.startState(n,d):!0}var Or=function(e,n,d){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=d};Or.prototype.eol=function(){return this.pos>=this.string.length},Or.prototype.sol=function(){return this.pos==this.lineStart},Or.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Or.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Or.prototype.eat=function(e){var n=this.string.charAt(this.pos),d;if(typeof e=="string"?d=n==e:d=n&&(e.test?e.test(n):e(n)),d)return++this.pos,n},Or.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},Or.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Or.prototype.skipToEnd=function(){this.pos=this.string.length},Or.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},Or.prototype.backUp=function(e){this.pos-=e},Or.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Or.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Or.prototype.match=function(e,n,d){if(typeof e=="string"){var l=function(te){return d?te.toLowerCase():te},v=this.string.substr(this.pos,e.length);if(l(v)==l(e))return n!==!1&&(this.pos+=e.length),!0}else{var K=this.string.slice(this.pos).match(e);return K&&K.index>0?null:(K&&n!==!1&&(this.pos+=K[0].length),K)}},Or.prototype.current=function(){return this.string.slice(this.start,this.pos)},Or.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},Or.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},Or.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function at(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var d=e;!d.lines;)for(var l=0;;++l){var v=d.children[l],K=v.chunkSize();if(n<K){d=v;break}n-=K}return d.lines[n]}function Fe(e,n,d){var l=[],v=n.line;return e.iter(n.line,d.line+1,function(K){var te=K.text;v==d.line&&(te=te.slice(0,d.ch)),v==n.line&&(te=te.slice(n.ch)),l.push(te),++v}),l}function pt(e,n,d){var l=[];return e.iter(n,d,function(v){l.push(v.text)}),l}function Le(e,n){var d=n-e.height;if(d)for(var l=e;l;l=l.parent)l.height+=d}function xe(e){if(e.parent==null)return null;for(var n=e.parent,d=se(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var v=0;!(l.children[v]==n);++v)d+=l.children[v].chunkSize();return d+n.first}function ge(e,n){var d=e.first;e:do{for(var l=0;l<e.children.length;++l){var v=e.children[l],K=v.height;if(n<K){e=v;continue e}n-=K,d+=v.chunkSize()}return d}while(!e.lines);for(var te=0;te<e.lines.length;++te){var ie=e.lines[te],oe=ie.height;if(n<oe)break;n-=oe}return d+te}function Hn(e,n){return n>=e.first&&n<e.first+e.size}function Lt(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function ke(e,n,d){if(d===void 0&&(d=null),!(this instanceof ke))return new ke(e,n,d);this.line=e,this.ch=n,this.sticky=d}function ut(e,n){return e.line-n.line||e.ch-n.ch}function Re(e,n){return e.sticky==n.sticky&&ut(e,n)==0}function tn(e){return ke(e.line,e.ch)}function cr(e,n){return ut(e,n)<0?n:e}function pr(e,n){return ut(e,n)<0?e:n}function Kn(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function jt(e,n){if(n.line<e.first)return ke(e.first,0);var d=e.first+e.size-1;return n.line>d?ke(d,at(e,d).text.length):dr(n,at(e,n.line).text.length)}function dr(e,n){var d=e.ch;return d==null||d>n?ke(e.line,n):d<0?ke(e.line,0):e}function ct(e,n){for(var d=[],l=0;l<n.length;l++)d[l]=jt(e,n[l]);return d}var Un=function(e,n){this.state=e,this.lookAhead=n},yn=function(e,n,d,l){this.state=n,this.doc=e,this.line=d,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};yn.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},yn.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},yn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},yn.fromSaved=function(e,n,d){return n instanceof Un?new yn(e,qn(e.mode,n.state),d,n.lookAhead):new yn(e,qn(e.mode,n),d)},yn.prototype.save=function(e){var n=e!==!1?qn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Un(n,this.maxLookAhead):n};function ln(e,n,d,l){var v=[e.state.modeGen],K={};Fn(e,n.text,e.doc.mode,d,function(_e,je){return v.push(_e,je)},K,l);for(var te=d.state,ie=function(_e){d.baseTokens=v;var je=e.state.overlays[_e],Ve=1,dt=0;d.state=!0,Fn(e,n.text,je.mode,d,function(st,Rt){for(var Ht=Ve;dt<st;){var en=v[Ve];en>st&&v.splice(Ve,1,st,v[Ve+1],en),Ve+=2,dt=Math.min(st,en)}if(!Rt)return;if(je.opaque)v.splice(Ht,Ve-Ht,st,"overlay "+Rt),Ve=Ht+2;else for(;Ht<Ve;Ht+=2){var Tn=v[Ht+1];v[Ht+1]=(Tn?Tn+" ":"")+"overlay "+Rt}},K),d.state=te,d.baseTokens=null,d.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)ie(oe);return{styles:v,classes:K.bgClass||K.textClass?K:null}}function Xt(e,n,d){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=Pn(e,xe(n)),v=n.text.length>e.options.maxHighlightLength&&qn(e.doc.mode,l.state),K=ln(e,n,l);v&&(l.state=v),n.stateAfter=l.save(!v),n.styles=K.styles,K.classes?n.styleClasses=K.classes:n.styleClasses&&(n.styleClasses=null),d===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function Pn(e,n,d){var l=e.doc,v=e.display;if(!l.mode.startState)return new yn(l,!0,n);var K=bn(e,n,d),te=K>l.first&&at(l,K-1).stateAfter,ie=te?yn.fromSaved(l,te,K):new yn(l,Lr(l.mode),K);return l.iter(K,n,function(oe){hn(e,oe.text,ie);var _e=ie.line;oe.stateAfter=_e==n-1||_e%5==0||_e>=v.viewFrom&&_e<v.viewTo?ie.save():null,ie.nextLine()}),d&&(l.modeFrontier=ie.line),ie}function hn(e,n,d,l){var v=e.doc.mode,K=new Or(n,e.options.tabSize,d);for(K.start=K.pos=l||0,n==""&&qt(v,d.state);!K.eol();)Mt(v,K,d.state),K.start=K.pos}function qt(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var d=fr(e,n);if(d.mode.blankLine)return d.mode.blankLine(d.state)}function Mt(e,n,d,l){for(var v=0;v<10;v++){l&&(l[0]=fr(e,d).mode);var K=e.token(n,d);if(n.pos>n.start)return K}throw new Error("Mode "+e.name+" failed to advance stream.")}var Kt=function(e,n,d){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=d};function ar(e,n,d,l){var v=e.doc,K=v.mode,te;n=jt(v,n);var ie=at(v,n.line),oe=Pn(e,n.line,d),_e=new Or(ie.text,e.options.tabSize,oe),je;for(l&&(je=[]);(l||_e.pos<n.ch)&&!_e.eol();)_e.start=_e.pos,te=Mt(K,_e,oe.state),l&&je.push(new Kt(_e,te,qn(v.mode,oe.state)));return l?je:new Kt(_e,te,oe.state)}function sr(e,n){if(e)for(;;){var d=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!d)break;e=e.slice(0,d.index)+e.slice(d.index+d[0].length);var l=d[1]?"bgClass":"textClass";n[l]==null?n[l]=d[2]:new RegExp("(?:^|\\s)"+d[2]+"(?:$|\\s)").test(n[l])||(n[l]+=" "+d[2])}return e}function Fn(e,n,d,l,v,K,te){var ie=d.flattenSpans;ie==null&&(ie=e.options.flattenSpans);var oe=0,_e=null,je=new Or(n,e.options.tabSize,l),Ve,dt=e.options.addModeClass&&[null];for(n==""&&sr(qt(d,l.state),K);!je.eol();){if(je.pos>e.options.maxHighlightLength?(ie=!1,te&&hn(e,n,l,je.pos),je.pos=n.length,Ve=null):Ve=sr(Mt(d,je,l.state,dt),K),dt){var st=dt[0].name;st&&(Ve="m-"+(Ve?st+" "+Ve:st))}if(!ie||_e!=Ve){for(;oe<je.start;)oe=Math.min(je.start,oe+5e3),v(oe,_e);_e=Ve}je.start=je.pos}for(;oe<je.pos;){var Rt=Math.min(je.pos,oe+5e3);v(Rt,_e),oe=Rt}}function bn(e,n,d){for(var l,v,K=e.doc,te=d?-1:n-(e.doc.mode.innerMode?1e3:100),ie=n;ie>te;--ie){if(ie<=K.first)return K.first;var oe=at(K,ie-1),_e=oe.stateAfter;if(_e&&(!d||ie+(_e instanceof Un?_e.lookAhead:0)<=K.modeFrontier))return ie;var je=H(oe.text,null,e.options.tabSize);(v==null||l>je)&&(v=ie-1,l=je)}return v}function Ut(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),e.highlightFrontier<n-10)return;for(var d=e.first,l=n-1;l>d;l--){var v=at(e,l).stateAfter;if(v&&(!(v instanceof Un)||l+v.lookAhead<n)){d=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,d)}var Vt=!1,Gt=!1;function Dt(){Vt=!0}function Zn(){Gt=!0}function On(e,n,d){this.marker=e,this.from=n,this.to=d}function fn(e,n){if(e)for(var d=0;d<e.length;++d){var l=e[d];if(l.marker==n)return l}}function Vn(e,n){for(var d,l=0;l<e.length;++l)e[l]!=n&&(d||(d=[])).push(e[l]);return d}function un(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function _n(e,n,d){var l;if(e)for(var v=0;v<e.length;++v){var K=e[v],te=K.marker,ie=K.from==null||(te.inclusiveLeft?K.from<=n:K.from<n);if(ie||K.from==n&&te.type=="bookmark"&&(!d||!K.marker.insertLeft)){var oe=K.to==null||(te.inclusiveRight?K.to>=n:K.to>n);(l||(l=[])).push(new On(te,K.from,oe?null:K.to))}}return l}function Zt(e,n,d){var l;if(e)for(var v=0;v<e.length;++v){var K=e[v],te=K.marker,ie=K.to==null||(te.inclusiveRight?K.to>=n:K.to>n);if(ie||K.from==n&&te.type=="bookmark"&&(!d||K.marker.insertLeft)){var oe=K.from==null||(te.inclusiveLeft?K.from<=n:K.from<n);(l||(l=[])).push(new On(te,oe?null:K.from-n,K.to==null?null:K.to-n))}}return l}function kn(e,n){if(n.full)return null;var d=Hn(e,n.from.line)&&at(e,n.from.line).markedSpans,l=Hn(e,n.to.line)&&at(e,n.to.line).markedSpans;if(!d&&!l)return null;var v=n.from.ch,K=n.to.ch,te=ut(n.from,n.to)==0,ie=_n(d,v,te),oe=Zt(l,K,te),_e=n.text.length==1,je=_(n.text).length+(_e?v:0);if(ie)for(var Ve=0;Ve<ie.length;++Ve){var dt=ie[Ve];if(dt.to==null){var st=fn(oe,dt.marker);st?_e&&(dt.to=st.to==null?null:st.to+je):dt.to=v}}if(oe)for(var Rt=0;Rt<oe.length;++Rt){var Ht=oe[Rt];if(Ht.to!=null&&(Ht.to+=je),Ht.from==null){var en=fn(ie,Ht.marker);en||(Ht.from=je,_e&&(ie||(ie=[])).push(Ht))}else Ht.from+=je,_e&&(ie||(ie=[])).push(Ht)}ie&&(ie=er(ie)),oe&&oe!=ie&&(oe=er(oe));var Tn=[ie];if(!_e){var Yn=n.text.length-2,Sn;if(Yn>0&&ie)for(var lr=0;lr<ie.length;++lr)ie[lr].to==null&&(Sn||(Sn=[])).push(new On(ie[lr].marker,null,null));for(var Rr=0;Rr<Yn;++Rr)Tn.push(Sn);Tn.push(oe)}return Tn}function er(e){for(var n=0;n<e.length;++n){var d=e[n];d.from!=null&&d.from==d.to&&d.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function tr(e,n,d){var l=null;if(e.iter(n.line,d.line+1,function(st){if(st.markedSpans)for(var Rt=0;Rt<st.markedSpans.length;++Rt){var Ht=st.markedSpans[Rt].marker;Ht.readOnly&&(!l||se(l,Ht)==-1)&&(l||(l=[])).push(Ht)}}),!l)return null;for(var v=[{from:n,to:d}],K=0;K<l.length;++K)for(var te=l[K],ie=te.find(0),oe=0;oe<v.length;++oe){var _e=v[oe];if(ut(_e.to,ie.from)<0||ut(_e.from,ie.to)>0)continue;var je=[oe,1],Ve=ut(_e.from,ie.from),dt=ut(_e.to,ie.to);(Ve<0||!te.inclusiveLeft&&!Ve)&&je.push({from:_e.from,to:ie.from}),(dt>0||!te.inclusiveRight&&!dt)&&je.push({from:ie.to,to:_e.to}),v.splice.apply(v,je),oe+=je.length-3}return v}function wn(e){var n=e.markedSpans;if(!n)return;for(var d=0;d<n.length;++d)n[d].marker.detachLine(e);e.markedSpans=null}function Mn(e,n){if(!n)return;for(var d=0;d<n.length;++d)n[d].marker.attachLine(e);e.markedSpans=n}function dn(e){return e.inclusiveLeft?-1:0}function or(e){return e.inclusiveRight?1:0}function Xn(e,n){var d=e.lines.length-n.lines.length;if(d!=0)return d;var l=e.find(),v=n.find(),K=ut(l.from,v.from)||dn(e)-dn(n);if(K)return-K;var te=ut(l.to,v.to)||or(e)-or(n);return te||n.id-e.id}function vr(e,n){var d=Gt&&e.markedSpans,l;if(d)for(var v=void 0,K=0;K<d.length;++K)v=d[K],v.marker.collapsed&&(n?v.from:v.to)==null&&(!l||Xn(l,v.marker)<0)&&(l=v.marker);return l}function gr(e){return vr(e,!0)}function Gn(e){return vr(e,!1)}function Bn(e,n){var d=Gt&&e.markedSpans,l;if(d)for(var v=0;v<d.length;++v){var K=d[v];K.marker.collapsed&&(K.from==null||K.from<n)&&(K.to==null||K.to>n)&&(!l||Xn(l,K.marker)<0)&&(l=K.marker)}return l}function _r(e,n,d,l,v){var K=at(e,n),te=Gt&&K.markedSpans;if(te)for(var ie=0;ie<te.length;++ie){var oe=te[ie];if(!oe.marker.collapsed)continue;var _e=oe.marker.find(0),je=ut(_e.from,d)||dn(oe.marker)-dn(v),Ve=ut(_e.to,l)||or(oe.marker)-or(v);if(je>=0&&Ve<=0||je<=0&&Ve>=0)continue;if(je<=0&&(oe.marker.inclusiveRight&&v.inclusiveLeft?ut(_e.to,d)>=0:ut(_e.to,d)>0)||je>=0&&(oe.marker.inclusiveRight&&v.inclusiveLeft?ut(_e.from,l)<=0:ut(_e.from,l)<0))return!0}}function Rn(e){for(var n;n=gr(e);)e=n.find(-1,!0).line;return e}function En(e){for(var n;n=Gn(e);)e=n.find(1,!0).line;return e}function Cn(e){for(var n,d;n=Gn(e);)e=n.find(1,!0).line,(d||(d=[])).push(e);return d}function vn(e,n){var d=at(e,n),l=Rn(d);return d==l?n:xe(l)}function Qt(e,n){if(n>e.lastLine())return n;var d=at(e,n),l;if(!St(e,d))return n;for(;l=Gn(d);)d=l.find(1,!0).line;return xe(d)+1}function St(e,n){var d=Gt&&n.markedSpans;if(d)for(var l=void 0,v=0;v<d.length;++v){if(l=d[v],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&It(e,n,l))return!0}}function It(e,n,d){if(d.to==null){var l=d.marker.find(1,!0);return It(e,l.line,fn(l.line.markedSpans,d.marker))}if(d.marker.inclusiveRight&&d.to==n.text.length)return!0;for(var v=void 0,K=0;K<n.markedSpans.length;++K)if(v=n.markedSpans[K],v.marker.collapsed&&!v.marker.widgetNode&&v.from==d.to&&(v.to==null||v.to!=d.from)&&(v.marker.inclusiveLeft||d.marker.inclusiveRight)&&It(e,n,v))return!0}function kt(e){e=Rn(e);for(var n=0,d=e.parent,l=0;l<d.lines.length;++l){var v=d.lines[l];if(v==e)break;n+=v.height}for(var K=d.parent;K;d=K,K=d.parent)for(var te=0;te<K.children.length;++te){var ie=K.children[te];if(ie==d)break;n+=ie.height}return n}function At(e){if(e.height==0)return 0;for(var n=e.text.length,d,l=e;d=gr(l);){var v=d.find(0,!0);l=v.from.line,n+=v.from.ch-v.to.ch}for(l=e;d=Gn(l);){var K=d.find(0,!0);n-=l.text.length-K.from.ch,l=K.to.line,n+=l.text.length-K.to.ch}return n}function zt(e){var n=e.display,d=e.doc;n.maxLine=at(d,d.first),n.maxLineLength=At(n.maxLine),n.maxLineChanged=!0,d.iter(function(l){var v=At(l);v>n.maxLineLength&&(n.maxLineLength=v,n.maxLine=l)})}var sn=function(e,n,d){this.text=e,Mn(this,n),this.height=d?d(this):1};sn.prototype.lineNo=function(){return xe(this)},Ce(sn);function nn(e,n,d,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),wn(e),Mn(e,d);var v=l?l(e):1;v!=e.height&&Le(e,v)}function ft(e){e.parent=null,wn(e)}var rt={},$e={};function Ze(e,n){if(!e||/^\s*$/.test(e))return null;var d=n.addModeClass?$e:rt;return d[e]||(d[e]=e.replace(/\S+/g,"cm-$&"))}function He(e,n){var d=O("span",null,null,r?"padding-right: .1px":null),l={pre:O("pre",[d],"CodeMirror-line"),content:d,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var v=0;v<=(n.rest?n.rest.length:0);v++){var K=v?n.rest[v-1]:n.line,te=void 0;l.pos=0,l.addToken=et,ir(e.display.measure)&&(te=Yt(K,e.doc.direction))&&(l.addToken=Tt(l.addToken,te)),l.map=[];var ie=n!=e.display.externalMeasured&&xe(K);Pt(K,l,Xt(e,K,ie)),K.styleClasses&&(K.styleClasses.bgClass&&(l.bgClass=C(K.styleClasses.bgClass,l.bgClass||"")),K.styleClasses.textClass&&(l.textClass=C(K.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Ot(e.display.measure))),v==0?(n.measure.map=l.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(l.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(r){var oe=l.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return ye(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=C(l.pre.className,l.textClass||"")),l}function ot(e){var n=h("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function et(e,n,d,l,v,K,te){if(!n)return;var ie=e.splitSpaces?mt(n,e.trailingSpace):n,oe=e.cm.state.specialChars,_e=!1,je;if(!oe.test(n))e.col+=n.length,je=document.createTextNode(ie),e.map.push(e.pos,e.pos+n.length,je),Y&&X<9&&(_e=!0),e.pos+=n.length;else{je=document.createDocumentFragment();for(var Ve=0;;){oe.lastIndex=Ve;var dt=oe.exec(n),st=dt?dt.index-Ve:n.length-Ve;if(st){var Rt=document.createTextNode(ie.slice(Ve,Ve+st));Y&&X<9?je.appendChild(h("span",[Rt])):je.appendChild(Rt),e.map.push(e.pos,e.pos+st,Rt),e.col+=st,e.pos+=st}if(!dt)break;Ve+=st+1;var Ht=void 0;if(dt[0]==" "){var en=e.cm.options.tabSize,Tn=en-e.col%en;Ht=je.appendChild(h("span",q(Tn),"cm-tab")),Ht.setAttribute("role","presentation"),Ht.setAttribute("cm-text"," "),e.col+=Tn}else dt[0]=="\r"||dt[0]==`
`?(Ht=je.appendChild(h("span",dt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ht.setAttribute("cm-text",dt[0]),e.col+=1):(Ht=e.cm.options.specialCharPlaceholder(dt[0]),Ht.setAttribute("cm-text",dt[0]),Y&&X<9?je.appendChild(h("span",[Ht])):je.appendChild(Ht),e.col+=1);e.map.push(e.pos,e.pos+1,Ht),e.pos++}}if(e.trailingSpace=ie.charCodeAt(n.length-1)==32,d||l||v||_e||K||te){var Yn=d||"";l&&(Yn+=l),v&&(Yn+=v);var Sn=h("span",[je],Yn,K);if(te)for(var lr in te)te.hasOwnProperty(lr)&&lr!="style"&&lr!="class"&&Sn.setAttribute(lr,te[lr]);return e.content.appendChild(Sn)}e.content.appendChild(je)}function mt(e,n){if(e.length>1&&!/ /.test(e))return e;for(var d=n,l="",v=0;v<e.length;v++){var K=e.charAt(v);K==" "&&d&&(v==e.length-1||e.charCodeAt(v+1)==32)&&(K="\xA0"),l+=K,d=K==" "}return l}function Tt(e,n){return function(d,l,v,K,te,ie,oe){v=v?v+" cm-force-border":"cm-force-border";for(var _e=d.pos,je=_e+l.length;;){for(var Ve=void 0,dt=0;dt<n.length&&!(Ve=n[dt],Ve.to>_e&&Ve.from<=_e);dt++);if(Ve.to>=je)return e(d,l,v,K,te,ie,oe);e(d,l.slice(0,Ve.to-_e),v,K,null,ie,oe),K=null,l=l.slice(Ve.to-_e),_e=Ve.to}}}function gt(e,n,d,l){var v=!l&&d.widgetNode;v&&e.map.push(e.pos,e.pos+n,v),!l&&e.cm.display.input.needsContentAttribute&&(v||(v=e.content.appendChild(document.createElement("span"))),v.setAttribute("cm-marker",d.id)),v&&(e.cm.display.input.setUneditable(v),e.content.appendChild(v)),e.pos+=n,e.trailingSpace=!1}function Pt(e,n,d){var l=e.markedSpans,v=e.text,K=0;if(!l){for(var te=1;te<d.length;te+=2)n.addToken(n,v.slice(K,K=d[te]),Ze(d[te+1],n.cm.options));return}for(var ie=v.length,oe=0,_e=1,je="",Ve,dt,st=0,Rt,Ht,en,Tn,Yn;;){if(st==oe){Rt=Ht=en=dt="",Yn=null,Tn=null,st=Infinity;for(var Sn=[],lr=void 0,Rr=0;Rr<l.length;++Rr){var Cr=l[Rr],Dr=Cr.marker;if(Dr.type=="bookmark"&&Cr.from==oe&&Dr.widgetNode)Sn.push(Dr);else if(Cr.from<=oe&&(Cr.to==null||Cr.to>oe||Dr.collapsed&&Cr.to==oe&&Cr.from==oe)){if(Cr.to!=null&&Cr.to!=oe&&st>Cr.to&&(st=Cr.to,Ht=""),Dr.className&&(Rt+=" "+Dr.className),Dr.css&&(dt=(dt?dt+";":"")+Dr.css),Dr.startStyle&&Cr.from==oe&&(en+=" "+Dr.startStyle),Dr.endStyle&&Cr.to==st&&(lr||(lr=[])).push(Dr.endStyle,Cr.to),Dr.title&&((Yn||(Yn={})).title=Dr.title),Dr.attributes)for(var Wr in Dr.attributes)(Yn||(Yn={}))[Wr]=Dr.attributes[Wr];Dr.collapsed&&(!Tn||Xn(Tn.marker,Dr)<0)&&(Tn=Cr)}else Cr.from>oe&&st>Cr.from&&(st=Cr.from)}if(lr)for(var ri=0;ri<lr.length;ri+=2)lr[ri+1]==st&&(Ht+=" "+lr[ri]);if(!Tn||Tn.from==oe)for(var zr=0;zr<Sn.length;++zr)gt(n,0,Sn[zr]);if(Tn&&(Tn.from||0)==oe){if(gt(n,(Tn.to==null?ie+1:Tn.to)-oe,Tn.marker,Tn.from==null),Tn.to==null)return;Tn.to==oe&&(Tn=!1)}}if(oe>=ie)break;for(var Ei=Math.min(ie,st);;){if(je){var gi=oe+je.length;if(!Tn){var Qr=gi>Ei?je.slice(0,Ei-oe):je;n.addToken(n,Qr,Ve?Ve+Rt:Rt,en,oe+Qr.length==st?Ht:"",dt,Yn)}if(gi>=Ei){je=je.slice(Ei-oe),oe=Ei;break}oe=gi,en=""}je=v.slice(K,K=d[_e++]),Ve=Ze(d[_e++],n.cm.options)}}}function vt(e,n,d){this.line=n,this.rest=Cn(n),this.size=this.rest?xe(_(this.rest))-d+1:1,this.node=this.text=null,this.hidden=St(e,n)}function yt(e,n,d){for(var l=[],v,K=n;K<d;K=v){var te=new vt(e.doc,at(e.doc,K),K);v=K+te.size,l.push(te)}return l}var on=null;function $t(e){on?on.ops.push(e):e.ownsGroup=on={ops:[e],delayedCallbacks:[]}}function hr(e){var n=e.delayedCallbacks,d=0;do{for(;d<n.length;d++)n[d].call(null);for(var l=0;l<e.ops.length;l++){var v=e.ops[l];if(v.cursorActivityHandlers)for(;v.cursorActivityCalled<v.cursorActivityHandlers.length;)v.cursorActivityHandlers[v.cursorActivityCalled++].call(null,v.cm)}}while(d<n.length)}function jn(e,n){var d=e.ownsGroup;if(!d)return;try{hr(d)}finally{on=null,n(d)}}var Wn=null;function Ft(e,n){var d=bt(e,n);if(!d.length)return;var l=Array.prototype.slice.call(arguments,2),v;on?v=on.delayedCallbacks:Wn?v=Wn:(v=Wn=[],setTimeout(pn,0));for(var K=function(ie){v.push(function(){return d[ie].apply(null,l)})},te=0;te<d.length;++te)K(te)}function pn(){var e=Wn;Wn=null;for(var n=0;n<e.length;++n)e[n]()}function Ln(e,n,d,l){for(var v=0;v<n.changes.length;v++){var K=n.changes[v];K=="text"?jr(e,n):K=="gutter"?Jn(e,n,d,l):K=="class"?Er(e,n):K=="widget"&&xr(e,n,l)}n.changes=null}function zn(e){return e.node==e.text&&(e.node=h("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Y&&X<8&&(e.node.style.zIndex=2)),e.node}function mn(e,n){var d=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(d&&(d+=" CodeMirror-linebackground"),n.background)d?n.background.className=d:(n.background.parentNode.removeChild(n.background),n.background=null);else if(d){var l=zn(n);n.background=l.insertBefore(h("div",null,d),l.firstChild),e.display.input.setUneditable(n.background)}}function Ir(e,n){var d=e.display.externalMeasured;return d&&d.line==n.line?(e.display.externalMeasured=null,n.measure=d.measure,d.built):He(e,n)}function jr(e,n){var d=n.text.className,l=Ir(e,n);n.text==n.node&&(n.node=l.pre),n.text.parentNode.replaceChild(l.pre,n.text),n.text=l.pre,l.bgClass!=n.bgClass||l.textClass!=n.textClass?(n.bgClass=l.bgClass,n.textClass=l.textClass,Er(e,n)):d&&(n.text.className=d)}function Er(e,n){mn(e,n),n.line.wrapClass?zn(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var d=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=d||""}function Jn(e,n,d,l){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var v=zn(n);n.gutterBackground=h("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),v.insertBefore(n.gutterBackground,n.text)}var K=n.line.gutterMarkers;if(e.options.lineNumbers||K){var te=zn(n),ie=n.gutter=h("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ie),te.insertBefore(ie,n.text),n.line.gutterClass&&(ie.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!K||!K["CodeMirror-linenumbers"])&&(n.lineNumber=ie.appendChild(h("div",Lt(e.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),K)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var _e=e.display.gutterSpecs[oe].className,je=K.hasOwnProperty(_e)&&K[_e];je&&ie.appendChild(h("div",[je],"CodeMirror-gutter-elt","left: "+l.gutterLeft[_e]+"px; width: "+l.gutterWidth[_e]+"px"))}}}function xr(e,n,d){n.alignable&&(n.alignable=null);for(var l=I("CodeMirror-linewidget"),v=n.node.firstChild,K=void 0;v;v=K)K=v.nextSibling,l.test(v.className)&&n.node.removeChild(v);wr(e,n,d)}function br(e,n,d,l){var v=Ir(e,n);return n.text=n.node=v.pre,v.bgClass&&(n.bgClass=v.bgClass),v.textClass&&(n.textClass=v.textClass),Er(e,n),Jn(e,n,d,l),wr(e,n,l),n.node}function wr(e,n,d){if(Ur(e,n.line,n,d,!0),n.rest)for(var l=0;l<n.rest.length;l++)Ur(e,n.rest[l],n,d,!1)}function Ur(e,n,d,l,v){if(!n.widgets)return;for(var K=zn(d),te=0,ie=n.widgets;te<ie.length;++te){var oe=ie[te],_e=h("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||_e.setAttribute("cm-ignore-events","true"),Vr(oe,_e,d,l),e.display.input.setUneditable(_e),v&&oe.above?K.insertBefore(_e,d.gutter||d.text):K.appendChild(_e),Ft(oe,"redraw")}}function Vr(e,n,d,l){if(e.noHScroll){(d.alignable||(d.alignable=[])).push(n);var v=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(v-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=v+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-l.gutterTotalWidth+"px"))}function Fr(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!b(document.body,e.node)){var d="position: relative;";e.coverGutter&&(d+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(d+="width: "+n.display.wrapper.clientWidth+"px;"),g(n.display.measure,h("div",[e.node],null,d))}return e.height=e.node.parentNode.offsetHeight}function kr(e,n){for(var d=Me(n);d!=e.wrapper;d=d.parentNode)if(!d||d.nodeType==1&&d.getAttribute("cm-ignore-events")=="true"||d.parentNode==e.sizer&&d!=e.mover)return!0}function Ti(e){return e.lineSpace.offsetTop}function Kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Si(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=g(e.measure,h("pre","x","CodeMirror-line-like")),d=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,l={left:parseInt(d.paddingLeft),right:parseInt(d.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function qr(e){return fe-e.display.nativeBarWidth}function ei(e){return e.display.scroller.clientWidth-qr(e)-e.display.barWidth}function yi(e){return e.display.scroller.clientHeight-qr(e)-e.display.barHeight}function Ri(e,n,d){var l=e.options.lineWrapping,v=l&&ei(e);if(!n.measure.heights||l&&n.measure.width!=v){var K=n.measure.heights=[];if(l){n.measure.width=v;for(var te=n.text.firstChild.getClientRects(),ie=0;ie<te.length-1;ie++){var oe=te[ie],_e=te[ie+1];Math.abs(oe.bottom-_e.bottom)>2&&K.push((oe.bottom+_e.top)/2-d.top)}}K.push(d.bottom-d.top)}}function Va(e,n,d){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==n)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var v=0;v<e.rest.length;v++)if(xe(e.rest[v])>d)return{map:e.measure.maps[v],cache:e.measure.caches[v],before:!0}}function fi(e,n){n=Rn(n);var d=xe(n),l=e.display.externalMeasured=new vt(e.doc,n,d);l.lineN=d;var v=l.built=He(e,l);return l.text=v.pre,g(e.display.lineMeasure,v.pre),l}function Xa(e,n,d,l){return ai(e,ki(e,n),d,l)}function Ki(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[zi(e,n)];var d=e.display.externalMeasured;if(d&&n>=d.lineN&&n<d.lineN+d.size)return d}function ki(e,n){var d=xe(n),l=Ki(e,d);l&&!l.text?l=null:l&&l.changes&&(Ln(e,l,d,As(e)),e.curOp.forceUpdate=!0),l||(l=fi(e,n));var v=Va(l,n,d);return{line:n,view:l,rect:null,map:v.map,cache:v.cache,before:v.before,hasHeights:!1}}function ai(e,n,d,l,v){n.before&&(d=-1);var K=d+(l||""),te;return n.cache.hasOwnProperty(K)?te=n.cache[K]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Ri(e,n.view,n.rect),n.hasHeights=!0),te=Es(e,n,d,l),te.bogus||(n.cache[K]=te)),{left:te.left,right:te.right,top:v?te.rtop:te.top,bottom:v?te.rbottom:te.bottom}}var Ji={left:0,right:0,top:0,bottom:0};function ys(e,n,d){for(var l,v,K,te,ie,oe,_e=0;_e<e.length;_e+=3)if(ie=e[_e],oe=e[_e+1],n<ie?(v=0,K=1,te="left"):n<oe?(v=n-ie,K=v+1):(_e==e.length-3||n==oe&&e[_e+3]>n)&&(K=oe-ie,v=K-1,n>=oe&&(te="right")),v!=null){if(l=e[_e+2],ie==oe&&d==(l.insertLeft?"left":"right")&&(te=d),d=="left"&&v==0)for(;_e&&e[_e-2]==e[_e-3]&&e[_e-1].insertLeft;)l=e[(_e-=3)+2],te="left";if(d=="right"&&v==oe-ie)for(;_e<e.length-3&&e[_e+3]==e[_e+4]&&!e[_e+5].insertLeft;)l=e[(_e+=3)+2],te="right";break}return{node:l,start:v,end:K,collapse:te,coverStart:ie,coverEnd:oe}}function bs(e,n){var d=Ji;if(n=="left")for(var l=0;l<e.length&&!((d=e[l]).left!=d.right);l++);else for(var v=e.length-1;v>=0&&!((d=e[v]).left!=d.right);v--);return d}function Es(e,n,d,l){var v=ys(n.map,d,l),K=v.node,te=v.start,ie=v.end,oe=v.collapse,_e;if(K.nodeType==3){for(var je=0;je<4;je++){for(;te&&Ye(n.line.text.charAt(v.coverStart+te));)--te;for(;v.coverStart+ie<v.coverEnd&&Ye(n.line.text.charAt(v.coverStart+ie));)++ie;if(Y&&X<9&&te==0&&ie==v.coverEnd-v.coverStart?_e=K.parentNode.getBoundingClientRect():_e=bs(w(K,te,ie).getClientRects(),l),_e.left||_e.right||te==0)break;ie=te,te=te-1,oe="right"}Y&&X<11&&(_e=co(e.display.measure,_e))}else{te>0&&(oe=l="right");var Ve;e.options.lineWrapping&&(Ve=K.getClientRects()).length>1?_e=Ve[l=="right"?Ve.length-1:0]:_e=K.getBoundingClientRect()}if(Y&&X<9&&!te&&(!_e||!_e.left&&!_e.right)){var dt=K.parentNode.getClientRects()[0];dt?_e={left:dt.left,right:dt.left+Zi(e.display),top:dt.top,bottom:dt.bottom}:_e=Ji}for(var st=_e.top-n.rect.top,Rt=_e.bottom-n.rect.top,Ht=(st+Rt)/2,en=n.view.measure.heights,Tn=0;Tn<en.length-1&&!(Ht<en[Tn]);Tn++);var Yn=Tn?en[Tn-1]:0,Sn=en[Tn],lr={left:(oe=="right"?_e.right:_e.left)-n.rect.left,right:(oe=="left"?_e.left:_e.right)-n.rect.left,top:Yn,bottom:Sn};return!_e.left&&!_e.right&&(lr.bogus=!0),e.options.singleCursorHeightPerLine||(lr.rtop=st,lr.rbottom=Rt),lr}function co(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ur(e))return n;var d=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*d,right:n.right*d,top:n.top*l,bottom:n.bottom*l}}function ho(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function xs(e){e.display.externalMeasure=null,x(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)ho(e.display.view[n])}function Ca(e){xs(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function fo(){return m&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function po(){return m&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ws(e){var n=0;if(e.widgets)for(var d=0;d<e.widgets.length;++d)e.widgets[d].above&&(n+=Fr(e.widgets[d]));return n}function $a(e,n,d,l,v){if(!v){var K=ws(n);d.top+=K,d.bottom+=K}if(l=="line")return d;l||(l="local");var te=kt(n);if(l=="local"?te+=Ti(e.display):te-=e.display.viewOffset,l=="page"||l=="window"){var ie=e.display.lineSpace.getBoundingClientRect();te+=ie.top+(l=="window"?0:po());var oe=ie.left+(l=="window"?0:fo());d.left+=oe,d.right+=oe}return d.top+=te,d.bottom+=te,d}function Cs(e,n,d){if(d=="div")return n;var l=n.left,v=n.top;if(d=="page")l-=fo(),v-=po();else if(d=="local"||!d){var K=e.display.sizer.getBoundingClientRect();l+=K.left,v+=K.top}var te=e.display.lineSpace.getBoundingClientRect();return{left:l-te.left,top:v-te.top}}function Ts(e,n,d,l,v){return l||(l=at(e.doc,n.line)),$a(e,l,Xa(e,l,n.ch,v),d)}function xi(e,n,d,l,v,K){l=l||at(e.doc,n.line),v||(v=ki(e,l));function te(Rt,Ht){var en=ai(e,v,Rt,Ht?"right":"left",K);return Ht?en.left=en.right:en.right=en.left,$a(e,l,en,d)}var ie=Yt(l,e.doc.direction),oe=n.ch,_e=n.sticky;if(oe>=l.text.length?(oe=l.text.length,_e="before"):oe<=0&&(oe=0,_e="after"),!ie)return te(_e=="before"?oe-1:oe,_e=="before");function je(Rt,Ht,en){var Tn=ie[Ht],Yn=Tn.level==1;return te(en?Rt-1:Rt,Yn!=en)}var Ve=Wt(ie,oe,_e),dt=Bt,st=je(oe,Ve,_e=="before");return dt!=null&&(st.other=je(oe,dt,_e!="before")),st}function mo(e,n){var d=0;n=jt(e.doc,n),e.options.lineWrapping||(d=Zi(e.display)*n.ch);var l=at(e.doc,n.line),v=kt(l)+Ti(e.display);return{left:d,right:d,top:v,bottom:v+l.height}}function Ss(e,n,d,l,v){var K=ke(e,n,d);return K.xRel=v,l&&(K.outside=l),K}function Rs(e,n,d){var l=e.doc;if(d+=e.display.viewOffset,d<0)return Ss(l.first,0,null,-1,-1);var v=ge(l,d),K=l.first+l.size-1;if(v>K)return Ss(l.first+l.size-1,at(l,K).text.length,null,1,1);n<0&&(n=0);for(var te=at(l,v);;){var ie=El(e,te,v,n,d),oe=Bn(te,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!oe)return ie;var _e=oe.find(1);if(_e.line==v)return _e;te=at(l,v=_e.line)}}function go(e,n,d,l){l-=ws(n);var v=n.text.length,K=ht(function(te){return ai(e,d,te-1).bottom<=l},v,0);return v=ht(function(te){return ai(e,d,te).top>l},K,v),{begin:K,end:v}}function vo(e,n,d,l){d||(d=ki(e,n));var v=$a(e,n,ai(e,d,l),"line").top;return go(e,n,d,v)}function Os(e,n,d,l){return e.bottom<=d?!1:e.top>d?!0:(l?e.left:e.right)>n}function El(e,n,d,l,v){v-=kt(n);var K=ki(e,n),te=ws(n),ie=0,oe=n.text.length,_e=!0,je=Yt(n,e.doc.direction);if(je){var Ve=(e.options.lineWrapping?Ya:Ta)(e,n,d,K,je,l,v);_e=Ve.level!=1,ie=_e?Ve.from:Ve.to-1,oe=_e?Ve.to:Ve.from-1}var dt=null,st=null,Rt=ht(function(Rr){var Cr=ai(e,K,Rr);return Cr.top+=te,Cr.bottom+=te,Os(Cr,l,v,!1)?(Cr.top<=v&&Cr.left<=l&&(dt=Rr,st=Cr),!0):!1},ie,oe),Ht,en,Tn=!1;if(st){var Yn=l-st.left<st.right-l,Sn=Yn==_e;Rt=dt+(Sn?0:1),en=Sn?"after":"before",Ht=Yn?st.left:st.right}else{!_e&&(Rt==oe||Rt==ie)&&Rt++,en=Rt==0?"after":Rt==n.text.length?"before":ai(e,K,Rt-(_e?1:0)).bottom+te<=v==_e?"after":"before";var lr=xi(e,ke(d,Rt,en),"line",n,K);Ht=lr.left,Tn=v<lr.top?-1:v>=lr.bottom?1:0}return Rt=Xe(n.text,Rt,1),Ss(d,Rt,en,Tn,l-Ht)}function Ta(e,n,d,l,v,K,te){var ie=ht(function(Ve){var dt=v[Ve],st=dt.level!=1;return Os(xi(e,ke(d,st?dt.to:dt.from,st?"before":"after"),"line",n,l),K,te,!0)},0,v.length-1),oe=v[ie];if(ie>0){var _e=oe.level!=1,je=xi(e,ke(d,_e?oe.from:oe.to,_e?"after":"before"),"line",n,l);Os(je,K,te,!0)&&je.top>te&&(oe=v[ie-1])}return oe}function Ya(e,n,d,l,v,K,te){var ie=go(e,n,l,te),oe=ie.begin,_e=ie.end;/\s/.test(n.text.charAt(_e-1))&&_e--;for(var je=null,Ve=null,dt=0;dt<v.length;dt++){var st=v[dt];if(st.from>=_e||st.to<=oe)continue;var Rt=st.level!=1,Ht=ai(e,l,Rt?Math.min(_e,st.to)-1:Math.max(oe,st.from)).right,en=Ht<K?K-Ht+1e9:Ht-K;(!je||Ve>en)&&(je=st,Ve=en)}return je||(je=v[v.length-1]),je.from<oe&&(je={from:oe,to:je.to,level:je.level}),je.to>_e&&(je={from:je.from,to:_e,level:je.level}),je}var Oi;function qi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Oi==null){Oi=h("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)Oi.appendChild(document.createTextNode("x")),Oi.appendChild(h("br"));Oi.appendChild(document.createTextNode("x"))}g(e.measure,Oi);var d=Oi.offsetHeight/50;return d>3&&(e.cachedTextHeight=d),x(e.measure),d||1}function Zi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=h("span","xxxxxxxxxx"),d=h("pre",[n],"CodeMirror-line-like");g(e.measure,d);var l=n.getBoundingClientRect(),v=(l.right-l.left)/10;return v>2&&(e.cachedCharWidth=v),v||10}function As(e){for(var n=e.display,d={},l={},v=n.gutters.clientLeft,K=n.gutters.firstChild,te=0;K;K=K.nextSibling,++te){var ie=e.display.gutterSpecs[te].className;d[ie]=K.offsetLeft+K.clientLeft+v,l[ie]=K.clientWidth}return{fixedPos:Ds(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:d,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function Ds(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function _o(e){var n=qi(e.display),d=e.options.lineWrapping,l=d&&Math.max(5,e.display.scroller.clientWidth/Zi(e.display)-3);return function(v){if(St(e.doc,v))return 0;var K=0;if(v.widgets)for(var te=0;te<v.widgets.length;te++)v.widgets[te].height&&(K+=v.widgets[te].height);return d?K+(Math.ceil(v.text.length/l)||1)*n:K+n}}function Ps(e){var n=e.doc,d=_o(e);n.iter(function(l){var v=d(l);v!=l.height&&Le(l,v)})}function Gi(e,n,d,l){var v=e.display;if(!d&&Me(n).getAttribute("cm-not-content")=="true")return null;var K,te,ie=v.lineSpace.getBoundingClientRect();try{K=n.clientX-ie.left,te=n.clientY-ie.top}catch(Ve){return null}var oe=Rs(e,K,te),_e;if(l&&oe.xRel>0&&(_e=at(e.doc,oe.line).text).length==oe.ch){var je=H(_e,_e.length,e.options.tabSize)-_e.length;oe=ke(oe.line,Math.max(0,Math.round((K-Si(e.display).left)/Zi(e.display))-je))}return oe}function zi(e,n){if(n>=e.display.viewTo)return null;if(n-=e.display.viewFrom,n<0)return null;for(var d=e.display.view,l=0;l<d.length;l++)if(n-=d[l].size,n<0)return l}function li(e,n,d,l){n==null&&(n=e.doc.first),d==null&&(d=e.doc.first+e.doc.size),l||(l=0);var v=e.display;if(l&&d<v.viewTo&&(v.updateLineNumbers==null||v.updateLineNumbers>n)&&(v.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=v.viewTo)Gt&&vn(e.doc,n)<v.viewTo&&Ni(e);else if(d<=v.viewFrom)Gt&&Qt(e.doc,d+l)>v.viewFrom?Ni(e):(v.viewFrom+=l,v.viewTo+=l);else if(n<=v.viewFrom&&d>=v.viewTo)Ni(e);else if(n<=v.viewFrom){var K=ea(e,d,d+l,1);K?(v.view=v.view.slice(K.index),v.viewFrom=K.lineN,v.viewTo+=l):Ni(e)}else if(d>=v.viewTo){var te=ea(e,n,n,-1);te?(v.view=v.view.slice(0,te.index),v.viewTo=te.lineN):Ni(e)}else{var ie=ea(e,n,n,-1),oe=ea(e,d,d+l,1);ie&&oe?(v.view=v.view.slice(0,ie.index).concat(yt(e,ie.lineN,oe.lineN)).concat(v.view.slice(oe.index)),v.viewTo+=l):Ni(e)}var _e=v.externalMeasured;_e&&(d<_e.lineN?_e.lineN+=l:n<_e.lineN+_e.size&&(v.externalMeasured=null))}function Mi(e,n,d){e.curOp.viewChanged=!0;var l=e.display,v=e.display.externalMeasured;if(v&&n>=v.lineN&&n<v.lineN+v.size&&(l.externalMeasured=null),n<l.viewFrom||n>=l.viewTo)return;var K=l.view[zi(e,n)];if(K.node==null)return;var te=K.changes||(K.changes=[]);se(te,d)==-1&&te.push(d)}function Ni(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ea(e,n,d,l){var v=zi(e,n),K,te=e.display.view;if(!Gt||d==e.doc.first+e.doc.size)return{index:v,lineN:d};for(var ie=e.display.viewFrom,oe=0;oe<v;oe++)ie+=te[oe].size;if(ie!=n){if(l>0){if(v==te.length-1)return null;K=ie+te[v].size-n,v++}else K=ie-n;n+=K,d+=K}for(;vn(e.doc,d)!=d;){if(v==(l<0?0:te.length-1))return null;d+=l*te[v-(l<0?1:0)].size,v+=l}return{index:v,lineN:d}}function xl(e,n,d){var l=e.display,v=l.view;v.length==0||n>=l.viewTo||d<=l.viewFrom?(l.view=yt(e,n,d),l.viewFrom=n):(l.viewFrom>n?l.view=yt(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(zi(e,n))),l.viewFrom=n,l.viewTo<d?l.view=l.view.concat(yt(e,l.viewTo,d)):l.viewTo>d&&(l.view=l.view.slice(0,zi(e,d)))),l.viewTo=d}function Ls(e){for(var n=e.display.view,d=0,l=0;l<n.length;l++){var v=n[l];!v.hidden&&(!v.node||v.changes)&&++d}return d}function ta(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Is(e,n){n===void 0&&(n=!0);for(var d=e.doc,l={},v=l.cursors=document.createDocumentFragment(),K=l.selection=document.createDocumentFragment(),te=0;te<d.sel.ranges.length;te++){if(!n&&te==d.sel.primIndex)continue;var ie=d.sel.ranges[te];if(ie.from().line>=e.display.viewTo||ie.to().line<e.display.viewFrom)continue;var oe=ie.empty();(oe||e.options.showCursorWhenSelecting)&&yo(e,ie.head,v),oe||bo(e,ie,K)}return l}function yo(e,n,d){var l=xi(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),v=d.appendChild(h("div","\xA0","CodeMirror-cursor"));if(v.style.left=l.left+"px",v.style.top=l.top+"px",v.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var K=d.appendChild(h("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));K.style.display="",K.style.left=l.other.left+"px",K.style.top=l.other.top+"px",K.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function Qa(e,n){return e.top-n.top||e.left-n.left}function bo(e,n,d){var l=e.display,v=e.doc,K=document.createDocumentFragment(),te=Si(e.display),ie=te.left,oe=Math.max(l.sizerWidth,ei(e)-l.sizer.offsetLeft)-te.right,_e=v.direction=="ltr";function je(Sn,lr,Rr,Cr){lr<0&&(lr=0),lr=Math.round(lr),Cr=Math.round(Cr),K.appendChild(h("div",null,"CodeMirror-selected","position: absolute; left: "+Sn+`px;
top: `+lr+"px; width: "+(Rr==null?oe-Sn:Rr)+`px;
height: `+(Cr-lr)+"px"))}function Ve(Sn,lr,Rr){var Cr=at(v,Sn),Dr=Cr.text.length,Wr,ri;function zr(Qr,vi){return Ts(e,ke(Sn,Qr),"div",Cr,vi)}function Ei(Qr,vi,oi){var Zr=vo(e,Cr,null,Qr),Jr=vi=="ltr"==(oi=="after")?"left":"right",Xr=oi=="after"?Zr.begin:Zr.end-(/\s/.test(Cr.text.charAt(Zr.end-1))?2:1);return zr(Xr,Jr)[Jr]}var gi=Yt(Cr,v.direction);return wt(gi,lr||0,Rr==null?Dr:Rr,function(Qr,vi,oi,Zr){var Jr=oi=="ltr",Xr=zr(Qr,Jr?"left":"right"),_i=zr(vi-1,Jr?"right":"left"),vs=lr==null&&Qr==0,wa=Rr==null&&vi==Dr,di=Zr==0,Hi=!gi||Zr==gi.length-1;if(_i.top-Xr.top<=3){var ii=(_e?vs:wa)&&di,nu=(_e?wa:vs)&&Hi,Qi=ii?ie:(Jr?Xr:_i).left,Ga=nu?oe:(Jr?_i:Xr).right;je(Qi,Xr.top,Ga-Qi,Xr.bottom)}else{var za,hi,_s,ru;Jr?(za=_e&&vs&&di?ie:Xr.left,hi=_e?oe:Ei(Qr,oi,"before"),_s=_e?ie:Ei(vi,oi,"after"),ru=_e&&wa&&Hi?oe:_i.right):(za=_e?Ei(Qr,oi,"before"):ie,hi=!_e&&vs&&di?oe:Xr.right,_s=!_e&&wa&&Hi?ie:_i.left,ru=_e?Ei(vi,oi,"after"):oe),je(za,Xr.top,hi-za,Xr.bottom),Xr.bottom<_i.top&&je(ie,Xr.bottom,null,_i.top),je(_s,_i.top,ru-_s,_i.bottom)}(!Wr||Qa(Xr,Wr)<0)&&(Wr=Xr),Qa(_i,Wr)<0&&(Wr=_i),(!ri||Qa(Xr,ri)<0)&&(ri=Xr),Qa(_i,ri)<0&&(ri=_i)}),{start:Wr,end:ri}}var dt=n.from(),st=n.to();if(dt.line==st.line)Ve(dt.line,dt.ch,st.ch);else{var Rt=at(v,dt.line),Ht=at(v,st.line),en=Rn(Rt)==Rn(Ht),Tn=Ve(dt.line,dt.ch,en?Rt.text.length+1:null).end,Yn=Ve(st.line,en?0:null,st.ch).start;en&&(Tn.top<Yn.top-2?(je(Tn.right,Tn.top,null,Tn.bottom),je(ie,Yn.top,Yn.left,Yn.bottom)):je(Tn.right,Tn.top,Yn.left-Tn.right,Tn.bottom)),Tn.bottom<Yn.top&&je(ie,Tn.bottom,null,Yn.top)}d.appendChild(K)}function ks(e){if(!e.state.focused)return;var n=e.display;clearInterval(n.blinker);var d=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||na(e),n.cursorDiv.style.visibility=(d=!d)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}function Ms(e){e.state.focused||(e.display.input.focus(),Ns(e))}function Eo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,na(e))},100)}function Ns(e,n){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ye(e,"focus",e,n),e.state.focused=!0,j(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()),ks(e)}function na(e,n){if(e.state.delayingBlurEvent)return;e.state.focused&&(ye(e,"blur",e,n),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ja(e){for(var n=e.display,d=n.lineDiv.offsetTop,l=0;l<n.view.length;l++){var v=n.view[l],K=e.options.lineWrapping,te=void 0,ie=0;if(v.hidden)continue;if(Y&&X<8){var oe=v.node.offsetTop+v.node.offsetHeight;te=oe-d,d=oe}else{var _e=v.node.getBoundingClientRect();te=_e.bottom-_e.top,!K&&v.text.firstChild&&(ie=v.text.firstChild.getBoundingClientRect().right-_e.left-1)}var je=v.line.height-te;if((je>.005||je<-.005)&&(Le(v.line,te),Ai(v.line),v.rest))for(var Ve=0;Ve<v.rest.length;Ve++)Ai(v.rest[Ve]);if(ie>e.display.sizerWidth){var dt=Math.ceil(ie/Zi(e.display));dt>e.display.maxLineLength&&(e.display.maxLineLength=dt,e.display.maxLine=v.line,e.display.maxLineChanged=!0)}}}function Ai(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var d=e.widgets[n],l=d.node.parentNode;l&&(d.height=l.offsetHeight)}}function qa(e,n,d){var l=d&&d.top!=null?Math.max(0,d.top):e.scroller.scrollTop;l=Math.floor(l-Ti(e));var v=d&&d.bottom!=null?d.bottom:l+e.wrapper.clientHeight,K=ge(n,l),te=ge(n,v);if(d&&d.ensure){var ie=d.ensure.from.line,oe=d.ensure.to.line;ie<K?(K=ie,te=ge(n,kt(at(n,ie))+e.wrapper.clientHeight)):Math.min(oe,n.lastLine())>=te&&(K=ge(n,kt(at(n,oe))-e.wrapper.clientHeight),te=oe)}return{from:K,to:Math.max(te,K+1)}}function xo(e,n){if(ae(e,"scrollCursorIntoView"))return;var d=e.display,l=d.sizer.getBoundingClientRect(),v=null;if(n.top+l.top<0?v=!0:n.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(v=!1),v!=null&&!c){var K=h("div","\u200B",null,`position: absolute;
top: `+(n.top-d.viewOffset-Ti(e.display))+`px;
height: `+(n.bottom-n.top+qr(e)+d.barHeight)+`px;
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(K),K.scrollIntoView(v),e.display.lineSpace.removeChild(K)}}function Us(e,n,d,l){l==null&&(l=0);var v;!e.options.lineWrapping&&n==d&&(n=n.ch?ke(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,d=n.sticky=="before"?ke(n.line,n.ch+1,"before"):n);for(var K=0;K<5;K++){var te=!1,ie=xi(e,n),oe=!d||d==n?ie:xi(e,d);v={left:Math.min(ie.left,oe.left),top:Math.min(ie.top,oe.top)-l,right:Math.max(ie.left,oe.left),bottom:Math.max(ie.bottom,oe.bottom)+l};var _e=Za(e,v),je=e.doc.scrollTop,Ve=e.doc.scrollLeft;if(_e.scrollTop!=null&&(aa(e,_e.scrollTop),Math.abs(e.doc.scrollTop-je)>1&&(te=!0)),_e.scrollLeft!=null&&(Di(e,_e.scrollLeft),Math.abs(e.doc.scrollLeft-Ve)>1&&(te=!0)),!te)break}return v}function wl(e,n){var d=Za(e,n);d.scrollTop!=null&&aa(e,d.scrollTop),d.scrollLeft!=null&&Di(e,d.scrollLeft)}function Za(e,n){var d=e.display,l=qi(e.display);n.top<0&&(n.top=0);var v=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:d.scroller.scrollTop,K=yi(e),te={};n.bottom-n.top>K&&(n.bottom=n.top+K);var ie=e.doc.height+Kr(d),oe=n.top<l,_e=n.bottom>ie-l;if(n.top<v)te.scrollTop=oe?0:n.top;else if(n.bottom>v+K){var je=Math.min(n.top,(_e?ie:n.bottom)-K);je!=v&&(te.scrollTop=je)}var Ve=e.options.fixedGutter?0:d.gutters.offsetWidth,dt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:d.scroller.scrollLeft-Ve,st=ei(e)-d.gutters.offsetWidth,Rt=n.right-n.left>st;return Rt&&(n.right=n.left+st),n.left<10?te.scrollLeft=0:n.left<dt?te.scrollLeft=Math.max(0,n.left+Ve-(Rt?0:10)):n.right>st+dt-3&&(te.scrollLeft=n.right+(Rt?0:10)-st),te}function es(e,n){if(n==null)return;ts(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n}function ra(e){ts(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ia(e,n,d){(n!=null||d!=null)&&ts(e),n!=null&&(e.curOp.scrollLeft=n),d!=null&&(e.curOp.scrollTop=d)}function wo(e,n){ts(e),e.curOp.scrollToPos=n}function ts(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var d=mo(e,n.from),l=mo(e,n.to);Co(e,d,l,n.margin)}}function Co(e,n,d,l){var v=Za(e,{left:Math.min(n.left,d.left),top:Math.min(n.top,d.top)-l,right:Math.max(n.right,d.right),bottom:Math.max(n.bottom,d.bottom)+l});ia(e,v.scrollLeft,v.scrollTop)}function aa(e,n){if(Math.abs(e.doc.scrollTop-n)<2)return;U||js(e,{top:n}),To(e,n,!0),U&&js(e),ti(e,100)}function To(e,n,d){if(n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),e.display.scroller.scrollTop==n&&!d)return;e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n)}function Di(e,n,d,l){if(n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(d?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!l)return;e.doc.scrollLeft=n,Io(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n)}function sa(e){var n=e.display,d=n.gutters.offsetWidth,l=Math.round(e.doc.height+Kr(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?d:0,docHeight:l,scrollHeight:l+qr(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:d}}var Pi=function(e,n,d){this.cm=d;var l=this.vert=h("div",[h("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),v=this.horiz=h("div",[h("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=v.tabIndex=-1,e(l),e(v),Qe(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),Qe(v,"scroll",function(){v.clientWidth&&n(v.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Y&&X<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Pi.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,d=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(d){this.vert.style.display="block",this.vert.style.bottom=n?l+"px":"0";var v=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+v)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=d?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var K=e.viewWidth-e.barLeft-(d?l: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&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:d?l:0,bottom:n?l:0}},Pi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Pi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Pi.prototype.zeroWidthHack=function(){var e=u&&!a?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new J,this.disableVert=new J},Pi.prototype.enableZeroWidthBar=function(e,n,d){e.style.pointerEvents="auto";function l(){var v=e.getBoundingClientRect(),K=d=="vert"?document.elementFromPoint(v.right-1,(v.top+v.bottom)/2):document.elementFromPoint((v.right+v.left)/2,v.bottom-1);K!=e?e.style.pointerEvents="none":n.set(1e3,l)}n.set(1e3,l)},Pi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};function Ui(e,n){n||(n=sa(e));var d=e.display.barWidth,l=e.display.barHeight;So(e,n);for(var v=0;v<4&&d!=e.display.barWidth||l!=e.display.barHeight;v++)d!=e.display.barWidth&&e.options.lineWrapping&&Ja(e),So(e,sa(e)),d=e.display.barWidth,l=e.display.barHeight}function So(e,n){var d=e.display,l=d.scrollbars.update(n);d.sizer.style.paddingRight=(d.barWidth=l.right)+"px",d.sizer.style.paddingBottom=(d.barHeight=l.bottom)+"px",d.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=l.bottom+"px",d.scrollbarFiller.style.width=l.right+"px"):d.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=l.bottom+"px",d.gutterFiller.style.width=n.gutterWidth+"px"):d.gutterFiller.style.display=""}var Ro={native:Pi,null:Sa};function Oo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ro[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),Qe(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,d){d=="horizontal"?Di(e,n):aa(e,n)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Ao=0;function Vi(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:++Ao},$t(e.curOp)}function Xi(e){var n=e.curOp;n&&jn(n,function(d){for(var l=0;l<d.ops.length;l++)d.ops[l].cm.curOp=null;Cl(d)})}function Cl(e){for(var n=e.ops,d=0;d<n.length;d++)oa(n[d]);for(var l=0;l<n.length;l++)la(n[l]);for(var v=0;v<n.length;v++)Fs(n[v]);for(var K=0;K<n.length;K++)Tl(n[K]);for(var te=0;te<n.length;te++)Do(n[te])}function oa(e){var n=e.cm,d=n.display;Sl(n),e.updateMaxLine&&zt(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<d.viewFrom||e.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new Ra(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function la(e){e.updatedDisplay=e.mustUpdate&&ns(e.cm,e.update)}function Fs(e){var n=e.cm,d=n.display;e.updatedDisplay&&Ja(n),e.barMeasure=sa(n),d.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Xa(n,d.maxLine,d.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(d.scroller.clientWidth,d.sizer.offsetLeft+e.adjustWidthTo+qr(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,d.sizer.offsetLeft+e.adjustWidthTo-ei(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=d.input.prepareSelection())}function Tl(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Di(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var d=e.focus&&e.focus==W();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,d),(e.updatedDisplay||e.startHeight!=n.doc.height)&&Ui(n,e.barMeasure),e.updatedDisplay&&$i(n,e.barMeasure),e.selectionChanged&&ks(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),d&&Ms(e.cm)}function Do(e){var n=e.cm,d=n.display,l=n.doc;if(e.updatedDisplay&&Lo(n,e.update),d.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(d.wheelStartX=d.wheelStartY=null),e.scrollTop!=null&&To(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Di(n,e.scrollLeft,!0,!0),e.scrollToPos){var v=Us(n,jt(l,e.scrollToPos.from),jt(l,e.scrollToPos.to),e.scrollToPos.margin);xo(n,v)}var K=e.maybeHiddenMarkers,te=e.maybeUnhiddenMarkers;if(K)for(var ie=0;ie<K.length;++ie)K[ie].lines.length||ye(K[ie],"hide");if(te)for(var oe=0;oe<te.length;++oe)te[oe].lines.length&&ye(te[oe],"unhide");d.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&ye(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function ci(e,n){if(e.curOp)return n();Vi(e);try{return n()}finally{Xi(e)}}function Gr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Vi(e);try{return n.apply(e,arguments)}finally{Xi(e)}}}function si(e){return function(){if(this.curOp)return e.apply(this,arguments);Vi(this);try{return e.apply(this,arguments)}finally{Xi(this)}}}function Yr(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Vi(n);try{return e.apply(this,arguments)}finally{Xi(n)}}}function ti(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,k(Bs,e))}function Bs(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var d=+new Date+e.options.workTime,l=Pn(e,n.highlightFrontier),v=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(K){if(l.line>=e.display.viewFrom){var te=K.styles,ie=K.text.length>e.options.maxHighlightLength?qn(n.mode,l.state):null,oe=ln(e,K,l,!0);ie&&(l.state=ie),K.styles=oe.styles;var _e=K.styleClasses,je=oe.classes;je?K.styleClasses=je:_e&&(K.styleClasses=null);for(var Ve=!te||te.length!=K.styles.length||_e!=je&&(!_e||!je||_e.bgClass!=je.bgClass||_e.textClass!=je.textClass),dt=0;!Ve&&dt<te.length;++dt)Ve=te[dt]!=K.styles[dt];Ve&&v.push(l.line),K.stateAfter=l.save(),l.nextLine()}else K.text.length<=e.options.maxHighlightLength&&hn(e,K.text,l),K.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>d)return ti(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),v.length&&ci(e,function(){for(var K=0;K<v.length;K++)Mi(e,v[K],"text")})}var Ra=function(e,n,d){var l=e.display;this.viewport=n,this.visible=qa(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=ei(e),this.force=d,this.dims=As(e),this.events=[]};Ra.prototype.signal=function(e,n){me(e,n)&&this.events.push(arguments)},Ra.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ye.apply(null,this.events[e])};function Sl(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=qr(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=qr(e)+"px",n.scrollbarsClipped=!0)}function Po(e){if(e.hasFocus())return null;var n=W();if(!n||!b(e.display.lineDiv,n))return null;var d={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&b(e.display.lineDiv,l.anchorNode)&&(d.anchorNode=l.anchorNode,d.anchorOffset=l.anchorOffset,d.focusNode=l.focusNode,d.focusOffset=l.focusOffset)}return d}function Oa(e){if(!e||!e.activeElt||e.activeElt==W())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var n=window.getSelection(),d=document.createRange();d.setEnd(e.anchorNode,e.anchorOffset),d.collapse(!1),n.removeAllRanges(),n.addRange(d),n.extend(e.focusNode,e.focusOffset)}}function ns(e,n){var d=e.display,l=e.doc;if(n.editorIsHidden)return Ni(e),!1;if(!n.force&&n.visible.from>=d.viewFrom&&n.visible.to<=d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&Ls(e)==0)return!1;ko(e)&&(Ni(e),n.dims=As(e));var v=l.first+l.size,K=Math.max(n.visible.from-e.options.viewportMargin,l.first),te=Math.min(v,n.visible.to+e.options.viewportMargin);d.viewFrom<K&&K-d.viewFrom<20&&(K=Math.max(l.first,d.viewFrom)),d.viewTo>te&&d.viewTo-te<20&&(te=Math.min(v,d.viewTo)),Gt&&(K=vn(e.doc,K),te=Qt(e.doc,te));var ie=K!=d.viewFrom||te!=d.viewTo||d.lastWrapHeight!=n.wrapperHeight||d.lastWrapWidth!=n.wrapperWidth;xl(e,K,te),d.viewOffset=kt(at(e.doc,d.viewFrom)),e.display.mover.style.top=d.viewOffset+"px";var oe=Ls(e);if(!ie&&oe==0&&!n.force&&d.renderedView==d.view&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo))return!1;var _e=Po(e);return oe>4&&(d.lineDiv.style.display="none"),Rl(e,d.updateLineNumbers,n.dims),oe>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,Oa(_e),x(d.cursorDiv),x(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,ie&&(d.lastWrapHeight=n.wrapperHeight,d.lastWrapWidth=n.wrapperWidth,ti(e,400)),d.updateLineNumbers=null,!0}function Lo(e,n){for(var d=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==ei(e)){if(d&&d.top!=null&&(d={top:Math.min(e.doc.height+Kr(e.display)-yi(e),d.top)}),n.visible=qa(e.display,e.doc,d),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=qa(e.display,e.doc,d));if(!ns(e,n))break;Ja(e);var v=sa(e);ta(e),Ui(e,v),$i(e,v),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function js(e,n){var d=new Ra(e,n);if(ns(e,d)){Ja(e),Lo(e,d);var l=sa(e);ta(e),Ui(e,l),$i(e,l),d.finish()}}function Rl(e,n,d){var l=e.display,v=e.options.lineNumbers,K=l.lineDiv,te=K.firstChild;function ie(Rt){var Ht=Rt.nextSibling;return r&&u&&e.display.currentWheelTarget==Rt?Rt.style.display="none":Rt.parentNode.removeChild(Rt),Ht}for(var oe=l.view,_e=l.viewFrom,je=0;je<oe.length;je++){var Ve=oe[je];if(!Ve.hidden)if(!Ve.node||Ve.node.parentNode!=K){var dt=br(e,Ve,_e,d);K.insertBefore(dt,te)}else{for(;te!=Ve.node;)te=ie(te);var st=v&&n!=null&&n<=_e&&Ve.lineNumber;Ve.changes&&(se(Ve.changes,"gutter")>-1&&(st=!1),Ln(e,Ve,_e,d)),st&&(x(Ve.lineNumber),Ve.lineNumber.appendChild(document.createTextNode(Lt(e.options,_e)))),te=Ve.node.nextSibling}_e+=Ve.size}for(;te;)te=ie(te)}function Aa(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px"}function $i(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+qr(e)+"px"}function Io(e){var n=e.display,d=n.view;if(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))return;for(var l=Ds(n)-n.scroller.scrollLeft+e.doc.scrollLeft,v=n.gutters.offsetWidth,K=l+"px",te=0;te<d.length;te++)if(!d[te].hidden){e.options.fixedGutter&&(d[te].gutter&&(d[te].gutter.style.left=K),d[te].gutterBackground&&(d[te].gutterBackground.style.left=K));var ie=d[te].alignable;if(ie)for(var oe=0;oe<ie.length;oe++)ie[oe].style.left=K}e.options.fixedGutter&&(n.gutters.style.left=l+v+"px")}function ko(e){if(!e.options.lineNumbers)return!1;var n=e.doc,d=Lt(e.options,n.first+n.size-1),l=e.display;if(d.length!=l.lineNumChars){var v=l.measure.appendChild(h("div",[h("div",d)],"CodeMirror-linenumber CodeMirror-gutter-elt")),K=v.firstChild.offsetWidth,te=v.offsetWidth-K;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(K,l.lineGutter.offsetWidth-te)+1,l.lineNumWidth=l.lineNumInnerWidth+te,l.lineNumChars=l.lineNumInnerWidth?d.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",Aa(e.display),!0}return!1}function Ws(e,n){for(var d=[],l=!1,v=0;v<e.length;v++){var K=e[v],te=null;if(typeof K!="string"&&(te=K.style,K=K.className),K=="CodeMirror-linenumbers")if(n)l=!0;else continue;d.push({className:K,style:te})}return n&&!l&&d.push({className:"CodeMirror-linenumbers",style:null}),d}function Hs(e){var n=e.gutters,d=e.gutterSpecs;x(n),e.lineGutter=null;for(var l=0;l<d.length;++l){var v=d[l],K=v.className,te=v.style,ie=n.appendChild(h("div",null,"CodeMirror-gutter "+K));te&&(ie.style.cssText=te),K=="CodeMirror-linenumbers"&&(e.lineGutter=ie,ie.style.width=(e.lineNumWidth||1)+"px")}n.style.display=d.length?"":"none",Aa(e)}function Da(e){Hs(e.display),li(e),Io(e)}function Ol(e,n,d,l){var v=this;this.input=d,v.scrollbarFiller=h("div",null,"CodeMirror-scrollbar-filler"),v.scrollbarFiller.setAttribute("cm-not-content","true"),v.gutterFiller=h("div",null,"CodeMirror-gutter-filler"),v.gutterFiller.setAttribute("cm-not-content","true"),v.lineDiv=O("div",null,"CodeMirror-code"),v.selectionDiv=h("div",null,null,"position: relative; z-index: 1"),v.cursorDiv=h("div",null,"CodeMirror-cursors"),v.measure=h("div",null,"CodeMirror-measure"),v.lineMeasure=h("div",null,"CodeMirror-measure"),v.lineSpace=O("div",[v.measure,v.lineMeasure,v.selectionDiv,v.cursorDiv,v.lineDiv],null,"position: relative; outline: none");var K=O("div",[v.lineSpace],"CodeMirror-lines");v.mover=h("div",[K],null,"position: relative"),v.sizer=h("div",[v.mover],"CodeMirror-sizer"),v.sizerWidth=null,v.heightForcer=h("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),v.gutters=h("div",null,"CodeMirror-gutters"),v.lineGutter=null,v.scroller=h("div",[v.sizer,v.heightForcer,v.gutters],"CodeMirror-scroll"),v.scroller.setAttribute("tabIndex","-1"),v.wrapper=h("div",[v.scrollbarFiller,v.gutterFiller,v.scroller],"CodeMirror"),Y&&X<8&&(v.gutters.style.zIndex=-1,v.scroller.style.paddingRight=0),!r&&!(U&&t)&&(v.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(v.wrapper):e(v.wrapper)),v.viewFrom=v.viewTo=n.first,v.reportedViewFrom=v.reportedViewTo=n.first,v.view=[],v.renderedView=null,v.externalMeasured=null,v.viewOffset=0,v.lastWrapHeight=v.lastWrapWidth=0,v.updateLineNumbers=null,v.nativeBarWidth=v.barHeight=v.barWidth=0,v.scrollbarsClipped=!1,v.lineNumWidth=v.lineNumInnerWidth=v.lineNumChars=null,v.alignWidgets=!1,v.cachedCharWidth=v.cachedTextHeight=v.cachedPaddingH=null,v.maxLine=null,v.maxLineLength=0,v.maxLineChanged=!1,v.wheelDX=v.wheelDY=v.wheelStartX=v.wheelStartY=null,v.shift=!1,v.selForContextMenu=null,v.activeTouch=null,v.gutterSpecs=Ws(l.gutters,l.lineNumbers),Hs(v),d.init(v)}var ua=0,pi=null;Y?pi=-.53:U?pi=15:m?pi=-.7:p&&(pi=-1/3);function Mo(e){var n=e.wheelDeltaX,d=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),d==null&&e.detail&&e.axis==e.VERTICAL_AXIS?d=e.detail:d==null&&(d=e.wheelDelta),{x:n,y:d}}function rs(e){var n=Mo(e);return n.x*=pi,n.y*=pi,n}function No(e,n){var d=Mo(n),l=d.x,v=d.y,K=e.display,te=K.scroller,ie=te.scrollWidth>te.clientWidth,oe=te.scrollHeight>te.clientHeight;if(!(l&&ie||v&&oe))return;if(v&&u&&r){e:for(var _e=n.target,je=K.view;_e!=te;_e=_e.parentNode)for(var Ve=0;Ve<je.length;Ve++)if(je[Ve].node==_e){e.display.currentWheelTarget=_e;break e}}if(l&&!U&&!f&&pi!=null){v&&oe&&aa(e,Math.max(0,te.scrollTop+v*pi)),Di(e,Math.max(0,te.scrollLeft+l*pi)),(!v||v&&oe)&&de(n),K.wheelStartX=null;return}if(v&&pi!=null){var dt=v*pi,st=e.doc.scrollTop,Rt=st+K.wrapper.clientHeight;dt<0?st=Math.max(0,st+dt-50):Rt=Math.min(e.doc.height,Rt+dt+50),js(e,{top:st,bottom:Rt})}ua<20&&(K.wheelStartX==null?(K.wheelStartX=te.scrollLeft,K.wheelStartY=te.scrollTop,K.wheelDX=l,K.wheelDY=v,setTimeout(function(){if(K.wheelStartX==null)return;var Ht=te.scrollLeft-K.wheelStartX,en=te.scrollTop-K.wheelStartY,Tn=en&&K.wheelDY&&en/K.wheelDY||Ht&&K.wheelDX&&Ht/K.wheelDX;if(K.wheelStartX=K.wheelStartY=null,!Tn)return;pi=(pi*ua+Tn)/(ua+1),++ua},200)):(K.wheelDX+=l,K.wheelDY+=v))}var mi=function(e,n){this.ranges=e,this.primIndex=n};mi.prototype.primary=function(){return this.ranges[this.primIndex]},mi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var d=this.ranges[n],l=e.ranges[n];if(!Re(d.anchor,l.anchor)||!Re(d.head,l.head))return!1}return!0},mi.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new Nr(tn(this.ranges[n].anchor),tn(this.ranges[n].head));return new mi(e,this.primIndex)},mi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},mi.prototype.contains=function(e,n){n||(n=e);for(var d=0;d<this.ranges.length;d++){var l=this.ranges[d];if(ut(n,l.from())>=0&&ut(e,l.to())<=0)return d}return-1};var Nr=function(e,n){this.anchor=e,this.head=n};Nr.prototype.from=function(){return pr(this.anchor,this.head)},Nr.prototype.to=function(){return cr(this.anchor,this.head)},Nr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function wi(e,n,d){var l=e&&e.options.selectionsMayTouch,v=n[d];n.sort(function(dt,st){return ut(dt.from(),st.from())}),d=se(n,v);for(var K=1;K<n.length;K++){var te=n[K],ie=n[K-1],oe=ut(ie.to(),te.from());if(l&&!te.empty()?oe>0:oe>=0){var _e=pr(ie.from(),te.from()),je=cr(ie.to(),te.to()),Ve=ie.empty()?te.from()==te.head:ie.from()==ie.head;K<=d&&--d,n.splice(--K,2,new Nr(Ve?je:_e,Ve?_e:je))}}return new mi(n,d)}function Fi(e,n){return new mi([new Nr(e,n||e)],0)}function Yi(e){return e.text?ke(e.from.line+e.text.length-1,_(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Uo(e,n){if(ut(e,n.from)<0)return e;if(ut(e,n.to)<=0)return Yi(n);var d=e.line+n.text.length-(n.to.line-n.from.line)-1,l=e.ch;return e.line==n.to.line&&(l+=Yi(n).ch-n.to.ch),ke(d,l)}function Pa(e,n){for(var d=[],l=0;l<e.sel.ranges.length;l++){var v=e.sel.ranges[l];d.push(new Nr(Uo(v.anchor,n),Uo(v.head,n)))}return wi(e.cm,d,e.sel.primIndex)}function da(e,n,d){return e.line==n.line?ke(d.line,e.ch-n.ch+d.ch):ke(d.line+(e.line-n.line),e.ch)}function Al(e,n,d){for(var l=[],v=ke(e.first,0),K=v,te=0;te<n.length;te++){var ie=n[te],oe=da(ie.from,v,K),_e=da(Yi(ie),v,K);if(v=ie.to,K=_e,d=="around"){var je=e.sel.ranges[te],Ve=ut(je.head,je.anchor)<0;l[te]=new Nr(Ve?_e:oe,Ve?oe:_e)}else l[te]=new Nr(oe,oe)}return new mi(l,e.sel.primIndex)}function La(e){e.doc.mode=Ar(e.options,e.doc.modeOption),Ia(e)}function Ia(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ti(e,100),e.state.modeGen++,e.curOp&&li(e)}function Fo(e,n){return n.from.ch==0&&n.to.ch==0&&_(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ks(e,n,d,l){function v(Yn){return d?d[Yn]:null}function K(Yn,Sn,lr){nn(Yn,Sn,lr,l),Ft(Yn,"change",Yn,n)}function te(Yn,Sn){for(var lr=[],Rr=Yn;Rr<Sn;++Rr)lr.push(new sn(_e[Rr],v(Rr),l));return lr}var ie=n.from,oe=n.to,_e=n.text,je=at(e,ie.line),Ve=at(e,oe.line),dt=_(_e),st=v(_e.length-1),Rt=oe.line-ie.line;if(n.full)e.insert(0,te(0,_e.length)),e.remove(_e.length,e.size-_e.length);else if(Fo(e,n)){var Ht=te(0,_e.length-1);K(Ve,Ve.text,st),Rt&&e.remove(ie.line,Rt),Ht.length&&e.insert(ie.line,Ht)}else if(je==Ve)if(_e.length==1)K(je,je.text.slice(0,ie.ch)+dt+je.text.slice(oe.ch),st);else{var en=te(1,_e.length-1);en.push(new sn(dt+je.text.slice(oe.ch),st,l)),K(je,je.text.slice(0,ie.ch)+_e[0],v(0)),e.insert(ie.line+1,en)}else if(_e.length==1)K(je,je.text.slice(0,ie.ch)+_e[0]+Ve.text.slice(oe.ch),v(0)),e.remove(ie.line+1,Rt);else{K(je,je.text.slice(0,ie.ch)+_e[0],v(0)),K(Ve,dt+Ve.text.slice(oe.ch),st);var Tn=te(1,_e.length-1);Rt>1&&e.remove(ie.line+1,Rt-1),e.insert(ie.line+1,Tn)}Ft(e,"change",e,n)}function Ci(e,n,d){function l(v,K,te){if(v.linked)for(var ie=0;ie<v.linked.length;++ie){var oe=v.linked[ie];if(oe.doc==K)continue;var _e=te&&oe.sharedHist;if(d&&!_e)continue;n(oe.doc,_e),l(oe.doc,v,_e)}}l(e,null,!0)}function Gs(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,Ps(e),La(e),Bo(e),e.options.lineWrapping||zt(e),e.options.mode=n.modeOption,li(e)}function Bo(e){(e.doc.direction=="rtl"?j:E)(e.display.lineDiv,"CodeMirror-rtl")}function Dl(e){ci(e,function(){Bo(e),li(e)})}function is(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 zs(e,n){var d={from:tn(n.from),to:Yi(n),text:Fe(e,n.from,n.to)};return Vs(e,d,n.from.line,n.to.line+1),Ci(e,function(l){return Vs(l,d,n.from.line,n.to.line+1)},!0),d}function jo(e){for(;e.length;){var n=_(e);if(n.ranges)e.pop();else break}}function Pl(e,n){if(n)return jo(e.done),_(e.done);if(e.done.length&&!_(e.done).ranges)return _(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),_(e.done)}function Wo(e,n,d,l){var v=e.history;v.undone.length=0;var K=+new Date,te,ie;if((v.lastOp==l||v.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&v.lastModTime>K-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(te=Pl(v,v.lastOp==l)))ie=_(te.changes),ut(n.from,n.to)==0&&ut(n.from,ie.to)==0?ie.to=Yi(n):te.changes.push(zs(e,n));else{var oe=_(v.done);for((!oe||!oe.ranges)&&ss(e.sel,v.done),te={changes:[zs(e,n)],generation:v.generation},v.done.push(te);v.done.length>v.undoDepth;)v.done.shift(),v.done[0].ranges||v.done.shift()}v.done.push(d),v.generation=++v.maxGeneration,v.lastModTime=v.lastSelTime=K,v.lastOp=v.lastSelOp=l,v.lastOrigin=v.lastSelOrigin=n.origin,ie||ye(e,"historyAdded")}function Ll(e,n,d,l){var v=n.charAt(0);return v=="*"||v=="+"&&d.ranges.length==l.ranges.length&&d.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function as(e,n,d,l){var v=e.history,K=l&&l.origin;d==v.lastSelOp||K&&v.lastSelOrigin==K&&(v.lastModTime==v.lastSelTime&&v.lastOrigin==K||Ll(e,K,_(v.done),n))?v.done[v.done.length-1]=n:ss(n,v.done),v.lastSelTime=+new Date,v.lastSelOrigin=K,v.lastSelOp=d,l&&l.clearRedo!==!1&&jo(v.undone)}function ss(e,n){var d=_(n);d&&d.ranges&&d.equals(e)||n.push(e)}function Vs(e,n,d,l){var v=n["spans_"+e.id],K=0;e.iter(Math.max(e.first,d),Math.min(e.first+e.size,l),function(te){te.markedSpans&&((v||(v=n["spans_"+e.id]={}))[K]=te.markedSpans),++K})}function os(e){if(!e)return null;for(var n,d=0;d<e.length;++d)e[d].marker.explicitlyCleared?n||(n=e.slice(0,d)):n&&n.push(e[d]);return n?n.length?n:null:e}function Ho(e,n){var d=n["spans_"+e.id];if(!d)return null;for(var l=[],v=0;v<n.text.length;++v)l.push(os(d[v]));return l}function Xs(e,n){var d=Ho(e,n),l=kn(e,n);if(!d)return l;if(!l)return d;for(var v=0;v<d.length;++v){var K=d[v],te=l[v];if(K&&te){e:for(var ie=0;ie<te.length;++ie){for(var oe=te[ie],_e=0;_e<K.length;++_e)if(K[_e].marker==oe.marker)continue e;K.push(oe)}}else te&&(d[v]=te)}return d}function ca(e,n,d){for(var l=[],v=0;v<e.length;++v){var K=e[v];if(K.ranges){l.push(d?mi.prototype.deepCopy.call(K):K);continue}var te=K.changes,ie=[];l.push({changes:ie});for(var oe=0;oe<te.length;++oe){var _e=te[oe],je=void 0;if(ie.push({from:_e.from,to:_e.to,text:_e.text}),n)for(var Ve in _e)(je=Ve.match(/^spans_(\d+)$/))&&(se(n,Number(je[1]))>-1&&(_(ie)[Ve]=_e[Ve],delete _e[Ve]))}}return l}function ls(e,n,d,l){if(l){var v=e.anchor;if(d){var K=ut(n,v)<0;K!=ut(d,v)<0?(v=n,n=d):K!=ut(n,d)<0&&(n=d)}return new Nr(v,n)}else return new Nr(d||n,n)}function us(e,n,d,l,v){v==null&&(v=e.cm&&(e.cm.display.shift||e.extend)),ni(e,new mi([ls(e.sel.primary(),n,d,v)],0),l)}function Ko(e,n,d){for(var l=[],v=e.cm&&(e.cm.display.shift||e.extend),K=0;K<e.sel.ranges.length;K++)l[K]=ls(e.sel.ranges[K],n[K],null,v);var te=wi(e.cm,l,e.sel.primIndex);ni(e,te,d)}function Bi(e,n,d,l){var v=e.sel.ranges.slice(0);v[n]=d,ni(e,wi(e.cm,v,e.sel.primIndex),l)}function Go(e,n,d,l){ni(e,Fi(n,d),l)}function Il(e,n,d){var l={ranges:n.ranges,update:function(v){this.ranges=[];for(var K=0;K<v.length;K++)this.ranges[K]=new Nr(jt(e,v[K].anchor),jt(e,v[K].head))},origin:d&&d.origin};return ye(e,"beforeSelectionChange",e,l),e.cm&&ye(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?wi(e.cm,l.ranges,l.ranges.length-1):n}function zo(e,n,d){var l=e.history.done,v=_(l);v&&v.ranges?(l[l.length-1]=n,ha(e,n,d)):ni(e,n,d)}function ni(e,n,d){ha(e,n,d),as(e,e.sel,e.cm?e.cm.curOp.id:NaN,d)}function ha(e,n,d){(me(e,"beforeSelectionChange")||e.cm&&me(e.cm,"beforeSelectionChange"))&&(n=Il(e,n,d));var l=d&&d.bias||(ut(n.primary().head,e.sel.primary().head)<0?-1:1);Vo(e,$o(e,n,l,!0)),!(d&&d.scroll===!1)&&e.cm&&ra(e.cm)}function Vo(e,n){if(n.equals(e.sel))return;e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,le(e.cm)),Ft(e,"cursorActivity",e)}function Xo(e){Vo(e,$o(e,e.sel,null,!1))}function $o(e,n,d,l){for(var v,K=0;K<n.ranges.length;K++){var te=n.ranges[K],ie=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[K],oe=ds(e,te.anchor,ie&&ie.anchor,d,l),_e=ds(e,te.head,ie&&ie.head,d,l);(v||oe!=te.anchor||_e!=te.head)&&(v||(v=n.ranges.slice(0,K)),v[K]=new Nr(oe,_e))}return v?wi(e.cm,v,n.primIndex):n}function fa(e,n,d,l,v){var K=at(e,n.line);if(K.markedSpans)for(var te=0;te<K.markedSpans.length;++te){var ie=K.markedSpans[te],oe=ie.marker,_e="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,je="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((ie.from==null||(_e?ie.from<=n.ch:ie.from<n.ch))&&(ie.to==null||(je?ie.to>=n.ch:ie.to>n.ch))){if(v&&(ye(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(K.markedSpans){--te;continue}else break;if(!oe.atomic)continue;if(d){var Ve=oe.find(l<0?1:-1),dt=void 0;if((l<0?je:_e)&&(Ve=Yo(e,Ve,-l,Ve&&Ve.line==n.line?K:null)),Ve&&Ve.line==n.line&&(dt=ut(Ve,d))&&(l<0?dt<0:dt>0))return fa(e,Ve,n,l,v)}var st=oe.find(l<0?-1:1);return(l<0?_e:je)&&(st=Yo(e,st,l,st.line==n.line?K:null)),st?fa(e,st,n,l,v):null}}return n}function ds(e,n,d,l,v){var K=l||1,te=fa(e,n,d,K,v)||!v&&fa(e,n,d,K,!0)||fa(e,n,d,-K,v)||!v&&fa(e,n,d,-K,!0);return te||(e.cantEdit=!0,ke(e.first,0))}function Yo(e,n,d,l){return d<0&&n.ch==0?n.line>e.first?jt(e,ke(n.line-1)):null:d>0&&n.ch==(l||at(e,n.line)).text.length?n.line<e.first+e.size-1?ke(n.line+1,0):null:new ke(n.line,n.ch+d)}function Qo(e){e.setSelection(ke(e.firstLine(),0),ke(e.lastLine()),Se)}function $s(e,n,d){var l={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return l.canceled=!0}};return d&&(l.update=function(v,K,te,ie){v&&(l.from=jt(e,v)),K&&(l.to=jt(e,K)),te&&(l.text=te),ie!==void 0&&(l.origin=ie)}),ye(e,"beforeChange",e,l),e.cm&&ye(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function pa(e,n,d){if(e.cm){if(!e.cm.curOp)return Gr(e.cm,pa)(e,n,d);if(e.cm.state.suppressEdits)return}if((me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"))&&(n=$s(e,n,!0),!n))return;var l=Vt&&!d&&tr(e,n.from,n.to);if(l)for(var v=l.length-1;v>=0;--v)Jo(e,{from:l[v].from,to:l[v].to,text:v?[""]:n.text,origin:n.origin});else Jo(e,n)}function Jo(e,n){if(n.text.length==1&&n.text[0]==""&&ut(n.from,n.to)==0)return;var d=Pa(e,n);Wo(e,n,d,e.cm?e.cm.curOp.id:NaN),ma(e,n,d,kn(e,n));var l=[];Ci(e,function(v,K){!K&&se(l,v.history)==-1&&(tl(v.history,n),l.push(v.history)),ma(v,n,null,kn(v,n))})}function cs(e,n,d){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!d)return;for(var v=e.history,K,te=e.sel,ie=n=="undo"?v.done:v.undone,oe=n=="undo"?v.undone:v.done,_e=0;_e<ie.length&&!(K=ie[_e],d?K.ranges&&!K.equals(e.sel):!K.ranges);_e++);if(_e==ie.length)return;for(v.lastOrigin=v.lastSelOrigin=null;;)if(K=ie.pop(),K.ranges){if(ss(K,oe),d&&!K.equals(e.sel)){ni(e,K,{clearRedo:!1});return}te=K}else if(l){ie.push(K);return}else break;var je=[];ss(te,oe),oe.push({changes:je,generation:v.generation}),v.generation=K.generation||++v.maxGeneration;for(var Ve=me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"),dt=function(Ht){var en=K.changes[Ht];if(en.origin=n,Ve&&!$s(e,en,!1))return ie.length=0,{};je.push(zs(e,en));var Tn=Ht?Pa(e,en):_(ie);ma(e,en,Tn,Xs(e,en)),!Ht&&e.cm&&e.cm.scrollIntoView({from:en.from,to:Yi(en)});var Yn=[];Ci(e,function(Sn,lr){!lr&&se(Yn,Sn.history)==-1&&(tl(Sn.history,en),Yn.push(Sn.history)),ma(Sn,en,null,Xs(Sn,en))})},st=K.changes.length-1;st>=0;--st){var Rt=dt(st);if(Rt)return Rt.v}}function qo(e,n){if(n==0)return;if(e.first+=n,e.sel=new mi(L(e.sel.ranges,function(v){return new Nr(ke(v.anchor.line+n,v.anchor.ch),ke(v.head.line+n,v.head.ch))}),e.sel.primIndex),e.cm){li(e.cm,e.first,e.first-n,n);for(var d=e.cm.display,l=d.viewFrom;l<d.viewTo;l++)Mi(e.cm,l,"gutter")}}function ma(e,n,d,l){if(e.cm&&!e.cm.curOp)return Gr(e.cm,ma)(e,n,d,l);if(n.to.line<e.first){qo(e,n.text.length-1-(n.to.line-n.from.line));return}if(n.from.line>e.lastLine())return;if(n.from.line<e.first){var v=n.text.length-1-(e.first-n.from.line);qo(e,v),n={from:ke(e.first,0),to:ke(n.to.line+v,n.to.ch),text:[_(n.text)],origin:n.origin}}var K=e.lastLine();n.to.line>K&&(n={from:n.from,to:ke(K,at(e,K).text.length),text:[n.text[0]],origin:n.origin}),n.removed=Fe(e,n.from,n.to),d||(d=Pa(e,n)),e.cm?kl(e.cm,n,l):Ks(e,n,l),ha(e,d,Se),e.cantEdit&&ds(e,ke(e.firstLine(),0))&&(e.cantEdit=!1)}function kl(e,n,d){var l=e.doc,v=e.display,K=n.from,te=n.to,ie=!1,oe=K.line;e.options.lineWrapping||(oe=xe(Rn(at(l,K.line))),l.iter(oe,te.line+1,function(st){if(st==v.maxLine)return ie=!0,!0})),l.sel.contains(n.from,n.to)>-1&&le(e),Ks(l,n,d,_o(e)),e.options.lineWrapping||(l.iter(oe,K.line+n.text.length,function(st){var Rt=At(st);Rt>v.maxLineLength&&(v.maxLine=st,v.maxLineLength=Rt,v.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),Ut(l,K.line),ti(e,400);var _e=n.text.length-(te.line-K.line)-1;n.full?li(e):K.line==te.line&&n.text.length==1&&!Fo(e.doc,n)?Mi(e,K.line,"text"):li(e,K.line,te.line+1,_e);var je=me(e,"changes"),Ve=me(e,"change");if(Ve||je){var dt={from:K,to:te,text:n.text,removed:n.removed,origin:n.origin};Ve&&Ft(e,"change",e,dt),je&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(dt)}e.display.selForContextMenu=null}function ga(e,n,d,l,v){var K;l||(l=d),ut(l,d)<0&&(K=[l,d],d=K[0],l=K[1]),typeof n=="string"&&(n=e.splitLines(n)),pa(e,{from:d,to:l,text:n,origin:v})}function Zo(e,n,d,l){d<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function el(e,n,d,l){for(var v=0;v<e.length;++v){var K=e[v],te=!0;if(K.ranges){K.copied||(K=e[v]=K.deepCopy(),K.copied=!0);for(var ie=0;ie<K.ranges.length;ie++)Zo(K.ranges[ie].anchor,n,d,l),Zo(K.ranges[ie].head,n,d,l);continue}for(var oe=0;oe<K.changes.length;++oe){var _e=K.changes[oe];if(d<_e.from.line)_e.from=ke(_e.from.line+l,_e.from.ch),_e.to=ke(_e.to.line+l,_e.to.ch);else if(n<=_e.to.line){te=!1;break}}te||(e.splice(0,v+1),v=0)}}function tl(e,n){var d=n.from.line,l=n.to.line,v=n.text.length-(l-d)-1;el(e.done,d,l,v),el(e.undone,d,l,v)}function ka(e,n,d,l){var v=n,K=n;return typeof n=="number"?K=at(e,Kn(e,n)):v=xe(n),v==null?null:(l(K,v)&&e.cm&&Mi(e.cm,v,d),K)}function ji(e){this.lines=e,this.parent=null;for(var n=0,d=0;d<e.length;++d)e[d].parent=this,n+=e[d].height;this.height=n}ji.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var d=e,l=e+n;d<l;++d){var v=this.lines[d];this.height-=v.height,ft(v),Ft(v,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,d){this.height+=d,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var l=0;l<n.length;++l)n[l].parent=this},iterN:function(e,n,d){for(var l=e+n;e<l;++e)if(d(this.lines[e]))return!0}};function va(e){this.children=e;for(var n=0,d=0,l=0;l<e.length;++l){var v=e[l];n+=v.chunkSize(),d+=v.height,v.parent=this}this.size=n,this.height=d,this.parent=null}va.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var d=0;d<this.children.length;++d){var l=this.children[d],v=l.chunkSize();if(e<v){var K=Math.min(n,v-e),te=l.height;if(l.removeInner(e,K),this.height-=te-l.height,v==K&&(this.children.splice(d--,1),l.parent=null),(n-=K)==0)break;e=0}else e-=v}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof ji))){var ie=[];this.collapse(ie),this.children=[new ji(ie)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,d){this.size+=n.length,this.height+=d;for(var l=0;l<this.children.length;++l){var v=this.children[l],K=v.chunkSize();if(e<=K){if(v.insertInner(e,n,d),v.lines&&v.lines.length>50){for(var te=v.lines.length%25+25,ie=te;ie<v.lines.length;){var oe=new ji(v.lines.slice(ie,ie+=25));v.height-=oe.height,this.children.splice(++l,0,oe),oe.parent=this}v.lines=v.lines.slice(0,te),this.maybeSpill()}break}e-=K}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var n=e.children.splice(e.children.length-5,5),d=new va(n);if(e.parent){e.size-=d.size,e.height-=d.height;var v=se(e.parent.children,e);e.parent.children.splice(v+1,0,d)}else{var l=new va(e.children);l.parent=e,e.children=[l,d],e=l}d.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,n,d){for(var l=0;l<this.children.length;++l){var v=this.children[l],K=v.chunkSize();if(e<K){var te=Math.min(n,K-e);if(v.iterN(e,te,d))return!0;if((n-=te)==0)break;e=0}else e-=K}}};var Ma=function(e,n,d){if(d)for(var l in d)d.hasOwnProperty(l)&&(this[l]=d[l]);this.doc=e,this.node=n};Ma.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,d=this.line,l=xe(d);if(l==null||!n)return;for(var v=0;v<n.length;++v)n[v]==this&&n.splice(v--,1);n.length||(d.widgets=null);var K=Fr(this);Le(d,Math.max(0,d.height-K)),e&&(ci(e,function(){nl(e,d,-K),Mi(e,l,"widget")}),Ft(e,"lineWidgetCleared",e,this,l))},Ma.prototype.changed=function(){var e=this,n=this.height,d=this.doc.cm,l=this.line;this.height=null;var v=Fr(this)-n;if(!v)return;St(this.doc,l)||Le(l,l.height+v),d&&ci(d,function(){d.curOp.forceUpdate=!0,nl(d,l,v),Ft(d,"lineWidgetChanged",d,e,xe(l))})},Ce(Ma);function nl(e,n,d){kt(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&es(e,d)}function Ml(e,n,d,l){var v=new Ma(e,d,l),K=e.cm;return K&&v.noHScroll&&(K.display.alignWidgets=!0),ka(e,n,"widget",function(te){var ie=te.widgets||(te.widgets=[]);if(v.insertAt==null?ie.push(v):ie.splice(Math.min(ie.length-1,Math.max(0,v.insertAt)),0,v),v.line=te,K&&!St(e,te)){var oe=kt(te)<e.scrollTop;Le(te,te.height+Fr(v)),oe&&es(K,v.height),K.curOp.forceUpdate=!0}return!0}),K&&Ft(K,"lineWidgetAdded",K,v,typeof n=="number"?n:xe(n)),v}var rl=0,bi=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++rl};bi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,n=e&&!e.curOp;if(n&&Vi(e),me(this,"clear")){var d=this.find();d&&Ft(this,"clear",d.from,d.to)}for(var l=null,v=null,K=0;K<this.lines.length;++K){var te=this.lines[K],ie=fn(te.markedSpans,this);e&&!this.collapsed?Mi(e,xe(te),"text"):e&&(ie.to!=null&&(v=xe(te)),ie.from!=null&&(l=xe(te))),te.markedSpans=Vn(te.markedSpans,ie),ie.from==null&&this.collapsed&&!St(this.doc,te)&&e&&Le(te,qi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var _e=Rn(this.lines[oe]),je=At(_e);je>e.display.maxLineLength&&(e.display.maxLine=_e,e.display.maxLineLength=je,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&li(e,l,v+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xo(e.doc)),e&&Ft(e,"markerCleared",e,this,l,v),n&&Xi(e),this.parent&&this.parent.clear()},bi.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var d,l,v=0;v<this.lines.length;++v){var K=this.lines[v],te=fn(K.markedSpans,this);if(te.from!=null&&(d=ke(n?K:xe(K),te.from),e==-1))return d;if(te.to!=null&&(l=ke(n?K:xe(K),te.to),e==1))return l}return d&&{from:d,to:l}},bi.prototype.changed=function(){var e=this,n=this.find(-1,!0),d=this,l=this.doc.cm;if(!n||!l)return;ci(l,function(){var v=n.line,K=xe(n.line),te=Ki(l,K);if(te&&(ho(te),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!St(d.doc,v)&&d.height!=null){var ie=d.height;d.height=null;var oe=Fr(d)-ie;oe&&Le(v,v.height+oe)}Ft(l,"markerChanged",l,e)})},bi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||se(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},bi.prototype.detachLine=function(e){if(this.lines.splice(se(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Ce(bi);function _a(e,n,d,l,v){if(l&&l.shared)return Nl(e,n,d,l,v);if(e.cm&&!e.cm.curOp)return Gr(e.cm,_a)(e,n,d,l,v);var K=new bi(e,v),te=ut(n,d);if(l&&y(l,K,!1),te>0||te==0&&K.clearWhenEmpty!==!1)return K;if(K.replacedWith&&(K.collapsed=!0,K.widgetNode=O("span",[K.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||K.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(K.widgetNode.insertLeft=!0)),K.collapsed){if(_r(e,n.line,n,d,K)||n.line!=d.line&&_r(e,d.line,n,d,K))throw new Error("Inserting collapsed marker partially overlapping an existing one");Zn()}K.addToHistory&&Wo(e,{from:n,to:d,origin:"markText"},e.sel,NaN);var ie=n.line,oe=e.cm,_e;if(e.iter(ie,d.line+1,function(Ve){oe&&K.collapsed&&!oe.options.lineWrapping&&Rn(Ve)==oe.display.maxLine&&(_e=!0),K.collapsed&&ie!=n.line&&Le(Ve,0),un(Ve,new On(K,ie==n.line?n.ch:null,ie==d.line?d.ch:null)),++ie}),K.collapsed&&e.iter(n.line,d.line+1,function(Ve){St(e,Ve)&&Le(Ve,0)}),K.clearOnEnter&&Qe(K,"beforeCursorEnter",function(){return K.clear()}),K.readOnly&&(Dt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),K.collapsed&&(K.id=++rl,K.atomic=!0),oe){if(_e&&(oe.curOp.updateMaxLine=!0),K.collapsed)li(oe,n.line,d.line+1);else if(K.className||K.startStyle||K.endStyle||K.css||K.attributes||K.title)for(var je=n.line;je<=d.line;je++)Mi(oe,je,"text");K.atomic&&Xo(oe.doc),Ft(oe,"markerAdded",oe,K)}return K}var ya=function(e,n){this.markers=e,this.primary=n;for(var d=0;d<e.length;++d)e[d].parent=this};ya.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ft(this,"clear")},ya.prototype.find=function(e,n){return this.primary.find(e,n)},Ce(ya);function Nl(e,n,d,l,v){l=y(l),l.shared=!1;var K=[_a(e,n,d,l,v)],te=K[0],ie=l.widgetNode;return Ci(e,function(oe){ie&&(l.widgetNode=ie.cloneNode(!0)),K.push(_a(oe,jt(oe,n),jt(oe,d),l,v));for(var _e=0;_e<oe.linked.length;++_e)if(oe.linked[_e].isParent)return;te=_(K)}),new ya(K,te)}function il(e){return e.findMarks(ke(e.first,0),e.clipPos(ke(e.lastLine())),function(n){return n.parent})}function iu(e,n){for(var d=0;d<n.length;d++){var l=n[d],v=l.find(),K=e.clipPos(v.from),te=e.clipPos(v.to);if(ut(K,te)){var ie=_a(e,K,te,l.primary,l.primary.type);l.markers.push(ie),ie.parent=l}}}function Ul(e){for(var n=function(l){var v=e[l],K=[v.primary.doc];Ci(v.primary.doc,function(oe){return K.push(oe)});for(var te=0;te<v.markers.length;te++){var ie=v.markers[te];se(K,ie.doc)==-1&&(ie.parent=null,v.markers.splice(te--,1))}},d=0;d<e.length;d++)n(d)}var Ys=0,ui=function(e,n,d,l,v){if(!(this instanceof ui))return new ui(e,n,d,l,v);d==null&&(d=0),va.call(this,[new ji([new sn("",null)])]),this.first=d,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=d;var K=ke(d,0);this.sel=Fi(K),this.history=new is(null),this.id=++Ys,this.modeOption=n,this.lineSep=l,this.direction=v=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ks(this,{from:K,to:K,text:e}),ni(this,Fi(K),Se)};ui.prototype=$(va.prototype,{constructor:ui,iter:function(e,n,d){d?this.iterN(e-this.first,n-e,d):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var d=0,l=0;l<n.length;++l)d+=n[l].height;this.insertInner(e-this.first,n,d)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=pt(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Yr(function(e){var n=ke(this.first,0),d=this.first+this.size-1;pa(this,{from:n,to:ke(d,at(this,d).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ia(this.cm,0,0),ni(this,Fi(n),Se)}),replaceRange:function(e,n,d,l){n=jt(this,n),d=d?jt(this,d):n,ga(this,e,n,d,l)},getRange:function(e,n,d){var l=Fe(this,jt(this,e),jt(this,n));return d===!1?l:l.join(d||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(Hn(this,e))return at(this,e)},getLineNumber:function(e){return xe(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=at(this,e)),Rn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return jt(this,e)},getCursor:function(e){var n=this.sel.primary(),d;return e==null||e=="head"?d=n.head:e=="anchor"?d=n.anchor:e=="end"||e=="to"||e===!1?d=n.to():d=n.from(),d},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Yr(function(e,n,d){Go(this,jt(this,typeof e=="number"?ke(e,n||0):e),null,d)}),setSelection:Yr(function(e,n,d){Go(this,jt(this,e),jt(this,n||e),d)}),extendSelection:Yr(function(e,n,d){us(this,jt(this,e),n&&jt(this,n),d)}),extendSelections:Yr(function(e,n){Ko(this,ct(this,e),n)}),extendSelectionsBy:Yr(function(e,n){var d=L(this.sel.ranges,e);Ko(this,ct(this,d),n)}),setSelections:Yr(function(e,n,d){if(!e.length)return;for(var l=[],v=0;v<e.length;v++)l[v]=new Nr(jt(this,e[v].anchor),jt(this,e[v].head));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),ni(this,wi(this.cm,l,n),d)}),addSelection:Yr(function(e,n,d){var l=this.sel.ranges.slice(0);l.push(new Nr(jt(this,e),jt(this,n||e))),ni(this,wi(this.cm,l,l.length-1),d)}),getSelection:function(e){for(var n=this.sel.ranges,d,l=0;l<n.length;l++){var v=Fe(this,n[l].from(),n[l].to());d=d?d.concat(v):v}return e===!1?d:d.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],d=this.sel.ranges,l=0;l<d.length;l++){var v=Fe(this,d[l].from(),d[l].to());e!==!1&&(v=v.join(e||this.lineSeparator())),n[l]=v}return n},replaceSelection:function(e,n,d){for(var l=[],v=0;v<this.sel.ranges.length;v++)l[v]=e;this.replaceSelections(l,n,d||"+input")},replaceSelections:Yr(function(e,n,d){for(var l=[],v=this.sel,K=0;K<v.ranges.length;K++){var te=v.ranges[K];l[K]={from:te.from(),to:te.to(),text:this.splitLines(e[K]),origin:d}}for(var ie=n&&n!="end"&&Al(this,l,n),oe=l.length-1;oe>=0;oe--)pa(this,l[oe]);ie?zo(this,ie):this.cm&&ra(this.cm)}),undo:Yr(function(){cs(this,"undo")}),redo:Yr(function(){cs(this,"redo")}),undoSelection:Yr(function(){cs(this,"undo",!0)}),redoSelection:Yr(function(){cs(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,d=0,l=0;l<e.done.length;l++)e.done[l].ranges||++n;for(var v=0;v<e.undone.length;v++)e.undone[v].ranges||++d;return{undo:n,redo:d}},clearHistory:function(){var e=this;this.history=new is(this.history.maxGeneration),Ci(this,function(n){return n.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:ca(this.history.done),undone:ca(this.history.undone)}},setHistory:function(e){var n=this.history=new is(this.history.maxGeneration);n.done=ca(e.done.slice(0),null,!0),n.undone=ca(e.undone.slice(0),null,!0)},setGutterMarker:Yr(function(e,n,d){return ka(this,e,"gutter",function(l){var v=l.gutterMarkers||(l.gutterMarkers={});return v[n]=d,!d&&we(v)&&(l.gutterMarkers=null),!0})}),clearGutter:Yr(function(e){var n=this;this.iter(function(d){d.gutterMarkers&&d.gutterMarkers[e]&&ka(n,d,"gutter",function(){return d.gutterMarkers[e]=null,we(d.gutterMarkers)&&(d.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!Hn(this,e))return null;if(n=e,e=at(this,e),!e)return null}else if(n=xe(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Yr(function(e,n,d){return ka(this,e,n=="gutter"?"gutter":"class",function(l){var v=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[v])l[v]=d;else{if(I(d).test(l[v]))return!1;l[v]+=" "+d}return!0})}),removeLineClass:Yr(function(e,n,d){return ka(this,e,n=="gutter"?"gutter":"class",function(l){var v=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",K=l[v];if(K)if(d==null)l[v]=null;else{var te=K.match(I(d));if(!te)return!1;var ie=te.index+te[0].length;l[v]=K.slice(0,te.index)+(!te.index||ie==K.length?"":" ")+K.slice(ie)||null}else return!1;return!0})}),addLineWidget:Yr(function(e,n,d){return Ml(this,e,n,d)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,d){return _a(this,jt(this,e),jt(this,n),d,d&&d.type||"range")},setBookmark:function(e,n){var d={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=jt(this,e),_a(this,e,e,d,"bookmark")},findMarksAt:function(e){e=jt(this,e);var n=[],d=at(this,e.line).markedSpans;if(d)for(var l=0;l<d.length;++l){var v=d[l];(v.from==null||v.from<=e.ch)&&(v.to==null||v.to>=e.ch)&&n.push(v.marker.parent||v.marker)}return n},findMarks:function(e,n,d){e=jt(this,e),n=jt(this,n);var l=[],v=e.line;return this.iter(e.line,n.line+1,function(K){var te=K.markedSpans;if(te)for(var ie=0;ie<te.length;ie++){var oe=te[ie];!(oe.to!=null&&v==e.line&&e.ch>=oe.to||oe.from==null&&v!=e.line||oe.from!=null&&v==n.line&&oe.from>=n.ch)&&(!d||d(oe.marker))&&l.push(oe.marker.parent||oe.marker)}++v}),l},getAllMarks:function(){var e=[];return this.iter(function(n){var d=n.markedSpans;if(d)for(var l=0;l<d.length;++l)d[l].from!=null&&e.push(d[l].marker)}),e},posFromIndex:function(e){var n,d=this.first,l=this.lineSeparator().length;return this.iter(function(v){var K=v.text.length+l;if(K>e)return n=e,!0;e-=K,++d}),jt(this,ke(d,n))},indexFromPos:function(e){e=jt(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var d=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){n+=l.text.length+d}),n},copy:function(e){var n=new ui(pt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,d=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<d&&(d=e.to);var l=new ui(pt(this,n,d),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],iu(l,il(this)),l},unlinkDoc:function(e){if(e instanceof Hr&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var d=this.linked[n];if(d.doc!=e)continue;this.linked.splice(n,1),e.unlinkDoc(this),Ul(il(this));break}if(e.history==this.history){var l=[e.id];Ci(e,function(v){return l.push(v.id)},!0),e.history=new is(null),e.history.done=ca(this.history.done,l),e.history.undone=ca(this.history.undone,l)}},iterLinkedDocs:function(e){Ci(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Jt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Yr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&Dl(this.cm)})}),ui.prototype.eachLine=ui.prototype.iter;var al=0;function Fl(e){var n=this;if(Qs(n),ae(n,e)||kr(n.display,e))return;de(e),Y&&(al=+new Date);var d=Gi(n,e,!0),l=e.dataTransfer.files;if(!d||n.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var v=l.length,K=Array(v),te=0,ie=function(){++te==v&&Gr(n,function(){d=jt(n.doc,d);var st={from:d,to:d,text:n.doc.splitLines(K.filter(function(Rt){return Rt!=null}).join(n.doc.lineSeparator())),origin:"paste"};pa(n.doc,st),zo(n.doc,Fi(jt(n.doc,d),jt(n.doc,Yi(st))))})()},oe=function(st,Rt){if(n.options.allowDropFileTypes&&se(n.options.allowDropFileTypes,st.type)==-1){ie();return}var Ht=new FileReader;Ht.onerror=function(){return ie()},Ht.onload=function(){var en=Ht.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(en)){ie();return}K[Rt]=en,ie()},Ht.readAsText(st)},_e=0;_e<l.length;_e++)oe(l[_e],_e);else{if(n.state.draggingText&&n.doc.sel.contains(d)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var je=e.dataTransfer.getData("Text");if(je){var Ve;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ve=n.listSelections()),ha(n.doc,Fi(d,d)),Ve)for(var dt=0;dt<Ve.length;++dt)ga(n.doc,"",Ve[dt].anchor,Ve[dt].head,"drag");n.replaceSelection(je,"around","paste"),n.display.input.focus()}}catch(st){}}}function sl(e,n){if(Y&&(!e.state.draggingText||+new Date-al<100)){ue(n);return}if(ae(e,n)||kr(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!p){var d=h("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(d.width=d.height=1,e.display.wrapper.appendChild(d),d._top=d.offsetTop),n.dataTransfer.setDragImage(d,0,0),f&&d.parentNode.removeChild(d)}}function Bl(e,n){var d=Gi(e,n);if(!d)return;var l=document.createDocumentFragment();yo(e,d,l),e.display.dragCursor||(e.display.dragCursor=h("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),g(e.display.dragCursor,l)}function Qs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ol(e){if(!document.getElementsByClassName)return;for(var n=document.getElementsByClassName("CodeMirror"),d=[],l=0;l<n.length;l++){var v=n[l].CodeMirror;v&&d.push(v)}d.length&&d[0].operation(function(){for(var K=0;K<d.length;K++)e(d[K])})}var Js=!1;function au(){if(Js)return;qs(),Js=!0}function qs(){var e;Qe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ol(jl)},100))}),Qe(window,"blur",function(){return ol(na)})}function jl(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var Wi={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"},Na=0;Na<10;Na++)Wi[Na+48]=Wi[Na+96]=String(Na);for(var hs=65;hs<=90;hs++)Wi[hs]=String.fromCharCode(hs);for(var Ua=1;Ua<=12;Ua++)Wi[Ua+111]=Wi[Ua+63235]="F"+Ua;var Li={};Li.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"},Li.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"},Li.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"},Li.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"]},Li.default=u?Li.macDefault:Li.pcDefault;function Wl(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var d,l,v,K,te=0;te<n.length-1;te++){var ie=n[te];if(/^(cmd|meta|m)$/i.test(ie))K=!0;else if(/^a(lt)?$/i.test(ie))d=!0;else if(/^(c|ctrl|control)$/i.test(ie))l=!0;else if(/^s(hift)?$/i.test(ie))v=!0;else throw new Error("Unrecognized modifier name: "+ie)}return d&&(e="Alt-"+e),l&&(e="Ctrl-"+e),K&&(e="Cmd-"+e),v&&(e="Shift-"+e),e}function ll(e){var n={};for(var d in e)if(e.hasOwnProperty(d)){var l=e[d];if(/^(name|fallthrough|(de|at)tach)$/.test(d))continue;if(l=="..."){delete e[d];continue}for(var v=L(d.split(" "),Wl),K=0;K<v.length;K++){var te=void 0,ie=void 0;K==v.length-1?(ie=v.join(" "),te=l):(ie=v.slice(0,K+1).join(" "),te="...");var oe=n[ie];if(!oe)n[ie]=te;else if(oe!=te)throw new Error("Inconsistent bindings for "+ie)}delete e[d]}for(var _e in n)e[_e]=n[_e];return e}function Ii(e,n,d,l){n=Ba(n);var v=n.call?n.call(e,l):n[e];if(v===!1)return"nothing";if(v==="...")return"multi";if(v!=null&&d(v))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return Ii(e,n.fallthrough,d,l);for(var K=0;K<n.fallthrough.length;K++){var te=Ii(e,n.fallthrough[K],d,l);if(te)return te}}}function Fa(e){var n=typeof e=="string"?e:Wi[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function ul(e,n,d){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(S?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(S?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!d&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function fs(e,n){if(f&&e.keyCode==34&&e.char)return!1;var d=Wi[e.keyCode];return d==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(d=e.code),ul(d,e,n))}function Ba(e){return typeof e=="string"?Li[e]:e}function ba(e,n){for(var d=e.doc.sel.ranges,l=[],v=0;v<d.length;v++){for(var K=n(d[v]);l.length&&ut(K.from,_(l).to)<=0;){var te=l.pop();if(ut(te.from,K.from)<0){K.from=te.from;break}}l.push(K)}ci(e,function(){for(var ie=l.length-1;ie>=0;ie--)ga(e.doc,"",l[ie].from,l[ie].to,"+delete");ra(e)})}function Zs(e,n,d){var l=Xe(e.text,n+d,d);return l<0||l>e.text.length?null:l}function eo(e,n,d){var l=Zs(e,n.ch,d);return l==null?null:new ke(n.line,l,d<0?"after":"before")}function to(e,n,d,l,v){if(e){n.doc.direction=="rtl"&&(v=-v);var K=Yt(d,n.doc.direction);if(K){var te=v<0?_(K):K[0],ie=v<0==(te.level==1),oe=ie?"after":"before",_e;if(te.level>0||n.doc.direction=="rtl"){var je=ki(n,d);_e=v<0?d.text.length-1:0;var Ve=ai(n,je,_e).top;_e=ht(function(dt){return ai(n,je,dt).top==Ve},v<0==(te.level==1)?te.from:te.to-1,_e),oe=="before"&&(_e=Zs(d,_e,1))}else _e=v<0?te.to:te.from;return new ke(l,_e,oe)}}return new ke(l,v<0?d.text.length:0,v<0?"before":"after")}function no(e,n,d,l){var v=Yt(n,e.doc.direction);if(!v)return eo(n,d,l);d.ch>=n.text.length?(d.ch=n.text.length,d.sticky="before"):d.ch<=0&&(d.ch=0,d.sticky="after");var K=Wt(v,d.ch,d.sticky),te=v[K];if(e.doc.direction=="ltr"&&te.level%2==0&&(l>0?te.to>d.ch:te.from<d.ch))return eo(n,d,l);var ie=function(Tn,Yn){return Zs(n,Tn instanceof ke?Tn.ch:Tn,Yn)},oe,_e=function(Tn){return e.options.lineWrapping?(oe=oe||ki(e,n),vo(e,n,oe,Tn)):{begin:0,end:n.text.length}},je=_e(d.sticky=="before"?ie(d,-1):d.ch);if(e.doc.direction=="rtl"||te.level==1){var Ve=te.level==1==l<0,dt=ie(d,Ve?1:-1);if(dt!=null&&(Ve?dt<=te.to&&dt<=je.end:dt>=te.from&&dt>=je.begin)){var st=Ve?"before":"after";return new ke(d.line,dt,st)}}var Rt=function(Tn,Yn,Sn){for(var lr=function(Wr,ri){return ri?new ke(d.line,ie(Wr,1),"before"):new ke(d.line,Wr,"after")};Tn>=0&&Tn<v.length;Tn+=Yn){var Rr=v[Tn],Cr=Yn>0==(Rr.level!=1),Dr=Cr?Sn.begin:ie(Sn.end,-1);if(Rr.from<=Dr&&Dr<Rr.to)return lr(Dr,Cr);if(Dr=Cr?Rr.from:ie(Rr.to,-1),Sn.begin<=Dr&&Dr<Sn.end)return lr(Dr,Cr)}},Ht=Rt(K+l,l,je);if(Ht)return Ht;var en=l>0?je.end:ie(je.begin,-1);return en!=null&&!(l>0&&en==n.text.length)&&(Ht=Rt(l>0?0:v.length-1,l,_e(en)),Ht)?Ht:null}var Ea={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Se)},killLine:function(e){return ba(e,function(n){if(n.empty()){var d=at(e.doc,n.head.line).text.length;return n.head.ch==d&&n.head.line<e.lastLine()?{from:n.head,to:ke(n.head.line+1,0)}:{from:n.head,to:ke(n.head.line,d)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return ba(e,function(n){return{from:ke(n.from().line,0),to:jt(e.doc,ke(n.to().line+1,0))}})},delLineLeft:function(e){return ba(e,function(n){return{from:ke(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return ba(e,function(n){var d=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return{from:l,to:n.from()}})},delWrappedLineRight:function(e){return ba(e,function(n){var d=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div");return{from:n.from(),to:l}})},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(ke(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ke(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return ps(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return dl(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return ro(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var d=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div")},Te)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var d=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:d},"div")},Te)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var d=e.cursorCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return l.ch<e.getLine(l.line).search(/\S/)?dl(e,n.head):l},Te)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var n=[],d=e.listSelections(),l=e.options.tabSize,v=0;v<d.length;v++){var K=d[v].from(),te=H(e.getLine(K.line),K.ch,l);n.push(q(l-te%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ci(e,function(){for(var n=e.listSelections(),d=[],l=0;l<n.length;l++){if(!n[l].empty())continue;var v=n[l].head,K=at(e.doc,v.line).text;if(K){if(v.ch==K.length&&(v=new ke(v.line,v.ch-1)),v.ch>0)v=new ke(v.line,v.ch+1),e.replaceRange(K.charAt(v.ch-1)+K.charAt(v.ch-2),ke(v.line,v.ch-2),v,"+transpose");else if(v.line>e.doc.first){var te=at(e.doc,v.line-1).text;te&&(v=new ke(v.line,1),e.replaceRange(K.charAt(0)+e.doc.lineSeparator()+te.charAt(te.length-1),ke(v.line-1,te.length-1),v,"+transpose"))}}d.push(new Nr(v,v))}e.setSelections(d)})},newlineAndIndent:function(e){return ci(e,function(){for(var n=e.listSelections(),d=n.length-1;d>=0;d--)e.replaceRange(e.doc.lineSeparator(),n[d].anchor,n[d].head,"+input");n=e.listSelections();for(var l=0;l<n.length;l++)e.indentLine(n[l].from().line,null,!0);ra(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ps(e,n){var d=at(e.doc,n),l=Rn(d);return l!=d&&(n=xe(l)),to(!0,e,l,n,1)}function ro(e,n){var d=at(e.doc,n),l=En(d);return l!=d&&(n=xe(l)),to(!0,e,d,n,-1)}function dl(e,n){var d=ps(e,n.line),l=at(e.doc,d.line),v=Yt(l,e.doc.direction);if(!v||v[0].level==0){var K=Math.max(d.ch,l.text.search(/\S/)),te=n.line==d.line&&n.ch<=K&&n.ch;return ke(d.line,te?0:K,d.sticky)}return d}function ms(e,n,d){if(typeof n=="string"&&(n=Ea[n],!n))return!1;e.display.input.ensurePolled();var l=e.display.shift,v=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d&&(e.display.shift=!1),v=n(e)!=ve}finally{e.display.shift=l,e.state.suppressEdits=!1}return v}function Hl(e,n,d){for(var l=0;l<e.state.keyMaps.length;l++){var v=Ii(n,e.state.keyMaps[l],d,e);if(v)return v}return e.options.extraKeys&&Ii(n,e.options.extraKeys,d,e)||Ii(n,e.options.keyMap,d,e)}var Kl=new J;function ja(e,n,d,l){var v=e.state.keySeq;if(v){if(Fa(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Kl.set(50,function(){e.state.keySeq==v&&(e.state.keySeq=null,e.display.input.reset())}),io(e,v+" "+n,d,l))return!0}return io(e,n,d,l)}function io(e,n,d,l){var v=Hl(e,n,l);return v=="multi"&&(e.state.keySeq=n),v=="handled"&&Ft(e,"keyHandled",e,n,d),(v=="handled"||v=="multi")&&(de(d),ks(e)),!!v}function cl(e,n){var d=fs(n,!0);return d?n.shiftKey&&!e.state.keySeq?ja(e,"Shift-"+d,n,function(l){return ms(e,l,!0)})||ja(e,d,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return ms(e,l)}):ja(e,d,n,function(l){return ms(e,l)}):!1}function Gl(e,n,d){return ja(e,"'"+d+"'",n,function(l){return ms(e,l,!0)})}var ao=null;function hl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(n.curOp.focus=W(),ae(n,e))return;Y&&X<11&&e.keyCode==27&&(e.returnValue=!1);var d=e.keyCode;n.display.shift=d==16||e.shiftKey;var l=cl(n,e);f&&(ao=l?d:null,!l&&d==88&&!rn&&(u?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),U&&!u&&!l&&d==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),d==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&zl(n)}function zl(e){var n=e.display.lineDiv;j(n,"CodeMirror-crosshair");function d(l){(l.keyCode==18||!l.altKey)&&(E(n,"CodeMirror-crosshair"),xt(document,"keyup",d),xt(document,"mouseover",d))}Qe(document,"keyup",d),Qe(document,"mouseover",d)}function fl(e){e.keyCode==16&&(this.doc.sel.shift=!1),ae(this,e)}function pl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(kr(n.display,e)||ae(n,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var d=e.keyCode,l=e.charCode;if(f&&d==ao){ao=null,de(e);return}if(f&&(!e.which||e.which<10)&&cl(n,e))return;var v=String.fromCharCode(l==null?d:l);if(v=="\b")return;if(Gl(n,e,v))return;n.display.input.onKeyPress(e)}var Vl=400,so=function(e,n,d){this.time=e,this.pos=n,this.button=d};so.prototype.compare=function(e,n,d){return this.time+Vl>e&&ut(n,this.pos)==0&&d==this.button};var Wa,Ha;function Xl(e,n){var d=+new Date;return Ha&&Ha.compare(d,e,n)?(Wa=Ha=null,"triple"):Wa&&Wa.compare(d,e,n)?(Ha=new so(d,e,n),Wa=null,"double"):(Wa=new so(d,e,n),Ha=null,"single")}function oo(e){var n=this,d=n.display;if(ae(n,e)||d.activeTouch&&d.input.supportsTouch())return;if(d.input.ensurePolled(),d.shift=e.shiftKey,kr(d,e)){r||(d.scroller.draggable=!1,setTimeout(function(){return d.scroller.draggable=!0},100));return}if(uo(n,e))return;var l=Gi(n,e),v=We(e),K=l?Xl(l,v):"single";if(window.focus(),v==1&&n.state.selectingText&&n.state.selectingText(e),l&&ml(n,v,l,K,e))return;v==1?l?Yl(n,l,K,e):Me(e)==d.scroller&&de(e):v==2?(l&&us(n.doc,l),setTimeout(function(){return d.input.focus()},20)):v==3&&(D?n.display.input.onContextMenu(e):Eo(n))}function ml(e,n,d,l,v){var K="Click";return l=="double"?K="Double"+K:l=="triple"&&(K="Triple"+K),K=(n==1?"Left":n==2?"Middle":"Right")+K,ja(e,ul(K,v),v,function(te){if(typeof te=="string"&&(te=Ea[te]),!te)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=te(e,d)!=ve}finally{e.state.suppressEdits=!1}return ie})}function $l(e,n,d){var l=e.getOption("configureMouse"),v=l?l(e,n,d):{};if(v.unit==null){var K=o?d.shiftKey&&d.metaKey:d.altKey;v.unit=K?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(v.extend==null||e.doc.extend)&&(v.extend=e.doc.extend||d.shiftKey),v.addNew==null&&(v.addNew=u?d.metaKey:d.ctrlKey),v.moveOnDrag==null&&(v.moveOnDrag=!(u?d.altKey:d.ctrlKey)),v}function Yl(e,n,d,l){Y?setTimeout(k(Ms,e),0):e.curOp.focus=W();var v=$l(e,d,l),K=e.doc.sel,te;e.options.dragDrop&&lt&&!e.isReadOnly()&&d=="single"&&(te=K.contains(n))>-1&&(ut((te=K.ranges[te]).from(),n)<0||n.xRel>0)&&(ut(te.to(),n)>0||n.xRel<0)?Ql(e,l,n,v):Jl(e,l,n,v)}function Ql(e,n,d,l){var v=e.display,K=!1,te=Gr(e,function(_e){r&&(v.scroller.draggable=!1),e.state.draggingText=!1,xt(v.wrapper.ownerDocument,"mouseup",te),xt(v.wrapper.ownerDocument,"mousemove",ie),xt(v.scroller,"dragstart",oe),xt(v.scroller,"drop",te),K||(de(_e),l.addNew||us(e.doc,d,null,null,l.extend),r&&!p||Y&&X==9?setTimeout(function(){v.wrapper.ownerDocument.body.focus({preventScroll:!0}),v.input.focus()},20):v.input.focus())}),ie=function(_e){K=K||Math.abs(n.clientX-_e.clientX)+Math.abs(n.clientY-_e.clientY)>=10},oe=function(){return K=!0};r&&(v.scroller.draggable=!0),e.state.draggingText=te,te.copy=!l.moveOnDrag,v.scroller.dragDrop&&v.scroller.dragDrop(),Qe(v.wrapper.ownerDocument,"mouseup",te),Qe(v.wrapper.ownerDocument,"mousemove",ie),Qe(v.scroller,"dragstart",oe),Qe(v.scroller,"drop",te),Eo(e),setTimeout(function(){return v.input.focus()},20)}function lo(e,n,d){if(d=="char")return new Nr(n,n);if(d=="word")return e.findWordAt(n);if(d=="line")return new Nr(ke(n.line,0),jt(e.doc,ke(n.line+1,0)));var l=d(e,n);return new Nr(l.from,l.to)}function Jl(e,n,d,l){var v=e.display,K=e.doc;de(n);var te,ie,oe=K.sel,_e=oe.ranges;if(l.addNew&&!l.extend?(ie=K.sel.contains(d),ie>-1?te=_e[ie]:te=new Nr(d,d)):(te=K.sel.primary(),ie=K.sel.primIndex),l.unit=="rectangle")l.addNew||(te=new Nr(d,d)),d=Gi(e,n,!0,!0),ie=-1;else{var je=lo(e,d,l.unit);l.extend?te=ls(te,je.anchor,je.head,l.extend):te=je}l.addNew?ie==-1?(ie=_e.length,ni(K,wi(e,_e.concat([te]),ie),{scroll:!1,origin:"*mouse"})):_e.length>1&&_e[ie].empty()&&l.unit=="char"&&!l.extend?(ni(K,wi(e,_e.slice(0,ie).concat(_e.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),oe=K.sel):Bi(K,ie,te,Ue):(ie=0,ni(K,new mi([te],0),Ue),oe=K.sel);var Ve=d;function dt(Sn){if(ut(Ve,Sn)==0)return;if(Ve=Sn,l.unit=="rectangle"){for(var lr=[],Rr=e.options.tabSize,Cr=H(at(K,d.line).text,d.ch,Rr),Dr=H(at(K,Sn.line).text,Sn.ch,Rr),Wr=Math.min(Cr,Dr),ri=Math.max(Cr,Dr),zr=Math.min(d.line,Sn.line),Ei=Math.min(e.lastLine(),Math.max(d.line,Sn.line));zr<=Ei;zr++){var gi=at(K,zr).text,Qr=Ie(gi,Wr,Rr);Wr==ri?lr.push(new Nr(ke(zr,Qr),ke(zr,Qr))):gi.length>Qr&&lr.push(new Nr(ke(zr,Qr),ke(zr,Ie(gi,ri,Rr))))}lr.length||lr.push(new Nr(d,d)),ni(K,wi(e,oe.ranges.slice(0,ie).concat(lr),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Sn)}else{var vi=te,oi=lo(e,Sn,l.unit),Zr=vi.anchor,Jr;ut(oi.anchor,Zr)>0?(Jr=oi.head,Zr=pr(vi.from(),oi.anchor)):(Jr=oi.anchor,Zr=cr(vi.to(),oi.head));var Xr=oe.ranges.slice(0);Xr[ie]=ql(e,new Nr(jt(K,Zr),Jr)),ni(K,wi(e,Xr,ie),Ue)}}var st=v.wrapper.getBoundingClientRect(),Rt=0;function Ht(Sn){var lr=++Rt,Rr=Gi(e,Sn,!0,l.unit=="rectangle");if(!Rr)return;if(ut(Rr,Ve)!=0){e.curOp.focus=W(),dt(Rr);var Cr=qa(v,K);(Rr.line>=Cr.to||Rr.line<Cr.from)&&setTimeout(Gr(e,function(){Rt==lr&&Ht(Sn)}),150)}else{var Dr=Sn.clientY<st.top?-20:Sn.clientY>st.bottom?20:0;Dr&&setTimeout(Gr(e,function(){if(Rt!=lr)return;v.scroller.scrollTop+=Dr,Ht(Sn)}),50)}}function en(Sn){e.state.selectingText=!1,Rt=Infinity,Sn&&(de(Sn),v.input.focus()),xt(v.wrapper.ownerDocument,"mousemove",Tn),xt(v.wrapper.ownerDocument,"mouseup",Yn),K.history.lastSelOrigin=null}var Tn=Gr(e,function(Sn){Sn.buttons===0||!We(Sn)?en(Sn):Ht(Sn)}),Yn=Gr(e,en);e.state.selectingText=Yn,Qe(v.wrapper.ownerDocument,"mousemove",Tn),Qe(v.wrapper.ownerDocument,"mouseup",Yn)}function ql(e,n){var d=n.anchor,l=n.head,v=at(e.doc,d.line);if(ut(d,l)==0&&d.sticky==l.sticky)return n;var K=Yt(v);if(!K)return n;var te=Wt(K,d.ch,d.sticky),ie=K[te];if(ie.from!=d.ch&&ie.to!=d.ch)return n;var oe=te+(ie.from==d.ch==(ie.level!=1)?0:1);if(oe==0||oe==K.length)return n;var _e;if(l.line!=d.line)_e=(l.line-d.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var je=Wt(K,l.ch,l.sticky),Ve=je-te||(l.ch-d.ch)*(ie.level==1?-1:1);je==oe-1||je==oe?_e=Ve<0:_e=Ve>0}var dt=K[oe+(_e?-1:0)],st=_e==(dt.level==1),Rt=st?dt.from:dt.to,Ht=st?"after":"before";return d.ch==Rt&&d.sticky==Ht?n:new Nr(new ke(d.line,Rt,Ht),l)}function gl(e,n,d,l){var v,K;if(n.touches)v=n.touches[0].clientX,K=n.touches[0].clientY;else try{v=n.clientX,K=n.clientY}catch(dt){return!1}if(v>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&de(n);var te=e.display,ie=te.lineDiv.getBoundingClientRect();if(K>ie.bottom||!me(e,d))return De(n);K-=ie.top-te.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var _e=te.gutters.childNodes[oe];if(_e&&_e.getBoundingClientRect().right>=v){var je=ge(e.doc,K),Ve=e.display.gutterSpecs[oe];return ye(e,d,e,je,Ve.className,n),De(n)}}}function uo(e,n){return gl(e,n,"gutterClick",!0)}function vl(e,n){if(kr(e.display,n)||_l(e,n))return;if(ae(e,n,"contextmenu"))return;D||e.display.input.onContextMenu(n)}function _l(e,n){return me(e,"gutterContextMenu")?gl(e,n,"gutterContextMenu",!1):!1}function yl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ca(e)}var xa={toString:function(){return"CodeMirror.Init"}},gs={},Ka={};function Zl(e){var n=e.optionHandlers;function d(l,v,K,te){e.defaults[l]=v,K&&(n[l]=te?function(ie,oe,_e){_e!=xa&&K(ie,oe,_e)}:K)}e.defineOption=d,e.Init=xa,d("value","",function(l,v){return l.setValue(v)},!0),d("mode",null,function(l,v){l.doc.modeOption=v,La(l)},!0),d("indentUnit",2,La,!0),d("indentWithTabs",!1),d("smartIndent",!0),d("tabSize",4,function(l){Ia(l),Ca(l),li(l)},!0),d("lineSeparator",null,function(l,v){if(l.doc.lineSep=v,!v)return;var K=[],te=l.doc.first;l.doc.iter(function(oe){for(var _e=0;;){var je=oe.text.indexOf(v,_e);if(je==-1)break;_e=je+v.length,K.push(ke(te,je))}te++});for(var ie=K.length-1;ie>=0;ie--)ga(l.doc,v,K[ie],ke(K[ie].line,K[ie].ch+v.length))}),d("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,v,K){l.state.specialChars=new RegExp(v.source+(v.test(" ")?"":"| "),"g"),K!=xa&&l.refresh()}),d("specialCharPlaceholder",ot,function(l){return l.refresh()},!0),d("electricChars",!0),d("inputStyle",t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),d("spellcheck",!1,function(l,v){return l.getInputField().spellcheck=v},!0),d("autocorrect",!1,function(l,v){return l.getInputField().autocorrect=v},!0),d("autocapitalize",!1,function(l,v){return l.getInputField().autocapitalize=v},!0),d("rtlMoveVisually",!R),d("wholeLineUpdateBefore",!0),d("theme","default",function(l){yl(l),Da(l)},!0),d("keyMap","default",function(l,v,K){var te=Ba(v),ie=K!=xa&&Ba(K);ie&&ie.detach&&ie.detach(l,te),te.attach&&te.attach(l,ie||null)}),d("extraKeys",null),d("configureMouse",null),d("lineWrapping",!1,tu,!0),d("gutters",[],function(l,v){l.display.gutterSpecs=Ws(v,l.options.lineNumbers),Da(l)},!0),d("fixedGutter",!0,function(l,v){l.display.gutters.style.left=v?Ds(l.display)+"px":"0",l.refresh()},!0),d("coverGutterNextToScrollbar",!1,function(l){return Ui(l)},!0),d("scrollbarStyle","native",function(l){Oo(l),Ui(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),d("lineNumbers",!1,function(l,v){l.display.gutterSpecs=Ws(l.options.gutters,v),Da(l)},!0),d("firstLineNumber",1,Da,!0),d("lineNumberFormatter",function(l){return l},Da,!0),d("showCursorWhenSelecting",!1,ta,!0),d("resetSelectionOnContextMenu",!0),d("lineWiseCopyCut",!0),d("pasteLinesPerSelection",!0),d("selectionsMayTouch",!1),d("readOnly",!1,function(l,v){v=="nocursor"&&(na(l),l.display.input.blur()),l.display.input.readOnlyChanged(v)}),d("screenReaderLabel",null,function(l,v){v=v===""?null:v,l.display.input.screenReaderLabelChanged(v)}),d("disableInput",!1,function(l,v){v||l.display.input.reset()},!0),d("dragDrop",!0,eu),d("allowDropFileTypes",null),d("cursorBlinkRate",530),d("cursorScrollMargin",0),d("cursorHeight",1,ta,!0),d("singleCursorHeightPerLine",!0,ta,!0),d("workTime",100),d("workDelay",100),d("flattenSpans",!0,Ia,!0),d("addModeClass",!1,Ia,!0),d("pollInterval",100),d("undoDepth",200,function(l,v){return l.doc.history.undoDepth=v}),d("historyEventDelay",1250),d("viewportMargin",10,function(l){return l.refresh()},!0),d("maxHighlightLength",1e4,Ia,!0),d("moveInputWithCursor",!0,function(l,v){v||l.display.input.resetPosition()}),d("tabindex",null,function(l,v){return l.display.input.getField().tabIndex=v||""}),d("autofocus",null),d("direction","ltr",function(l,v){return l.doc.setDirection(v)},!0),d("phrases",null)}function eu(e,n,d){var l=d&&d!=xa;if(!n!=!l){var v=e.display.dragFunctions,K=n?Qe:xt;K(e.display.scroller,"dragstart",v.start),K(e.display.scroller,"dragenter",v.enter),K(e.display.scroller,"dragover",v.over),K(e.display.scroller,"dragleave",v.leave),K(e.display.scroller,"drop",v.drop)}}function tu(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),zt(e)),Ps(e),li(e),Ca(e),setTimeout(function(){return Ui(e)},100)}function Hr(e,n){var d=this;if(!(this instanceof Hr))return new Hr(e,n);this.options=n=n?y(n):{},y(gs,n,!1);var l=n.value;typeof l=="string"?l=new ui(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var v=new Hr.inputStyles[n.inputStyle](this),K=this.display=new Ol(e,l,v,n);K.wrapper.CodeMirror=this,yl(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Oo(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 J,keySeq:null,specialChars:null},n.autofocus&&!t&&K.input.focus(),Y&&X<11&&setTimeout(function(){return d.display.input.reset(!0)},20),bl(this),au(),Vi(this),this.curOp.forceUpdate=!0,Gs(this,l),n.autofocus&&!t||this.hasFocus()?setTimeout(function(){d.hasFocus()&&!d.state.focused&&Ns(d)},20):na(this);for(var te in Ka)Ka.hasOwnProperty(te)&&Ka[te](this,n[te],xa);ko(this),n.finishInit&&n.finishInit(this);for(var ie=0;ie<P.length;++ie)P[ie](this);Xi(this),r&&n.lineWrapping&&getComputedStyle(K.lineDiv).textRendering=="optimizelegibility"&&(K.lineDiv.style.textRendering="auto")}Hr.defaults=gs,Hr.optionHandlers=Ka;function bl(e){var n=e.display;Qe(n.scroller,"mousedown",Gr(e,oo)),Y&&X<11?Qe(n.scroller,"dblclick",Gr(e,function(oe){if(ae(e,oe))return;var _e=Gi(e,oe);if(!_e||uo(e,oe)||kr(e.display,oe))return;de(oe);var je=e.findWordAt(_e);us(e.doc,je.anchor,je.head)})):Qe(n.scroller,"dblclick",function(oe){return ae(e,oe)||de(oe)}),Qe(n.scroller,"contextmenu",function(oe){return vl(e,oe)}),Qe(n.input.getField(),"contextmenu",function(oe){n.scroller.contains(oe.target)||vl(e,oe)});var d,l={end:0};function v(){n.activeTouch&&(d=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function K(oe){if(oe.touches.length!=1)return!1;var _e=oe.touches[0];return _e.radiusX<=1&&_e.radiusY<=1}function te(oe,_e){if(_e.left==null)return!0;var je=_e.left-oe.left,Ve=_e.top-oe.top;return je*je+Ve*Ve>20*20}Qe(n.scroller,"touchstart",function(oe){if(!ae(e,oe)&&!K(oe)&&!uo(e,oe)){n.input.ensurePolled(),clearTimeout(d);var _e=+new Date;n.activeTouch={start:_e,moved:!1,prev:_e-l.end<=300?l:null},oe.touches.length==1&&(n.activeTouch.left=oe.touches[0].pageX,n.activeTouch.top=oe.touches[0].pageY)}}),Qe(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),Qe(n.scroller,"touchend",function(oe){var _e=n.activeTouch;if(_e&&!kr(n,oe)&&_e.left!=null&&!_e.moved&&new Date-_e.start<300){var je=e.coordsChar(n.activeTouch,"page"),Ve;!_e.prev||te(_e,_e.prev)?Ve=new Nr(je,je):!_e.prev.prev||te(_e,_e.prev.prev)?Ve=e.findWordAt(je):Ve=new Nr(ke(je.line,0),jt(e.doc,ke(je.line+1,0))),e.setSelection(Ve.anchor,Ve.head),e.focus(),de(oe)}v()}),Qe(n.scroller,"touchcancel",v),Qe(n.scroller,"scroll",function(){n.scroller.clientHeight&&(aa(e,n.scroller.scrollTop),Di(e,n.scroller.scrollLeft,!0),ye(e,"scroll",e))}),Qe(n.scroller,"mousewheel",function(oe){return No(e,oe)}),Qe(n.scroller,"DOMMouseScroll",function(oe){return No(e,oe)}),Qe(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(oe){ae(e,oe)||ue(oe)},over:function(oe){ae(e,oe)||(Bl(e,oe),ue(oe))},start:function(oe){return sl(e,oe)},drop:Gr(e,Fl),leave:function(oe){ae(e,oe)||Qs(e)}};var ie=n.input.getField();Qe(ie,"keyup",function(oe){return fl.call(e,oe)}),Qe(ie,"keydown",Gr(e,hl)),Qe(ie,"keypress",Gr(e,pl)),Qe(ie,"focus",function(oe){return Ns(e,oe)}),Qe(ie,"blur",function(oe){return na(e,oe)})}var P=[];Hr.defineInitHook=function(e){return P.push(e)};function N(e,n,d,l){var v=e.doc,K;d==null&&(d="add"),d=="smart"&&(v.mode.indent?K=Pn(e,n).state:d="prev");var te=e.options.tabSize,ie=at(v,n),oe=H(ie.text,null,te);ie.stateAfter&&(ie.stateAfter=null);var _e=ie.text.match(/^\s*/)[0],je;if(!l&&!/\S/.test(ie.text))je=0,d="not";else if(d=="smart"&&(je=v.mode.indent(K,ie.text.slice(_e.length),ie.text),je==ve||je>150)){if(!l)return;d="prev"}d=="prev"?n>v.first?je=H(at(v,n-1).text,null,te):je=0:d=="add"?je=oe+e.options.indentUnit:d=="subtract"?je=oe-e.options.indentUnit:typeof d=="number"&&(je=oe+d),je=Math.max(0,je);var Ve="",dt=0;if(e.options.indentWithTabs)for(var st=Math.floor(je/te);st;--st)dt+=te,Ve+=" ";if(dt<je&&(Ve+=q(je-dt)),Ve!=_e)return ga(v,Ve,ke(n,0),ke(n,_e.length),"+input"),ie.stateAfter=null,!0;for(var Rt=0;Rt<v.sel.ranges.length;Rt++){var Ht=v.sel.ranges[Rt];if(Ht.head.line==n&&Ht.head.ch<_e.length){var en=ke(n,_e.length);Bi(v,Rt,new Nr(en,en));break}}}var V=null;function re(e){V=e}function ce(e,n,d,l,v){var K=e.doc;e.display.shift=!1,l||(l=K.sel);var te=+new Date-200,ie=v=="paste"||e.state.pasteIncoming>te,oe=Jt(n),_e=null;if(ie&&l.ranges.length>1)if(V&&V.text.join(`
`)==n){if(l.ranges.length%V.text.length==0){_e=[];for(var je=0;je<V.text.length;je++)_e.push(K.splitLines(V.text[je]))}}else oe.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(_e=L(oe,function(Tn){return[Tn]}));for(var Ve=e.curOp.updateInput,dt=l.ranges.length-1;dt>=0;dt--){var st=l.ranges[dt],Rt=st.from(),Ht=st.to();st.empty()&&(d&&d>0?Rt=ke(Rt.line,Rt.ch-d):e.state.overwrite&&!ie?Ht=ke(Ht.line,Math.min(at(K,Ht.line).text.length,Ht.ch+_(oe).length)):ie&&V&&V.lineWise&&V.text.join(`
`)==oe.join(`
`)&&(Rt=Ht=ke(Rt.line,0)));var en={from:Rt,to:Ht,text:_e?_e[dt%_e.length]:oe,origin:v||(ie?"paste":e.state.cutIncoming>te?"cut":"+input")};pa(e.doc,en),Ft(e,"inputRead",e,en)}n&&!ie&&Oe(e,n),ra(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ve),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function he(e,n){var d=e.clipboardData&&e.clipboardData.getData("Text");if(d)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&ci(n,function(){return ce(n,d,0,null,"paste")}),!0}function Oe(e,n){if(!e.options.electricChars||!e.options.smartIndent)return;for(var d=e.doc.sel,l=d.ranges.length-1;l>=0;l--){var v=d.ranges[l];if(v.head.ch>100||l&&d.ranges[l-1].head.line==v.head.line)continue;var K=e.getModeAt(v.head),te=!1;if(K.electricChars){for(var ie=0;ie<K.electricChars.length;ie++)if(n.indexOf(K.electricChars.charAt(ie))>-1){te=N(e,v.head.line,"smart");break}}else K.electricInput&&(K.electricInput.test(at(e.doc,v.head.line).text.slice(0,v.head.ch))&&(te=N(e,v.head.line,"smart")));te&&Ft(e,"electricInput",e,v.head.line)}}function Ae(e){for(var n=[],d=[],l=0;l<e.doc.sel.ranges.length;l++){var v=e.doc.sel.ranges[l].head.line,K={anchor:ke(v,0),head:ke(v+1,0)};d.push(K),n.push(e.getRange(K.anchor,K.head))}return{text:n,ranges:d}}function Ke(e,n,d,l){e.setAttribute("autocorrect",d?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function tt(){var e=h("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),n=h("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),s&&(e.style.border="1px solid black"),Ke(e),n}function it(e){var n=e.optionHandlers,d=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,v){var K=this.options,te=K[l];if(K[l]==v&&l!="mode")return;K[l]=v,n.hasOwnProperty(l)&&Gr(this,n[l])(this,v,te),ye(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,v){this.state.keyMaps[v?"push":"unshift"](Ba(l))},removeKeyMap:function(l){for(var v=this.state.keyMaps,K=0;K<v.length;++K)if(v[K]==l||v[K].name==l)return v.splice(K,1),!0},addOverlay:si(function(l,v){var K=l.token?l:e.getMode(this.options,l);if(K.startState)throw new Error("Overlays may not be stateful.");z(this.state.overlays,{mode:K,modeSpec:l,opaque:v&&v.opaque,priority:v&&v.priority||0},function(te){return te.priority}),this.state.modeGen++,li(this)}),removeOverlay:si(function(l){for(var v=this.state.overlays,K=0;K<v.length;++K){var te=v[K].modeSpec;if(te==l||typeof l=="string"&&te.name==l){v.splice(K,1),this.state.modeGen++,li(this);return}}}),indentLine:si(function(l,v,K){typeof v!="string"&&typeof v!="number"&&(v==null?v=this.options.smartIndent?"smart":"prev":v=v?"add":"subtract"),Hn(this.doc,l)&&N(this,l,v,K)}),indentSelection:si(function(l){for(var v=this.doc.sel.ranges,K=-1,te=0;te<v.length;te++){var ie=v[te];if(ie.empty())ie.head.line>K&&(N(this,ie.head.line,l,!0),K=ie.head.line,te==this.doc.sel.primIndex&&ra(this));else{var oe=ie.from(),_e=ie.to(),je=Math.max(K,oe.line);K=Math.min(this.lastLine(),_e.line-(_e.ch?0:1))+1;for(var Ve=je;Ve<K;++Ve)N(this,Ve,l);var dt=this.doc.sel.ranges;oe.ch==0&&v.length==dt.length&&dt[te].from().ch>0&&Bi(this.doc,te,new Nr(oe,dt[te].to()),Se)}}}),getTokenAt:function(l,v){return ar(this,l,v)},getLineTokens:function(l,v){return ar(this,ke(l),v,!0)},getTokenTypeAt:function(l){l=jt(this.doc,l);var v=Xt(this,at(this.doc,l.line)),K=0,te=(v.length-1)/2,ie=l.ch,oe;if(ie==0)oe=v[2];else for(;;){var _e=K+te>>1;if((_e?v[_e*2-1]:0)>=ie)te=_e;else if(v[_e*2+1]<ie)K=_e+1;else{oe=v[_e*2+2];break}}var je=oe?oe.indexOf("overlay "):-1;return je<0?oe:je==0?null:oe.slice(0,je-1)},getModeAt:function(l){var v=this.doc.mode;return v.innerMode?e.innerMode(v,this.getTokenAt(l).state).mode:v},getHelper:function(l,v){return this.getHelpers(l,v)[0]},getHelpers:function(l,v){var K=[];if(!d.hasOwnProperty(v))return K;var te=d[v],ie=this.getModeAt(l);if(typeof ie[v]=="string")te[ie[v]]&&K.push(te[ie[v]]);else if(ie[v])for(var oe=0;oe<ie[v].length;oe++){var _e=te[ie[v][oe]];_e&&K.push(_e)}else ie.helperType&&te[ie.helperType]?K.push(te[ie.helperType]):te[ie.name]&&K.push(te[ie.name]);for(var je=0;je<te._global.length;je++){var Ve=te._global[je];Ve.pred(ie,this)&&se(K,Ve.val)==-1&&K.push(Ve.val)}return K},getStateAfter:function(l,v){var K=this.doc;return l=Kn(K,l==null?K.first+K.size-1:l),Pn(this,l+1,v).state},cursorCoords:function(l,v){var K,te=this.doc.sel.primary();return l==null?K=te.head:typeof l=="object"?K=jt(this.doc,l):K=l?te.from():te.to(),xi(this,K,v||"page")},charCoords:function(l,v){return Ts(this,jt(this.doc,l),v||"page")},coordsChar:function(l,v){return l=Cs(this,l,v||"page"),Rs(this,l.left,l.top)},lineAtHeight:function(l,v){return l=Cs(this,{top:l,left:0},v||"page").top,ge(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,v,K){var te=!1,ie;if(typeof l=="number"){var oe=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>oe&&(l=oe,te=!0),ie=at(this.doc,l)}else ie=l;return $a(this,ie,{top:0,left:0},v||"page",K||te).top+(te?this.doc.height-kt(ie):0)},defaultTextHeight:function(){return qi(this.display)},defaultCharWidth:function(){return Zi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,v,K,te,ie){var oe=this.display;l=xi(this,jt(this.doc,l));var _e=l.bottom,je=l.left;if(v.style.position="absolute",v.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(v),oe.sizer.appendChild(v),te=="over")_e=l.top;else if(te=="above"||te=="near"){var Ve=Math.max(oe.wrapper.clientHeight,this.doc.height),dt=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(te=="above"||l.bottom+v.offsetHeight>Ve)&&l.top>v.offsetHeight?_e=l.top-v.offsetHeight:l.bottom+v.offsetHeight<=Ve&&(_e=l.bottom),je+v.offsetWidth>dt&&(je=dt-v.offsetWidth)}v.style.top=_e+"px",v.style.left=v.style.right="",ie=="right"?(je=oe.sizer.clientWidth-v.offsetWidth,v.style.right="0px"):(ie=="left"?je=0:ie=="middle"&&(je=(oe.sizer.clientWidth-v.offsetWidth)/2),v.style.left=je+"px"),K&&wl(this,{left:je,top:_e,right:je+v.offsetWidth,bottom:_e+v.offsetHeight})},triggerOnKeyDown:si(hl),triggerOnKeyPress:si(pl),triggerOnKeyUp:fl,triggerOnMouseDown:si(oo),execCommand:function(l){if(Ea.hasOwnProperty(l))return Ea[l].call(null,this)},triggerElectric:si(function(l){Oe(this,l)}),findPosH:function(l,v,K,te){var ie=1;v<0&&(ie=-1,v=-v);for(var oe=jt(this.doc,l),_e=0;_e<v&&!(oe=ze(this.doc,oe,ie,K,te),oe.hitSide);++_e);return oe},moveH:si(function(l,v){var K=this;this.extendSelectionsBy(function(te){return K.display.shift||K.doc.extend||te.empty()?ze(K.doc,te.head,l,v,K.options.rtlMoveVisually):l<0?te.from():te.to()},Te)}),deleteH:si(function(l,v){var K=this.doc.sel,te=this.doc;K.somethingSelected()?te.replaceSelection("",null,"+delete"):ba(this,function(ie){var oe=ze(te,ie.head,l,v,!1);return l<0?{from:oe,to:ie.head}:{from:ie.head,to:oe}})}),findPosV:function(l,v,K,te){var ie=1,oe=te;v<0&&(ie=-1,v=-v);for(var _e=jt(this.doc,l),je=0;je<v;++je){var Ve=xi(this,_e,"div");if(oe==null?oe=Ve.left:Ve.left=oe,_e=Ge(this,Ve,ie,K),_e.hitSide)break}return _e},moveV:si(function(l,v){var K=this,te=this.doc,ie=[],oe=!this.display.shift&&!te.extend&&te.sel.somethingSelected();if(te.extendSelectionsBy(function(je){if(oe)return l<0?je.from():je.to();var Ve=xi(K,je.head,"div");je.goalColumn!=null&&(Ve.left=je.goalColumn),ie.push(Ve.left);var dt=Ge(K,Ve,l,v);return v=="page"&&je==te.sel.primary()&&es(K,Ts(K,dt,"div").top-Ve.top),dt},Te),ie.length)for(var _e=0;_e<te.sel.ranges.length;_e++)te.sel.ranges[_e].goalColumn=ie[_e]}),findWordAt:function(l){var v=this.doc,K=at(v,l.line).text,te=l.ch,ie=l.ch;if(K){var oe=this.getHelper(l,"wordChars");(l.sticky=="before"||ie==K.length)&&te?--te:++ie;for(var _e=K.charAt(te),je=nt(_e,oe)?function(Ve){return nt(Ve,oe)}:/\s/.test(_e)?function(Ve){return/\s/.test(Ve)}:function(Ve){return!/\s/.test(Ve)&&!nt(Ve)};te>0&&je(K.charAt(te-1));)--te;for(;ie<K.length&&je(K.charAt(ie));)++ie}return new Nr(ke(l.line,te),ke(l.line,ie))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),ye(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:si(function(l,v){ia(this,l,v)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-qr(this)-this.display.barHeight,width:l.scrollWidth-qr(this)-this.display.barWidth,clientHeight:yi(this),clientWidth:ei(this)}},scrollIntoView:si(function(l,v){l==null?(l={from:this.doc.sel.primary().head,to:null},v==null&&(v=this.options.cursorScrollMargin)):typeof l=="number"?l={from:ke(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=v||0,l.from.line!=null?wo(this,l):Co(this,l.from,l.to,l.margin)}),setSize:si(function(l,v){var K=this,te=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};l!=null&&(this.display.wrapper.style.width=te(l)),v!=null&&(this.display.wrapper.style.height=te(v)),this.options.lineWrapping&&xs(this);var ie=this.display.viewFrom;this.doc.iter(ie,this.display.viewTo,function(oe){if(oe.widgets){for(var _e=0;_e<oe.widgets.length;_e++)if(oe.widgets[_e].noHScroll){Mi(K,ie,"widget");break}}++ie}),this.curOp.forceUpdate=!0,ye(this,"refresh",this)}),operation:function(l){return ci(this,l)},startOperation:function(){return Vi(this)},endOperation:function(){return Xi(this)},refresh:si(function(){var l=this.display.cachedTextHeight;li(this),this.curOp.forceUpdate=!0,Ca(this),ia(this,this.doc.scrollLeft,this.doc.scrollTop),Aa(this.display),(l==null||Math.abs(l-qi(this.display))>.5||this.options.lineWrapping)&&Ps(this),ye(this,"refresh",this)}),swapDoc:si(function(l){var v=this.doc;return v.cm=null,this.state.selectingText&&this.state.selectingText(),Gs(this,l),Ca(this),this.display.input.reset(),ia(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Ft(this,"swapDoc",this,v),v}),phrase:function(l){var v=this.options.phrases;return v&&Object.prototype.hasOwnProperty.call(v,l)?v[l]:l},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}},Ce(e),e.registerHelper=function(l,v,K){d.hasOwnProperty(l)||(d[l]=e[l]={_global:[]}),d[l][v]=K},e.registerGlobalHelper=function(l,v,K,te){e.registerHelper(l,v,te),d[l]._global.push({pred:K,val:te})}}function ze(e,n,d,l,v){var K=n,te=d,ie=at(e,n.line),oe=v&&e.direction=="rtl"?-d:d;function _e(){var Yn=n.line+oe;return Yn<e.first||Yn>=e.first+e.size?!1:(n=new ke(Yn,n.ch,n.sticky),ie=at(e,Yn))}function je(Yn){var Sn;if(l=="codepoint"){var lr=ie.text.charCodeAt(n.ch+(l>0?0:-1));isNaN(lr)?Sn=null:Sn=new ke(n.line,Math.max(0,Math.min(ie.text.length,n.ch+d*(lr>=55296&&lr<56320?2:1))),-d)}else v?Sn=no(e.cm,ie,n,d):Sn=eo(ie,n,d);if(Sn==null)if(!Yn&&_e())n=to(v,e.cm,ie,n.line,oe);else return!1;else n=Sn;return!0}if(l=="char"||l=="codepoint")je();else if(l=="column")je(!0);else if(l=="word"||l=="group")for(var Ve=null,dt=l=="group",st=e.cm&&e.cm.getHelper(n,"wordChars"),Rt=!0;!(d<0&&!je(!Rt));Rt=!1){var Ht=ie.text.charAt(n.ch)||`
`,en=nt(Ht,st)?"w":dt&&Ht==`
`?"n":!dt||/\s/.test(Ht)?null:"p";if(dt&&!Rt&&!en&&(en="s"),Ve&&Ve!=en){d<0&&(d=1,je(),n.sticky="after");break}if(en&&(Ve=en),d>0&&!je(!Rt))break}var Tn=ds(e,n,K,te,!0);return Re(K,Tn)&&(Tn.hitSide=!0),Tn}function Ge(e,n,d,l){var v=e.doc,K=n.left,te;if(l=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ie-.5*qi(e.display),3);te=(d>0?n.bottom:n.top)+d*oe}else l=="line"&&(te=d>0?n.bottom+3:n.top-3);for(var _e;!(_e=Rs(e,K,te),!_e.outside);){if(d<0?te<=0:te>=v.height){_e.hitSide=!0;break}te+=d*5}return _e}var Je=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new J,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Je.prototype.init=function(e){var n=this,d=this,l=d.cm,v=d.div=e.lineDiv;Ke(v,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function K(ie){for(var oe=ie.target;oe;oe=oe.parentNode){if(oe==v)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}Qe(v,"paste",function(ie){if(!K(ie)||ae(l,ie)||he(ie,l))return;X<=11&&setTimeout(Gr(l,function(){return n.updateFromDOM()}),20)}),Qe(v,"compositionstart",function(ie){n.composing={data:ie.data,done:!1}}),Qe(v,"compositionupdate",function(ie){n.composing||(n.composing={data:ie.data,done:!1})}),Qe(v,"compositionend",function(ie){n.composing&&(ie.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Qe(v,"touchstart",function(){return d.forceCompositionEnd()}),Qe(v,"input",function(){n.composing||n.readFromDOMSoon()});function te(ie){if(!K(ie)||ae(l,ie))return;if(l.somethingSelected())re({lineWise:!1,text:l.getSelections()}),ie.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var oe=Ae(l);re({lineWise:!0,text:oe.text}),ie.type=="cut"&&l.operation(function(){l.setSelections(oe.ranges,0,Se),l.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var _e=V.text.join(`
`);if(ie.clipboardData.setData("Text",_e),ie.clipboardData.getData("Text")==_e){ie.preventDefault();return}}var je=tt(),Ve=je.firstChild;l.display.lineSpace.insertBefore(je,l.display.lineSpace.firstChild),Ve.value=V.text.join(`
`);var dt=document.activeElement;B(Ve),setTimeout(function(){l.display.lineSpace.removeChild(je),dt.focus(),dt==v&&d.showPrimarySelection()},50)}Qe(v,"copy",te),Qe(v,"cut",te)},Je.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Je.prototype.prepareSelection=function(){var e=Is(this.cm,!1);return e.focus=document.activeElement==this.div,e},Je.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Je.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Je.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,d=n.doc.sel.primary(),l=d.from(),v=d.to();if(n.display.viewTo==n.display.viewFrom||l.line>=n.display.viewTo||v.line<n.display.viewFrom){e.removeAllRanges();return}var K=rr(n,e.anchorNode,e.anchorOffset),te=rr(n,e.focusNode,e.focusOffset);if(K&&!K.bad&&te&&!te.bad&&ut(pr(K,te),l)==0&&ut(cr(K,te),v)==0)return;var ie=n.display.view,oe=l.line>=n.display.viewFrom&&_t(n,l)||{node:ie[0].measure.map[2],offset:0},_e=v.line<n.display.viewTo&&_t(n,v);if(!_e){var je=ie[ie.length-1].measure,Ve=je.maps?je.maps[je.maps.length-1]:je.map;_e={node:Ve[Ve.length-1],offset:Ve[Ve.length-2]-Ve[Ve.length-3]}}if(!oe||!_e){e.removeAllRanges();return}var dt=e.rangeCount&&e.getRangeAt(0),st;try{st=w(oe.node,oe.offset,_e.offset,_e.node)}catch(Rt){}st&&(!U&&n.state.focused?(e.collapse(oe.node,oe.offset),st.collapsed||(e.removeAllRanges(),e.addRange(st))):(e.removeAllRanges(),e.addRange(st)),dt&&e.anchorNode==null?e.addRange(dt):U&&this.startGracePeriod()),this.rememberSelection()},Je.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)},Je.prototype.showMultipleSelections=function(e){g(this.cm.display.cursorDiv,e.cursors),g(this.cm.display.selectionDiv,e.selection)},Je.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Je.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return b(this.div,n)},Je.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Je.prototype.blur=function(){this.div.blur()},Je.prototype.getField=function(){return this.div},Je.prototype.supportsTouch=function(){return!0},Je.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ci(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function n(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Je.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Je.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),n=this.cm;if(i&&m&&this.cm.display.gutterSpecs.length&&gn(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var d=rr(n,e.anchorNode,e.anchorOffset),l=rr(n,e.focusNode,e.focusOffset);d&&l&&ci(n,function(){ni(n.doc,Fi(d,l),Se),(d.bad||l.bad)&&(n.curOp.selectionChanged=!0)})},Je.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,d=e.doc.sel.primary(),l=d.from(),v=d.to();if(l.ch==0&&l.line>e.firstLine()&&(l=ke(l.line-1,at(e.doc,l.line-1).length)),v.ch==at(e.doc,v.line).text.length&&v.line<e.lastLine()&&(v=ke(v.line+1,0)),l.line<n.viewFrom||v.line>n.viewTo-1)return!1;var K,te,ie;l.line==n.viewFrom||(K=zi(e,l.line))==0?(te=xe(n.view[0].line),ie=n.view[0].node):(te=xe(n.view[K].line),ie=n.view[K-1].node.nextSibling);var oe=zi(e,v.line),_e,je;if(oe==n.view.length-1?(_e=n.viewTo-1,je=n.lineDiv.lastChild):(_e=xe(n.view[oe+1].line)-1,je=n.view[oe+1].node.previousSibling),!ie)return!1;for(var Ve=e.doc.splitLines($n(e,ie,je,te,_e)),dt=Fe(e.doc,ke(te,0),ke(_e,at(e.doc,_e).text.length));Ve.length>1&&dt.length>1;)if(_(Ve)==_(dt))Ve.pop(),dt.pop(),_e--;else if(Ve[0]==dt[0])Ve.shift(),dt.shift(),te++;else break;for(var st=0,Rt=0,Ht=Ve[0],en=dt[0],Tn=Math.min(Ht.length,en.length);st<Tn&&Ht.charCodeAt(st)==en.charCodeAt(st);)++st;for(var Yn=_(Ve),Sn=_(dt),lr=Math.min(Yn.length-(Ve.length==1?st:0),Sn.length-(dt.length==1?st:0));Rt<lr&&Yn.charCodeAt(Yn.length-Rt-1)==Sn.charCodeAt(Sn.length-Rt-1);)++Rt;if(Ve.length==1&&dt.length==1&&te==l.line)for(;st&&st>l.ch&&Yn.charCodeAt(Yn.length-Rt-1)==Sn.charCodeAt(Sn.length-Rt-1);)st--,Rt++;Ve[Ve.length-1]=Yn.slice(0,Yn.length-Rt).replace(/^\u200b+/,""),Ve[0]=Ve[0].slice(st).replace(/\u200b+$/,"");var Rr=ke(te,st),Cr=ke(_e,dt.length?_(dt).length-Rt:0);if(Ve.length>1||Ve[0]||ut(Rr,Cr))return ga(e.doc,Ve,Rr,Cr,"+input"),!0},Je.prototype.ensurePolled=function(){this.forceCompositionEnd()},Je.prototype.reset=function(){this.forceCompositionEnd()},Je.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Je.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)},Je.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ci(this.cm,function(){return li(e.cm)})},Je.prototype.setUneditable=function(e){e.contentEditable="false"},Je.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gr(this.cm,ce)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Je.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Je.prototype.onContextMenu=function(){},Je.prototype.resetPosition=function(){},Je.prototype.needsContentAttribute=!0;function _t(e,n){var d=Ki(e,n.line);if(!d||d.hidden)return null;var l=at(e.doc,n.line),v=Va(d,l,n.line),K=Yt(l,e.doc.direction),te="left";if(K){var ie=Wt(K,n.ch);te=ie%2?"right":"left"}var oe=ys(v.map,n.ch,te);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function gn(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function xn(e,n){return n&&(e.bad=!0),e}function $n(e,n,d,l,v){var K="",te=!1,ie=e.doc.lineSeparator(),oe=!1;function _e(st){return function(Rt){return Rt.id==st}}function je(){te&&(K+=ie,oe&&(K+=ie),te=oe=!1)}function Ve(st){st&&(je(),K+=st)}function dt(st){if(st.nodeType==1){var Rt=st.getAttribute("cm-text");if(Rt){Ve(Rt);return}var Ht=st.getAttribute("cm-marker"),en;if(Ht){var Tn=e.findMarks(ke(l,0),ke(v+1,0),_e(+Ht));Tn.length&&(en=Tn[0].find(0))&&Ve(Fe(e.doc,en.from,en.to).join(ie));return}if(st.getAttribute("contenteditable")=="false")return;var Yn=/^(pre|div|p|li|table|br)$/i.test(st.nodeName);if(!/^br$/i.test(st.nodeName)&&st.textContent.length==0)return;Yn&&je();for(var Sn=0;Sn<st.childNodes.length;Sn++)dt(st.childNodes[Sn]);/^(pre|p)$/i.test(st.nodeName)&&(oe=!0),Yn&&(te=!0)}else st.nodeType==3&&Ve(st.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(dt(n),n==d);)n=n.nextSibling,oe=!1;return K}function rr(e,n,d){var l;if(n==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[d],!l)return xn(e.clipPos(ke(e.display.viewTo-1)),!0);n=null,d=0}else for(l=n;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var v=0;v<e.display.view.length;v++){var K=e.display.view[v];if(K.node==l)return Tr(K,n,d)}}function Tr(e,n,d){var l=e.text.firstChild,v=!1;if(!n||!b(l,n))return xn(ke(xe(e.line),0),!0);if(n==l&&(v=!0,n=l.childNodes[d],d=0,!n)){var K=e.rest?_(e.rest):e.line;return xn(ke(xe(K),K.text.length),v)}var te=n.nodeType==3?n:null,ie=n;for(!te&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(te=n.firstChild,d&&(d=te.nodeValue.length));ie.parentNode!=l;)ie=ie.parentNode;var oe=e.measure,_e=oe.maps;function je(en,Tn,Yn){for(var Sn=-1;Sn<(_e?_e.length:0);Sn++)for(var lr=Sn<0?oe.map:_e[Sn],Rr=0;Rr<lr.length;Rr+=3){var Cr=lr[Rr+2];if(Cr==en||Cr==Tn){var Dr=xe(Sn<0?e.line:e.rest[Sn]),Wr=lr[Rr]+Yn;return(Yn<0||Cr!=en)&&(Wr=lr[Rr+(Yn?1:0)]),ke(Dr,Wr)}}}var Ve=je(te,ie,d);if(Ve)return xn(Ve,v);for(var dt=ie.nextSibling,st=te?te.nodeValue.length-d:0;dt;dt=dt.nextSibling){if(Ve=je(dt,dt.firstChild,0),Ve)return xn(ke(Ve.line,Ve.ch-st),v);st+=dt.textContent.length}for(var Rt=ie.previousSibling,Ht=d;Rt;Rt=Rt.previousSibling){if(Ve=je(Rt,Rt.firstChild,-1),Ve)return xn(ke(Ve.line,Ve.ch+Ht),v);Ht+=Rt.textContent.length}}var nr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new J,this.hasSelection=!1,this.composing=null};nr.prototype.init=function(e){var n=this,d=this,l=this.cm;this.createField(e);var v=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),s&&(v.style.width="0px"),Qe(v,"input",function(){Y&&X>=9&&n.hasSelection&&(n.hasSelection=null),d.poll()}),Qe(v,"paste",function(te){if(ae(l,te)||he(te,l))return;l.state.pasteIncoming=+new Date,d.fastPoll()});function K(te){if(ae(l,te))return;if(l.somethingSelected())re({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var ie=Ae(l);re({lineWise:!0,text:ie.text}),te.type=="cut"?l.setSelections(ie.ranges,null,Se):(d.prevInput="",v.value=ie.text.join(`
`),B(v))}else return;te.type=="cut"&&(l.state.cutIncoming=+new Date)}Qe(v,"cut",K),Qe(v,"copy",K),Qe(e.scroller,"paste",function(te){if(kr(e,te)||ae(l,te))return;if(!v.dispatchEvent){l.state.pasteIncoming=+new Date,d.focus();return}var ie=new Event("paste");ie.clipboardData=te.clipboardData,v.dispatchEvent(ie)}),Qe(e.lineSpace,"selectstart",function(te){kr(e,te)||de(te)}),Qe(v,"compositionstart",function(){var te=l.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:te,range:l.markText(te,l.getCursor("to"),{className:"CodeMirror-composing"})}}),Qe(v,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})},nr.prototype.createField=function(e){this.wrapper=tt(),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,n=e.display,d=e.doc,l=Is(e);if(e.options.moveInputWithCursor){var v=xi(e,d.sel.primary().head,"div"),K=n.wrapper.getBoundingClientRect(),te=n.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,v.top+te.top-K.top)),l.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,v.left+te.left-K.left))}return l},nr.prototype.showSelection=function(e){var n=this.cm,d=n.display;g(d.cursorDiv,e.cursors),g(d.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 n=this.cm;if(n.somethingSelected()){this.prevInput="";var d=n.getSelection();this.textarea.value=d,n.state.focused&&B(this.textarea),Y&&X>=9&&(this.hasSelection=d)}else e||(this.prevInput=this.textarea.value="",Y&&X>=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"&&(!t||W()!=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,n=this;n.pollingFast=!0;function d(){var l=n.poll();!l&&!e?(e=!0,n.polling.set(60,d)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,d)},nr.prototype.poll=function(){var e=this,n=this.cm,d=this.textarea,l=this.prevInput;if(this.contextMenuPending||!n.state.focused||cn(d)&&!l&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var v=d.value;if(v==l&&!n.somethingSelected())return!1;if(Y&&X>=9&&this.hasSelection===v||u&&/[\uf700-\uf7ff]/.test(v))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var K=v.charCodeAt(0);if(K==8203&&!l&&(l="\u200B"),K==8666)return this.reset(),this.cm.execCommand("undo")}for(var te=0,ie=Math.min(l.length,v.length);te<ie&&l.charCodeAt(te)==v.charCodeAt(te);)++te;return ci(n,function(){ce(n,v.slice(te),l.length-te,null,e.composing?"*compose":null),v.length>1e3||v.indexOf(`
`)>-1?d.value=e.prevInput="":e.prevInput=v,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},nr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},nr.prototype.onKeyPress=function(){Y&&X>=9&&(this.hasSelection=null),this.fastPoll()},nr.prototype.onContextMenu=function(e){var n=this,d=n.cm,l=d.display,v=n.textarea;n.contextMenuPending&&n.contextMenuPending();var K=Gi(d,e),te=l.scroller.scrollTop;if(!K||f)return;var ie=d.options.resetSelectionOnContextMenu;ie&&d.doc.sel.contains(K)==-1&&Gr(d,ni)(d.doc,Fi(K),Se);var oe=v.style.cssText,_e=n.wrapper.style.cssText,je=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",v.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-je.top-5)+"px; left: "+(e.clientX-je.left-5)+`px;
z-index: 1000; background: `+(Y?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ve;r&&(Ve=window.scrollY),l.input.focus(),r&&window.scrollTo(null,Ve),l.input.reset(),d.somethingSelected()||(v.value=n.prevInput=" "),n.contextMenuPending=st,l.selForContextMenu=d.doc.sel,clearTimeout(l.detectingSelectAll);function dt(){if(v.selectionStart!=null){var Ht=d.somethingSelected(),en="\u200B"+(Ht?v.value:"");v.value="\u21DA",v.value=en,n.prevInput=Ht?"":"\u200B",v.selectionStart=1,v.selectionEnd=en.length,l.selForContextMenu=d.doc.sel}}function st(){if(n.contextMenuPending!=st)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=_e,v.style.cssText=oe,Y&&X<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=te),v.selectionStart!=null){(!Y||Y&&X<9)&&dt();var Ht=0,en=function(){l.selForContextMenu==d.doc.sel&&v.selectionStart==0&&v.selectionEnd>0&&n.prevInput=="\u200B"?Gr(d,Qo)(d):Ht++<10?l.detectingSelectAll=setTimeout(en,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(en,200)}}if(Y&&X>=9&&dt(),D){ue(e);var Rt=function(){xt(window,"mouseup",Rt),setTimeout(st,20)};Qe(window,"mouseup",Rt)}else setTimeout(st,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 Mr(e,n){if(n=n?y(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var d=W();n.autofocus=d==e||e.getAttribute("autofocus")!=null&&d==document.body}function l(){e.value=ie.getValue()}var v;if(e.form&&(Qe(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var K=e.form;v=K.submit;try{var te=K.submit=function(){l(),K.submit=v,K.submit(),K.submit=te}}catch(oe){}}n.finishInit=function(oe){oe.save=l,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,l(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(xt(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=v))}},e.style.display="none";var ie=Hr(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},n);return ie}function Pr(e){e.off=xt,e.on=Qe,e.wheelEventPixels=rs,e.Doc=ui,e.splitLines=Jt,e.countColumn=H,e.findColumn=Ie,e.isWordChar=Be,e.Pass=ve,e.signal=ye,e.Line=sn,e.changeEnd=Yi,e.scrollbarModel=Ro,e.Pos=ke,e.cmpPos=ut,e.modes=mr,e.mimeModes=Qn,e.resolveMode=Nn,e.getMode=Ar,e.modeExtensions=An,e.extendMode=Dn,e.copyState=qn,e.startState=Lr,e.innerMode=fr,e.commands=Ea,e.keyMap=Li,e.keyName=fs,e.isModifierKey=Fa,e.lookupKey=Ii,e.normalizeKeyMap=ll,e.StringStream=Or,e.SharedTextMarker=ya,e.TextMarker=bi,e.LineWidget=Ma,e.e_preventDefault=de,e.e_stopPropagation=pe,e.e_stop=ue,e.addClass=j,e.contains=b,e.rmClass=E,e.keyNames=Wi}Zl(Hr),it(Hr);var Br="iter insert remove copy getEditor constructor".split(" ");for(var $r in ui.prototype)ui.prototype.hasOwnProperty($r)&&se(Br,$r)<0&&(Hr.prototype[$r]=function(e){return function(){return e.apply(this.doc,arguments)}}(ui.prototype[$r]));return Ce(ui),Hr.inputStyles={textarea:nr,contenteditable:Je},Hr.defineMode=function(e){!Hr.defaults.mode&&e!="null"&&(Hr.defaults.mode=e),yr.apply(this,arguments)},Hr.defineMIME=Sr,Hr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Hr.defineMIME("text/plain","null"),Hr.defineExtension=function(e,n){Hr.prototype[e]=n},Hr.defineDocExtension=function(e,n){ui.prototype[e]=n},Hr.fromTextArea=Mr,Pr(Hr),Hr.version="5.58.2",Hr})},WaYH:function(Et,Pe,F){"use strict";var ne=F("rePB"),Q=F("Ff2n"),U=F("VTBJ"),Z=F("1OyB"),G=F("vuIU"),M=F("JX7q"),Y=F("Ji7U"),X=F("LK+K"),r=F("q1tI"),A=F("TSYQ"),m=F.n(A),f=F("sboe"),p=F("OZM5"),a=function(D){var I=D.prefixCls,E=D.level,x=D.isStart,g=D.isEnd;if(!E)return null;for(var h="".concat(I,"-indent-unit"),O=[],w=0;w<E;w+=1){var b;O.push(r.createElement("span",{key:w,className:m()(h,(b={},Object(ne.a)(b,"".concat(h,"-start"),x[w+1]),Object(ne.a)(b,"".concat(h,"-end"),g[w+1]),Object(ne.a)(b,"".concat(h,"-end-first-level"),!w&&g[0]),b))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(I,"-indent")},O)},c=a,s=F("815F"),i="open",t="close",u="---",o=function(S){Object(Y.a)(I,S);var D=Object(X.a)(I);function I(){var E;return Object(Z.a)(this,I),E=D.apply(this,arguments),E.state={dragNodeHighlight:!1},E.onSelectorClick=function(x){var g=E.props.context.onNodeClick;g(x,Object(s.b)(E.props)),E.isSelectable()?E.onSelect(x):E.onCheck(x)},E.onSelectorDoubleClick=function(x){var g=E.props.context.onNodeDoubleClick;g(x,Object(s.b)(E.props))},E.onSelect=function(x){if(E.isDisabled())return;var g=E.props.context.onNodeSelect;x.preventDefault(),g(x,Object(s.b)(E.props))},E.onCheck=function(x){if(E.isDisabled())return;var g=E.props,h=g.disableCheckbox,O=g.checked,w=E.props.context.onNodeCheck;if(!E.isCheckable()||h)return;x.preventDefault();var b=!O;w(x,Object(s.b)(E.props),b)},E.onMouseEnter=function(x){var g=E.props.context.onNodeMouseEnter;g(x,Object(s.b)(E.props))},E.onMouseLeave=function(x){var g=E.props.context.onNodeMouseLeave;g(x,Object(s.b)(E.props))},E.onContextMenu=function(x){var g=E.props.context.onNodeContextMenu;g(x,Object(s.b)(E.props))},E.onDragStart=function(x){var g=E.props.context.onNodeDragStart;x.stopPropagation(),E.setState({dragNodeHighlight:!0}),g(x,Object(M.a)(E));try{x.dataTransfer.setData("text/plain","")}catch(h){}},E.onDragEnter=function(x){var g=E.props.context.onNodeDragEnter;x.preventDefault(),x.stopPropagation(),g(x,Object(M.a)(E))},E.onDragOver=function(x){var g=E.props.context.onNodeDragOver;x.preventDefault(),x.stopPropagation(),g(x,Object(M.a)(E))},E.onDragLeave=function(x){var g=E.props.context.onNodeDragLeave;x.stopPropagation(),g(x,Object(M.a)(E))},E.onDragEnd=function(x){var g=E.props.context.onNodeDragEnd;x.stopPropagation(),E.setState({dragNodeHighlight:!1}),g(x,Object(M.a)(E))},E.onDrop=function(x){var g=E.props.context.onNodeDrop;x.preventDefault(),x.stopPropagation(),E.setState({dragNodeHighlight:!1}),g(x,Object(M.a)(E))},E.onExpand=function(x){var g=E.props.context.onNodeExpand;g(x,Object(s.b)(E.props))},E.setSelectHandle=function(x){E.selectHandle=x},E.getNodeState=function(){var x=E.props.expanded;return E.isLeaf()?null:x?i:t},E.hasChildren=function(){var x=E.props.eventKey,g=E.props.context.keyEntities,h=g[x]||{},O=h.children;return!!(O||[]).length},E.isLeaf=function(){var x=E.props,g=x.isLeaf,h=x.loaded,O=E.props.context.loadData,w=E.hasChildren();return g===!1?!1:g||!O&&!w||O&&h&&!w},E.isDisabled=function(){var x=E.props.disabled,g=E.props.context.disabled;return!!(g||x)},E.isCheckable=function(){var x=E.props.checkable,g=E.props.context.checkable;return!g||x===!1?!1:g},E.syncLoadData=function(x){var g=x.expanded,h=x.loading,O=x.loaded,w=E.props.context,b=w.loadData,W=w.onNodeLoad;if(h)return;b&&g&&!E.isLeaf()&&(!E.hasChildren()&&!O&&W(Object(s.b)(E.props)))},E.renderSwitcher=function(){var x=E.props,g=x.expanded,h=x.switcherIcon,O=E.props.context,w=O.prefixCls,b=O.switcherIcon,W=h||b;if(E.isLeaf())return r.createElement("span",{className:m()("".concat(w,"-switcher"),"".concat(w,"-switcher-noop"))},typeof W=="function"?W(Object(U.a)(Object(U.a)({},E.props),{},{isLeaf:!0})):W);var j=m()("".concat(w,"-switcher"),"".concat(w,"-switcher_").concat(g?i:t));return r.createElement("span",{onClick:E.onExpand,className:j},typeof W=="function"?W(Object(U.a)(Object(U.a)({},E.props),{},{isLeaf:!1})):W)},E.renderCheckbox=function(){var x=E.props,g=x.checked,h=x.halfChecked,O=x.disableCheckbox,w=E.props.context.prefixCls,b=E.isDisabled(),W=E.isCheckable();if(!W)return null;var j=typeof W!="boolean"?W:null;return r.createElement("span",{className:m()("".concat(w,"-checkbox"),g&&"".concat(w,"-checkbox-checked"),!g&&h&&"".concat(w,"-checkbox-indeterminate"),(b||O)&&"".concat(w,"-checkbox-disabled")),onClick:E.onCheck},j)},E.renderIcon=function(){var x=E.props.loading,g=E.props.context.prefixCls;return r.createElement("span",{className:m()("".concat(g,"-iconEle"),"".concat(g,"-icon__").concat(E.getNodeState()||"docu"),x&&"".concat(g,"-icon_loading"))})},E.renderSelector=function(){var x=E.state.dragNodeHighlight,g=E.props,h=g.title,O=g.selected,w=g.icon,b=g.loading,W=g.data,j=E.props.context,C=j.prefixCls,B=j.showIcon,k=j.icon,y=j.draggable,H=j.loadData,J=j.titleRender,se=E.isDisabled(),fe="".concat(C,"-node-content-wrapper"),ve;if(B){var Se=w||k;ve=Se?r.createElement("span",{className:m()("".concat(C,"-iconEle"),"".concat(C,"-icon__customize"))},typeof Se=="function"?Se(E.props):Se):E.renderIcon()}else H&&b&&(ve=E.renderIcon());var Ue;typeof h=="function"?Ue=h(W):J?Ue=J(W):Ue=h;var Te=r.createElement("span",{className:"".concat(C,"-title")},Ue);return r.createElement("span",{ref:E.setSelectHandle,title:typeof h=="string"?h:"",className:m()("".concat(fe),"".concat(fe,"-").concat(E.getNodeState()||"normal"),!se&&(O||x)&&"".concat(C,"-node-selected"),!se&&y&&"draggable"),draggable:!se&&y||void 0,"aria-grabbed":!se&&y||void 0,onMouseEnter:E.onMouseEnter,onMouseLeave:E.onMouseLeave,onContextMenu:E.onContextMenu,onClick:E.onSelectorClick,onDoubleClick:E.onSelectorDoubleClick,onDragStart:y?E.onDragStart:void 0},ve,Te)},E}return Object(G.a)(I,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var x=this.props.selectable,g=this.props.context.selectable;return typeof x=="boolean"?x:g}},{key:"render",value:function(){var x,g=this.props,h=g.eventKey,O=g.className,w=g.style,b=g.dragOver,W=g.dragOverGapTop,j=g.dragOverGapBottom,C=g.isLeaf,B=g.isStart,k=g.isEnd,y=g.expanded,H=g.selected,J=g.checked,se=g.halfChecked,fe=g.loading,ve=g.domRef,Se=g.active,Ue=g.onMouseMove,Te=Object(Q.a)(g,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ie=this.props.context,be=Ie.prefixCls,q=Ie.filterTreeNode,_=Ie.draggable,L=Ie.keyEntities,z=this.isDisabled(),ee=Object(p.f)(Te),$=L[h]||{},Ee=$.level,Be=k[k.length-1];return r.createElement("div",Object.assign({ref:ve,className:m()(O,"".concat(be,"-treenode"),(x={},Object(ne.a)(x,"".concat(be,"-treenode-disabled"),z),Object(ne.a)(x,"".concat(be,"-treenode-switcher-").concat(y?"open":"close"),!C),Object(ne.a)(x,"".concat(be,"-treenode-checkbox-checked"),J),Object(ne.a)(x,"".concat(be,"-treenode-checkbox-indeterminate"),se),Object(ne.a)(x,"".concat(be,"-treenode-selected"),H),Object(ne.a)(x,"".concat(be,"-treenode-loading"),fe),Object(ne.a)(x,"".concat(be,"-treenode-active"),Se),Object(ne.a)(x,"".concat(be,"-treenode-leaf-last"),Be),Object(ne.a)(x,"drag-over",!z&&b),Object(ne.a)(x,"drag-over-gap-top",!z&&W),Object(ne.a)(x,"drag-over-gap-bottom",!z&&j),Object(ne.a)(x,"filter-node",q&&q(Object(s.b)(this.props))),x)),style:w,onDragEnter:_?this.onDragEnter:void 0,onDragOver:_?this.onDragOver:void 0,onDragLeave:_?this.onDragLeave:void 0,onDrop:_?this.onDrop:void 0,onDragEnd:_?this.onDragEnd:void 0,onMouseMove:Ue},ee),r.createElement(c,{prefixCls:be,level:Ee,isStart:B,isEnd:k}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),I}(r.Component),R=function(D){return r.createElement(f.a.Consumer,null,function(I){return r.createElement(o,Object.assign({},D,{context:I}))})};R.displayName="TreeNode",R.defaultProps={title:u},R.isTreeNode=1;var T=Pe.a=R},XIdC:function(Et,Pe,F){"use strict";var ne=F("rePB"),Q=F("ODXe"),U=F("Ff2n"),Z=F("q1tI"),G=F.n(Z),M=F("TSYQ"),Y=F.n(M),X=F("6cGi"),r=F("4IlW"),A=Z.forwardRef(function(m,f){var p,a=m.prefixCls,c=a===void 0?"rc-switch":a,s=m.className,i=m.checked,t=m.defaultChecked,u=m.disabled,o=m.loadingIcon,R=m.checkedChildren,T=m.unCheckedChildren,S=m.onClick,D=m.onChange,I=m.onKeyDown,E=Object(U.a)(m,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),x=Object(X.a)(!1,{value:i,defaultValue:t}),g=Object(Q.a)(x,2),h=g[0],O=g[1];function w(C,B){var k=h;return u||(k=C,O(k),D==null||D(k,B)),k}function b(C){C.which===r.a.LEFT?w(!1,C):C.which===r.a.RIGHT&&w(!0,C),I==null||I(C)}function W(C){var B=w(!h,C);S==null||S(B,C)}var j=Y()(c,s,(p={},Object(ne.a)(p,"".concat(c,"-checked"),h),Object(ne.a)(p,"".concat(c,"-disabled"),u),p));return Z.createElement("button",Object.assign({},E,{type:"button",role:"switch","aria-checked":h,disabled:u,className:j,ref:f,onKeyDown:b,onClick:W}),o,Z.createElement("span",{className:"".concat(c,"-inner")},h?R:T))});A.displayName="Switch",Pe.a=A},Y1PL:function(Et,Pe,F){"use strict";F.r(Pe),F.d(Pe,"ResizableTextArea",function(){return se});var ne=F("wx14"),Q=F("1OyB"),U=F("vuIU"),Z=F("Ji7U"),G=F("LK+K"),M=F("q1tI"),Y=F("VTBJ"),X=F("rePB"),r=F("Zm9Q"),A=F("Kwbf"),m=F("c+Xe"),f=F("m+aA"),p=F("bdgK"),a=new Map;function c(Se){Se.forEach(function(Ue){var Te,Ie=Ue.target;(Te=a.get(Ie))===null||Te===void 0||Te.forEach(function(be){return be(Ie)})})}var s=new p.default(c),i=null,t=null;function u(Se,Ue){a.has(Se)||(a.set(Se,new Set),s.observe(Se)),a.get(Se).add(Ue)}function o(Se,Ue){a.has(Se)&&(a.get(Se).delete(Ue),a.get(Se).size||(s.unobserve(Se),a.delete(Se)))}var R=function(Se){Object(Z.a)(Te,Se);var Ue=Object(G.a)(Te);function Te(){return Object(Q.a)(this,Te),Ue.apply(this,arguments)}return Object(U.a)(Te,[{key:"render",value:function(){return this.props.children}}]),Te}(M.Component),T=M.createContext(null);function S(Se){var Ue=Se.children,Te=Se.onBatchResize,Ie=M.useRef(0),be=M.useRef([]),q=M.useContext(T),_=M.useCallback(function(L,z,ee){Ie.current+=1;var $=Ie.current;be.current.push({size:L,element:z,data:ee}),Promise.resolve().then(function(){$===Ie.current&&(Te==null||Te(be.current),be.current=[])}),q==null||q(L,z,ee)},[Te,q]);return M.createElement(T.Provider,{value:_},Ue)}function D(Se){var Ue=Se.children,Te=Se.disabled,Ie=M.useRef(null),be=M.useRef(null),q=M.useContext(T),_=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),L=M.isValidElement(Ue)&&Object(m.c)(Ue),z=L?Ue.ref:null,ee=M.useMemo(function(){return Object(m.a)(z,Ie)},[z,Ie]),$=M.useRef(Se);$.current=Se;var Ee=M.useCallback(function(Be){var nt=$.current,we=nt.onResize,Ne=nt.data,Ye=Be.getBoundingClientRect(),Xe=Ye.width,ht=Ye.height,wt=Be.offsetWidth,Bt=Be.offsetHeight,Wt=Math.floor(Xe),an=Math.floor(ht);if(_.current.width!==Wt||_.current.height!==an||_.current.offsetWidth!==wt||_.current.offsetHeight!==Bt){var Yt={width:Wt,height:an,offsetWidth:wt,offsetHeight:Bt};_.current=Yt;var qe=wt===Math.round(Xe)?Xe:wt,Qe=Bt===Math.round(ht)?ht:Bt,bt=Object(Y.a)(Object(Y.a)({},Yt),{},{offsetWidth:qe,offsetHeight:Qe});q==null||q(bt,Be,Ne),we&&Promise.resolve().then(function(){we(bt,Be)})}},[]);return M.useEffect(function(){var Be=Object(f.a)(Ie.current)||Object(f.a)(be.current);return Be&&!Te&&u(Be,Ee),function(){return o(Be,Ee)}},[Ie.current,Te]),M.createElement(R,{ref:be},L?M.cloneElement(Ue,{ref:ee}):Ue)}var I="rc-observer-key";function E(Se){var Ue=Se.children,Te=Object(r.a)(Ue);return Te.map(function(Ie,be){var q=(Ie==null?void 0:Ie.key)||"".concat(I,"-").concat(be);return M.createElement(D,Object(ne.a)({},Se,{key:q}),Ie)})}E.Collection=S;var x=E,g=F("bT9E"),h=F("TSYQ"),O=F.n(h),w=`
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
`,b=["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"],W={},j;function C(Se){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if(Ue&&W[Te])return W[Te];var Ie=window.getComputedStyle(Se),be=Ie.getPropertyValue("box-sizing")||Ie.getPropertyValue("-moz-box-sizing")||Ie.getPropertyValue("-webkit-box-sizing"),q=parseFloat(Ie.getPropertyValue("padding-bottom"))+parseFloat(Ie.getPropertyValue("padding-top")),_=parseFloat(Ie.getPropertyValue("border-bottom-width"))+parseFloat(Ie.getPropertyValue("border-top-width")),L=b.map(function(ee){return"".concat(ee,":").concat(Ie.getPropertyValue(ee))}).join(";"),z={sizingStyle:L,paddingSize:q,borderSize:_,boxSizing:be};return Ue&&Te&&(W[Te]=z),z}function B(Se){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),Se.getAttribute("wrap")?j.setAttribute("wrap",Se.getAttribute("wrap")):j.removeAttribute("wrap");var be=C(Se,Ue),q=be.paddingSize,_=be.borderSize,L=be.boxSizing,z=be.sizingStyle;j.setAttribute("style","".concat(z,";").concat(w)),j.value=Se.value||Se.placeholder||"";var ee=Number.MIN_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER,Ee=j.scrollHeight,Be;if(L==="border-box"?Ee+=_:L==="content-box"&&(Ee-=q),Te!==null||Ie!==null){j.value=" ";var nt=j.scrollHeight-q;Te!==null&&(ee=nt*Te,L==="border-box"&&(ee=ee+q+_),Ee=Math.max(ee,Ee)),Ie!==null&&($=nt*Ie,L==="border-box"&&($=$+q+_),Be=Ee>$?"":"hidden",Ee=Math.min($,Ee))}return{height:Ee,minHeight:ee,maxHeight:$,overflowY:Be,resize:"none"}}var k=F("Gytx"),y=F.n(k),H;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})(H||(H={}));var J=function(Se){Object(Z.a)(Te,Se);var Ue=Object(G.a)(Te);function Te(Ie){var be;return Object(Q.a)(this,Te),be=Ue.call(this,Ie),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(q){be.textArea=q},be.handleResize=function(q){var _=be.state.resizeStatus,L=be.props,z=L.autoSize,ee=L.onResize;if(_!==H.NONE)return;typeof ee=="function"&&ee(q),z&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var q=be.props.autoSize;if(!q||!be.textArea)return;var _=q.minRows,L=q.maxRows,z=B(be.textArea,!1,_,L);be.setState({textareaStyles:z,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:H.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:H.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var q=be.props,_=q.prefixCls,L=_===void 0?"rc-textarea":_,z=q.autoSize,ee=q.onResize,$=q.className,Ee=q.disabled,Be=be.state,nt=Be.textareaStyles,we=Be.resizeStatus,Ne=Object(g.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ye=O()(L,$,Object(X.a)({},"".concat(L,"-disabled"),Ee));"value"in Ne&&(Ne.value=Ne.value||"");var Xe=Object(Y.a)(Object(Y.a)(Object(Y.a)({},be.props.style),nt),we===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(x,{onResize:be.handleResize,disabled:!(z||ee)},M.createElement("textarea",Object(ne.a)({},Ne,{className:Ye,style:Xe,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:H.NONE},be}return Object(U.a)(Te,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!y()(be.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 be=this.textArea.selectionStart,q=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,q)}}catch(_){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Te}(M.Component),se=J,fe=function(Se){Object(Z.a)(Te,Se);var Ue=Object(G.a)(Te);function Te(Ie){var be;Object(Q.a)(this,Te),be=Ue.call(this,Ie),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(_){be.resizableTextArea=_},be.handleChange=function(_){var L=be.props.onChange;be.setValue(_.target.value,function(){be.resizableTextArea.resizeTextarea()}),L&&L(_)},be.handleKeyDown=function(_){var L=be.props,z=L.onPressEnter,ee=L.onKeyDown;_.keyCode===13&&z&&z(_),ee&&ee(_)};var q=typeof Ie.value=="undefined"||Ie.value===null?Ie.defaultValue:Ie.value;return be.state={value:q},be}return Object(U.a)(Te,[{key:"setValue",value:function(be,q){"value"in this.props||this.setState({value:be},q)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(se,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Te}(M.Component),ve=Pe.default=fe},YIbm:function(Et,Pe,F){Et.exports={content:"content___24s9X"}},"YJx+":function(Et,Pe,F){Et.exports={flex_box_center:"flex_box_center___TKIS5",flex_space_between:"flex_space_between___3ITJg",flex_box_vertical_center:"flex_box_vertical_center___pGLbk",flex_box_center_end:"flex_box_center_end___3-z2A",flex_box_column:"flex_box_column___1SlIq",wrap:"wrap___2TxDh",modal:"modal___jkvmI",titleWrap:"titleWrap___386Y5",required:"required___3ddar",title:"title___2scfU",colorGray:"colorGray___10JDh",choiceWrap:"choiceWrap___3UMox",answer:"answer___1kvCr",activeAnswer:"activeAnswer___1tun2",deleteIcon:"deleteIcon___2_EJk",addIcon:"addIcon___b404_",editorWrap:"editorWrap___1qDS7",htmlWrap:"htmlWrap___2ear6",radio:"radio___3EFAB",color333:"color333___lt3ql",color999:"color999___11Mt_",questionType:"questionType___1yIj7",questionChoices:"questionChoices___1n3A7",action:"action___3PqBm",difficult:"difficult___1L4Zj",fold:"fold___3zBy6",head:"head___1dsW5"}},Z9P2:function(Et,Pe,F){"use strict";var ne=F("+BJd"),Q=F("mr32"),U=F("14J3"),Z=F("BMrR"),G=F("5NDa"),M=F("5rEg"),Y=F("oBTY"),X=F("5Dmo"),r=F("3S7+"),A=F("miYZ"),m=F("tsqr"),f=F("tJVT"),p=F("q1tI"),a=F.n(p),c=function(i){var t,u,o=i.value,R=o===void 0?[[],[]]:o,T=i.onChange,S=Object(p.useState)(""),D=Object(f.a)(S,2),I=D[0],E=D[1],x=Object(p.useState)(""),g=Object(f.a)(x,2),h=g[0],O=g[1],w=function(W){if(!W)return!1;var j=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return j.test(W)?(m.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u542B\u6709\u7279\u6B8A\u5B57\u7B26\uFF01"),!1):W==="|"?(m.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0};return a.a.createElement("div",null,a.a.createElement("p",{className:"font14"},"\u5173\u952E\u8BCD",a.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5173\u952E\u8BCD\u53EF\u7528\u4E8E\u81EA\u52A8\u5224\u5206\uFF09"),a.a.createElement(r.a,{overlayStyle:{maxWidth:350},title:a.a.createElement("div",null,a.a.createElement("div",null,"\u6BCF\u4E2A\u6838\u5FC3\u5173\u952E\u8BCD\u7684\u5206\u6570\u662F\u666E\u901A\u5173\u952E\u8BCD\u5206\u6570\u7684\u4E24\u500D"),a.a.createElement("div",null,"\u4F8B\u5982\uFF1A"),a.a.createElement("div",null,"\u672C\u989810\u5206\uFF0C\u666E\u901A\u5173\u952E\u8BCD1\u4E2A\uFF0C\u6838\u5FC3\u5173\u952E\u8BCD2\u4E2A\uFF0C\u5219\u6BCF\u4E2A"),a.a.createElement("div",null,"\u666E\u901A\u5173\u952E\u8BCD2\u5206\uFF0C\u6BCF\u4E2A\u6838\u5FC3\u5173\u952E\u8BCD4\u5206"))},a.a.createElement("span",{className:"iconfont icon-a-wenhaobeifen2 font14"}))),a.a.createElement(Z.a,{align:"middle",className:"font14"},"\u666E\u901A\u5173\u952E\u8BCD\uFF1A",a.a.createElement(M.a,{value:I,onChange:function(W){E(W.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(W){var j,C=(j=W.target)===null||j===void 0?void 0:j.value;if(w(C)){var B,k;(B=R[0])===null||B===void 0||B.push(C==null||((k=C.split("|"))===null||k===void 0)?void 0:k.filter(function(y){return!!y})),T(Object(Y.a)(R)),E("")}},style:{width:800},className:"ml5 mr10",placeholder:"\u652F\u6301\u4FDD\u5B58\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u7528\u201D|\u201D\u5206\u5272\u3002"}),a.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),a.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},R==null||((t=R[0])===null||t===void 0)?void 0:t.map(function(b,W){return a.a.createElement(Q.a,{className:"mb10",key:W,closable:!0,onClose:function(C){var B;C.preventDefault(),R[0]=(B=R[0])===null||B===void 0?void 0:B.filter(function(k,y){return y!==W}),T(Object(Y.a)(R))}},b==null?void 0:b.join(" \u6216 "))})),a.a.createElement(Z.a,{align:"middle",className:"font14"},"\u6838\u5FC3\u5173\u952E\u8BCD\uFF1A",a.a.createElement(M.a,{value:h,onChange:function(W){O(W.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(W){var j,C=(j=W.target)===null||j===void 0?void 0:j.value;if(w(C)){var B,k;(B=R[1])===null||B===void 0||B.push(C==null||((k=C.split("|"))===null||k===void 0)?void 0:k.filter(function(y){return!!y})),T(Object(Y.a)(R)),O("")}},style:{width:800},className:"ml5 mr10",placeholder:"\u652F\u6301\u4FDD\u5B58\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u7528\u201D|\u201D\u5206\u5272\u3002"}),a.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),a.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},R==null||((u=R[1])===null||u===void 0)?void 0:u.map(function(b,W){return a.a.createElement(Q.a,{className:"mb10",key:W,closable:!0,onClose:function(C){var B;C.preventDefault(),R[1]=(B=R[1])===null||B===void 0?void 0:B.filter(function(k,y){return y!==W}),T(Object(Y.a)(R))}},b==null?void 0:b.join(" \u6216 "))})))};Pe.a=c},ZW9T:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return k});var ne=F("k1fw"),Q=F("oBTY"),U=F("miYZ"),Z=F("tsqr"),G=F("rAM+"),M=F("tJVT"),Y=F("PpiC"),X=F("q1tI"),r=F.n(X),A=F("bdgK"),m=F("9og8"),f=F("WmNS"),p=F.n(f),a={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},c={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},s={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},i={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},t=F("5VLF"),u=F.n(t),o={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},R=function(H,J){return J.map(function(se){return{label:se,kind:H.languages.CompletionItemKind.Keyword,insertText:se}})},T=function(H){return Object.keys(o.tables).map(function(J){return{label:J,kind:H.languages.CompletionItemKind.Variable,insertText:J}})},S=function(H,J){var se=o.tables[H];return se?se.map(function(fe){return{label:fe,kind:J.languages.CompletionItemKind.Field,insertText:fe}}):[]};function D(y,H,J,se,fe){var ve=H.getWordUntilPosition(J),Se={startLineNumber:J.lineNumber,endLineNumber:J.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Ue=se.map(function(Te){return{label:Te,kind:y.languages.CompletionItemKind.Keyword,insertText:Te,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}});return fe.map(function(Te){Ue.push(Object(ne.a)(Object(ne.a)({},Te),{},{range:Se}))}),Ue}var I=function(y){o.languages.map(function(fe){return y.languages.registerDocumentFormattingEditProvider(fe,{provideDocumentFormattingEdits:function(Se,Ue,Te){return Object(m.a)(p.a.mark(function Ie(){var be;return p.a.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return be=u()(Se.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),_.abrupt("return",[{range:Se.getFullModelRange(),text:be}]);case 2:case"end":return _.stop()}},Ie)}))()}}),fe});var H=s.quickKey.map(function(fe){return{label:fe.label,kind:y.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),J=i.quickKey.map(function(fe){return{label:fe.label,kind:y.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),se=c.quickKey.map(function(fe){return{label:fe.label,kind:y.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}});y.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ve,Se){var Ue=ve.getWordUntilPosition(Se),Te={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:Ue.startColumn,endColumn:Ue.endColumn},Ie=ve.getLineContent(Se.lineNumber).substring(Ue.startColumn-2,Ue.endColumn);return{suggestions:[].concat(Object(Q.a)(s.keywords.map(function(be){return{label:be,kind:y.languages.CompletionItemKind.Function,documentation:be,insertText:be,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})),Object(Q.a)(s.quickKey.map(function(be){return{label:be.label,kind:y.languages.CompletionItemKind.Function,documentation:be.content,insertText:Ie.startsWith("#")?be.content.replace(/#/,""):be.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})))}}}),y.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(ve,Se){var Ue=ve.getWordUntilPosition(Se),Te={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:Ue.startColumn,endColumn:Ue.endColumn};return{suggestions:Object(Q.a)(a.keywords.map(function(Ie){return{label:Ie,kind:y.languages.CompletionItemKind.Function,documentation:Ie,insertText:Ie,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}}))}}}),y.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ve,Se){var Ue=ve.getWordUntilPosition(Se),Te={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:Ue.startColumn,endColumn:Ue.endColumn},Ie=ve.getLineContent(Se.lineNumber).substring(Ue.startColumn-2,Ue.endColumn);return{suggestions:[].concat(Object(Q.a)(c.keywords.map(function(be){return{label:be,kind:y.languages.CompletionItemKind.Function,documentation:be,insertText:be,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})),Object(Q.a)(c.quickKey.map(function(be){return{label:be.label,kind:y.languages.CompletionItemKind.Function,documentation:be.content,insertText:Ie.startsWith("#")?be.content.replace(/#/,""):be.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})))}}}),y.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ve,Se){var Ue=ve.getWordUntilPosition(Se),Te={startLineNumber:Se.lineNumber,endLineNumber:Se.lineNumber,startColumn:Ue.startColumn,endColumn:Ue.endColumn},Ie=ve.getLineContent(Se.lineNumber).substring(Ue.startColumn-2,Ue.endColumn);return{suggestions:[].concat(Object(Q.a)(i.keywords.map(function(be){return{label:be,kind:y.languages.CompletionItemKind.Function,documentation:be,insertText:be,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})),Object(Q.a)(i.quickKey.map(function(be){return{label:be.label,kind:y.languages.CompletionItemKind.Function,documentation:be.content,insertText:Ie.startsWith("#")?be.content.replace(/#/,""):be.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})))}}})},E="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",x=F("fjLI"),g=F("LvDl"),h=F("+ua5");function O(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function w(){}var b=!1,W={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function j(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=y;if(Array.isArray(y)){for(var J=0;J<y.length;J++){var se=W[y[J]];if(se)return se}return H[0]}return W[H]||H}var C=null,B=Pe.b=function(y){var H=y.width,J=H===void 0?"100%":H,se=y.height,fe=se===void 0?"100%":se,ve=y.value,Se=y.language,Ue=Se===void 0?"javascript":Se,Te=y.style,Ie=Te===void 0?{}:Te,be=y.options,q=be===void 0?{}:be,_=y.overrideServices,L=_===void 0?{}:_,z=y.theme,ee=z===void 0?"vs-dark":z,$=y.onEditBlur,Ee=y.onSave,Be=y.autoHeight,nt=Be===void 0?!1:Be,we=y.forbidCopy,Ne=we===void 0?!1:we,Ye=y.onChange,Xe=Ye===void 0?w:Ye,ht=y.editorDidMount,wt=ht===void 0?w:ht,Bt=y.onFocus,Wt=Bt===void 0?w:Bt,an=y.filename,Yt=an===void 0?"educoder.txt":an,qe=y.errorLine,Qe=y.errorContent,bt=Qe===void 0?"":Qe,xt=Object(Y.a)(y,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ye=Object(X.useRef)(),ae=Object(X.useRef)({}),le=Object(X.useRef)(),me=Object(X.useRef)(),Ce=Object(X.useRef)(!1),de=Object(X.useRef)(),pe=Object(X.useState)(!1),De=Object(M.a)(pe,2),ue=De[0],Me=De[1];function We(){var An;return ye.current&&(An=new A.default(function(Dn){var qn=Object(G.a)(Dn),fr;try{for(qn.s();!(fr=qn.n()).done;){var Lr=fr.value;(Lr.target.offsetHeight>0||Lr.target.offsetWidth>0)&&ae.current.instance.layout()}}catch(Or){qn.e(Or)}finally{qn.f()}}),An.observe(ye.current)),An}function lt(){Z.b.warn(decodeURIComponent(E))}var Ct=function(){var Dn=ae.current.instance;if(ve!=null&&Dn&&ue){var qn=Dn.getModel();qn&&ve!==qn.getValue()&&(b=!0,qn.setValue(ve),Dn.layout(),b=!1)}};Object(X.useEffect)(function(){me.current&&clearTimeout(me.current),me.current=setTimeout(function(){Ct()},500)},[ve,ue,ae.current]),Object(X.useEffect)(function(){if(qe&&ae.current&&ae.current.instance){var An=ae.current.instance;An.changeViewZones(function(qn){var fr=document.createElement("div");fr.style.padding="10px 20px",fr.style.width="calc(100% - 20px)",fr.className="my-error-line-wrp",fr.innerHTML=bt,qn.addZone({afterLineNumber:qe||11,heightInLines:3,domNode:fr})});var Dn={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}};An.addOverlayWidget(Dn),An.revealPositionInCenter({lineNumber:20,column:1})}},[qe,ae.current,ue]);function Ot(){var An=ae.current.instance;if(An){var Dn=An.getSelection(),qn=ae.current.pastePos||{},fr=new C.Range(qn.startLineNumber||Dn.endLineNumber,qn.startColumn||Dn.endColumn,qn.endLineNumber||Dn.endLineNumber,qn.endColumn||Dn.endColumn);setTimeout(function(){An.executeEdits("",[{range:fr,text:""}])},300)}}function Nt(An){(window.navigator.platform.match("Mac")?An.metaKey:An.ctrlKey)&&An.keyCode==83&&(An.preventDefault(),Ee())}var ir=function(){if(nt&&ae.current.instance){var Dn=ae.current.instance.getContentHeight();Nn(Dn<fe?fe:Dn)}else Nn(fe)};function Jt(An){var Dn=document.createEvent("MouseEvents");Dn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),An.dispatchEvent(Dn)}function cn(An,Dn){var qn=window.URL||window.webkitURL||window,fr=new Blob([Dn]),Lr=document.createElementNS("http://www.w3.org/1999/xhtml","a");Lr.href=qn.createObjectURL(fr),Lr.download=An,Jt(Lr)}Object(X.useEffect)(function(){ir()},[ir]),Object(X.useEffect)(function(){ye.current&&!ue&&Promise.all([F.e(17),F.e(29)]).then(F.t.bind(null,"M/lh",7)).then(function(An){try{C=An,ae.current.instance=C.editor.create(ye.current,{value:ve,language:j(Ue),theme:ee,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},L);var Dn=ae.current.instance,qn=x.d._menuItems,fr=Object(Q.a)(qn).find(function(pt){return pt[0]._debugName=="EditorContext"}),Lr=fr[1],Or=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],at=function(Le,xe){var ge=Le._first;do{var Hn,Lt,ke=xe.includes((Hn=ge.element)===null||Hn===void 0||((Lt=Hn.command)===null||Lt===void 0)?void 0:Lt.id);ke&&Le._remove(ge)}while(ge=ge.next)};if(wt(Dn,C),setTimeout(function(){ir(),ae.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){cn(Yt||"educoder.txt",Dn.getValue())}}),Dn.getDomNode().addEventListener("input",function(){le.current.autoFormat&&Dn.getAction("editor.action.formatDocument").run()})},500),ae.current.subscription=Dn.onDidChangeModelContent(function(pt){Ce.current?clearTimeout(de.current):(ir(),Xe(Dn.getValue(),pt)),de.current=setTimeout(function(){Ce.current=!1},500)}),window.Monaco||I(C,j(Ue)),Ne&&(at(Lr,Or),ye.current.classList.add("noCopyPaste"),Dn.onKeyDown(function(pt){var Le=pt.keyCode,xe=pt.ctrlKey,ge=pt.metaKey;(Le===33||Le===52)&&(ge||xe)&&(lt(),pt.preventDefault())})),window.Monaco=C,$&&Dn.onDidBlurEditorWidget(function(){$(Dn.getValue())}),Wt&&Dn.onDidFocusEditorText(function(){Wt(Dn.getValue())}),Ne){Dn.addCommand(C.KeyMod.CtrlCmd|C.KeyCode.KEY_V,function(){return lt(),null}),Dn.onDidPaste(function(pt){ae.current.pastePos=pt});try{window.addEventListener("paste",Ot)}catch(pt){}}var Fe=We();return Me(!0),function(){var pt=ae.current.instance;pt.dispose();var Le=pt.getModel();Le&&Le.dispose(),ae.current.subscription&&ae.current.subscription.dispose(),Ne&&window.removeEventListener("paste",Ot),Fe.unobserve(ye.current)}}catch(pt){}})},[]),Object(X.useEffect)(function(){var An=ae.current.instance;if(An&&ue)return document.addEventListener("keydown",Nt,!1),function(){document.removeEventListener("keydown",Nt)}},[Ee,ue]),Object(X.useEffect)(function(){var An=ae.current.instance;if(An&&ue){var Dn=j(Ue);C.editor.setModelLanguage(An.getModel(),Dn),console.log("language:",Ue,An.getModel(),Dn)}},[Ue,ue]),Object(X.useEffect)(function(){var An=ae.current.instance;An&&ue&&C.editor.setTheme(ee)},[ee,ue]),Object(X.useEffect)(function(){var An=ae.current.instance;le.current=q,An&&ue&&(An.updateOptions(Object(ne.a)({},q)),setTimeout(function(){An.getModel().updateOptions(Object(ne.a)({},q))},200))},[JSON.stringify(q),ue]),Object(X.useEffect)(function(){var An=ae.current.instance;An&&ue&&An.layout()},[J,fe,ue]);var rn=Object(X.useState)(O(J)),In=Object(M.a)(rn,2),ur=In[0],mr=In[1],Qn=Object(X.useState)(O(fe)),yr=Object(M.a)(Qn,2),Sr=yr[0],Nn=yr[1],Ar=Object(ne.a)(Object(ne.a)({},Ie),{},{width:ur,height:Sr});return r.a.createElement("div",{className:"my-monaco-editor",ref:ye,style:Ar})};function k(y){var H=y.width,J=H===void 0?"100%":H,se=y.height,fe=se===void 0?"100%":se,ve=y.original,Se=y.modified,Ue=y.language,Te=y.options,Ie=Te===void 0?{}:Te,be=Object(X.useRef)(),q=Object(X.useState)(null),_=Object(M.a)(q,2),L=_[0],z=_[1];function ee(nt){var we;return be.current&&(we=new A.default(function(Ne){var Ye=Object(G.a)(Ne),Xe;try{for(Ye.s();!(Xe=Ye.n()).done;){var ht=Xe.value;(ht.target.offsetHeight>0||ht.target.offsetWidth>0)&&nt.layout()}}catch(wt){Ye.e(wt)}finally{Ye.f()}}),we.observe(be.current)),we}Object(X.useEffect)(function(){be.current&&Promise.all([F.e(17),F.e(29)]).then(F.t.bind(null,"M/lh",7)).then(function(nt){C=nt;var we=C.editor.createDiffEditor(be.current,Object(ne.a)(Object(ne.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Ie),{},{wordWrap:!0}));z(we);var Ne=ee(we);return function(){we.dispose();var Ye=we.getModel();Ye&&Ye.dispose(),Ne.unobserve(be.current)}})},[]),Object(X.useEffect)(function(){L&&L.setModel({original:C.editor.createModel(ve,Ue),modified:C.editor.createModel(Se,Ue)})},[ve,Se,Ue,L]);var $=O(J),Ee=O(fe),Be={width:$,height:Ee};return r.a.createElement("div",{className:"my-diff-editor",ref:be,style:Be})}},ZWs3:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return m});var ne=F("+L6B"),Q=F("2/Rp"),U=F("0Owb"),Z=F("9og8"),G=F("tJVT"),M=F("PpiC"),Y=F("WmNS"),X=F.n(Y),r=F("q1tI"),A=F.n(r),m=function(p){var a=p.children,c=Object(M.a)(p,["children"]),s=Object(r.useState)(!1),i=Object(G.a)(s,2),t=i[0],u=i[1];return A.a.createElement(Q.a,Object(U.a)({},c,{loading:t,onClick:function(){var o=Object(Z.a)(X.a.mark(function R(T){return X.a.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.prev=0,u(!0),D.next=4,c.onClick(T);case 4:u(!1),D.next=10;break;case 7:D.prev=7,D.t0=D.catch(0),u(!1);case 10:case"end":return D.stop()}},R,null,[[0,7]])}));return function(R){return o.apply(this,arguments)}}()}),a)}},Zss7:function(Et,Pe,F){var ne;(function(Q){var U=/^\s+/,Z=/\s+$/,G=0,M=Q.round,Y=Q.min,X=Q.max,r=Q.random;function A(_,L){if(_=_||"",L=L||{},_ instanceof A)return _;if(!(this instanceof A))return new A(_,L);var z=m(_);this._originalInput=_,this._r=z.r,this._g=z.g,this._b=z.b,this._a=z.a,this._roundA=M(100*this._a)/100,this._format=L.format||z.format,this._gradientType=L.gradientType,this._r<1&&(this._r=M(this._r)),this._g<1&&(this._g=M(this._g)),this._b<1&&(this._b=M(this._b)),this._ok=z.ok,this._tc_id=G++}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 _=this.toRgb();return(_.r*299+_.g*587+_.b*114)/1e3},getLuminance:function(){var _=this.toRgb(),L,z,ee,$,Ee,Be;return L=_.r/255,z=_.g/255,ee=_.b/255,L<=.03928?$=L/12.92:$=Q.pow((L+.055)/1.055,2.4),z<=.03928?Ee=z/12.92:Ee=Q.pow((z+.055)/1.055,2.4),ee<=.03928?Be=ee/12.92:Be=Q.pow((ee+.055)/1.055,2.4),.2126*$+.7152*Ee+.0722*Be},setAlpha:function(_){return this._a=B(_),this._roundA=M(100*this._a)/100,this},toHsv:function(){var _=c(this._r,this._g,this._b);return{h:_.h*360,s:_.s,v:_.v,a:this._a}},toHsvString:function(){var _=c(this._r,this._g,this._b),L=M(_.h*360),z=M(_.s*100),ee=M(_.v*100);return this._a==1?"hsv("+L+", "+z+"%, "+ee+"%)":"hsva("+L+", "+z+"%, "+ee+"%, "+this._roundA+")"},toHsl:function(){var _=p(this._r,this._g,this._b);return{h:_.h*360,s:_.s,l:_.l,a:this._a}},toHslString:function(){var _=p(this._r,this._g,this._b),L=M(_.h*360),z=M(_.s*100),ee=M(_.l*100);return this._a==1?"hsl("+L+", "+z+"%, "+ee+"%)":"hsla("+L+", "+z+"%, "+ee+"%, "+this._roundA+")"},toHex:function(_){return i(this._r,this._g,this._b,_)},toHexString:function(_){return"#"+this.toHex(_)},toHex8:function(_){return t(this._r,this._g,this._b,this._a,_)},toHex8String:function(_){return"#"+this.toHex8(_)},toRgb:function(){return{r:M(this._r),g:M(this._g),b:M(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+M(this._r)+", "+M(this._g)+", "+M(this._b)+")":"rgba("+M(this._r)+", "+M(this._g)+", "+M(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:M(k(this._r,255)*100)+"%",g:M(k(this._g,255)*100)+"%",b:M(k(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+M(k(this._r,255)*100)+"%, "+M(k(this._g,255)*100)+"%, "+M(k(this._b,255)*100)+"%)":"rgba("+M(k(this._r,255)*100)+"%, "+M(k(this._g,255)*100)+"%, "+M(k(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:j[i(this._r,this._g,this._b,!0)]||!1},toFilter:function(_){var L="#"+u(this._r,this._g,this._b,this._a),z=L,ee=this._gradientType?"GradientType = 1, ":"";if(_){var $=A(_);z="#"+u($._r,$._g,$._b,$._a)}return"progid:DXImageTransform.Microsoft.gradient("+ee+"startColorstr="+L+",endColorstr="+z+")"},toString:function(_){var L=!!_;_=_||this._format;var z=!1,ee=this._a<1&&this._a>=0,$=!L&&ee&&(_==="hex"||_==="hex6"||_==="hex3"||_==="hex4"||_==="hex8"||_==="name");return $?_==="name"&&this._a===0?this.toName():this.toRgbString():(_==="rgb"&&(z=this.toRgbString()),_==="prgb"&&(z=this.toPercentageRgbString()),(_==="hex"||_==="hex6")&&(z=this.toHexString()),_==="hex3"&&(z=this.toHexString(!0)),_==="hex4"&&(z=this.toHex8String(!0)),_==="hex8"&&(z=this.toHex8String()),_==="name"&&(z=this.toName()),_==="hsl"&&(z=this.toHslString()),_==="hsv"&&(z=this.toHsvString()),z||this.toHexString())},clone:function(){return A(this.toString())},_applyModification:function(_,L){var z=_.apply(null,[this].concat([].slice.call(L)));return this._r=z._r,this._g=z._g,this._b=z._b,this.setAlpha(z._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(I,arguments)},desaturate:function(){return this._applyModification(o,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(T,arguments)},spin:function(){return this._applyModification(E,arguments)},_applyCombination:function(_,L){return _.apply(null,[this].concat([].slice.call(L)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(x,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(O,arguments)},triad:function(){return this._applyCombination(g,arguments)},tetrad:function(){return this._applyCombination(h,arguments)}},A.fromRatio=function(_,L){if(typeof _=="object"){var z={};for(var ee in _)_.hasOwnProperty(ee)&&(ee==="a"?z[ee]=_[ee]:z[ee]=ve(_[ee]));_=z}return A(_,L)};function m(_){var L={r:0,g:0,b:0},z=1,ee=null,$=null,Ee=null,Be=!1,nt=!1;return typeof _=="string"&&(_=be(_)),typeof _=="object"&&(Ie(_.r)&&Ie(_.g)&&Ie(_.b)?(L=f(_.r,_.g,_.b),Be=!0,nt=String(_.r).substr(-1)==="%"?"prgb":"rgb"):Ie(_.h)&&Ie(_.s)&&Ie(_.v)?(ee=ve(_.s),$=ve(_.v),L=s(_.h,ee,$),Be=!0,nt="hsv"):Ie(_.h)&&Ie(_.s)&&Ie(_.l)&&(ee=ve(_.s),Ee=ve(_.l),L=a(_.h,ee,Ee),Be=!0,nt="hsl"),_.hasOwnProperty("a")&&(z=_.a)),z=B(z),{ok:Be,format:_.format||nt,r:Y(255,X(L.r,0)),g:Y(255,X(L.g,0)),b:Y(255,X(L.b,0)),a:z}}function f(_,L,z){return{r:k(_,255)*255,g:k(L,255)*255,b:k(z,255)*255}}function p(_,L,z){_=k(_,255),L=k(L,255),z=k(z,255);var ee=X(_,L,z),$=Y(_,L,z),Ee,Be,nt=(ee+$)/2;if(ee==$)Ee=Be=0;else{var we=ee-$;Be=nt>.5?we/(2-ee-$):we/(ee+$);switch(ee){case _:Ee=(L-z)/we+(L<z?6:0);break;case L:Ee=(z-_)/we+2;break;case z:Ee=(_-L)/we+4;break}Ee/=6}return{h:Ee,s:Be,l:nt}}function a(_,L,z){var ee,$,Ee;_=k(_,360),L=k(L,100),z=k(z,100);function Be(Ne,Ye,Xe){return Xe<0&&(Xe+=1),Xe>1&&(Xe-=1),Xe<1/6?Ne+(Ye-Ne)*6*Xe:Xe<1/2?Ye:Xe<2/3?Ne+(Ye-Ne)*(2/3-Xe)*6:Ne}if(L===0)ee=$=Ee=z;else{var nt=z<.5?z*(1+L):z+L-z*L,we=2*z-nt;ee=Be(we,nt,_+1/3),$=Be(we,nt,_),Ee=Be(we,nt,_-1/3)}return{r:ee*255,g:$*255,b:Ee*255}}function c(_,L,z){_=k(_,255),L=k(L,255),z=k(z,255);var ee=X(_,L,z),$=Y(_,L,z),Ee,Be,nt=ee,we=ee-$;if(Be=ee===0?0:we/ee,ee==$)Ee=0;else{switch(ee){case _:Ee=(L-z)/we+(L<z?6:0);break;case L:Ee=(z-_)/we+2;break;case z:Ee=(_-L)/we+4;break}Ee/=6}return{h:Ee,s:Be,v:nt}}function s(_,L,z){_=k(_,360)*6,L=k(L,100),z=k(z,100);var ee=Q.floor(_),$=_-ee,Ee=z*(1-L),Be=z*(1-$*L),nt=z*(1-(1-$)*L),we=ee%6,Ne=[z,Be,Ee,Ee,nt,z][we],Ye=[nt,z,z,Be,Ee,Ee][we],Xe=[Ee,Ee,nt,z,z,Be][we];return{r:Ne*255,g:Ye*255,b:Xe*255}}function i(_,L,z,ee){var $=[fe(M(_).toString(16)),fe(M(L).toString(16)),fe(M(z).toString(16))];return ee&&$[0].charAt(0)==$[0].charAt(1)&&$[1].charAt(0)==$[1].charAt(1)&&$[2].charAt(0)==$[2].charAt(1)?$[0].charAt(0)+$[1].charAt(0)+$[2].charAt(0):$.join("")}function t(_,L,z,ee,$){var Ee=[fe(M(_).toString(16)),fe(M(L).toString(16)),fe(M(z).toString(16)),fe(Se(ee))];return $&&Ee[0].charAt(0)==Ee[0].charAt(1)&&Ee[1].charAt(0)==Ee[1].charAt(1)&&Ee[2].charAt(0)==Ee[2].charAt(1)&&Ee[3].charAt(0)==Ee[3].charAt(1)?Ee[0].charAt(0)+Ee[1].charAt(0)+Ee[2].charAt(0)+Ee[3].charAt(0):Ee.join("")}function u(_,L,z,ee){var $=[fe(Se(ee)),fe(M(_).toString(16)),fe(M(L).toString(16)),fe(M(z).toString(16))];return $.join("")}A.equals=function(_,L){return!_||!L?!1:A(_).toRgbString()==A(L).toRgbString()},A.random=function(){return A.fromRatio({r:r(),g:r(),b:r()})};function o(_,L){L=L===0?0:L||10;var z=A(_).toHsl();return z.s-=L/100,z.s=y(z.s),A(z)}function R(_,L){L=L===0?0:L||10;var z=A(_).toHsl();return z.s+=L/100,z.s=y(z.s),A(z)}function T(_){return A(_).desaturate(100)}function S(_,L){L=L===0?0:L||10;var z=A(_).toHsl();return z.l+=L/100,z.l=y(z.l),A(z)}function D(_,L){L=L===0?0:L||10;var z=A(_).toRgb();return z.r=X(0,Y(255,z.r-M(255*-(L/100)))),z.g=X(0,Y(255,z.g-M(255*-(L/100)))),z.b=X(0,Y(255,z.b-M(255*-(L/100)))),A(z)}function I(_,L){L=L===0?0:L||10;var z=A(_).toHsl();return z.l-=L/100,z.l=y(z.l),A(z)}function E(_,L){var z=A(_).toHsl(),ee=(z.h+L)%360;return z.h=ee<0?360+ee:ee,A(z)}function x(_){var L=A(_).toHsl();return L.h=(L.h+180)%360,A(L)}function g(_){var L=A(_).toHsl(),z=L.h;return[A(_),A({h:(z+120)%360,s:L.s,l:L.l}),A({h:(z+240)%360,s:L.s,l:L.l})]}function h(_){var L=A(_).toHsl(),z=L.h;return[A(_),A({h:(z+90)%360,s:L.s,l:L.l}),A({h:(z+180)%360,s:L.s,l:L.l}),A({h:(z+270)%360,s:L.s,l:L.l})]}function O(_){var L=A(_).toHsl(),z=L.h;return[A(_),A({h:(z+72)%360,s:L.s,l:L.l}),A({h:(z+216)%360,s:L.s,l:L.l})]}function w(_,L,z){L=L||6,z=z||30;var ee=A(_).toHsl(),$=360/z,Ee=[A(_)];for(ee.h=(ee.h-($*L>>1)+720)%360;--L;)ee.h=(ee.h+$)%360,Ee.push(A(ee));return Ee}function b(_,L){L=L||6;for(var z=A(_).toHsv(),ee=z.h,$=z.s,Ee=z.v,Be=[],nt=1/L;L--;)Be.push(A({h:ee,s:$,v:Ee})),Ee=(Ee+nt)%1;return Be}A.mix=function(_,L,z){z=z===0?0:z||50;var ee=A(_).toRgb(),$=A(L).toRgb(),Ee=z/100,Be={r:($.r-ee.r)*Ee+ee.r,g:($.g-ee.g)*Ee+ee.g,b:($.b-ee.b)*Ee+ee.b,a:($.a-ee.a)*Ee+ee.a};return A(Be)},A.readability=function(_,L){var z=A(_),ee=A(L);return(Q.max(z.getLuminance(),ee.getLuminance())+.05)/(Q.min(z.getLuminance(),ee.getLuminance())+.05)},A.isReadable=function(_,L,z){var ee=A.readability(_,L),$,Ee;Ee=!1,$=q(z);switch($.level+$.size){case"AAsmall":case"AAAlarge":Ee=ee>=4.5;break;case"AAlarge":Ee=ee>=3;break;case"AAAsmall":Ee=ee>=7;break}return Ee},A.mostReadable=function(_,L,z){var ee=null,$=0,Ee,Be,nt,we;z=z||{},Be=z.includeFallbackColors,nt=z.level,we=z.size;for(var Ne=0;Ne<L.length;Ne++)Ee=A.readability(_,L[Ne]),Ee>$&&($=Ee,ee=A(L[Ne]));return A.isReadable(_,ee,{level:nt,size:we})||!Be?ee:(z.includeFallbackColors=!1,A.mostReadable(_,["#fff","#000"],z))};var W=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"},j=A.hexNames=C(W);function C(_){var L={};for(var z in _)_.hasOwnProperty(z)&&(L[_[z]]=z);return L}function B(_){return _=parseFloat(_),(isNaN(_)||_<0||_>1)&&(_=1),_}function k(_,L){J(_)&&(_="100%");var z=se(_);return _=Y(L,X(0,parseFloat(_))),z&&(_=parseInt(_*L,10)/100),Q.abs(_-L)<1e-6?1:_%L/parseFloat(L)}function y(_){return Y(1,X(0,_))}function H(_){return parseInt(_,16)}function J(_){return typeof _=="string"&&_.indexOf(".")!=-1&&parseFloat(_)===1}function se(_){return typeof _=="string"&&_.indexOf("%")!=-1}function fe(_){return _.length==1?"0"+_:""+_}function ve(_){return _<=1&&(_=_*100+"%"),_}function Se(_){return Q.round(parseFloat(_)*255).toString(16)}function Ue(_){return H(_)/255}var Te=function(){var _="[-\\+]?\\d+%?",L="[-\\+]?\\d*\\.\\d+%?",z="(?:"+L+")|(?:"+_+")",ee="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",$="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?";return{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+ee),rgba:new RegExp("rgba"+$),hsl:new RegExp("hsl"+ee),hsla:new RegExp("hsla"+$),hsv:new RegExp("hsv"+ee),hsva:new RegExp("hsva"+$),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 Ie(_){return!!Te.CSS_UNIT.exec(_)}function be(_){_=_.replace(U,"").replace(Z,"").toLowerCase();var L=!1;if(W[_])_=W[_],L=!0;else if(_=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var z;return(z=Te.rgb.exec(_))?{r:z[1],g:z[2],b:z[3]}:(z=Te.rgba.exec(_))?{r:z[1],g:z[2],b:z[3],a:z[4]}:(z=Te.hsl.exec(_))?{h:z[1],s:z[2],l:z[3]}:(z=Te.hsla.exec(_))?{h:z[1],s:z[2],l:z[3],a:z[4]}:(z=Te.hsv.exec(_))?{h:z[1],s:z[2],v:z[3]}:(z=Te.hsva.exec(_))?{h:z[1],s:z[2],v:z[3],a:z[4]}:(z=Te.hex8.exec(_))?{r:H(z[1]),g:H(z[2]),b:H(z[3]),a:Ue(z[4]),format:L?"name":"hex8"}:(z=Te.hex6.exec(_))?{r:H(z[1]),g:H(z[2]),b:H(z[3]),format:L?"name":"hex"}:(z=Te.hex4.exec(_))?{r:H(z[1]+""+z[1]),g:H(z[2]+""+z[2]),b:H(z[3]+""+z[3]),a:Ue(z[4]+""+z[4]),format:L?"name":"hex8"}:(z=Te.hex3.exec(_))?{r:H(z[1]+""+z[1]),g:H(z[2]+""+z[2]),b:H(z[3]+""+z[3]),format:L?"name":"hex"}:!1}function q(_){var L,z;return _=_||{level:"AA",size:"small"},L=(_.level||"AA").toUpperCase(),z=(_.size||"small").toLowerCase(),L!=="AA"&&L!=="AAA"&&(L="AA"),z!=="small"&&z!=="large"&&(z="small"),{level:L,size:z}}Et.exports?Et.exports=A:!(ne=function(){return A}.call(Pe,F,Pe,Et),ne!==void 0&&(Et.exports=ne))})(Math)},a99f:function(Et,Pe,F){"use strict";F.r(Pe);var ne=F("T2oS"),Q=F("W9HT"),U=F("14J3"),Z=F("BMrR"),G=F("jCWc"),M=F("kPKH"),Y=F("sPJy"),X=F("bE4q"),r=F("k1fw"),A=F("oBTY"),m=F("miYZ"),f=F("tsqr"),p=F("9og8"),a=F("tJVT"),c=F("WmNS"),s=F.n(c),i=F("q1tI"),t=F.n(i),u=F("Ty5D"),o=F("9kvl"),R=F("55Ip"),T=F("LvDl"),S=F("bbsP"),D=F("/wGt"),I=F("DjyN"),E=F("NUBc"),x=F("/zsF"),g=F("PArb"),h=F("5Dmo"),O=F("3S7+"),w=F("sRBo"),b=F("kaz8"),W=F("+L6B"),j=F("2/Rp"),C=F("5NDa"),B=F("5rEg"),k=F("xKgJ"),y=F("kCvp"),H=F.n(y),J=F("NLgs"),se=F("9z17"),fe=B.a.Search,ve=[{id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]}],Se=[{id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]}],Ue=function(ue){var Me,We=ue.classroomList,lt=ue.shixunsList,Ct=ue.dispatch,Ot=ue.callback,Nt=ue.inNewPaperLibrary,ir=Object(i.useState)(Object(r.a)({},Object(u.i)())),Jt=Object(a.a)(ir,2),cn=Jt[0],rn=Jt[1],In=We.shixunLists,ur=Object(i.useState)([]),mr=Object(a.a)(ur,2),Qn=mr[0],yr=mr[1],Sr=Object(i.useState)(""),Nn=Object(a.a)(Sr,2),Ar=Nn[0],An=Nn[1],Dn=Object(i.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1,keyword:""}),qn=Object(a.a)(Dn,2),fr=qn[0],Lr=qn[1];Object(i.useEffect)(function(){return We.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?document.body.setAttribute("data-custom","height"):document.body.removeAttribute("data-custom"),function(){document.body.removeAttribute("data-custom")}},[We.actionTabs.key]);var Or=We.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE";Object(i.useEffect)(function(){Or&&Ct({type:"classroomList/getShixunLists",payload:Object(r.a)({},fr)})},[cn.categoryId,Or,fr]),Object(i.useEffect)(function(){Ct({type:"shixunsList/getMenus",payload:{}})},[]),Object(i.useEffect)(function(){yr([])},[We.actionTabs.key]);var at=Object(se.b)(),Fe=Object(a.a)(at,4),pt=Fe[0],Le=Fe[1],xe=Fe[2],ge=Fe[3],Hn=function(ut,Re,tn){fr.tag_level=ut,fr.sub_discipline_id=Re,fr.discipline_id=tn,Lr(Object(r.a)({},fr))},Lt=function(){var ke=Object(p.a)(s.a.mark(function ut(Re){var tn,cr;return s.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:Ot&&Ot(In==null||((tn=In.shixun_list)===null||tn===void 0)?void 0:tn.filter(function(jt){return jt.identifier===Qn[0]})[0],(cr=We.actionTabs)===null||cr===void 0?void 0:cr.editData,Re),Ct({type:"classroomList/setActionTabs",payload:{}}),Le();case 3:case"end":return Kn.stop()}},ut)}));return function(Re){return ke.apply(this,arguments)}}();return We.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:t.a.createElement(D.a,{title:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",placement:"bottom",height:"100%",closable:!0,onClose:function(){Ct({type:"classroomList/setActionTabs",payload:{key:""}})},visible:!!Or,key:"bottom",className:H.a.drawer,footer:t.a.createElement("div",{className:"tc"},t.a.createElement(j.a,{size:"large",onClick:function(){Ct({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8}},"\u53D6\u6D88"),t.a.createElement(j.a,{size:"large",onClick:Object(p.a)(s.a.mark(function ke(){var ut;return s.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:if(!(Qn.length>1)){tn.next=4;break}f.b.error("\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u5B9E\u8DF5\u9879\u76EE"),tn.next=16;break;case 4:if(!(Qn.length===0)){tn.next=8;break}f.b.error("\u8BF7\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE"),tn.next=16;break;case 8:if(!Nt){tn.next=12;break}Lt(0),tn.next=16;break;case 12:return tn.next=14,ge({id:Qn[0],course_id:cn.coursesId,type:"shixun"});case 14:ut=tn.sent,ut||Lt(0);case 16:case"end":return tn.stop()}},ke)})),type:"primary"},"\u786E\u5B9A"))},t.a.createElement("section",{className:"tc"},t.a.createElement(fe,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"large",value:Ar,onChange:function(ut){return An(ut.target.value)},className:H.a.search,onSearch:function(ut){fr.keyword=ut,fr.page=1,Lr(Object(r.a)({},fr))}})),t.a.createElement("section",{className:"edu-container"},ve.map(function(ke,ut){var Re;return t.a.createElement("ul",{className:H.a.menu,key:ut},t.a.createElement("li",null,ke.name),ke==null||((Re=ke.children)===null||Re===void 0)?void 0:Re.map(function(tn,cr){return t.a.createElement("li",{key:cr,className:fr[ke.id]==tn.id?H.a.actived:"",onClick:function(){fr[ke.id]=tn.id,Lr(Object(r.a)({},fr)),Ct({type:"classroomList/getShixunLists",payload:Object(r.a)({},fr)})}},t.a.createElement("strong",null,tn.name))}))}),t.a.createElement("ul",{className:H.a.menut},t.a.createElement("span",{style:{padding:"18px",fontWeight:"600"}},"\u65B9\u5411\uFF1A"),t.a.createElement("li",{className:fr.discipline_id?"":H.a.actived3,onClick:function(){Hn(null,null,null)}},t.a.createElement("strong",null,"\u5168\u90E8")),lt.menus&&lt.menus.map(function(ke,ut){return t.a.createElement("li",{key:ut,className:fr.discipline_id==ke.id?H.a.actived3:""},t.a.createElement("strong",{onClick:function(){Hn(1,null,ke.id)}},ke.name),t.a.createElement("div",null,ke.sub_repertoires.map(function(Re,tn){return t.a.createElement("div",{key:tn,className:"mt5"},t.a.createElement("div",{className:fr.sub_discipline_id==Re.id?"".concat(H.a.actived4," ").concat(H.a.subTag):H.a.subTag,onClick:function(){Hn(2,Re.id,ke.id)}},Re.name),t.a.createElement("ul",{className:"mt5"},Re.tags&&Re.tags.map(function(cr,pr){return t.a.createElement("li",{key:pr,className:fr.sub_discipline_id==cr.id?H.a.actived4:"",onClick:function(){Hn(3,cr.id,ke.id)}},cr.name)})))})))})),Se.map(function(ke,ut){var Re;return t.a.createElement("ul",{className:H.a.menu,key:ut},t.a.createElement("li",null,ke.name),ke==null||((Re=ke.children)===null||Re===void 0)?void 0:Re.map(function(tn,cr){return t.a.createElement("li",{key:cr,className:fr[ke.id]==tn.id?H.a.actived:"",onClick:function(){fr[ke.id]=tn.id,Lr(Object(r.a)({},fr)),Ct({type:"classroomList/getShixunLists",payload:Object(r.a)({},fr)})}},t.a.createElement("strong",null,tn.name))}))}),t.a.createElement("div",{className:H.a.menuCourse,style:{margin:"0px 15px"}},t.a.createElement("ul",null,t.a.createElement("li",null,"\u5DF2\u9009",t.a.createElement("span",{className:"c-blue"},Qn.length),"\u4E2A\u5B9E\u8BAD"),t.a.createElement("li",null,"\u5171",t.a.createElement("span",{className:"c-blue"},In.shixuns_count),"\u4E2A\u8BFE\u7A0B"),t.a.createElement("li",{className:"current",onClick:function(){fr.order=fr.order==="asc"?"desc":"asc",Lr(Object(r.a)({},fr))}},"\u5B66\u4E60\u4EBA\u6570",t.a.createElement("p",{className:"edu-sorter current ".concat(fr.order)},fr.order==="asc"?t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"}))))),t.a.createElement(b.a.Group,{style:{display:"block"},value:Qn,onChange:function(ut){yr(ut)}},In==null||((Me=In.shixun_list)===null||Me===void 0)?void 0:Me.map(function(ke,ut){return t.a.createElement("div",{className:H.a.listItem,key:ke.identifier},t.a.createElement(b.a,{value:ke.identifier,disabled:ke==null?void 0:ke.need_authorize}),t.a.createElement("div",{className:H.a.info},t.a.createElement("div",{className:H.a.title},t.a.createElement("div",{className:H.a.titleLeft},t.a.createElement(R.a,{to:"/shixuns/".concat(ke.identifier,"/challenges"),target:"_blank"},t.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:ke.title}})),(ke==null?void 0:ke.need_authorize)&&t.a.createElement("span",{onClick:function(){Object(J.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(k.w)()&&(ke==null?void 0:ke.mark_status)===1&&t.a.createElement(O.a,{title:ke==null?void 0:ke.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(k.w)()&&(ke==null?void 0:ke.mark_status)===2&&t.a.createElement(O.a,{title:ke==null?void 0:ke.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(k.w)()&&(ke==null?void 0:ke.mark_status)===3&&t.a.createElement(O.a,{title:ke==null?void 0:ke.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),t.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},t.a.createElement("span",{className:H.a.description,dangerouslySetInnerHTML:{__html:ke.description}})),t.a.createElement("div",{className:"flex-wrp mt15"},ke.challenge_names.map(function(Re,tn){return t.a.createElement("span",{key:tn,className:"mr30"},"\u7B2C",tn+1,"\u5173 ",Re," ")})),t.a.createElement(g.a,{dashed:!0}),t.a.createElement("div",{className:"c-light-black mt20"},t.a.createElement("span",null,ke.author_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,ke.author_school_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",ke.level),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),t.a.createElement("span",null,ke.study_count))))})),t.a.createElement("p",null)),t.a.createElement("div",{className:"tc"},t.a.createElement(E.a,{defaultCurrent:1,current:fr.page||1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,showSizeChanger:!1,total:In==null?void 0:In.shixuns_count,onChange:function(ut){fr.page=ut,Lr(Object(r.a)({},fr)),yr([])}})),t.a.createElement(se.a,{visible:pt,onCancel:Le,onOk:Lt,renderData:xe,inPaper:!0,modalType:"single",type:"shixun"}))},Te=Object(o.a)(function(De){var ue=De.classroomList,Me=De.shixunsList,We=De.user;return{classroomList:ue,shixunsList:Me,user:We}})(Ue),Ie=F("sZF6"),be=F("2aBv"),q=F("zWo0"),_=F.n(q),L=F("LYsE"),z=F("1vsH"),ee=F("vCeJ"),$=F("7Kak"),Ee=F("9yH6"),Be=F("giR+"),nt=F("fyUT"),we=F("6UJt"),Ne=F("DFOY"),Ye=F("rAM+"),Xe=F("y8nQ"),ht=F("Vl3Y"),wt=F("ZWs3"),Bt=function(ue){var Me=ue.initValue,We=ue.courseOptions,lt=ue.setIsEdit,Ct=ue.setEditKey,Ot=ue.reload,Nt=ht.a.useForm(),ir=Object(a.a)(Nt,1),Jt=ir[0],cn=Object(u.i)(),rn=Object(i.useMemo)(function(){var In=Me==null?void 0:Me.sub_discipline_id,ur=[],mr=Object(Ye.a)(We),Qn;try{for(mr.s();!(Qn=mr.n()).done;){var yr=Qn.value,Sr=Object(Ye.a)(yr.children),Nn;try{for(Sr.s();!(Nn=Sr.n()).done;){var Ar=Nn.value;Ar.value===In&&(ur=[yr.value,Ar.value])}}catch(Dn){Sr.e(Dn)}finally{Sr.f()}}}catch(Dn){mr.e(Dn)}finally{mr.f()}var An=Me.time;return Object(r.a)(Object(r.a)({},Me),{},{sub_discipline_id:ur,time:An===-1?null:An})},[Me,We]);return t.a.createElement(ht.a,{initialValues:rn,layout:"vertical",form:Jt,className:_.a.formWrap},t.a.createElement(ht.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"sub_discipline_id",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},t.a.createElement(Ne.a,{placeholder:"\u8BF7\u9009\u62E9...",options:We})),t.a.createElement(ht.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u540D\u79F0"}]},t.a.createElement(B.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),t.a.createElement("div",{style:{display:"flex"}},t.a.createElement(ht.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F"},t.a.createElement(nt.a,{min:1,max:9999,style:{width:110},maxLength:60,placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"})),t.a.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"32px",marginTop:23}},"\u5206\u949F")),t.a.createElement(ht.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},t.a.createElement(Ee.a.Group,null,t.a.createElement(Ee.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(Ee.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(Ee.a.Button,{value:3},"\u56F0\u96BE"))),t.a.createElement(ht.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},t.a.createElement(B.a.TextArea,{maxLength:65535,rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u523665535\u4E2A\u5B57\u7B26"})),t.a.createElement(ht.a.Item,{className:"tr"},t.a.createElement(wt.a,{type:"primary",onClick:Object(p.a)(s.a.mark(function In(){var ur,mr;return s.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:return yr.next=2,Jt.validateFields();case 2:return ur=Jt.getFieldsValue(),ur.sub_discipline_id=ur.sub_discipline_id[1],yr.next=6,Object(ee.z)(Object(r.a)({id:cn.id},ur));case 6:mr=yr.sent,mr.status===0&&(lt(!1),Ct(-1),Ot());case 8:case"end":return yr.stop()}},In)}))},"\u4FDD\u5B58"),t.a.createElement(j.a,{style:{marginLeft:10},onClick:function(){Jt.resetFields(),lt(!1)}},"\u53D6\u6D88")))},Wt=Bt,an=F("g9YV"),Yt=F("wCAj"),qe=F("+BqJ"),Qe=F.n(qe),bt=F("9Bee"),xt=function(ue){var Me=ue.isPreview,We=Me===void 0?!1:Me,lt=ue.isExportBlank,Ct=lt===void 0?!1:lt,Ot=ue.newExercisePaper,Nt=ue.setIsEdit,ir=Object(u.i)(),Jt=Object(i.useState)(),cn=Object(a.a)(Jt,2),rn=cn[0],In=cn[1],ur=Object(i.useState)(),mr=Object(a.a)(ur,2),Qn=mr[0],yr=mr[1],Sr=Object(i.useRef)(null),Nn=Object(i.useState)(21),Ar=Object(a.a)(Nn,2),An=Ar[0],Dn=Ar[1];Object(i.useEffect)(function(){qn()},[]),Object(i.useEffect)(function(){Sr.current&&Dn(Sr.current.clientHeight)},[Sr.current]),Object(i.useEffect)(function(){var at;if((at=Ot.exerciseExportHeadData)!==null&&at!==void 0&&at.title){var Fe=Ot.exerciseExportHeadData;In(Object(r.a)({},Fe||{}));var pt=Fe||{},Le=pt.table,xe,ge;(Le!=null&&Le.total_singles_scores||Le!=null&&Le.total_doubles_scores||Le!=null&&Le.total_nulls_scores||Le!=null&&Le.total_judges_scores||Le!=null&&Le.total_pros_scores||Le!=null&&Le.total_shixuns_scores||Le!=null&&Le.total_mains_scores||Le!=null&&Le.total_combination_scores)&&(xe=Number(Le==null?void 0:Le.total_singles_scores)+Number(Le==null?void 0:Le.total_doubles_scores)+Number(Le==null?void 0:Le.total_nulls_scores)+Number(Le==null?void 0:Le.total_judges_scores)+Number(Le==null?void 0:Le.total_pros_scores)+Number(Le==null?void 0:Le.total_shixuns_scores)+Number(Le==null?void 0:Le.total_mains_scores)+Number(Le==null?void 0:Le.total_combination_scores)),(Le!=null&&Le.singles_scores||Le!=null&&Le.doubles_scores||Le!=null&&Le.nulls_scores||Le!=null&&Le.judges_scores||Le!=null&&Le.pros_scores||Le!=null&&Le.shixuns_scores||Le!=null&&Le.mains_scores||Le!=null&&Le.combination_scores)&&(ge=Number(Le==null?void 0:Le.singles_scores)+Number(Le==null?void 0:Le.doubles_scores)+Number(Le==null?void 0:Le.nulls_scores)+Number(Le==null?void 0:Le.judges_scores)+Number(Le==null?void 0:Le.pros_scores)+Number(Le==null?void 0:Le.shixuns_scores)+Number(Le==null?void 0:Le.mains_scores)+Number(Le==null?void 0:Le.combination_scores));var Hn=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Le==null?void 0:Le.total_singles_scores,doubles_score:Le==null?void 0:Le.total_doubles_scores,nulls_score:Le==null?void 0:Le.total_nulls_scores,judges_score:Le==null?void 0:Le.total_judges_scores,pros_score:Le==null?void 0:Le.total_pros_scores,shixuns_score:Le==null?void 0:Le.total_shixuns_scores,mains_score:Le==null?void 0:Le.total_mains_scores,combinations_score:Le==null?void 0:Le.total_combination_scores,total_score:xe},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:Le==null?void 0:Le.singles_scores,doubles_score:Le==null?void 0:Le.doubles_scores,nulls_score:Le==null?void 0:Le.nulls_scores,judges_score:Le==null?void 0:Le.judges_scores,pros_score:Le==null?void 0:Le.pros_scores,shixuns_score:Le==null?void 0:Le.shixuns_scores,mains_score:Le==null?void 0:Le.mains_scores,combinations_score:Le==null?void 0:Le.combination_scores,total_score:ge},{key:"3",name:"\u8BC4\u5377\u4EBA"}],Lt=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Le==null?void 0:Le.total_singles_scores,doubles_score:Le==null?void 0:Le.total_doubles_scores,nulls_score:Le==null?void 0:Le.total_nulls_scores,judges_score:Le==null?void 0:Le.total_judges_scores,pros_score:Le==null?void 0:Le.total_pros_scores,shixuns_score:Le==null?void 0:Le.total_shixuns_scores,mains_score:Le==null?void 0:Le.total_mains_scores,combinations_score:Le==null?void 0:Le.combination_scores,total_score:xe},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}];yr(Object(A.a)(Ct?Lt:Hn))}},[Ot.exerciseExportHeadData]);var qn=function(){var at=Object(p.a)(s.a.mark(function Fe(){var pt,Le,xe,ge,Hn,Lt,ke;return s.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return Re.next=2,Object(ee.m)(ir.id);case 2:pt=Re.sent,In(pt||{}),Le=pt||{},xe=Le.table,(xe!=null&&xe.total_singles_scores||xe!=null&&xe.total_doubles_scores||xe!=null&&xe.total_nulls_scores||xe!=null&&xe.total_judges_scores||xe!=null&&xe.total_pros_scores||xe!=null&&xe.total_shixuns_scores||xe!=null&&xe.total_mains_scores||xe!=null&&xe.total_combination_scores)&&(ge=Number(xe==null?void 0:xe.total_singles_scores)+Number(xe==null?void 0:xe.total_doubles_scores)+Number(xe==null?void 0:xe.total_nulls_scores)+Number(xe==null?void 0:xe.total_judges_scores)+Number(xe==null?void 0:xe.total_pros_scores)+Number(xe==null?void 0:xe.total_shixuns_scores)+Number(xe==null?void 0:xe.total_mains_scores)+Number(xe==null?void 0:xe.total_combination_scores)),(xe!=null&&xe.singles_scores||xe!=null&&xe.doubles_scores||xe!=null&&xe.nulls_scores||xe!=null&&xe.judges_scores||xe!=null&&xe.pros_scores||xe!=null&&xe.shixuns_scores||xe!=null&&xe.mains_scores||xe!=null&&xe.combinations_score)&&(Hn=Number(xe==null?void 0:xe.singles_scores)+Number(xe==null?void 0:xe.doubles_scores)+Number(xe==null?void 0:xe.nulls_scores)+Number(xe==null?void 0:xe.judges_scores)+Number(xe==null?void 0:xe.pros_scores)+Number(xe==null?void 0:xe.shixuns_scores)+Number(xe==null?void 0:xe.mains_scores)+Number(xe==null?void 0:xe.combinations_score)),Lt=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:xe==null?void 0:xe.total_singles_scores,doubles_score:xe==null?void 0:xe.total_doubles_scores,nulls_score:xe==null?void 0:xe.total_nulls_scores,judges_score:xe==null?void 0:xe.total_judges_scores,pros_score:xe==null?void 0:xe.total_pros_scores,shixuns_score:xe==null?void 0:xe.total_shixuns_scores,combinations_score:xe==null?void 0:xe.total_combination_scores,mains_score:xe==null?void 0:xe.total_mains_scores,total_score:ge},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:xe==null?void 0:xe.singles_scores,doubles_score:xe==null?void 0:xe.doubles_scores,nulls_score:xe==null?void 0:xe.nulls_scores,judges_score:xe==null?void 0:xe.judges_scores,pros_score:xe==null?void 0:xe.pros_scores,shixuns_score:xe==null?void 0:xe.shixuns_scores,mains_score:xe==null?void 0:xe.mains_scores,combinations_score:xe==null?void 0:xe.combination_scores,total_score:Hn},{key:"3",name:"\u8BC4\u5377\u4EBA"}],ke=[{key:"1",name:"\u5E94\u5F97\u5206"},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}],yr(Ct?ke:Lt);case 10:case"end":return Re.stop()}},Fe)}));return function(){return at.apply(this,arguments)}}(),fr=[{width:"10%",title:"\u9898\u578B",align:"center",dataIndex:"name",render:function(Fe){return t.a.createElement("a",null,Fe)}},{width:"10%",title:"\u5355\u9009\u9898",align:"center",dataIndex:"singles_score",render:function(Fe){return t.a.createElement("a",null,Fe==="0.0"?0:Fe)}},{width:"10%",title:"\u591A\u9009\u9898",align:"center",dataIndex:"doubles_score",render:function(Fe){return t.a.createElement("a",null,Fe==="0.0"?0:Fe)}},{width:"10%",title:"\u586B\u7A7A\u9898",align:"center",dataIndex:"nulls_score",render:function(Fe){return t.a.createElement("a",null,Fe==="0.0"?0:Fe)}},{width:"10%",title:"\u5224\u65AD\u9898",align:"center",dataIndex:"judges_score",render:function(Fe){return t.a.createElement("a",null,Fe==="0.0"?0:Fe)}},{width:"10%",title:"\u7F16\u7A0B\u9898",align:"center",dataIndex:"pros_score",render:function(Fe){return t.a.createElement("a",null,Fe==="0.0"?0:Fe)}},{width:"10%",title:"\u5B9E\u8BAD\u9898",align:"center",dataIndex:"shixuns_score",render:function(Fe){return t.a.createElement("a",null,Fe==="0.0"?0:Fe)}},{width:"10%",title:"\u7B80\u7B54\u9898",align:"center",dataIndex:"mains_score",render:function(Fe){return t.a.createElement("a",null,Fe==="0.0"?0:Fe)}},{width:"10%",title:"\u7EC4\u5408\u9898",align:"center",dataIndex:"combinations_score",render:function(Fe){return t.a.createElement("a",null,Fe==="0.0"?0:Fe)}},{width:"10%",title:"\u603B\u5206",align:"center",dataIndex:"total_score",render:function(Fe){return t.a.createElement("a",null,Fe==="0.0"?0:Fe)}}],Lr=rn||{},Or=Lr.exercise_header;return t.a.createElement(t.a.Fragment,null,t.a.createElement("section",{className:"".concat(Qe.a.wrap," ").concat(We?"pl20":""," ")},(rn==null?void 0:rn.photo_url)&&t.a.createElement("img",{className:Qe.a.img,src:rn==null?void 0:rn.photo_url}),t.a.createElement("div",{style:{width:"100%",textAlign:"end"}},t.a.createElement(j.a,{onClick:function(){return Nt(!0)}},"\u7F16\u8F91\u8BD5\u5377")),(Or==null?void 0:Or.show_title)&&t.a.createElement("p",{className:"font16 tc c-grey-333"},t.a.createElement("strong",null,rn==null?void 0:rn.title)),(rn==null?void 0:rn.exercise_description)&&t.a.createElement("span",{ref:Sr,style:{justifyContent:An===21?"center":"left",wordBreak:"break-all",display:"flex",textAlign:"left",marginBottom:12},className:"tc c-grey-333"},"\u8BD5\u5377\u987B\u77E5\uFF1A".concat(rn==null?void 0:rn.exercise_description)),(Or==null?void 0:Or.show_info)&&t.a.createElement("p",{className:"tc c-grey-666"},"\u5171:\u3010",rn==null?void 0:rn.large_counts,"\u5927\u9898\u3011\u3010",rn==null?void 0:rn.total_count,"\u5C0F\u9898\u3011\u3010 \u6EE1\u5206",rn==null?void 0:rn.score,"\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010",(rn==null?void 0:rn.time)>-1?"".concat(rn==null?void 0:rn.time,"\u5206\u949F"):"\u4E0D\u9650","\u3011"),(Or==null?void 0:Or.show_desc)&&t.a.createElement("div",{className:"mt10"},t.a.createElement("p",{className:"font16"},"\u8003\u8BD5\u8BF4\u660E\uFF1A"),t.a.createElement(bt.a,{value:rn==null?void 0:rn.description})),(Or==null?void 0:Or.show_table)&&t.a.createElement("div",{className:"mt10"},t.a.createElement(Yt.a,{className:Qe.a.table,columns:fr,dataSource:Object(A.a)(Qn||[]),bordered:!0,pagination:!1}))))},ye=Object(o.a)(function(De){var ue=De.newExercisePaper;return{newExercisePaper:ue}})(xt),ae=F("VYcG"),le=function(ue){var Me=ue.onImport,We=ue.questionType,lt=ue.onAdd,Ct=ue.onSort,Ot=ue.user,Nt=Object(u.i)(),ir=function(){var Jt=Object(p.a)(s.a.mark(function cn(){var rn,In;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return mr.next=2,Object(ee.h)(Nt.id);case 2:rn=mr.sent,rn.status===0&&o.d.push("/classrooms/coursesId/exercise/".concat(rn.exercise_id,"/").concat((In=Ot.userInfo)===null||In===void 0?void 0:In.login,"/initate_answer"));case 4:case"end":return mr.stop()}},cn)}));return function(){return Jt.apply(this,arguments)}}();return t.a.createElement("section",{style:{display:"flex",width:"100%",position:"fixed",bottom:0,height:70,boxShadow:"rgb(0 0 0 / 5%) 0px -4px 4px 0px",zIndex:666},className:[_.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},t.a.createElement("div",{style:{width:"1200px",margin:"0px auto",display:"flex",alignItems:"center"}},t.a.createElement(j.a,{style:{height:30,marginRight:10,width:104},type:"primary",onClick:function(){o.d.push("/paperlibrary/edit_select/".concat(Nt.id))}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),t.a.createElement(j.a,{style:{height:30,marginRight:27,width:104},type:"primary",onClick:Me},"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898"),t.a.createElement("div",{style:{marginRight:"27px",height:"30px",width:1,background:"#F5F5F5"}}),t.a.createElement("div",{style:{display:"flex",marginRight:27}},We.map(function(Jt){return t.a.createElement("span",{key:Jt.id,className:_.a.button,onClick:function(){return lt(Jt.id)}},t.a.createElement("i",{className:"iconfont icon-tianjiashitixiaojiahao mr5",style:{fontSize:"10px",color:"#B1BACD"}}),Jt.name)})),t.a.createElement("div",{style:{marginRight:"25px",height:"30px",width:1,background:"#F5F5F5"}}),t.a.createElement(j.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},className:"mr8",onClick:Ct},t.a.createElement("i",{className:"iconfont icon-tixingpaixu mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u9898\u578B\u6392\u5E8F"),t.a.createElement(j.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},className:"mr8"},t.a.createElement(R.a,{to:"/paperlibrary/see/".concat(Nt.id)},t.a.createElement("i",{className:"iconfont icon-yulan mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u9884\u89C8")),t.a.createElement(j.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},onClick:Object(T.throttle)(ir,3500)},t.a.createElement("i",{className:"iconfont icon-monikaoshi1 mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u6A21\u62DF\u8003\u8BD5")))},me=Object(o.a)(function(De){var ue=De.user;return{user:ue}})(le),Ce=F("hQp1"),de=function(ue){var Me,We,lt,Ct=ue.exercise,Ot=ue.newExercisePaper,Nt=ue.user,ir=ue.dispatch,Jt=Object(u.i)(),cn=Object(i.useState)(!1),rn=Object(a.a)(cn,2),In=rn[0],ur=rn[1],mr=Object(i.useState)(!1),Qn=Object(a.a)(mr,2),yr=Qn[0],Sr=Qn[1],Nn=Object(i.useState)(-1),Ar=Object(a.a)(Nn,2),An=Ar[0],Dn=Ar[1],qn=Object(i.useRef)(),fr=[{name:"\u5355\u9009\u9898",id:0,count:"q_singles",score:"q_singles_scores"},{name:"\u591A\u9009\u9898",id:1,count:"q_doubles",score:"q_doubles_scores"},{name:"\u5224\u65AD\u9898",id:2,count:"q_judges",score:"q_judges_scores"},{name:"\u586B\u7A7A\u9898",id:3,count:"q_nulls",score:"q_nulls_scores"},{name:"\u7B80\u7B54\u9898",id:4,count:"q_mains",score:"q_mains_scores"},{name:"\u5B9E\u8BAD\u9898",id:5,count:"q_shixuns",score:"q_shixuns_scores"},{name:"\u7F16\u7A0B\u9898",id:6,count:"q_pros",score:"q_pros_scores"},{name:"\u7EC4\u5408\u9898",id:7,count:"q_combinations",score:"q_combinations_scores"}],Lr=Object(z.I)();Object(i.useEffect)(function(){return ir({type:"globalSetting/footerToggle",payload:!1}),function(){ir({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(i.useEffect)(function(){Hn()},[]);var Or=Object(ae.useCourseOptions)();Object(i.useEffect)(function(){var yn,ln,Xt;if(Ot!=null&&(yn=Ot.editData)!==null&&yn!==void 0&&yn.exercise_question_types){var Pn,hn;xe(Object(T.cloneDeep)(Ot==null||((Pn=Ot.editData)===null||Pn===void 0)?void 0:Pn.exercise_question_types)),ge.current=Object(T.cloneDeep)(Ot==null||((hn=Ot.editData)===null||hn===void 0)?void 0:hn.exercise_question_types)}var qt=(ln=Ot.editData)===null||ln===void 0||((Xt=ln.exercise)===null||Xt===void 0)?void 0:Xt.sub_discipline_id;qt&&at(qt)},[Ot.editData]);var at=function(){var yn=Object(p.a)(s.a.mark(function ln(Xt){return s.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,ir({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:Xt}});case 2:case"end":return hn.stop()}},ln)}));return function(Xt){return yn.apply(this,arguments)}}(),Fe=Object(i.useState)(),pt=Object(a.a)(Fe,2),Le=pt[0],xe=pt[1],ge=Object(i.useRef)(Le),Hn=function(){var yn=Object(p.a)(s.a.mark(function ln(){var Xt;return s.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:Xt=ir({type:"newExercisePaper/editExercise",payload:{id:Jt.id}}),Xt.status===0&&xe(Xt.exercise_question_types);case 2:case"end":return hn.stop()}},ln)}));return function(){return yn.apply(this,arguments)}}(),Lt=function(){var yn=Object(p.a)(s.a.mark(function ln(Xt){var Pn,hn,qt,Mt,Kt,ar,sr;return s.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:if(!(An!==-1)){bn.next=3;break}return f.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),bn.abrupt("return");case 3:if(!(Xt===Ce.a.Shixun)){bn.next=7;break}ir({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}),bn.next=21;break;case 7:if(!(Xt===Ce.a.Program)){bn.next=11;break}o.d.push("/problems/new?difficult=".concat((Pn=Ot.editData)===null||Pn===void 0||((hn=Pn.exercise)===null||hn===void 0)?void 0:hn.difficulty,"&sub_discipline_id=").concat((qt=Ot.editData)===null||qt===void 0||((Mt=qt.exercise)===null||Mt===void 0)?void 0:Mt.sub_discipline_id,"&express_id=").concat(Jt.id,"&callback_url=").concat(location.pathname)),bn.next=21;break;case 11:if(ar=Le.find(function(Ut){return Ut.question_type===Xt}),ar){bn.next=18;break}return ge.current=Object(T.cloneDeep)(Le),Le.push({name:fr.find(function(Ut){return Ut.id===Xt}).name,question_type:Xt,count:0,score:0,items:[{key:1,insert_id:1,question_type:Xt}]}),xe(Object(A.a)(Le)),Dn("".concat(Xt,"-",1)),bn.abrupt("return");case 18:setTimeout(function(){var Ut;(Ut=document.getElementById("".concat(Xt,"-").concat(ar.count-1)))===null||Ut===void 0||Ut.scrollIntoView()},400),sr={key:ar.count,insert_id:(Kt=ar.items[ar.count])===null||Kt===void 0?void 0:Kt.question_id,question_type:Xt},ut(sr);case 21:case"end":return bn.stop()}},ln)}));return function(Xt){return yn.apply(this,arguments)}}(),ke=function(){Dn(-1),xe(ge.current)},ut=function(){var ln=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ge.current=Object(T.cloneDeep)(Le),ln.question_type===Ce.a.Program){var Xt,Pn,hn,qt;return o.d.push("/problems/new?difficult=".concat((Xt=Ot.editData)===null||Xt===void 0||((Pn=Xt.exercise)===null||Pn===void 0)?void 0:Pn.difficulty,"&sub_discipline_id=").concat((hn=Ot.editData)===null||hn===void 0||((qt=hn.exercise)===null||qt===void 0)?void 0:qt.sub_discipline_id,"&express_id=").concat(Jt.id,"&callback_url=").concat(location.pathname)),!1}Le.map(function(Mt){if(Mt.question_type===ln.question_type){var Kt=Object(T.cloneDeep)(Mt.items);Kt.splice(ln==null?void 0:ln.key,0,Object(r.a)({insert_id:ln==null?void 0:ln.insert_id},ln)),Mt.items=Kt}return Mt}),xe(Object(A.a)(Le)),Dn("".concat(ln.question_type,"-").concat(ln.key+1))},Re={ref:qn,editKey:An,hideAction:!1,cancelAdd:function(){return ke()},setEditKey:function(ln){return Dn(ln)},addCallback:function(ln){return ut(ln)}},tn=Object(i.useState)(!1),cr=Object(a.a)(tn,2),pr=cr[0],Kn=cr[1],jt=function(){var yn=Object(p.a)(s.a.mark(function ln(Xt,Pn){var hn,qt;return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:if(!(Xt.length===0)){Kt.next=4;break}return f.b.warn("\u8BF7\u4E0A\u4F20\u6587\u4EF6"),Pn(),Kt.abrupt("return");case 4:return Kt.next=6,Object(ee.s)(Jt.id,(hn=Xt[0])===null||hn===void 0?void 0:hn.file);case 6:qt=Kt.sent,qt.status===0&&(f.b.success("\u6210\u529F\u5BFC\u5165".concat(qt==null?void 0:qt.success,"\u6761")),Kn(!1),Hn());case 8:case"end":return Kt.stop()}},ln)}));return function(Xt,Pn){return yn.apply(this,arguments)}}(),dr=function(){var yn=Object(p.a)(s.a.mark(function ln(Xt,Pn){var hn;return s.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Mt.next=2,Object(ee.y)(Jt.id,{question_type:Xt});case 2:hn=Mt.sent,(hn==null?void 0:hn.status)===0&&(f.b.success(hn==null?void 0:hn.message),Sr(!1),Hn()),Pn();case 5:case"end":return Mt.stop()}},ln)}));return function(Xt,Pn){return yn.apply(this,arguments)}}(),ct=function(){if(An!==-1){f.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002");return}Kn(!0)},Un=function(){var yn=Object(p.a)(s.a.mark(function ln(Xt,Pn,hn){var qt,Mt,Kt;return s.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return ge.current=Object(T.cloneDeep)(Le),qt=Le.findIndex(function(Fn){return Fn.question_type===hn}),Mt=Le,Mt[qt].items=Pn,xe(Object(A.a)(Mt)),sr.next=7,Object(ee.a)({id:Jt.id,itemId:parseInt(Xt.draggableId),position:Xt.destination.index+1});case 7:Kt=sr.sent;case 8:case"end":return sr.stop()}},ln)}));return function(Xt,Pn,hn){return yn.apply(this,arguments)}}();return t.a.createElement("div",null,t.a.createElement("section",{className:"edu-container minH500"},t.a.createElement(Q.a,{spinning:!1,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},t.a.createElement("section",{className:"animated fadeIn"},t.a.createElement("aside",{className:"mt10"},t.a.createElement(X.a,{separator:">"},t.a.createElement(X.a.Item,null,t.a.createElement(R.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),t.a.createElement(X.a.Item,null,"\u7F16\u8F91\u8BD5\u5377"))),t.a.createElement("aside",{className:"".concat(_.a.title," mt20")},t.a.createElement(Z.a,{style:{width:"100%"}},t.a.createElement(M.a,{flex:"1"},t.a.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u8BD5\u5377")),t.a.createElement(M.a,null,t.a.createElement(R.a,{className:"font16 c-light-black",to:(Lr==null?void 0:Lr.fromadd)==="1"?"/paperlibrary/add/".concat(Jt.id):"/paperlibrary"},"\u8FD4\u56DE"))))),t.a.createElement("section",{className:[_.a.bg,"pt30","pl30","pr30","pb60","mt20"].join(" ")},!In&&t.a.createElement(ye,{setIsEdit:ur,isExportBlank:!1}),In&&t.a.createElement(Wt,{initValue:(Me=Ot.editData)===null||Me===void 0?void 0:Me.exercise,setIsEdit:ur,courseOptions:Or,reload:Hn,setEditKey:Dn})),Le&&t.a.createElement("section",{className:[_.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},t.a.createElement(L.a,{inNewPaperLibrary:!0,data:Le,editorProps:Re,isDragDisabled:An!==-1,onDragEnd:Un,batchScore:["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u7F16\u7A0B\u9898"],reload:Hn})),t.a.createElement(Te,{inNewPaperLibrary:!0,callback:function(ln,Xt,Pn){var hn;ge.current=Object(T.cloneDeep)(Le);var qt={shixun:ln.challenge_names.map(function(ar){return{challenge_name:ar,challenge_score:5}}),shixun_name:ln==null||((hn=ln.title)===null||hn===void 0)?void 0:hn.replace(/<.*?>/gi,""),shixun_id:ln.id,question_type:5,edit:!0,is_copy:Pn};if(Xt&&(Le.map(function(ar){if(ar.question_type===5){var sr=Object(T.cloneDeep)(ar.items);sr.splice(Xt==null?void 0:Xt.key,0,qt),ar.items=sr}return ar}),Dn("5-".concat(Le.key+1)),xe(Object(A.a)(Le))),!Xt){var Mt,Kt=Le.find(function(ar){return ar.question_type===5});if(!Kt){Le.push({name:fr.find(function(ar){return ar.id===5}).name,question_type:5,count:0,score:0,items:[qt]}),xe(Object(A.a)(Le)),Dn("".concat(5,"-",1));return}(Mt=document.getElementById("".concat(5,"-",Kt.count-1)))===null||Mt===void 0||Mt.scrollIntoView({block:"center",inline:"nearest"}),Kt.items.push(qt),xe(Object(A.a)(Le)),Dn("".concat(5,"-",Kt.count))}}})),t.a.createElement(Ie.a,{visible:pr,onCancel:function(){return Kn(!1)},onOk:jt}),t.a.createElement(be.a,{visible:yr,onCancel:function(){return Sr(!1)},onOk:dr,data:(We=Ot.editData)===null||We===void 0||((lt=We.exercise)===null||lt===void 0)?void 0:lt.sort_by_qustion_type})),t.a.createElement(me,{questionType:fr,onAdd:Lt,onImport:ct,onSort:function(){return Sr(!0)}}))},pe=Pe.default=Object(o.a)(function(De){var ue=De.exercise,Me=De.newExercisePaper,We=De.user;return{exercise:ue,user:We,newExercisePaper:Me}})(de)},bT9E:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Q});var ne=F("VTBJ");function Q(U,Z){var G=Object(ne.a)({},U);return Array.isArray(Z)&&Z.forEach(function(M){delete G[M]}),G}},biw7:function(Et,Pe,F){"use strict";var ne=F("q1tI"),Q=F.n(ne),U=ne.createContext(null);Pe.a=U},c5Ni:function(Et,Pe,F){},dejd:function(Et,Pe,F){},dmUQ:function(Et,Pe,F){"use strict";var ne=F("Ff2n"),Q=F("rePB"),U=F("1OyB"),Z=F("vuIU"),G=F("Ji7U"),M=F("md7G"),Y=F("foSv"),X=F("q1tI"),r=F.n(X),A=F("TSYQ"),m=F.n(A),f=F("4IlW");function p(g,h){var O=Object.keys(g);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(g);h&&(w=w.filter(function(b){return Object.getOwnPropertyDescriptor(g,b).enumerable})),O.push.apply(O,w)}return O}function a(g){for(var h=1;h<arguments.length;h++){var O=arguments[h]!=null?arguments[h]:{};h%2?p(Object(O),!0).forEach(function(w){Object(Q.a)(g,w,O[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(O)):p(Object(O)).forEach(function(w){Object.defineProperty(g,w,Object.getOwnPropertyDescriptor(O,w))})}return g}function c(g){var h=s();return function(){var w=Object(Y.a)(g),b;if(h){var W=Object(Y.a)(this).constructor;b=Reflect.construct(w,arguments,W)}else b=w.apply(this,arguments);return Object(M.a)(this,b)}}function s(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(g){return!1}}function i(){}function t(g){g.preventDefault()}var u=function(h){return h.replace(/[^\w.-]+/g,"")},o=200,R=600,T=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(h){return h!=null},D=function(h,O){return O===h||typeof O=="number"&&typeof h=="number"&&isNaN(O)&&isNaN(h)},I=function(g){Object(G.a)(O,g);var h=c(O);function O(w){var b;Object(U.a)(this,O),b=h.call(this,w),b.onKeyDown=function(C){var B=b.props,k=B.onKeyDown,y=B.onPressEnter;if(C.keyCode===f.a.UP){var H=b.getRatio(C);b.up(C,H,null),b.stop()}else if(C.keyCode===f.a.DOWN){var J=b.getRatio(C);b.down(C,J,null),b.stop()}else C.keyCode===f.a.ENTER&&y&&y(C);if(b.recordCursorPosition(),b.lastKeyCode=C.keyCode,k){for(var se=arguments.length,fe=new Array(se>1?se-1:0),ve=1;ve<se;ve++)fe[ve-1]=arguments[ve];k.apply(void 0,[C].concat(fe))}},b.onKeyUp=function(C){var B=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),B){for(var k=arguments.length,y=new Array(k>1?k-1:0),H=1;H<k;H++)y[H-1]=arguments[H];B.apply(void 0,[C].concat(y))}},b.onChange=function(C){var B=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(C)),b.setState({inputValue:b.rawInput}),B(b.toNumber(b.rawInput))},b.onMouseUp=function(){var C=b.props.onMouseUp;b.recordCursorPosition(),C&&C.apply(void 0,arguments)},b.onFocus=function(){var C;b.setState({focused:!0}),(C=b.props).onFocus.apply(C,arguments)},b.onBlur=function(){var C=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var B=b.getCurrentValidValue(b.state.inputValue),k=b.setValue(B,i);if(C){var y=b.input.value,H=b.getInputDisplayValue({focus:!1,value:k});b.input.value=H&&Number(H),C.apply(void 0,arguments),b.input.value=y}},b.getRatio=function(C){var B=1;return C.metaKey||C.ctrlKey?B=.1:C.shiftKey&&(B=10),B},b.getFullNum=function(C){return isNaN(C)?C:/e/i.test(String(C))?Number(C).toFixed(18).replace(/\.?0+$/,""):C},b.getPrecision=function(C){if(S(b.props.precision))return b.props.precision;var B=String(C);if(B.indexOf("e-")>=0)return parseInt(B.slice(B.indexOf("e-")+2),10);var k=0;return B.indexOf(".")>=0&&(k=B.length-B.indexOf(".")-1),k},b.getInputDisplayValue=function(C){var B=C||b.state,k=B.focused,y=B.inputValue,H=B.value,J;k?J=y:J=b.toPrecisionAsStep(H),J==null&&(J="");var se=b.formatWrapper(J);return S(b.props.decimalSeparator)&&(se=se.toString().replace(".",b.props.decimalSeparator)),se},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(C){}},b.restoreByAfter=function(C){if(C===void 0)return!1;var B=b.input.value,k=B.lastIndexOf(C);if(k===-1)return!1;var y=b.cursorBefore.length;return b.lastKeyCode===f.a.DELETE&&b.cursorBefore.charAt(y-1)===C[0]?(b.fixCaret(y,y),!0):k+C.length===B.length?(b.fixCaret(k,k),!0):!1},b.partRestoreByAfter=function(C){return C===void 0?!1:Array.prototype.some.call(C,function(B,k){var y=C.substring(k);return b.restoreByAfter(y)})},b.isNotCompleteNumber=function(C){return isNaN(C)||C===""||C===null||C&&C.toString().indexOf(".")===C.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(C,B,k){b.pressingUpOrDown=!0,b.step("down",C,B,k)},b.up=function(C,B,k){b.pressingUpOrDown=!0,b.step("up",C,B,k)},b.saveInput=function(C){b.input=C};var W=w.value;W===void 0&&(W=w.defaultValue),b.state={focused:w.autoFocus};var j=b.getValidValue(b.toNumber(W));return b.state=a(a({},b.state),{},{inputValue:b.toPrecisionAsStep(j),value:j}),b}return Object(Z.a)(O,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var W=this.props,j=W.value,C=W.onChange,B=W.max,k=W.min,y=this.state.focused;if(b){if(!D(b.value,j)||!D(b.max,B)||!D(b.min,k)){var H=y?j:this.getValidValue(j),J;this.pressingUpOrDown?J=H:this.inputting?J=this.rawInput:J=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:J})}var se="value"in this.props?j:this.state.value;"max"in this.props&&b.max!==B&&typeof se=="number"&&se>B&&C&&C(B),"min"in this.props&&b.min!==k&&typeof se=="number"&&se<k&&C&&C(k)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case f.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case f.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ve){}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(b){var W=b;return W===""?W="":this.isNotCompleteNumber(parseFloat(W))?W=this.state.value:W=this.getValidValue(W),this.toNumber(W)}},{key:"getValueFromEvent",value:function(b){var W=b.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(W=W.replace(this.props.decimalSeparator,".")),W}},{key:"getValidValue",value:function(b){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,C=parseFloat(b);return isNaN(C)?b:(C<W&&(C=W),C>j&&(C=j),C)}},{key:"setValue",value:function(b,W){var j=this.props.precision,C=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),B=this.state.value,k=B===void 0?null:B,y=this.state.inputValue,H=y===void 0?null:y,J=typeof C=="number"?C.toFixed(j):"".concat(C),se=C!==k||J!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},W)):this.setState({value:C,inputValue:this.toPrecisionAsStep(b)},W),se&&this.props.onChange(C),C}},{key:"getMaxPrecision",value:function(b){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,C=j.precision,B=j.step;if(S(C))return C;var k=this.getPrecision(W),y=this.getPrecision(B),H=this.getPrecision(b);return b?Math.max(H,k+y):k+y}},{key:"getPrecisionFactor",value:function(b){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(b,W);return Math.pow(10,j)}},{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(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var W=Math.abs(this.getMaxPrecision(b));return isNaN(W)?b.toString():Number(b).toFixed(W)}},{key:"toNumber",value:function(b){var W=this.props.precision,j=this.state.focused,C=b&&b.length>16&&j;return this.isNotCompleteNumber(b)||C?b:S(W)?Math.round(b*Math.pow(10,W))/Math.pow(10,W):Number(b)}},{key:"upStep",value:function(b,W){var j=this.props.step,C=this.getPrecisionFactor(b,W),B=Math.abs(this.getMaxPrecision(b,W)),k=((C*b+C*j*W)/C).toFixed(B);return this.toNumber(k)}},{key:"downStep",value:function(b,W){var j=this.props.step,C=this.getPrecisionFactor(b,W),B=Math.abs(this.getMaxPrecision(b,W)),k=((C*b-C*j*W)/C).toFixed(B);return this.toNumber(k)}},{key:"step",value:function(b,W){var j=this,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,B=arguments.length>3?arguments[3]:void 0;this.stop(),W&&(W.persist(),W.preventDefault());var k=this.props;if(k.disabled)return;var y=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(y))return;var H=this["".concat(b,"Step")](y,C),J=H>k.max||H<k.min;if(H>k.max?H=k.max:H<k.min&&(H=k.min),this.setValue(H,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),J)return;this.autoStepTimer=setTimeout(function(){j[b](W,C,!0)},B?o:R)}},{key:"fixCaret",value:function(b,W){if(b===void 0||W===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,C=this.input.selectionEnd;(b!==j||W!==C)&&this.input.setSelectionRange(b,W)}catch(B){}}},{key:"render",value:function(){var b,W=this.props,j=W.prefixCls,C=W.disabled,B=W.readOnly,k=W.useTouch,y=W.autoComplete,H=W.upHandler,J=W.downHandler,se=W.className,fe=W.max,ve=W.min,Se=W.style,Ue=W.title,Te=W.onMouseEnter,Ie=W.onMouseLeave,be=W.onMouseOver,q=W.onMouseOut,_=W.required,L=W.onClick,z=W.tabIndex,ee=W.type,$=W.placeholder,Ee=W.id,Be=W.inputMode,nt=W.pattern,we=W.step,Ne=W.maxLength,Ye=W.autoFocus,Xe=W.name,ht=W.onPaste,wt=W.onInput,Bt=Object(ne.a)(W,["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"]),Wt=this.state,an=Wt.value,Yt=Wt.focused,qe=m()(j,(b={},Object(Q.a)(b,se,!!se),Object(Q.a)(b,"".concat(j,"-disabled"),C),Object(Q.a)(b,"".concat(j,"-focused"),Yt),b)),Qe={};Object.keys(Bt).forEach(function(ue){(ue.substr(0,5)==="data-"||ue.substr(0,5)==="aria-"||ue==="role")&&(Qe[ue]=Bt[ue])});var bt=!B&&!C,xt=this.getInputDisplayValue(null),ye=(an||an===0)&&(isNaN(an)||Number(an)>=fe),ae=(an||an===0)&&(isNaN(an)||Number(an)<=ve),le=ye||C||B,me=ae||C||B,Ce=m()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(Q.a)({},"".concat(j,"-handler-up-disabled"),le)),de=m()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(Q.a)({},"".concat(j,"-handler-down-disabled"),me)),pe=k?{onTouchStart:le?i:this.up,onTouchEnd:this.stop}:{onMouseDown:le?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},De=k?{onTouchStart:me?i:this.down,onTouchEnd:this.stop}:{onMouseDown:me?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:qe,style:Se,title:Ue,onMouseEnter:Te,onMouseLeave:Ie,onMouseOver:be,onMouseOut:q,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(j,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},pe,{role:"button","aria-label":"Increase Value","aria-disabled":le,className:Ce}),H||r.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:t})),r.a.createElement("span",Object.assign({unselectable:"on"},De,{role:"button","aria-label":"Decrease Value","aria-disabled":me,className:de}),J||r.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:t}))),r.a.createElement("div",{className:"".concat(j,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ve,"aria-valuemax":fe,"aria-valuenow":an,required:_,type:ee,placeholder:$,onPaste:ht,onClick:L,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:z,autoComplete:y,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:bt?this.onKeyDown:i,onKeyUp:bt?this.onKeyUp:i,autoFocus:Ye,maxLength:Ne,readOnly:B,disabled:C,max:fe,min:ve,step:we,name:Xe,title:Ue,id:Ee,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(xt),pattern:nt,inputMode:Be,onInput:wt},Qe))))}}]),O}(r.a.Component);I.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:u,required:!1,autoComplete:"off"};var E=I,x=Pe.a=E},fcSX:function(Et,Pe,F){"use strict";var ne=F("Ff2n"),Q=F("1OyB"),U=F("vuIU"),Z=F("Ji7U"),G=F("md7G"),M=F("foSv"),Y=F("1W/9"),X=F("q1tI"),r=F("rePB"),A=F("JX7q"),m=F("TSYQ"),f=F.n(m),p=F("qx4F"),a=F("4IlW");function c(C){return Array.isArray(C)?C:[C]}var s={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(s).filter(function(C){if(typeof document=="undefined")return!1;var B=document.getElementsByTagName("html")[0];return C in(B?B.style:{})})[0],t=s[i];function u(C,B,k,y){C.addEventListener?C.addEventListener(B,k,y):C.attachEvent&&C.attachEvent("on".concat(B),k)}function o(C,B,k,y){C.removeEventListener?C.removeEventListener(B,k,y):C.attachEvent&&C.detachEvent("on".concat(B),k)}function R(C,B){var k=typeof C=="function"?C(B):C;return Array.isArray(k)?k.length===2?k:[k[0],k[1]]:[k]}var T=function(B){return!isNaN(parseFloat(B))&&isFinite(B)},S=!(typeof window!="undefined"&&window.document&&window.document.createElement),D=function C(B,k,y,H){if(!k||k===document||k instanceof Document)return!1;if(k===B.parentNode)return!0;var J=Math.max(Math.abs(y),Math.abs(H))===Math.abs(H),se=Math.max(Math.abs(y),Math.abs(H))===Math.abs(y),fe=k.scrollHeight-k.clientHeight,ve=k.scrollWidth-k.clientWidth,Se=document.defaultView.getComputedStyle(k),Ue=Se.overflowY==="auto"||Se.overflowY==="scroll",Te=Se.overflowX==="auto"||Se.overflowX==="scroll",Ie=fe&&Ue,be=ve&&Te;return J&&(!Ie||Ie&&(k.scrollTop>=fe&&H<0||k.scrollTop<=0&&H>0))||se&&(!be||be&&(k.scrollLeft>=ve&&y<0||k.scrollLeft<=0&&y>0))?C(B,k.parentNode,y,H):!1};function I(C){var B=E();return function(){var y=Object(M.a)(C),H;if(B){var J=Object(M.a)(this).constructor;H=Reflect.construct(y,arguments,J)}else H=y.apply(this,arguments);return Object(G.a)(this,H)}}function E(){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(C){return!1}}var x={},g=function(C){Object(Z.a)(k,C);var B=I(k);function k(y){var H;return Object(Q.a)(this,k),H=B.call(this,y),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(J){if(J.touches.length>1)return;H.startPos={x:J.touches[0].clientX,y:J.touches[0].clientY}},H.removeMoveHandler=function(J){if(J.changedTouches.length>1)return;var se=J.currentTarget,fe=J.changedTouches[0].clientX-H.startPos.x,ve=J.changedTouches[0].clientY-H.startPos.y;(se===H.maskDom||se===H.handlerDom||se===H.contentDom&&D(se,J.target,fe,ve))&&J.cancelable&&J.preventDefault()},H.transitionEnd=function(J){var se=J.target;o(se,t,H.transitionEnd),se.style.transition=""},H.onKeyDown=function(J){if(J.keyCode===a.a.ESC){var se=H.props.onClose;J.stopPropagation(),se&&se(J)}},H.onWrapperTransitionEnd=function(J){var se=H.props,fe=se.open,ve=se.afterVisibleChange;J.target===H.contentWrapper&&J.propertyName.match(/transform$/)&&(H.dom.style.transition="",!fe&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),ve&&ve(!!fe))},H.openLevelTransition=function(){var J=H.props,se=J.open,fe=J.width,ve=J.height,Se=H.getHorizontalBoolAndPlacementName(),Ue=Se.isHorizontal,Te=Se.placementName,Ie=H.contentDom?H.contentDom.getBoundingClientRect()[Ue?"width":"height"]:0,be=(Ue?fe:ve)||Ie;H.setLevelAndScrolling(se,Te,be)},H.setLevelTransform=function(J,se,fe,ve){var Se=H.props,Ue=Se.placement,Te=Se.levelMove,Ie=Se.duration,be=Se.ease,q=Se.showMask;H.levelDom.forEach(function(_){_.style.transition="transform ".concat(Ie," ").concat(be),u(_,t,H.transitionEnd);var L=J?fe:0;if(Te){var z=R(Te,{target:_,open:J});L=J?z[0]:z[1]||0}var ee=typeof L=="number"?"".concat(L,"px"):L,$=Ue==="left"||Ue==="top"?ee:"-".concat(ee);$=q&&Ue==="right"&&ve?"calc(".concat($," + ").concat(ve,"px)"):$,_.style.transform=L?"".concat(se,"(").concat($,")"):""})},H.setLevelAndScrolling=function(J,se,fe){var ve=H.props.onChange;if(!S){var Se=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(p.a)(!0):0;H.setLevelTransform(J,se,fe,Se),H.toggleScrollingToDrawerAndBody(Se)}ve&&ve(J)},H.toggleScrollingToDrawerAndBody=function(J){var se=H.props,fe=se.getOpenCount,ve=se.getContainer,Se=se.showMask,Ue=se.open,Te=ve&&ve(),Ie=fe&&fe();if(Te&&Te.parentNode===document.body&&Se){var be=["touchstart"],q=[document.body,H.maskDom,H.handlerDom,H.contentDom];Ue&&document.body.style.overflow!=="hidden"?(J&&H.addScrollingEffect(J),Ie===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",q.forEach(function(_,L){if(!_)return;u(_,be[L]||"touchmove",L?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(Ie||(document.body.style.overflow=""),document.body.style.touchAction="",J&&H.remScrollingEffect(J),q.forEach(function(_,L){if(!_)return;o(_,be[L]||"touchmove",L?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(J){var se=H.props,fe=se.placement,ve=se.duration,Se=se.ease,Ue=se.getOpenCount,Te=se.switchScrollingEffect,Ie=Ue&&Ue();Ie===1&&Te();var be="width ".concat(ve," ").concat(Se),q="transform ".concat(ve," ").concat(Se);H.dom.style.transition="none";switch(fe){case"right":H.dom.style.transform="translateX(-".concat(J,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(J,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(q,",").concat(be),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(J){var se=H.props,fe=se.placement,ve=se.duration,Se=se.ease,Ue=se.getOpenCount,Te=se.switchScrollingEffect,Ie=Ue&&Ue();Ie||Te(!0),i&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var be,q="width ".concat(ve," ").concat(Se),_="transform ".concat(ve," ").concat(Se);switch(fe){case"left":{H.dom.style.width="100%",q="width 0s ".concat(Se," ").concat(ve);break}case"right":{H.dom.style.transform="translateX(".concat(J,"px)"),H.dom.style.width="100%",q="width 0s ".concat(Se," ").concat(ve),H.maskDom&&(H.maskDom.style.left="-".concat(J,"px"),H.maskDom.style.width="calc(100% + ".concat(J,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(J,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",be="height 0s ".concat(Se," ").concat(ve);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(_,",").concat(be?"".concat(be,","):"").concat(q),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(x).some(function(J){return x[J]})},H.getLevelDom=function(J){var se=J.level,fe=J.getContainer;if(S)return;var ve=fe&&fe(),Se=ve?ve.parentNode:null;if(H.levelDom=[],se==="all"){var Ue=Se?Array.prototype.slice.call(Se.children):[];Ue.forEach(function(Te){Te.nodeName!=="SCRIPT"&&Te.nodeName!=="STYLE"&&Te.nodeName!=="LINK"&&Te!==ve&&H.levelDom.push(Te)})}else se&&c(se).forEach(function(Te){document.querySelectorAll(Te).forEach(function(Ie){H.levelDom.push(Ie)})})},H.getHorizontalBoolAndPlacementName=function(){var J=H.props.placement,se=J==="left"||J==="right",fe="translate".concat(se?"X":"Y");return{isHorizontal:se,placementName:fe}},H.state={_self:Object(A.a)(H)},H}return Object(U.a)(k,[{key:"componentDidMount",value:function(){var H=this;if(!S){var J=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return J=!0,null}}))}catch(Ue){}this.passive=J?{passive:!1}:!1}var se=this.props,fe=se.open,ve=se.getContainer,Se=ve&&ve();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),fe&&(Se&&Se.parentNode===document.body&&(x[this.drawerId]=fe),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var J=this.props,se=J.open,fe=J.getContainer,ve=fe&&fe();se!==H.open&&(se&&this.domFocus(),ve&&ve.parentNode===document.body&&(x[this.drawerId]=!!se),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,J=H.getOpenCount,se=H.open,fe=H.switchScrollingEffect,ve=typeof J=="function"&&J();delete x[this.drawerId],se&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ve||(document.body.style.overflow="",fe(!0))}},{key:"render",value:function(){var H,J=this,se=this.props,fe=se.className,ve=se.children,Se=se.style,Ue=se.width,Te=se.height,Ie=se.defaultOpen,be=se.open,q=se.prefixCls,_=se.placement,L=se.level,z=se.levelMove,ee=se.ease,$=se.duration,Ee=se.getContainer,Be=se.handler,nt=se.onChange,we=se.afterVisibleChange,Ne=se.showMask,Ye=se.maskClosable,Xe=se.maskStyle,ht=se.onClose,wt=se.onHandleClick,Bt=se.keyboard,Wt=se.getOpenCount,an=se.switchScrollingEffect,Yt=Object(ne.a)(se,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),qe=this.dom?be:!1,Qe=f()(q,(H={},Object(r.a)(H,"".concat(q,"-").concat(_),!0),Object(r.a)(H,"".concat(q,"-open"),qe),Object(r.a)(H,fe||"",!!fe),Object(r.a)(H,"no-mask",!Ne),H)),bt=this.getHorizontalBoolAndPlacementName(),xt=bt.placementName,ye=_==="left"||_==="top"?"-100%":"100%",ae=qe?"":"".concat(xt,"(").concat(ye,")"),le=Be&&X.cloneElement(Be,{onClick:function(Ce){Be.props.onClick&&Be.props.onClick(),wt&&wt(Ce)},ref:function(Ce){J.handlerDom=Ce}});return X.createElement("div",Object.assign({},Yt,{tabIndex:-1,className:Qe,style:Se,ref:function(Ce){J.dom=Ce},onKeyDown:qe&&Bt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Ne&&X.createElement("div",{className:"".concat(q,"-mask"),onClick:Ye?ht:void 0,style:Xe,ref:function(Ce){J.maskDom=Ce}}),X.createElement("div",{className:"".concat(q,"-content-wrapper"),style:{transform:ae,msTransform:ae,width:T(Ue)?"".concat(Ue,"px"):Ue,height:T(Te)?"".concat(Te,"px"):Te},ref:function(Ce){J.contentWrapper=Ce}},X.createElement("div",{className:"".concat(q,"-content"),ref:function(Ce){J.contentDom=Ce},onTouchStart:qe&&Ne?this.removeStartHandler:void 0,onTouchMove:qe&&Ne?this.removeMoveHandler:void 0},ve),le))}}],[{key:"getDerivedStateFromProps",value:function(H,J){var se=J.prevProps,fe=J._self,ve={prevProps:H};if(se!==void 0){var Se=H.placement,Ue=H.level;Se!==se.placement&&(fe.contentDom=null),Ue!==se.level&&fe.getLevelDom(H)}return ve}}]),k}(X.Component);g.defaultProps={switchScrollingEffect:function(){}};var h=g;function O(C){var B=w();return function(){var y=Object(M.a)(C),H;if(B){var J=Object(M.a)(this).constructor;H=Reflect.construct(y,arguments,J)}else H=y.apply(this,arguments);return Object(G.a)(this,H)}}function w(){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(C){return!1}}var b=function(C){Object(Z.a)(k,C);var B=O(k);function k(y){var H;Object(Q.a)(this,k),H=B.call(this,y),H.onHandleClick=function(se){var fe=H.props,ve=fe.onHandleClick,Se=fe.open;if(ve&&ve(se),typeof Se=="undefined"){var Ue=H.state.open;H.setState({open:!Ue})}},H.onClose=function(se){var fe=H.props,ve=fe.onClose,Se=fe.open;ve&&ve(se),typeof Se=="undefined"&&H.setState({open:!1})};var J=typeof y.open!="undefined"?y.open:!!y.defaultOpen;return H.state={open:J},"onMaskClick"in y&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(U.a)(k,[{key:"render",value:function(){var H=this,J=this.props,se=J.defaultOpen,fe=J.getContainer,ve=J.wrapperClassName,Se=J.forceRender,Ue=J.handler,Te=Object(ne.a)(J,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Ie=this.state.open;if(!fe)return X.createElement("div",{className:ve,ref:function(_){H.dom=_}},X.createElement(h,Object.assign({},Te,{open:Ie,handler:Ue,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var be=!!Ue||Se;return X.createElement(Y.a,{visible:Ie,forceRender:be,getContainer:fe,wrapperClassName:ve},function(q){var _=q.visible,L=q.afterClose,z=Object(ne.a)(q,["visible","afterClose"]);return X.createElement(h,Object.assign({},Te,z,{open:_!==void 0?_:Ie,afterVisibleChange:L!==void 0?L:Te.afterVisibleChange,handler:Ue,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,J){var se=J.prevProps,fe={prevProps:H};return typeof se!="undefined"&&H.open!==se.open&&(fe.open=H.open),fe}}]),k}(X.Component);b.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:X.createElement("div",{className:"drawer-handle"},X.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var W=b,j=Pe.a=W},fjLI:function(Et,Pe,F){"use strict";F.d(Pe,"f",function(){return p}),F.d(Pe,"b",function(){return a}),F.d(Pe,"a",function(){return c}),F.d(Pe,"d",function(){return s}),F.d(Pe,"e",function(){return i}),F.d(Pe,"c",function(){return t});var ne=F("8HAY"),Q=F("Vhoy"),U=F("MI8n"),Z=F("JYp7"),G=F("pmY6"),M=F("24hK"),Y=F("nnTU"),X=F("T8No"),r=F("Cg/j"),A=F("t9D7"),m=function(u,o,R,T){var S=arguments.length,D=S<3?o:T===null?T=Object.getOwnPropertyDescriptor(o,R):T,I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(u,o,R,T);else for(var E=u.length-1;E>=0;E--)(I=u[E])&&(D=(S<3?I(D):S>3?I(o,R,D):I(o,R))||D);return S>3&&D&&Object.defineProperty(o,R,D),D},f=function(u,o){return function(R,T){o(R,T,u)}};function p(u){return u.command!==void 0}class a{constructor(u){this.id=a._idPool++,this._debugName=u}}a._idPool=0,a.CommandPalette=new a("CommandPalette"),a.EditorContext=new a("EditorContext"),a.SimpleEditorContext=new a("SimpleEditorContext"),a.EditorContextCopy=new a("EditorContextCopy"),a.EditorContextPeek=new a("EditorContextPeek"),a.MenubarEditMenu=new a("MenubarEditMenu"),a.MenubarCopy=new a("MenubarCopy"),a.MenubarGoMenu=new a("MenubarGoMenu"),a.MenubarSelectionMenu=new a("MenubarSelectionMenu"),a.InlineCompletionsActions=new a("InlineCompletionsActions");const c=Object(r.c)("menuService"),s=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new U.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:u=>u===a.CommandPalette}}addCommand(u){return this.addCommands(Z.a.single(u))}addCommands(u){for(const o of u)this._commands.set(o.id,o);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(G.i)(()=>{let o=!1;for(const R of u)o=this._commands.delete(R.id)||o;o&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(u){return this._commands.get(u)}getCommands(){const u=new Map;return this._commands.forEach((o,R)=>u.set(R,o)),u}appendMenuItem(u,o){return this.appendMenuItems(Z.a.single({id:u,item:o}))}appendMenuItems(u){const o=new Set,R=new M.a;for(const{id:T,item:S}of u){let D=this._menuItems.get(T);D||(D=new M.a,this._menuItems.set(T,D)),R.push(D.push(S)),o.add(T)}return this._onDidChangeMenu.fire(o),Object(G.i)(()=>{if(R.size>0){for(let T of R)T();this._onDidChangeMenu.fire(o),R.clear()}})}getMenuItems(u){let o;return this._menuItems.has(u)?o=[...this._menuItems.get(u)]:o=[],u===a.CommandPalette&&this._appendImplicitItems(o),o}_appendImplicitItems(u){const o=new Set;for(const R of u)p(R)&&(o.add(R.command.id),R.alt&&o.add(R.alt.id));this._commands.forEach((R,T)=>{o.has(T)||u.push({command:R})})}};class i extends ne.e{constructor(u,o,R,T){super(`submenuitem.${u.submenu.id}`,typeof u.title=="string"?u.title:u.title.value,[],"submenu");this.item=u,this._menuService=o,this._contextKeyService=R,this._options=T}get actions(){const u=[],o=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=o.getActions(this._options);o.dispose();for(const[,T]of R)T.length>0&&(u.push(...T),u.push(new ne.d));return u.length&&u.pop(),u}}let t=class u{constructor(o,R,T,S,D){var I,E;if(this._commandService=D,this.id=o.id,this.label=(T==null?void 0:T.renderShortTitle)&&o.shortTitle?typeof o.shortTitle=="string"?o.shortTitle:o.shortTitle.value:typeof o.title=="string"?o.title:o.title.value,this.tooltip=(E=typeof o.tooltip=="string"?o.tooltip:(I=o.tooltip)===null||I===void 0?void 0:I.value)!==null&&E!==void 0?E:"",this.enabled=!o.precondition||S.contextMatchesRules(o.precondition),this.checked=void 0,o.toggled){const x=o.toggled.condition?o.toggled:{condition:o.toggled};this.checked=S.contextMatchesRules(x.condition),this.checked&&x.tooltip&&(this.tooltip=typeof x.tooltip=="string"?x.tooltip:x.tooltip.value),x.title&&(this.label=typeof x.title=="string"?x.title:x.title.value)}this.item=o,this.alt=R?new u(R,void 0,T,S,D):void 0,this._options=T,A.d.isThemeIcon(o.icon)&&(this.class=Q.a.asClassName(o.icon))}dispose(){}run(...o){var R,T;let S=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(S=[...S,this._options.arg]),((T=this._options)===null||T===void 0?void 0:T.shouldForwardArgs)&&(S=[...S,...o]),this._commandService.executeCommand(this.id,...S)}};t=m([f(3,X.b),f(4,Y.b)],t)},fyJ8:function(Et,Pe,F){"use strict";var ne=F("rePB"),Q=F("VTBJ"),U=F("Ff2n"),Z=F("U8pU"),G=F("q1tI"),M=F.n(G),Y=F("TSYQ"),X=F.n(Y),r=F("c+Xe"),A=F("sR1s");function m(s){return s&&Object(Z.a)(s)==="object"&&!Array.isArray(s)&&!G.isValidElement(s)}function f(s){return typeof s=="string"?!0:Object(r.c)(s)}function p(s,i){var t,u=s.prefixCls,o=s.className,R=s.record,T=s.index,S=s.dataIndex,D=s.render,I=s.children,E=s.component,x=E===void 0?"td":E,g=s.colSpan,h=s.rowSpan,O=s.fixLeft,w=s.fixRight,b=s.firstFixLeft,W=s.lastFixLeft,j=s.firstFixRight,C=s.lastFixRight,B=s.appendNode,k=s.additionalProps,y=k===void 0?{}:k,H=s.ellipsis,J=s.align,se=s.rowType,fe=s.isSticky,ve="".concat(u,"-cell"),Se,Ue;if(I)Ue=I;else{var Te=Object(A.b)(R,S);if(Ue=Te,D){var Ie=D(Te,R,T);m(Ie)?(Ue=Ie.children,Se=Ie.props):Ue=Ie}}Object(Z.a)(Ue)==="object"&&!Array.isArray(Ue)&&!G.isValidElement(Ue)&&(Ue=null),H&&(W||j)&&(Ue=G.createElement("span",{className:"".concat(ve,"-content")},Ue));var be=Se||{},q=be.colSpan,_=be.rowSpan,L=be.style,z=be.className,ee=Object(U.a)(be,["colSpan","rowSpan","style","className"]),$=q!==void 0?q:g,Ee=_!==void 0?_:h;if($===0||Ee===0)return null;var Be={},nt=typeof O=="number",we=typeof w=="number";nt&&(Be.position="sticky",Be.left=O),we&&(Be.position="sticky",Be.right=w);var Ne={};J&&(Ne.textAlign=J);var Ye,Xe=H===!0?{showTitle:!0}:H;Xe&&(Xe.showTitle||se==="header")&&(typeof Ue=="string"||typeof Ue=="number"?Ye=Ue.toString():G.isValidElement(Ue)&&typeof Ue.props.children=="string"&&(Ye=Ue.props.children));var ht=Object(Q.a)(Object(Q.a)(Object(Q.a)({title:Ye},ee),y),{},{colSpan:$&&$!==1?$:null,rowSpan:Ee&&Ee!==1?Ee:null,className:X()(ve,o,(t={},Object(ne.a)(t,"".concat(ve,"-fix-left"),nt),Object(ne.a)(t,"".concat(ve,"-fix-left-first"),b),Object(ne.a)(t,"".concat(ve,"-fix-left-last"),W),Object(ne.a)(t,"".concat(ve,"-fix-right"),we),Object(ne.a)(t,"".concat(ve,"-fix-right-first"),j),Object(ne.a)(t,"".concat(ve,"-fix-right-last"),C),Object(ne.a)(t,"".concat(ve,"-ellipsis"),H),Object(ne.a)(t,"".concat(ve,"-with-append"),B),Object(ne.a)(t,"".concat(ve,"-fix-sticky"),(nt||we)&&fe),t),y.className,z),style:Object(Q.a)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},y.style),Ne),Be),L),ref:f(x)?i:null});return G.createElement(x,Object.assign({},ht),B,Ue)}var a=G.forwardRef(p);a.displayName="Cell";var c=G.memo(a,function(s,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,s.record):!1});Pe.a=c},h78n:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return b});var ne=F("q1tI"),Q=F.n(ne),U=F("TSYQ"),Z=F.n(U),G={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},M=function(C){var B=C.map(function(){return Object(ne.useRef)()}),k=Object(ne.useRef)();return Object(ne.useEffect)(function(){var y=Date.now(),H=!1;Object.keys(B).forEach(function(J){var se=B[J].current;if(!se)return;H=!0;var fe=se.style;fe.transitionDuration=".3s, .3s, .3s, .06s",k.current&&y-k.current<100&&(fe.transitionDuration="0s, 0s")}),H&&(k.current=Date.now())}),[B]};function Y(){return Y=Object.assign||function(j){for(var C=1;C<arguments.length;C++){var B=arguments[C];for(var k in B)Object.prototype.hasOwnProperty.call(B,k)&&(j[k]=B[k])}return j},Y.apply(this,arguments)}function X(j,C){return p(j)||f(j,C)||A(j,C)||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(j,C){if(!j)return;if(typeof j=="string")return m(j,C);var B=Object.prototype.toString.call(j).slice(8,-1);if(B==="Object"&&j.constructor&&(B=j.constructor.name),B==="Map"||B==="Set")return Array.from(j);if(B==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(B))return m(j,C)}function m(j,C){(C==null||C>j.length)&&(C=j.length);for(var B=0,k=new Array(C);B<C;B++)k[B]=j[B];return k}function f(j,C){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var B=[],k=!0,y=!1,H=void 0;try{for(var J=j[Symbol.iterator](),se;!(k=(se=J.next()).done)&&!(B.push(se.value),C&&B.length===C);k=!0);}catch(fe){y=!0,H=fe}finally{try{!k&&J.return!=null&&J.return()}finally{if(y)throw H}}return B}function p(j){if(Array.isArray(j))return j}function a(j,C){if(j==null)return{};var B=c(j,C),k,y;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(j);for(y=0;y<H.length;y++){if(k=H[y],C.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,k))continue;B[k]=j[k]}}return B}function c(j,C){if(j==null)return{};var B={},k=Object.keys(j),y,H;for(H=0;H<k.length;H++){if(y=k[H],C.indexOf(y)>=0)continue;B[y]=j[y]}return B}var s=function(C){var B=C.className,k=C.percent,y=C.prefixCls,H=C.strokeColor,J=C.strokeLinecap,se=C.strokeWidth,fe=C.style,ve=C.trailColor,Se=C.trailWidth,Ue=C.transition,Te=a(C,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Te.gapPosition;var Ie=Array.isArray(k)?k:[k],be=Array.isArray(H)?H:[H],q=M(Ie),_=X(q,1),L=_[0],z=se/2,ee=100-se/2,$="M ".concat(J==="round"?z:0,",").concat(z,`
L `).concat(J==="round"?ee:100,",").concat(z),Ee="0 0 100 ".concat(se),Be=0;return Q.a.createElement("svg",Y({className:Z()("".concat(y,"-line"),B),viewBox:Ee,preserveAspectRatio:"none",style:fe},Te),Q.a.createElement("path",{className:"".concat(y,"-line-trail"),d:$,strokeLinecap:J,stroke:ve,strokeWidth:Se||se,fillOpacity:"0"}),Ie.map(function(nt,we){var Ne={strokeDasharray:"".concat(nt,"px, 100px"),strokeDashoffset:"-".concat(Be,"px"),transition:Ue||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ye=be[we]||be[be.length-1];return Be+=nt,Q.a.createElement("path",{key:we,className:"".concat(y,"-line-path"),d:$,strokeLinecap:J,stroke:Ye,strokeWidth:se,fillOpacity:"0",ref:L[we],style:Ne})}))};s.defaultProps=G;var i=s;function t(){return t=Object.assign||function(j){for(var C=1;C<arguments.length;C++){var B=arguments[C];for(var k in B)Object.prototype.hasOwnProperty.call(B,k)&&(j[k]=B[k])}return j},t.apply(this,arguments)}function u(j,C){return D(j)||S(j,C)||R(j,C)||o()}function o(){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 R(j,C){if(!j)return;if(typeof j=="string")return T(j,C);var B=Object.prototype.toString.call(j).slice(8,-1);if(B==="Object"&&j.constructor&&(B=j.constructor.name),B==="Map"||B==="Set")return Array.from(j);if(B==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(B))return T(j,C)}function T(j,C){(C==null||C>j.length)&&(C=j.length);for(var B=0,k=new Array(C);B<C;B++)k[B]=j[B];return k}function S(j,C){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var B=[],k=!0,y=!1,H=void 0;try{for(var J=j[Symbol.iterator](),se;!(k=(se=J.next()).done)&&!(B.push(se.value),C&&B.length===C);k=!0);}catch(fe){y=!0,H=fe}finally{try{!k&&J.return!=null&&J.return()}finally{if(y)throw H}}return B}function D(j){if(Array.isArray(j))return j}function I(j,C){if(j==null)return{};var B=E(j,C),k,y;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(j);for(y=0;y<H.length;y++){if(k=H[y],C.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,k))continue;B[k]=j[k]}}return B}function E(j,C){if(j==null)return{};var B={},k=Object.keys(j),y,H;for(H=0;H<k.length;H++){if(y=k[H],C.indexOf(y)>=0)continue;B[y]=j[y]}return B}var x=0;function g(j){return+j.replace("%","")}function h(j){return Array.isArray(j)?j:[j]}function O(j,C,B,k){var y=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,J=50-k/2,se=0,fe=-J,ve=0,Se=-2*J;switch(H){case"left":se=-J,fe=0,ve=2*J,Se=0;break;case"right":se=J,fe=0,ve=-2*J,Se=0;break;case"bottom":fe=J,Se=2*J;break;default:}var Ue="M 50,50 m ".concat(se,",").concat(fe,`
a `).concat(J,",").concat(J," 0 1 1 ").concat(ve,",").concat(-Se,`
a `).concat(J,",").concat(J," 0 1 1 ").concat(-ve,",").concat(Se),Te=Math.PI*2*J,Ie={stroke:B,strokeDasharray:"".concat(C/100*(Te-y),"px ").concat(Te,"px"),strokeDashoffset:"-".concat(y/2+j/100*(Te-y),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Ue,pathStyle:Ie}}var w=function(C){var B=C.prefixCls,k=C.strokeWidth,y=C.trailWidth,H=C.gapDegree,J=C.gapPosition,se=C.trailColor,fe=C.strokeLinecap,ve=C.style,Se=C.className,Ue=C.strokeColor,Te=C.percent,Ie=I(C,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),be=Object(ne.useMemo)(function(){return x+=1,x},[]),q=O(0,100,se,k,H,J),_=q.pathString,L=q.pathStyle,z=h(Te),ee=h(Ue),$=ee.find(function(Ne){return Object.prototype.toString.call(Ne)==="[object Object]"}),Ee=M(z),Be=u(Ee,1),nt=Be[0],we=function(){var Ye=0;return z.map(function(Xe,ht){var wt=ee[ht]||ee[ee.length-1],Bt=Object.prototype.toString.call(wt)==="[object Object]"?"url(#".concat(B,"-gradient-").concat(be,")"):"",Wt=O(Ye,Xe,wt,k,H,J);return Ye+=Xe,Q.a.createElement("path",{key:ht,className:"".concat(B,"-circle-path"),d:Wt.pathString,stroke:Bt,strokeLinecap:fe,strokeWidth:k,opacity:Xe===0?0:1,fillOpacity:"0",style:Wt.pathStyle,ref:nt[ht]})})};return Q.a.createElement("svg",t({className:Z()("".concat(B,"-circle"),Se),viewBox:"0 0 100 100",style:ve},Ie),$&&Q.a.createElement("defs",null,Q.a.createElement("linearGradient",{id:"".concat(B,"-gradient-").concat(be),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys($).sort(function(Ne,Ye){return g(Ne)-g(Ye)}).map(function(Ne,Ye){return Q.a.createElement("stop",{key:Ye,offset:Ne,stopColor:$[Ne]})}))),Q.a.createElement("path",{className:"".concat(B,"-circle-trail"),d:_,stroke:se,strokeLinecap:fe,strokeWidth:y||k,fillOpacity:"0",style:L}),we().reverse())};w.defaultProps=G;var b=w,W={Line:i,Circle:b}},hQp1:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Q});var ne;(function(U){U.FirstPage="firstPage",U.PrevPage="prevPage",U.NextPage="nextPage"})(ne||(ne={}));var Q;(function(U){U[U.Single=0]="Single",U[U.Multiple=1]="Multiple",U[U.Judge=2]="Judge",U[U.Fill=3]="Fill",U[U.Subjective=4]="Subjective",U[U.Shixun=5]="Shixun",U[U.Program=6]="Program",U[U.Combine=7]="Combine"})(Q||(Q={}))},hW8S:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Z}),F.d(Pe,"c",function(){return G}),F.d(Pe,"b",function(){return M});var ne=F("VTBJ"),Q=F("Ff2n"),U=F("Kwbf"),Z="RC_TABLE_INTERNAL_COL_DEFINE";function G(Y){var X=Y.expandable,r=Object(Q.a)(Y,["expandable"]);return"expandable"in Y?Object(ne.a)(Object(ne.a)({},r),X):r}function M(Y){return Object.keys(Y).reduce(function(X,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(X[r]=Y[r]),X},{})}},i58Z:function(Et,Pe,F){Et.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},ic2d:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Z});var ne=F("FWmy"),Q=F("746U");class U{constructor(){this.data=new Map}add(G,M){ne.a(Q.l(G)),ne.a(Q.k(M)),ne.a(!this.data.has(G),"There is already an extension with this id"),this.data.set(G,M)}as(G){return this.data.get(G)||null}}const Z=new U},ie49:function(Et,Pe,F){Et.exports={brief:"brief___29L5W",contentTitle:"contentTitle___2wPLj",content:"content___2MAv3",tips:"tips___3qmPX",antdTable:"antdTable___o4ScH",tableCell:"tableCell___24I9Y",antdModal:"antdModal___1nRWw"}},kCvp:function(Et,Pe,F){Et.exports={flex_box_center:"flex_box_center___1wyfO",flex_space_between:"flex_space_between___3ie-6",flex_box_vertical_center:"flex_box_vertical_center___1eUAq",flex_box_center_end:"flex_box_center_end___29GnR",flex_box_column:"flex_box_column___1pS1E",wrp:"wrp___3A78D",drawer:"drawer___2J2c_",menu:"menu___2EGlp",actived:"actived___2vitA",actived2:"actived2___1qPkY",listItem:"listItem___2jBqU",info:"info___1kwD-",title:"title___2GCln",titleLeft:"titleLeft___3VSnz",titleRight:"titleRight___2bW7b",search:"search___llksR",description:"description____0dnE",menuCourse:"menuCourse___2-Hgo",menut:"menut___1lhlV",actived3:"actived3___P7x4U",actived4:"actived4___BZSP4",subTag:"subTag___1TmCh"}},kSUc:function(Et,Pe,F){},kqOp:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return A});var ne=F("0Owb"),Q=F("fWQN"),U=F("mtLc"),Z=F("yKVA"),G=F("879j"),M=F("q1tI"),Y=F.n(M),X=F("Ot1p"),r="\u2581",A=function(m){Object(Z.a)(p,m);var f=Object(G.a)(p);function p(){var a;Object(Q.a)(this,p);for(var c=arguments.length,s=new Array(c),i=0;i<c;i++)s[i]=arguments[i];return a=f.call.apply(f,[this].concat(s)),a.getChCountBeforeCursor=function(t,u){for(var o=u.line,R=0,T=0;T<o;T++)R+=t.getLine(T).split(r).length-1;var S=t.getLine(o).substring(0,u.ch);return R+=S.split(r).length-1,R},a.onCMBeforeChange=function(t,u){var o=t.getRange(u.from,u.to),R=0;if(u.text.forEach(function(I){R+=I.split(r).length-1}),o&&o.indexOf(r)!=-1){var T=o.split(r).length-1,S=a.getChCountBeforeCursor(t,u.from);console.log("\u5220\u9664".concat(T,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(S,"\u4E2A\uFF0C\u65B0\u589E").concat(R,"\u4E2A")),a.props.deleteEmptyDisabled?u.cancel():a.props.onPlaceholderChange&&a.props.onPlaceholderChange(S,T,R)}else if(R){var D=a.getChCountBeforeCursor(t,u.from);console.log("\u65B0\u589E".concat(R,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(D,"\u4E2A")),a.props.onPlaceholderChange&&a.props.onPlaceholderChange(D,0,R)}},a}return Object(U.a)(p,[{key:"render",value:function(){return Y.a.createElement(X.a,Object(ne.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),p}(M.Component)},lZu9:function(Et,Pe,F){(function(ne){ne(F("VrN/"),F("1eCo"),F("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function(Q,U){var Z=ne.getMode(Q,"text/html"),G=Z.name=="null";function M(k){if(ne.findModeByName){var y=ne.findModeByName(k);y&&(k=y.mime||y.mimes[0])}var H=ne.getMode(Q,k);return H.name=="null"?null:H}U.highlightFormatting===void 0&&(U.highlightFormatting=!1),U.maxBlockquoteDepth===void 0&&(U.maxBlockquoteDepth=0),U.taskLists===void 0&&(U.taskLists=!1),U.strikethrough===void 0&&(U.strikethrough=!1),U.emoji===void 0&&(U.emoji=!1),U.fencedCodeBlockHighlighting===void 0&&(U.fencedCodeBlockHighlighting=!0),U.fencedCodeBlockDefaultMode===void 0&&(U.fencedCodeBlockDefaultMode="text/plain"),U.xml===void 0&&(U.xml=!0),U.tokenTypeOverrides===void 0&&(U.tokenTypeOverrides={});var Y={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 X in Y)Y.hasOwnProperty(X)&&U.tokenTypeOverrides[X]&&(Y[X]=U.tokenTypeOverrides[X]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,A=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,m=/^\[(x| )\](?=\s)/i,f=U.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,a=/^[^#!\[\]*_\\<>` "'(~:]+/,c=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,s=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,t=" ";function u(k,y,H){return y.f=y.inline=H,H(k,y)}function o(k,y,H){return y.f=y.block=H,H(k,y)}function R(k){return!k||!/\S/.test(k.string)}function T(k){if(k.linkTitle=!1,k.linkHref=!1,k.linkText=!1,k.em=!1,k.strong=!1,k.strikethrough=!1,k.quote=0,k.indentedCode=!1,k.f==D){var y=G;if(!y){var H=ne.innerMode(Z,k.htmlState);y=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}y&&(k.f=g,k.block=S,k.htmlState=null)}return k.trailingSpace=0,k.trailingSpaceNewLine=!1,k.prevLine=k.thisLine,k.thisLine={stream:null},null}function S(k,y){var H=k.column()===y.indentation,J=R(y.prevLine.stream),se=y.indentedCode,fe=y.prevLine.hr,ve=y.list!==!1,Se=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var Ue=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,ve)){for(y.list=null;Ue<y.listStack[y.listStack.length-1];)y.listStack.pop(),y.listStack.length?y.indentation=y.listStack[y.listStack.length-1]:y.list=!1;y.list!==!1&&(y.indentationDiff=Ue-y.listStack[y.listStack.length-1])}var Te=!J&&!fe&&!y.prevLine.header&&(!ve||!se)&&!y.prevLine.fencedCodeEnd,Ie=(y.list===!1||fe||J)&&y.indentation<=Se&&k.match(r),be=null;if(y.indentationDiff>=4&&(se||y.prevLine.fencedCodeEnd||y.prevLine.header||J))return k.skipToEnd(),y.indentedCode=!0,Y.code;if(k.eatSpace())return null;if(H&&y.indentation<=Se&&(be=k.match(f))&&be[1].length<=6)return y.quote=0,y.header=be[1].length,y.thisLine.header=!0,U.highlightFormatting&&(y.formatting="header"),y.f=y.inline,E(y);if(y.indentation<=Se&&k.eat(">"))return y.quote=H?1:y.quote+1,U.highlightFormatting&&(y.formatting="quote"),k.eatSpace(),E(y);if(!Ie&&!y.setext&&H&&y.indentation<=Se&&(be=k.match(A))){var q=be[1]?"ol":"ul";return y.indentation=Ue+k.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,U.taskLists&&k.match(m,!1)&&(y.taskList=!0),y.f=y.inline,U.highlightFormatting&&(y.formatting=["list","list-"+q]),E(y)}else{if(H&&y.indentation<=Se&&(be=k.match(c,!0)))return y.quote=0,y.fencedEndRE=new RegExp(be[1]+"+ *$"),y.localMode=U.fencedCodeBlockHighlighting&&M(be[2]||U.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=ne.startState(y.localMode)),y.f=y.block=I,U.highlightFormatting&&(y.formatting="code-block"),y.code=-1,E(y);if(y.setext||(!Te||!ve)&&!y.quote&&y.list===!1&&!y.code&&!Ie&&!s.test(k.string)&&(be=k.lookAhead(1))&&(be=be.match(p)))return y.setext?(y.header=y.setext,y.setext=0,k.skipToEnd(),U.highlightFormatting&&(y.formatting="header")):(y.header=be[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,E(y);if(Ie)return k.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,Y.hr;if(k.peek()==="[")return u(k,y,W)}return u(k,y,y.inline)}function D(k,y){var H=Z.token(k,y.htmlState);if(!G){var J=ne.innerMode(Z,y.htmlState);(J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText||y.md_inside&&k.current().indexOf(">")>-1)&&(y.f=g,y.block=S,y.htmlState=null)}return H}function I(k,y){var H=y.listStack[y.listStack.length-1]||0,J=y.indentation<H,se=H+3;if(y.fencedEndRE&&y.indentation<=se&&(J||k.match(y.fencedEndRE))){U.highlightFormatting&&(y.formatting="code-block");var fe;return J||(fe=E(y)),y.localMode=y.localState=null,y.block=S,y.f=g,y.fencedEndRE=null,y.code=0,y.thisLine.fencedCodeEnd=!0,J?o(k,y,y.block):fe}else return y.localMode?y.localMode.token(k,y.localState):(k.skipToEnd(),Y.code)}function E(k){var y=[];if(k.formatting){y.push(Y.formatting),typeof k.formatting=="string"&&(k.formatting=[k.formatting]);for(var H=0;H<k.formatting.length;H++)y.push(Y.formatting+"-"+k.formatting[H]),k.formatting[H]==="header"&&y.push(Y.formatting+"-"+k.formatting[H]+"-"+k.header),k.formatting[H]==="quote"&&(!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=k.quote?y.push(Y.formatting+"-"+k.formatting[H]+"-"+k.quote):y.push("error"))}if(k.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(k.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(k.linkHref?y.push(Y.linkHref,"url"):(k.strong&&y.push(Y.strong),k.em&&y.push(Y.em),k.strikethrough&&y.push(Y.strikethrough),k.emoji&&y.push(Y.emoji),k.linkText&&y.push(Y.linkText),k.code&&y.push(Y.code),k.image&&y.push(Y.image),k.imageAltText&&y.push(Y.imageAltText,"link"),k.imageMarker&&y.push(Y.imageMarker)),k.header&&y.push(Y.header,Y.header+"-"+k.header),k.quote&&(y.push(Y.quote),!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=k.quote?y.push(Y.quote+"-"+k.quote):y.push(Y.quote+"-"+U.maxBlockquoteDepth)),k.list!==!1){var J=(k.listStack.length-1)%3;J?J===1?y.push(Y.list2):y.push(Y.list3):y.push(Y.list1)}return k.trailingSpaceNewLine?y.push("trailing-space-new-line"):k.trailingSpace&&y.push("trailing-space-"+(k.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function x(k,y){return k.match(a,!0)?E(y):void 0}function g(k,y){var H=y.text(k,y);if(typeof H!="undefined")return H;if(y.list)return y.list=null,E(y);if(y.taskList){var J=k.match(m,!0)[1]===" ";return J?y.taskOpen=!0:y.taskClosed=!0,U.highlightFormatting&&(y.formatting="task"),y.taskList=!1,E(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&k.match(/^#+$/,!0))return U.highlightFormatting&&(y.formatting="header"),E(y);var se=k.next();if(y.linkTitle){y.linkTitle=!1;var fe=se;se==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ve="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(k.match(new RegExp(ve),!0))return Y.linkHref}if(se==="`"){var Se=y.formatting;U.highlightFormatting&&(y.formatting="code"),k.eatWhile("`");var Ue=k.current().length;if(y.code==0&&(!y.quote||Ue==1))return y.code=Ue,E(y);if(Ue==y.code){var Te=E(y);return y.code=0,Te}else return y.formatting=Se,E(y)}else if(y.code)return E(y);if(se==="\\"&&(k.next(),U.highlightFormatting)){var Ie=E(y),be=Y.formatting+"-escape";return Ie?Ie+" "+be:be}if(se==="!"&&k.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,U.highlightFormatting&&(y.formatting="image"),E(y);if(se==="["&&y.imageMarker&&k.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,U.highlightFormatting&&(y.formatting="image"),E(y);if(se==="]"&&y.imageAltText){U.highlightFormatting&&(y.formatting="image");var Ie=E(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=O,Ie}if(se==="["&&!y.image)return y.linkText&&k.match(/^.*?\]/)||(y.linkText=!0,U.highlightFormatting&&(y.formatting="link")),E(y);if(se==="]"&&y.linkText){U.highlightFormatting&&(y.formatting="link");var Ie=E(y);return y.linkText=!1,y.inline=y.f=k.match(/\(.*?\)| ?\[.*?\]/,!1)?O:g,Ie}if(se==="<"&&k.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=h,U.highlightFormatting&&(y.formatting="link");var Ie=E(y);return Ie?Ie+=" ":Ie="",Ie+Y.linkInline}if(se==="<"&&k.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=h,U.highlightFormatting&&(y.formatting="link");var Ie=E(y);return Ie?Ie+=" ":Ie="",Ie+Y.linkEmail}if(U.xml&&se==="<"&&k.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var q=k.string.indexOf(">",k.pos);if(q!=-1){var _=k.string.substring(k.start,q);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(_)&&(y.md_inside=!0)}return k.backUp(1),y.htmlState=ne.startState(Z),o(k,y,D)}if(U.xml&&se==="<"&&k.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(se==="*"||se==="_"){for(var L=1,z=k.pos==1?" ":k.string.charAt(k.pos-2);L<3&&k.eat(se);)L++;var ee=k.peek()||" ",$=!/\s/.test(ee)&&(!i.test(ee)||/\s/.test(z)||i.test(z)),Ee=!/\s/.test(z)&&(!i.test(z)||/\s/.test(ee)||i.test(ee)),Be=null,nt=null;if(L%2&&(!y.em&&$&&(se==="*"||!Ee||i.test(z))?Be=!0:y.em==se&&Ee&&(se==="*"||!$||i.test(ee))&&(Be=!1)),L>1&&(!y.strong&&$&&(se==="*"||!Ee||i.test(z))?nt=!0:y.strong==se&&Ee&&(se==="*"||!$||i.test(ee))&&(nt=!1)),nt!=null||Be!=null){U.highlightFormatting&&(y.formatting=Be==null?"strong":nt==null?"em":"strong em"),Be===!0&&(y.em=se),nt===!0&&(y.strong=se);var Te=E(y);return Be===!1&&(y.em=!1),nt===!1&&(y.strong=!1),Te}}else if(se===" "&&(k.eat("*")||k.eat("_"))){if(k.peek()===" ")return E(y);k.backUp(1)}if(U.strikethrough){if(se==="~"&&k.eatWhile(se)){if(y.strikethrough){U.highlightFormatting&&(y.formatting="strikethrough");var Te=E(y);return y.strikethrough=!1,Te}else if(k.match(/^[^\s]/,!1))return y.strikethrough=!0,U.highlightFormatting&&(y.formatting="strikethrough"),E(y)}else if(se===" "&&k.match(/^~~/,!0)){if(k.peek()===" ")return E(y);k.backUp(2)}}if(U.emoji&&se===":"&&k.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,U.highlightFormatting&&(y.formatting="emoji");var we=E(y);return y.emoji=!1,we}return se===" "&&(k.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),E(y)}function h(k,y){var H=k.next();if(H===">"){y.f=y.inline=g,U.highlightFormatting&&(y.formatting="link");var J=E(y);return J?J+=" ":J="",J+Y.linkInline}return k.match(/^[^>]+/,!0),Y.linkInline}function O(k,y){if(k.eatSpace())return null;var H=k.next();return H==="("||H==="["?(y.f=y.inline=b(H==="("?")":"]"),U.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,E(y)):"error"}var w={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(k){return function(y,H){var J=y.next();if(J===k){H.f=H.inline=g,U.highlightFormatting&&(H.formatting="link-string");var se=E(H);return H.linkHref=!1,se}return y.match(w[k]),H.linkHref=!0,E(H)}}function W(k,y){return k.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=j,k.next(),U.highlightFormatting&&(y.formatting="link"),y.linkText=!0,E(y)):u(k,y,g)}function j(k,y){if(k.match(/^\]:/,!0)){y.f=y.inline=C,U.highlightFormatting&&(y.formatting="link");var H=E(y);return y.linkText=!1,H}return k.match(/^([^\]\\]|\\.)+/,!0),Y.linkText}function C(k,y){return k.eatSpace()?null:(k.match(/^[^\s]+/,!0),k.peek()===void 0?y.linkTitle=!0:k.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),y.f=y.inline=g,Y.linkHref+" url")}var B={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:g,text:x,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(k){return{f:k.f,prevLine:k.prevLine,thisLine:k.thisLine,block:k.block,htmlState:k.htmlState&&ne.copyState(Z,k.htmlState),indentation:k.indentation,localMode:k.localMode,localState:k.localMode?ne.copyState(k.localMode,k.localState):null,inline:k.inline,text:k.text,formatting:!1,linkText:k.linkText,linkTitle:k.linkTitle,linkHref:k.linkHref,code:k.code,em:k.em,strong:k.strong,strikethrough:k.strikethrough,emoji:k.emoji,header:k.header,setext:k.setext,hr:k.hr,taskList:k.taskList,list:k.list,listStack:k.listStack.slice(0),quote:k.quote,indentedCode:k.indentedCode,trailingSpace:k.trailingSpace,trailingSpaceNewLine:k.trailingSpaceNewLine,md_inside:k.md_inside,fencedEndRE:k.fencedEndRE}},token:function(k,y){if(y.formatting=!1,k!=y.thisLine.stream){if(y.header=0,y.hr=!1,k.match(/^\s*$/,!0))return T(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:k},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=D)){var H=k.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(y.indentation=H,y.indentationDiff=null,H>0)return null}}return y.f(k,y)},innerMode:function(k){return k.block==D?{state:k.htmlState,mode:Z}:k.localState?{state:k.localState,mode:k.localMode}:{state:k,mode:B}},indent:function(k,y,H){return k.block==D&&Z.indent?Z.indent(k.htmlState,y,H):k.localState&&k.localMode.indent?k.localMode.indent(k.localState,y,H):ne.Pass},blankLine:T,getType:E,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return B},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},loLm:function(Et,Pe,F){Et.exports={flex_box_center:"flex_box_center___Ea2v9",flex_space_between:"flex_space_between___1bTGw",flex_box_vertical_center:"flex_box_vertical_center___2J4zW",flex_box_center_end:"flex_box_center_end___9_5OK",flex_box_column:"flex_box_column___2FLgO",posWarp:"posWarp___3pf1n",pos:"pos___3-NfR",tips:"tips___2-j_s",markWrongBtnWrapper:"markWrongBtnWrapper___37HXF"}},n6Qo:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return X});var ne=F("q1tI"),Q=F("biw7"),U=F("fyJ8");function Z(r){var A=r.className,m=r.index,f=r.children,p=r.colSpan,a=r.rowSpan,c=ne.useContext(Q.a),s=c.prefixCls,i=c.fixedInfoList,t=i[m];return ne.createElement(U.a,Object.assign({className:A,index:m,component:"td",prefixCls:s,record:null,dataIndex:null,render:function(){return{children:f,props:{colSpan:p,rowSpan:a}}}},t))}function G(r){return ne.createElement("tr",Object.assign({},r))}function M(r){var A=r.children,m=ne.useContext(Q.a),f=m.prefixCls;return ne.createElement("tfoot",{className:"".concat(f,"-summary")},A)}var Y=Pe.b=M,X={Cell:Z,Row:G}},nEHx:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return ne});var ne;(function(Q){Q.DARK="dark",Q.LIGHT="light",Q.HIGH_CONTRAST="hc"})(ne||(ne={}))},ngQI:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Ul}),F.d(Pe,"b",function(){return yl}),F.d(Pe,"c",function(){return bl});var ne=F("q1tI"),Q=F.n(ne),U=F("dI71"),Z=F("wx14"),G=F("ANjH"),M=F("/MKj");function Y(P,N){if(P.length!==N.length)return!1;for(var V=0;V<P.length;V++)if(P[V]!==N[V])return!1;return!0}function X(P,N){var V=Object(ne.useState)(function(){return{inputs:N,result:P()}})[0],re=Object(ne.useRef)(!0),ce=Object(ne.useRef)(V),he=re.current||Boolean(N&&ce.current.inputs&&Y(N,ce.current.inputs)),Oe=he?ce.current:{inputs:N,result:P()};return Object(ne.useEffect)(function(){re.current=!1,ce.current=Oe},[Oe]),Oe.result}function r(P,N){return X(function(){return P},N)}var A=X,m=r,f=F("9R94"),p=function(N){var V=N.top,re=N.right,ce=N.bottom,he=N.left,Oe=re-he,Ae=ce-V,Ke={top:V,right:re,bottom:ce,left:he,width:Oe,height:Ae,x:he,y:V,center:{x:(re+he)/2,y:(ce+V)/2}};return Ke},a=function(N,V){return{top:N.top-V.top,left:N.left-V.left,bottom:N.bottom+V.bottom,right:N.right+V.right}},c=function(N,V){return{top:N.top+V.top,left:N.left+V.left,bottom:N.bottom-V.bottom,right:N.right-V.right}},s=function(N,V){return{top:N.top+V.y,left:N.left+V.x,bottom:N.bottom+V.y,right:N.right+V.x}},i={top:0,right:0,bottom:0,left:0},t=function(N){var V=N.borderBox,re=N.margin,ce=re===void 0?i:re,he=N.border,Oe=he===void 0?i:he,Ae=N.padding,Ke=Ae===void 0?i:Ae,tt=p(a(V,ce)),it=p(c(V,Oe)),ze=p(c(it,Ke));return{marginBox:tt,borderBox:p(V),paddingBox:it,contentBox:ze,margin:ce,border:Oe,padding:Ke}},u=function(N){var V=N.slice(0,-2),re=N.slice(-2);if(re!=="px")return 0;var ce=Number(V);return isNaN(ce)&&Object(f.a)(!1),ce},o=function(){return{x:window.pageXOffset,y:window.pageYOffset}},R=function(N,V){var re=N.borderBox,ce=N.border,he=N.margin,Oe=N.padding,Ae=s(re,V);return t({borderBox:Ae,border:ce,margin:he,padding:Oe})},T=function(N,V){return V===void 0&&(V=o()),R(N,V)},S=function(N,V){var re={top:u(V.marginTop),right:u(V.marginRight),bottom:u(V.marginBottom),left:u(V.marginLeft)},ce={top:u(V.paddingTop),right:u(V.paddingRight),bottom:u(V.paddingBottom),left:u(V.paddingLeft)},he={top:u(V.borderTopWidth),right:u(V.borderRightWidth),bottom:u(V.borderBottomWidth),left:u(V.borderLeftWidth)};return t({borderBox:N,margin:re,padding:ce,border:he})},D=function(N){var V=N.getBoundingClientRect(),re=window.getComputedStyle(N);return S(V,re)},I=Number.isNaN||function(N){return typeof N=="number"&&N!==N};function E(P,N){return P===N?!0:!!(I(P)&&I(N))}function x(P,N){if(P.length!==N.length)return!1;for(var V=0;V<P.length;V++)if(!E(P[V],N[V]))return!1;return!0}function g(P,N){N===void 0&&(N=x);var V,re=[],ce,he=!1;function Oe(){for(var Ae=[],Ke=0;Ke<arguments.length;Ke++)Ae[Ke]=arguments[Ke];return he&&V===this&&N(Ae,re)||(ce=P.apply(this,Ae),he=!0,V=this,re=Ae),ce}return Oe}var h=g,O=function(N){var V=[],re=null,ce=function(){for(var Oe=arguments.length,Ae=new Array(Oe),Ke=0;Ke<Oe;Ke++)Ae[Ke]=arguments[Ke];if(V=Ae,re)return;re=requestAnimationFrame(function(){re=null,N.apply(void 0,V)})};return ce.cancel=function(){if(!re)return;cancelAnimationFrame(re),re=null},ce},w=O,b=F("i8i4"),W=F.n(b),j=!0,C=/[ \t]{2,}/g,B=/^[ \t]*/gm,k=function(N){return N.replace(C," ").replace(B,"").trim()},y=function(N){return k(`
%creact-beautiful-dnd
%c`+k(N)+`
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
`)},H=function(N){return[y(N),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},J="__react-beautiful-dnd-disable-dev-warnings";function se(P,N){var V;if(j)return;if(typeof window!="undefined"&&window[J])return;(V=console)[P].apply(V,H(N))}var fe=se.bind(null,"warn"),ve=se.bind(null,"error");function Se(){}function Ue(P,N){return Object(Z.a)({},P,{},N)}function Te(P,N,V){var re=N.map(function(ce){var he=Ue(V,ce.options);return P.addEventListener(ce.eventName,ce.fn,he),function(){P.removeEventListener(ce.eventName,ce.fn,he)}});return function(){re.forEach(function(he){he()})}}var Ie=!0,be="Invariant failed";function q(P){this.message=P}q.prototype.toString=function(){return this.message};function _(P,N){if(P)return;throw Ie?new q(be):new q(be+": "+(N||""))}var L=function(P){Object(U.a)(N,P);function N(){for(var re,ce=arguments.length,he=new Array(ce),Oe=0;Oe<ce;Oe++)he[Oe]=arguments[Oe];return re=P.call.apply(P,[this].concat(he))||this,re.callbacks=null,re.unbind=Se,re.onWindowError=function(Ae){var Ke=re.getCallbacks();Ke.isDragging()&&Ke.tryAbort();var tt=Ae.error;tt instanceof q&&Ae.preventDefault()},re.getCallbacks=function(){if(!re.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return re.callbacks},re.setCallbacks=function(Ae){re.callbacks=Ae},re}var V=N.prototype;return V.componentDidMount=function(){this.unbind=Te(window,[{eventName:"error",fn:this.onWindowError}])},V.componentWillUnmount=function(){this.unbind()},V.componentDidCatch=function(ce){if(ce instanceof q){this.setState({});return}throw ce},V.render=function(){return this.props.children(this.setCallbacks)},N}(Q.a.Component),z=`
Press space bar to start a drag.
When dragging you can use the arrow keys to move the item around and escape to cancel.
Some screen readers may require you to be in focus mode or to use your pass through key
`,ee=function(N){return N+1},$=function(N){return`
You have lifted an item in position `+ee(N.source.index)+`
`},Ee=function(N,V){var re=N.droppableId===V.droppableId,ce=ee(N.index),he=ee(V.index);return re?`
You have moved the item from position `+ce+`
to position `+he+`
`:`
You have moved the item from position `+ce+`
in list `+N.droppableId+`
to list `+V.droppableId+`
in position `+he+`
`},Be=function(N,V,re){var ce=V.droppableId===re.droppableId;return ce?`
The item `+N+`
has been combined with `+re.draggableId:`
The item `+N+`
in list `+V.droppableId+`
has been combined with `+re.draggableId+`
in list `+re.droppableId+`
`},nt=function(N){var V=N.destination;if(V)return Ee(N.source,V);var re=N.combine;return re?Be(N.draggableId,N.source,re):"You are over an area that cannot be dropped on"},we=function(N){return`
The item has returned to its starting position
of `+ee(N.index)+`
`},Ne=function(N){if(N.reason==="CANCEL")return`
Movement cancelled.
`+we(N.source)+`
`;var V=N.destination,re=N.combine;return V?`
You have dropped the item.
`+Ee(N.source,V)+`
`:re?`
You have dropped the item.
`+Be(N.draggableId,N.source,re)+`
`:`
The item has been dropped while not over a drop area.
`+we(N.source)+`
`},Ye={dragHandleUsageInstructions:z,onDragStart:$,onDragUpdate:nt,onDragEnd:Ne},Xe={x:0,y:0},ht=function(N,V){return{x:N.x+V.x,y:N.y+V.y}},wt=function(N,V){return{x:N.x-V.x,y:N.y-V.y}},Bt=function(N,V){return N.x===V.x&&N.y===V.y},Wt=function(N){return{x:N.x!==0?-N.x:0,y:N.y!==0?-N.y:0}},an=function(N,V,re){var ce;return re===void 0&&(re=0),ce={},ce[N]=V,ce[N==="x"?"y":"x"]=re,ce},Yt=function(N,V){return Math.sqrt(Math.pow(V.x-N.x,2)+Math.pow(V.y-N.y,2))},qe=function(N,V){return Math.min.apply(Math,V.map(function(re){return Yt(N,re)}))},Qe=function(N){return function(V){return{x:N(V.x),y:N(V.y)}}},bt=function(P,N){var V=p({top:Math.max(N.top,P.top),right:Math.min(N.right,P.right),bottom:Math.min(N.bottom,P.bottom),left:Math.max(N.left,P.left)});return V.width<=0||V.height<=0?null:V},xt=function(N,V){return{top:N.top+V.y,left:N.left+V.x,bottom:N.bottom+V.y,right:N.right+V.x}},ye=function(N){return[{x:N.left,y:N.top},{x:N.right,y:N.top},{x:N.left,y:N.bottom},{x:N.right,y:N.bottom}]},ae={top:0,right:0,bottom:0,left:0},le=function(N,V){return V?xt(N,V.scroll.diff.displacement):N},me=function(N,V,re){if(re&&re.increasedBy){var ce;return Object(Z.a)({},N,(ce={},ce[V.end]=N[V.end]+re.increasedBy[V.line],ce))}return N},Ce=function(N,V){return V&&V.shouldClipSubject?bt(V.pageMarginBox,N):p(N)},de=function(P){var N=P.page,V=P.withPlaceholder,re=P.axis,ce=P.frame,he=le(N.marginBox,ce),Oe=me(he,re,V),Ae=Ce(Oe,ce);return{page:N,withPlaceholder:V,active:Ae}},pe=function(P,N){P.frame||_(!1);var V=P.frame,re=wt(N,V.scroll.initial),ce=Wt(re),he=Object(Z.a)({},V,{scroll:{initial:V.scroll.initial,current:N,diff:{value:re,displacement:ce},max:V.scroll.max}}),Oe=de({page:P.subject.page,withPlaceholder:P.subject.withPlaceholder,axis:P.axis,frame:he}),Ae=Object(Z.a)({},P,{frame:he,subject:Oe});return Ae};function De(P){return Number.isInteger?Number.isInteger(P):typeof P=="number"&&isFinite(P)&&Math.floor(P)===P}function ue(P){return Object.values?Object.values(P):Object.keys(P).map(function(N){return P[N]})}function Me(P,N){if(P.findIndex)return P.findIndex(N);for(var V=0;V<P.length;V++)if(N(P[V]))return V;return-1}function We(P,N){if(P.find)return P.find(N);var V=Me(P,N);return V!==-1?P[V]:void 0}function lt(P){return Array.prototype.slice.call(P)}var Ct=h(function(P){return P.reduce(function(N,V){return N[V.descriptor.id]=V,N},{})}),Ot=h(function(P){return P.reduce(function(N,V){return N[V.descriptor.id]=V,N},{})}),Nt=h(function(P){return ue(P)}),ir=h(function(P){return ue(P)}),Jt=h(function(P,N){var V=ir(N).filter(function(re){return P===re.descriptor.droppableId}).sort(function(re,ce){return re.descriptor.index-ce.descriptor.index});return V});function cn(P){return P.at&&P.at.type==="REORDER"?P.at.destination:null}function rn(P){return P.at&&P.at.type==="COMBINE"?P.at.combine:null}var In=h(function(P,N){return N.filter(function(V){return V.descriptor.id!==P.descriptor.id})}),ur=function(P){var N=P.isMovingForward,V=P.draggable,re=P.destination,ce=P.insideDestination,he=P.previousImpact;if(!re.isCombineEnabled)return null;var Oe=cn(he);if(!Oe)return null;function Ae(gn){var xn={type:"COMBINE",combine:{draggableId:gn,droppableId:re.descriptor.id}};return Object(Z.a)({},he,{at:xn})}var Ke=he.displaced.all,tt=Ke.length?Ke[0]:null;if(N)return tt?Ae(tt):null;var it=In(V,ce);if(!tt){if(!it.length)return null;var ze=it[it.length-1];return Ae(ze.descriptor.id)}var Ge=Me(it,function(gn){return gn.descriptor.id===tt});Ge!==-1||_(!1);var Je=Ge-1;if(Je<0)return null;var _t=it[Je];return Ae(_t.descriptor.id)},mr=function(P,N){return P.descriptor.droppableId===N.descriptor.id},Qn={point:Xe,value:0},yr={invisible:{},visible:{},all:[]},Sr={displaced:yr,displacedBy:Qn,at:null},Nn=function(P,N){return function(V){return P<=V&&V<=N}},Ar=function(P){var N=Nn(P.top,P.bottom),V=Nn(P.left,P.right);return function(re){var ce=N(re.top)&&N(re.bottom)&&V(re.left)&&V(re.right);if(ce)return!0;var he=N(re.top)||N(re.bottom),Oe=V(re.left)||V(re.right),Ae=he&&Oe;if(Ae)return!0;var Ke=re.top<P.top&&re.bottom>P.bottom,tt=re.left<P.left&&re.right>P.right,it=Ke&&tt;if(it)return!0;var ze=Ke&&Oe||tt&&he;return ze}},An=function(P){var N=Nn(P.top,P.bottom),V=Nn(P.left,P.right);return function(re){var ce=N(re.top)&&N(re.bottom)&&V(re.left)&&V(re.right);return ce}},Dn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},qn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},fr=function(P){return function(N){var V=Nn(N.top,N.bottom),re=Nn(N.left,N.right);return function(ce){return P===Dn?V(ce.top)&&V(ce.bottom):re(ce.left)&&re(ce.right)}}},Lr=function(N,V){var re=V.frame?V.frame.scroll.diff.displacement:Xe;return xt(N,re)},Or=function(N,V,re){return V.subject.active?re(V.subject.active)(N):!1},at=function(N,V,re){return re(V)(N)},Fe=function(N){var V=N.target,re=N.destination,ce=N.viewport,he=N.withDroppableDisplacement,Oe=N.isVisibleThroughFrameFn,Ae=he?Lr(V,re):V;return Or(Ae,re,Oe)&&at(Ae,ce,Oe)},pt=function(N){return Fe(Object(Z.a)({},N,{isVisibleThroughFrameFn:Ar}))},Le=function(N){return Fe(Object(Z.a)({},N,{isVisibleThroughFrameFn:An}))},xe=function(N){return Fe(Object(Z.a)({},N,{isVisibleThroughFrameFn:fr(N.destination.axis)}))},ge=function(N,V,re){if(typeof re=="boolean")return re;if(!V)return!0;var ce=V.invisible,he=V.visible;if(ce[N])return!1;var Oe=he[N];return Oe?Oe.shouldAnimate:!0};function Hn(P,N){var V=P.page.marginBox,re={top:N.point.y,right:0,bottom:0,left:N.point.x};return p(a(V,re))}function Lt(P){var N=P.afterDragging,V=P.destination,re=P.displacedBy,ce=P.viewport,he=P.forceShouldAnimate,Oe=P.last;return N.reduce(function(Ke,tt){var it=Hn(tt,re),ze=tt.descriptor.id;Ke.all.push(ze);var Ge=pt({target:it,destination:V,viewport:ce,withDroppableDisplacement:!0});if(!Ge)return Ke.invisible[tt.descriptor.id]=!0,Ke;var Je=ge(ze,Oe,he),_t={draggableId:ze,shouldAnimate:Je};return Ke.visible[ze]=_t,Ke},{all:[],visible:{},invisible:{}})}function ke(P,N){if(!P.length)return 0;var V=P[P.length-1].descriptor.index;return N.inHomeList?V:V+1}function ut(P){var N=P.insideDestination,V=P.inHomeList,re=P.displacedBy,ce=P.destination,he=ke(N,{inHomeList:V});return{displaced:yr,displacedBy:re,at:{type:"REORDER",destination:{droppableId:ce.descriptor.id,index:he}}}}function Re(P){var N=P.draggable,V=P.insideDestination,re=P.destination,ce=P.viewport,he=P.displacedBy,Oe=P.last,Ae=P.index,Ke=P.forceShouldAnimate,tt=mr(N,re);if(Ae==null)return ut({insideDestination:V,inHomeList:tt,displacedBy:he,destination:re});var it=We(V,function(gn){return gn.descriptor.index===Ae});if(!it)return ut({insideDestination:V,inHomeList:tt,displacedBy:he,destination:re});var ze=In(N,V),Ge=V.indexOf(it),Je=ze.slice(Ge),_t=Lt({afterDragging:Je,destination:re,displacedBy:he,last:Oe,viewport:ce.frame,forceShouldAnimate:Ke});return{displaced:_t,displacedBy:he,at:{type:"REORDER",destination:{droppableId:re.descriptor.id,index:Ae}}}}function tn(P,N){return Boolean(N.effected[P])}var cr=function(P){var N=P.isMovingForward,V=P.destination,re=P.draggables,ce=P.combine,he=P.afterCritical;if(!V.isCombineEnabled)return null;var Oe=ce.draggableId,Ae=re[Oe],Ke=Ae.descriptor.index,tt=tn(Oe,he);return tt?N?Ke:Ke-1:N?Ke+1:Ke},pr=function(P){var N=P.isMovingForward,V=P.isInHomeList,re=P.insideDestination,ce=P.location;if(!re.length)return null;var he=ce.index,Oe=N?he+1:he-1,Ae=re[0].descriptor.index,Ke=re[re.length-1].descriptor.index,tt=V?Ke:Ke+1;return Oe<Ae||Oe>tt?null:Oe},Kn=function(P){var N=P.isMovingForward,V=P.isInHomeList,re=P.draggable,ce=P.draggables,he=P.destination,Oe=P.insideDestination,Ae=P.previousImpact,Ke=P.viewport,tt=P.afterCritical,it=Ae.at;if(it||_(!1),it.type==="REORDER"){var ze=pr({isMovingForward:N,isInHomeList:V,location:it.destination,insideDestination:Oe});return ze==null?null:Re({draggable:re,insideDestination:Oe,destination:he,viewport:Ke,last:Ae.displaced,displacedBy:Ae.displacedBy,index:ze})}var Ge=cr({isMovingForward:N,destination:he,displaced:Ae.displaced,draggables:ce,combine:it.combine,afterCritical:tt});return Ge==null?null:Re({draggable:re,insideDestination:Oe,destination:he,viewport:Ke,last:Ae.displaced,displacedBy:Ae.displacedBy,index:Ge})},jt=function(P){var N=P.displaced,V=P.afterCritical,re=P.combineWith,ce=P.displacedBy,he=Boolean(N.visible[re]||N.invisible[re]);return tn(re,V)?he?Xe:Wt(ce.point):he?ce.point:Xe},dr=function(P){var N=P.afterCritical,V=P.impact,re=P.draggables,ce=rn(V);ce||_(!1);var he=ce.draggableId,Oe=re[he].page.borderBox.center,Ae=jt({displaced:V.displaced,afterCritical:N,combineWith:he,displacedBy:V.displacedBy});return ht(Oe,Ae)},ct=function(N,V){return V.margin[N.start]+V.borderBox[N.size]/2},Un=function(N,V){return V.margin[N.end]+V.borderBox[N.size]/2},yn=function(N,V,re){return V[N.crossAxisStart]+re.margin[N.crossAxisStart]+re.borderBox[N.crossAxisSize]/2},ln=function(N){var V=N.axis,re=N.moveRelativeTo,ce=N.isMoving;return an(V.line,re.marginBox[V.end]+ct(V,ce),yn(V,re.marginBox,ce))},Xt=function(N){var V=N.axis,re=N.moveRelativeTo,ce=N.isMoving;return an(V.line,re.marginBox[V.start]-Un(V,ce),yn(V,re.marginBox,ce))},Pn=function(N){var V=N.axis,re=N.moveInto,ce=N.isMoving;return an(V.line,re.contentBox[V.start]+ct(V,ce),yn(V,re.contentBox,ce))},hn=function(P){var N=P.impact,V=P.draggable,re=P.draggables,ce=P.droppable,he=P.afterCritical,Oe=Jt(ce.descriptor.id,re),Ae=V.page,Ke=ce.axis;if(!Oe.length)return Pn({axis:Ke,moveInto:ce.page,isMoving:Ae});var tt=N.displaced,it=N.displacedBy,ze=tt.all[0];if(ze){var Ge=re[ze];if(tn(ze,he))return Xt({axis:Ke,moveRelativeTo:Ge.page,isMoving:Ae});var Je=R(Ge.page,it.point);return Xt({axis:Ke,moveRelativeTo:Je,isMoving:Ae})}var _t=Oe[Oe.length-1];if(_t.descriptor.id===V.descriptor.id)return Ae.borderBox.center;if(tn(_t.descriptor.id,he)){var gn=R(_t.page,Wt(he.displacedBy.point));return ln({axis:Ke,moveRelativeTo:gn,isMoving:Ae})}return ln({axis:Ke,moveRelativeTo:_t.page,isMoving:Ae})},qt=function(P,N){var V=P.frame;return V?ht(N,V.scroll.diff.displacement):N},Mt=function(N){var V=N.impact,re=N.draggable,ce=N.droppable,he=N.draggables,Oe=N.afterCritical,Ae=re.page.borderBox.center,Ke=V.at;return ce&&Ke?Ke.type==="REORDER"?hn({impact:V,draggable:re,draggables:he,droppable:ce,afterCritical:Oe}):dr({impact:V,draggables:he,afterCritical:Oe}):Ae},Kt=function(P){var N=Mt(P),V=P.droppable,re=V?qt(V,N):N;return re},ar=function(P,N){var V=wt(N,P.scroll.initial),re=Wt(V),ce=p({top:N.y,bottom:N.y+P.frame.height,left:N.x,right:N.x+P.frame.width}),he={frame:ce,scroll:{initial:P.scroll.initial,max:P.scroll.max,current:N,diff:{value:V,displacement:re}}};return he};function sr(P,N){return P.map(function(V){return N[V]})}function Fn(P,N){for(var V=0;V<N.length;V++){var re=N[V].visible[P];if(re)return re}return null}var bn=function(P){var N=P.impact,V=P.viewport,re=P.destination,ce=P.draggables,he=P.maxScrollChange,Oe=ar(V,ht(V.scroll.current,he)),Ae=re.frame?pe(re,ht(re.frame.scroll.current,he)):re,Ke=N.displaced,tt=Lt({afterDragging:sr(Ke.all,ce),destination:re,displacedBy:N.displacedBy,viewport:Oe.frame,last:Ke,forceShouldAnimate:!1}),it=Lt({afterDragging:sr(Ke.all,ce),destination:Ae,displacedBy:N.displacedBy,viewport:V.frame,last:Ke,forceShouldAnimate:!1}),ze={},Ge={},Je=[Ke,tt,it];Ke.all.forEach(function(gn){var xn=Fn(gn,Je);if(xn){Ge[gn]=xn;return}ze[gn]=!0});var _t=Object(Z.a)({},N,{displaced:{all:Ke.all,invisible:ze,visible:Ge}});return _t},Ut=function(P,N){return ht(P.scroll.diff.displacement,N)},Vt=function(P){var N=P.pageBorderBoxCenter,V=P.draggable,re=P.viewport,ce=Ut(re,N),he=wt(ce,V.page.borderBox.center);return ht(V.client.borderBox.center,he)},Gt=function(P){var N=P.draggable,V=P.destination,re=P.newPageBorderBoxCenter,ce=P.viewport,he=P.withDroppableDisplacement,Oe=P.onlyOnMainAxis,Ae=Oe===void 0?!1:Oe,Ke=wt(re,N.page.borderBox.center),tt=xt(N.page.borderBox,Ke),it={target:tt,destination:V,withDroppableDisplacement:he,viewport:ce};return Ae?xe(it):Le(it)},Dt=function(P){var N=P.isMovingForward,V=P.draggable,re=P.destination,ce=P.draggables,he=P.previousImpact,Oe=P.viewport,Ae=P.previousPageBorderBoxCenter,Ke=P.previousClientSelection,tt=P.afterCritical;if(!re.isEnabled)return null;var it=Jt(re.descriptor.id,ce),ze=mr(V,re),Ge=ur({isMovingForward:N,draggable:V,destination:re,insideDestination:it,previousImpact:he})||Kn({isMovingForward:N,isInHomeList:ze,draggable:V,draggables:ce,destination:re,insideDestination:it,previousImpact:he,viewport:Oe,afterCritical:tt});if(!Ge)return null;var Je=Kt({impact:Ge,draggable:V,droppable:re,draggables:ce,afterCritical:tt}),_t=Gt({draggable:V,destination:re,newPageBorderBoxCenter:Je,viewport:Oe.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(_t){var gn=Vt({pageBorderBoxCenter:Je,draggable:V,viewport:Oe});return{clientSelection:gn,impact:Ge,scrollJumpRequest:null}}var xn=wt(Je,Ae),$n=bn({impact:Ge,viewport:Oe,destination:re,draggables:ce,maxScrollChange:xn});return{clientSelection:Ke,impact:$n,scrollJumpRequest:xn}},Zn=function(N){var V=N.subject.active;return V||_(!1),V},On=function(P){var N=P.isMovingForward,V=P.pageBorderBoxCenter,re=P.source,ce=P.droppables,he=P.viewport,Oe=re.subject.active;if(!Oe)return null;var Ae=re.axis,Ke=Nn(Oe[Ae.start],Oe[Ae.end]),tt=Nt(ce).filter(function(ze){return ze!==re}).filter(function(ze){return ze.isEnabled}).filter(function(ze){return Boolean(ze.subject.active)}).filter(function(ze){return Ar(he.frame)(Zn(ze))}).filter(function(ze){var Ge=Zn(ze);return N?Oe[Ae.crossAxisEnd]<Ge[Ae.crossAxisEnd]:Ge[Ae.crossAxisStart]<Oe[Ae.crossAxisStart]}).filter(function(ze){var Ge=Zn(ze),Je=Nn(Ge[Ae.start],Ge[Ae.end]);return Ke(Ge[Ae.start])||Ke(Ge[Ae.end])||Je(Oe[Ae.start])||Je(Oe[Ae.end])}).sort(function(ze,Ge){var Je=Zn(ze)[Ae.crossAxisStart],_t=Zn(Ge)[Ae.crossAxisStart];return N?Je-_t:_t-Je}).filter(function(ze,Ge,Je){return Zn(ze)[Ae.crossAxisStart]===Zn(Je[0])[Ae.crossAxisStart]});if(!tt.length)return null;if(tt.length===1)return tt[0];var it=tt.filter(function(ze){var Ge=Nn(Zn(ze)[Ae.start],Zn(ze)[Ae.end]);return Ge(V[Ae.line])});return it.length===1?it[0]:it.length>1?it.sort(function(ze,Ge){return Zn(ze)[Ae.start]-Zn(Ge)[Ae.start]})[0]:tt.sort(function(ze,Ge){var Je=qe(V,ye(Zn(ze))),_t=qe(V,ye(Zn(Ge)));return Je!==_t?Je-_t:Zn(ze)[Ae.start]-Zn(Ge)[Ae.start]})[0]},fn=function(N,V){var re=N.page.borderBox.center;return tn(N.descriptor.id,V)?wt(re,V.displacedBy.point):re},Vn=function(N,V){var re=N.page.borderBox;return tn(N.descriptor.id,V)?xt(re,Wt(V.displacedBy.point)):re},un=function(P){var N=P.pageBorderBoxCenter,V=P.viewport,re=P.destination,ce=P.insideDestination,he=P.afterCritical,Oe=ce.filter(function(Ae){return Le({target:Vn(Ae,he),destination:re,viewport:V.frame,withDroppableDisplacement:!0})}).sort(function(Ae,Ke){var tt=Yt(N,qt(re,fn(Ae,he))),it=Yt(N,qt(re,fn(Ke,he)));return tt<it?-1:it<tt?1:Ae.descriptor.index-Ke.descriptor.index});return Oe[0]||null},_n=h(function(N,V){var re=V[N.line];return{value:re,point:an(N.line,re)}}),Zt=function(N,V,re){var ce=N.axis;if(N.descriptor.mode==="virtual")return an(ce.line,V[ce.line]);var he=N.subject.page.contentBox[ce.size],Oe=Jt(N.descriptor.id,re),Ae=Oe.reduce(function(it,ze){return it+ze.client.marginBox[ce.size]},0),Ke=Ae+V[ce.line],tt=Ke-he;return tt<=0?null:an(ce.line,tt)},kn=function(N,V){return Object(Z.a)({},N,{scroll:Object(Z.a)({},N.scroll,{max:V})})},er=function(N,V,re){var ce=N.frame;mr(V,N)&&_(!1),N.subject.withPlaceholder&&_(!1);var he=_n(N.axis,V.displaceBy).point,Oe=Zt(N,he,re),Ae={placeholderSize:he,increasedBy:Oe,oldFrameMaxScroll:N.frame?N.frame.scroll.max:null};if(!ce){var Ke=de({page:N.subject.page,withPlaceholder:Ae,axis:N.axis,frame:N.frame});return Object(Z.a)({},N,{subject:Ke})}var tt=Oe?ht(ce.scroll.max,Oe):ce.scroll.max,it=kn(ce,tt),ze=de({page:N.subject.page,withPlaceholder:Ae,axis:N.axis,frame:it});return Object(Z.a)({},N,{subject:ze,frame:it})},tr=function(N){var V=N.subject.withPlaceholder;V||_(!1);var re=N.frame;if(!re){var ce=de({page:N.subject.page,axis:N.axis,frame:null,withPlaceholder:null});return Object(Z.a)({},N,{subject:ce})}var he=V.oldFrameMaxScroll;he||_(!1);var Oe=kn(re,he),Ae=de({page:N.subject.page,axis:N.axis,frame:Oe,withPlaceholder:null});return Object(Z.a)({},N,{subject:Ae,frame:Oe})},wn=function(P){var N=P.previousPageBorderBoxCenter,V=P.moveRelativeTo,re=P.insideDestination,ce=P.draggable,he=P.draggables,Oe=P.destination,Ae=P.viewport,Ke=P.afterCritical;if(!V){if(re.length)return null;var tt={displaced:yr,displacedBy:Qn,at:{type:"REORDER",destination:{droppableId:Oe.descriptor.id,index:0}}},it=Kt({impact:tt,draggable:ce,droppable:Oe,draggables:he,afterCritical:Ke}),ze=mr(ce,Oe)?Oe:er(Oe,ce,he),Ge=Gt({draggable:ce,destination:ze,newPageBorderBoxCenter:it,viewport:Ae.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return Ge?tt:null}var Je=Boolean(N[Oe.axis.line]<=V.page.borderBox.center[Oe.axis.line]),_t=function(){var xn=V.descriptor.index;return V.descriptor.id===ce.descriptor.id||Je?xn:xn+1}(),gn=_n(Oe.axis,ce.displaceBy);return Re({draggable:ce,insideDestination:re,destination:Oe,viewport:Ae,displacedBy:gn,last:yr,index:_t})},Mn=function(P){var N=P.isMovingForward,V=P.previousPageBorderBoxCenter,re=P.draggable,ce=P.isOver,he=P.draggables,Oe=P.droppables,Ae=P.viewport,Ke=P.afterCritical,tt=On({isMovingForward:N,pageBorderBoxCenter:V,source:ce,droppables:Oe,viewport:Ae});if(!tt)return null;var it=Jt(tt.descriptor.id,he),ze=un({pageBorderBoxCenter:V,viewport:Ae,destination:tt,insideDestination:it,afterCritical:Ke}),Ge=wn({previousPageBorderBoxCenter:V,destination:tt,draggable:re,draggables:he,moveRelativeTo:ze,insideDestination:it,viewport:Ae,afterCritical:Ke});if(!Ge)return null;var Je=Kt({impact:Ge,draggable:re,droppable:tt,draggables:he,afterCritical:Ke}),_t=Vt({pageBorderBoxCenter:Je,draggable:re,viewport:Ae});return{clientSelection:_t,impact:Ge,scrollJumpRequest:null}},dn=function(P){var N=P.at;return N?N.type==="REORDER"?N.destination.droppableId:N.combine.droppableId:null},or=function(N,V){var re=dn(N);return re?V[re]:null},Xn=function(P){var N=P.state,V=P.type,re=or(N.impact,N.dimensions.droppables),ce=Boolean(re),he=N.dimensions.droppables[N.critical.droppable.id],Oe=re||he,Ae=Oe.axis.direction,Ke=Ae==="vertical"&&(V==="MOVE_UP"||V==="MOVE_DOWN")||Ae==="horizontal"&&(V==="MOVE_LEFT"||V==="MOVE_RIGHT");if(Ke&&!ce)return null;var tt=V==="MOVE_DOWN"||V==="MOVE_RIGHT",it=N.dimensions.draggables[N.critical.draggable.id],ze=N.current.page.borderBoxCenter,Ge=N.dimensions,Je=Ge.draggables,_t=Ge.droppables;return Ke?Dt({isMovingForward:tt,previousPageBorderBoxCenter:ze,draggable:it,destination:Oe,draggables:Je,viewport:N.viewport,previousClientSelection:N.current.client.selection,previousImpact:N.impact,afterCritical:N.afterCritical}):Mn({isMovingForward:tt,previousPageBorderBoxCenter:ze,draggable:it,isOver:Oe,draggables:Je,droppables:_t,viewport:N.viewport,afterCritical:N.afterCritical})};function vr(P){return P.phase==="DRAGGING"||P.phase==="COLLECTING"}function gr(P){var N=Nn(P.top,P.bottom),V=Nn(P.left,P.right);return function(ce){return N(ce.y)&&V(ce.x)}}function Gn(P,N){return P.left<N.right&&P.right>N.left&&P.top<N.bottom&&P.bottom>N.top}function Bn(P){var N=P.pageBorderBox,V=P.draggable,re=P.candidates,ce=V.page.borderBox.center,he=re.map(function(Oe){var Ae=Oe.axis,Ke=an(Oe.axis.line,N.center[Ae.line],Oe.page.borderBox.center[Ae.crossAxisLine]);return{id:Oe.descriptor.id,distance:Yt(ce,Ke)}}).sort(function(Oe,Ae){return Ae.distance-Oe.distance});return he[0]?he[0].id:null}function _r(P){var N=P.pageBorderBox,V=P.draggable,re=P.droppables,ce=Nt(re).filter(function(he){if(!he.isEnabled)return!1;var Oe=he.subject.active;if(!Oe)return!1;if(!Gn(N,Oe))return!1;if(gr(Oe)(N.center))return!0;var Ae=he.axis,Ke=Oe.center[Ae.crossAxisLine],tt=N[Ae.crossAxisStart],it=N[Ae.crossAxisEnd],ze=Nn(Oe[Ae.crossAxisStart],Oe[Ae.crossAxisEnd]),Ge=ze(tt),Je=ze(it);return!Ge&&!Je?!0:Ge?tt<Ke:it>Ke});return ce.length?ce.length===1?ce[0].descriptor.id:Bn({pageBorderBox:N,draggable:V,candidates:ce}):null}var Rn=function(N,V){return p(xt(N,V))},En=function(P,N){var V=P.frame;return V?Rn(N,V.scroll.diff.value):N};function Cn(P){var N=P.displaced,V=P.id;return Boolean(N.visible[V]||N.invisible[V])}function vn(P){var N=P.draggable,V=P.closest,re=P.inHomeList;return V?re&&V.descriptor.index>N.descriptor.index?V.descriptor.index-1:V.descriptor.index:null}var Qt=function(P){var N=P.pageBorderBoxWithDroppableScroll,V=P.draggable,re=P.destination,ce=P.insideDestination,he=P.last,Oe=P.viewport,Ae=P.afterCritical,Ke=re.axis,tt=_n(re.axis,V.displaceBy),it=tt.value,ze=N[Ke.start],Ge=N[Ke.end],Je=In(V,ce),_t=We(Je,function(xn){var $n=xn.descriptor.id,rr=xn.page.borderBox.center[Ke.line],Tr=tn($n,Ae),nr=Cn({displaced:he,id:$n});return Tr?nr?Ge<=rr:ze<rr-it:nr?Ge<=rr+it:ze<rr}),gn=vn({draggable:V,closest:_t,inHomeList:mr(V,re)});return Re({draggable:V,insideDestination:ce,destination:re,viewport:Oe,last:he,displacedBy:tt,index:gn})},St=4,It=function(P){var N=P.draggable,V=P.pageBorderBoxWithDroppableScroll,re=P.previousImpact,ce=P.destination,he=P.insideDestination,Oe=P.afterCritical;if(!ce.isCombineEnabled)return null;var Ae=ce.axis,Ke=_n(ce.axis,N.displaceBy),tt=Ke.value,it=V[Ae.start],ze=V[Ae.end],Ge=In(N,he),Je=We(Ge,function(gn){var xn=gn.descriptor.id,$n=gn.page.borderBox,rr=$n[Ae.size],Tr=rr/St,nr=tn(xn,Oe),Mr=Cn({displaced:re.displaced,id:xn});return nr?Mr?ze>$n[Ae.start]+Tr&&ze<$n[Ae.end]-Tr:it>$n[Ae.start]-tt+Tr&&it<$n[Ae.end]-tt-Tr:Mr?ze>$n[Ae.start]+tt+Tr&&ze<$n[Ae.end]+tt-Tr:it>$n[Ae.start]+Tr&&it<$n[Ae.end]-Tr});if(!Je)return null;var _t={displacedBy:Ke,displaced:re.displaced,at:{type:"COMBINE",combine:{draggableId:Je.descriptor.id,droppableId:ce.descriptor.id}}};return _t},kt=function(P){var N=P.pageOffset,V=P.draggable,re=P.draggables,ce=P.droppables,he=P.previousImpact,Oe=P.viewport,Ae=P.afterCritical,Ke=Rn(V.page.borderBox,N),tt=_r({pageBorderBox:Ke,draggable:V,droppables:ce});if(!tt)return Sr;var it=ce[tt],ze=Jt(it.descriptor.id,re),Ge=En(it,Ke);return It({pageBorderBoxWithDroppableScroll:Ge,draggable:V,previousImpact:he,destination:it,insideDestination:ze,afterCritical:Ae})||Qt({pageBorderBoxWithDroppableScroll:Ge,draggable:V,destination:it,insideDestination:ze,last:he.displaced,viewport:Oe,afterCritical:Ae})},At=function(P,N){var V;return Object(Z.a)({},P,(V={},V[N.descriptor.id]=N,V))},zt=function(N){var V=N.previousImpact,re=N.impact,ce=N.droppables,he=dn(V),Oe=dn(re);if(!he)return ce;if(he===Oe)return ce;var Ae=ce[he];if(!Ae.subject.withPlaceholder)return ce;var Ke=tr(Ae);return At(ce,Ke)},sn=function(P){var N=P.draggable,V=P.draggables,re=P.droppables,ce=P.previousImpact,he=P.impact,Oe=zt({previousImpact:ce,impact:he,droppables:re}),Ae=dn(he);if(!Ae)return Oe;var Ke=re[Ae];if(mr(N,Ke))return Oe;if(Ke.subject.withPlaceholder)return Oe;var tt=er(Ke,N,V);return At(Oe,tt)},nn=function(P){var N=P.state,V=P.clientSelection,re=P.dimensions,ce=P.viewport,he=P.impact,Oe=P.scrollJumpRequest,Ae=ce||N.viewport,Ke=re||N.dimensions,tt=V||N.current.client.selection,it=wt(tt,N.initial.client.selection),ze={offset:it,selection:tt,borderBoxCenter:ht(N.initial.client.borderBoxCenter,it)},Ge={selection:ht(ze.selection,Ae.scroll.current),borderBoxCenter:ht(ze.borderBoxCenter,Ae.scroll.current),offset:ht(ze.offset,Ae.scroll.diff.value)},Je={client:ze,page:Ge};if(N.phase==="COLLECTING")return Object(Z.a)({phase:"COLLECTING"},N,{dimensions:Ke,viewport:Ae,current:Je});var _t=Ke.draggables[N.critical.draggable.id],gn=he||kt({pageOffset:Ge.offset,draggable:_t,draggables:Ke.draggables,droppables:Ke.droppables,previousImpact:N.impact,viewport:Ae,afterCritical:N.afterCritical}),xn=sn({draggable:_t,impact:gn,previousImpact:N.impact,draggables:Ke.draggables,droppables:Ke.droppables}),$n=Object(Z.a)({},N,{current:Je,dimensions:{draggables:Ke.draggables,droppables:xn},impact:gn,viewport:Ae,scrollJumpRequest:Oe||null,forceShouldAnimate:Oe?!1:null});return $n};function ft(P,N){return P.map(function(V){return N[V]})}var rt=function(P){var N=P.impact,V=P.viewport,re=P.draggables,ce=P.destination,he=P.forceShouldAnimate,Oe=N.displaced,Ae=ft(Oe.all,re),Ke=Lt({afterDragging:Ae,destination:ce,displacedBy:N.displacedBy,viewport:V.frame,forceShouldAnimate:he,last:Oe});return Object(Z.a)({},N,{displaced:Ke})},$e=function(P){var N=P.impact,V=P.draggable,re=P.droppable,ce=P.draggables,he=P.viewport,Oe=P.afterCritical,Ae=Kt({impact:N,draggable:V,draggables:ce,droppable:re,afterCritical:Oe});return Vt({pageBorderBoxCenter:Ae,draggable:V,viewport:he})},Ze=function(P){var N=P.state,V=P.dimensions,re=P.viewport;N.movementMode==="SNAP"||_(!1);var ce=N.impact,he=re||N.viewport,Oe=V||N.dimensions,Ae=Oe.draggables,Ke=Oe.droppables,tt=Ae[N.critical.draggable.id],it=dn(ce);it||_(!1);var ze=Ke[it],Ge=rt({impact:ce,viewport:he,destination:ze,draggables:Ae}),Je=$e({impact:Ge,draggable:tt,droppable:ze,draggables:Ae,viewport:he,afterCritical:N.afterCritical});return nn({impact:Ge,clientSelection:Je,state:N,dimensions:Oe,viewport:he})},He=function(P){return{index:P.index,droppableId:P.droppableId}},ot=function(P){var N=P.draggable,V=P.home,re=P.draggables,ce=P.viewport,he=_n(V.axis,N.displaceBy),Oe=Jt(V.descriptor.id,re),Ae=Oe.indexOf(N);Ae!==-1||_(!1);var Ke=Oe.slice(Ae+1),tt=Ke.reduce(function(Je,_t){return Je[_t.descriptor.id]=!0,Je},{}),it={inVirtualList:V.descriptor.mode==="virtual",displacedBy:he,effected:tt},ze=Lt({afterDragging:Ke,destination:V,displacedBy:he,last:null,viewport:ce.frame,forceShouldAnimate:!1}),Ge={displaced:ze,displacedBy:he,at:{type:"REORDER",destination:He(N.descriptor)}};return{impact:Ge,afterCritical:it}},et=function(P,N){return{draggables:P.draggables,droppables:At(P.droppables,N)}},mt=function(N){},Tt=function(N){},gt=function(P){var N=P.draggable,V=P.offset,re=P.initialWindowScroll,ce=R(N.client,V),he=T(ce,re),Oe=Object(Z.a)({},N,{placeholder:Object(Z.a)({},N.placeholder,{client:ce}),client:ce,page:he});return Oe},Pt=function(P){var N=P.frame;return N||_(!1),N},vt=function(P){var N=P.additions,V=P.updatedDroppables,re=P.viewport,ce=re.scroll.diff.value;return N.map(function(he){var Oe=he.descriptor.droppableId,Ae=V[Oe],Ke=Pt(Ae),tt=Ke.scroll.diff.value,it=ht(ce,tt),ze=gt({draggable:he,offset:it,initialWindowScroll:re.scroll.initial});return ze})},yt=function(P){var N=P.state,V=P.published;mt();var re=V.modified.map(function(Tr){var nr=N.dimensions.droppables[Tr.droppableId],Mr=pe(nr,Tr.scroll);return Mr}),ce=Object(Z.a)({},N.dimensions.droppables,{},Ct(re)),he=Ot(vt({additions:V.additions,updatedDroppables:ce,viewport:N.viewport})),Oe=Object(Z.a)({},N.dimensions.draggables,{},he);V.removals.forEach(function(Tr){delete Oe[Tr]});var Ae={droppables:ce,draggables:Oe},Ke=dn(N.impact),tt=Ke?Ae.droppables[Ke]:null,it=Ae.draggables[N.critical.draggable.id],ze=Ae.droppables[N.critical.droppable.id],Ge=ot({draggable:it,home:ze,draggables:Oe,viewport:N.viewport}),Je=Ge.impact,_t=Ge.afterCritical,gn=tt&&tt.isCombineEnabled?N.impact:Je,xn=kt({pageOffset:N.current.page.offset,draggable:Ae.draggables[N.critical.draggable.id],draggables:Ae.draggables,droppables:Ae.droppables,previousImpact:gn,viewport:N.viewport,afterCritical:_t});Tt();var $n=Object(Z.a)({phase:"DRAGGING"},N,{phase:"DRAGGING",impact:xn,onLiftImpact:Je,dimensions:Ae,afterCritical:_t,forceShouldAnimate:!1});if(N.phase==="COLLECTING")return $n;var rr=Object(Z.a)({phase:"DROP_PENDING"},$n,{phase:"DROP_PENDING",reason:N.reason,isWaiting:!1});return rr},on=function(N){return N.movementMode==="SNAP"},$t=function(N,V,re){var ce=et(N.dimensions,V);return!on(N)||re?nn({state:N,dimensions:ce}):Ze({state:N,dimensions:ce})};function hr(P){return P.isDragging&&P.movementMode==="SNAP"?Object(Z.a)({phase:"DRAGGING"},P,{scrollJumpRequest:null}):P}var jn={phase:"IDLE",completed:null,shouldFlush:!1},Wn=function(P,N){if(P===void 0&&(P=jn),N.type==="FLUSH")return Object(Z.a)({},jn,{shouldFlush:!0});if(N.type==="INITIAL_PUBLISH"){P.phase==="IDLE"||_(!1);var V=N.payload,re=V.critical,ce=V.clientSelection,he=V.viewport,Oe=V.dimensions,Ae=V.movementMode,Ke=Oe.draggables[re.draggable.id],tt=Oe.droppables[re.droppable.id],it={selection:ce,borderBoxCenter:Ke.client.borderBox.center,offset:Xe},ze={client:it,page:{selection:ht(it.selection,he.scroll.initial),borderBoxCenter:ht(it.selection,he.scroll.initial),offset:ht(it.selection,he.scroll.diff.value)}},Ge=Nt(Oe.droppables).every(function(Cr){return!Cr.isFixedOnPage}),Je=ot({draggable:Ke,home:tt,draggables:Oe.draggables,viewport:he}),_t=Je.impact,gn=Je.afterCritical,xn={phase:"DRAGGING",isDragging:!0,critical:re,movementMode:Ae,dimensions:Oe,initial:ze,current:ze,isWindowScrollAllowed:Ge,impact:_t,afterCritical:gn,onLiftImpact:_t,viewport:he,scrollJumpRequest:null,forceShouldAnimate:null};return xn}if(N.type==="COLLECTION_STARTING"){if(P.phase==="COLLECTING"||P.phase==="DROP_PENDING")return P;P.phase==="DRAGGING"||_(!1);var $n=Object(Z.a)({phase:"COLLECTING"},P,{phase:"COLLECTING"});return $n}if(N.type==="PUBLISH_WHILE_DRAGGING")return P.phase==="COLLECTING"||P.phase==="DROP_PENDING"||_(!1),yt({state:P,published:N.payload});if(N.type==="MOVE"){if(P.phase==="DROP_PENDING")return P;vr(P)||_(!1);var rr=N.payload.client;return Bt(rr,P.current.client.selection)?P:nn({state:P,clientSelection:rr,impact:on(P)?P.impact:null})}if(N.type==="UPDATE_DROPPABLE_SCROLL"){if(P.phase==="DROP_PENDING")return hr(P);if(P.phase==="COLLECTING")return hr(P);vr(P)||_(!1);var Tr=N.payload,nr=Tr.id,Mr=Tr.newScroll,Pr=P.dimensions.droppables[nr];if(!Pr)return P;var Br=pe(Pr,Mr);return $t(P,Br,!1)}if(N.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(P.phase==="DROP_PENDING")return P;vr(P)||_(!1);var $r=N.payload,e=$r.id,n=$r.isEnabled,d=P.dimensions.droppables[e];d||_(!1),d.isEnabled!==n||_(!1);var l=Object(Z.a)({},d,{isEnabled:n});return $t(P,l,!0)}if(N.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(P.phase==="DROP_PENDING")return P;vr(P)||_(!1);var v=N.payload,K=v.id,te=v.isCombineEnabled,ie=P.dimensions.droppables[K];ie||_(!1),ie.isCombineEnabled!==te||_(!1);var oe=Object(Z.a)({},ie,{isCombineEnabled:te});return $t(P,oe,!0)}if(N.type==="MOVE_BY_WINDOW_SCROLL"){if(P.phase==="DROP_PENDING"||P.phase==="DROP_ANIMATING")return P;vr(P)||_(!1),P.isWindowScrollAllowed||_(!1);var _e=N.payload.newScroll;if(Bt(P.viewport.scroll.current,_e))return hr(P);var je=ar(P.viewport,_e);return on(P)?Ze({state:P,viewport:je}):nn({state:P,viewport:je})}if(N.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!vr(P))return P;var Ve=N.payload.maxScroll;if(Bt(Ve,P.viewport.scroll.max))return P;var dt=Object(Z.a)({},P.viewport,{scroll:Object(Z.a)({},P.viewport.scroll,{max:Ve})});return Object(Z.a)({phase:"DRAGGING"},P,{viewport:dt})}if(N.type==="MOVE_UP"||N.type==="MOVE_DOWN"||N.type==="MOVE_LEFT"||N.type==="MOVE_RIGHT"){if(P.phase==="COLLECTING"||P.phase==="DROP_PENDING")return P;P.phase==="DRAGGING"||_(!1);var st=Xn({state:P,type:N.type});return st?nn({state:P,impact:st.impact,clientSelection:st.clientSelection,scrollJumpRequest:st.scrollJumpRequest}):P}if(N.type==="DROP_PENDING"){var Rt=N.payload.reason;P.phase==="COLLECTING"||_(!1);var Ht=Object(Z.a)({phase:"DROP_PENDING"},P,{phase:"DROP_PENDING",isWaiting:!0,reason:Rt});return Ht}if(N.type==="DROP_ANIMATE"){var en=N.payload,Tn=en.completed,Yn=en.dropDuration,Sn=en.newHomeClientOffset;P.phase==="DRAGGING"||P.phase==="DROP_PENDING"||_(!1);var lr={phase:"DROP_ANIMATING",completed:Tn,dropDuration:Yn,newHomeClientOffset:Sn,dimensions:P.dimensions};return lr}if(N.type==="DROP_COMPLETE"){var Rr=N.payload.completed;return{phase:"IDLE",completed:Rr,shouldFlush:!1}}return P},Ft=function(N){return{type:"BEFORE_INITIAL_CAPTURE",payload:N}},pn=function(N){return{type:"LIFT",payload:N}},Ln=function(N){return{type:"INITIAL_PUBLISH",payload:N}},zn=function(N){return{type:"PUBLISH_WHILE_DRAGGING",payload:N}},mn=function(){return{type:"COLLECTION_STARTING",payload:null}},Ir=function(N){return{type:"UPDATE_DROPPABLE_SCROLL",payload:N}},jr=function(N){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:N}},Er=function(N){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:N}},Jn=function(N){return{type:"MOVE",payload:N}},xr=function(N){return{type:"MOVE_BY_WINDOW_SCROLL",payload:N}},br=function(N){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:N}},wr=function(){return{type:"MOVE_UP",payload:null}},Ur=function(){return{type:"MOVE_DOWN",payload:null}},Vr=function(){return{type:"MOVE_RIGHT",payload:null}},Fr=function(){return{type:"MOVE_LEFT",payload:null}},kr=function(){return{type:"FLUSH",payload:null}},Ti=function(N){return{type:"DROP_ANIMATE",payload:N}},Kr=function(N){return{type:"DROP_COMPLETE",payload:N}},Si=function(N){return{type:"DROP",payload:N}},qr=function(N){return{type:"DROP_PENDING",payload:N}},ei=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function yi(P){if(P.length<=1)return;for(var N=P.map(function(Ae){return Ae.descriptor.index}),V={},re=1;re<N.length;re++){var ce=N[re],he=N[re-1];ce!==he+1&&(V[ce]=!0)}if(!Object.keys(V).length)return;var Oe=N.map(function(Ae){var Ke=Boolean(V[Ae]);return Ke?"[\u{1F525}"+Ae+"]":""+Ae}).join(", ")}function Ri(P,N){if(!1)var V}var Va=function(P){return function(N){var V=N.getState,re=N.dispatch;return function(ce){return function(he){if(he.type!=="LIFT"){ce(he);return}var Oe=he.payload,Ae=Oe.id,Ke=Oe.clientSelection,tt=Oe.movementMode,it=V();it.phase==="DROP_ANIMATING"&&re(Kr({completed:it.completed})),V().phase==="IDLE"||_(!1),re(kr()),re(Ft({draggableId:Ae,movementMode:tt}));var ze={shouldPublishImmediately:tt==="SNAP"},Ge={draggableId:Ae,scrollOptions:ze},Je=P.startPublishing(Ge),_t=Je.critical,gn=Je.dimensions,xn=Je.viewport;Ri(_t,gn),re(Ln({critical:_t,dimensions:gn,clientSelection:Ke,movementMode:tt,viewport:xn}))}}}},fi=function(P){return function(){return function(N){return function(V){V.type==="INITIAL_PUBLISH"&&P.dragging(),V.type==="DROP_ANIMATE"&&P.dropping(V.payload.completed.result.reason),(V.type==="FLUSH"||V.type==="DROP_COMPLETE")&&P.resting(),N(V)}}}},Xa={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Ki={opacity:{drop:0,combining:.7},scale:{drop:.75}},ki={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ai=ki.outOfTheWay+"s "+Xa.outOfTheWay,Ji={fluid:"opacity "+ai,snap:"transform "+ai+", opacity "+ai,drop:function(N){var V=N+"s "+Xa.drop;return"transform "+V+", opacity "+V},outOfTheWay:"transform "+ai,placeholder:"height "+ai+", width "+ai+", margin "+ai},ys=function(N){return Bt(N,Xe)?null:"translate("+N.x+"px, "+N.y+"px)"},bs={moveTo:ys,drop:function(N,V){var re=ys(N);return re?V?re+" scale("+Ki.scale.drop+")":re:null}},Es=ki.minDropTime,co=ki.maxDropTime,ho=co-Es,xs=1500,Ca=.6,fo=function(P){var N=P.current,V=P.destination,re=P.reason,ce=Yt(N,V);if(ce<=0)return Es;if(ce>=xs)return co;var he=ce/xs,Oe=Es+ho*he,Ae=re==="CANCEL"?Oe*Ca:Oe;return Number(Ae.toFixed(2))},po=function(P){var N=P.impact,V=P.draggable,re=P.dimensions,ce=P.viewport,he=P.afterCritical,Oe=re.draggables,Ae=re.droppables,Ke=dn(N),tt=Ke?Ae[Ke]:null,it=Ae[V.descriptor.droppableId],ze=$e({impact:N,draggable:V,draggables:Oe,afterCritical:he,droppable:tt||it,viewport:ce}),Ge=wt(ze,V.client.borderBox.center);return Ge},ws=function(P){var N=P.draggables,V=P.reason,re=P.lastImpact,ce=P.home,he=P.viewport,Oe=P.onLiftImpact;if(!re.at||V!=="DROP"){var Ae=rt({draggables:N,impact:Oe,destination:ce,viewport:he,forceShouldAnimate:!0});return{impact:Ae,didDropInsideDroppable:!1}}if(re.at.type==="REORDER")return{impact:re,didDropInsideDroppable:!0};var Ke=Object(Z.a)({},re,{displaced:yr});return{impact:Ke,didDropInsideDroppable:!0}},$a=function(P){var N=P.getState,V=P.dispatch;return function(re){return function(ce){if(ce.type!=="DROP"){re(ce);return}var he=N(),Oe=ce.payload.reason;if(he.phase==="COLLECTING"){V(qr({reason:Oe}));return}if(he.phase==="IDLE")return;var Ae=he.phase==="DROP_PENDING"&&he.isWaiting;Ae&&_(!1),he.phase==="DRAGGING"||he.phase==="DROP_PENDING"||_(!1);var Ke=he.critical,tt=he.dimensions,it=tt.draggables[he.critical.draggable.id],ze=ws({reason:Oe,lastImpact:he.impact,afterCritical:he.afterCritical,onLiftImpact:he.onLiftImpact,home:he.dimensions.droppables[he.critical.droppable.id],viewport:he.viewport,draggables:he.dimensions.draggables}),Ge=ze.impact,Je=ze.didDropInsideDroppable,_t=Je?cn(Ge):null,gn=Je?rn(Ge):null,xn={index:Ke.draggable.index,droppableId:Ke.droppable.id},$n={draggableId:it.descriptor.id,type:it.descriptor.type,source:xn,reason:Oe,mode:he.movementMode,destination:_t,combine:gn},rr=po({impact:Ge,draggable:it,dimensions:tt,viewport:he.viewport,afterCritical:he.afterCritical}),Tr={critical:he.critical,afterCritical:he.afterCritical,result:$n,impact:Ge},nr=!Bt(he.current.client.offset,rr)||Boolean($n.combine);if(!nr){V(Kr({completed:Tr}));return}var Mr=fo({current:he.current.client.offset,destination:rr,reason:Oe}),Pr={newHomeClientOffset:rr,dropDuration:Mr,completed:Tr};V(Ti(Pr))}}},Cs=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function Ts(P){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(V){if(V.target!==window&&V.target!==window.document)return;P()}}}function xi(P){var N=P.onWindowScroll;function V(){N(Cs())}var re=w(V),ce=Ts(re),he=Se;function Oe(){return he!==Se}function Ae(){Oe()&&_(!1),he=Te(window,[ce])}function Ke(){Oe()||_(!1),re.cancel(),he(),he=Se}return{start:Ae,stop:Ke,isActive:Oe}}var mo=function(N){return N.type==="DROP_COMPLETE"||N.type==="DROP_ANIMATE"||N.type==="FLUSH"},Ss=function(P){var N=xi({onWindowScroll:function(re){P.dispatch(xr({newScroll:re}))}});return function(V){return function(re){!N.isActive()&&re.type==="INITIAL_PUBLISH"&&N.start(),N.isActive()&&mo(re)&&N.stop(),V(re)}}},Rs=function(P){var N=!1,V=!1,re=setTimeout(function(){V=!0}),ce=function(Oe){if(N)return;if(V)return;N=!0,P(Oe),clearTimeout(re)};return ce.wasCalled=function(){return N},ce},go=function(){var P=[],N=function(he){var Oe=Me(P,function(tt){return tt.timerId===he});Oe!==-1||_(!1);var Ae=P.splice(Oe,1),Ke=Ae[0];Ke.callback()},V=function(he){var Oe=setTimeout(function(){return N(Oe)}),Ae={timerId:Oe,callback:he};P.push(Ae)},re=function(){if(!P.length)return;var he=[].concat(P);P.length=0,he.forEach(function(Oe){clearTimeout(Oe.timerId),Oe.callback()})};return{add:V,flush:re}},vo=function(N,V){return N==null&&V==null?!0:N==null||V==null?!1:N.droppableId===V.droppableId&&N.index===V.index},Os=function(N,V){return N==null&&V==null?!0:N==null||V==null?!1:N.draggableId===V.draggableId&&N.droppableId===V.droppableId},El=function(N,V){if(N===V)return!0;var re=N.draggable.id===V.draggable.id&&N.draggable.droppableId===V.draggable.droppableId&&N.draggable.type===V.draggable.type&&N.draggable.index===V.draggable.index,ce=N.droppable.id===V.droppable.id&&N.droppable.type===V.droppable.type;return re&&ce},Ta=function(N,V){mt(),V(),Tt()},Ya=function(N,V){return{draggableId:N.draggable.id,type:N.droppable.type,source:{droppableId:N.droppable.id,index:N.draggable.index},mode:V}},Oi=function(N,V,re,ce){if(!N){re(ce(V));return}var he=Rs(re),Oe={announce:he};N(V,Oe),he.wasCalled()||re(ce(V))},qi=function(P,N){var V=go(),re=null,ce=function(Ge,Je){re&&_(!1),Ta("onBeforeCapture",function(){var _t=P().onBeforeCapture;if(_t){var gn={draggableId:Ge,mode:Je};_t(gn)}})},he=function(Ge,Je){re&&_(!1),Ta("onBeforeDragStart",function(){var _t=P().onBeforeDragStart;_t&&_t(Ya(Ge,Je))})},Oe=function(Ge,Je){re&&_(!1);var _t=Ya(Ge,Je);re={mode:Je,lastCritical:Ge,lastLocation:_t.source,lastCombine:null},V.add(function(){Ta("onDragStart",function(){return Oi(P().onDragStart,_t,N,Ye.onDragStart)})})},Ae=function(Ge,Je){var _t=cn(Je),gn=rn(Je);re||_(!1);var xn=!El(Ge,re.lastCritical);xn&&(re.lastCritical=Ge);var $n=!vo(re.lastLocation,_t);$n&&(re.lastLocation=_t);var rr=!Os(re.lastCombine,gn);if(rr&&(re.lastCombine=gn),!xn&&!$n&&!rr)return;var Tr=Object(Z.a)({},Ya(Ge,re.mode),{combine:gn,destination:_t});V.add(function(){Ta("onDragUpdate",function(){return Oi(P().onDragUpdate,Tr,N,Ye.onDragUpdate)})})},Ke=function(){re||_(!1),V.flush()},tt=function(Ge){re||_(!1),re=null,Ta("onDragEnd",function(){return Oi(P().onDragEnd,Ge,N,Ye.onDragEnd)})},it=function(){if(!re)return;var Ge=Object(Z.a)({},Ya(re.lastCritical,re.mode),{combine:null,destination:null,reason:"CANCEL"});tt(Ge)};return{beforeCapture:ce,beforeStart:he,start:Oe,update:Ae,flush:Ke,drop:tt,abort:it}},Zi=function(P,N){var V=qi(P,N);return function(re){return function(ce){return function(he){if(he.type==="BEFORE_INITIAL_CAPTURE"){V.beforeCapture(he.payload.draggableId,he.payload.movementMode);return}if(he.type==="INITIAL_PUBLISH"){var Oe=he.payload.critical;V.beforeStart(Oe,he.payload.movementMode),ce(he),V.start(Oe,he.payload.movementMode);return}if(he.type==="DROP_COMPLETE"){var Ae=he.payload.completed.result;V.flush(),ce(he),V.drop(Ae);return}if(ce(he),he.type==="FLUSH"){V.abort();return}var Ke=re.getState();Ke.phase==="DRAGGING"&&V.update(Ke.critical,Ke.impact)}}}},As=function(P){return function(N){return function(V){if(V.type!=="DROP_ANIMATION_FINISHED"){N(V);return}var re=P.getState();re.phase==="DROP_ANIMATING"||_(!1),P.dispatch(Kr({completed:re.completed}))}}},Ds=function(P){var N=null,V=null;function re(){V&&(cancelAnimationFrame(V),V=null),N&&(N(),N=null)}return function(ce){return function(he){if((he.type==="FLUSH"||he.type==="DROP_COMPLETE"||he.type==="DROP_ANIMATION_FINISHED")&&re(),ce(he),he.type!=="DROP_ANIMATE")return;var Oe={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var Ke=P.getState();Ke.phase==="DROP_ANIMATING"&&P.dispatch(ei())}};V=requestAnimationFrame(function(){V=null,N=Te(window,[Oe])})}}},_o=function(P){return function(){return function(N){return function(V){(V.type==="DROP_COMPLETE"||V.type==="FLUSH"||V.type==="DROP_ANIMATE")&&P.stopPublishing(),N(V)}}}},Ps=function(P){var N=!1;return function(){return function(V){return function(re){if(re.type==="INITIAL_PUBLISH"){N=!0,P.tryRecordFocus(re.payload.critical.draggable.id),V(re),P.tryRestoreFocusRecorded();return}if(V(re),!N)return;if(re.type==="FLUSH"){N=!1,P.tryRestoreFocusRecorded();return}if(re.type==="DROP_COMPLETE"){N=!1;var ce=re.payload.completed.result;ce.combine&&P.tryShiftRecord(ce.draggableId,ce.combine.draggableId),P.tryRestoreFocusRecorded()}}}}},Gi=function(N){return N.type==="DROP_COMPLETE"||N.type==="DROP_ANIMATE"||N.type==="FLUSH"},zi=function(P){return function(N){return function(V){return function(re){if(Gi(re)){P.stop(),V(re);return}if(re.type==="INITIAL_PUBLISH"){V(re);var ce=N.getState();ce.phase==="DRAGGING"||_(!1),P.start(ce);return}V(re),P.scroll(N.getState())}}}},li=function(P){return function(N){return function(V){if(N(V),V.type!=="PUBLISH_WHILE_DRAGGING")return;var re=P.getState();if(re.phase!=="DROP_PENDING")return;if(re.isWaiting)return;P.dispatch(Si({reason:re.reason}))}}},Mi=G.d,Ni=function(P){var N=P.dimensionMarshal,V=P.focusMarshal,re=P.styleMarshal,ce=P.getResponders,he=P.announce,Oe=P.autoScroller;return Object(G.e)(Wn,Mi(Object(G.a)(fi(re),_o(N),Va(N),$a,As,Ds,li,zi(Oe),Ss,Ps(V),Zi(ce,he))))},ea=function(){return{additions:{},removals:{},modified:{}}};function xl(P){var N=P.registry,V=P.callbacks,re=ea(),ce=null,he=function(){if(ce)return;V.collectionStarting(),ce=requestAnimationFrame(function(){ce=null,mt();var it=re,ze=it.additions,Ge=it.removals,Je=it.modified,_t=Object.keys(ze).map(function($n){return N.draggable.getById($n).getDimension(Xe)}).sort(function($n,rr){return $n.descriptor.index-rr.descriptor.index}),gn=Object.keys(Je).map(function($n){var rr=N.droppable.getById($n),Tr=rr.callbacks.getScrollWhileDragging();return{droppableId:$n,scroll:Tr}}),xn={additions:_t,removals:Object.keys(Ge),modified:gn};re=ea(),Tt(),V.publish(xn)})},Oe=function(it){var ze=it.descriptor.id;re.additions[ze]=it,re.modified[it.descriptor.droppableId]=!0,re.removals[ze]&&delete re.removals[ze],he()},Ae=function(it){var ze=it.descriptor;re.removals[ze.id]=!0,re.modified[ze.droppableId]=!0,re.additions[ze.id]&&delete re.additions[ze.id],he()},Ke=function(){if(!ce)return;cancelAnimationFrame(ce),ce=null,re=ea()};return{add:Oe,remove:Ae,stop:Ke}}var Ls=function(P){var N=P.scrollHeight,V=P.scrollWidth,re=P.height,ce=P.width,he=wt({x:V,y:N},{x:ce,y:re}),Oe={x:Math.max(0,he.x),y:Math.max(0,he.y)};return Oe},ta=function(){var P=document.documentElement;return P||_(!1),P},Is=function(){var P=ta(),N=Ls({scrollHeight:P.scrollHeight,scrollWidth:P.scrollWidth,width:P.clientWidth,height:P.clientHeight});return N},yo=function(){var P=Cs(),N=Is(),V=P.y,re=P.x,ce=ta(),he=ce.clientWidth,Oe=ce.clientHeight,Ae=re+he,Ke=V+Oe,tt=p({top:V,left:re,right:Ae,bottom:Ke}),it={frame:tt,scroll:{initial:P,current:P,max:N,diff:{value:Xe,displacement:Xe}}};return it},Qa=function(P){var N=P.critical,V=P.scrollOptions,re=P.registry;mt();var ce=yo(),he=ce.scroll.current,Oe=N.droppable,Ae=re.droppable.getAllByType(Oe.type).map(function(ze){return ze.callbacks.getDimensionAndWatchScroll(he,V)}),Ke=re.draggable.getAllByType(N.draggable.type).map(function(ze){return ze.getDimension(he)}),tt={draggables:Ot(Ke),droppables:Ct(Ae)};Tt();var it={dimensions:tt,critical:N,viewport:ce};return it};function bo(P,N,V){if(V.descriptor.id===N.id)return!1;if(V.descriptor.type!==N.type)return!1;var re=P.droppable.getById(V.descriptor.droppableId);return!(re.descriptor.mode!=="virtual")}var ks=function(P,N){var V=null,re=xl({callbacks:{publish:N.publishWhileDragging,collectionStarting:N.collectionStarting},registry:P}),ce=function(Je,_t){if(P.droppable.exists(Je)||_(!1),!V)return;N.updateDroppableIsEnabled({id:Je,isEnabled:_t})},he=function(Je,_t){if(!V)return;P.droppable.exists(Je)||_(!1),N.updateDroppableIsCombineEnabled({id:Je,isCombineEnabled:_t})},Oe=function(Je,_t){if(!V)return;P.droppable.exists(Je)||_(!1),N.updateDroppableScroll({id:Je,newScroll:_t})},Ae=function(Je,_t){if(!V)return;P.droppable.getById(Je).callbacks.scroll(_t)},Ke=function(){if(!V)return;re.stop();var Je=V.critical.droppable;P.droppable.getAllByType(Je.type).forEach(function(_t){return _t.callbacks.dragStopped()}),V.unsubscribe(),V=null},tt=function(Je){V||_(!1);var _t=V.critical.draggable;Je.type==="ADDITION"&&(bo(P,_t,Je.value)&&re.add(Je.value)),Je.type==="REMOVAL"&&(bo(P,_t,Je.value)&&re.remove(Je.value))},it=function(Je){V&&_(!1);var _t=P.draggable.getById(Je.draggableId),gn=P.droppable.getById(_t.descriptor.droppableId),xn={draggable:_t.descriptor,droppable:gn.descriptor},$n=P.subscribe(tt);return V={critical:xn,unsubscribe:$n},Qa({critical:xn,registry:P,scrollOptions:Je.scrollOptions})},ze={updateDroppableIsEnabled:ce,updateDroppableIsCombineEnabled:he,scrollDroppable:Ae,updateDroppableScroll:Oe,startPublishing:it,stopPublishing:Ke};return ze},Ms=function(P,N){return P.phase==="IDLE"?!0:P.phase!=="DROP_ANIMATING"||P.completed.result.draggableId===N?!1:P.completed.result.reason==="DROP"},Eo=function(P){window.scrollBy(P.x,P.y)},Ns=h(function(P){return Nt(P).filter(function(N){return N.isEnabled?!!N.frame:!1})}),na=function(N,V){var re=We(Ns(V),function(ce){return ce.frame||_(!1),gr(ce.frame.pageMarginBox)(N)});return re},Ja=function(P){var N=P.center,V=P.destination,re=P.droppables;if(V){var ce=re[V];return ce.frame?ce:null}var he=na(N,re);return he},Ai={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(N){return Math.pow(N,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},qa=function(P,N){var V=P[N.size]*Ai.startFromPercentage,re=P[N.size]*Ai.maxScrollAtPercentage,ce={startScrollingFrom:V,maxScrollValueAt:re};return ce},xo=function(P){var N=P.startOfRange,V=P.endOfRange,re=P.current,ce=V-N;if(ce===0)return 0;var he=re-N,Oe=he/ce;return Oe},Us=1,wl=function(P,N){if(P>N.startScrollingFrom)return 0;if(P<=N.maxScrollValueAt)return Ai.maxPixelScroll;if(P===N.startScrollingFrom)return Us;var V=xo({startOfRange:N.maxScrollValueAt,endOfRange:N.startScrollingFrom,current:P}),re=1-V,ce=Ai.maxPixelScroll*Ai.ease(re);return Math.ceil(ce)},Za=Ai.durationDampening.accelerateAt,es=Ai.durationDampening.stopDampeningAt,ra=function(P,N){var V=N,re=es,ce=Date.now(),he=ce-V;if(he>=es)return P;if(he<Za)return Us;var Oe=xo({startOfRange:Za,endOfRange:re,current:he}),Ae=P*Ai.ease(Oe);return Math.ceil(Ae)},ia=function(P){var N=P.distanceToEdge,V=P.thresholds,re=P.dragStartTime,ce=P.shouldUseTimeDampening,he=wl(N,V);return he===0?0:ce?Math.max(ra(he,re),Us):he},wo=function(P){var N=P.container,V=P.distanceToEdges,re=P.dragStartTime,ce=P.axis,he=P.shouldUseTimeDampening,Oe=qa(N,ce),Ae=V[ce.end]<V[ce.start];return Ae?ia({distanceToEdge:V[ce.end],thresholds:Oe,dragStartTime:re,shouldUseTimeDampening:he}):-1*ia({distanceToEdge:V[ce.start],thresholds:Oe,dragStartTime:re,shouldUseTimeDampening:he})},ts=function(P){var N=P.container,V=P.subject,re=P.proposedScroll,ce=V.height>N.height,he=V.width>N.width;return!he&&!ce?re:he&&ce?null:{x:he?0:re.x,y:ce?0:re.y}},Co=Qe(function(P){return P===0?0:P}),aa=function(P){var N=P.dragStartTime,V=P.container,re=P.subject,ce=P.center,he=P.shouldUseTimeDampening,Oe={top:ce.y-V.top,right:V.right-ce.x,bottom:V.bottom-ce.y,left:ce.x-V.left},Ae=wo({container:V,distanceToEdges:Oe,dragStartTime:N,axis:Dn,shouldUseTimeDampening:he}),Ke=wo({container:V,distanceToEdges:Oe,dragStartTime:N,axis:qn,shouldUseTimeDampening:he}),tt=Co({x:Ke,y:Ae});if(Bt(tt,Xe))return null;var it=ts({container:V,subject:re,proposedScroll:tt});return it?Bt(it,Xe)?null:it:null},To=Qe(function(P){return P===0?0:P>0?1:-1}),Di=function(){var P=function(V,re){return V<0?V:V>re?V-re:0};return function(N){var V=N.current,re=N.max,ce=N.change,he=ht(V,ce),Oe={x:P(he.x,re.x),y:P(he.y,re.y)};return Bt(Oe,Xe)?null:Oe}}(),sa=function(N){var V=N.max,re=N.current,ce=N.change,he={x:Math.max(re.x,V.x),y:Math.max(re.y,V.y)},Oe=To(ce),Ae=Di({max:he,current:re,change:Oe});return Ae?Oe.x!==0&&Ae.x===0?!0:Oe.y!==0&&Ae.y===0:!0},Pi=function(N,V){return sa({current:N.scroll.current,max:N.scroll.max,change:V})},Sa=function(N,V){if(!Pi(N,V))return null;var re=N.scroll.max,ce=N.scroll.current;return Di({current:ce,max:re,change:V})},Ui=function(N,V){var re=N.frame;return re?sa({current:re.scroll.current,max:re.scroll.max,change:V}):!1},So=function(N,V){var re=N.frame;return re&&Ui(N,V)?Di({current:re.scroll.current,max:re.scroll.max,change:V}):null},Ro=function(P){var N=P.viewport,V=P.subject,re=P.center,ce=P.dragStartTime,he=P.shouldUseTimeDampening,Oe=aa({dragStartTime:ce,container:N.frame,subject:V,center:re,shouldUseTimeDampening:he});return Oe&&Pi(N,Oe)?Oe:null},Oo=function(P){var N=P.droppable,V=P.subject,re=P.center,ce=P.dragStartTime,he=P.shouldUseTimeDampening,Oe=N.frame;if(!Oe)return null;var Ae=aa({dragStartTime:ce,container:Oe.pageMarginBox,subject:V,center:re,shouldUseTimeDampening:he});return Ae&&Ui(N,Ae)?Ae:null},Ao=function(P){var N=P.state,V=P.dragStartTime,re=P.shouldUseTimeDampening,ce=P.scrollWindow,he=P.scrollDroppable,Oe=N.current.page.borderBoxCenter,Ae=N.dimensions.draggables[N.critical.draggable.id],Ke=Ae.page.marginBox;if(N.isWindowScrollAllowed){var tt=N.viewport,it=Ro({dragStartTime:V,viewport:tt,subject:Ke,center:Oe,shouldUseTimeDampening:re});if(it){ce(it);return}}var ze=Ja({center:Oe,destination:dn(N.impact),droppables:N.dimensions.droppables});if(!ze)return;var Ge=Oo({dragStartTime:V,droppable:ze,subject:Ke,center:Oe,shouldUseTimeDampening:re});Ge&&he(ze.descriptor.id,Ge)},Vi=function(P){var N=P.scrollWindow,V=P.scrollDroppable,re=w(N),ce=w(V),he=null,Oe=function(it){he||_(!1);var ze=he,Ge=ze.shouldUseTimeDampening,Je=ze.dragStartTime;Ao({state:it,scrollWindow:re,scrollDroppable:ce,dragStartTime:Je,shouldUseTimeDampening:Ge})},Ae=function(it){mt(),he&&_(!1);var ze=Date.now(),Ge=!1,Je=function(){Ge=!0};Ao({state:it,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:Je,scrollDroppable:Je}),he={dragStartTime:ze,shouldUseTimeDampening:Ge},Tt(),Ge&&Oe(it)},Ke=function(){if(!he)return;re.cancel(),ce.cancel(),he=null};return{start:Ae,stop:Ke,scroll:Oe}},Xi=function(P){var N=P.move,V=P.scrollDroppable,re=P.scrollWindow,ce=function(tt,it){var ze=ht(tt.current.client.selection,it);N({client:ze})},he=function(tt,it){if(!Ui(tt,it))return it;var ze=So(tt,it);if(!ze)return V(tt.descriptor.id,it),null;var Ge=wt(it,ze);V(tt.descriptor.id,Ge);var Je=wt(it,Ge);return Je},Oe=function(tt,it,ze){if(!tt)return ze;if(!Pi(it,ze))return ze;var Ge=Sa(it,ze);if(!Ge)return re(ze),null;var Je=wt(ze,Ge);re(Je);var _t=wt(ze,Je);return _t},Ae=function(tt){var it=tt.scrollJumpRequest;if(!it)return;var ze=dn(tt.impact);ze||_(!1);var Ge=he(tt.dimensions.droppables[ze],it);if(!Ge)return;var Je=tt.viewport,_t=Oe(tt.isWindowScrollAllowed,Je,Ge);if(!_t)return;ce(tt,_t)};return Ae},Cl=function(P){var N=P.scrollDroppable,V=P.scrollWindow,re=P.move,ce=Vi({scrollWindow:V,scrollDroppable:N}),he=Xi({move:re,scrollWindow:V,scrollDroppable:N}),Oe=function(tt){if(tt.phase!=="DRAGGING")return;if(tt.movementMode==="FLUID"){ce.scroll(tt);return}if(!tt.scrollJumpRequest)return;he(tt)},Ae={scroll:Oe,start:ce.start,stop:ce.stop};return Ae},oa="data-rbd",la=function(){var P=oa+"-drag-handle";return{base:P,draggableId:P+"-draggable-id",contextId:P+"-context-id"}}(),Fs=function(){var P=oa+"-draggable";return{base:P,contextId:P+"-context-id",id:P+"-id"}}(),Tl=function(){var P=oa+"-droppable";return{base:P,contextId:P+"-context-id",id:P+"-id"}}(),Do={contextId:oa+"-scroll-container-context-id"},ci=function(N){return function(V){return"["+V+'="'+N+'"]'}},Gr=function(N,V){return N.map(function(re){var ce=re.styles[V];return ce?re.selector+" { "+ce+" }":""}).join(" ")},si="pointer-events: none;",Yr=function(P){var N=ci(P),V=function(){var Ae=`
cursor: -webkit-grab;
cursor: grab;
`;return{selector:N(la.contextId),styles:{always:`
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
touch-action: manipulation;
`,resting:Ae,dragging:si,dropAnimating:Ae}}}(),re=function(){var Ae=`
transition: `+Ji.outOfTheWay+`;
`;return{selector:N(Fs.contextId),styles:{dragging:Ae,dropAnimating:Ae,userCancel:Ae}}}(),ce={selector:N(Tl.contextId),styles:{always:"overflow-anchor: none;"}},he={selector:"body",styles:{dragging:`
cursor: grabbing;
cursor: -webkit-grabbing;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
overflow-anchor: none;
`}},Oe=[re,V,ce,he];return{always:Gr(Oe,"always"),resting:Gr(Oe,"resting"),dragging:Gr(Oe,"dragging"),dropAnimating:Gr(Oe,"dropAnimating"),userCancel:Gr(Oe,"userCancel")}},ti=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?ne.useLayoutEffect:ne.useEffect,Bs=function(){var N=document.querySelector("head");return N||_(!1),N},Ra=function(N){var V=document.createElement("style");return N&&V.setAttribute("nonce",N),V.type="text/css",V};function Sl(P,N){var V=A(function(){return Yr(P)},[P]),re=Object(ne.useRef)(null),ce=Object(ne.useRef)(null),he=m(h(function(ze){var Ge=ce.current;Ge||_(!1),Ge.textContent=ze}),[]),Oe=m(function(ze){var Ge=re.current;Ge||_(!1),Ge.textContent=ze},[]);ti(function(){!re.current&&!ce.current||_(!1);var ze=Ra(N),Ge=Ra(N);return re.current=ze,ce.current=Ge,ze.setAttribute(oa+"-always",P),Ge.setAttribute(oa+"-dynamic",P),Bs().appendChild(ze),Bs().appendChild(Ge),Oe(V.always),he(V.resting),function(){var Je=function(gn){var xn=gn.current;xn||_(!1),Bs().removeChild(xn),gn.current=null};Je(re),Je(ce)}},[N,Oe,he,V.always,V.resting,P]);var Ae=m(function(){return he(V.dragging)},[he,V.dragging]),Ke=m(function(ze){if(ze==="DROP"){he(V.dropAnimating);return}he(V.userCancel)},[he,V.dropAnimating,V.userCancel]),tt=m(function(){if(!ce.current)return;he(V.resting)},[he,V.resting]),it=A(function(){return{dragging:Ae,dropping:Ke,resting:tt}},[Ae,Ke,tt]);return it}var Po=function(P){return P&&P.ownerDocument?P.ownerDocument.defaultView:window};function Oa(P){return P instanceof Po(P).HTMLElement}function ns(P,N){var V="["+la.contextId+'="'+P+'"]',re=lt(document.querySelectorAll(V));if(!re.length)return null;var ce=We(re,function(he){return he.getAttribute(la.draggableId)===N});return ce&&Oa(ce)?ce:null}function Lo(P){var N=Object(ne.useRef)({}),V=Object(ne.useRef)(null),re=Object(ne.useRef)(null),ce=Object(ne.useRef)(!1),he=m(function(Ge,Je){var _t={id:Ge,focus:Je};return N.current[Ge]=_t,function(){var xn=N.current,$n=xn[Ge];$n!==_t&&delete xn[Ge]}},[]),Oe=m(function(Ge){var Je=ns(P,Ge);Je&&Je!==document.activeElement&&Je.focus()},[P]),Ae=m(function(Ge,Je){V.current===Ge&&(V.current=Je)},[]),Ke=m(function(){if(re.current)return;if(!ce.current)return;re.current=requestAnimationFrame(function(){re.current=null;var Ge=V.current;Ge&&Oe(Ge)})},[Oe]),tt=m(function(Ge){V.current=null;var Je=document.activeElement;if(!Je)return;if(Je.getAttribute(la.draggableId)!==Ge)return;V.current=Ge},[]);ti(function(){return ce.current=!0,function(){ce.current=!1;var Ge=re.current;Ge&&cancelAnimationFrame(Ge)}},[]);var it=A(function(){return{register:he,tryRecordFocus:tt,tryRestoreFocusRecorded:Ke,tryShiftRecord:Ae}},[he,tt,Ke,Ae]);return it}function js(){var P={draggables:{},droppables:{}},N=[];function V(ze){return N.push(ze),function(){var Je=N.indexOf(ze);if(Je===-1)return;N.splice(Je,1)}}function re(ze){N.length&&N.forEach(function(Ge){return Ge(ze)})}function ce(ze){return P.draggables[ze]||null}function he(ze){var Ge=ce(ze);return Ge||_(!1),Ge}var Oe={register:function(Ge){P.draggables[Ge.descriptor.id]=Ge,re({type:"ADDITION",value:Ge})},update:function(Ge,Je){var _t=P.draggables[Je.descriptor.id];if(!_t)return;if(_t.uniqueId!==Ge.uniqueId)return;delete P.draggables[Je.descriptor.id],P.draggables[Ge.descriptor.id]=Ge},unregister:function(Ge){var Je=Ge.descriptor.id,_t=ce(Je);if(!_t)return;if(Ge.uniqueId!==_t.uniqueId)return;delete P.draggables[Je],re({type:"REMOVAL",value:Ge})},getById:he,findById:ce,exists:function(Ge){return Boolean(ce(Ge))},getAllByType:function(Ge){return ue(P.draggables).filter(function(Je){return Je.descriptor.type===Ge})}};function Ae(ze){return P.droppables[ze]||null}function Ke(ze){var Ge=Ae(ze);return Ge||_(!1),Ge}var tt={register:function(Ge){P.droppables[Ge.descriptor.id]=Ge},unregister:function(Ge){var Je=Ae(Ge.descriptor.id);if(!Je)return;if(Ge.uniqueId!==Je.uniqueId)return;delete P.droppables[Ge.descriptor.id]},getById:Ke,findById:Ae,exists:function(Ge){return Boolean(Ae(Ge))},getAllByType:function(Ge){return ue(P.droppables).filter(function(Je){return Je.descriptor.type===Ge})}};function it(){P.draggables={},P.droppables={},N.length=0}return{draggable:Oe,droppable:tt,subscribe:V,clean:it}}function Rl(){var P=A(js,[]);return Object(ne.useEffect)(function(){return function(){requestAnimationFrame(P.clean)}},[P]),P}var Aa=Q.a.createContext(null),$i=function(){var P=document.body;return P||_(!1),P},Io={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},ko=function(N){return"rbd-announcement-"+N};function Ws(P){var N=A(function(){return ko(P)},[P]),V=Object(ne.useRef)(null);Object(ne.useEffect)(function(){var he=document.createElement("div");return V.current=he,he.id=N,he.setAttribute("aria-live","assertive"),he.setAttribute("aria-atomic","true"),Object(Z.a)(he.style,Io),$i().appendChild(he),function(){setTimeout(function(){var Ke=$i();Ke.contains(he)&&Ke.removeChild(he),he===V.current&&(V.current=null)})}},[N]);var re=m(function(ce){var he=V.current;if(he){he.textContent=ce;return}},[]);return re}var Hs=0,Da={separator:"::"};function Ol(){Hs=0}function ua(P,N){return N===void 0&&(N=Da),A(function(){return""+P+N.separator+Hs++},[N.separator,P])}function pi(P){var N=P.contextId,V=P.uniqueId;return"rbd-hidden-text-"+N+"-"+V}function Mo(P){var N=P.contextId,V=P.text,re=ua("hidden-text",{separator:"-"}),ce=A(function(){return pi({contextId:N,uniqueId:re})},[re,N]);return Object(ne.useEffect)(function(){var Oe=document.createElement("div");return Oe.id=ce,Oe.textContent=V,Oe.style.display="none",$i().appendChild(Oe),function(){var Ke=$i();Ke.contains(Oe)&&Ke.removeChild(Oe)}},[ce,V]),ce}var rs=Q.a.createContext(null),No={react:"^16.8.5","react-dom":"^16.8.5"},mi=/(\d+)\.(\d+)\.(\d+)/,Nr=function(N){var V=mi.exec(N);V!=null||_(!1);var re=Number(V[1]),ce=Number(V[2]),he=Number(V[3]);return{major:re,minor:ce,patch:he,raw:N}},wi=function(N,V){return V.major>N.major?!0:V.major<N.major?!1:V.minor>N.minor?!0:V.minor<N.minor?!1:V.patch>=N.patch},Fi=function(P,N){var V=Nr(P),re=Nr(N);if(wi(V,re))return},Yi=`
We expect a html5 doctype: <!doctype html>
This is to ensure consistent browser layout and measurement
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md
`,Uo=function(P){var N=P.doctype;if(!N)return;N.name.toLowerCase()!=="html",N.publicId!==""};function Pa(P){}function da(P,N){Pa(function(){Object(ne.useEffect)(function(){try{P()}catch(V){ve(`
A setup problem was encountered.
> `+V.message+`
`)}},N)})}function Al(){da(function(){Fi(No.react,Q.a.version),Uo(document)},[])}function La(P){var N=Object(ne.useRef)(P);return Object(ne.useEffect)(function(){N.current=P}),N}function Ia(){var P=null;function N(){return Boolean(P)}function V(Oe){return Oe===P}function re(Oe){P&&_(!1);var Ae={abandon:Oe};return P=Ae,Ae}function ce(){P||_(!1),P=null}function he(){P&&(P.abandon(),ce())}return{isClaimed:N,isActive:V,claim:re,release:ce,tryAbandon:he}}var Fo=9,Ks=13,Ci=27,Gs=32,Bo=33,Dl=34,is=35,zs=36,jo=37,Pl=38,Wo=39,Ll=40,as,ss=(as={},as[Ks]=!0,as[Fo]=!0,as),Vs=function(P){ss[P.keyCode]&&P.preventDefault()},os=function(){var P="visibilitychange";if(typeof document=="undefined")return P;var N=[P,"ms"+P,"webkit"+P,"moz"+P,"o"+P],V=We(N,function(re){return"on"+re in document});return V||P}(),Ho=0,Xs=5;function ca(P,N){return Math.abs(N.x-P.x)>=Xs||Math.abs(N.y-P.y)>=Xs}var ls={type:"IDLE"};function us(P){var N=P.cancel,V=P.completed,re=P.getPhase,ce=P.setPhase;return[{eventName:"mousemove",fn:function(Oe){var Ae=Oe.button,Ke=Oe.clientX,tt=Oe.clientY;if(Ae!==Ho)return;var it={x:Ke,y:tt},ze=re();if(ze.type==="DRAGGING"){Oe.preventDefault(),ze.actions.move(it);return}ze.type==="PENDING"||_(!1);var Ge=ze.point;if(!ca(Ge,it))return;Oe.preventDefault();var Je=ze.actions.fluidLift(it);ce({type:"DRAGGING",actions:Je})}},{eventName:"mouseup",fn:function(Oe){var Ae=re();if(Ae.type!=="DRAGGING"){N();return}Oe.preventDefault(),Ae.actions.drop({shouldBlockNextClick:!0}),V()}},{eventName:"mousedown",fn:function(Oe){re().type==="DRAGGING"&&Oe.preventDefault(),N()}},{eventName:"keydown",fn:function(Oe){var Ae=re();if(Ae.type==="PENDING"){N();return}if(Oe.keyCode===Ci){Oe.preventDefault(),N();return}Vs(Oe)}},{eventName:"resize",fn:N},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){re().type==="PENDING"&&N()}},{eventName:"webkitmouseforcedown",fn:function(Oe){var Ae=re();if(Ae.type!=="IDLE"||_(!1),Ae.actions.shouldRespectForcePress()){N();return}Oe.preventDefault()}},{eventName:os,fn:N}]}function Ko(P){var N=Object(ne.useRef)(ls),V=Object(ne.useRef)(Se),re=A(function(){return{eventName:"mousedown",fn:function(ze){if(ze.defaultPrevented)return;if(ze.button!==Ho)return;if(ze.ctrlKey||ze.metaKey||ze.shiftKey||ze.altKey)return;var Ge=P.findClosestDraggableId(ze);if(!Ge)return;var Je=P.tryGetLock(Ge,Oe,{sourceEvent:ze});if(!Je)return;ze.preventDefault();var _t={x:ze.clientX,y:ze.clientY};V.current(),tt(Je,_t)}}},[P]),ce=A(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(ze){if(ze.defaultPrevented)return;var Ge=P.findClosestDraggableId(ze);if(!Ge)return;var Je=P.findOptionsForDraggable(Ge);if(!Je)return;if(Je.shouldRespectForcePress)return;if(!P.canGetLock(Ge))return;ze.preventDefault()}}},[P]),he=m(function(){var ze={passive:!1,capture:!0};V.current=Te(window,[ce,re],ze)},[ce,re]),Oe=m(function(){var it=N.current;if(it.type==="IDLE")return;N.current=ls,V.current(),he()},[he]),Ae=m(function(){var it=N.current;Oe(),it.type==="DRAGGING"&&it.actions.cancel({shouldBlockNextClick:!0}),it.type==="PENDING"&&it.actions.abort()},[Oe]),Ke=m(function(){var ze={capture:!0,passive:!1},Ge=us({cancel:Ae,completed:Oe,getPhase:function(){return N.current},setPhase:function(_t){N.current=_t}});V.current=Te(window,Ge,ze)},[Ae,Oe]),tt=m(function(ze,Ge){N.current.type==="IDLE"||_(!1),N.current={type:"PENDING",point:Ge,actions:ze},Ke()},[Ke]);ti(function(){return he(),function(){V.current()}},[he])}var Bi;function Go(){}var Il=(Bi={},Bi[Dl]=!0,Bi[Bo]=!0,Bi[zs]=!0,Bi[is]=!0,Bi);function zo(P,N){function V(){N(),P.cancel()}function re(){N(),P.drop()}return[{eventName:"keydown",fn:function(he){if(he.keyCode===Ci){he.preventDefault(),V();return}if(he.keyCode===Gs){he.preventDefault(),re();return}if(he.keyCode===Ll){he.preventDefault(),P.moveDown();return}if(he.keyCode===Pl){he.preventDefault(),P.moveUp();return}if(he.keyCode===Wo){he.preventDefault(),P.moveRight();return}if(he.keyCode===jo){he.preventDefault(),P.moveLeft();return}if(Il[he.keyCode]){he.preventDefault();return}Vs(he)}},{eventName:"mousedown",fn:V},{eventName:"mouseup",fn:V},{eventName:"click",fn:V},{eventName:"touchstart",fn:V},{eventName:"resize",fn:V},{eventName:"wheel",fn:V,options:{passive:!0}},{eventName:os,fn:V}]}function ni(P){var N=Object(ne.useRef)(Go),V=A(function(){return{eventName:"keydown",fn:function(he){if(he.defaultPrevented)return;if(he.keyCode!==Gs)return;var Oe=P.findClosestDraggableId(he);if(!Oe)return;var Ae=P.tryGetLock(Oe,it,{sourceEvent:he});if(!Ae)return;he.preventDefault();var Ke=!0,tt=Ae.snapLift();N.current();function it(){Ke||_(!1),Ke=!1,N.current(),re()}N.current=Te(window,zo(tt,it),{capture:!0,passive:!1})}}},[P]),re=m(function(){var he={passive:!1,capture:!0};N.current=Te(window,[V],he)},[V]);ti(function(){return re(),function(){N.current()}},[re])}var ha={type:"IDLE"},Vo=120,Xo=.15;function $o(P){var N=P.cancel,V=P.getPhase;return[{eventName:"orientationchange",fn:N},{eventName:"resize",fn:N},{eventName:"contextmenu",fn:function(ce){ce.preventDefault()}},{eventName:"keydown",fn:function(ce){if(V().type!=="DRAGGING"){N();return}ce.keyCode===Ci&&ce.preventDefault(),N()}},{eventName:os,fn:N}]}function fa(P){var N=P.cancel,V=P.completed,re=P.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(he){var Oe=re();if(Oe.type!=="DRAGGING"){N();return}Oe.hasMoved=!0;var Ae=he.touches[0],Ke=Ae.clientX,tt=Ae.clientY,it={x:Ke,y:tt};he.preventDefault(),Oe.actions.move(it)}},{eventName:"touchend",fn:function(he){var Oe=re();if(Oe.type!=="DRAGGING"){N();return}he.preventDefault(),Oe.actions.drop({shouldBlockNextClick:!0}),V()}},{eventName:"touchcancel",fn:function(he){if(re().type!=="DRAGGING"){N();return}he.preventDefault(),N()}},{eventName:"touchforcechange",fn:function(he){var Oe=re();Oe.type!=="IDLE"||_(!1);var Ae=he.touches[0];if(!Ae)return;var Ke=Ae.force>=Xo;if(!Ke)return;var tt=Oe.actions.shouldRespectForcePress();if(Oe.type==="PENDING"){tt&&N();return}if(tt){if(Oe.hasMoved){he.preventDefault();return}N();return}he.preventDefault()}},{eventName:os,fn:N}]}function ds(P){var N=Object(ne.useRef)(ha),V=Object(ne.useRef)(Se),re=m(function(){return N.current},[]),ce=m(function(Je){N.current=Je},[]),he=A(function(){return{eventName:"touchstart",fn:function(Je){if(Je.defaultPrevented)return;var _t=P.findClosestDraggableId(Je);if(!_t)return;var gn=P.tryGetLock(_t,Ae,{sourceEvent:Je});if(!gn)return;var xn=Je.touches[0],$n=xn.clientX,rr=xn.clientY,Tr={x:$n,y:rr};V.current(),ze(gn,Tr)}}},[P]),Oe=m(function(){var Je={capture:!0,passive:!1};V.current=Te(window,[he],Je)},[he]),Ae=m(function(){var Ge=N.current;if(Ge.type==="IDLE")return;Ge.type==="PENDING"&&clearTimeout(Ge.longPressTimerId),ce(ha),V.current(),Oe()},[Oe,ce]),Ke=m(function(){var Ge=N.current;Ae(),Ge.type==="DRAGGING"&&Ge.actions.cancel({shouldBlockNextClick:!0}),Ge.type==="PENDING"&&Ge.actions.abort()},[Ae]),tt=m(function(){var Je={capture:!0,passive:!1},_t={cancel:Ke,completed:Ae,getPhase:re},gn=Te(window,fa(_t),Je),xn=Te(window,$o(_t),Je);V.current=function(){gn(),xn()}},[Ke,re,Ae]),it=m(function(){var Je=re();Je.type==="PENDING"||_(!1);var _t=Je.actions.fluidLift(Je.point);ce({type:"DRAGGING",actions:_t,hasMoved:!1})},[re,ce]),ze=m(function(Je,_t){re().type==="IDLE"||_(!1);var gn=setTimeout(it,Vo);ce({type:"PENDING",point:_t,actions:Je,longPressTimerId:gn}),tt()},[tt,re,ce,it]);ti(function(){return Oe(),function(){V.current();var _t=re();_t.type==="PENDING"&&(clearTimeout(_t.longPressTimerId),ce(ha))}},[re,Oe,ce]),ti(function(){var Je=Te(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return Je},[])}function Yo(P){Pa(function(){var N=La(P);da(function(){N.current.length===P.length||_(!1)})})}var Qo={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function $s(P,N){if(N==null)return!1;var V=Boolean(Qo[N.tagName.toLowerCase()]);if(V)return!0;var re=N.getAttribute("contenteditable");return re==="true"||re===""?!0:N===P?!1:$s(P,N.parentElement)}function pa(P,N){var V=N.target;return Oa(V)?$s(P,V):!1}var Jo=function(P){return p(P.getBoundingClientRect()).center};function cs(P){return P instanceof Po(P).Element}var qo=function(){var P="matches";if(typeof document=="undefined")return P;var N=[P,"msMatchesSelector","webkitMatchesSelector"],V=We(N,function(re){return re in Element.prototype});return V||P}();function ma(P,N){return P==null?null:P[qo](N)?P:ma(P.parentElement,N)}function kl(P,N){return P.closest?P.closest(N):ma(P,N)}function ga(P){return"["+la.contextId+'="'+P+'"]'}function Zo(P,N){var V=N.target;if(!cs(V))return null;var re=ga(P),ce=kl(V,re);return ce&&Oa(ce)?ce:null}function el(P,N){var V=Zo(P,N);return V?V.getAttribute(la.draggableId):null}function tl(P,N){var V="["+Fs.contextId+'="'+P+'"]',re=lt(document.querySelectorAll(V)),ce=We(re,function(he){return he.getAttribute(Fs.id)===N});return ce&&Oa(ce)?ce:null}function ka(P){P.preventDefault()}function ji(P){var N=P.expected,V=P.phase,re=P.isLockActive,ce=P.shouldWarn;return re()?!(N!==V):!1}function va(P){var N=P.lockAPI,V=P.store,re=P.registry,ce=P.draggableId;if(N.isClaimed())return!1;var he=re.draggable.findById(ce);return he&&he.options.isEnabled?!!Ms(V.getState(),ce):!1}function Ma(P){var N=P.lockAPI,V=P.contextId,re=P.store,ce=P.registry,he=P.draggableId,Oe=P.forceSensorStop,Ae=P.sourceEvent,Ke=va({lockAPI:N,store:re,registry:ce,draggableId:he});if(!Ke)return null;var tt=ce.draggable.getById(he),it=tl(V,tt.descriptor.id);if(!it)return null;if(Ae&&!tt.options.canDragInteractiveElements&&pa(it,Ae))return null;var ze=N.claim(Oe||Se),Ge="PRE_DRAG";function Je(){return tt.options.shouldRespectForcePress}function _t(){return N.isActive(ze)}function gn(Pr,Br){ji({expected:Pr,phase:Ge,isLockActive:_t,shouldWarn:!0})&&re.dispatch(Br())}var xn=gn.bind(null,"DRAGGING");function $n(Pr){function Br(){N.release(),Ge="COMPLETED"}Ge!=="PRE_DRAG"&&(Br(),Ge==="PRE_DRAG"||_(!1)),re.dispatch(pn(Pr.liftActionArgs)),Ge="DRAGGING";function $r(e,n){if(n===void 0&&(n={shouldBlockNextClick:!1}),Pr.cleanup(),n.shouldBlockNextClick){var d=Te(window,[{eventName:"click",fn:ka,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(d)}Br(),re.dispatch(Si({reason:e}))}return Object(Z.a)({isActive:function(){return ji({expected:"DRAGGING",phase:Ge,isLockActive:_t,shouldWarn:!1})},shouldRespectForcePress:Je,drop:function(n){return $r("DROP",n)},cancel:function(n){return $r("CANCEL",n)}},Pr.actions)}function rr(Pr){var Br=w(function(e){xn(function(){return Jn({client:e})})}),$r=$n({liftActionArgs:{id:he,clientSelection:Pr,movementMode:"FLUID"},cleanup:function(){return Br.cancel()},actions:{move:Br}});return Object(Z.a)({},$r,{move:Br})}function Tr(){var Pr={moveUp:function(){return xn(wr)},moveRight:function(){return xn(Vr)},moveDown:function(){return xn(Ur)},moveLeft:function(){return xn(Fr)}};return $n({liftActionArgs:{id:he,clientSelection:Jo(it),movementMode:"SNAP"},cleanup:Se,actions:Pr})}function nr(){var Pr=ji({expected:"PRE_DRAG",phase:Ge,isLockActive:_t,shouldWarn:!0});Pr&&N.release()}var Mr={isActive:function(){return ji({expected:"PRE_DRAG",phase:Ge,isLockActive:_t,shouldWarn:!1})},shouldRespectForcePress:Je,fluidLift:rr,snapLift:Tr,abort:nr};return Mr}var nl=[Ko,ni,ds];function Ml(P){var N=P.contextId,V=P.store,re=P.registry,ce=P.customSensors,he=P.enableDefaultSensors,Oe=[].concat(he?nl:[],ce||[]),Ae=Object(ne.useState)(function(){return Ia()})[0],Ke=m(function(rr,Tr){rr.isDragging&&!Tr.isDragging&&Ae.tryAbandon()},[Ae]);ti(function(){var rr=V.getState(),Tr=V.subscribe(function(){var nr=V.getState();Ke(rr,nr),rr=nr});return Tr},[Ae,V,Ke]),ti(function(){return Ae.tryAbandon},[Ae.tryAbandon]);var tt=m(function($n){return va({lockAPI:Ae,registry:re,store:V,draggableId:$n})},[Ae,re,V]),it=m(function($n,rr,Tr){return Ma({lockAPI:Ae,registry:re,contextId:N,store:V,draggableId:$n,forceSensorStop:rr,sourceEvent:Tr&&Tr.sourceEvent?Tr.sourceEvent:null})},[N,Ae,re,V]),ze=m(function($n){return el(N,$n)},[N]),Ge=m(function($n){var rr=re.draggable.findById($n);return rr?rr.options:null},[re.draggable]),Je=m(function(){if(!Ae.isClaimed())return;Ae.tryAbandon(),V.getState().phase!=="IDLE"&&V.dispatch(kr())},[Ae,V]),_t=m(Ae.isClaimed,[Ae]),gn=A(function(){return{canGetLock:tt,tryGetLock:it,findClosestDraggableId:ze,findOptionsForDraggable:Ge,tryReleaseLock:Je,isLockClaimed:_t}},[tt,it,ze,Ge,Je,_t]);Yo(Oe);for(var xn=0;xn<Oe.length;xn++)Oe[xn](gn)}var rl=function(N){return{onBeforeCapture:N.onBeforeCapture,onBeforeDragStart:N.onBeforeDragStart,onDragStart:N.onDragStart,onDragEnd:N.onDragEnd,onDragUpdate:N.onDragUpdate}};function bi(P){return P.current||_(!1),P.current}function _a(P){var N=P.contextId,V=P.setCallbacks,re=P.sensors,ce=P.nonce,he=P.dragHandleUsageInstructions,Oe=Object(ne.useRef)(null);Al();var Ae=La(P),Ke=m(function(){return rl(Ae.current)},[Ae]),tt=Ws(N),it=Mo({contextId:N,text:he}),ze=Sl(N,ce),Ge=m(function(e){bi(Oe).dispatch(e)},[]),Je=A(function(){return Object(G.b)({publishWhileDragging:zn,updateDroppableScroll:Ir,updateDroppableIsEnabled:jr,updateDroppableIsCombineEnabled:Er,collectionStarting:mn},Ge)},[Ge]),_t=Rl(),gn=A(function(){return ks(_t,Je)},[_t,Je]),xn=A(function(){return Cl(Object(Z.a)({scrollWindow:Eo,scrollDroppable:gn.scrollDroppable},Object(G.b)({move:Jn},Ge)))},[gn.scrollDroppable,Ge]),$n=Lo(N),rr=A(function(){return Ni({announce:tt,autoScroller:xn,dimensionMarshal:gn,focusMarshal:$n,getResponders:Ke,styleMarshal:ze})},[tt,xn,gn,$n,Ke,ze]);Oe.current=rr;var Tr=m(function(){var e=bi(Oe),n=e.getState();n.phase!=="IDLE"&&e.dispatch(kr())},[]),nr=m(function(){var e=bi(Oe).getState();return e.isDragging||e.phase==="DROP_ANIMATING"},[]),Mr=A(function(){return{isDragging:nr,tryAbort:Tr}},[nr,Tr]);V(Mr);var Pr=m(function(e){return Ms(bi(Oe).getState(),e)},[]),Br=m(function(){return vr(bi(Oe).getState())},[]),$r=A(function(){return{marshal:gn,focus:$n,contextId:N,canLift:Pr,isMovementAllowed:Br,dragHandleUsageInstructionsId:it,registry:_t}},[N,gn,it,$n,Pr,Br,_t]);return Ml({contextId:N,store:rr,registry:_t,customSensors:re,enableDefaultSensors:P.enableDefaultSensors!==!1}),Object(ne.useEffect)(function(){return Tr},[Tr]),Q.a.createElement(rs.Provider,{value:$r},Q.a.createElement(M.a,{context:Aa,store:rr},P.children))}var ya=0;function Nl(){ya=0}function il(){return A(function(){return""+ya++},[])}function iu(){Nl(),Ol()}function Ul(P){var N=il(),V=P.dragHandleUsageInstructions||Ye.dragHandleUsageInstructions;return Q.a.createElement(L,null,function(re){return Q.a.createElement(_a,{nonce:P.nonce,contextId:N,setCallbacks:re,dragHandleUsageInstructions:V,enableDefaultSensors:P.enableDefaultSensors,sensors:P.sensors,onBeforeCapture:P.onBeforeCapture,onBeforeDragStart:P.onBeforeDragStart,onDragStart:P.onDragStart,onDragUpdate:P.onDragUpdate,onDragEnd:P.onDragEnd},P.children)})}var Ys=function(N){return function(V){return N===V}},ui=Ys("scroll"),al=Ys("auto"),Fl=Ys("visible"),sl=function(N,V){return V(N.overflowX)||V(N.overflowY)},Bl=function(N,V){return V(N.overflowX)&&V(N.overflowY)},Qs=function(N){var V=window.getComputedStyle(N),re={overflowX:V.overflowX,overflowY:V.overflowY};return sl(re,ui)||sl(re,al)},ol=function(){return!1;var N,V;if(!Qs(N))return!1;var re,ce;if(Bl(ce,Fl))return!1},Js=function P(N){return N==null?null:N===document.body?ol()?N:null:N===document.documentElement?null:Qs(N)?N:P(N.parentElement)},au=function(P){if(!P)return;var N=Js(P.parentElement);if(!N)return},qs=function(P){return{x:P.scrollLeft,y:P.scrollTop}},jl=function P(N){if(!N)return!1;var V=window.getComputedStyle(N);return V.position==="fixed"?!0:P(N.parentElement)},Wi=function(P){var N=Js(P),V=jl(P);return{closestScrollable:N,isFixedOnPage:V}},Na=function(P){var N=P.descriptor,V=P.isEnabled,re=P.isCombineEnabled,ce=P.isFixedOnPage,he=P.direction,Oe=P.client,Ae=P.page,Ke=P.closest,tt=function(){if(!Ke)return null;var Je=Ke.scrollSize,_t=Ke.client,gn=Ls({scrollHeight:Je.scrollHeight,scrollWidth:Je.scrollWidth,height:_t.paddingBox.height,width:_t.paddingBox.width});return{pageMarginBox:Ke.page.marginBox,frameClient:_t,scrollSize:Je,shouldClipSubject:Ke.shouldClipSubject,scroll:{initial:Ke.scroll,current:Ke.scroll,max:gn,diff:{value:Xe,displacement:Xe}}}}(),it=he==="vertical"?Dn:qn,ze=de({page:Ae,withPlaceholder:null,axis:it,frame:tt}),Ge={descriptor:N,isCombineEnabled:re,isFixedOnPage:ce,axis:it,isEnabled:V,client:Oe,page:Ae,frame:tt,subject:ze};return Ge},hs=function(N,V){var re=D(N);if(!V)return re;if(N!==V)return re;var ce=re.paddingBox.top-V.scrollTop,he=re.paddingBox.left-V.scrollLeft,Oe=ce+V.scrollHeight,Ae=he+V.scrollWidth,Ke={top:ce,right:Ae,bottom:Oe,left:he},tt=a(Ke,re.border),it=t({borderBox:tt,margin:re.margin,border:re.border,padding:re.padding});return it},Ua=function(P){var N=P.ref,V=P.descriptor,re=P.env,ce=P.windowScroll,he=P.direction,Oe=P.isDropDisabled,Ae=P.isCombineEnabled,Ke=P.shouldClipSubject,tt=re.closestScrollable,it=hs(N,tt),ze=T(it,ce),Ge=function(){if(!tt)return null;var _t=D(tt),gn={scrollHeight:tt.scrollHeight,scrollWidth:tt.scrollWidth};return{client:_t,page:T(_t,ce),scroll:qs(tt),scrollSize:gn,shouldClipSubject:Ke}}(),Je=Na({descriptor:V,isEnabled:!Oe,isCombineEnabled:Ae,isFixedOnPage:re.isFixedOnPage,direction:he,client:it,page:ze,closest:Ge});return Je},Li={passive:!1},Wl={passive:!0},ll=function(P){return P.shouldPublishImmediately?Li:Wl};function Ii(P){var N=Object(ne.useContext)(P);return N||_(!1),N}var Fa=function(N){return N&&N.env.closestScrollable||null};function ul(P){var N=Object(ne.useRef)(null),V=Ii(rs),re=ua("droppable"),ce=V.registry,he=V.marshal,Oe=La(P),Ae=A(function(){return{id:P.droppableId,type:P.type,mode:P.mode}},[P.droppableId,P.mode,P.type]),Ke=Object(ne.useRef)(Ae),tt=A(function(){return h(function(nr,Mr){N.current||_(!1);var Pr={x:nr,y:Mr};he.updateDroppableScroll(Ae.id,Pr)})},[Ae.id,he]),it=m(function(){var nr=N.current;return!nr||!nr.env.closestScrollable?Xe:qs(nr.env.closestScrollable)},[]),ze=m(function(){var nr=it();tt(nr.x,nr.y)},[it,tt]),Ge=A(function(){return w(ze)},[ze]),Je=m(function(){var nr=N.current,Mr=Fa(nr);nr&&Mr||_(!1);var Pr=nr.scrollOptions;if(Pr.shouldPublishImmediately){ze();return}Ge()},[Ge,ze]),_t=m(function(nr,Mr){N.current&&_(!1);var Pr=Oe.current,Br=Pr.getDroppableRef();Br||_(!1);var $r=Wi(Br),e={ref:Br,descriptor:Ae,env:$r,scrollOptions:Mr};N.current=e;var n=Ua({ref:Br,descriptor:Ae,env:$r,windowScroll:nr,direction:Pr.direction,isDropDisabled:Pr.isDropDisabled,isCombineEnabled:Pr.isCombineEnabled,shouldClipSubject:!Pr.ignoreContainerClipping}),d=$r.closestScrollable;return d&&(d.setAttribute(Do.contextId,V.contextId),d.addEventListener("scroll",Je,ll(e.scrollOptions))),n},[V.contextId,Ae,Je,Oe]),gn=m(function(){var nr=N.current,Mr=Fa(nr);return nr&&Mr||_(!1),qs(Mr)},[]),xn=m(function(){var nr=N.current;nr||_(!1);var Mr=Fa(nr);if(N.current=null,!Mr)return;Ge.cancel(),Mr.removeAttribute(Do.contextId),Mr.removeEventListener("scroll",Je,ll(nr.scrollOptions))},[Je,Ge]),$n=m(function(nr){var Mr=N.current;Mr||_(!1);var Pr=Fa(Mr);Pr||_(!1),Pr.scrollTop+=nr.y,Pr.scrollLeft+=nr.x},[]),rr=A(function(){return{getDimensionAndWatchScroll:_t,getScrollWhileDragging:gn,dragStopped:xn,scroll:$n}},[xn,_t,gn,$n]),Tr=A(function(){return{uniqueId:re,descriptor:Ae,callbacks:rr}},[rr,Ae,re]);ti(function(){return Ke.current=Tr.descriptor,ce.droppable.register(Tr),function(){N.current&&xn(),ce.droppable.unregister(Tr)}},[rr,Ae,xn,Tr,he,ce.droppable]),ti(function(){if(!N.current)return;he.updateDroppableIsEnabled(Ke.current.id,!P.isDropDisabled)},[P.isDropDisabled,he]),ti(function(){if(!N.current)return;he.updateDroppableIsCombineEnabled(Ke.current.id,P.isCombineEnabled)},[P.isCombineEnabled,he])}function fs(){}var Ba={width:0,height:0,margin:ae},ba=function(N){var V=N.isAnimatingOpenOnMount,re=N.placeholder,ce=N.animate;return V||ce==="close"?Ba:{height:re.client.borderBox.height,width:re.client.borderBox.width,margin:re.client.margin}},Zs=function(N){var V=N.isAnimatingOpenOnMount,re=N.placeholder,ce=N.animate,he=ba({isAnimatingOpenOnMount:V,placeholder:re,animate:ce});return{display:re.display,boxSizing:"border-box",width:he.width,height:he.height,marginTop:he.margin.top,marginRight:he.margin.right,marginBottom:he.margin.bottom,marginLeft:he.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:ce!=="none"?Ji.placeholder:null}};function eo(P){var N=Object(ne.useRef)(null),V=m(function(){if(!N.current)return;clearTimeout(N.current),N.current=null},[]),re=P.animate,ce=P.onTransitionEnd,he=P.onClose,Oe=P.contextId,Ae=Object(ne.useState)(P.animate==="open"),Ke=Ae[0],tt=Ae[1];Object(ne.useEffect)(function(){return Ke?re!=="open"?(V(),tt(!1),fs):N.current?fs:(N.current=setTimeout(function(){N.current=null,tt(!1)}),V):fs},[re,Ke,V]);var it=m(function(Ge){if(Ge.propertyName!=="height")return;ce(),re==="close"&&he()},[re,he,ce]),ze=Zs({isAnimatingOpenOnMount:Ke,animate:P.animate,placeholder:P.placeholder});return Q.a.createElement(P.placeholder.tagName,{style:ze,"data-rbd-placeholder-context-id":Oe,onTransitionEnd:it,ref:P.innerRef})}var to=Q.a.memo(eo),no=Q.a.createContext(null);function Ea(P){P&&Oa(P)||_(!1)}function ps(P){return typeof P=="boolean"}function ro(P,N){N.forEach(function(V){return V(P)})}var dl=[function(N){var V=N.props;V.droppableId||_(!1),typeof V.droppableId=="string"||_(!1)},function(N){var V=N.props;ps(V.isDropDisabled)||_(!1),ps(V.isCombineEnabled)||_(!1),ps(V.ignoreContainerClipping)||_(!1)},function(N){var V=N.getDroppableRef;Ea(V())}],ms=[function(N){var V=N.props,re=N.getPlaceholderRef;if(!V.placeholder)return;var ce=re();if(ce)return}],Hl=[function(N){var V=N.props;V.renderClone||_(!1)},function(N){var V=N.getPlaceholderRef;V()&&_(!1)}];function Kl(P){da(function(){ro(P,dl),P.props.mode==="standard"&&ro(P,ms),P.props.mode==="virtual"&&ro(P,Hl)})}var ja=function(P){Object(U.a)(N,P);function N(){for(var re,ce=arguments.length,he=new Array(ce),Oe=0;Oe<ce;Oe++)he[Oe]=arguments[Oe];return re=P.call.apply(P,[this].concat(he))||this,re.state={isVisible:Boolean(re.props.on),data:re.props.on,animate:re.props.shouldAnimate&&re.props.on?"open":"none"},re.onClose=function(){if(re.state.animate!=="close")return;re.setState({isVisible:!1})},re}N.getDerivedStateFromProps=function(ce,he){return ce.shouldAnimate?ce.on?{isVisible:!0,data:ce.on,animate:"open"}:he.isVisible?{isVisible:!0,data:he.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(ce.on),data:ce.on,animate:"none"}};var V=N.prototype;return V.render=function(){if(!this.state.isVisible)return null;var ce={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(ce)},N}(Q.a.PureComponent),io={dragging:5e3,dropAnimating:4500},cl=function(N,V){return V?Ji.drop(V.duration):N?Ji.snap:Ji.fluid},Gl=function(N,V){return N?V?Ki.opacity.drop:Ki.opacity.combining:null},ao=function(N){return N.forceShouldAnimate!=null?N.forceShouldAnimate:N.mode==="SNAP"};function hl(P){var N=P.dimension,V=N.client,re=P.offset,ce=P.combineWith,he=P.dropping,Oe=Boolean(ce),Ae=ao(P),Ke=Boolean(he),tt=Ke?bs.drop(re,Oe):bs.moveTo(re),it={position:"fixed",top:V.marginBox.top,left:V.marginBox.left,boxSizing:"border-box",width:V.borderBox.width,height:V.borderBox.height,transition:cl(Ae,he),transform:tt,opacity:Gl(Oe,Ke),zIndex:Ke?io.dropAnimating:io.dragging,pointerEvents:"none"};return it}function zl(P){return{transform:bs.moveTo(P.offset),transition:P.shouldAnimateDisplacement?null:"none"}}function fl(P){return P.type==="DRAGGING"?hl(P):zl(P)}function pl(P,N,V){V===void 0&&(V=Xe);var re=window.getComputedStyle(N),ce=N.getBoundingClientRect(),he=S(ce,re),Oe=T(he,V),Ae={client:he,tagName:N.tagName.toLowerCase(),display:re.display},Ke={x:he.marginBox.width,y:he.marginBox.height},tt={descriptor:P,placeholder:Ae,displaceBy:Ke,client:he,page:Oe};return tt}function Vl(P){var N=ua("draggable"),V=P.descriptor,re=P.registry,ce=P.getDraggableRef,he=P.canDragInteractiveElements,Oe=P.shouldRespectForcePress,Ae=P.isEnabled,Ke=A(function(){return{canDragInteractiveElements:he,shouldRespectForcePress:Oe,isEnabled:Ae}},[he,Ae,Oe]),tt=m(function(Je){var _t=ce();return _t||_(!1),pl(V,_t,Je)},[V,ce]),it=A(function(){return{uniqueId:N,descriptor:V,options:Ke,getDimension:tt}},[V,tt,Ke,N]),ze=Object(ne.useRef)(it),Ge=Object(ne.useRef)(!0);ti(function(){return re.draggable.register(ze.current),function(){return re.draggable.unregister(ze.current)}},[re.draggable]),ti(function(){if(Ge.current){Ge.current=!1;return}var Je=ze.current;ze.current=it,re.draggable.update(it,Je)},[it,re.draggable])}function so(P,N,V){da(function(){function re(he){return"Draggable[id: "+he+"]: "}var ce=P.draggableId;if(ce||_(!1),typeof ce=="string"||_(!1),De(P.index)||_(!1),P.mapped.type==="DRAGGING")return;Ea(V()),P.isEnabled&&(ns(N,ce)||_(!1))})}function Wa(P){Pa(function(){var N=Object(ne.useRef)(P);da(function(){P===N.current||_(!1)},[P])})}function Ha(P){P.preventDefault()}function Xl(P){var N=Object(ne.useRef)(null),V=m(function(e){N.current=e},[]),re=m(function(){return N.current},[]),ce=Ii(rs),he=ce.contextId,Oe=ce.dragHandleUsageInstructionsId,Ae=ce.registry,Ke=Ii(no),tt=Ke.type,it=Ke.droppableId,ze=A(function(){return{id:P.draggableId,index:P.index,type:tt,droppableId:it}},[P.draggableId,P.index,tt,it]),Ge=P.children,Je=P.draggableId,_t=P.isEnabled,gn=P.shouldRespectForcePress,xn=P.canDragInteractiveElements,$n=P.isClone,rr=P.mapped,Tr=P.dropAnimationFinished;if(so(P,he,re),Wa($n),!$n){var nr=A(function(){return{descriptor:ze,registry:Ae,getDraggableRef:re,canDragInteractiveElements:xn,shouldRespectForcePress:gn,isEnabled:_t}},[ze,Ae,re,xn,gn,_t]);Vl(nr)}var Mr=A(function(){return _t?{tabIndex:0,role:"button","aria-describedby":Oe,"data-rbd-drag-handle-draggable-id":Je,"data-rbd-drag-handle-context-id":he,draggable:!1,onDragStart:Ha}:null},[he,Oe,Je,_t]),Pr=m(function(e){if(rr.type!=="DRAGGING")return;if(!rr.dropping)return;if(e.propertyName!=="transform")return;Tr()},[Tr,rr]),Br=A(function(){var e=fl(rr),n=rr.type==="DRAGGING"&&rr.dropping?Pr:null,d={innerRef:V,draggableProps:{"data-rbd-draggable-context-id":he,"data-rbd-draggable-id":Je,style:e,onTransitionEnd:n},dragHandleProps:Mr};return d},[he,Mr,Je,rr,Pr,V]),$r=A(function(){return{draggableId:ze.id,type:ze.type,source:{index:ze.index,droppableId:ze.droppableId}}},[ze.droppableId,ze.id,ze.index,ze.type]);return Ge(Br,rr.snapshot,$r)}var oo=function(P,N){return P===N},ml=function(P){var N=P.combine,V=P.destination;return V?V.droppableId:N?N.droppableId:null},$l=function(N){return N.combine?N.combine.draggableId:null},Yl=function(N){return N.at&&N.at.type==="COMBINE"?N.at.combine.draggableId:null};function Ql(){var P=h(function(ce,he){return{x:ce,y:he}}),N=h(function(ce,he,Oe,Ae,Ke){return{isDragging:!0,isClone:he,isDropAnimating:Boolean(Ke),dropAnimation:Ke,mode:ce,draggingOver:Oe,combineWith:Ae,combineTargetFor:null}}),V=h(function(ce,he,Oe,Ae,Ke,tt,it){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:Ke,combineWith:tt,mode:he,offset:ce,dimension:Oe,forceShouldAnimate:it,snapshot:N(he,Ae,Ke,tt,null)}}}),re=function(he,Oe){if(he.isDragging){if(he.critical.draggable.id!==Oe.draggableId)return null;var Ae=he.current.client.offset,Ke=he.dimensions.draggables[Oe.draggableId],tt=dn(he.impact),it=Yl(he.impact),ze=he.forceShouldAnimate;return V(P(Ae.x,Ae.y),he.movementMode,Ke,Oe.isClone,tt,it,ze)}if(he.phase==="DROP_ANIMATING"){var Ge=he.completed;if(Ge.result.draggableId!==Oe.draggableId)return null;var Je=Oe.isClone,_t=he.dimensions.draggables[Oe.draggableId],gn=Ge.result,xn=gn.mode,$n=ml(gn),rr=$l(gn),Tr=he.dropDuration,nr={duration:Tr,curve:Xa.drop,moveTo:he.newHomeClientOffset,opacity:rr?Ki.opacity.drop:null,scale:rr?Ki.scale.drop:null};return{mapped:{type:"DRAGGING",offset:he.newHomeClientOffset,dimension:_t,dropping:nr,draggingOver:$n,combineWith:rr,mode:xn,forceShouldAnimate:null,snapshot:N(xn,Je,$n,rr,nr)}}}return null};return re}function lo(P){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:P,combineWith:null}}var Jl={mapped:{type:"SECONDARY",offset:Xe,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:lo(null)}};function ql(){var P=h(function(Oe,Ae){return{x:Oe,y:Ae}}),N=h(lo),V=h(function(Oe,Ae,Ke){return Ae===void 0&&(Ae=null),{mapped:{type:"SECONDARY",offset:Oe,combineTargetFor:Ae,shouldAnimateDisplacement:Ke,snapshot:N(Ae)}}}),re=function(Ae){return Ae?V(Xe,Ae,!0):null},ce=function(Ae,Ke,tt,it){var ze=tt.displaced.visible[Ae],Ge=Boolean(it.inVirtualList&&it.effected[Ae]),Je=rn(tt),_t=Je&&Je.draggableId===Ae?Ke:null;if(!ze){if(!Ge)return re(_t);if(tt.displaced.invisible[Ae])return null;var gn=Wt(it.displacedBy.point),xn=P(gn.x,gn.y);return V(xn,_t,!0)}if(Ge)return re(_t);var $n=tt.displacedBy.point,rr=P($n.x,$n.y);return V(rr,_t,ze.shouldAnimate)},he=function(Ae,Ke){if(Ae.isDragging)return Ae.critical.draggable.id===Ke.draggableId?null:ce(Ke.draggableId,Ae.critical.draggable.id,Ae.impact,Ae.afterCritical);if(Ae.phase==="DROP_ANIMATING"){var tt=Ae.completed;return tt.result.draggableId===Ke.draggableId?null:ce(Ke.draggableId,tt.result.draggableId,tt.impact,tt.afterCritical)}return null};return he}var gl=function(){var N=Ql(),V=ql(),re=function(he,Oe){return N(he,Oe)||V(he,Oe)||Jl};return re},uo={dropAnimationFinished:ei},vl=Object(M.c)(gl,uo,null,{context:Aa,pure:!0,areStatePropsEqual:oo})(Xl);function _l(P){var N=Ii(no),V=N.isUsingCloneFor;return V===P.draggableId&&!P.isClone?null:Q.a.createElement(vl,P)}function yl(P){var N=typeof P.isDragDisabled=="boolean"?!P.isDragDisabled:!0,V=Boolean(P.disableInteractiveElementBlocking),re=Boolean(P.shouldRespectForcePress);return Q.a.createElement(_l,Object(Z.a)({},P,{isClone:!1,isEnabled:N,canDragInteractiveElements:V,shouldRespectForcePress:re}))}function xa(P){var N=Object(ne.useContext)(rs);N||_(!1);var V=N.contextId,re=N.isMovementAllowed,ce=Object(ne.useRef)(null),he=Object(ne.useRef)(null),Oe=P.children,Ae=P.droppableId,Ke=P.type,tt=P.mode,it=P.direction,ze=P.ignoreContainerClipping,Ge=P.isDropDisabled,Je=P.isCombineEnabled,_t=P.snapshot,gn=P.useClone,xn=P.updateViewportMaxScroll,$n=P.getContainerForClone,rr=m(function(){return ce.current},[]),Tr=m(function(l){ce.current=l},[]),nr=m(function(){return he.current},[]),Mr=m(function(l){he.current=l},[]);Kl({props:P,getDroppableRef:rr,getPlaceholderRef:nr});var Pr=m(function(){re()&&xn({maxScroll:Is()})},[re,xn]);ul({droppableId:Ae,type:Ke,mode:tt,direction:it,isDropDisabled:Ge,isCombineEnabled:Je,ignoreContainerClipping:ze,getDroppableRef:rr});var Br=Q.a.createElement(ja,{on:P.placeholder,shouldAnimate:P.shouldAnimatePlaceholder},function(l){var v=l.onClose,K=l.data,te=l.animate;return Q.a.createElement(to,{placeholder:K,onClose:v,innerRef:Mr,animate:te,contextId:V,onTransitionEnd:Pr})}),$r=A(function(){return{innerRef:Tr,placeholder:Br,droppableProps:{"data-rbd-droppable-id":Ae,"data-rbd-droppable-context-id":V}}},[V,Ae,Br,Tr]),e=gn?gn.dragging.draggableId:null,n=A(function(){return{droppableId:Ae,type:Ke,isUsingCloneFor:e}},[Ae,e,Ke]);function d(){if(!gn)return null;var l=gn.dragging,v=gn.render,K=Q.a.createElement(_l,{draggableId:l.draggableId,index:l.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(te,ie){return v(te,ie,l)});return W.a.createPortal(K,$n())}return Q.a.createElement(no.Provider,{value:n},Oe($r,_t),d())}var gs=function(N,V){return N===V.droppable.type},Ka=function(N,V){return V.draggables[N.draggable.id]},Zl=function(){var N={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},V=Object(Z.a)({},N,{shouldAnimatePlaceholder:!1}),re=h(function(Oe){return{draggableId:Oe.id,type:Oe.type,source:{index:Oe.index,droppableId:Oe.droppableId}}}),ce=h(function(Oe,Ae,Ke,tt,it,ze){var Ge=it.descriptor.id,Je=it.descriptor.droppableId===Oe;if(Je){var _t=ze?{render:ze,dragging:re(it.descriptor)}:null,gn={isDraggingOver:Ke,draggingOverWith:Ke?Ge:null,draggingFromThisWith:Ge,isUsingPlaceholder:!0};return{placeholder:it.placeholder,shouldAnimatePlaceholder:!1,snapshot:gn,useClone:_t}}if(!Ae)return V;if(!tt)return N;var xn={isDraggingOver:Ke,draggingOverWith:Ge,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:it.placeholder,shouldAnimatePlaceholder:!0,snapshot:xn,useClone:null}}),he=function(Ae,Ke){var tt=Ke.droppableId,it=Ke.type,ze=!Ke.isDropDisabled,Ge=Ke.renderClone;if(Ae.isDragging){var Je=Ae.critical;if(!gs(it,Je))return V;var _t=Ka(Je,Ae.dimensions),gn=dn(Ae.impact)===tt;return ce(tt,ze,gn,gn,_t,Ge)}if(Ae.phase==="DROP_ANIMATING"){var xn=Ae.completed;if(!gs(it,xn.critical))return V;var $n=Ka(xn.critical,Ae.dimensions);return ce(tt,ze,ml(xn.result)===tt,dn(xn.impact)===tt,$n,Ge)}if(Ae.phase==="IDLE"&&Ae.completed&&!Ae.shouldFlush){var rr=Ae.completed;if(!gs(it,rr.critical))return V;var Tr=dn(rr.impact)===tt,nr=Boolean(rr.impact.at&&rr.impact.at.type==="COMBINE"),Mr=rr.critical.droppable.id===tt;return Tr?nr?N:V:Mr?N:V}return V};return he},eu={updateViewportMaxScroll:br};function tu(){return document.body||_(!1),document.body}var Hr={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:tu},bl=Object(M.c)(Zl,eu,null,{context:Aa,pure:!0,areStatePropsEqual:oo})(xa);bl.defaultProps=Hr},nnTU:function(Et,Pe,F){"use strict";F.d(Pe,"b",function(){return Y}),F.d(Pe,"a",function(){return X});var ne=F("MI8n"),Q=F("JYp7"),U=F("pmY6"),Z=F("24hK"),G=F("746U"),M=F("Cg/j");const Y=Object(M.c)("commandService"),X=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,A){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!A)throw new Error("invalid command");return this.registerCommand({id:r,handler:A})}if(r.description){const c=[];for(let i of r.description.args)c.push(i.constraint);const s=r.handler;r.handler=function(i,...t){return Object(G.o)(t,c),s(i,...t)}}const{id:m}=r;let f=this._commands.get(m);f||(f=new Z.a,this._commands.set(m,f));let p=f.unshift(r),a=Object(U.i)(()=>{p();const c=this._commands.get(m);(c==null?void 0:c.isEmpty())&&this._commands.delete(m)});return this._onDidRegisterCommand.fire(m),a}registerCommandAlias(r,A){return X.registerCommand(r,(m,...f)=>m.get(Y).executeCommand(A,...f))}getCommand(r){const A=this._commands.get(r);return!A||A.isEmpty()?void 0:Q.a.first(A)}getCommands(){const r=new Map;for(const A of this._commands.keys()){const m=this.getCommand(A);m&&r.set(A,m)}return r}};X.registerCommand("noop",()=>{})},osHv:function(Et,Pe,F){(function(ne){ne(F("VrN/"))})(function(ne){"use strict";var Q=ne.Pos;function U(i,t){return i.line-t.line||i.ch-t.ch}var Z="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",G=Z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+Z+"]["+G+"]*)","g");function Y(i,t,u,o){this.line=t,this.ch=u,this.cm=i,this.text=i.getLine(t),this.min=o?Math.max(o.from,i.firstLine()):i.firstLine(),this.max=o?Math.min(o.to-1,i.lastLine()):i.lastLine()}function X(i,t){var u=i.cm.getTokenTypeAt(Q(i.line,t));return u&&/\btag\b/.test(u)}function r(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function A(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function m(i){for(;;){var t=i.text.indexOf(">",i.ch);if(t==-1){if(r(i))continue;return}if(!X(i,t+1)){i.ch=t+1;continue}var u=i.text.lastIndexOf("/",t),o=u>-1&&!/\S/.test(i.text.slice(u+1,t));return i.ch=t+1,o?"selfClose":"regular"}}function f(i){for(;;){var t=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(t==-1){if(A(i))continue;return}if(!X(i,t+1)){i.ch=t;continue}M.lastIndex=t,i.ch=t;var u=M.exec(i.text);if(u&&u.index==t)return u}}function p(i){for(;;){M.lastIndex=i.ch;var t=M.exec(i.text);if(!t){if(r(i))continue;return}if(!X(i,t.index+1)){i.ch=t.index+1;continue}return i.ch=t.index+t[0].length,t}}function a(i){for(;;){var t=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(t==-1){if(A(i))continue;return}if(!X(i,t+1)){i.ch=t;continue}var u=i.text.lastIndexOf("/",t),o=u>-1&&!/\S/.test(i.text.slice(u+1,t));return i.ch=t+1,o?"selfClose":"regular"}}function c(i,t){for(var u=[];;){var o=p(i),R,T=i.line,S=i.ch-(o?o[0].length:0);if(!o||!(R=m(i)))return;if(R=="selfClose")continue;if(o[1]){for(var D=u.length-1;D>=0;--D)if(u[D]==o[2]){u.length=D;break}if(D<0&&(!t||t==o[2]))return{tag:o[2],from:Q(T,S),to:Q(i.line,i.ch)}}else u.push(o[2])}}function s(i,t){for(var u=[];;){var o=a(i);if(!o)return;if(o=="selfClose"){f(i);continue}var R=i.line,T=i.ch,S=f(i);if(!S)return;if(S[1])u.push(S[2]);else{for(var D=u.length-1;D>=0;--D)if(u[D]==S[2]){u.length=D;break}if(D<0&&(!t||t==S[2]))return{tag:S[2],from:Q(i.line,i.ch),to:Q(R,T)}}}}ne.registerHelper("fold","xml",function(i,t){for(var u=new Y(i,t.line,0);;){var o=p(u);if(!o||u.line!=t.line)return;var R=m(u);if(!R)return;if(!o[1]&&R!="selfClose"){var T=Q(u.line,u.ch),S=c(u,o[2]);return S&&U(S.from,T)>0?{from:T,to:S.from}:null}}}),ne.findMatchingTag=function(i,t,u){var o=new Y(i,t.line,t.ch,u);if(o.text.indexOf(">")==-1&&o.text.indexOf("<")==-1)return;var R=m(o),T=R&&Q(o.line,o.ch),S=R&&f(o);if(!R||!S||U(o,t)>0)return;var D={from:Q(o.line,o.ch),to:T,tag:S[2]};return R=="selfClose"?{open:D,close:null,at:"open"}:S[1]?{open:s(o,S[2]),close:D,at:"close"}:(o=new Y(i,T.line,T.ch,u),{open:D,close:c(o,S[2]),at:"open"})},ne.findEnclosingTag=function(i,t,u,o){for(var R=new Y(i,t.line,t.ch,u);;){var T=s(R,o);if(!T)break;var S=new Y(i,t.line,t.ch,u),D=c(S,T.tag);if(D)return{open:T,close:D}}},ne.scanForClosingTag=function(i,t,u,o){var R=new Y(i,t.line,t.ch,o?{from:0,to:o}:null);return c(R,u)}})},p5ED:function(Et,Pe,F){"use strict";var ne=F("+L6B"),Q=F("2/Rp"),U=F("5Dmo"),Z=F("3S7+"),G=F("k1fw"),M=F("9og8"),Y=F("tJVT"),X=F("WmNS"),r=F.n(X),A=F("q1tI"),m=F.n(A),f=F("vHTk"),p=F.n(f),a=F("yEEn"),c=F("ZW9T"),s=F("1vsH"),i=F("V0Rq"),t=F("m3rI");Pe.a=function(u){var o,R,T,S,D,I,E,x=u.editOffice,g=x===void 0?"view":x,h=u.data,O=u.theme,w=u.type,b=u.filename,W=u.monacoEditor,j=u.className,C=u.style,B=u.close,k=u.onClose,y=u.hasMask,H=u.disabledDownload,J=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),se=Object(Y.a)(J,2),fe=se[0],ve=se[1],Se=Object(A.useState)(""),Ue=Object(Y.a)(Se,2),Te=Ue[0],Ie=Ue[1],be=Object(A.useState)(),q=Object(Y.a)(be,2),_=q[0],L=q[1],z=window.ENV==="build"?"/react/build":"",ee=t.a.PROXY_SERVER||location.origin,$,Ee=1024*1024,Be=10*Ee,nt=Object(A.useRef)();(o=h)!==null&&o!==void 0&&o.startsWith("/api")&&w!=="txt"&&(h=(t.a.API_SERVER||location.origin)+h),w==="office"&&($=Object(s.T)(h).filesize,$>Be&&(w="other")),b&&W&&(W.filename=b),Object(A.useEffect)(function(){var Xe,ht,wt=(Xe=document.cookie)===null||Xe===void 0||((ht=Xe.replace(/\s/g,""))===null||ht===void 0)?void 0:ht.split(";");wt==null||wt.map(function(Bt){var Wt=Bt.split("=");Wt[0]==="_educoder_session"&&Ie(Wt[1])})},[]),Object(A.useEffect)(function(){w==="office"&&we()},[w,h]);var we=function(){var Xe=Object(M.a)(r.a.mark(function ht(){var wt,Bt,Wt;return r.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return console.log("data:",h),wt=h,h.startsWith("http")||(wt=location.origin+wt),Bt=new URL(wt).pathname.split("/").pop(),Yt.next=6,Object(i.V)({attachment_id:Bt});case 6:Wt=Yt.sent,L(Wt);case 8:case"end":return Yt.stop()}},ht)}));return function(){return Xe.apply(this,arguments)}}(),Ne=function(){if(h.startsWith("http")||h.startsWith("blob:")){Ye();return}Object(s.z)(b||"educoder",h,b)},Ye=function(){Object(s.x)(b||"educoder",decodeURIComponent(h))};return m.a.createElement("div",{style:Object(G.a)({},C||{}),className:"".concat(y&&p.a.bgBlack," ").concat(w?p.a.wrp:"hide")},B&&m.a.createElement("div",{className:p.a.close,ref:nt},!H&&m.a.createElement(Z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return nt.current}},m.a.createElement("span",{onClick:Ye},m.a.createElement("i",{className:"icon-quxiaozhiding"}))),m.a.createElement(Z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return nt.current}},m.a.createElement("span",{className:"",onClick:k},m.a.createElement("i",{className:"icon-guanbi1"})))),m.a.createElement("div",{className:"".concat(p.a[j]," ").concat(j," ").concat(p.a.monaco," ").concat(w==="txt"?"show":"hide")},w==="txt"&&m.a.createElement(c.b,W)),w==="audio"&&m.a.createElement("audio",{src:"".concat(((R=h)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((T=h)===null||T===void 0?void 0:T.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(h),autoPlay:!0}),w==="video"&&m.a.createElement(m.a.Fragment,null,((S=h)===null||S===void 0?void 0:S.indexOf("http"))>-1?m.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):m.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),w==="office"&&_&&m.a.createElement("iframe",{src:"".concat(z,"/office.html?key=").concat(_.key,"&url=").concat(ee+_.url,"&callbackUrl=").concat(ee+_.callbackUrl,"&fileType=").concat(_.fileType,"&title=").concat(_.title,"&model=").concat(g,"&officeServer=").concat(t.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),w==="html"&&m.a.createElement("iframe",{src:h+"&disposition=inline"}),w==="pdf"&&m.a.createElement("iframe",{src:"".concat(z,"/js/pdfview/index.html?url=").concat(h,"&disabledDownload=").concat(!!H)}),w==="image"&&m.a.createElement("img",{src:"".concat(((D=h)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((I=h)===null||I===void 0?void 0:I.indexOf("https://"))>-1||(E=h)!==null&&E!==void 0&&E.startsWith("/api")?"":"data:image/png;base64,").concat(h)}),w==="other"&&m.a.createElement("div",null,m.a.createElement(Q.a,{type:"primary",size:"large",onClick:Ne},m.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),w==="download"&&m.a.createElement(Q.a,{type:"primary",size:"large",onClick:Ne},m.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Et,Pe,F){},pmY6:function(Et,Pe,F){"use strict";F.d(Pe,"h",function(){return A}),F.d(Pe,"g",function(){return f}),F.d(Pe,"f",function(){return p}),F.d(Pe,"e",function(){return a}),F.d(Pe,"i",function(){return c}),F.d(Pe,"b",function(){return s}),F.d(Pe,"a",function(){return i}),F.d(Pe,"d",function(){return t}),F.d(Pe,"c",function(){return u});var ne=F("C/vA"),Q=F("JYp7");const U=!1;let Z=null;function G(o){Z=o}if(U){const o="__is_disposable_tracked__";G(new class{trackDisposable(R){const T=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[o]||console.log(T)},3e3)}setParent(R,T){if(R&&R!==i.None)try{R[o]=!0}catch(S){}}markAsDisposed(R){if(R&&R!==i.None)try{R[o]=!0}catch(T){}}markAsSingleton(R){}})}function M(o){return Z==null||Z.trackDisposable(o),o}function Y(o){Z==null||Z.markAsDisposed(o)}function X(o,R){Z==null||Z.setParent(o,R)}function r(o,R){if(!Z)return;for(const T of o)Z.setParent(T,R)}function A(o){return Z==null||Z.markAsSingleton(o),o}class m extends Error{constructor(o){super(`Encountered errors while disposing of store. Errors: [${o.join(", ")}]`);this.errors=o}}function f(o){return typeof o.dispose=="function"&&o.dispose.length===0}function p(o){if(Q.a.is(o)){let R=[];for(const T of o)if(T)try{T.dispose()}catch(S){R.push(S)}if(R.length===1)throw R[0];if(R.length>1)throw new m(R);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function a(...o){const R=c(()=>p(o));return r(o,R),R}function c(o){const R=M({dispose:Object(ne.a)(()=>{Y(R),o()})});return R}class s{constructor(){this._toDispose=new Set,this._isDisposed=!1,M(this)}dispose(){if(this._isDisposed)return;Y(this),this._isDisposed=!0,this.clear()}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return X(o,this),this._isDisposed?s.DISABLE_DISPOSED_WARNING||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(o),o}}s.DISABLE_DISPOSED_WARNING=!1;class i{constructor(){this._store=new s,M(this),X(this._store,this)}dispose(){Y(this),this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}}i.None=Object.freeze({dispose(){}});class t{constructor(){this._isDisposed=!1,M(this)}get value(){return this._isDisposed?void 0:this._value}set value(o){var R;if(this._isDisposed||o===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),o&&X(o,this),this._value=o}clear(){this.value=void 0}dispose(){var o;this._isDisposed=!0,Y(this),(o=this._value)===null||o===void 0||o.dispose(),this._value=void 0}clearAndLeak(){const o=this._value;return this._value=void 0,o&&X(o,null),o}}class u{constructor(o){this.object=o}dispose(){}}},psGv:function(Et,Pe,F){var ne,Q;(function(){var U;(function(){"use strict";var Y=[,,function(m){function f(c){this.__parent=c,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}f.prototype.clone_empty=function(){var c=new f(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},f.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},f.prototype.has_match=function(c){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(c))return!0;return!1},f.prototype.set_indent=function(c,s){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},f.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(c){this.__items.push(c);var s=c.lastIndexOf(`
`);s!==-1?this.__character_count=c.length-s:this.__character_count+=c.length},f.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function p(c,s){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),s=s||"",c.indent_level>0&&(s=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}p.prototype.get_indent_size=function(c,s){var i=this.__base_string_length;return s=s||0,c<0&&(i=0),i+=c*this.__indent_size,i+=s,i},p.prototype.get_indent_string=function(c,s){var i=this.__base_string;return s=s||0,c<0&&(c=0,i=""),s+=c*this.__indent_size,this.__ensure_cache(s),i+=this.__cache[s],i},p.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var c=this.__cache.length,s=0,i="";this.__indent_size&&c>=this.__indent_size&&(s=Math.floor(c/this.__indent_size),c-=s*this.__indent_size,i=new Array(s+1).join(this.__indent_string)),c&&(i+=new Array(c+1).join(" ")),this.__cache.push(i)};function a(c,s){this.__indent_cache=new p(c,s),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(c,s){return this.__indent_cache.get_indent_string(c,s)},a.prototype.get_indent_size=function(c,s){return this.__indent_cache.get_indent_size(c,s)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(c){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return c!==`
`&&(i=i.replace(/[\n]/g,c)),i},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(c,s){return c=c||0,s=s||0,this.next_line.set_indent(c,s),this.__lines.length>1?(this.current_line.set_indent(c,s),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(c){for(var s=0;s<c.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},a.prototype.remove_indent=function(c){for(var s=this.__lines.length;c<s;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(c,s){for(var i=this.__lines.length-2;i>=0;){var t=this.__lines[i];if(t.is_empty())break;if(t.item(0).indexOf(c)!==0&&t.item(-1)!==s){this.__lines.splice(i+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},m.exports.Output=a},function(m){function f(p,a,c,s){this.type=p,this.text=a,this.comments_before=null,this.newlines=c||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}m.exports.Token=f},,,function(m){function f(c,s){this.raw_options=p(c,s),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}f.prototype._get_array=function(c,s){var i=this.raw_options[c],t=s||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(t=i.concat()):typeof i=="string"&&(t=i.split(/[^a-zA-Z0-9_\/\-]+/)),t},f.prototype._get_boolean=function(c,s){var i=this.raw_options[c],t=i===void 0?!!s:!!i;return t},f.prototype._get_characters=function(c,s){var i=this.raw_options[c],t=s||"";return typeof i=="string"&&(t=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),t},f.prototype._get_number=function(c,s){var i=this.raw_options[c];s=parseInt(s,10),isNaN(s)&&(s=0);var t=parseInt(i,10);return isNaN(t)&&(t=s),t},f.prototype._get_selection=function(c,s,i){var t=this._get_selection_list(c,s,i);if(t.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
`+s+`
You passed in: '`+this.raw_options[c]+"'");return t[0]},f.prototype._get_selection_list=function(c,s,i){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[s[0]],!this._is_valid_selection(i,s))throw new Error("Invalid Default Value!");var t=this._get_array(c,i);if(!this._is_valid_selection(t,s))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
`+s+`
You passed in: '`+this.raw_options[c]+"'");return t},f.prototype._is_valid_selection=function(c,s){return c.length&&s.length&&!c.some(function(i){return s.indexOf(i)===-1})};function p(c,s){var i={};c=a(c);var t;for(t in c)t!==s&&(i[t]=c[t]);if(s&&c[s])for(t in c[s])i[t]=c[s][t];return i}function a(c){var s={},i;for(i in c){var t=i.replace(/-/g,"_");s[t]=c[i]}return s}m.exports.Options=f,m.exports.normalizeOpts=a,m.exports.mergeOpts=p},,function(m){var f=RegExp.prototype.hasOwnProperty("sticky");function p(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},p.prototype.peek=function(a){var c=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(c=this.__input.charAt(a)),c},p.prototype.__match=function(a,c){a.lastIndex=c;var s=a.exec(this.__input);return s&&!(f&&a.sticky)&&(s.index!==c&&(s=null)),s},p.prototype.test=function(a,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(a,c):!1},p.prototype.testChar=function(a,c){var s=this.peek(c);return a.lastIndex=0,s!==null&&a.test(s)},p.prototype.match=function(a){var c=this.__match(a,this.__position);return c?this.__position+=c[0].length:c=null,c},p.prototype.read=function(a,c,s){var i="",t;return a&&(t=this.match(a),t&&(i+=t[0])),c&&(t||!a)&&(i+=this.readUntil(c,s)),i},p.prototype.readUntil=function(a,c){var s="",i=this.__position;a.lastIndex=this.__position;var t=a.exec(this.__input);return t?(i=t.index,c&&(i+=t[0].length)):i=this.__input_length,s=this.__input.substring(this.__position,i),this.__position=i,s},p.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},p.prototype.get_regexp=function(a,c){var s=null,i="g";return c&&f&&(i="y"),typeof a=="string"&&a!==""?s=new RegExp(a,i):a&&(s=new RegExp(a.source,i)),s},p.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(a){var c=this.__position,s=this.readUntilAfter(a);return this.__position=c,s},p.prototype.lookBack=function(a){var c=this.__position-1;return c>=a.length&&this.__input.substring(c-a.length,c).toLowerCase()===a},m.exports.InputScanner=p},function(m,f,p){var a=p(8).InputScanner,c=p(3).Token,s=p(10).TokenStream,i=p(11).WhitespacePattern,t={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(o,R){this._input=new a(o),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var o,R=new c(t.START,""),T=null,S=[],D=new s;R.type!==t.EOF;){for(o=this._get_next_token(R,T);this._is_comment(o);)D.add(o),o=this._get_next_token(R,T);D.isEmpty()||(o.comments_before=D,D=new s),o.parent=T,this._is_opening(o)?(S.push(T),T=o):T&&this._is_closing(o,T)&&(o.opened=T,T.closed=o,T=S.pop(),o.parent=T),o.previous=R,R.next=o,this.__tokens.add(o),R=o}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(o,R){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(t.RAW,T):this._create_token(t.EOF,"")},u.prototype._is_comment=function(o){return!1},u.prototype._is_opening=function(o){return!1},u.prototype._is_closing=function(o,R){return!1},u.prototype._create_token=function(o,R){var T=new c(o,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},m.exports.Tokenizer=u,m.exports.TOKEN=t},function(m){function f(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},f.prototype.peek=function(p){var a=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(a=this.__tokens[p]),a},f.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},m.exports.TokenStream=f},function(m,f,p){var a=p(12).Pattern;function c(s,i){a.call(this,s,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}c.prototype=new a,c.prototype.__set_whitespace_patterns=function(s,i){s+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},c.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var i=this.__split(this._newline_regexp,s);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return s},c.prototype.matching=function(s,i){var t=this._create();return t.__set_whitespace_patterns(s,i),t._update(),t},c.prototype._create=function(){return new c(this._input,this)},c.prototype.__split=function(s,i){s.lastIndex=0;for(var t=0,u=[],o=s.exec(i);o;)u.push(i.substring(t,o.index)),t=o.index+o[0].length,o=s.exec(i);return t<i.length?u.push(i.substring(t,i.length)):u.push(""),u},m.exports.WhitespacePattern=c},function(m){function f(p,a){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}f.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(p){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(p),a._update(),a},f.prototype.until=function(p){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(p),a._update(),a},f.prototype.starting_with=function(p){var a=this._create();return a._starting_pattern=this._input.get_regexp(p,!0),a._update(),a},f.prototype.matching=function(p){var a=this._create();return a._match_pattern=this._input.get_regexp(p,!0),a._update(),a},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},m.exports.Pattern=f},function(m){function f(p,a){p=typeof p=="string"?p:p.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+a,"g")}f.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(p);c;)a[c[1]]=c[2],c=this.__directive_pattern.exec(p);return a},f.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=f},function(m,f,p){var a=p(12).Pattern,c={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(i,t){a.call(this,i,t),this.__template_pattern=null,this._disabled=Object.assign({},c),this._excluded=Object.assign({},c),t&&(this.__template_pattern=this._input.get_regexp(t.__template_pattern),this._excluded=Object.assign(this._excluded,t._excluded),this._disabled=Object.assign(this._disabled,t._disabled));var u=new a(i);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new a,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(i){var t=this._create();return t._disabled[i]=!0,t._update(),t},s.prototype.read_options=function(i){var t=this._create();for(var u in c)t._disabled[u]=i.templating.indexOf(u)===-1;return t._update(),t},s.prototype.exclude=function(i){var t=this._create();return t._excluded[i]=!0,t._update(),t},s.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),i+=t,t=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},s.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},s.prototype._read_template=function(){var i="",t=this._input.peek();if(t==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(i=i||this.__patterns.erb.read())}else t==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},m.exports.TemplatablePattern=s},,,,function(m,f,p){var a=p(19).Beautifier,c=p(20).Options;function s(i,t,u,o){var R=new a(i,t,u,o);return R.beautify()}m.exports=s,m.exports.defaultOptions=function(){return new c}},function(m,f,p){var a=p(20).Options,c=p(2).Output,s=p(21).Tokenizer,i=p(21).TOKEN,t=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,o=function(O,w){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=O.max_preserve_newlines,this.preserve_newlines=O.preserve_newlines,this._output=new c(O,w)};o.prototype.current_line_has_match=function(O){return this._output.current_line.has_match(O)},o.prototype.set_space_before_token=function(O,w){this._output.space_before_token=O,this._output.non_breaking_space=w},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(O){this._output.add_raw_token(O)},o.prototype.print_preserved_newlines=function(O){var w=0;O.type!==i.TEXT&&O.previous.type!==i.TEXT&&(w=O.newlines?1:0),this.preserve_newlines&&(w=O.newlines<this.max_preserve_newlines+1?O.newlines:this.max_preserve_newlines+1);for(var b=0;b<w;b++)this.print_newline(b>0);return w!==0},o.prototype.traverse_whitespace=function(O){return O.whitespace_before||O.newlines?(this.print_preserved_newlines(O)||(this._output.space_before_token=!0),!0):!1},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(O){this._output.add_new_line(O)},o.prototype.print_token=function(O){O.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(O.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(O){return O=this.indent_level+(O||0),O<1?"":this._output.get_indent_string(O)};var R=function(O){for(var w=null,b=O.next;b.type!==i.EOF&&O.closed!==b;){if(b.type===i.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===i.EQUALS&&b.next.next&&b.next.next.type===i.VALUE&&(w=b.next.next.text);break}b=b.next}return w},T=function(O,w){var b=null,W=null;return w.closed?(O==="script"?b="text/javascript":O==="style"&&(b="text/css"),b=R(w)||b,b.search("text/css")>-1?W="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?W="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?W="html":b.search(/test\/null/)>-1&&(W="null"),W):null};function S(O,w){return w.indexOf(O)!==-1}function D(O,w,b){this.parent=O||null,this.tag=w?w.tag_name:"",this.indent_level=b||0,this.parser_token=w||null}function I(O){this._printer=O,this._current_frame=null}I.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},I.prototype.record_tag=function(O){var w=new D(this._current_frame,O,this._printer.indent_level);this._current_frame=w},I.prototype._try_pop_frame=function(O){var w=null;return O&&(w=O.parser_token,this._printer.indent_level=O.indent_level,this._current_frame=O.parent),w},I.prototype._get_frame=function(O,w){for(var b=this._current_frame;b&&!(O.indexOf(b.tag)!==-1);){if(w&&w.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},I.prototype.try_pop=function(O,w){var b=this._get_frame([O],w);return this._try_pop_frame(b)},I.prototype.indent_to_tag=function(O){var w=this._get_frame(O);w&&(this._printer.indent_level=w.indent_level)};function E(O,w,b,W){this._source_text=O||"",w=w||{},this._js_beautify=b,this._css_beautify=W,this._tag_stack=null;var j=new a(w,"html");this._options=j,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}E.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,w=this._options.eol;this._options.eol==="auto"&&(w=`
`,O&&t.test(O)&&(w=O.match(t)[0])),O=O.replace(u,`
`);var b=O.match(/^[\t ]*/)[0],W={text:"",type:""},j=new x,C=new o(this._options,b),B=new s(O,this._options).tokenize();this._tag_stack=new I(C);for(var k=null,y=B.next();y.type!==i.EOF;)y.type===i.TAG_OPEN||y.type===i.COMMENT?(k=this._handle_tag_open(C,y,j,W),j=k):y.type===i.ATTRIBUTE||y.type===i.EQUALS||y.type===i.VALUE||y.type===i.TEXT&&!j.tag_complete?k=this._handle_inside_tag(C,y,j,B):y.type===i.TAG_CLOSE?k=this._handle_tag_close(C,y,j):y.type===i.TEXT?k=this._handle_text(C,y,j):C.add_raw_token(y),W=k,y=B.next();var H=C._output.get_code(w);return H},E.prototype._handle_tag_close=function(O,w,b){var W={text:w.text,type:w.type};return O.alignment_size=0,b.tag_complete=!0,O.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),b.is_unformatted?O.add_raw_token(w):(b.tag_start_char==="<"&&(O.set_space_before_token(w.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&O.print_newline(!1)),O.print_token(w)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(O.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&O.set_wrap_point(),W},E.prototype._handle_inside_tag=function(O,w,b,W){var j=b.has_wrapped_attrs,C={text:w.text,type:w.type};if(O.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),b.is_unformatted)O.add_raw_token(w);else if(b.tag_start_char==="{"&&w.type===i.TEXT)O.print_preserved_newlines(w)?(w.newlines=0,O.add_raw_token(w)):O.print_token(w);else{if(w.type===i.ATTRIBUTE?(O.set_space_before_token(!0),b.attr_count+=1):(w.type===i.EQUALS||w.type===i.VALUE&&w.previous.type===i.EQUALS)&&O.set_space_before_token(!1),w.type===i.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(O.traverse_whitespace(w),j=j||w.newlines!==0),this._is_wrap_attributes_force)){var B=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var k=!0,y=0,H;do{if(H=W.peek(y),H.type===i.ATTRIBUTE){k=!1;break}y+=1}while(y<4&&H.type!==i.EOF&&H.type!==i.TAG_CLOSE);B=!k}B&&(O.print_newline(!1),j=!0)}O.print_token(w),j=j||O.previous_token_wrapped(),b.has_wrapped_attrs=j}return C},E.prototype._handle_text=function(O,w,b){var W={text:w.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(O,w,b):b.is_unformatted||b.is_content_unformatted?O.add_raw_token(w):(O.traverse_whitespace(w),O.print_token(w)),W},E.prototype._print_custom_beatifier_text=function(O,w,b){var W=this;if(w.text!==""){var j=w.text,C,B=1,k="",y="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?C=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?C=this._css_beautify:b.custom_beautifier_name==="html"&&(C=function(Se,Ue){var Te=new E(Se,Ue,W._js_beautify,W._css_beautify);return Te.beautify()}),this._options.indent_scripts==="keep"?B=0:this._options.indent_scripts==="separate"&&(B=-O.indent_level);var H=O.get_full_indent(B);if(j=j.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&j[0]==="<"&&j.match(/^(<!--|<!\[CDATA\[)/)){var J=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(j);if(!J){O.add_raw_token(w);return}k=H+J[1]+`
`,j=J[4],J[5]&&(y=H+J[5]),j=j.replace(/\n[ \t]*$/,""),(J[2]||J[3].indexOf(`
`)!==-1)&&(J=J[3].match(/[ \t]+$/),J&&(w.whitespace_before=J[0]))}if(j)if(C){var se=function(){this.eol=`
`};se.prototype=this._options.raw_options;var fe=new se;j=C(H+j,fe)}else{var ve=w.whitespace_before;ve&&(j=j.replace(new RegExp(`
(`+ve+")?","g"),`
`)),j=H+j.replace(/\n/g,`
`+H)}k&&(j?j=k+j+`
`+y:j=k+y),O.print_newline(!1),j&&(w.text=j,w.whitespace_before="",w.newlines=0,O.add_raw_token(w),O.print_newline(!0))}},E.prototype._handle_tag_open=function(O,w,b,W){var j=this._get_tag_open_token(w);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&w.type===i.TAG_OPEN&&w.text.indexOf("</")===0?(O.add_raw_token(w),j.start_tag_token=this._tag_stack.try_pop(j.tag_name)):(O.traverse_whitespace(w),this._set_tag_position(O,w,j,b,W),j.is_inline_element||O.set_wrap_point(),O.print_token(w)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(j.alignment_size=w.text.length+1),!j.tag_complete&&!j.is_unformatted&&(O.alignment_size=j.alignment_size),j};var x=function(O,w){if(this.parent=O||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!w)this.tag_complete=!0;else{var b;this.tag_start_char=w.text[0],this.text=w.text,this.tag_start_char==="<"?(b=w.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=w.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(w.text.startsWith("{{#>")||w.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&w.next!==null?this.tag_check=w.next.text.split(" ")[0]:this.tag_check=w.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),w.type===i.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||w.closed&&w.closed.text==="/>";var W=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(W=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(W)))}};E.prototype._get_tag_open_token=function(O){var w=new x(this._tag_stack.get_parser_token(),O);return w.alignment_size=this._options.wrap_attributes_indent_size,w.is_end_tag=w.is_end_tag||S(w.tag_check,this._options.void_elements),w.is_empty_element=w.tag_complete||w.is_start_tag&&w.is_end_tag,w.is_unformatted=!w.tag_complete&&S(w.tag_check,this._options.unformatted),w.is_content_unformatted=!w.is_empty_element&&S(w.tag_check,this._options.content_unformatted),w.is_inline_element=S(w.tag_name,this._options.inline)||w.tag_name.includes("-")||w.tag_start_char==="{",w},E.prototype._set_tag_position=function(O,w,b,W,j){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||O.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=T(b.tag_check,w)))),S(b.tag_check,this._options.extra_liners)&&(O.print_newline(!1),O._output.just_added_blankline()||O.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var C=O.current_line_has_match(/{{#if/);C||O.print_newline(!1)}b.tag_name==="!--"&&j.type===i.TAG_CLOSE&&W.is_end_tag&&b.text.indexOf(`
`)===-1||(b.is_inline_element||b.is_unformatted||O.print_newline(!1),this._calcluate_parent_multiline(O,b))}else if(b.is_end_tag){var B=!1;B=b.start_tag_token&&b.start_tag_token.multiline_content,B=B||!b.is_inline_element&&!(W.is_inline_element||W.is_unformatted)&&!(j.type===i.TAG_CLOSE&&b.start_tag_token===W)&&j.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(B=!1),B&&O.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(j.type!=="TK_CONTENT"||b.is_content_unformatted)&&O.print_newline(!1),this._calcluate_parent_multiline(O,b)},E.prototype._calcluate_parent_multiline=function(O,w){w.parent&&O._output.just_added_newline()&&!((w.is_inline_element||w.is_unformatted)&&w.parent.is_inline_element)&&(w.parent.multiline_content=!0)};var g=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],h=["a","audio","del","ins","map","noscript","video"];E.prototype._do_optional_end_element=function(O){var w=null;if(O.is_empty_element||!O.is_start_tag||!O.parent)return;if(O.tag_name==="body")w=w||this._tag_stack.try_pop("head");else if(O.tag_name==="li")w=w||this._tag_stack.try_pop("li",["ol","ul"]);else if(O.tag_name==="dd"||O.tag_name==="dt")w=w||this._tag_stack.try_pop("dt",["dl"]),w=w||this._tag_stack.try_pop("dd",["dl"]);else if(O.parent.tag_name==="p"&&g.indexOf(O.tag_name)!==-1){var b=O.parent.parent;(!b||h.indexOf(b.tag_name)===-1)&&(w=w||this._tag_stack.try_pop("p"))}else O.tag_name==="rp"||O.tag_name==="rt"?(w=w||this._tag_stack.try_pop("rt",["ruby","rtc"]),w=w||this._tag_stack.try_pop("rp",["ruby","rtc"])):O.tag_name==="optgroup"?w=w||this._tag_stack.try_pop("optgroup",["select"]):O.tag_name==="option"?w=w||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):O.tag_name==="colgroup"?w=w||this._tag_stack.try_pop("caption",["table"]):O.tag_name==="thead"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"])):O.tag_name==="tbody"||O.tag_name==="tfoot"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"]),w=w||this._tag_stack.try_pop("thead",["table"]),w=w||this._tag_stack.try_pop("tbody",["table"])):O.tag_name==="tr"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"]),w=w||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(O.tag_name==="th"||O.tag_name==="td")&&(w=w||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),w=w||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return O.parent=this._tag_stack.get_parser_token(),w},m.exports.Beautifier=E},function(m,f,p){var a=p(6).Options;function c(s){a.call(this,s,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}c.prototype=new a,m.exports.Options=c},function(m,f,p){var a=p(9).Tokenizer,c=p(9).TOKEN,s=p(13).Directives,i=p(14).TemplatablePattern,t=p(12).Pattern,u={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:c.START,RAW:c.RAW,EOF:c.EOF},o=new s(/<\!--/,/-->/),R=function(T,S){a.call(this,T,S),this._current_tag_name="";var D=new i(this._input).read_options(this._options),I=new t(this._input);if(this.__patterns={word:D.until(/[\n\r\t <]/),single_quote:D.until_after(/'/),double_quote:D.until_after(/"/),attribute:D.until(/[\n\r\t =>]|\/>/),element_name:D.until(/[\n\r\t >\/]/),handlebars_comment:I.starting_with(/{{!--/).until_after(/--}}/),handlebars:I.starting_with(/{{/).until_after(/}}/),handlebars_open:I.until(/[\n\r\t }]/),handlebars_raw_close:I.until(/}}/),comment:I.starting_with(/<!--/).until_after(/-->/),cdata:I.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:I.starting_with(/<!\[/).until_after(/]>/),processing:I.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var E=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=I.matching(E).until_after(E)}};R.prototype=new a,R.prototype._is_comment=function(T){return!1},R.prototype._is_opening=function(T){return T.type===u.TAG_OPEN},R.prototype._is_closing=function(T,S){return T.type===u.TAG_CLOSE&&S&&((T.text===">"||T.text==="/>")&&S.text[0]==="<"||T.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(T,S){var D=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(u.EOF,""):(D=D||this._read_open_handlebars(I,S),D=D||this._read_attribute(I,T,S),D=D||this._read_close(I,S),D=D||this._read_raw_content(I,T,S),D=D||this._read_content_word(I),D=D||this._read_comment_or_cdata(I),D=D||this._read_processing(I),D=D||this._read_open(I,S),D=D||this._create_token(u.UNKNOWN,this._input.next()),D)},R.prototype._read_comment_or_cdata=function(T){var S=null,D=null,I=null;if(T==="<"){var E=this._input.peek(1);E==="!"&&(D=this.__patterns.comment.read(),D?(I=o.get_directives(D),I&&I.ignore==="start"&&(D+=o.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(S=this._create_token(u.COMMENT,D),S.directives=I)}return S},R.prototype._read_processing=function(T){var S=null,D=null,I=null;if(T==="<"){var E=this._input.peek(1);(E==="!"||E==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(S=this._create_token(u.COMMENT,D),S.directives=I)}return S},R.prototype._read_open=function(T,S){var D=null,I=null;return S||T==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),I=this._create_token(u.TAG_OPEN,D)),I},R.prototype._read_open_handlebars=function(T,S){var D=null,I=null;return S||this._options.indent_handlebars&&T==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),I=this._create_token(u.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),I=this._create_token(u.TAG_OPEN,D))),I},R.prototype._read_close=function(T,S){var D=null,I=null;return S&&(S.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(D=this._input.next(),T==="/"&&(D+=this._input.next()),I=this._create_token(u.TAG_CLOSE,D)):S.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),I=this._create_token(u.TAG_CLOSE,"}}"))),I},R.prototype._read_attribute=function(T,S,D){var I=null,E="";if(D&&D.text[0]==="<")if(T==="=")I=this._create_token(u.EQUALS,this._input.next());else if(T==='"'||T==="'"){var x=this._input.next();T==='"'?x+=this.__patterns.double_quote.read():x+=this.__patterns.single_quote.read(),I=this._create_token(u.VALUE,x)}else E=this.__patterns.attribute.read(),E&&(S.type===u.EQUALS?I=this._create_token(u.VALUE,E):I=this._create_token(u.ATTRIBUTE,E));return I},R.prototype._is_content_unformatted=function(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},R.prototype._read_raw_content=function(T,S,D){var I="";if(D&&D.text[0]==="{")I=this.__patterns.handlebars_raw_close.read();else if(S.type===u.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var E=S.opened.text.substr(1).toLowerCase();if(E==="script"||E==="style"){var x=this._read_comment_or_cdata(T);if(x)return x.type=u.TEXT,x;I=this._input.readUntil(new RegExp("</"+E+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(E)&&(I=this._input.readUntil(new RegExp("</"+E+"[\\n\\r\\t ]*?>","ig")))}return I?this._create_token(u.TEXT,I):null},R.prototype._read_content_word=function(T){var S="";if(this._options.unformatted_content_delimiter&&(T===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(u.TEXT,S)},m.exports.Tokenizer=R,m.exports.TOKEN=u}],X={};function r(m){var f=X[m];if(f!==void 0)return f.exports;var p=X[m]={exports:{}};return Y[m](p,p.exports,r),p.exports}var A=r(18);U=A})();var Z=U;if(!0)!(ne=[F,F("6UM0"),F("TXwP")],Q=function(Y){var X=F("6UM0"),r=F("TXwP");return{html_beautify:function(A,m){return Z(A,m,X.js_beautify,r.css_beautify)}}}.apply(Pe,ne),Q!==void 0&&(Et.exports=Q));else var G,M})()},"rAM+":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Q});var ne=F("Qw5x");function Q(U,Z){var G;if(typeof Symbol=="undefined"||U[Symbol.iterator]==null){if(Array.isArray(U)||(G=Object(ne.a)(U))||Z&&U&&typeof U.length=="number"){G&&(U=G);var M=0,Y=function(){};return{s:Y,n:function(){return M>=U.length?{done:!0}:{done:!1,value:U[M++]}},e:function(f){throw f},f:Y}}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 X=!0,r=!1,A;return{s:function(){G=U[Symbol.iterator]()},n:function(){var f=G.next();return X=f.done,f},e:function(f){r=!0,A=f},f:function(){try{!X&&G.return!=null&&G.return()}finally{if(r)throw A}}}}},rUJ1:function(Et,Pe){const F=/[&<>"']/,ne=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,Z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},G=I=>Z[I];function M(I,E){if(E){if(F.test(I))return I.replace(ne,G)}else if(Q.test(I))return I.replace(U,G);return I}const Y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function X(I){return I.replace(Y,(E,x)=>(x=x.toLowerCase(),x==="colon"?":":x.charAt(0)==="#"?x.charAt(1)==="x"?String.fromCharCode(parseInt(x.substring(2),16)):String.fromCharCode(+x.substring(1)):""))}const r=/(^|[^\[])\^/g;function A(I,E){I=I.source||I,E=E||"";const x={replace:(g,h)=>(h=h.source||h,h=h.replace(r,"$1"),I=I.replace(g,h),x),getRegex:()=>new RegExp(I,E)};return x}const m=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(I,E,x){if(I){let g;try{g=decodeURIComponent(X(x)).replace(m,"").toLowerCase()}catch(h){return null}if(g.indexOf("javascript:")===0||g.indexOf("vbscript:")===0||g.indexOf("data:")===0)return null}E&&!f.test(x)&&(x=t(E,x));try{x=encodeURI(x).replace(/%25/g,"%")}catch(g){return null}return x}const a={},c=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(I,E){a[" "+I]||(c.test(I)?a[" "+I]=I+"/":a[" "+I]=T(I,"/",!0)),I=a[" "+I];const x=I.indexOf(":")===-1;return E.substring(0,2)==="//"?x?E:I.replace(s,"$1")+E:E.charAt(0)==="/"?x?E:I.replace(i,"$1")+E:I+E}const u={exec:function(){}};function o(I){let E=1,x,g;for(;E<arguments.length;E++){x=arguments[E];for(g in x)Object.prototype.hasOwnProperty.call(x,g)&&(I[g]=x[g])}return I}function R(I,E){const x=I.replace(/\|/g,(O,w,b)=>{let W=!1,j=w;for(;--j>=0&&b[j]==="\\";)W=!W;return W?"|":" |"}),g=x.split(/ \|/);let h=0;if(g.length>E)g.splice(E);else for(;g.length<E;)g.push("");for(;h<g.length;h++)g[h]=g[h].trim().replace(/\\\|/g,"|");return g}function T(I,E,x){const g=I.length;if(g===0)return"";let h=0;for(;h<g;){const O=I.charAt(g-h-1);if(O===E&&!x)h++;else if(O!==E&&x)h++;else break}return I.substr(0,g-h)}function S(I,E){if(I.indexOf(E[1])===-1)return-1;const x=I.length;let g=0,h=0;for(;h<x;h++)if(I[h]==="\\")h++;else if(I[h]===E[0])g++;else if(I[h]===E[1]&&(g--,g<0))return h;return-1}function D(I){I&&I.sanitize&&!I.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")}Et.exports={escape:M,unescape:X,edit:A,cleanUrl:p,resolveUrl:t,noopTest:u,merge:o,splitCells:R,rtrim:T,findClosingBracket:S,checkSanitizeDeprecation:D}},sR1s:function(Et,Pe,F){"use strict";F.d(Pe,"b",function(){return Z}),F.d(Pe,"a",function(){return G}),F.d(Pe,"c",function(){return M}),F.d(Pe,"d",function(){return Y});var ne=F("U8pU"),Q="RC_TABLE_KEY";function U(X){return X==null?[]:Array.isArray(X)?X:[X]}function Z(X,r){if(!r&&typeof r!="number")return X;for(var A=U(r),m=X,f=0;f<A.length;f+=1){if(!m)return null;var p=A[f];m=m[p]}return m}function G(X){var r=[],A={};return X.forEach(function(m){for(var f=m||{},p=f.key,a=f.dataIndex,c=p||U(a).join("-")||Q;A[c];)c="".concat(c,"_next");A[c]=!0,r.push(c)}),r}function M(){var X={};function r(p,a){a&&Object.keys(a).forEach(function(c){var s=a[c];s&&Object(ne.a)(s)==="object"?(p[c]=p[c]||{},r(p[c],s)):p[c]=s})}for(var A=arguments.length,m=new Array(A),f=0;f<A;f++)m[f]=arguments[f];return m.forEach(function(p){r(X,p)}),X}function Y(X){return X!=null}},sZF6:function(Et,Pe,F){"use strict";var ne=F("2qtc"),Q=F("kLXV"),U=F("DZo9"),Z=F("8z0m"),G=F("+L6B"),M=F("2/Rp"),Y=F("tJVT"),X=F("q1tI"),r=F.n(X),A=F("xvlK"),m=F("m3rI"),f=F("1vsH"),p=F("Ty5D"),a=F("69hG"),c=F.n(a),s=function(t){var u=t.visible,o=t.onOk,R=t.onCancel,T=Object(X.useState)([]),S=Object(Y.a)(T,2),D=S[0],I=S[1],E=Object(X.useState)(!1),x=Object(Y.a)(E,2),g=x[0],h=x[1],O=Object(p.i)();Object(X.useEffect)(function(){u||(I([]),h(!1))},[u]);var w=function(){h(!0),o(D,function(){h(!1)})},b=function(){R()},W=function(){console.log(O,444);var k="".concat(m.a.API_SERVER,"/api/courses/").concat(O.coursesId,"/exercises/down_template");Object(f.x)(null,k)},j=function(k){var y={name:k.name,uid:k.uid,file:k};return I([y]),!1},C=function(){I([])};return r.a.createElement(Q.a,{title:"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898",visible:u,onOk:w,centered:!0,wrapClassName:c.a.customModal,onCancel:b,width:"680px",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",confirmLoading:g},r.a.createElement("div",{className:c.a.content},r.a.createElement("aside",null,r.a.createElement("div",null,"\u6B65\u9AA41\uFF1A"),r.a.createElement("ul",null,r.a.createElement("li",null,"\u4E0B\u8F7D\xA0",r.a.createElement("span",{style:{color:"#0152d9",cursor:"pointer"},onClick:W},"\u8003\u8BD5\u8BD5\u9898\u6A21\u677F"),",\xA0\u6279\u91CF\u5BFC\u5165\u8BD5\u9898\u3002"),r.a.createElement("li",{className:"c-grey-999 mt10"},"\u6CE8\uFF1A\u76EE\u524D\u4EC5\u652F\u6301Excel\u683C\u5F0F\u6A21\u677F\uFF0C\u6BCF\u6B21\u6700\u591A\u5BFC\u5165300\u9898\u3002\u4E0D\u652F\u6301\u7F16\u7A0B\u9898\u548C\u5B9E\u8BAD\u9898\u5BFC\u5165"))),r.a.createElement("aside",{className:"mt30"},r.a.createElement("div",null,"\u6B65\u9AA42\uFF1A"),r.a.createElement("ul",{style:{flex:1}},r.a.createElement("li",null,"\u4E0A\u4F20\u586B\u5199\u597D\u7684\u8BD5\u9898\u8868"),u&&r.a.createElement(Z.a,{action:"".concat(m.a.API_SERVER,"/api/attachments.json"),beforeUpload:j,onRemove:C,withCredentials:!0,fileList:D,accept:".xls,.xlsx"},r.a.createElement(M.a,{className:c.a.upload,type:"primary",icon:r.a.createElement(A.a,null)},"\u9009\u62E9\u6587\u4EF6"))))))};Pe.a=s},sboe:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return U});var ne=F("q1tI"),Q=F.n(ne),U=ne.createContext(null)},t23M:function(Et,Pe,F){"use strict";var ne=F("VTBJ"),Q=F("1OyB"),U=F("vuIU"),Z=F("Ji7U"),G=F("LK+K"),M=F("q1tI"),Y=F.n(M),X=F("m+aA"),r=F("Zm9Q"),A=F("Kwbf"),m=F("c+Xe"),f=F("bdgK"),p="rc-observer-key",a=function(c){Object(Z.a)(i,c);var s=Object(G.a)(i);function i(){var t;return Object(Q.a)(this,i),t=s.apply(this,arguments),t.resizeObserver=null,t.childNode=null,t.currentElement=null,t.state={width:0,height:0,offsetHeight:0,offsetWidth:0},t.onResize=function(u){var o=t.props.onResize,R=u[0].target,T=R.getBoundingClientRect(),S=T.width,D=T.height,I=R.offsetWidth,E=R.offsetHeight,x=Math.floor(S),g=Math.floor(D);if(t.state.width!==x||t.state.height!==g||t.state.offsetWidth!==I||t.state.offsetHeight!==E){var h={width:x,height:g,offsetWidth:I,offsetHeight:E};t.setState(h),o&&Promise.resolve().then(function(){o(Object(ne.a)(Object(ne.a)({},h),{},{offsetWidth:I,offsetHeight:E}))})}},t.setChildNode=function(u){t.childNode=u},t}return Object(U.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var u=this.props.disabled;if(u){this.destroyObserver();return}var o=Object(X.a)(this.childNode||this),R=o!==this.currentElement;R&&(this.destroyObserver(),this.currentElement=o),!this.resizeObserver&&o&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(o))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var u=this.props.children,o=Object(r.a)(u);if(o.length>1)Object(A.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(o.length===0)return Object(A.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=o[0];if(M.isValidElement(R)&&Object(m.c)(R)){var T=R.ref;o[0]=M.cloneElement(R,{ref:Object(m.a)(T,this.setChildNode)})}return o.length===1?o[0]:o.map(function(S,D){return!M.isValidElement(S)||"key"in S&&S.key!==null?S:M.cloneElement(S,{key:"".concat(p,"-").concat(D)})})}}]),i}(M.Component);a.displayName="ResizeObserver",Pe.a=a},t9D7:function(Et,Pe,F){"use strict";F.d(Pe,"b",function(){return Y}),F.d(Pe,"g",function(){return r}),F.d(Pe,"d",function(){return A}),F.d(Pe,"e",function(){return m}),F.d(Pe,"a",function(){return f}),F.d(Pe,"f",function(){return c}),F.d(Pe,"c",function(){return s});var ne=F("Vhoy"),Q=F("MI8n"),U=F("pmY6"),Z=F("Cg/j"),G=F("ic2d"),M=F("nEHx");const Y=Object(Z.c)("themeService");var X;(function(i){function t(u){return u&&typeof u=="object"&&typeof u.id=="string"}i.isThemeColor=t})(X||(X={}));function r(i){return{id:i}}var A;(function(i){function t(D){return D&&typeof D=="object"&&typeof D.id=="string"&&(typeof D.color=="undefined"||X.isThemeColor(D.color))}i.isThemeIcon=t;const u=new RegExp(`^\\$\\((${ne.a.iconNameExpression}(?:${ne.a.iconModifierExpression})?)\\)$`);function o(D){const I=u.exec(D);if(!I)return;let[,E]=I;return{id:E}}i.fromString=o;function R(D,I){let E=D.id;const x=E.lastIndexOf("~");return x!==-1&&(E=E.substring(0,x)),I&&(E=`${E}~${I}`),{id:E}}i.modify=R;function T(D,I){var E,x;return D.id===I.id&&((E=D.color)===null||E===void 0?void 0:E.id)===((x=I.color)===null||x===void 0?void 0:x.id)}i.isEqual=T;function S(D,I){return{id:D.id,color:I?r(I):void 0}}i.asThemeIcon=S,i.asClassNameArray=ne.a.asClassNameArray,i.asClassName=ne.a.asClassName,i.asCSSSelector=ne.a.asCSSSelector})(A||(A={}));function m(i){switch(i){case M.a.DARK:return"vs-dark";case M.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Q.b}onColorThemeChange(i){return this.themingParticipants.push(i),this.onThemingParticipantAddedEmitter.fire(i),Object(U.i)(()=>{const t=this.themingParticipants.indexOf(i);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new p;G.a.add(f.ThemingContribution,a);function c(i){return a.onColorThemeChange(i)}class s extends U.a{constructor(i){super();this.themeService=i,this.theme=i.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(i){this.theme=i,this.updateStyles()}updateStyles(){}}},u2Z1:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return T});var ne=F("miYZ"),Q=F("tsqr"),U=F("9og8"),Z=F("5NDa"),G=F("5rEg"),M=F("2qtc"),Y=F("kLXV"),X=F("oBTY"),r=F("tJVT"),A=F("OaEy"),m=F("2fM7"),f=F("WmNS"),p=F.n(f),a=F("q1tI"),c=F.n(a),s=F("ErOA"),i=F("i58Z"),t=F.n(i),u=F("T1X5"),o=F.n(u),R=m.a.Option,T=function(D){var I=D.subId,E=D.value,x=D.selectvalues,g=D.disabled,h=D.knowledgeOptions,O=h===void 0?[]:h,w=D.onChange,b=w===void 0?function(){}:w,W=D.onAddKnowledgeFinish,j=W===void 0?function(){}:W,C=Object(a.useRef)(),B=Object(a.useState)([]),k=Object(r.a)(B,2),y=k[0],H=k[1];E=E||[];var J=function(ve,Se){ve?(H([Se.key]),b([Se.key])):(H([]),b([]))};Object(a.useEffect)(function(){(x==null?void 0:x.length)>0&&(H(Object(X.a)(x)),b(Object(X.a)(x)))},[O]),Object(a.useEffect)(function(){var fe;((fe=E)===null||fe===void 0?void 0:fe.length)>0&&b(Object(X.a)(E))},[O]);var se=function(ve){ve.preventDefault(),C.current="",Y.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:c.a.createElement("div",{className:"font14"},c.a.createElement("div",{style:{display:"flex",marginTop:"48px",marginBottom:"36px"}},c.a.createElement("img",{src:o.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",c.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",c.a.createElement("br",null),"\u8BF7\u8BA4\u771F\u586B\u5199\u4E0E\u6559\u5B66\u5185\u5BB9\u76F8\u5173\u7684\u771F\u5B9E\u77E5\u8BC6\u70B9 ",c.a.createElement("br",null)),c.a.createElement(G.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:C.current,onChange:function(Ue){C.current=Ue.target.value}})),onOk:function(){return new Promise(function(){var Ue=Object(U.a)(p.a.mark(function Te(Ie,be){var q,_;return p.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(C.current){z.next=3;break}return Q.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),z.abrupt("return",be());case 3:if(!(C.current.length>20)){z.next=6;break}return Q.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),z.abrupt("return",be());case 6:return z.next=8,Object(s.a)("/api/tag_disciplines.json",{method:"post",body:{name:C.current,sub_discipline_id:I}});case 8:return q=z.sent,(q==null?void 0:q.status)===0&&(j({id:q.tag_discipline_id,name:C.current,type:"personal"}),_=[],_.push(q.tag_discipline_id),b([].concat(_)),H([q.tag_discipline_id]),b([].concat(_))),z.abrupt("return",Ie());case 11:case"end":return z.stop()}},Te)}));return function(Te,Ie){return Ue.apply(this,arguments)}}())}})};return c.a.createElement("div",{className:t.a.wrap},c.a.createElement(m.a,{disabled:!I||g,className:"mr5",style:{width:"242px"},onChange:J,showSearch:!0,allowClear:!0,value:O==null?void 0:O.filter(function(fe){return(y==null?void 0:y.includes(fe==null?void 0:fe.id))||(y==null?void 0:y.includes((fe==null?void 0:fe.id)+""))}).map(function(fe){return fe.name})},O==null?void 0:O.map(function(fe){return c.a.createElement(R,{key:fe.id,value:fe.name},c.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},c.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},fe.name),c.a.createElement("span",null,fe.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),c.a.createElement("button",{disabled:!I,className:"".concat(t.a.addKnowledge," ").concat(I?"":t.a.disabled),onClick:se},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uK0f:function(Et,Pe,F){(function(ne,Q){Et.exports=Q()})(this,function(){"use strict";function ne(Q,U,Z){Z=Z||{},Z.childrenKeyName=Z.childrenKeyName||"children";var G=Q||[],M=[],Y=0;do{var X=G.filter(function(r){return U(r,Y)})[0];if(!X)break;M.push(X),G=X[Z.childrenKeyName]||[],Y+=1}while(G.length>0);return M}return ne})},ulZh:function(Et,Pe,F){typeof window!="undefined"&&function(Q,U){Et.exports=U()}(this,function(){return function(ne){var Q={};function U(Z){if(Q[Z])return Q[Z].exports;var G=Q[Z]={i:Z,l:!1,exports:{}};return ne[Z].call(G.exports,G,G.exports,U),G.l=!0,G.exports}return U.m=ne,U.c=Q,U.d=function(Z,G,M){U.o(Z,G)||Object.defineProperty(Z,G,{enumerable:!0,get:M})},U.r=function(Z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Z,"__esModule",{value:!0})},U.t=function(Z,G){if(G&1&&(Z=U(Z)),G&8)return Z;if(G&4&&typeof Z=="object"&&Z&&Z.__esModule)return Z;var M=Object.create(null);if(U.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:Z}),G&2&&typeof Z!="string")for(var Y in Z)U.d(M,Y,function(X){return Z[X]}.bind(null,Y));return M},U.n=function(Z){var G=Z&&Z.__esModule?function(){return Z.default}:function(){return Z};return U.d(G,"a",G),G},U.o=function(Z,G){return Object.prototype.hasOwnProperty.call(Z,G)},U.p="/dist/",U(U.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,Q,U){"use strict";var Z=Object.prototype.hasOwnProperty,G="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(G=!1));function Y(m,f,p){this.fn=m,this.context=f,this.once=p||!1}function X(m,f,p,a,c){if(typeof p!="function")throw new TypeError("The listener must be a function");var s=new Y(p,a||m,c),i=G?G+f:f;return m._events[i]?m._events[i].fn?m._events[i]=[m._events[i],s]:m._events[i].push(s):(m._events[i]=s,m._eventsCount++),m}function r(m,f){--m._eventsCount===0?m._events=new M:delete m._events[f]}function A(){this._events=new M,this._eventsCount=0}A.prototype.eventNames=function(){var f=[],p,a;if(this._eventsCount===0)return f;for(a in p=this._events)Z.call(p,a)&&f.push(G?a.slice(1):a);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},A.prototype.listeners=function(f){var p=G?G+f:f,a=this._events[p];if(!a)return[];if(a.fn)return[a.fn];for(var c=0,s=a.length,i=new Array(s);c<s;c++)i[c]=a[c].fn;return i},A.prototype.listenerCount=function(f){var p=G?G+f:f,a=this._events[p];return a?a.fn?1:a.length:0},A.prototype.emit=function(f,p,a,c,s,i){var t=G?G+f:f;if(!this._events[t])return!1;var u=this._events[t],o=arguments.length,R,T;if(u.fn){u.once&&this.removeListener(f,u.fn,void 0,!0);switch(o){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,p),!0;case 3:return u.fn.call(u.context,p,a),!0;case 4:return u.fn.call(u.context,p,a,c),!0;case 5:return u.fn.call(u.context,p,a,c,s),!0;case 6:return u.fn.call(u.context,p,a,c,s,i),!0}for(T=1,R=new Array(o-1);T<o;T++)R[T-1]=arguments[T];u.fn.apply(u.context,R)}else{var S=u.length,D;for(T=0;T<S;T++){u[T].once&&this.removeListener(f,u[T].fn,void 0,!0);switch(o){case 1:u[T].fn.call(u[T].context);break;case 2:u[T].fn.call(u[T].context,p);break;case 3:u[T].fn.call(u[T].context,p,a);break;case 4:u[T].fn.call(u[T].context,p,a,c);break;default:if(!R)for(D=1,R=new Array(o-1);D<o;D++)R[D-1]=arguments[D];u[T].fn.apply(u[T].context,R)}}}return!0},A.prototype.on=function(f,p,a){return X(this,f,p,a,!1)},A.prototype.once=function(f,p,a){return X(this,f,p,a,!0)},A.prototype.removeListener=function(f,p,a,c){var s=G?G+f:f;if(!this._events[s])return this;if(!p)return r(this,s),this;var i=this._events[s];if(i.fn)i.fn===p&&(!c||i.once)&&(!a||i.context===a)&&r(this,s);else{for(var t=0,u=[],o=i.length;t<o;t++)(i[t].fn!==p||c&&!i[t].once||a&&i[t].context!==a)&&u.push(i[t]);u.length?this._events[s]=u.length===1?u[0]:u:r(this,s)}return this},A.prototype.removeAllListeners=function(f){var p;return f?(p=G?G+f:f,this._events[p]&&r(this,p)):(this._events=new M,this._eventsCount=0),this},A.prototype.off=A.prototype.removeListener,A.prototype.addListener=A.prototype.on,A.prefixed=G,A.EventEmitter=A,ne.exports=A},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,Q,U){(function(Z){var G=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,Y=/(?:\/|^)\.(?=\/)/g,X=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(A,m,f){if(f=f||{},A=A.trim(),m=m.trim(),!m){if(!f.alwaysNormalize)return A;var p=r.parseURL(A);if(!p)throw new Error("Error trying to parse base URL.");return p.path=r.normalizePath(p.path),r.buildURLFromParts(p)}var a=r.parseURL(m);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return f.alwaysNormalize?(a.path=r.normalizePath(a.path),r.buildURLFromParts(a)):m;var c=r.parseURL(A);if(!c)throw new Error("Error trying to parse base URL.");if(!c.netLoc&&c.path&&c.path[0]!=="/"){var s=M.exec(c.path);c.netLoc=s[1],c.path=s[2]}c.netLoc&&!c.path&&(c.path="/");var i={scheme:c.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(i.netLoc=c.netLoc,a.path[0]!=="/"))if(!a.path)i.path=c.path,a.params||(i.params=c.params,a.query||(i.query=c.query));else{var t=c.path,u=t.substring(0,t.lastIndexOf("/")+1)+a.path;i.path=r.normalizePath(u)}return i.path===null&&(i.path=f.alwaysNormalize?r.normalizePath(a.path):a.path),r.buildURLFromParts(i)},parseURL:function(A){var m=G.exec(A);return m?{scheme:m[1]||"",netLoc:m[2]||"",path:m[3]||"",params:m[4]||"",query:m[5]||"",fragment:m[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(Y,"");A.length!==(A=A.replace(X,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};ne.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,Q,U){function Z(f){var p={};function a(s){if(p[s])return p[s].exports;var i=p[s]={i:s,l:!1,exports:{}};return f[s].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=f,a.c=p,a.i=function(s){return s},a.d=function(s,i,t){a.o(s,i)||Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:t})},a.r=function(s){Object.defineProperty(s,"__esModule",{value:!0})},a.n=function(s){var i=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(i,"a",i),i},a.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)},a.p="/",a.oe=function(s){throw console.error(s),s};var c=a(a.s=ENTRY_MODULE);return c.default||c}var G="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+G+").*?\\)";function Y(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function X(f){return!isNaN(1*f)}function r(f,p,a){var c={};c[a]=[];var s=p.toString(),i=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return c;for(var t=i[1],u=new RegExp("(\\\\n|\\W)"+Y(t)+M,"g"),o;o=u.exec(s);){if(o[3]==="dll-reference")continue;c[a].push(o[3])}for(u=new RegExp("\\("+Y(t)+'\\("(dll-reference\\s('+G+'))"\\)\\)'+M,"g");o=u.exec(s);)f[o[2]]||(c[a].push(o[1]),f[o[2]]=U(o[1]).m),c[o[2]]=c[o[2]]||[],c[o[2]].push(o[4]);for(var R=Object.keys(c),T=0;T<R.length;T++)for(var S=0;S<c[R[T]].length;S++)X(c[R[T]][S])&&(c[R[T]][S]=1*c[R[T]][S]);return c}function A(f){var p=Object.keys(f);return p.reduce(function(a,c){return a||f[c].length>0},!1)}function m(f,p){for(var a={main:[p]},c={main:[]},s={main:{}};A(a);)for(var i=Object.keys(a),t=0;t<i.length;t++){var u=i[t],o=a[u],R=o.pop();if(s[u]=s[u]||{},s[u][R]||!f[u][R])continue;s[u][R]=!0,c[u]=c[u]||[],c[u].push(R);for(var T=r(f,f[u][R],u),S=Object.keys(T),D=0;D<S.length;D++)a[S[D]]=a[S[D]]||[],a[S[D]]=a[S[D]].concat(T[S[D]])}return c}ne.exports=function(f,p){p=p||{};var a={main:U.m},c=p.all?{main:Object.keys(a.main)}:m(a,f),s="";Object.keys(c).filter(function(R){return R!=="main"}).forEach(function(R){for(var T=0;c[R][T];)T++;c[R].push(T),a[R][T]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+R+" = ("+Z.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+c[R].map(function(S){return""+JSON.stringify(S)+": "+a[R][S].toString()}).join(",")+`});
`}),s=s+"new (("+Z.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+c.main.map(function(R){return""+JSON.stringify(R)+": "+a.main[R].toString()}).join(",")+"}))(self);";var i=new window.Blob([s],{type:"text/javascript"});if(p.bare)return i;var t=window.URL||window.webkitURL||window.mozURL||window.msURL,u=t.createObjectURL(i),o=new window.Worker(u);return o.objectURL=u,o}},"./src/config.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"hlsDefaultConfig",function(){return D}),U.d(Q,"mergeConfig",function(){return E}),U.d(Q,"enableStreamingMode",function(){return x});var Z=U("./src/controller/abr-controller.ts"),G=U("./src/controller/audio-stream-controller.ts"),M=U("./src/controller/audio-track-controller.ts"),Y=U("./src/controller/subtitle-stream-controller.ts"),X=U("./src/controller/subtitle-track-controller.ts"),r=U("./src/controller/buffer-controller.ts"),A=U("./src/controller/timeline-controller.ts"),m=U("./src/controller/cap-level-controller.ts"),f=U("./src/controller/fps-controller.ts"),p=U("./src/controller/eme-controller.ts"),a=U("./src/controller/cmcd-controller.ts"),c=U("./src/utils/xhr-loader.ts"),s=U("./src/utils/fetch-loader.ts"),i=U("./src/utils/cues.ts"),t=U("./src/utils/mediakeys-helper.ts"),u=U("./src/utils/logger.ts");function o(){return o=Object.assign||function(g){for(var h=1;h<arguments.length;h++){var O=arguments[h];for(var w in O)Object.prototype.hasOwnProperty.call(O,w)&&(g[w]=O[w])}return g},o.apply(this,arguments)}function R(g,h){var O=Object.keys(g);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(g);h&&(w=w.filter(function(b){return Object.getOwnPropertyDescriptor(g,b).enumerable})),O.push.apply(O,w)}return O}function T(g){for(var h=1;h<arguments.length;h++){var O=arguments[h]!=null?arguments[h]:{};h%2?R(Object(O),!0).forEach(function(w){S(g,w,O[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(O)):R(Object(O)).forEach(function(w){Object.defineProperty(g,w,Object.getOwnPropertyDescriptor(O,w))})}return g}function S(g,h,O){return h in g?Object.defineProperty(g,h,{value:O,enumerable:!0,configurable:!0,writable:!0}):g[h]=O,g}var D=T(T({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:c.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Z.default,bufferController:r.default,capLevelController:m.default,fpsController:f.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:t.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},I()),{},{subtitleStreamController:Y.SubtitleStreamController,subtitleTrackController:X.default,timelineController:A.TimelineController,audioStreamController:G.default,audioTrackController:M.default,emeController:p.default,cmcdController:a.default});function I(){return{cueHandler:i.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 E(g,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return o({},g,h)}function x(g){var h=g.loader;if(h!==s.default&&h!==c.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),g.progressive=!1;else{var O=Object(s.fetchSupported)();O&&(g.loader=s.default,g.progressive=!0,g.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/polyfills/number.ts"),G=U("./src/utils/ewma-bandwidth-estimator.ts"),M=U("./src/events.ts"),Y=U("./src/utils/buffer-helper.ts"),X=U("./src/errors.ts"),r=U("./src/types/loader.ts"),A=U("./src/utils/logger.ts");function m(a,c){for(var s=0;s<c.length;s++){var i=c[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function f(a,c,s){return c&&m(a.prototype,c),s&&m(a,s),a}var p=function(){function a(s){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=s;var i=s.config;this.bwEstimator=new G.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var c=a.prototype;return c.registerListeners=function(){var i=this.hls;i.on(M.Events.FRAG_LOADING,this.onFragLoading,this),i.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(M.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var i=this.hls;i.off(M.Events.FRAG_LOADING,this.onFragLoading,this),i.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(M.Events.ERROR,this.onError,this)},c.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},c.onFragLoading=function(i,t){var u=t.frag;if(u.type===r.PlaylistLevelType.MAIN&&!this.timer){var o;this.fragCurrent=u,this.partCurrent=(o=t.part)!=null?o:null,this.timer=self.setInterval(this.onCheck,100)}},c.onLevelLoaded=function(i,t){var u=this.hls.config;t.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},c._abandonRulesCheck=function(){var i=this.fragCurrent,t=this.partCurrent,u=this.hls,o=u.autoLevelEnabled,R=u.config,T=u.media;if(!i||!T)return;var S=t?t.stats:i.stats,D=t?t.duration:i.duration;if(S.aborted){A.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||T.paused||!T.playbackRate||!T.readyState)return;var I=performance.now()-S.loading.start,E=Math.abs(T.playbackRate);if(I<=500*D/E)return;var x=u.levels,g=u.minAutoLevel,h=x[i.level],O=S.total||Math.max(S.loaded,Math.round(D*h.maxBitrate/8)),w=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/I),b=(O-S.loaded)/w,W=T.currentTime,j=(Y.BufferHelper.bufferInfo(T,W,R.maxBufferHole).end-W)/E;if(j>=2*D/E||b<=j)return;var C=Number.POSITIVE_INFINITY,B;for(B=i.level-1;B>g;B--){var k=x[B].maxBitrate;if(C=D*k/(8*.8*w),C<j)break}if(C>=b)return;var y=this.bwEstimator.getEstimate();A.logger.warn("Fragment "+i.sn+(t?" part "+t.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+B+`
Current BW estimate: `+(Object(Z.isFiniteNumber)(y)?(y/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+b.toFixed(3)+` s
Estimated load time for the next fragment: `+C.toFixed(3)+` s
Time to underbuffer: `+j.toFixed(3)+" s"),u.nextLoadLevel=B,this.bwEstimator.sample(I,S.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),u.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:t,stats:S})},c.onFragLoaded=function(i,t){var u=t.frag,o=t.part;if(u.type===r.PlaylistLevelType.MAIN&&Object(Z.isFiniteNumber)(u.sn)){var R=o?o.stats:u.stats,T=o?o.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[u.level],D=(S.loaded?S.loaded.bytes:0)+R.loaded,I=(S.loaded?S.loaded.duration:0)+T;S.loaded={bytes:D,duration:I},S.realBitrate=Math.round(8*D/I)}if(u.bitrateTest){var E={stats:R,frag:u,part:o,id:u.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,E),u.bitrateTest=!1}}},c.onFragBuffered=function(i,t){var u=t.frag,o=t.part,R=o?o.stats:u.stats;if(R.aborted)return;if(u.type!==r.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var T=R.parsing.end-R.loading.start;this.bwEstimator.sample(T,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},c.onError=function(i,t){switch(t.details){case X.ErrorDetails.FRAG_LOAD_ERROR:case X.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},c.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},c.getNextABRAutoLevel=function(){var i=this.fragCurrent,t=this.partCurrent,u=this.hls,o=u.maxAutoLevel,R=u.config,T=u.minAutoLevel,S=u.media,D=t?t.duration:i?i.duration:0,I=S?S.currentTime:0,E=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,x=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,g=(Y.BufferHelper.bufferInfo(S,I,R.maxBufferHole).end-I)/E,h=this.findBestLevel(x,T,o,g,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(h>=0)return h;A.logger.trace((g?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var O=D?Math.min(D,R.maxStarvationDelay):R.maxStarvationDelay,w=R.abrBandWidthFactor,b=R.abrBandWidthUpFactor;if(!g){var W=this.bitrateTestDelay;if(W){var j=D?Math.min(D,R.maxLoadingDelay):R.maxLoadingDelay;O=j-W,A.logger.trace("bitrate test took "+Math.round(1e3*W)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*O)+" ms"),w=b=1}}return h=this.findBestLevel(x,T,o,g+O,w,b),Math.max(h,0)},c.findBestLevel=function(i,t,u,o,R,T){for(var S,D=this.fragCurrent,I=this.partCurrent,E=this.lastLoadedFragLevel,x=this.hls.levels,g=x[E],h=!!(g!=null&&(S=g.details)!==null&&S!==void 0&&S.live),O=g==null?void 0:g.codecSet,w=I?I.duration:D?D.duration:0,b=u;b>=t;b--){var W=x[b];if(!W||O&&W.codecSet!==O)continue;var j=W.details,C=(I?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||w,B=void 0;b<=E?B=R*i:B=T*i;var k=x[b].maxBitrate,y=k*C/B;if(A.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(B)+"/"+k+"/"+C+"/"+o+"/"+y),B>k&&(!y||h&&!this.bitrateTestDelay||y<o))return b}return-1},f(a,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,t=this.bwEstimator;if(i!==-1&&(!t||!t.canEstimate()))return i;var u=this.getNextABRAutoLevel();return i!==-1&&(u=Math.min(i,u)),u},set:function(i){this._nextAutoLevel=i}}]),a}();Q.default=p},"./src/controller/audio-stream-controller.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/polyfills/number.ts"),G=U("./src/controller/base-stream-controller.ts"),M=U("./src/events.ts"),Y=U("./src/utils/buffer-helper.ts"),X=U("./src/controller/fragment-tracker.ts"),r=U("./src/types/level.ts"),A=U("./src/types/loader.ts"),m=U("./src/loader/fragment.ts"),f=U("./src/demux/chunk-cache.ts"),p=U("./src/demux/transmuxer-interface.ts"),a=U("./src/types/transmuxer.ts"),c=U("./src/controller/fragment-finders.ts"),s=U("./src/utils/discontinuities.ts"),i=U("./src/errors.ts"),t=U("./src/utils/logger.ts");function u(){return u=Object.assign||function(D){for(var I=1;I<arguments.length;I++){var E=arguments[I];for(var x in E)Object.prototype.hasOwnProperty.call(E,x)&&(D[x]=E[x])}return D},u.apply(this,arguments)}function o(D,I){D.prototype=Object.create(I.prototype),D.prototype.constructor=D,R(D,I)}function R(D,I){return R=Object.setPrototypeOf||function(x,g){return x.__proto__=g,x},R(D,I)}var T=100,S=function(D){o(I,D);function I(x,g){var h;return h=D.call(this,x,g,"[audio-stream-controller]")||this,h.videoBuffer=null,h.videoTrackCC=-1,h.waitingVideoCC=-1,h.audioSwitch=!1,h.trackId=-1,h.waitingData=null,h.mainDetails=null,h.bufferFlushed=!1,h._registerListeners(),h}var E=I.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var g=this.hls;g.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.on(M.Events.ERROR,this.onError,this),g.on(M.Events.BUFFER_RESET,this.onBufferReset,this),g.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var g=this.hls;g.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.off(M.Events.ERROR,this.onError,this),g.off(M.Events.BUFFER_RESET,this.onBufferReset,this),g.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onInitPtsFound=function(g,h){var O=h.frag,w=h.id,b=h.initPTS;if(w==="main"){var W=O.cc;this.initPTS[O.cc]=b,this.log("InitPTS for cc: "+W+" found from main: "+b),this.videoTrackCC=W,this.state===G.State.WAITING_INIT_PTS&&this.tick()}},E.startLoad=function(g){if(!this.levels){this.startPosition=g,this.state=G.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(T),this.fragLoadError=0,h>0&&g===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=G.State.IDLE):(this.loadedmetadata=!1,this.state=G.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()},E.doTick=function(){switch(this.state){case G.State.IDLE:this.doTickIdle();break;case G.State.WAITING_TRACK:{var g,h=this.levels,O=this.trackId,w=h==null||((g=h[O])===null||g===void 0)?void 0:g.details;if(w){if(this.waitForCdnTuneIn(w))break;this.state=G.State.WAITING_INIT_PTS}break}case G.State.FRAG_LOADING_WAITING_RETRY:{var b,W=performance.now(),j=this.retryDate;(!j||W>=j||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=G.State.IDLE);break}case G.State.WAITING_INIT_PTS:{var C=this.waitingData;if(C){var B=C.frag,k=C.part,y=C.cache,H=C.complete;if(this.initPTS[B.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=G.State.FRAG_LOADING;var J=y.flush(),se={frag:B,part:k,payload:J,networkDetails:null};this._handleFragmentLoadProgress(se),H&&D.prototype._handleFragmentLoadComplete.call(this,se)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+B.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),ve=Y.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Se=Object(c.fragmentWithinToleranceTest)(ve.end,this.config.maxFragLookUpTolerance,B);Se<0&&(t.logger.log("Waiting fragment cc ("+B.cc+") @ "+B.start+" cancelled because another fragment at "+ve.end+" is needed"),this.clearWaitingFragment())}}else this.state=G.State.IDLE}}this.onTickEnd()},E.clearWaitingFragment=function(){var g=this.waitingData;g&&(this.fragmentTracker.removeFragment(g.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=G.State.IDLE)},E.onTickEnd=function(){var g=this.media;if(!g||!g.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:g,O=h.buffered;!this.loadedmetadata&&O.length&&(this.loadedmetadata=!0),this.lastCurrentTime=g.currentTime},E.doTickIdle=function(){var g,h,O=this.hls,w=this.levels,b=this.media,W=this.trackId,j=O.config;if(!w||!w[W])return;if(!b&&(this.startFragRequested||!j.startFragPrefetch))return;var C=w[W],B=C.details;if(!B||B.live&&this.levelLastLoaded!==W||this.waitForCdnTuneIn(B)){this.state=G.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,m.ElementaryStreamTypes.AUDIO,A.PlaylistLevelType.AUDIO));var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,A.PlaylistLevelType.AUDIO);if(k===null)return;var y=k.len,H=this.getMaxBufferLength(),J=this.audioSwitch;if(y>=H&&!J)return;if(!J&&this._streamEnded(k,B)){O.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=G.State.ENDED;return}var se=B.fragments,fe=se[0].start,ve=k.end;if(J){var Se=this.getLoadPosition();ve=Se,B.PTSKnown&&Se<fe&&((k.end>fe||k.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=fe+.05))}var Ue=this.getNextFragment(ve,B);if(!Ue){this.bufferFlushed=!0;return}((g=Ue.decryptdata)===null||g===void 0?void 0:g.keyFormat)==="identity"&&!((h=Ue.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(Ue,B):this.loadFragment(Ue,B,ve)},E.getMaxBufferLength=function(){var g=D.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,A.PlaylistLevelType.MAIN);return h===null?g:Math.max(g,h.len)},E.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},E.onAudioTracksUpdated=function(g,h){var O=h.audioTracks;this.resetTransmuxer(),this.levels=O.map(function(w){return new r.Level(w)})},E.onAudioTrackSwitching=function(g,h){var O=!!h.url;this.trackId=h.id;var w=this.fragCurrent;w!=null&&w.loader&&w.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),O?this.setInterval(T):this.resetTransmuxer(),O?(this.audioSwitch=!0,this.state=G.State.IDLE):this.state=G.State.STOPPED,this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},E.onLevelLoaded=function(g,h){this.mainDetails=h.details},E.onAudioTrackLoaded=function(g,h){var O,w=this.levels,b=h.details,W=h.id;if(!w){this.warn("Audio tracks were reset while loading level "+W);return}this.log("Track "+W+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var j=w[W],C=0;if(b.live||(O=j.details)!==null&&O!==void 0&&O.live){var B=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!B)return;!j.details&&b.hasProgramDateTime&&B.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(b,B),C=b.fragments[0].start):C=this.alignPlaylists(b,j.details)}j.details=b,this.levelLastLoaded=W,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(j.details,C),this.state===G.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=G.State.IDLE),this.tick()},E._handleFragmentLoadProgress=function(g){var h,O=g.frag,w=g.part,b=g.payload,W=this.config,j=this.trackId,C=this.levels;if(!C){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+O.sn+" of level "+O.level+" will not be buffered");return}var B=C[j];console.assert(B,"Audio track is defined on fragment load progress");var k=B.details;console.assert(k,"Audio track details are defined on fragment load progress");var y=W.defaultAudioCodec||B.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new p.default(this.hls,A.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var J=this.initPTS[O.cc],se=(h=O.initSegment)===null||h===void 0?void 0:h.data;if(J!==void 0){var fe=!1,ve=w?w.index:-1,Se=ve!==-1,Ue=new a.ChunkMetadata(O.level,O.sn,O.stats.chunkCount,b.byteLength,ve,Se);H.push(b,se,y,"",O,w,k.totalduration,fe,Ue,J)}else{t.logger.log("Unknown video PTS for cc "+O.cc+", waiting for video PTS before demuxing audio frag "+O.sn+" of ["+k.startSN+" ,"+k.endSN+"],track "+j);var Te=this.waitingData=this.waitingData||{frag:O,part:w,cache:new f.default,complete:!1},Ie=Te.cache;Ie.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=G.State.WAITING_INIT_PTS}},E._handleFragmentLoadComplete=function(g){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,g)},E.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},E.onBufferCreated=function(g,h){var O=h.tracks.audio;O&&(this.mediaBuffer=O.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},E.onFragBuffered=function(g,h){var O=h.frag,w=h.part;if(O.type!==A.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(O)){this.warn("Fragment "+O.sn+(w?" p: "+w.index:"")+" of level "+O.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}O.sn!=="initSegment"&&(this.fragPrevious=O,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(O,w)},E.onError=function(g,h){switch(h.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.AUDIO,h);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==G.State.ERROR&&this.state!==G.State.STOPPED&&(this.state=h.fatal?G.State.ERROR:G.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="audio"&&(this.state===G.State.PARSING||this.state===G.State.PARSED)){var O=!0,w=this.getFwdBufferInfo(this.mediaBuffer,A.PlaylistLevelType.AUDIO);w&&w.len>.5&&(O=!this.reduceMaxBufferLength(w.len)),O&&(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}},E.onBufferFlushed=function(g,h){var O=h.type;O===m.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},E._handleTransmuxComplete=function(g){var h,O="audio",w=this.hls,b=g.remuxResult,W=g.chunkMeta,j=this.getCurrentContext(W);if(!j){this.warn("The loading context changed while buffering fragment "+W.sn+" of level "+W.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(W.level);return}var C=j.frag,B=j.part,k=b.audio,y=b.text,H=b.id3,J=b.initSegment;if(this.fragContextChanged(C))return;if(this.state=G.State.PARSING,this.audioSwitch&&k&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,C,W),w.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:C,id:O,tracks:J.tracks})),k){var se=k.startPTS,fe=k.endPTS,ve=k.startDTS,Se=k.endDTS;B&&(B.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:fe,startDTS:ve,endDTS:Se}),C.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,se,fe,ve,Se),this.bufferFragmentData(k,C,B,W)}if(H!=null&&(h=H.samples)!==null&&h!==void 0&&h.length){var Ue=u({frag:C,id:O},H);w.trigger(M.Events.FRAG_PARSING_METADATA,Ue)}if(y){var Te=u({frag:C,id:O},y);w.trigger(M.Events.FRAG_PARSING_USERDATA,Te)}},E._bufferInitSegment=function(g,h,O){if(this.state!==G.State.PARSING)return;g.video&&delete g.video;var w=g.audio;if(!w)return;w.levelCodec=w.codec,w.id="audio",this.log("Init audio buffer, container:"+w.container+", codecs[parsed]=["+w.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,g);var b=w.initSegment;if(b!=null&&b.byteLength){var W={type:"audio",frag:h,part:null,chunkMeta:O,parent:h.type,data:b};this.hls.trigger(M.Events.BUFFER_APPENDING,W)}this.tick()},E.loadFragment=function(g,h,O){var w=this.fragmentTracker.getState(g);this.fragCurrent=g,(this.audioSwitch||w===X.FragmentState.NOT_LOADED||w===X.FragmentState.PARTIAL)&&(g.sn==="initSegment"?this._loadInitSegment(g):h.live&&!Object(Z.isFiniteNumber)(this.initPTS[g.cc])?(this.log("Waiting for video PTS in continuity counter "+g.cc+" of live stream before loading audio fragment "+g.sn+" of level "+this.trackId),this.state=G.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,g,h,O)))},E.completeAudioSwitch=function(){var g=this.hls,h=this.media,O=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,g.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:O})},I}(G.default);Q.default=S},"./src/controller/audio-track-controller.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/events.ts"),G=U("./src/errors.ts"),M=U("./src/controller/base-playlist-controller.ts"),Y=U("./src/types/loader.ts");function X(p,a){for(var c=0;c<a.length;c++){var s=a[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(p,s.key,s)}}function r(p,a,c){return a&&X(p.prototype,a),c&&X(p,c),p}function A(p,a){p.prototype=Object.create(a.prototype),p.prototype.constructor=p,m(p,a)}function m(p,a){return m=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},m(p,a)}var f=function(p){A(a,p);function a(s){var i;return i=p.call(this,s,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var c=a.prototype;return c.registerListeners=function(){var i=this.hls;i.on(Z.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(Z.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(Z.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(Z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(Z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(Z.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var i=this.hls;i.off(Z.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(Z.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(Z.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(Z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(Z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(Z.Events.ERROR,this.onError,this)},c.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},c.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},c.onManifestParsed=function(i,t){this.tracks=t.audioTracks||[]},c.onAudioTrackLoaded=function(i,t){var u=t.id,o=t.details,R=this.tracksInGroup[u];if(!R){this.warn("Invalid audio track id "+u);return}var T=R.details;R.details=t.details,this.log("audioTrack "+u+" loaded ["+o.startSN+"-"+o.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,t,T))},c.onLevelLoading=function(i,t){this.switchLevel(t.level)},c.onLevelSwitching=function(i,t){this.switchLevel(t.level)},c.switchLevel=function(i){var t=this.hls.levels[i];if(!(t!=null&&t.audioGroupIds))return;var u=t.audioGroupIds[t.urlId];if(this.groupId!==u){this.groupId=u;var o=this.tracks.filter(function(T){return!u||T.groupId===u});this.selectDefaultTrack&&!o.some(function(T){return T.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=o;var R={audioTracks:o};this.log("Updating audio tracks, "+o.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(Z.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},c.onError=function(i,t){if(p.prototype.onError.call(this,i,t),t.fatal||!t.context)return;t.context.type===Y.PlaylistContextType.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},c.setAudioTrack=function(i){var t=this.tracksInGroup;if(i<0||i>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=t[this.trackId];this.log("Now switching to audio-track index "+i);var o=t[i],R=o.id,T=o.groupId,S=T===void 0?"":T,D=o.name,I=o.type,E=o.url;if(this.trackId=i,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(Z.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:S,name:D,type:I,url:E}),o.details&&!o.details.live)return;var x=this.switchParams(o.url,u==null?void 0:u.details);this.loadPlaylist(x)},c.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,u=this.findTrackId(t)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},c.findTrackId=function(i){for(var t=this.tracksInGroup,u=0;u<t.length;u++){var o=t[u];if((!this.selectDefaultTrack||o.default)&&(!i||i===o.name))return o.id}return-1},c.loadPlaylist=function(i){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var u=t.id,o=t.groupId,R=t.url;if(i)try{R=i.addDirectives(R)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(Z.Events.AUDIO_TRACK_LOADING,{url:R,id:u,groupId:o,deliveryDirectives:i||null})}},r(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),a}(M.default);Q.default=f},"./src/controller/base-playlist-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return r});var Z=U("./src/polyfills/number.ts"),G=U("./src/types/level.ts"),M=U("./src/controller/level-helper.ts"),Y=U("./src/utils/logger.ts"),X=U("./src/errors.ts"),r=function(){function A(f,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=Y.logger.log.bind(Y.logger,p+":"),this.warn=Y.logger.warn.bind(Y.logger,p+":"),this.hls=f}var m=A.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(p,a){a.fatal&&a.type===X.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},m.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},m.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},m.stopLoad=function(){this.canLoad=!1,this.clearTimer()},m.switchParams=function(p,a){var c=a==null?void 0:a.renditionReports;if(c)for(var s=0;s<c.length;s++){var i=c[s],t=""+i.URI;if(t===p.substr(-t.length)){var u=parseInt(i["LAST-MSN"]),o=parseInt(i["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var R=Math.min(a.age-a.partTarget,a.targetduration);o!==void 0&&R>a.partTarget&&(o+=1)}if(Object(Z.isFiniteNumber)(u))return new G.HlsUrlParameters(u,Object(Z.isFiniteNumber)(o)?o:void 0,G.HlsSkip.No)}}},m.loadPlaylist=function(p){},m.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},m.playlistLoaded=function(p,a,c){var s=this,i=a.details,t=a.stats,u=t.loading.end?Math.max(0,self.performance.now()-t.loading.end):0;if(i.advancedDateTime=Date.now()-u,i.live||c!=null&&c.live){if(i.reloaded(c),c&&this.log("live playlist "+p+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),c&&i.fragments.length>0&&Object(M.mergeDetails)(c,i),!this.canLoad||!i.live)return;var o,R=void 0,T=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var S=this.hls.config.lowLatencyMode,D=i.lastPartSn,I=i.endSN,E=i.lastPartIndex,x=E!==-1,g=D===I,h=S?0:E;x?(R=g?I+1:D,T=g?h:E+1):R=I+1;var O=i.age,w=O+i.ageHeader,b=Math.min(w-i.partTarget,i.targetduration*1.5);if(b>0){if(c&&b>c.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+c.tuneInGoal+" to: "+b+" with playlist age: "+i.age),b=0;else{var W=Math.floor(b/i.targetduration);if(R+=W,T!==void 0){var j=Math.round(b%i.targetduration/i.partTarget);T+=j}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+O.toFixed(2)+"s goal: "+b+" skip sn "+W+" to part "+T)}i.tuneInGoal=b}if(o=this.getDeliveryDirectives(i,a.deliveryDirectives,R,T),S||!g){this.loadPlaylist(o);return}}else o=this.getDeliveryDirectives(i,a.deliveryDirectives,R,T);var C=Object(M.computeReloadInterval)(i,t);R!==void 0&&i.canBlockReload&&(C-=i.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(C)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(o)},C)}else this.clearTimer()},m.getDeliveryDirectives=function(p,a,c,s){var i=Object(G.getSkipValue)(p,c);return a!=null&&a.skip&&p.deltaUpdateFailed&&(c=a.msn,s=a.part,i=G.HlsSkip.No),new G.HlsUrlParameters(c,s,i)},m.retryLoadingOrFail=function(p){var a=this,c=this.hls.config,s=this.retryCount<c.levelLoadingMaxRetry;if(s){var i;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(i=p.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var t=Math.min(Math.pow(2,this.retryCount)*c.levelLoadingRetryDelay,c.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},t),this.warn("retry playlist loading #"+this.retryCount+" in "+t+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return s},A}()},"./src/controller/base-stream-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"State",function(){return I}),U.d(Q,"default",function(){return E});var Z=U("./src/polyfills/number.ts"),G=U("./src/task-loop.ts"),M=U("./src/controller/fragment-tracker.ts"),Y=U("./src/utils/buffer-helper.ts"),X=U("./src/utils/logger.ts"),r=U("./src/events.ts"),A=U("./src/errors.ts"),m=U("./src/types/transmuxer.ts"),f=U("./src/utils/mp4-tools.ts"),p=U("./src/utils/discontinuities.ts"),a=U("./src/controller/fragment-finders.ts"),c=U("./src/controller/level-helper.ts"),s=U("./src/loader/fragment-loader.ts"),i=U("./src/crypt/decrypter.ts"),t=U("./src/utils/time-ranges.ts"),u=U("./src/types/loader.ts");function o(x,g){for(var h=0;h<g.length;h++){var O=g[h];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(x,O.key,O)}}function R(x,g,h){return g&&o(x.prototype,g),h&&o(x,h),x}function T(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function S(x,g){x.prototype=Object.create(g.prototype),x.prototype.constructor=x,D(x,g)}function D(x,g){return D=Object.setPrototypeOf||function(O,w){return O.__proto__=w,O},D(x,g)}var I={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"},E=function(x){S(g,x);function g(O,w,b){var W;return W=x.call(this)||this,W.hls=void 0,W.fragPrevious=null,W.fragCurrent=null,W.fragmentTracker=void 0,W.transmuxer=null,W._state=I.STOPPED,W.media=void 0,W.mediaBuffer=void 0,W.config=void 0,W.bitrateTest=!1,W.lastCurrentTime=0,W.nextLoadPosition=0,W.startPosition=0,W.loadedmetadata=!1,W.fragLoadError=0,W.retryDate=0,W.levels=null,W.fragmentLoader=void 0,W.levelLastLoaded=null,W.startFragRequested=!1,W.decrypter=void 0,W.initPTS=[],W.onvseeking=null,W.onvended=null,W.logPrefix="",W.log=void 0,W.warn=void 0,W.logPrefix=b,W.log=X.logger.log.bind(X.logger,b+":"),W.warn=X.logger.warn.bind(X.logger,b+":"),W.hls=O,W.fragmentLoader=new s.default(O.config),W.fragmentTracker=w,W.config=O.config,W.decrypter=new i.default(O,O.config),O.on(r.Events.KEY_LOADED,W.onKeyLoaded,T(W)),W}var h=g.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(w){},h.stopLoad=function(){this.fragmentLoader.abort();var w=this.fragCurrent;w&&this.fragmentTracker.removeFragment(w),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=I.STOPPED},h._streamEnded=function(w,b){var W=this.fragCurrent,j=this.fragmentTracker;if(!b.live&&W&&W.sn===b.endSN&&!w.nextStart){var C=j.getState(W);return C===M.FragmentState.PARTIAL||C===M.FragmentState.OK}return!1},h.onMediaAttached=function(w,b){var W=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),W.addEventListener("seeking",this.onvseeking),W.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===I.STOPPED&&this.startLoad(j.startPosition)},h.onMediaDetaching=function(){var w=this.media;w!=null&&w.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),w&&(w.removeEventListener("seeking",this.onvseeking),w.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},h.onMediaSeeking=function(){var w=this.config,b=this.fragCurrent,W=this.media,j=this.mediaBuffer,C=this.state,B=W?W.currentTime:0,k=Y.BufferHelper.bufferInfo(j||W,B,w.maxBufferHole);if(this.log("media seeking to "+(Object(Z.isFiniteNumber)(B)?B.toFixed(3):B)+", state: "+C),C===I.ENDED)this.resetLoadingState();else if(b&&!k.len){var y=w.maxFragLookUpTolerance,H=b.start-y,J=b.start+b.duration+y,se=B>J;(B<H||se)&&(se&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}W&&(this.lastCurrentTime=B),!this.loadedmetadata&&!k.len&&(this.nextLoadPosition=this.startPosition=B),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(w,b){if(this.state!==I.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=I.IDLE;var W=this.levels[b.frag.level].details;W&&this.loadFragment(b.frag,W,b.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),x.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=I.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,x.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(w,b){this.log("Loading key for "+w.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+w.level),this.state=I.KEY_LOADING,this.fragCurrent=w,this.hls.trigger(r.Events.KEY_LOADING,{frag:w})},h.loadFragment=function(w,b,W){this._loadFragForPlayback(w,b,W)},h._loadFragForPlayback=function(w,b,W){var j=this,C=function(k){if(j.fragContextChanged(w)){j.warn("Fragment "+w.sn+(k.part?" p: "+k.part.index:"")+" of level "+w.level+" was dropped during download."),j.fragmentTracker.removeFragment(w);return}w.stats.chunkCount++,j._handleFragmentLoadProgress(k)};this._doFragLoad(w,b,W,C).then(function(B){if(!B)return;j.fragLoadError=0;var k=j.state;if(j.fragContextChanged(w)){(k===I.FRAG_LOADING||k===I.BACKTRACKING||!j.fragCurrent&&k===I.PARSING)&&(j.fragmentTracker.removeFragment(w),j.state=I.IDLE);return}if("payload"in B&&(j.log("Loaded fragment "+w.sn+" of level "+w.level),j.hls.trigger(r.Events.FRAG_LOADED,B),j.state===I.BACKTRACKING)){j.fragmentTracker.backtrack(w,B),j.resetFragmentLoading(w);return}j._handleFragmentLoadComplete(B)}).catch(function(B){j.warn(B),j.resetFragmentLoading(w)})},h.flushMainBuffer=function(w,b,W){if(W===void 0&&(W=null),!(w-b))return;var j={startOffset:w,endOffset:b,type:W};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,j)},h._loadInitSegment=function(w){var b=this;this._doFragLoad(w).then(function(W){if(!W||b.fragContextChanged(w)||!b.levels)throw new Error("init load aborted");return W}).then(function(W){var j=b.hls,C=W.payload,B=w.decryptdata;if(C&&C.byteLength>0&&B&&B.key&&B.iv&&B.method==="AES-128"){var k=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(C),B.key.buffer,B.iv.buffer).then(function(y){var H=self.performance.now();return j.trigger(r.Events.FRAG_DECRYPTED,{frag:w,payload:y,stats:{tstart:k,tdecrypt:H}}),W.payload=y,W})}return W}).then(function(W){var j=b.fragCurrent,C=b.hls,B=b.levels;if(!B)throw new Error("init load aborted, missing levels");var k=B[w.level].details;console.assert(k,"Level details are defined when init segment is loaded");var y=w.stats;b.state=I.IDLE,b.fragLoadError=0,w.data=new Uint8Array(W.payload),y.parsing.start=y.buffering.start=self.performance.now(),y.parsing.end=y.buffering.end=self.performance.now(),W.frag===j&&C.trigger(r.Events.FRAG_BUFFERED,{stats:y,frag:j,part:null,id:w.type}),b.tick()}).catch(function(W){b.warn(W),b.resetFragmentLoading(w)})},h.fragContextChanged=function(w){var b=this.fragCurrent;return!w||!b||w.level!==b.level||w.sn!==b.sn||w.urlId!==b.urlId},h.fragBufferedComplete=function(w,b){var W=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+w.type+" sn: "+w.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+w.level+" "+t.default.toString(Y.BufferHelper.getBuffered(W))),this.state=I.IDLE,this.tick()},h._handleFragmentLoadComplete=function(w){var b=this.transmuxer;if(!b)return;var W=w.frag,j=w.part,C=w.partsLoaded,B=!C||C.length===0||C.some(function(y){return!y}),k=new m.ChunkMetadata(W.level,W.sn,W.stats.chunkCount+1,0,j?j.index:-1,!B);b.flush(k)},h._handleFragmentLoadProgress=function(w){},h._doFragLoad=function(w,b,W,j){var C=this;if(W===void 0&&(W=null),!this.levels)throw new Error("frag load aborted, missing levels");if(W=Math.max(w.start,W||0),this.config.lowLatencyMode&&b){var B=b.partList;if(B&&j){W>w.end&&b.fragmentHint&&(w=b.fragmentHint);var k=this.getNextPart(B,w,W);if(k>-1){var y=B[k];return this.log("Loading part sn: "+w.sn+" p: "+y.index+" cc: "+w.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+k+"-"+(B.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+w.level+", target: "+parseFloat(W.toFixed(3))),this.nextLoadPosition=y.start+y.duration,this.state=I.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:w,part:B[k],targetBufferTime:W}),this.doFragPartsLoad(w,B,k,j).catch(function(H){return C.handleFragLoadError(H)})}else if(!w.url||this.loadedEndOfParts(B,W))return Promise.resolve(null)}}return this.log("Loading fragment "+w.sn+" cc: "+w.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+w.level+", target: "+parseFloat(W.toFixed(3))),Object(Z.isFiniteNumber)(w.sn)&&!this.bitrateTest&&(this.nextLoadPosition=w.start+w.duration),this.state=I.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:w,targetBufferTime:W}),this.fragmentLoader.load(w,j).catch(function(H){return C.handleFragLoadError(H)})},h.doFragPartsLoad=function(w,b,W,j){var C=this;return new Promise(function(B,k){var y=[],H=function J(se){var fe=b[se];C.fragmentLoader.loadPart(w,fe,j).then(function(ve){y[fe.index]=ve;var Se=ve.part;C.hls.trigger(r.Events.FRAG_LOADED,ve);var Ue=b[se+1];if(Ue&&Ue.fragment===w)J(se+1);else return B({frag:w,part:Se,partsLoaded:y})}).catch(k)};H(W)})},h.handleFragLoadError=function(w){var b=w.data;return b&&b.details===A.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(r.Events.ERROR,b),null},h._handleTransmuxerFlush=function(w){var b=this.getCurrentContext(w);if(!b||this.state!==I.PARSING){this.fragCurrent||(this.state=I.IDLE);return}var W=b.frag,j=b.part,C=b.level,B=self.performance.now();W.stats.parsing.end=B,j&&(j.stats.parsing.end=B),this.updateLevelTiming(W,j,C,w.partial)},h.getCurrentContext=function(w){var b=this.levels,W=w.level,j=w.sn,C=w.part;if(!b||!b[W])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+W+". The current chunk will not be buffered."),null;var B=b[W],k=C>-1?Object(c.getPartWith)(B,j,C):null,y=k?k.fragment:Object(c.getFragmentWithSN)(B,j,this.fragCurrent);return y?{frag:y,part:k,level:B}:null},h.bufferFragmentData=function(w,b,W,j){if(!w||this.state!==I.PARSING)return;var C=w.data1,B=w.data2,k=C;if(C&&B&&(k=Object(f.appendUint8Array)(C,B)),!k||!k.length)return;var y={type:w.type,frag:b,part:W,chunkMeta:j,parent:b.type,data:k};this.hls.trigger(r.Events.BUFFER_APPENDING,y),w.dropped&&w.independent&&!W&&this.flushBufferGap(b)},h.flushBufferGap=function(w){var b=this.media;if(!b)return;if(!Y.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,w.start);return}var W=b.currentTime,j=Y.BufferHelper.bufferInfo(b,W,0),C=w.duration,B=Math.min(this.config.maxFragLookUpTolerance*2,C*.25),k=Math.max(Math.min(w.start-B,j.end-B),W+B);w.start-k>B&&this.flushMainBuffer(k,w.start)},h.getFwdBufferInfo=function(w,b){var W=this.config,j=this.getLoadPosition();if(!Object(Z.isFiniteNumber)(j))return null;var C=Y.BufferHelper.bufferInfo(w,j,W.maxBufferHole);if(C.len===0&&C.nextStart!==void 0){var B=this.fragmentTracker.getBufferedFrag(j,b);if(B&&C.nextStart<B.end)return Y.BufferHelper.bufferInfo(w,j,Math.max(C.nextStart,W.maxBufferHole))}return C},h.getMaxBufferLength=function(w){var b=this.config,W;return w?W=Math.max(8*b.maxBufferSize/w,b.maxBufferLength):W=b.maxBufferLength,Math.min(W,b.maxMaxBufferLength)},h.reduceMaxBufferLength=function(w){var b=this.config,W=w||b.maxBufferLength;return b.maxMaxBufferLength>=W?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(w,b){var W,j,C=b.fragments,B=C.length;if(!B)return null;var k=this.config,y=C[0].start,H;if(b.live){var J=k.initialLiveManifestSize;if(B<J)return this.warn("Not enough fragments to start playback (have: "+B+", need: "+J+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(b,C),this.startPosition=H?this.hls.liveSyncPosition||H.start:w)}else w<=y&&(H=C[0]);if(!H){var se=k.lowLatencyMode?b.partEnd:b.fragmentEnd;H=this.getFragmentAtPosition(w,se,b)}return(W=H)!==null&&W!==void 0&&W.initSegment&&!((j=H)!==null&&j!==void 0&&j.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},h.getNextPart=function(w,b,W){for(var j=-1,C=!1,B=!0,k=0,y=w.length;k<y;k++){var H=w[k];if(B=B&&!H.independent,j>-1&&W<H.start)break;var J=H.loaded;!J&&(C||H.independent||B)&&H.fragment===b&&(j=k),C=J}return j},h.loadedEndOfParts=function(w,b){var W=w[w.length-1];return W&&b>W.start&&W.loaded},h.getInitialLiveFragment=function(w,b){var W=this.fragPrevious,j=null;if(W){if(w.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+W.programDateTime),j=Object(a.findFragmentByPDT)(b,W.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var C=W.sn+1;if(C>=w.startSN&&C<=w.endSN){var B=b[C-w.startSN];W.cc===B.cc&&(j=B,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(a.findFragWithCC)(b,W.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var k=this.hls.liveSyncPosition;k!==null&&(j=this.getFragmentAtPosition(k,this.bitrateTest?w.fragmentEnd:w.edge,w))}return j},h.getFragmentAtPosition=function(w,b,W){var j=this.config,C=this.fragPrevious,B=W.fragments,k=W.endSN,y=W.fragmentHint,H=j.maxFragLookUpTolerance,J=!!(j.lowLatencyMode&&W.partList&&y);J&&y&&!this.bitrateTest&&(B=B.concat(y),k=y.sn);var se;if(w<b){var fe=w>b-H?0:H;se=Object(a.findFragmentByPTS)(C,B,w,fe)}else se=B[B.length-1];if(se){var ve=se.sn-W.startSN,Se=C&&se.level===C.level,Ue=B[ve+1],Te=this.fragmentTracker.getState(se);if(Te===M.FragmentState.BACKTRACKED){se=null;for(var Ie=ve;B[Ie]&&this.fragmentTracker.getState(B[Ie])===M.FragmentState.BACKTRACKED;)C?se=B[Ie--]:se=B[--Ie];se||(se=Ue)}else C&&se.sn===C.sn&&!J&&(Se&&(se.sn<k&&this.fragmentTracker.getState(Ue)!==M.FragmentState.OK?(this.log("SN "+se.sn+" just loaded, load next one: "+Ue.sn),se=Ue):se=null))}return se},h.synchronizeToLiveEdge=function(w){var b=this.config,W=this.media;if(!W)return;var j=this.hls.liveSyncPosition,C=W.currentTime,B=w.fragments[0].start,k=w.edge,y=C>=B-b.maxFragLookUpTolerance&&C<=k;if(j!==null&&W.duration>j&&(C<j||!y)){var H=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*w.targetduration;(!y&&W.readyState<4||C<k-H)&&(this.loadedmetadata||(this.nextLoadPosition=j),W.readyState&&(this.warn("Playback: "+C.toFixed(3)+" is located too far from the end of live sliding playlist: "+k+", reset currentTime to : "+j.toFixed(3)),W.currentTime=j))}},h.alignPlaylists=function(w,b){var W=this.levels,j=this.levelLastLoaded,C=this.fragPrevious,B=j!==null?W[j]:null,k=w.fragments.length;if(!k)return this.warn("No fragments in live playlist"),0;var y=w.fragments[0].start,H=!b,J=w.alignedSliding&&Object(Z.isFiniteNumber)(y);if(H||!J&&!y){Object(p.alignStream)(C,B,w);var se=w.fragments[0].start;return this.log("Live playlist sliding: "+se.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+w.startSN+" prev-sn: "+(C?C.sn:"na")+" fragments: "+k),se}return y},h.waitForCdnTuneIn=function(w){var b=3;return w.live&&w.canBlockReload&&w.tuneInGoal>Math.max(w.partHoldBack,w.partTarget*b)},h.setStartPosition=function(w,b){var W=this.startPosition;if(W<b&&(W=-1),W===-1||this.lastCurrentTime===-1){var j=w.startTimeOffset;Object(Z.isFiniteNumber)(j)?(W=b+j,j<0&&(W+=w.totalduration),W=Math.min(Math.max(b,W),b+w.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+W),this.startPosition=W):w.live?W=this.hls.liveSyncPosition||b:this.startPosition=W=0,this.lastCurrentTime=W}this.nextLoadPosition=W},h.getLoadPosition=function(){var w=this.media,b=0;return this.loadedmetadata&&w?b=w.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},h.handleFragLoadAborted=function(w,b){this.transmuxer&&w.sn!=="initSegment"&&w.stats.aborted&&(this.warn("Fragment "+w.sn+(b?" part"+b.index:"")+" of level "+w.level+" was aborted"),this.resetFragmentLoading(w))},h.resetFragmentLoading=function(w){(!this.fragCurrent||!this.fragContextChanged(w))&&(this.state=I.IDLE)},h.onFragmentOrKeyLoadError=function(w,b){if(b.fatal)return;var W=b.frag;if(!W||W.type!==w)return;var j=this.fragCurrent;console.assert(j&&W.sn===j.sn&&W.level===j.level&&W.urlId===j.urlId,"Frag load error must match current frag to retry");var C=this.config;if(this.fragLoadError+1<=C.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(W.level))return;var B=Math.min(Math.pow(2,this.fragLoadError)*C.fragLoadingRetryDelay,C.fragLoadingMaxRetryTimeout);this.warn("Fragment "+W.sn+" of "+w+" "+W.level+" failed to load, retrying in "+B+"ms"),this.retryDate=self.performance.now()+B,this.fragLoadError++,this.state=I.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(w===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=I.IDLE):(X.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=I.ERROR)},h.afterBufferFlushed=function(w,b,W){if(!w)return;var j=Y.BufferHelper.getBuffered(w);this.fragmentTracker.detectEvictedFragments(b,j,W),this.state===I.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=I.IDLE},h.resetLiveStartWhenNotLoaded=function(w){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[w].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(w,b,W,j){var C=this,B=W.details;console.assert(!!B,"level.details must be defined");var k=Object.keys(w.elementaryStreams).reduce(function(y,H){var J=w.elementaryStreams[H];if(J){var se=J.endPTS-J.startPTS;if(se<=0)return C.warn("Could not parse fragment "+w.sn+" "+H+" duration reliably ("+se+") resetting transmuxer to fallback to playlist timing"),C.resetTransmuxer(),y||!1;var fe=j?0:Object(c.updateFragPTSDTS)(B,w,J.startPTS,J.endPTS,J.startDTS,J.endDTS);return C.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:B,level:W,drift:fe,type:H,frag:w,start:J.startPTS,end:J.endPTS}),!0}return y},!1);k?(this.state=I.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:w,part:b})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(g,[{key:"state",get:function(){return this._state},set:function(w){var b=this._state;b!==w&&(this._state=w,this.log(b+"->"+w))}}]),g}(G.default)},"./src/controller/buffer-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return a});var Z=U("./src/polyfills/number.ts"),G=U("./src/events.ts"),M=U("./src/utils/logger.ts"),Y=U("./src/errors.ts"),X=U("./src/utils/buffer-helper.ts"),r=U("./src/utils/mediasource-helper.ts"),A=U("./src/loader/fragment.ts"),m=U("./src/controller/buffer-operation-queue.ts"),f=Object(r.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function c(i){var t=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var u=t.hls,o=t.media,R=t.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),o&&(t.updateMediaElementDuration(),u.trigger(G.Events.MEDIA_ATTACHED,{media:o})),R&&R.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var s=c.prototype;return s.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},s.destroy=function(){this.unregisterListeners(),this.details=null},s.registerListeners=function(){var t=this.hls;t.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(G.Events.BUFFER_RESET,this.onBufferReset,this),t.on(G.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(G.Events.BUFFER_EOS,this.onBufferEos,this),t.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(G.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(G.Events.FRAG_PARSED,this.onFragParsed,this),t.on(G.Events.FRAG_CHANGED,this.onFragChanged,this)},s.unregisterListeners=function(){var t=this.hls;t.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(G.Events.BUFFER_RESET,this.onBufferReset,this),t.off(G.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(G.Events.BUFFER_EOS,this.onBufferEos,this),t.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(G.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(G.Events.FRAG_PARSED,this.onFragParsed,this),t.off(G.Events.FRAG_CHANGED,this.onFragChanged,this)},s._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new m.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},s.onManifestParsed=function(t,u){var o=2;(u.audio&&!u.video||!u.altAudio)&&(o=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=o,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(t,u){var o=this.media=u.media;if(o&&f){var R=this.mediaSource=new f;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(R),this._objectUrl=o.src}},s.onMediaDetaching=function(){var t=this.media,u=this.mediaSource,o=this._objectUrl;if(u){if(M.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(R){M.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(o&&self.URL.revokeObjectURL(o),t.src===o?(t.removeAttribute("src"),t.load()):M.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(G.Events.MEDIA_DETACHED,void 0)},s.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(u){var o=t.sourceBuffer[u];try{o&&(t.removeBufferListeners(u),t.mediaSource&&t.mediaSource.removeSourceBuffer(o),t.sourceBuffer[u]=void 0)}catch(R){M.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",R)}}),this._initSourceBuffer()},s.onBufferCodecs=function(t,u){var o=this,R=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(T){if(R){var S=o.tracks[T];if(S&&typeof S.buffer.changeType=="function"){var D=u[T],I=D.codec,E=D.levelCodec,x=D.container,g=(S.levelCodec||S.codec).replace(p,"$1"),h=(E||I).replace(p,"$1");if(g!==h){var O=x+";codecs="+(E||I);o.appendChangeType(T,O)}}}else o.pendingTracks[T]=u[T]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},s.appendChangeType=function(t,u){var o=this,R=this.operationQueue,T={execute:function(){var D=o.sourceBuffer[t];D&&(M.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+u),D.changeType(u)),R.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(D){M.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",D)}};R.append(T,t)},s.onBufferAppending=function(t,u){var o=this,R=this.hls,T=this.operationQueue,S=this.tracks,D=u.data,I=u.type,E=u.frag,x=u.part,g=u.chunkMeta,h=g.buffering[I],O=self.performance.now();h.start=O;var w=E.stats.buffering,b=x?x.stats.buffering:null;w.start===0&&(w.start=O),b&&b.start===0&&(b.start=O);var W=S.audio,j=I==="audio"&&g.id===1&&(W==null?void 0:W.container)==="audio/mpeg",C={execute:function(){if(h.executeStart=self.performance.now(),j){var k=o.sourceBuffer[I];if(k){var y=E.start-k.timestampOffset;Math.abs(y)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+E.start+" (delta: "+y+") sn: "+E.sn+")"),k.timestampOffset=E.start)}}o.appendExecutor(D,I)},onStart:function(){},onComplete:function(){var k=self.performance.now();h.executeEnd=h.end=k,w.first===0&&(w.first=k),b&&b.first===0&&(b.first=k);var y=o.sourceBuffer,H={};for(var J in y)H[J]=X.BufferHelper.getBuffered(y[J]);o.appendError=0,o.hls.trigger(G.Events.BUFFER_APPENDED,{type:I,frag:E,part:x,chunkMeta:g,parent:E.type,timeRanges:H})},onError:function(k){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+I+" SourceBuffer",k);var y={type:Y.ErrorTypes.MEDIA_ERROR,parent:E.type,details:Y.ErrorDetails.BUFFER_APPEND_ERROR,err:k,fatal:!1};k.code===DOMException.QUOTA_EXCEEDED_ERR?y.details=Y.ErrorDetails.BUFFER_FULL_ERROR:(o.appendError++,y.details=Y.ErrorDetails.BUFFER_APPEND_ERROR,o.appendError>R.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),y.fatal=!0)),R.trigger(G.Events.ERROR,y)}};T.append(C,I)},s.onBufferFlushing=function(t,u){var o=this,R=this.operationQueue,T=function(D){return{execute:o.removeExecutor.bind(o,D,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){o.hls.trigger(G.Events.BUFFER_FLUSHED,{type:D})},onError:function(E){M.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",E)}}};u.type?R.append(T(u.type),u.type):this.getSourceBufferTypes().forEach(function(S){R.append(T(S),S)})},s.onFragParsed=function(t,u){var o=this,R=u.frag,T=u.part,S=[],D=T?T.elementaryStreams:R.elementaryStreams;D[A.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(D[A.ElementaryStreamTypes.AUDIO]&&S.push("audio"),D[A.ElementaryStreamTypes.VIDEO]&&S.push("video"));var I=function(){var x=self.performance.now();R.stats.buffering.end=x,T&&(T.stats.buffering.end=x);var g=T?T.stats:R.stats;o.hls.trigger(G.Events.FRAG_BUFFERED,{frag:R,part:T,stats:g,id:R.type})};S.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(I,S)},s.onFragChanged=function(t,u){this.flushBackBuffer()},s.onBufferEos=function(t,u){var o=this,R=this.getSourceBufferTypes().reduce(function(T,S){var D=o.sourceBuffer[S];return(!u.type||u.type===S)&&(D&&!D.ended&&(D.ended=!0,M.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),T&&!!(!D||D.ended)},!0);R&&this.blockBuffers(function(){var T=o.mediaSource;if(!T||T.readyState!=="open")return;T.endOfStream()})},s.onLevelUpdated=function(t,u){var o=u.details;if(!o.fragments.length)return;this.details=o,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},s.flushBackBuffer=function(){var t=this.hls,u=this.details,o=this.media,R=this.sourceBuffer;if(!o||u===null)return;var T=this.getSourceBufferTypes();if(!T.length)return;var S=u.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(Z.isFiniteNumber)(S)||S<0)return;var D=o.currentTime,I=u.levelTargetDuration,E=Math.max(S,I),x=Math.floor(D/I)*I-E;T.forEach(function(g){var h=R[g];if(h){var O=X.BufferHelper.getBuffered(h);O.length>0&&x>O.start(0)&&(t.trigger(G.Events.BACK_BUFFER_REACHED,{bufferEnd:x}),u.live&&t.trigger(G.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:x}),t.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:x,type:g}))}})},s.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,u=this.hls,o=this.media,R=this.mediaSource,T=t.fragments[0].start+t.totalduration,S=o.duration,D=Object(Z.isFiniteNumber)(R.duration)?R.duration:0;t.live&&u.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(t)):(T>D&&T>S||!Object(Z.isFiniteNumber)(S))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),R.duration=T)},s.updateSeekableRange=function(t){var u=this.mediaSource,o=t.fragments,R=o.length;if(R&&t.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var T=Math.max(0,o[0].start),S=Math.max(T,T+t.totalduration);u.setLiveSeekableRange(T,S)}},s.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,u=this.operationQueue,o=this.pendingTracks,R=Object.keys(o).length;if(R&&!t||R===2){this.createSourceBuffers(o),this.pendingTracks={};var T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(G.Events.ERROR,{type:Y.ErrorTypes.MEDIA_ERROR,details:Y.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.forEach(function(S){u.executeNext(S)})}},s.createSourceBuffers=function(t){var u=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var T in t)if(!u[T]){var S=t[T];if(!S)throw Error("source buffer exists for track "+T+", however track does not");var D=S.levelCodec||S.codec,I=S.container+";codecs="+D;M.logger.log("[buffer-controller]: creating sourceBuffer("+I+")");try{var E=u[T]=o.addSourceBuffer(I),x=T;this.addBufferListener(x,"updatestart",this._onSBUpdateStart),this.addBufferListener(x,"updateend",this._onSBUpdateEnd),this.addBufferListener(x,"error",this._onSBUpdateError),this.tracks[T]={buffer:E,codec:D,container:S.container,levelCodec:S.levelCodec,id:S.id},R++}catch(g){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+g.message),this.hls.trigger(G.Events.ERROR,{type:Y.ErrorTypes.MEDIA_ERROR,details:Y.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:g,mimeType:I})}}R&&this.hls.trigger(G.Events.BUFFER_CREATED,{tracks:this.tracks})},s._onSBUpdateStart=function(t){var u=this.operationQueue,o=u.current(t);o.onStart()},s._onSBUpdateEnd=function(t){var u=this.operationQueue,o=u.current(t);o.onComplete(),u.shiftAndExecuteNext(t)},s._onSBUpdateError=function(t,u){M.logger.error("[buffer-controller]: "+t+" SourceBuffer error",u),this.hls.trigger(G.Events.ERROR,{type:Y.ErrorTypes.MEDIA_ERROR,details:Y.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var o=this.operationQueue.current(t);o&&o.onError(u)},s.removeExecutor=function(t,u,o){var R=this.media,T=this.mediaSource,S=this.operationQueue,D=this.sourceBuffer,I=D[t];if(!R||!T||!I){M.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(t);return}var E=Object(Z.isFiniteNumber)(R.duration)?R.duration:Infinity,x=Object(Z.isFiniteNumber)(T.duration)?T.duration:Infinity,g=Math.max(0,u),h=Math.min(o,E,x);h>g?(M.logger.log("[buffer-controller]: Removing ["+g+","+h+"] from the "+t+" SourceBuffer"),console.assert(!I.updating,t+" sourceBuffer must not be updating"),I.remove(g,h)):S.shiftAndExecuteNext(t)},s.appendExecutor=function(t,u){var o=this.operationQueue,R=this.sourceBuffer,T=R[u];if(!T){M.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(u);return}T.ended=!1,console.assert(!T.updating,u+" sourceBuffer must not be updating"),T.appendBuffer(t)},s.blockBuffers=function(t,u){var o=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var R=this.operationQueue,T=u.map(function(S){return R.appendBlocker(S)});Promise.all(T).then(function(){t(),u.forEach(function(S){var D=o.sourceBuffer[S];(!D||!D.updating)&&R.shiftAndExecuteNext(S)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(t,u,o){var R=this.sourceBuffer[t];if(!R)return;var T=o.bind(this,t);this.listeners[t].push({event:u,listener:T}),R.addEventListener(u,T)},s.removeBufferListeners=function(t){var u=this.sourceBuffer[t];if(!u)return;this.listeners[t].forEach(function(o){u.removeEventListener(o.event,o.listener)})},c}()},"./src/controller/buffer-operation-queue.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return G});var Z=U("./src/utils/logger.ts"),G=function(){function M(X){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=X}var Y=M.prototype;return Y.append=function(r,A){var m=this.queues[A];m.push(r),m.length===1&&this.buffers[A]&&this.executeNext(A)},Y.insertAbort=function(r,A){var m=this.queues[A];m.unshift(r),this.executeNext(A)},Y.appendBlocker=function(r){var A,m=new Promise(function(p){A=p}),f={execute:A,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,r),m},Y.executeNext=function(r){var A=this.buffers,m=this.queues,f=A[r],p=m[r];if(p.length){var a=p[0];try{a.execute()}catch(c){Z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(c),(!f||!f.updating)&&(p.shift(),this.executeNext(r))}}},Y.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},Y.current=function(r){return this.queues[r][0]},M}()},"./src/controller/cap-level-controller.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/events.ts");function G(X,r){for(var A=0;A<r.length;A++){var m=r[A];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(X,m.key,m)}}function M(X,r,A){return r&&G(X.prototype,r),A&&G(X,A),X}var Y=function(){function X(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=X.prototype;return r.setStreamController=function(m){this.streamController=m},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 m=this.hls;m.on(Z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.on(Z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.on(Z.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(Z.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.on(Z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var m=this.hls;m.off(Z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.off(Z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.off(Z.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(Z.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.off(Z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(m,f){X.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},r.onMediaAttaching=function(m,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},r.onManifestParsed=function(m,f){var p=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,p.config.capLevelToPlayerSize&&f.video&&this.startCapping()},r.onBufferCodecs=function(m,f){var p=this.hls;p.config.capLevelToPlayerSize&&f.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var m=this.hls.levels;if(m.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(m.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},r.getMaxLevel=function(m){var f=this,p=this.hls.levels;if(!p.length)return-1;var a=p.filter(function(c,s){return X.isLevelAllowed(s,f.restrictedLevels)&&s<=m});return this.clientRect=null,X.getMaxLevelByMediaSize(a,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 m=this.media,f={width:0,height:0};if(m){var p=m.getBoundingClientRect();f.width=p.width,f.height=p.height,!f.width&&!f.height&&(f.width=p.right-p.left||m.width||0,f.height=p.bottom-p.top||m.height||0)}return this.clientRect=f,f},X.isLevelAllowed=function(m,f){return f===void 0&&(f=[]),f.indexOf(m)===-1},X.getMaxLevelByMediaSize=function(m,f,p){if(!m||!m.length)return-1;for(var a=function(u,o){return o?u.width!==o.width||u.height!==o.height:!0},c=m.length-1,s=0;s<m.length;s+=1){var i=m[s];if((i.width>=f||i.height>=p)&&a(i,m[s+1])){c=s;break}}return c},M(X,[{key:"mediaWidth",get:function(){return this.getDimensions().width*X.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*X.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var m=1;try{m=self.devicePixelRatio}catch(f){}return m}}]),X}();Q.default=Y},"./src/controller/cmcd-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return a});var Z=U("./src/events.ts"),G=U("./src/types/cmcd.ts"),M=U("./src/utils/buffer-helper.ts"),Y=U("./src/utils/logger.ts");function X(c,s){for(var i=0;i<s.length;i++){var t=s[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(c,t.key,t)}}function r(c,s,i){return s&&X(c.prototype,s),i&&X(c,i),c}function A(c,s){var i=typeof Symbol!="undefined"&&c[Symbol.iterator]||c["@@iterator"];if(i)return(i=i.call(c)).next.bind(i);if(Array.isArray(c)||(i=m(c))||s&&c&&typeof c.length=="number"){i&&(c=i);var t=0;return function(){return t>=c.length?{done:!0}:{done:!1,value:c[t++]}}}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 m(c,s){if(!c)return;if(typeof c=="string")return f(c,s);var i=Object.prototype.toString.call(c).slice(8,-1);if(i==="Object"&&c.constructor&&(i=c.constructor.name),i==="Map"||i==="Set")return Array.from(c);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return f(c,s)}function f(c,s){(s==null||s>c.length)&&(s=c.length);for(var i=0,t=new Array(s);i<s;i++)t[i]=c[i];return t}function p(){return p=Object.assign||function(c){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(c[t]=i[t])}return c},p.apply(this,arguments)}var a=function(){function c(i){var t=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(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized=!0),t.buffering=!1},this.applyPlaylistData=function(R){try{t.apply(R,{ot:G.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(T){Y.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(R){try{var T=R.frag,S=t.hls.levels[T.level],D=t.getObjectType(T),I={d:T.duration*1e3,ot:D};(D===G.CMCDObjectType.VIDEO||D===G.CMCDObjectType.AUDIO||D==G.CMCDObjectType.MUXED)&&(I.br=S.bitrate/1e3,I.tb=t.getTopBandwidth(D),I.bl=t.getBufferLength(D)),t.apply(R,I)}catch(E){Y.logger.warn("Could not generate segment CMCD data.",E)}},this.hls=i;var u=this.config=i.config,o=u.cmcd;o!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=o.sessionId||c.uuid(),this.cid=o.contentId,this.useHeaders=o.useHeaders===!0,this.registerListeners())}var s=c.prototype;return s.registerListeners=function(){var t=this.hls;t.on(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Z.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(Z.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var t=this.hls;t.off(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Z.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(Z.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},s.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},s.onMediaAttached=function(t,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},s.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},s.onBufferCreated=function(t,u){var o,R;this.audioBuffer=(o=u.tracks.audio)===null||o===void 0?void 0:o.buffer,this.videoBuffer=(R=u.tracks.video)===null||R===void 0?void 0:R.buffer},s.createData=function(){var t;return{v:G.CMCDVersion,sf:G.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)===null||t===void 0?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},s.apply=function(t,u){u===void 0&&(u={}),p(u,this.createData());var o=u.ot===G.CMCDObjectType.INIT||u.ot===G.CMCDObjectType.VIDEO||u.ot===G.CMCDObjectType.MUXED;if(this.starved&&o&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var R=c.toHeaders(u);if(!Object.keys(R).length)return;t.headers||(t.headers={}),p(t.headers,R)}else{var T=c.toQuery(u);if(!T)return;t.url=c.appendQueryToUri(t.url,T)}},s.getObjectType=function(t){var u=t.type;return u==="subtitle"?G.CMCDObjectType.TIMED_TEXT:t.sn==="initSegment"?G.CMCDObjectType.INIT:u==="audio"?G.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?G.CMCDObjectType.VIDEO:G.CMCDObjectType.MUXED:void 0},s.getTopBandwidth=function(t){for(var u=0,o=t===G.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=A(o),T;!(T=R()).done;){var S=T.value;S.bitrate>u&&(u=S.bitrate)}return u>0?u:NaN},s.getBufferLength=function(t){var u=this.hls.media,o=t===G.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!o||!u)return NaN;var R=M.BufferHelper.bufferInfo(o,u.currentTime,this.config.maxBufferHole);return R.len*1e3},s.createPlaylistLoader=function(){var t=this.config.pLoader,u=this.applyPlaylistData,o=t||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new o(S)}var T=R.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(D,I,E){u(D),this.loader.load(D,I,E)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},s.createFragmentLoader=function(){var t=this.config.fLoader,u=this.applyFragmentData,o=t||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new o(S)}var T=R.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(D,I,E){u(D),this.loader.load(D,I,E)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},c.uuid=function(){var t=URL.createObjectURL(new Blob),u=t.toString();return URL.revokeObjectURL(t),u.substr(u.lastIndexOf("/")+1)},c.serialize=function(t){for(var u=[],o=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},R=function(j){return Math.round(j)},T=function(j){return R(j/100)*100},S=function(j){return encodeURIComponent(j)},D={br:R,d:R,bl:T,dl:T,mtp:T,nor:S,rtp:T,tb:R},I=Object.keys(t||{}).sort(),E=A(I),x;!(x=E()).done;){var g=x.value,h=t[g];if(!o(h))continue;if(g==="v"&&h===1)continue;if(g=="pr"&&h===1)continue;var O=D[g];O&&(h=O(h));var w=typeof h,b=void 0;g==="ot"||g==="sf"||g==="st"?b=g+"="+h:w==="boolean"?b=g:w==="number"?b=g+"="+h:b=g+"="+JSON.stringify(h),u.push(b)}return u.join(",")},c.toHeaders=function(t){for(var u=Object.keys(t),o={},R=["Object","Request","Session","Status"],T=[{},{},{},{}],S={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,I=u;D<I.length;D++){var E=I[D],x=S[E]!=null?S[E]:1;T[x][E]=t[E]}for(var g=0;g<T.length;g++){var h=c.serialize(T[g]);h&&(o["CMCD-"+R[g]]=h)}return o},c.toQuery=function(t){return"CMCD="+encodeURIComponent(c.serialize(t))},c.appendQueryToUri=function(t,u){if(!u)return t;var o=t.includes("?")?"&":"?";return""+t+o+u},c}()},"./src/controller/eme-controller.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/events.ts"),G=U("./src/errors.ts"),M=U("./src/utils/logger.ts"),Y=U("./src/utils/mediakeys-helper.ts");function X(a,c){for(var s=0;s<c.length;s++){var i=c[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function r(a,c,s){return c&&X(a.prototype,c),s&&X(a,s),a}var A=3,m=function(c,s,i){var t={audioCapabilities:[],videoCapabilities:[]};return c.forEach(function(u){t.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:i.audioRobustness||""})}),s.forEach(function(u){t.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:i.videoRobustness||""})}),[t]},f=function(c,s,i,t){switch(c){case Y.KeySystems.WIDEVINE:return m(s,i,t);default:throw new Error("Unknown key-system: "+c)}},p=function(){function a(s){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=s,this._config=s.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var c=a.prototype;return c.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},c._registerListeners=function(){this.hls.on(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c._unregisterListeners=function(){this.hls.off(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c.getLicenseServerUrl=function(i){switch(i){case Y.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},c._attemptKeySystemAccess=function(i,t,u){var o=this,R=f(i,t,u,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var T=this.requestMediaKeySystemAccess(i,R);this.mediaKeysPromise=T.then(function(S){return o._onMediaKeySystemAccessObtained(i,S)}),T.catch(function(S){M.logger.error('Failed to obtain key-system "'+i+'" access:',S)})},c._onMediaKeySystemAccessObtained=function(i,t){var u=this;M.logger.log('Access for key-system "'+i+'" obtained');var o={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:i};this._mediaKeysList.push(o);var R=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(T){return o.mediaKeys=T,M.logger.log('Media-keys created for key-system "'+i+'"'),u._onMediaKeysCreated(),T});return R.catch(function(T){M.logger.error("Failed to create media-keys:",T)}),R},c._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),i._onNewMediaKeySession(t.mediaKeysSession))})},c._onNewMediaKeySession=function(i){var t=this;M.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(u){t._onKeySessionMessage(i,u.message)},!1)},c._onKeySessionMessage=function(i,t){M.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(u){M.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),i.update(u)})},c.onMediaEncrypted=function(i){var t=this;if(M.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.KEY_SYSTEM_ERROR,details:G.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(R){if(!t._media)return;t._attemptSetMediaKeys(R),t._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(u).catch(u)},c._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.KEY_SYSTEM_ERROR,details:G.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},c._generateRequestWithPreferredKeySession=function(i,t){var u=this,o=this._mediaKeysList[0];if(!o){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.KEY_SYSTEM_ERROR,details:G.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(o.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var R=o.mediaKeysSession;if(!R){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.KEY_SYSTEM_ERROR,details:G.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.KEY_SYSTEM_ERROR,details:G.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+i+'" init data type'),o.mediaKeysSessionInitialized=!0,R.generateRequest(i,t).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(T){M.logger.error("Error generating key-session request:",T),u.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.KEY_SYSTEM_ERROR,details:G.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},c._createLicenseXhr=function(i,t,u){var o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,o,i,t,u);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,o,i),R=void 0}catch(T){M.logger.error(T)}try{o.readyState||o.open("POST",i,!0),R&&R.call(this.hls,o,i)}catch(T){throw new Error("issue setting up KeySystem license XHR "+T)}return o},c._onLicenseRequestReadyStageChange=function(i,t,u,o){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var R=i.response,T=this._licenseResponseCallback;if(T)try{R=T.call(this.hls,i,t)}catch(D){M.logger.error(D)}o(R)}else{if(M.logger.error("License Request XHR failed ("+t+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>A){this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.KEY_SYSTEM_ERROR,details:G.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=A-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(u,o)}break}},c._generateLicenseRequestChallenge=function(i,t){switch(i.mediaKeySystemDomain){case Y.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},c._requestLicense=function(i,t){M.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.KEY_SYSTEM_ERROR,details:G.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var o=this.getLicenseServerUrl(u.mediaKeySystemDomain),R=this._createLicenseXhr(o,i,t);M.logger.log("Sending license request to URL: "+o);var T=this._generateLicenseRequestChallenge(u,i);R.send(T)}catch(S){M.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.KEY_SYSTEM_ERROR,details:G.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},c.onMediaAttached=function(i,t){if(!this._emeEnabled)return;var u=t.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},c.onMediaDetached=function(){var i=this._media,t=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},c.onManifestParsed=function(i,t){if(!this._emeEnabled)return;var u=t.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),o=t.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(Y.KeySystems.WIDEVINE,u,o)},r(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();Q.default=p},"./src/controller/fps-controller.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/events.ts"),G=U("./src/utils/logger.ts"),M=function(){function Y(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 X=Y.prototype;return X.setStreamController=function(A){this.streamController=A},X.registerListeners=function(){this.hls.on(Z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},X.unregisterListeners=function(){this.hls.off(Z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},X.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},X.onMediaAttaching=function(A,m){var f=this.hls.config;if(f.capLevelOnFPSDrop){var p=m.media instanceof self.HTMLVideoElement?m.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},X.checkFPS=function(A,m,f){var p=performance.now();if(m){if(this.lastTime){var a=p-this.lastTime,c=f-this.lastDroppedFrames,s=m-this.lastDecodedFrames,i=1e3*c/a,t=this.hls;if(t.trigger(Z.Events.FPS_DROP,{currentDropped:c,currentDecoded:s,totalDroppedFrames:f}),i>0&&c>t.config.fpsDroppedMonitoringThreshold*s){var u=t.currentLevel;G.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(t.autoLevelCapping===-1||t.autoLevelCapping>=u)&&(u=u-1,t.trigger(Z.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:t.currentLevel}),t.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=f,this.lastDecodedFrames=m}},X.checkFPSInterval=function(){var A=this.media;if(A)if(this.isVideoPlaybackQualityAvailable){var m=A.getVideoPlaybackQuality();this.checkFPS(A,m.totalVideoFrames,m.droppedVideoFrames)}else this.checkFPS(A,A.webkitDecodedFrameCount,A.webkitDroppedFrameCount)},Y}();Q.default=M},"./src/controller/fragment-finders.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"findFragmentByPDT",function(){return M}),U.d(Q,"findFragmentByPTS",function(){return Y}),U.d(Q,"fragmentWithinToleranceTest",function(){return X}),U.d(Q,"pdtWithinToleranceTest",function(){return r}),U.d(Q,"findFragWithCC",function(){return A});var Z=U("./src/polyfills/number.ts"),G=U("./src/utils/binary-search.ts");function M(m,f,p){if(f===null||!Array.isArray(m)||!m.length||!Object(Z.isFiniteNumber)(f))return null;var a=m[0].programDateTime;if(f<(a||0))return null;var c=m[m.length-1].endProgramDateTime;if(f>=(c||0))return null;p=p||0;for(var s=0;s<m.length;++s){var i=m[s];if(r(f,p,i))return i}return null}function Y(m,f,p,a){p===void 0&&(p=0),a===void 0&&(a=0);var c=null;if(m?c=f[m.sn-f[0].sn+1]||null:p===0&&f[0].start===0&&(c=f[0]),c&&X(p,a,c)===0)return c;var s=G.default.search(f,X.bind(null,p,a));return s||c}function X(m,f,p){m===void 0&&(m=0),f===void 0&&(f=0);var a=Math.min(f,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-a<=m?1:p.start-a>m&&p.start?-1:0}function r(m,f,p){var a=Math.min(f,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,c=p.endProgramDateTime||0;return c-a>m}function A(m,f){return G.default.search(m,function(p){return p.cc<f?1:p.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"FragmentState",function(){return M}),U.d(Q,"FragmentTracker",function(){return Y});var Z=U("./src/events.ts"),G=U("./src/types/loader.ts"),M;(function(A){A.NOT_LOADED="NOT_LOADED",A.BACKTRACKED="BACKTRACKED",A.APPENDING="APPENDING",A.PARTIAL="PARTIAL",A.OK="OK"})(M||(M={}));var Y=function(){function A(f){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=f,this._registerListeners()}var m=A.prototype;return m._registerListeners=function(){var p=this.hls;p.on(Z.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(Z.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(Z.Events.FRAG_LOADED,this.onFragLoaded,this)},m._unregisterListeners=function(){var p=this.hls;p.off(Z.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(Z.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(Z.Events.FRAG_LOADED,this.onFragLoaded,this)},m.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},m.getAppendedFrag=function(p,a){if(a===G.PlaylistLevelType.MAIN){var c=this.activeFragment,s=this.activeParts;if(!c)return null;if(s)for(var i=s.length;i--;){var t=s[i],u=t?t.end:c.appendedPTS;if(t.start<=p&&u!==void 0&&p<=u)return i>9&&(this.activeParts=s.slice(i-9)),t}else if(c.start<=p&&c.appendedPTS!==void 0&&p<=c.appendedPTS)return c}return this.getBufferedFrag(p,a)},m.getBufferedFrag=function(p,a){for(var c=this.fragments,s=Object.keys(c),i=s.length;i--;){var t=c[s[i]];if((t==null?void 0:t.body.type)===a&&t.buffered){var u=t.body;if(u.start<=p&&p<=u.end)return u}}return null},m.detectEvictedFragments=function(p,a,c){var s=this;Object.keys(this.fragments).forEach(function(i){var t=s.fragments[i];if(!t)return;if(!t.buffered){t.body.type===c&&s.removeFragment(t.body);return}var u=t.range[p];if(!u)return;u.time.some(function(o){var R=!s.isTimeBuffered(o.startPTS,o.endPTS,a);return R&&s.removeFragment(t.body),R})})},m.detectPartialFragments=function(p){var a=this,c=this.timeRanges,s=p.frag,i=p.part;if(!c||s.sn==="initSegment")return;var t=r(s),u=this.fragments[t];if(!u)return;Object.keys(c).forEach(function(o){var R=s.elementaryStreams[o];if(!R)return;var T=c[o],S=i!==null||R.partial===!0;u.range[o]=a.getBufferedTimes(s,i,S,T)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},m.fragBuffered=function(p){var a=r(p),c=this.fragments[a];c&&(c.backtrack=c.loaded=null,c.buffered=!0)},m.getBufferedTimes=function(p,a,c,s){for(var i={time:[],partial:c},t=a?a.start:p.start,u=a?a.end:p.end,o=p.minEndPTS||u,R=p.maxStartPTS||t,T=0;T<s.length;T++){var S=s.start(T)-this.bufferPadding,D=s.end(T)+this.bufferPadding;if(R>=S&&o<=D){i.time.push({startPTS:Math.max(t,s.start(T)),endPTS:Math.min(u,s.end(T))});break}else if(t<D&&u>S)i.partial=!0,i.time.push({startPTS:Math.max(t,s.start(T)),endPTS:Math.min(u,s.end(T))});else if(u<=S)break}return i},m.getPartialFragment=function(p){var a=null,c,s,i,t=0,u=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(R){var T=o[R];if(!T)return;X(T)&&(s=T.body.start-u,i=T.body.end+u,p>=s&&p<=i&&(c=Math.min(p-s,i-p),t<=c&&(a=T.body,t=c)))}),a},m.getState=function(p){var a=r(p),c=this.fragments[a];return c?c.buffered?X(c)?M.PARTIAL:M.OK:c.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},m.backtrack=function(p,a){var c=r(p),s=this.fragments[c];if(!s||s.backtrack)return null;var i=s.backtrack=a||s.loaded;return s.loaded=null,i},m.getBacktrackData=function(p){var a=r(p),c=this.fragments[a];if(c){var s,i=c.backtrack;if(i!=null&&(s=i.payload)!==null&&s!==void 0&&s.byteLength)return i;this.removeFragment(p)}return null},m.isTimeBuffered=function(p,a,c){for(var s,i,t=0;t<c.length;t++){if(s=c.start(t)-this.bufferPadding,i=c.end(t)+this.bufferPadding,p>=s&&a<=i)return!0;if(a<=s)return!1}return!1},m.onFragLoaded=function(p,a){var c=a.frag,s=a.part;if(c.sn==="initSegment"||c.bitrateTest||s)return;var i=r(c);this.fragments[i]={body:c,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},m.onBufferAppended=function(p,a){var c=this,s=a.frag,i=a.part,t=a.timeRanges;if(s.type===G.PlaylistLevelType.MAIN)if(this.activeFragment=s,i){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(i)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(o){var R=t[o];if(c.detectEvictedFragments(o,R),!i)for(var T=0;T<R.length;T++)s.appendedPTS=Math.max(R.end(T),s.appendedPTS||0)})},m.onFragBuffered=function(p,a){this.detectPartialFragments(a)},m.hasFragment=function(p){var a=r(p);return!!this.fragments[a]},m.removeFragmentsInRange=function(p,a,c){var s=this;Object.keys(this.fragments).forEach(function(i){var t=s.fragments[i];if(!t)return;if(t.buffered){var u=t.body;u.type===c&&u.start<a&&u.end>p&&s.removeFragment(u)}})},m.removeFragment=function(p){var a=r(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[a]},m.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},A}();function X(A){var m,f;return A.buffered&&(((m=A.range.video)===null||m===void 0?void 0:m.partial)||((f=A.range.audio)===null||f===void 0?void 0:f.partial))}function r(A){return A.type+"_"+A.level+"_"+A.urlId+"_"+A.sn}},"./src/controller/gap-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"STALL_MINIMUM_DURATION_MS",function(){return X}),U.d(Q,"MAX_START_GAP_JUMP",function(){return r}),U.d(Q,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return A}),U.d(Q,"SKIP_BUFFER_RANGE_START",function(){return m}),U.d(Q,"default",function(){return f});var Z=U("./src/utils/buffer-helper.ts"),G=U("./src/errors.ts"),M=U("./src/events.ts"),Y=U("./src/utils/logger.ts"),X=250,r=2,A=.1,m=.05,f=function(){function p(c,s,i,t){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=c,this.media=s,this.fragmentTracker=i,this.hls=t}var a=p.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(s){var i=this.config,t=this.media,u=this.stalled,o=t.currentTime,R=t.seeking,T=this.seeking&&!R,S=!this.seeking&&R;if(this.seeking=R,o!==s){if(this.moved=!0,u!==null){if(this.stallReported){var D=self.performance.now()-u;Y.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||T)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!Z.BufferHelper.getBuffered(t).length)return;var I=Z.BufferHelper.bufferInfo(t,o,0),E=I.len>0,x=I.nextStart||0;if(!E&&!x)return;if(R){var g=I.len>r,h=!x||x-o>r&&!this.fragmentTracker.getPartialFragment(o);if(g||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var O,w=Math.max(x,I.start||0)-o,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,W=b==null||((O=b.details)===null||O===void 0)?void 0:O.live,j=W?b.details.targetduration*2:r;if(w>0&&w<=j){this._trySkipBufferHole(null);return}}var C=self.performance.now();if(u===null){this.stalled=C;return}var B=C-u;!R&&B>=X&&this._reportStall(I.len);var k=Z.BufferHelper.bufferInfo(t,o,i.maxBufferHole);this._tryFixBufferStall(k,B)},a._tryFixBufferStall=function(s,i){var t=this.config,u=this.fragmentTracker,o=this.media,R=o.currentTime,T=u.getPartialFragment(R);if(T){var S=this._trySkipBufferHole(T);if(S)return}s.len>t.maxBufferHole&&i>t.highBufferWatchdogPeriod*1e3&&(Y.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(s){var i=this.hls,t=this.media,u=this.stallReported;u||(this.stallReported=!0,Y.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+s+")"),i.trigger(M.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:s}))},a._trySkipBufferHole=function(s){for(var i=this.config,t=this.hls,u=this.media,o=u.currentTime,R=0,T=Z.BufferHelper.getBuffered(u),S=0;S<T.length;S++){var D=T.start(S);if(o+i.maxBufferHole>=R&&o<D){var I=Math.max(D+m,u.currentTime+A);return Y.logger.warn("skipping hole, adjusting currentTime from "+o+" to "+I),this.moved=!0,this.stalled=null,u.currentTime=I,s&&t.trigger(M.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+o+" to "+I,frag:s}),I}R=T.end(S)}return 0},a._tryNudgeBuffer=function(){var s=this.config,i=this.hls,t=this.media,u=t.currentTime,o=(this.nudgeRetry||0)+1;if(this.nudgeRetry=o,o<s.nudgeMaxRetry){var R=u+o*s.nudgeOffset;Y.logger.warn("Nudging 'currentTime' from "+u+" to "+R),t.currentTime=R,i.trigger(M.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else Y.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+s.nudgeMaxRetry+" nudges"),i.trigger(M.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/events.ts"),G=U("./src/utils/texttrack-utils.ts"),M=U("./src/demux/id3.ts"),Y=.25,X=function(){function r(m){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=m,this._registerListeners()}var A=r.prototype;return A.destroy=function(){this._unregisterListeners()},A._registerListeners=function(){var f=this.hls;f.on(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(Z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(Z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(Z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var f=this.hls;f.off(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(Z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(Z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(Z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.onMediaAttached=function(f,p){this.media=p.media},A.onMediaDetaching=function(){if(!this.id3Track)return;Object(G.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},A.getID3Track=function(f){if(!this.media)return;for(var p=0;p<f.length;p++){var a=f[p];if(a.kind==="metadata"&&a.label==="id3")return Object(G.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},A.onFragParsingMetadata=function(f,p){if(!this.media)return;var a=p.frag,c=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var s=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<c.length;i++){var t=M.getID3Frames(c[i].data);if(t){var u=c[i].pts,o=i<c.length-1?c[i+1].pts:a.end,R=o-u;R<=0&&(o=u+Y);for(var T=0;T<t.length;T++){var S=t[T];if(!M.isTimeStampFrame(S)){var D=new s(u,o,"");D.value=S,this.id3Track.addCue(D)}}}}},A.onBufferFlushing=function(f,p){var a=p.startOffset,c=p.endOffset,s=p.type;if(!s||s==="audio"){var i=this.id3Track;i&&Object(G.removeCuesInRange)(i,a,c)}},r}();Q.default=X},"./src/controller/latency-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return r});var Z=U("./src/errors.ts"),G=U("./src/events.ts"),M=U("./src/utils/logger.ts");function Y(A,m){for(var f=0;f<m.length;f++){var p=m[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(A,p.key,p)}}function X(A,m,f){return m&&Y(A.prototype,m),f&&Y(A,f),A}var r=function(){function A(f){var p=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return p.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var m=A.prototype;return m.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},m.registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(G.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(G.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(G.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(G.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(G.Events.ERROR,this.onError)},m.onMediaAttached=function(p,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},m.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},m.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},m.onLevelUpdated=function(p,a){var c=a.details;this.levelDetails=c,c.advanced&&this.timeupdate(),!c.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},m.onError=function(p,a){if(a.details!==Z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},m.timeupdate=function(){var p=this.media,a=this.levelDetails;if(!p||!a)return;this.currentTime=p.currentTime;var c=this.computeLatency();if(c===null)return;this._latency=c;var s=this.config,i=s.lowLatencyMode,t=s.maxLiveSyncPlaybackRate;if(!i||t===1)return;var u=this.targetLatency;if(u===null)return;var o=c-u,R=Math.min(this.maxLatency,u+a.targetduration),T=o<R;if(a.live&&T&&o>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,t)),D=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;p.playbackRate=Math.min(S,Math.max(1,D))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},m.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},m.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},X(A,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,a=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:a?p.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var a=p.holdBack,c=p.partHoldBack,s=p.targetduration,i=this.config,t=i.liveSyncDuration,u=i.liveSyncDurationCount,o=i.lowLatencyMode,R=this.hls.userConfig,T=o&&c||a;(R.liveSyncDuration||R.liveSyncDurationCount||T===0)&&(T=t!==void 0?t:u*s);var S=s,D=1;return T+Math.min(this.stallCount*D,S)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),a=this.targetLatency,c=this.levelDetails;if(p===null||a===null||c===null)return null;var s=c.edge,i=p-a-this.edgeStalled,t=s-c.totalduration,u=s-(this.config.lowLatencyMode&&c.partTarget||c.targetduration);return Math.min(Math.max(t,i),u)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var a=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-a,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,a=this.levelDetails;if(!p||!a)return 0;var c=p.buffered.length;return c?p.buffered.end(c-1):a.edge-this.currentTime}}]),A}()},"./src/controller/level-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return i});var Z=U("./src/types/level.ts"),G=U("./src/events.ts"),M=U("./src/errors.ts"),Y=U("./src/utils/codecs.ts"),X=U("./src/controller/level-helper.ts"),r=U("./src/controller/base-playlist-controller.ts"),A=U("./src/types/loader.ts");function m(){return m=Object.assign||function(t){for(var u=1;u<arguments.length;u++){var o=arguments[u];for(var R in o)Object.prototype.hasOwnProperty.call(o,R)&&(t[R]=o[R])}return t},m.apply(this,arguments)}function f(t,u){for(var o=0;o<u.length;o++){var R=u[o];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(t,R.key,R)}}function p(t,u,o){return u&&f(t.prototype,u),o&&f(t,o),t}function a(t,u){t.prototype=Object.create(u.prototype),t.prototype.constructor=t,c(t,u)}function c(t,u){return c=Object.setPrototypeOf||function(R,T){return R.__proto__=T,R},c(t,u)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(t){a(u,t);function u(R){var T;return T=t.call(this,R,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var o=u.prototype;return o._registerListeners=function(){var T=this.hls;T.on(G.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(G.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(G.Events.ERROR,this.onError,this)},o._unregisterListeners=function(){var T=this.hls;T.off(G.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(G.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(G.Events.ERROR,this.onError,this)},o.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},o.startLoad=function(){var T=this._levels;T.forEach(function(S){S.loadError=0}),t.prototype.startLoad.call(this)},o.onManifestLoaded=function(T,S){var D=[],I=[],E=[],x,g={},h,O=!1,w=!1,b=!1;if(S.levels.forEach(function(B){var k=B.attrs;O=O||!!(B.width&&B.height),w=w||!!B.videoCodec,b=b||!!B.audioCodec,s&&B.audioCodec&&B.audioCodec.indexOf("mp4a.40.34")!==-1&&(B.audioCodec=void 0);var y=B.bitrate+"-"+B.attrs.RESOLUTION+"-"+B.attrs.CODECS;h=g[y],h?h.url.push(B.url):(h=new Z.Level(B),g[y]=h,D.push(h)),k&&(k.AUDIO&&Object(X.addGroupId)(h,"audio",k.AUDIO),k.SUBTITLES&&Object(X.addGroupId)(h,"text",k.SUBTITLES))}),(O||w)&&b&&(D=D.filter(function(B){var k=B.videoCodec,y=B.width,H=B.height;return!!k||!!(y&&H)})),D=D.filter(function(B){var k=B.audioCodec,y=B.videoCodec;return(!k||Object(Y.isCodecSupportedInMp4)(k,"audio"))&&(!y||Object(Y.isCodecSupportedInMp4)(y,"video"))}),S.audioTracks&&(I=S.audioTracks.filter(function(B){return!B.audioCodec||Object(Y.isCodecSupportedInMp4)(B.audioCodec,"audio")}),Object(X.assignTrackIdsByGroup)(I)),S.subtitles&&(E=S.subtitles,Object(X.assignTrackIdsByGroup)(E)),D.length>0){x=D[0].bitrate,D.sort(function(B,k){return B.bitrate-k.bitrate}),this._levels=D;for(var W=0;W<D.length;W++)if(D[W].bitrate===x){this._firstLevel=W,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+x);break}var j=b&&!w,C={levels:D,audioTracks:I,subtitleTracks:E,firstLevel:this._firstLevel,stats:S.stats,audio:b,video:w,altAudio:!j&&I.some(function(B){return!!B.url})};this.hls.trigger(G.Events.MANIFEST_PARSED,C),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},o.onError=function(T,S){if(t.prototype.onError.call(this,T,S),S.fatal)return;var D=S.context,I=this._levels[this.currentLevelIndex];if(D&&(D.type===A.PlaylistContextType.AUDIO_TRACK&&I.audioGroupIds&&D.groupId===I.audioGroupIds[I.urlId]||D.type===A.PlaylistContextType.SUBTITLE_TRACK&&I.textGroupIds&&D.groupId===I.textGroupIds[I.urlId])){this.redundantFailover(this.currentLevelIndex);return}var E=!1,x=!0,g;switch(S.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var h=this._levels[S.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(g=S.frag.level)):g=S.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(x=!1),g=D.level),E=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:g=S.level,E=!0;break}g!==void 0&&this.recoverLevel(S,g,E,x)},o.recoverLevel=function(T,S,D,I){var E=T.details,x=this._levels[S];if(x.loadError++,D){var g=this.retryLoadingOrFail(T);if(g)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(I){var h=x.url.length;if(h>1&&x.loadError<h)T.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var O=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==O&&this._levels[O].loadError===0&&(this.warn(E+": switch to "+O),T.levelRetry=!0,this.hls.nextAutoLevel=O)}}},o.redundantFailover=function(T){var S=this._levels[T],D=S.url.length;if(D>1){var I=(S.urlId+1)%D;this.warn("Switching to redundant URL-id "+I),this._levels.forEach(function(E){E.urlId=I}),this.level=T}},o.onFragLoaded=function(T,S){var D=S.frag;if(D!==void 0&&D.type===A.PlaylistLevelType.MAIN){var I=this._levels[D.level];I!==void 0&&(I.fragmentError=0,I.loadError=0)}},o.onLevelLoaded=function(T,S){var D,I=S.level,E=S.details,x=this._levels[I];if(!x){var g;this.warn("Invalid level index "+I),(g=S.deliveryDirectives)!==null&&g!==void 0&&g.skip&&(E.deltaUpdateFailed=!0);return}I===this.currentLevelIndex?(x.fragmentError===0&&(x.loadError=0,this.retryCount=0),this.playlistLoaded(I,S,x.details)):(D=S.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(E.deltaUpdateFailed=!0)},o.onAudioTrackSwitched=function(T,S){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var I=-1,E=this.hls.audioTracks[S.id].groupId,x=0;x<D.audioGroupIds.length;x++)if(D.audioGroupIds[x]===E){I=x;break}I!==D.urlId&&(D.urlId=I,this.startLoad())}},o.loadPlaylist=function(T){var S=this.currentLevelIndex,D=this._levels[S];if(this.canLoad&&D&&D.url.length>0){var I=D.urlId,E=D.url[I];if(T)try{E=T.addDirectives(E)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Attempt loading level index "+S+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+I+" "+E),this.clearTimer(),this.hls.trigger(G.Events.LEVEL_LOADING,{url:E,level:S,id:I,deliveryDirectives:T||null})}},o.removeLevel=function(T,S){var D=function(x,g){return g!==S},I=this._levels.filter(function(E,x){return x!==T?!0:E.url.length>1&&S!==void 0?(E.url=E.url.filter(D),E.audioGroupIds&&(E.audioGroupIds=E.audioGroupIds.filter(D)),E.textGroupIds&&(E.textGroupIds=E.textGroupIds.filter(D)),E.urlId=0,!0):!1}).map(function(E,x){var g=E.details;return g!=null&&g.fragments&&g.fragments.forEach(function(h){h.level=x}),E});this._levels=I,this.hls.trigger(G.Events.LEVELS_UPDATED,{levels:I})},p(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var S,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===T&&(S=D[T])!==null&&S!==void 0&&S.details)return;if(T<0||T>=D.length){var I=T<0;if(this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:I,reason:"invalid level idx"}),I)return;T=Math.min(T,D.length-1)}this.clearTimer();var E=this.currentLevelIndex,x=D[E],g=D[T];this.log("switching to level "+T+" from "+E),this.currentLevelIndex=T;var h=m({},g,{level:T,maxBitrate:g.maxBitrate,uri:g.uri,urlId:g.urlId});delete h._urlId,this.hls.trigger(G.Events.LEVEL_SWITCHING,h);var O=g.details;if(!O||O.live){var w=this.switchParams(g.uri,x==null?void 0:x.details);this.loadPlaylist(w)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),u}(r.default)},"./src/controller/level-helper.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"addGroupId",function(){return M}),U.d(Q,"assignTrackIdsByGroup",function(){return Y}),U.d(Q,"updatePTS",function(){return X}),U.d(Q,"updateFragPTSDTS",function(){return A}),U.d(Q,"mergeDetails",function(){return m}),U.d(Q,"mapPartIntersection",function(){return f}),U.d(Q,"mapFragmentIntersection",function(){return p}),U.d(Q,"adjustSliding",function(){return a}),U.d(Q,"addSliding",function(){return c}),U.d(Q,"computeReloadInterval",function(){return s}),U.d(Q,"getFragmentWithSN",function(){return i}),U.d(Q,"getPartWith",function(){return t});var Z=U("./src/polyfills/number.ts"),G=U("./src/utils/logger.ts");function M(u,o,R){switch(o){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(R);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(R);break}}function Y(u){var o={};u.forEach(function(R){var T=R.groupId||"";R.id=o[T]=o[T]||0,o[T]++})}function X(u,o,R){var T=u[o],S=u[R];r(T,S)}function r(u,o){var R=o.startPTS;if(Object(Z.isFiniteNumber)(R)){var T=0,S;o.sn>u.sn?(T=R-u.start,S=u):(T=u.start-R,S=o),S.duration!==T&&(S.duration=T)}else if(o.sn>u.sn){var D=u.cc===o.cc;D&&u.minEndPTS?o.start=u.start+(u.minEndPTS-u.start):o.start=u.start+u.duration}else o.start=Math.max(u.start-o.duration,0)}function A(u,o,R,T,S,D){var I=T-R;I<=0&&(G.logger.warn("Fragment should have a positive duration",o),T=R+o.duration,D=S+o.duration);var E=R,x=T,g=o.startPTS,h=o.endPTS;if(Object(Z.isFiniteNumber)(g)){var O=Math.abs(g-R);Object(Z.isFiniteNumber)(o.deltaPTS)?o.deltaPTS=Math.max(O,o.deltaPTS):o.deltaPTS=O,E=Math.max(R,g),R=Math.min(R,g),S=Math.min(S,o.startDTS),x=Math.min(T,h),T=Math.max(T,h),D=Math.max(D,o.endDTS)}o.duration=T-R;var w=R-o.start;o.appendedPTS=T,o.start=o.startPTS=R,o.maxStartPTS=E,o.startDTS=S,o.endPTS=T,o.minEndPTS=x,o.endDTS=D;var b=o.sn;if(!u||b<u.startSN||b>u.endSN)return 0;var W,j=b-u.startSN,C=u.fragments;for(C[j]=o,W=j;W>0;W--)r(C[W],C[W-1]);for(W=j;W<C.length-1;W++)r(C[W],C[W+1]);return u.fragmentHint&&r(C[C.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,w}function m(u,o){for(var R=null,T=u.fragments,S=T.length-1;S>=0;S--){var D=T[S].initSegment;if(D){R=D;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var I=0,E;if(p(u,o,function(W,j){W.relurl&&(I=W.cc-j.cc),Object(Z.isFiniteNumber)(W.startPTS)&&Object(Z.isFiniteNumber)(W.endPTS)&&(j.start=j.startPTS=W.startPTS,j.startDTS=W.startDTS,j.appendedPTS=W.appendedPTS,j.maxStartPTS=W.maxStartPTS,j.endPTS=W.endPTS,j.endDTS=W.endDTS,j.minEndPTS=W.minEndPTS,j.duration=W.endPTS-W.startPTS,j.duration&&(E=j),o.PTSKnown=o.alignedSliding=!0),j.elementaryStreams=W.elementaryStreams,j.loader=W.loader,j.stats=W.stats,j.urlId=W.urlId,W.initSegment&&(j.initSegment=W.initSegment,R=W.initSegment)}),R){var x=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;x.forEach(function(W){var j;(!W.initSegment||W.initSegment.relurl===((j=R)===null||j===void 0?void 0:j.relurl))&&(W.initSegment=R)})}if(o.skippedSegments&&(o.deltaUpdateFailed=o.fragments.some(function(W){return!W}),o.deltaUpdateFailed)){G.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var g=o.skippedSegments;g--;)o.fragments.shift();o.startSN=o.fragments[0].sn,o.startCC=o.fragments[0].cc}var h=o.fragments;if(I){G.logger.warn("discontinuity sliding from playlist, take drift into account");for(var O=0;O<h.length;O++)h[O].cc+=I}o.skippedSegments&&(o.startCC=o.fragments[0].cc),f(u.partList,o.partList,function(W,j){j.elementaryStreams=W.elementaryStreams,j.stats=W.stats}),E?A(o,E,E.startPTS,E.endPTS,E.startDTS,E.endDTS):a(u,o),h.length&&(o.totalduration=o.edge-h[0].start),o.driftStartTime=u.driftStartTime,o.driftStart=u.driftStart;var w=o.advancedDateTime;if(o.advanced&&w){var b=o.edge;o.driftStart||(o.driftStartTime=w,o.driftStart=b),o.driftEndTime=w,o.driftEnd=b}else o.driftEndTime=u.driftEndTime,o.driftEnd=u.driftEnd,o.advancedDateTime=u.advancedDateTime}function f(u,o,R){if(u&&o)for(var T=0,S=0,D=u.length;S<=D;S++){var I=u[S],E=o[S+T];I&&E&&I.index===E.index&&I.fragment.sn===E.fragment.sn?R(I,E):T--}}function p(u,o,R){for(var T=o.skippedSegments,S=Math.max(u.startSN,o.startSN)-o.startSN,D=(u.fragmentHint?1:0)+(T?o.endSN:Math.min(u.endSN,o.endSN))-o.startSN,I=o.startSN-u.startSN,E=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,x=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,g=S;g<=D;g++){var h=x[I+g],O=E[g];T&&!O&&g<T&&(O=o.fragments[g]=h),h&&O&&R(h,O)}}function a(u,o){var R=o.startSN+o.skippedSegments-u.startSN,T=u.fragments;if(R<0||R>=T.length)return;c(o,T[R].start)}function c(u,o){if(o){for(var R=u.fragments,T=u.skippedSegments;T<R.length;T++)R[T].start+=o;u.fragmentHint&&(u.fragmentHint.start+=o)}}function s(u,o){var R=1e3*u.levelTargetDuration,T=R/2,S=u.age,D=S>0&&S<R*3,I=o.loading.end-o.loading.start,E,x=u.availabilityDelay;if(u.updated===!1)if(D){var g=333*u.misses;E=Math.max(Math.min(T,I*2),g),u.availabilityDelay=(u.availabilityDelay||0)+E}else E=T;else D?(x=Math.min(x||R/2,S),u.availabilityDelay=x,E=x+R-S):E=R-I;return Math.round(E)}function i(u,o,R){if(!u||!u.details)return null;var T=u.details,S=T.fragments[o-T.startSN];return S||(S=T.fragmentHint,S&&S.sn===o?S:o<T.startSN&&R&&R.sn===o?R:null)}function t(u,o,R){if(!u||!u.details)return null;var T=u.details.partList;if(T)for(var S=T.length;S--;){var D=T[S];if(D.index===R&&D.fragment.sn===o)return D}return null}},"./src/controller/stream-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return T});var Z=U("./src/polyfills/number.ts"),G=U("./src/controller/base-stream-controller.ts"),M=U("./src/is-supported.ts"),Y=U("./src/events.ts"),X=U("./src/utils/buffer-helper.ts"),r=U("./src/controller/fragment-tracker.ts"),A=U("./src/types/loader.ts"),m=U("./src/loader/fragment.ts"),f=U("./src/demux/transmuxer-interface.ts"),p=U("./src/types/transmuxer.ts"),a=U("./src/controller/gap-controller.ts"),c=U("./src/errors.ts"),s=U("./src/utils/logger.ts");function i(S,D){for(var I=0;I<D.length;I++){var E=D[I];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}function t(S,D,I){return D&&i(S.prototype,D),I&&i(S,I),S}function u(S,D){S.prototype=Object.create(D.prototype),S.prototype.constructor=S,o(S,D)}function o(S,D){return o=Object.setPrototypeOf||function(E,x){return E.__proto__=x,E},o(S,D)}var R=100,T=function(S){u(D,S);function D(E,x){var g;return g=S.call(this,E,x,"[stream-controller]")||this,g.audioCodecSwap=!1,g.gapController=null,g.level=-1,g._forceStartLoad=!1,g.altAudio=!1,g.audioOnly=!1,g.fragPlaying=null,g.onvplaying=null,g.onvseeked=null,g.fragLastKbps=0,g.stalled=!1,g.couldBacktrack=!1,g.audioCodecSwitch=!1,g.videoBuffer=null,g._registerListeners(),g}var I=D.prototype;return I._registerListeners=function(){var x=this.hls;x.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),x.on(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(Y.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),x.on(Y.Events.ERROR,this.onError,this),x.on(Y.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(Y.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(Y.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(Y.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(Y.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),x.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this)},I._unregisterListeners=function(){var x=this.hls;x.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.off(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(Y.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),x.off(Y.Events.ERROR,this.onError,this),x.off(Y.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(Y.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(Y.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(Y.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(Y.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),x.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this)},I.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},I.startLoad=function(x){if(this.levels){var g=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var O=h.startLevel;O===-1&&(h.config.testBandwidth?(O=0,this.bitrateTest=!0):O=h.nextAutoLevel),this.level=h.nextLoadLevel=O,this.loadedmetadata=!1}g>0&&x===-1&&(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),x=g),this.state=G.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()}else this._forceStartLoad=!0,this.state=G.State.STOPPED},I.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},I.doTick=function(){switch(this.state){case G.State.IDLE:this.doTickIdle();break;case G.State.WAITING_LEVEL:{var x,g=this.levels,h=this.level,O=g==null||((x=g[h])===null||x===void 0)?void 0:x.details;if(O&&(!O.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(O))break;this.state=G.State.IDLE;break}break}case G.State.FRAG_LOADING_WAITING_RETRY:{var w,b=self.performance.now(),W=this.retryDate;(!W||b>=W||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=G.State.IDLE)}break;default:break}this.onTickEnd()},I.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},I.doTickIdle=function(){var x,g,h=this.hls,O=this.levelLastLoaded,w=this.levels,b=this.media,W=h.config,j=h.nextLoadLevel;if(O===null||!b&&(this.startFragRequested||!W.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!w||!w[j])return;var C=w[j];this.level=h.nextLoadLevel=j;var B=C.details;if(!B||this.state===G.State.WAITING_LEVEL||B.live&&this.levelLastLoaded!==j){this.state=G.State.WAITING_LEVEL;return}var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,A.PlaylistLevelType.MAIN);if(k===null)return;var y=k.len,H=this.getMaxBufferLength(C.maxBitrate);if(y>=H)return;if(this._streamEnded(k,B)){var J={};this.altAudio&&(J.type="video"),this.hls.trigger(Y.Events.BUFFER_EOS,J),this.state=G.State.ENDED;return}var se=k.end,fe=this.getNextFragment(se,B);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var ve=fe.sn-B.startSN;ve>1&&(fe=B.fragments[ve-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===r.FragmentState.OK&&this.nextLoadPosition>se){var Se=this.audioOnly&&!this.altAudio?m.ElementaryStreamTypes.AUDIO:m.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,Se,A.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,B)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((x=fe.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((g=fe.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(fe,B):this.loadFragment(fe,B,se)},I.loadFragment=function(x,g,h){var O,w=this.fragmentTracker.getState(x);if(this.fragCurrent=x,w===r.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(x);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else w=r.FragmentState.NOT_LOADED}w===r.FragmentState.NOT_LOADED||w===r.FragmentState.PARTIAL?x.sn==="initSegment"?this._loadInitSegment(x):this.bitrateTest?(x.bitrateTest=!0,this.log("Fragment "+x.sn+" of level "+x.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(x)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,x,g,h)):w===r.FragmentState.APPENDING?this.reduceMaxBufferLength(x.duration)&&this.fragmentTracker.removeFragment(x):((O=this.media)===null||O===void 0?void 0:O.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},I.getAppendedFrag=function(x){var g=this.fragmentTracker.getAppendedFrag(x,A.PlaylistLevelType.MAIN);return g&&"fragment"in g?g.fragment:g},I.getBufferedFrag=function(x){return this.fragmentTracker.getBufferedFrag(x,A.PlaylistLevelType.MAIN)},I.followingBufferedFrag=function(x){return x?this.getBufferedFrag(x.end+.5):null},I.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},I.nextLevelSwitch=function(){var x=this.levels,g=this.media;if(g!=null&&g.readyState){var h,O=this.getAppendedFrag(g.currentTime);if(O&&O.start>1&&this.flushMainBuffer(0,O.start-1),!g.paused&&x){var w=this.hls.nextLoadLevel,b=x[w],W=this.fragLastKbps;W&&this.fragCurrent?h=this.fragCurrent.duration*b.maxBitrate/(1e3*W)+1:h=0}else h=0;var j=this.getBufferedFrag(g.currentTime+h);if(j){var C=this.followingBufferedFrag(j);if(C){this.abortCurrentFrag();var B=C.maxStartPTS?C.maxStartPTS:C.start,k=C.duration,y=Math.max(j.end,B+Math.min(Math.max(k-this.config.maxFragLookUpTolerance,k*.5),k*.75));this.flushMainBuffer(y,Number.POSITIVE_INFINITY)}}}},I.abortCurrentFrag=function(){var x=this.fragCurrent;this.fragCurrent=null,x!=null&&x.loader&&x.loader.abort(),this.state===G.State.KEY_LOADING&&(this.state=G.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},I.flushMainBuffer=function(x,g){S.prototype.flushMainBuffer.call(this,x,g,this.altAudio?"video":null)},I.onMediaAttached=function(x,g){S.prototype.onMediaAttached.call(this,x,g);var h=g.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),h.addEventListener("playing",this.onvplaying),h.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,h,this.fragmentTracker,this.hls)},I.onMediaDetaching=function(){var x=this.media;x&&(x.removeEventListener("playing",this.onvplaying),x.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},I.onMediaPlaying=function(){this.tick()},I.onMediaSeeked=function(){var x=this.media,g=x?x.currentTime:null;Object(Z.isFiniteNumber)(g)&&this.log("Media seeked to "+g.toFixed(3)),this.tick()},I.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(Y.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},I.onManifestParsed=function(x,g){var h=!1,O=!1,w;g.levels.forEach(function(b){w=b.audioCodec,w&&(w.indexOf("mp4a.40.2")!==-1&&(h=!0),w.indexOf("mp4a.40.5")!==-1&&(O=!0))}),this.audioCodecSwitch=h&&O&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=g.levels,this.startFragRequested=!1},I.onLevelLoading=function(x,g){var h=this.levels;if(!h||this.state!==G.State.IDLE)return;var O=h[g.level];(!O.details||O.details.live&&this.levelLastLoaded!==g.level||this.waitForCdnTuneIn(O.details))&&(this.state=G.State.WAITING_LEVEL)},I.onLevelLoaded=function(x,g){var h,O=this.levels,w=g.level,b=g.details,W=b.totalduration;if(!O){this.warn("Levels were reset while loading level "+w);return}this.log("Level "+w+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+W);var j=this.fragCurrent;j&&(this.state===G.State.FRAG_LOADING||this.state===G.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==g.level&&j.loader&&(this.state=G.State.IDLE,j.loader.abort()));var C=O[w],B=0;if(b.live||(h=C.details)!==null&&h!==void 0&&h.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;B=this.alignPlaylists(b,C.details)}if(C.details=b,this.levelLastLoaded=w,this.hls.trigger(Y.Events.LEVEL_UPDATED,{details:b,level:w}),this.state===G.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=G.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,B),this.tick()},I._handleFragmentLoadProgress=function(x){var g,h=x.frag,O=x.part,w=x.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var W=b[h.level],j=W.details;if(!j){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var C=W.videoCodec,B=j.PTSKnown||!j.live,k=(g=h.initSegment)===null||g===void 0?void 0:g.data,y=this._getAudioCodec(W),H=this.transmuxer=this.transmuxer||new f.default(this.hls,A.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=O?O.index:-1,se=J!==-1,fe=new p.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,w.byteLength,J,se),ve=this.initPTS[h.cc];H.push(w,k,y,C,h,O,j.totalduration,B,fe,ve)},I.onAudioTrackSwitching=function(x,g){var h=this.altAudio,O=!!g.url,w=g.id;if(!O){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var W=this.hls;h&&W.trigger(Y.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),W.trigger(Y.Events.AUDIO_TRACK_SWITCHED,{id:w})}},I.onAudioTrackSwitched=function(x,g){var h=g.id,O=!!this.hls.audioTracks[h].url;if(O){var w=this.videoBuffer;w&&this.mediaBuffer!==w&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=w)}this.altAudio=O,this.tick()},I.onBufferCreated=function(x,g){var h=g.tracks,O,w,b=!1;for(var W in h){var j=h[W];if(j.id==="main"){if(w=W,O=j,W==="video"){var C=h[W];C&&(this.videoBuffer=C.buffer)}}else b=!0}b&&O?(this.log("Alternate track found, use "+w+".buffered to schedule main fragment loading"),this.mediaBuffer=O.buffer):this.mediaBuffer=this.media},I.onFragBuffered=function(x,g){var h=g.frag,O=g.part;if(h&&h.type!==A.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(O?" p: "+O.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===G.State.PARSED&&(this.state=G.State.IDLE);return}var w=O?O.stats:h.stats;this.fragLastKbps=Math.round(8*w.total/(w.buffering.end-w.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,O)},I.onError=function(x,g){switch(g.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.MAIN,g);break;case c.ErrorDetails.LEVEL_LOAD_ERROR:case c.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==G.State.ERROR&&(g.fatal?(this.warn(""+g.details),this.state=G.State.ERROR):!g.levelRetry&&this.state===G.State.WAITING_LEVEL&&(this.state=G.State.IDLE));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="main"&&(this.state===G.State.PARSING||this.state===G.State.PARSED)){var h=!0,O=this.getFwdBufferInfo(this.media,A.PlaylistLevelType.MAIN);O&&O.len>.5&&(h=!this.reduceMaxBufferLength(O.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},I.checkBuffer=function(){var x=this.media,g=this.gapController;if(!x||!g||!x.readyState)return;var h=X.BufferHelper.getBuffered(x);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):g.poll(this.lastCurrentTime),this.lastCurrentTime=x.currentTime},I.onFragLoadEmergencyAborted=function(){this.state=G.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},I.onBufferFlushed=function(x,g){var h=g.type;if(h!==m.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var O=(h===m.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(O,h,A.PlaylistLevelType.MAIN)}},I.onLevelsUpdated=function(x,g){this.levels=g.levels},I.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},I.seekToStartPos=function(){var x=this.media,g=x.currentTime,h=this.startPosition;if(h>=0&&g<h){if(x.seeking){s.logger.log("could not seek to "+h+", already seeking at "+g);return}var O=X.BufferHelper.getBuffered(x),w=O.length?O.start(0):0,b=w-h;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(s.logger.log("adjusting start position by "+b+" to match buffer start"),h+=b,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+g),x.currentTime=h}},I._getAudioCodec=function(x){var g=this.config.defaultAudioCodec||x.audioCodec;return this.audioCodecSwap&&g&&(this.log("Swapping audio codec"),g.indexOf("mp4a.40.5")!==-1?g="mp4a.40.2":g="mp4a.40.5"),g},I._loadBitrateTestFrag=function(x){var g=this;this._doFragLoad(x).then(function(h){var O=g.hls;if(!h||O.nextLoadLevel||g.fragContextChanged(x))return;g.fragLoadError=0,g.state=G.State.IDLE,g.startFragRequested=!1,g.bitrateTest=!1;var w=x.stats;w.parsing.start=w.parsing.end=w.buffering.start=w.buffering.end=self.performance.now(),O.trigger(Y.Events.FRAG_LOADED,h)})},I._handleTransmuxComplete=function(x){var g,h="main",O=this.hls,w=x.remuxResult,b=x.chunkMeta,W=this.getCurrentContext(b);if(!W){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var j=W.frag,C=W.part,B=W.level,k=w.video,y=w.text,H=w.id3,J=w.initSegment,se=this.altAudio?void 0:w.audio;if(this.fragContextChanged(j))return;if(this.state=G.State.PARSING,J){J.tracks&&(this._bufferInitSegment(B,J.tracks,j,b),O.trigger(Y.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:h,tracks:J.tracks}));var fe=J.initPTS,ve=J.timescale;Object(Z.isFiniteNumber)(fe)&&(this.initPTS[j.cc]=fe,O.trigger(Y.Events.INIT_PTS_FOUND,{frag:j,id:h,initPTS:fe,timescale:ve}))}if(k&&w.independent!==!1){if(B.details){var Se=k.startPTS,Ue=k.endPTS,Te=k.startDTS,Ie=k.endDTS;if(C)C.elementaryStreams[k.type]={startPTS:Se,endPTS:Ue,startDTS:Te,endDTS:Ie};else if(k.firstKeyFrame&&k.independent&&(this.couldBacktrack=!0),k.dropped&&k.independent){var be=this.getLoadPosition()+this.config.maxBufferHole;if(be<Se){this.backtrack(j);return}j.setElementaryStreamInfo(k.type,j.start,Ue,j.start,Ie,!0)}j.setElementaryStreamInfo(k.type,Se,Ue,Te,Ie),this.bufferFragmentData(k,j,C,b)}}else if(w.independent===!1){this.backtrack(j);return}if(se){var q=se.startPTS,_=se.endPTS,L=se.startDTS,z=se.endDTS;C&&(C.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:q,endPTS:_,startDTS:L,endDTS:z}),j.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,q,_,L,z),this.bufferFragmentData(se,j,C,b)}if(H!=null&&(g=H.samples)!==null&&g!==void 0&&g.length){var ee={frag:j,id:h,samples:H.samples};O.trigger(Y.Events.FRAG_PARSING_METADATA,ee)}if(y){var $={frag:j,id:h,samples:y.samples};O.trigger(Y.Events.FRAG_PARSING_USERDATA,$)}},I._bufferInitSegment=function(x,g,h,O){var w=this;if(this.state!==G.State.PARSING)return;this.audioOnly=!!g.audio&&!g.video,this.altAudio&&!this.audioOnly&&delete g.audio;var b=g.audio,W=g.video,j=g.audiovideo;if(b){var C=x.audioCodec,B=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(C&&(C.indexOf("mp4a.40.5")!==-1?C="mp4a.40.2":C="mp4a.40.5"),b.metadata.channelCount!==1&&B.indexOf("firefox")===-1&&(C="mp4a.40.5")),B.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(C="mp4a.40.2",this.log("Android: force audio codec to "+C)),x.audioCodec&&x.audioCodec!==C&&this.log('Swapping manifest audio codec "'+x.audioCodec+'" for "'+C+'"'),b.levelCodec=C,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(C||"")+"/"+(x.audioCodec||"")+"/"+b.codec+"]")}W&&(W.levelCodec=x.videoCodec,W.id="main",this.log("Init video buffer, container:"+W.container+", codecs[level/parsed]=["+(x.videoCodec||"")+"/"+W.codec+"]")),j&&this.log("Init audiovideo buffer, container:"+j.container+", codecs[level/parsed]=["+(x.attrs.CODECS||"")+"/"+j.codec+"]"),this.hls.trigger(Y.Events.BUFFER_CODECS,g),Object.keys(g).forEach(function(k){var y=g[k],H=y.initSegment;H!=null&&H.byteLength&&w.hls.trigger(Y.Events.BUFFER_APPENDING,{type:k,data:H,frag:h,part:null,chunkMeta:O,parent:h.type})}),this.tick()},I.backtrack=function(x){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(x);var g=this.fragmentTracker.backtrack(x);this.fragPrevious=null,this.nextLoadPosition=x.start,g?this.resetFragmentLoading(x):this.state=G.State.BACKTRACKING},I.checkFragmentChanged=function(){var x=this.media,g=null;if(x&&x.readyState>1&&x.seeking===!1){var h=x.currentTime;if(X.BufferHelper.isBuffered(x,h)?g=this.getAppendedFrag(h):X.BufferHelper.isBuffered(x,h+.1)&&(g=this.getAppendedFrag(h+.1)),g){var O=this.fragPlaying,w=g.level;(!O||g.sn!==O.sn||O.level!==w||g.urlId!==O.urlId)&&(this.hls.trigger(Y.Events.FRAG_CHANGED,{frag:g}),(!O||O.level!==w)&&this.hls.trigger(Y.Events.LEVEL_SWITCHED,{level:w}),this.fragPlaying=g)}}},t(D,[{key:"nextLevel",get:function(){var x=this.nextBufferedFrag;return x?x.level:-1}},{key:"currentLevel",get:function(){var x=this.media;if(x){var g=this.getAppendedFrag(x.currentTime);if(g)return g.level}return-1}},{key:"nextBufferedFrag",get:function(){var x=this.media;if(x){var g=this.getAppendedFrag(x.currentTime);return this.followingBufferedFrag(g)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(G.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"SubtitleStreamController",function(){return u});var Z=U("./src/events.ts"),G=U("./src/utils/logger.ts"),M=U("./src/utils/buffer-helper.ts"),Y=U("./src/controller/fragment-finders.ts"),X=U("./src/utils/discontinuities.ts"),r=U("./src/controller/level-helper.ts"),A=U("./src/controller/fragment-tracker.ts"),m=U("./src/controller/base-stream-controller.ts"),f=U("./src/types/loader.ts"),p=U("./src/types/level.ts");function a(o,R){for(var T=0;T<R.length;T++){var S=R[T];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(o,S.key,S)}}function c(o,R,T){return R&&a(o.prototype,R),T&&a(o,T),o}function s(o,R){o.prototype=Object.create(R.prototype),o.prototype.constructor=o,i(o,R)}function i(o,R){return i=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},i(o,R)}var t=500,u=function(o){s(R,o);function R(S,D){var I;return I=o.call(this,S,D,"[subtitle-stream-controller]")||this,I.levels=[],I.currentTrackId=-1,I.tracksBuffered=[],I.mainDetails=null,I._registerListeners(),I}var T=R.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var D=this.hls;D.on(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(Z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(Z.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(Z.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(Z.Events.ERROR,this.onError,this),D.on(Z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(Z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(Z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(Z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(Z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var D=this.hls;D.off(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(Z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(Z.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(Z.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(Z.Events.ERROR,this.onError,this),D.off(Z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(Z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(Z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(Z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(Z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.startLoad=function(){this.stopLoad(),this.state=m.State.IDLE,this.setInterval(t),this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(D,I){this.mainDetails=I.details},T.onSubtitleFragProcessed=function(D,I){var E=I.frag,x=I.success;if(this.fragPrevious=E,this.state=m.State.IDLE,!x)return;var g=this.tracksBuffered[this.currentTrackId];if(!g)return;for(var h,O=E.start,w=0;w<g.length;w++)if(O>=g[w].start&&O<=g[w].end){h=g[w];break}var b=E.start+E.duration;h?h.end=b:(h={start:O,end:b},g.push(h)),this.fragmentTracker.fragBuffered(E)},T.onBufferFlushing=function(D,I){var E=I.startOffset,x=I.endOffset;if(E===0&&x!==Number.POSITIVE_INFINITY){var g=this.currentTrackId,h=this.levels;if(!h.length||!h[g]||!h[g].details)return;var O=h[g].details,w=O.targetduration,b=x-w;if(b<=0)return;I.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(W){for(var j=0;j<W.length;){if(W[j].end<=b){W.shift();continue}else if(W[j].start<b)W[j].start=b;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(E,b,f.PlaylistLevelType.SUBTITLE)}},T.onError=function(D,I){var E,x=I.frag;if(!x||x.type!==f.PlaylistLevelType.SUBTITLE)return;(E=this.fragCurrent)!==null&&E!==void 0&&E.loader&&this.fragCurrent.loader.abort(),this.state=m.State.IDLE},T.onSubtitleTracksUpdated=function(D,I){var E=this,x=I.subtitleTracks;this.tracksBuffered=[],this.levels=x.map(function(g){return new p.Level(g)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(g){E.tracksBuffered[g.id]=[]}),this.mediaBuffer=null},T.onSubtitleTrackSwitch=function(D,I){if(this.currentTrackId=I.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var E=this.levels[this.currentTrackId];E!=null&&E.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,E&&this.setInterval(t)},T.onSubtitleTrackLoaded=function(D,I){var E,x=I.details,g=I.id,h=this.currentTrackId,O=this.levels;if(!O.length)return;var w=O[h];if(g>=O.length||g!==h||!w)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,x.live||(E=w.details)!==null&&E!==void 0&&E.live){var b=this.mainDetails;if(x.deltaUpdateFailed||!b)return;var W=b.fragments[0];if(!w.details)x.hasProgramDateTime&&b.hasProgramDateTime?Object(X.alignMediaPlaylistByPDT)(x,b):W&&Object(r.addSliding)(x,W.start);else{var j=this.alignPlaylists(x,w.details);j===0&&W&&Object(r.addSliding)(x,W.start)}}if(w.details=x,this.levelLastLoaded=g,this.tick(),x.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var C=Object(Y.findFragmentByPTS)(null,x.fragments,this.media.currentTime,0);C||(this.warn("Subtitle playlist not aligned with playback"),w.details=void 0)}},T._handleFragmentLoadComplete=function(D){var I=D.frag,E=D.payload,x=I.decryptdata,g=this.hls;if(this.fragContextChanged(I))return;if(E&&E.byteLength>0&&x&&x.key&&x.iv&&x.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(E),x.key.buffer,x.iv.buffer).then(function(O){var w=performance.now();g.trigger(Z.Events.FRAG_DECRYPTED,{frag:I,payload:O,stats:{tstart:h,tdecrypt:w}})})}},T.doTick=function(){if(!this.media){this.state=m.State.IDLE;return}if(this.state===m.State.IDLE){var D,I=this.currentTrackId,E=this.levels;if(!E.length||!E[I]||!E[I].details)return;var x=E[I].details,g=x.targetduration,h=this.config,O=this.media,w=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,O.currentTime-g,h.maxBufferHole),b=w.end,W=w.len,j=this.getMaxBufferLength()+g;if(W>j)return;console.assert(x,"Subtitle track details are defined on idle subtitle stream controller tick");var C=x.fragments,B=C.length,k=x.edge,y,H=this.fragPrevious;if(b<k){var J=h.maxFragLookUpTolerance;H&&x.hasProgramDateTime&&(y=Object(Y.findFragmentByPDT)(C,H.endProgramDateTime,J)),y||(y=Object(Y.findFragmentByPTS)(H,C,b,J),!y&&H&&H.start<C[0].start&&(y=C[0]))}else y=C[B-1];(D=y)!==null&&D!==void 0&&D.encrypted?(G.logger.log("Loading key for "+y.sn),this.state=m.State.KEY_LOADING,this.hls.trigger(Z.Events.KEY_LOADING,{frag:y})):y&&this.fragmentTracker.getState(y)===A.FragmentState.NOT_LOADED&&this.loadFragment(y,x,b)}},T.loadFragment=function(D,I,E){this.fragCurrent=D,o.prototype.loadFragment.call(this,D,I,E)},c(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(m.default)},"./src/controller/subtitle-track-controller.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/events.ts"),G=U("./src/utils/texttrack-utils.ts"),M=U("./src/controller/base-playlist-controller.ts"),Y=U("./src/types/loader.ts");function X(a,c){for(var s=0;s<c.length;s++){var i=c[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function r(a,c,s){return c&&X(a.prototype,c),s&&X(a,s),a}function A(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,m(a,c)}function m(a,c){return m=Object.setPrototypeOf||function(i,t){return i.__proto__=t,i},m(a,c)}var f=function(a){A(c,a);function c(i){var t;return t=a.call(this,i,"[subtitle-track-controller]")||this,t.media=null,t.tracks=[],t.groupId=null,t.tracksInGroup=[],t.trackId=-1,t.selectDefaultTrack=!0,t.queuedDefaultTrack=-1,t.trackChangeListener=function(){return t.onTextTracksChanged()},t.asyncPollTrackChange=function(){return t.pollTrackChange(0)},t.useTextTrackPolling=!1,t.subtitlePollingInterval=-1,t.subtitleDisplay=!0,t.registerListeners(),t}var s=c.prototype;return s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},s.registerListeners=function(){var t=this.hls;t.on(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Z.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Z.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(Z.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(Z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(Z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(Z.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var t=this.hls;t.off(Z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Z.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Z.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(Z.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(Z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(Z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(Z.Events.ERROR,this.onError,this)},s.onMediaAttached=function(t,u){if(this.media=u.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},s.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},s.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var t=p(this.media.textTracks);t.forEach(function(u){Object(G.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},s.onManifestParsed=function(t,u){this.tracks=u.subtitleTracks},s.onSubtitleTrackLoaded=function(t,u){var o=u.id,R=u.details,T=this.trackId,S=this.tracksInGroup[T];if(!S){this.warn("Invalid subtitle track id "+o);return}var D=S.details;S.details=u.details,this.log("subtitle track "+o+" loaded ["+R.startSN+"-"+R.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,u,D))},s.onLevelLoading=function(t,u){this.switchLevel(u.level)},s.onLevelSwitching=function(t,u){this.switchLevel(u.level)},s.switchLevel=function(t){var u=this.hls.levels[t];if(!(u!=null&&u.textGroupIds))return;var o=u.textGroupIds[u.urlId];if(this.groupId!==o){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,T=this.tracks.filter(function(I){return!o||I.groupId===o});this.tracksInGroup=T;var S=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=o;var D={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(Z.Events.SUBTITLE_TRACKS_UPDATED,D),S!==-1&&this.setSubtitleTrack(S,R)}},s.findTrackId=function(t){for(var u=this.tracksInGroup,o=0;o<u.length;o++){var R=u[o];if((!this.selectDefaultTrack||R.default)&&(!t||t===R.name))return R.id}return-1},s.onError=function(t,u){if(a.prototype.onError.call(this,t,u),u.fatal||!u.context)return;u.context.type===Y.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},s.loadPlaylist=function(t){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var o=u.id,R=u.groupId,T=u.url;if(t)try{T=t.addDirectives(T)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+o),this.hls.trigger(Z.Events.SUBTITLE_TRACK_LOADING,{url:T,id:o,groupId:R,deliveryDirectives:t||null})}},s.toggleTrackModes=function(t){var u=this,o=this.media,R=this.subtitleDisplay,T=this.trackId;if(!o)return;var S=p(o.textTracks),D=S.filter(function(x){return x.groupId===u.groupId});if(t===-1)[].slice.call(S).forEach(function(x){x.mode="disabled"});else{var I=D[T];I&&(I.mode="disabled")}var E=D[t];E&&(E.mode=R?"showing":"hidden")},s.setSubtitleTrack=function(t,u){var o,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(o=R[t])!==null&&o!==void 0&&o.details)||t<-1||t>=R.length)return;this.clearTimer();var T=R[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,T){var S=T.id,D=T.groupId,I=D===void 0?"":D,E=T.name,x=T.type,g=T.url;this.hls.trigger(Z.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:I,name:E,type:x,url:g});var h=this.switchParams(T.url,u==null?void 0:u.details);this.loadPlaylist(h)}else this.hls.trigger(Z.Events.SUBTITLE_TRACK_SWITCH,{id:t})},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,u=p(this.media.textTracks),o=0;o<u.length;o++)if(u[o].mode==="hidden")t=o;else if(u[o].mode==="showing"){t=o;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)},r(c,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,u)}}]),c}(M.default);function p(a){for(var c=[],s=0;s<a.length;s++){var i=a[s];i.kind==="subtitles"&&i.label&&c.push(a[s])}return c}Q.default=f},"./src/controller/timeline-controller.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"TimelineController",function(){return p});var Z=U("./src/polyfills/number.ts"),G=U("./src/events.ts"),M=U("./src/utils/cea-608-parser.ts"),Y=U("./src/utils/output-filter.ts"),X=U("./src/utils/webvtt-parser.ts"),r=U("./src/utils/texttrack-utils.ts"),A=U("./src/utils/imsc1-ttml-parser.ts"),m=U("./src/types/loader.ts"),f=U("./src/utils/logger.ts"),p=function(){function i(u){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var o=new Y.default(this,"textTrack1"),R=new Y.default(this,"textTrack2"),T=new Y.default(this,"textTrack3"),S=new Y.default(this,"textTrack4");this.cea608Parser1=new M.default(1,o,R),this.cea608Parser2=new M.default(3,T,S)}u.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(G.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(G.Events.FRAG_LOADING,this.onFragLoading,this),u.on(G.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(G.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(G.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(G.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(G.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=i.prototype;return t.destroy=function(){var o=this.hls;o.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(G.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.off(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.off(G.Events.FRAG_LOADING,this.onFragLoading,this),o.off(G.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(G.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.off(G.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.off(G.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(G.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(o,R,T,S,D){for(var I=!1,E=D.length;E--;){var x=D[E],g=c(x[0],x[1],R,T);if(g>=0&&(x[0]=Math.min(x[0],R),x[1]=Math.max(x[1],T),I=!0,g/(T-R)>.5))return}if(I||D.push([R,T]),this.config.renderTextTracksNatively){var h=this.captionsTracks[o];this.Cues.newCue(h,R,T,S)}else{var O=this.Cues.newCue(null,R,T,S);this.hls.trigger(G.Events.CUES_PARSED,{type:"captions",cues:O,track:o})}},t.onInitPtsFound=function(o,R){var T=this,S=R.frag,D=R.id,I=R.initPTS,E=R.timescale,x=this.unparsedVttFrags;D==="main"&&(this.initPTS[S.cc]=I,this.timescale[S.cc]=E),x.length&&(this.unparsedVttFrags=[],x.forEach(function(g){T.onFragLoaded(G.Events.FRAG_LOADED,g)}))},t.getExistingTrack=function(o){var R=this.media;if(R)for(var T=0;T<R.textTracks.length;T++){var S=R.textTracks[T];if(S[o])return S}return null},t.createCaptionsTrack=function(o){this.config.renderTextTracksNatively?this.createNativeTrack(o):this.createNonNativeTrack(o)},t.createNativeTrack=function(o){if(this.captionsTracks[o])return;var R=this.captionsProperties,T=this.captionsTracks,S=this.media,D=R[o],I=D.label,E=D.languageCode,x=this.getExistingTrack(o);if(x)T[o]=x,Object(r.clearCurrentCues)(T[o]),Object(r.sendAddTrackEvent)(T[o],S);else{var g=this.createTextTrack("captions",I,E);g&&(g[o]=!0,T[o]=g)}},t.createNonNativeTrack=function(o){if(this.nonNativeCaptionsTracks[o])return;var R=this.captionsProperties[o];if(!R)return;var T=R.label,S={_id:o,label:T,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[o]=S,this.hls.trigger(G.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},t.createTextTrack=function(o,R,T){var S=this.media;return S?S.addTextTrack(o,R,T):void 0},t.onMediaAttaching=function(o,R){this.media=R.media,this._cleanTracks()},t.onMediaDetaching=function(){var o=this.captionsTracks;Object.keys(o).forEach(function(R){Object(r.clearCurrentCues)(o[R]),delete o[R]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},t._cleanTracks=function(){var o=this.media;if(!o)return;var R=o.textTracks;if(R)for(var T=0;T<R.length;T++)Object(r.clearCurrentCues)(R[T])},t.onSubtitleTracksUpdated=function(o,R){var T=this;this.textTracks=[];var S=R.subtitleTracks||[],D=S.some(function(g){return g.textCodec===A.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var I=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var E=this.media?this.media.textTracks:[];this.tracks.forEach(function(g,h){var O;if(h<E.length){for(var w=null,b=0;b<E.length;b++)if(a(E[b],g)){w=E[b];break}w&&(O=w)}O?Object(r.clearCurrentCues)(O):(O=T.createTextTrack("subtitles",g.name,g.lang),O&&(O.mode="disabled")),O&&(O.groupId=g.groupId,T.textTracks.push(O))})}else if(!I&&this.tracks&&this.tracks.length){var x=this.tracks.map(function(g){return{label:g.name,kind:g.type.toLowerCase(),default:g.default,subtitleTrack:g}});this.hls.trigger(G.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:x})}}},t.onManifestLoaded=function(o,R){var T=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(S){var D=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!D)return;var I="textTrack"+D[1],E=T.captionsProperties[I];if(!E)return;E.label=S.name,S.lang&&(E.languageCode=S.lang),E.media=S})},t.onFragLoading=function(o,R){var T=this.cea608Parser1,S=this.cea608Parser2,D=this.lastSn,I=this.lastPartIndex;if(!this.enabled||!(T&&S))return;if(R.frag.type===m.PlaylistLevelType.MAIN){var E,x,g=R.frag.sn,h=(E=R==null||((x=R.part)===null||x===void 0)?void 0:x.index)!=null?E:-1;g===D+1||g===D&&h===I+1||(T.reset(),S.reset()),this.lastSn=g,this.lastPartIndex=h}},t.onFragLoaded=function(o,R){var T=R.frag,S=R.payload,D=this.initPTS,I=this.unparsedVttFrags;if(T.type===m.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(Z.isFiniteNumber)(D[T.cc])){I.push(R),D.length&&this.hls.trigger(G.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var E=T.decryptdata;if(E==null||E.key==null||E.method!=="AES-128"){var x=this.tracks[T.level],g=this.vttCCs;g[T.cc]||(g[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),x&&x.textCodec===A.IMSC1_CODEC?this._parseIMSC1(T,S):this._parseVTTs(T,S,g)}}else this.hls.trigger(G.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(o,R){var T=this,S=this.hls;Object(A.parseIMSC1)(R,this.initPTS[o.cc],this.timescale[o.cc],function(D){T._appendCues(D,o.level),S.trigger(G.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(D){f.logger.log("Failed to parse IMSC1: "+D),S.trigger(G.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:D})})},t._parseVTTs=function(o,R,T){var S=this,D=this.hls;Object(X.parseWebVTT)(R,this.initPTS[o.cc],this.timescale[o.cc],T,o.cc,o.start,function(I){S._appendCues(I,o.level),D.trigger(G.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(I){S._fallbackToIMSC1(o,R),f.logger.log("Failed to parse VTT cue: "+I),D.trigger(G.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:I})})},t._fallbackToIMSC1=function(o,R){var T=this,S=this.tracks[o.level];S.textCodec||Object(A.parseIMSC1)(R,this.initPTS[o.cc],this.timescale[o.cc],function(){S.textCodec=A.IMSC1_CODEC,T._parseIMSC1(o,R)},function(){S.textCodec="wvtt"})},t._appendCues=function(o,R){var T=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[R];if(S.mode==="disabled")return;o.forEach(function(E){return Object(r.addCueToTrack)(S,E)})}else{var D=this.tracks[R],I=D.default?"default":"subtitles"+R;T.trigger(G.Events.CUES_PARSED,{type:"subtitles",cues:o,track:I})}},t.onFragDecrypted=function(o,R){var T=R.frag;if(T.type===m.PlaylistLevelType.SUBTITLE){if(!Object(Z.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(G.Events.FRAG_LOADED,R)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(o,R){var T=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(T&&S))return;for(var D=0;D<R.samples.length;D++){var I=R.samples[D].bytes;if(I){var E=this.extractCea608Data(I);T.addData(R.samples[D].pts,E[0]),S.addData(R.samples[D].pts,E[1])}}},t.onBufferFlushing=function(o,R){var T=R.startOffset,S=R.endOffset,D=R.endOffsetSubtitles,I=R.type,E=this.media;if(!E||E.currentTime<S)return;if(!I||I==="video"){var x=this.captionsTracks;Object.keys(x).forEach(function(h){return Object(r.removeCuesInRange)(x[h],T,S)})}if(this.config.renderTextTracksNatively&&(T===0&&D!==void 0)){var g=this.textTracks;Object.keys(g).forEach(function(h){return Object(r.removeCuesInRange)(g[h],T,D)})}},t.extractCea608Data=function(o){for(var R=o[0]&31,T=2,S=[[],[]],D=0;D<R;D++){var I=o[T++],E=127&o[T++],x=127&o[T++],g=(4&I)!==0,h=3&I;if(E===0&&x===0)continue;g&&((h===0||h===1)&&(S[h].push(E),S[h].push(x)))}return S},i}();function a(i,t){return i&&i.label===t.name&&!(i.textTrack1||i.textTrack2)}function c(i,t,u,o){return Math.min(t,o)-Math.max(i,u)}function s(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return Z});var Z=function(){function G(Y,X){this.subtle=void 0,this.aesIV=void 0,this.subtle=Y,this.aesIV=X}var M=G.prototype;return M.decrypt=function(X,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,X)},G}()},"./src/crypt/aes-decryptor.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"removePadding",function(){return G}),U.d(Q,"default",function(){return M});var Z=U("./src/utils/typed-array.ts");function G(Y){var X=Y.byteLength,r=X&&new DataView(Y.buffer).getUint8(X-1);return r?Object(Z.sliceUint8)(Y,0,X-r):Y}var M=function(){function Y(){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 X=Y.prototype;return X.uint8ArrayToUint32Array_=function(A){for(var m=new DataView(A),f=new Uint32Array(4),p=0;p<4;p++)f[p]=m.getUint32(p*4);return f},X.initTable=function(){var A=this.sBox,m=this.invSBox,f=this.subMix,p=f[0],a=f[1],c=f[2],s=f[3],i=this.invSubMix,t=i[0],u=i[1],o=i[2],R=i[3],T=new Uint32Array(256),S=0,D=0,I=0;for(I=0;I<256;I++)I<128?T[I]=I<<1:T[I]=I<<1^283;for(I=0;I<256;I++){var E=D^D<<1^D<<2^D<<3^D<<4;E=E>>>8^E&255^99,A[S]=E,m[E]=S;var x=T[S],g=T[x],h=T[g],O=T[E]*257^E*16843008;p[S]=O<<24|O>>>8,a[S]=O<<16|O>>>16,c[S]=O<<8|O>>>24,s[S]=O,O=h*16843009^g*65537^x*257^S*16843008,t[E]=O<<24|O>>>8,u[E]=O<<16|O>>>16,o[E]=O<<8|O>>>24,R[E]=O,S?(S=x^T[T[T[h^x]]],D^=T[T[D]]):S=D=1}},X.expandKey=function(A){for(var m=this.uint8ArrayToUint32Array_(A),f=!0,p=0;p<m.length&&f;)f=m[p]===this.key[p],p++;if(f)return;this.key=m;var a=this.keySize=m.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var c=this.ksRows=(a+6+1)*4,s,i,t=this.keySchedule=new Uint32Array(c),u=this.invKeySchedule=new Uint32Array(c),o=this.sBox,R=this.rcon,T=this.invSubMix,S=T[0],D=T[1],I=T[2],E=T[3],x,g;for(s=0;s<c;s++){if(s<a){x=t[s]=m[s];continue}g=x,s%a===0?(g=g<<8|g>>>24,g=o[g>>>24]<<24|o[g>>>16&255]<<16|o[g>>>8&255]<<8|o[g&255],g^=R[s/a|0]<<24):a>6&&s%a===4&&(g=o[g>>>24]<<24|o[g>>>16&255]<<16|o[g>>>8&255]<<8|o[g&255]),t[s]=x=(t[s-a]^g)>>>0}for(i=0;i<c;i++)s=c-i,i&3?g=t[s]:g=t[s-4],i<4||s<=4?u[i]=g:u[i]=S[o[g>>>24]]^D[o[g>>>16&255]]^I[o[g>>>8&255]]^E[o[g&255]],u[i]=u[i]>>>0},X.networkToHostOrderSwap=function(A){return A<<24|(A&65280)<<8|(A&16711680)>>8|A>>>24},X.decrypt=function(A,m,f){for(var p=this.keySize+6,a=this.invKeySchedule,c=this.invSBox,s=this.invSubMix,i=s[0],t=s[1],u=s[2],o=s[3],R=this.uint8ArrayToUint32Array_(f),T=R[0],S=R[1],D=R[2],I=R[3],E=new Int32Array(A),x=new Int32Array(E.length),g,h,O,w,b,W,j,C,B,k,y,H,J,se,fe=this.networkToHostOrderSwap;m<E.length;){for(B=fe(E[m]),k=fe(E[m+1]),y=fe(E[m+2]),H=fe(E[m+3]),b=B^a[0],W=H^a[1],j=y^a[2],C=k^a[3],J=4,se=1;se<p;se++)g=i[b>>>24]^t[W>>16&255]^u[j>>8&255]^o[C&255]^a[J],h=i[W>>>24]^t[j>>16&255]^u[C>>8&255]^o[b&255]^a[J+1],O=i[j>>>24]^t[C>>16&255]^u[b>>8&255]^o[W&255]^a[J+2],w=i[C>>>24]^t[b>>16&255]^u[W>>8&255]^o[j&255]^a[J+3],b=g,W=h,j=O,C=w,J=J+4;g=c[b>>>24]<<24^c[W>>16&255]<<16^c[j>>8&255]<<8^c[C&255]^a[J],h=c[W>>>24]<<24^c[j>>16&255]<<16^c[C>>8&255]<<8^c[b&255]^a[J+1],O=c[j>>>24]<<24^c[C>>16&255]<<16^c[b>>8&255]<<8^c[W&255]^a[J+2],w=c[C>>>24]<<24^c[b>>16&255]<<16^c[W>>8&255]<<8^c[j&255]^a[J+3],x[m]=fe(g^T),x[m+1]=fe(w^S),x[m+2]=fe(O^D),x[m+3]=fe(h^I),T=B,S=k,D=y,I=H,m=m+4}return x.buffer},Y}()},"./src/crypt/decrypter.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return m});var Z=U("./src/crypt/aes-crypto.ts"),G=U("./src/crypt/fast-aes-key.ts"),M=U("./src/crypt/aes-decryptor.ts"),Y=U("./src/utils/logger.ts"),X=U("./src/utils/mp4-tools.ts"),r=U("./src/utils/typed-array.ts"),A=16,m=function(){function f(a,c,s){var i=s===void 0?{}:s,t=i.removePKCS7Padding,u=t===void 0?!0:t;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=a,this.config=c,this.removePKCS7Padding=u,u)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=f.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var c=this.currentResult;if(!c){this.reset();return}var s=new Uint8Array(c);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(s):s},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(c,s,i,t){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(c),s,i);var u=this.flush();u&&t(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(c),s,i).then(t)},p.softwareDecrypt=function(c,s,i){var t=this.currentIV,u=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(c=Object(X.appendUint8Array)(o,c),this.remainderData=null);var R=this.getValidChunk(c);if(!R.length)return null;t&&(i=t);var T=this.softwareDecrypter;T||(T=this.softwareDecrypter=new M.default),T.expandKey(s);var S=u;return this.currentResult=T.decrypt(R.buffer,0,i),this.currentIV=Object(r.sliceUint8)(R,-16).buffer,S||null},p.webCryptoDecrypt=function(c,s,i){var t=this,u=this.subtle;return(this.key!==s||!this.fastAesKey)&&(this.key=s,this.fastAesKey=new G.default(u,s)),this.fastAesKey.expandKey().then(function(o){if(!u)return Promise.reject(new Error("web crypto not initialized"));var R=new Z.default(u,i);return R.decrypt(c.buffer,o)}).catch(function(o){return t.onWebCryptoError(o,c,s,i)})},p.onWebCryptoError=function(c,s,i,t){return Y.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",c),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,i,t)},p.getValidChunk=function(c){var s=c,i=c.length-c.length%A;return i!==c.length&&(s=Object(r.sliceUint8)(c,0,i),this.remainderData=Object(r.sliceUint8)(c,i)),s},p.logOnce=function(c){if(!this.logEnabled)return;Y.logger.log("[decrypter.ts]: "+c),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return Z});var Z=function(){function G(Y,X){this.subtle=void 0,this.key=void 0,this.subtle=Y,this.key=X}var M=G.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},G}()},"./src/demux/aacdemuxer.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/demux/base-audio-demuxer.ts"),G=U("./src/demux/adts.ts"),M=U("./src/utils/logger.ts"),Y=U("./src/demux/id3.ts");function X(m,f){m.prototype=Object.create(f.prototype),m.prototype.constructor=m,r(m,f)}function r(m,f){return r=Object.setPrototypeOf||function(a,c){return a.__proto__=c,a},r(m,f)}var A=function(m){X(f,m);function f(a,c){var s;return s=m.call(this)||this,s.observer=void 0,s.config=void 0,s.observer=a,s.config=c,s}var p=f.prototype;return p.resetInitSegment=function(c,s,i){m.prototype.resetInitSegment.call(this,c,s,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:c,duration:i,inputTimeScale:9e4,dropped:0}},f.probe=function(c){if(!c)return!1;for(var s=Y.getID3Data(c,0)||[],i=s.length,t=c.length;i<t;i++)if(G.probe(c,i))return M.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(c,s){return G.canParse(c,s)},p.appendFrame=function(c,s,i){G.initTrackConfig(c,this.observer,s,i,c.manifestCodec);var t=G.appendFrame(c,s,i,this.initPTS,this.frameIndex);if(t&&t.missing===0)return t},f}(Z.default);A.minProbeByteLength=9,Q.default=A},"./src/demux/adts.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"getAudioConfig",function(){return Y}),U.d(Q,"isHeaderPattern",function(){return X}),U.d(Q,"getHeaderLength",function(){return r}),U.d(Q,"getFullFrameLength",function(){return A}),U.d(Q,"canGetFrameLength",function(){return m}),U.d(Q,"isHeader",function(){return f}),U.d(Q,"canParse",function(){return p}),U.d(Q,"probe",function(){return a}),U.d(Q,"initTrackConfig",function(){return c}),U.d(Q,"getFrameDuration",function(){return s}),U.d(Q,"parseFrameHeader",function(){return i}),U.d(Q,"appendFrame",function(){return t});var Z=U("./src/utils/logger.ts"),G=U("./src/errors.ts"),M=U("./src/events.ts");function Y(u,o,R,T){var S,D,I,E,x=navigator.userAgent.toLowerCase(),g=T,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((o[R+2]&192)>>>6)+1;var O=(o[R+2]&60)>>>2;if(O>h.length-1){u.trigger(M.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+O});return}return I=(o[R+2]&1)<<2,I|=(o[R+3]&192)>>>6,Z.logger.log("manifest codec:"+T+", ADTS type:"+S+", samplingIndex:"+O),/firefox/i.test(x)?O>=6?(S=5,E=new Array(4),D=O-3):(S=2,E=new Array(2),D=O):x.indexOf("android")!==-1?(S=2,E=new Array(2),D=O):(S=5,E=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&O>=6?D=O-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(O>=6&&I===1||/vivaldi/i.test(x))||!T&&I===1)&&(S=2,E=new Array(2)),D=O)),E[0]=S<<3,E[0]|=(O&14)>>1,E[1]|=(O&1)<<7,E[1]|=I<<3,S===5&&(E[1]|=(D&14)>>1,E[2]=(D&1)<<7,E[2]|=2<<2,E[3]=0),{config:E,samplerate:h[O],channelCount:I,codec:"mp4a.40."+S,manifestCodec:g}}function X(u,o){return u[o]===255&&(u[o+1]&246)===240}function r(u,o){return u[o+1]&1?7:9}function A(u,o){return(u[o+3]&3)<<11|u[o+4]<<3|(u[o+5]&224)>>>5}function m(u,o){return o+5<u.length}function f(u,o){return o+1<u.length&&X(u,o)}function p(u,o){return m(u,o)&&X(u,o)&&A(u,o)<=u.length-o}function a(u,o){if(f(u,o)){var R=r(u,o);if(o+R>=u.length)return!1;var T=A(u,o);if(T<=R)return!1;var S=o+T;return S===u.length||f(u,S)}return!1}function c(u,o,R,T,S){if(!u.samplerate){var D=Y(o,R,T,S);if(!D)return;u.config=D.config,u.samplerate=D.samplerate,u.channelCount=D.channelCount,u.codec=D.codec,u.manifestCodec=D.manifestCodec,Z.logger.log("parsed codec:"+u.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function s(u){return 1024*9e4/u}function i(u,o,R,T,S){var D=r(u,o),I=A(u,o);if(I-=D,I>0){var E=R+T*S;return{headerLength:D,frameLength:I,stamp:E}}}function t(u,o,R,T,S){var D=s(u.samplerate),I=i(o,R,T,S,D);if(I){var E=I.frameLength,x=I.headerLength,g=I.stamp,h=x+E,O=Math.max(0,R+h-o.length),w;O?(w=new Uint8Array(h-x),w.set(o.subarray(R+x,o.length),0)):w=o.subarray(R+x,R+h);var b={unit:w,pts:g};return O||u.samples.push(b),{sample:b,length:h,missing:O}}}},"./src/demux/base-audio-demuxer.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"initPTSFn",function(){return A});var Z=U("./src/polyfills/number.ts"),G=U("./src/demux/id3.ts"),M=U("./src/demux/dummy-demuxed-track.ts"),Y=U("./src/utils/mp4-tools.ts"),X=U("./src/utils/typed-array.ts"),r=function(){function m(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=m.prototype;return f.resetInitSegment=function(a,c,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(a,c){return!1},f.appendFrame=function(a,c,s){},f.demux=function(a,c){this.cachedData&&(a=Object(Y.appendUint8Array)(this.cachedData,a),this.cachedData=null);var s=G.getID3Data(a,0),i=s?s.length:0,t,u,o=this._audioTrack,R=this._id3Track,T=s?G.getTimeStamp(s):void 0,S=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=A(T,c)),s&&s.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),u=this.initPTS;i<S;){if(this.canParse(a,i)){var D=this.appendFrame(o,a,i);D?(this.frameIndex++,u=D.sample.pts,i+=D.length,t=i):i=S}else G.canParse(a,i)?(s=G.getID3Data(a,i),R.samples.push({pts:u,dts:u,data:s}),i+=s.length,t=i):i++;if(i===S&&t!==S){var I=Object(X.sliceUint8)(a,t);this.cachedData?this.cachedData=Object(Y.appendUint8Array)(this.cachedData,I):this.cachedData=I}}return{audioTrack:o,avcTrack:Object(M.dummyTrack)(),id3Track:R,textTrack:Object(M.dummyTrack)()}},f.demuxSampleAes=function(a,c,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(a){var c=this.cachedData;return c&&(this.cachedData=null,this.demux(c,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},f.destroy=function(){},m}(),A=function(f,p){return Object(Z.isFiniteNumber)(f)?f*90:p*9e4};Q.default=r},"./src/demux/chunk-cache.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return Z});var Z=function(){function M(){this.chunks=[],this.dataLength=0}var Y=M.prototype;return Y.push=function(r){this.chunks.push(r),this.dataLength+=r.length},Y.flush=function(){var r=this.chunks,A=this.dataLength,m;if(r.length)r.length===1?m=r[0]:m=G(r,A);else return new Uint8Array(0);return this.reset(),m},Y.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function G(M,Y){for(var X=new Uint8Array(Y),r=0,A=0;A<M.length;A++){var m=M[A];X.set(m,r),r+=m.length}return X}},"./src/demux/dummy-demuxed-track.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"dummyTrack",function(){return Z});function Z(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/utils/logger.ts"),G=function(){function M(X){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=X,this.bytesAvailable=X.byteLength,this.word=0,this.bitsAvailable=0}var Y=M.prototype;return Y.loadWord=function(){var r=this.data,A=this.bytesAvailable,m=r.byteLength-A,f=new Uint8Array(4),p=Math.min(4,A);if(p===0)throw new Error("no bytes available");f.set(r.subarray(m,m+p)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},Y.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)},Y.readBits=function(r){var A=Math.min(this.bitsAvailable,r),m=this.word>>>32-A;return r>32&&Z.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?m<<A|this.readBits(A):m},Y.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()},Y.skipUEG=function(){this.skipBits(1+this.skipLZ())},Y.skipEG=function(){this.skipBits(1+this.skipLZ())},Y.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},Y.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},Y.readBoolean=function(){return this.readBits(1)===1},Y.readUByte=function(){return this.readBits(8)},Y.readUShort=function(){return this.readBits(16)},Y.readUInt=function(){return this.readBits(32)},Y.skipScalingList=function(r){for(var A=8,m=8,f,p=0;p<r;p++)m!==0&&(f=this.readEG(),m=(A+f+256)%256),A=m===0?A:m},Y.readSPS=function(){var r=0,A=0,m=0,f=0,p,a,c,s=this.readUByte.bind(this),i=this.readBits.bind(this),t=this.readUEG.bind(this),u=this.readBoolean.bind(this),o=this.skipBits.bind(this),R=this.skipEG.bind(this),T=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);s();var D=s();if(i(5),o(3),s(),T(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var I=t();if(I===3&&o(1),T(),T(),o(1),u())for(a=I!==3?8:12,c=0;c<a;c++)u()&&(c<6?S(16):S(64))}T();var E=t();if(E===0)t();else if(E===1)for(o(1),R(),R(),p=t(),c=0;c<p;c++)R();T(),o(1);var x=t(),g=t(),h=i(1);h===0&&o(1),o(1),u()&&(r=t(),A=t(),m=t(),f=t());var O=[1,1];if(u()&&u()){var w=s();switch(w){case 1:O=[1,1];break;case 2:O=[12,11];break;case 3:O=[10,11];break;case 4:O=[16,11];break;case 5:O=[40,33];break;case 6:O=[24,11];break;case 7:O=[20,11];break;case 8:O=[32,11];break;case 9:O=[80,33];break;case 10:O=[18,11];break;case 11:O=[15,11];break;case 12:O=[64,33];break;case 13:O=[160,99];break;case 14:O=[4,3];break;case 15:O=[3,2];break;case 16:O=[2,1];break;case 255:{O=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((x+1)*16-r*2-A*2),height:(2-h)*(g+1)*16-(h?2:4)*(m+f),pixelRatio:O}},Y.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();Q.default=G},"./src/demux/id3.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"isHeader",function(){return Z}),U.d(Q,"isFooter",function(){return G}),U.d(Q,"getID3Data",function(){return M}),U.d(Q,"canParse",function(){return X}),U.d(Q,"getTimeStamp",function(){return r}),U.d(Q,"isTimeStampFrame",function(){return A}),U.d(Q,"getID3Frames",function(){return f}),U.d(Q,"decodeFrame",function(){return p}),U.d(Q,"utf8ArrayToStr",function(){return t}),U.d(Q,"testables",function(){return u});var Z=function(S,D){return D+10<=S.length&&(S[D]===73&&S[D+1]===68&&S[D+2]===51&&(S[D+3]<255&&S[D+4]<255&&(S[D+6]<128&&S[D+7]<128&&S[D+8]<128&&S[D+9]<128)))},G=function(S,D){return D+10<=S.length&&(S[D]===51&&S[D+1]===68&&S[D+2]===73&&(S[D+3]<255&&S[D+4]<255&&(S[D+6]<128&&S[D+7]<128&&S[D+8]<128&&S[D+9]<128)))},M=function(S,D){for(var I=D,E=0;Z(S,D);){E+=10;var x=Y(S,D+6);E+=x,G(S,D+10)&&(E+=10),D+=E}return E>0?S.subarray(I,I+E):void 0},Y=function(S,D){var I=0;return I=(S[D]&127)<<21,I|=(S[D+1]&127)<<14,I|=(S[D+2]&127)<<7,I|=S[D+3]&127,I},X=function(S,D){return Z(S,D)&&Y(S,D+6)+10<=S.length-D},r=function(S){for(var D=f(S),I=0;I<D.length;I++){var E=D[I];if(A(E))return i(E)}return},A=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},m=function(S){var D=String.fromCharCode(S[0],S[1],S[2],S[3]),I=Y(S,4),E=10;return{type:D,size:I,data:S.subarray(E,E+I)}},f=function(S){for(var D=0,I=[];Z(S,D);){var E=Y(S,D+6);D+=10;for(var x=D+E;D+8<x;){var g=m(S.subarray(D)),h=p(g);h&&I.push(h),D+=g.size+10}G(S,D)&&(D+=10)}return I},p=function(S){return S.type==="PRIV"?a(S):S.type[0]==="W"?s(S):c(S)},a=function(S){if(S.size<2)return;var D=t(S.data,!0),I=new Uint8Array(S.data.subarray(D.length+1));return{key:S.type,info:D,data:I.buffer}},c=function(S){if(S.size<2)return;if(S.type==="TXXX"){var D=1,I=t(S.data.subarray(D),!0);D+=I.length+1;var E=t(S.data.subarray(D));return{key:S.type,info:I,data:E}}var x=t(S.data.subarray(1));return{key:S.type,data:x}},s=function(S){if(S.type==="WXXX"){if(S.size<2)return;var D=1,I=t(S.data.subarray(D),!0);D+=I.length+1;var E=t(S.data.subarray(D));return{key:S.type,info:I,data:E}}var x=t(S.data);return{key:S.type,data:x}},i=function(S){if(S.data.byteLength===8){var D=new Uint8Array(S.data),I=D[3]&1,E=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return E/=45,I&&(E+=4772185884e-2),Math.round(E)}return},t=function(S,D){D===void 0&&(D=!1);var I=R();if(I){var E=I.decode(S);if(D){var x=E.indexOf("\0");return x!==-1?E.substring(0,x):E}return E.replace(/\0/g,"")}for(var g=S.length,h,O,w,b="",W=0;W<g;){if(h=S[W++],h===0&&D)return b;if(h===0||h===3)continue;switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(h);break;case 12:case 13:O=S[W++],b+=String.fromCharCode((h&31)<<6|O&63);break;case 14:O=S[W++],w=S[W++],b+=String.fromCharCode((h&15)<<12|(O&63)<<6|(w&63)<<0);break;default:}}return b},u={decodeTextFrame:c},o;function R(){return!o&&typeof self.TextDecoder!="undefined"&&(o=new self.TextDecoder("utf-8")),o}},"./src/demux/mp3demuxer.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/demux/base-audio-demuxer.ts"),G=U("./src/demux/id3.ts"),M=U("./src/utils/logger.ts"),Y=U("./src/demux/mpegaudio.ts");function X(m,f){m.prototype=Object.create(f.prototype),m.prototype.constructor=m,r(m,f)}function r(m,f){return r=Object.setPrototypeOf||function(a,c){return a.__proto__=c,a},r(m,f)}var A=function(m){X(f,m);function f(){return m.apply(this,arguments)||this}var p=f.prototype;return p.resetInitSegment=function(c,s,i){m.prototype.resetInitSegment.call(this,c,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:c,duration:i,inputTimeScale:9e4,dropped:0}},f.probe=function(c){if(!c)return!1;for(var s=G.getID3Data(c,0)||[],i=s.length,t=c.length;i<t;i++)if(Y.probe(c,i))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(c,s){return Y.canParse(c,s)},p.appendFrame=function(c,s,i){return this.initPTS===null?void 0:Y.appendFrame(c,s,i,this.initPTS,this.frameIndex)},f}(Z.default);A.minProbeByteLength=4,Q.default=A},"./src/demux/mp4demuxer.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/utils/mp4-tools.ts"),G=U("./src/demux/dummy-demuxed-track.ts"),M=function(){function Y(r,A){this.remainderData=null,this.config=void 0,this.config=A}var X=Y.prototype;return X.resetTimeStamp=function(){},X.resetInitSegment=function(){},X.resetContiguity=function(){},Y.probe=function(A){return Object(Z.findBox)({data:A,start:0,end:Math.min(A.length,16384)},["moof"]).length>0},X.demux=function(A){var m=A,f=Object(G.dummyTrack)();if(this.config.progressive){this.remainderData&&(m=Object(Z.appendUint8Array)(this.remainderData,A));var p=Object(Z.segmentValidRange)(m);this.remainderData=p.remainder,f.samples=p.valid||new Uint8Array}else f.samples=m;return{audioTrack:Object(G.dummyTrack)(),avcTrack:f,id3Track:Object(G.dummyTrack)(),textTrack:Object(G.dummyTrack)()}},X.flush=function(){var A=Object(G.dummyTrack)();return A.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(G.dummyTrack)(),avcTrack:A,id3Track:Object(G.dummyTrack)(),textTrack:Object(G.dummyTrack)()}},X.demuxSampleAes=function(A,m,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},X.destroy=function(){},Y}();M.minProbeByteLength=1024,Q.default=M},"./src/demux/mpegaudio.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"appendFrame",function(){return r}),U.d(Q,"parseHeader",function(){return A}),U.d(Q,"isHeaderPattern",function(){return m}),U.d(Q,"isHeader",function(){return f}),U.d(Q,"canParse",function(){return p}),U.d(Q,"probe",function(){return a});var Z=null,G=[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],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Y=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],X=[0,1,1,4];function r(c,s,i,t,u){if(i+24>s.length)return;var o=A(s,i);if(o&&i+o.frameLength<=s.length){var R=o.samplesPerFrame*9e4/o.sampleRate,T=t+u*R,S={unit:s.subarray(i,i+o.frameLength),pts:T,dts:T};return c.config=[],c.channelCount=o.channelCount,c.samplerate=o.sampleRate,c.samples.push(S),{sample:S,length:o.frameLength,missing:0}}}function A(c,s){var i=c[s+1]>>3&3,t=c[s+1]>>1&3,u=c[s+2]>>4&15,o=c[s+2]>>2&3;if(i!==1&&u!==0&&u!==15&&o!==3){var R=c[s+2]>>1&1,T=c[s+3]>>6,S=i===3?3-t:t===3?3:4,D=G[S*14+u-1]*1e3,I=i===3?0:i===2?1:2,E=M[I*3+o],x=T===3?1:2,g=Y[i][t],h=X[t],O=g*8*h,w=Math.floor(g*D/E+R)*h;if(Z===null){var b=navigator.userAgent||"",W=b.match(/Chrome\/(\d+)/i);Z=W?parseInt(W[1]):0}var j=!!Z&&Z<=87;return j&&t===2&&D>=224e3&&T===0&&(c[s+3]=c[s+3]|128),{sampleRate:E,channelCount:x,frameLength:w,samplesPerFrame:O}}}function m(c,s){return c[s]===255&&(c[s+1]&224)===224&&(c[s+1]&6)!==0}function f(c,s){return s+1<c.length&&m(c,s)}function p(c,s){var i=4;return m(c,s)&&i<=c.length-s}function a(c,s){if(s+1<c.length&&m(c,s)){var i=4,t=A(c,s),u=i;t!=null&&t.frameLength&&(u=t.frameLength);var o=s+u;return o===c.length||f(c,o)}return!1}},"./src/demux/sample-aes.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/crypt/decrypter.ts"),G=U("./src/demux/tsdemuxer.ts"),M=function(){function Y(r,A,m){this.keyData=void 0,this.decrypter=void 0,this.keyData=m,this.decrypter=new Z.default(r,A,{removePKCS7Padding:!1})}var X=Y.prototype;return X.decryptBuffer=function(A,m){this.decrypter.decrypt(A,this.keyData.key.buffer,this.keyData.iv.buffer,m)},X.decryptAacSample=function(A,m,f,p){var a=A[m].unit,c=a.subarray(16,a.length-a.length%16),s=c.buffer.slice(c.byteOffset,c.byteOffset+c.length),i=this;this.decryptBuffer(s,function(t){var u=new Uint8Array(t);a.set(u,16),p||i.decryptAacSamples(A,m+1,f)})},X.decryptAacSamples=function(A,m,f){for(;;m++){if(m>=A.length){f();return}if(A[m].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(A,m,f,p),!p)return}},X.getAvcEncryptedData=function(A){for(var m=Math.floor((A.length-48)/160)*16+16,f=new Int8Array(m),p=0,a=32;a<=A.length-16;a+=160,p+=16)f.set(A.subarray(a,a+16),p);return f},X.getAvcDecryptedUnit=function(A,m){for(var f=new Uint8Array(m),p=0,a=32;a<=A.length-16;a+=160,p+=16)A.set(f.subarray(p,p+16),a);return A},X.decryptAvcSample=function(A,m,f,p,a,c){var s=Object(G.discardEPB)(a.data),i=this.getAvcEncryptedData(s),t=this;this.decryptBuffer(i.buffer,function(u){a.data=t.getAvcDecryptedUnit(s,u),c||t.decryptAvcSamples(A,m,f+1,p)})},X.decryptAvcSamples=function(A,m,f,p){if(A instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;m++,f=0){if(m>=A.length){p();return}for(var a=A[m].units;!(f>=a.length);f++){var c=a[f];if(c.data.length<=48||c.type!==1&&c.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(A,m,f,p,c,s),!s)return}}},Y}();Q.default=M},"./src/demux/transmuxer-interface.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return a});var Z=U("./node_modules/webworkify-webpack/index.js"),G=U.n(Z),M=U("./src/events.ts"),Y=U("./src/demux/transmuxer.ts"),X=U("./src/utils/logger.ts"),r=U("./src/errors.ts"),A=U("./src/utils/mediasource-helper.ts"),m=U("./node_modules/eventemitter3/index.js"),f=U.n(m),p=Object(A.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function c(i,t,u,o){var R=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=i,this.id=t,this.onTransmuxComplete=u,this.onFlush=o;var T=i.config,S=function(g,h){h=h||{},h.frag=R.frag,h.id=R.id,i.trigger(g,h)};this.observer=new m.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,S),this.observer.on(M.Events.ERROR,S);var D={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},I=navigator.vendor;if(T.enableWorker&&typeof Worker!="undefined"){X.logger.log("demuxing in webworker");var E;try{E=this.worker=Z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),E.addEventListener("message",this.onwmsg),E.onerror=function(x){i.trigger(M.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(x.message+" ("+x.filename+":"+x.lineno+")")})},E.postMessage({cmd:"init",typeSupported:D,vendor:I,id:t,config:JSON.stringify(T)})}catch(x){X.logger.warn("Error in worker:",x),X.logger.error("Error while initializing DemuxerWorker, fallback to inline"),E&&self.URL.revokeObjectURL(E.objectURL),this.transmuxer=new Y.default(this.observer,D,T,I,t),this.worker=null}}else this.transmuxer=new Y.default(this.observer,D,T,I,t)}var s=c.prototype;return s.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var o=this.observer;o&&o.removeAllListeners(),this.observer=null},s.push=function(t,u,o,R,T,S,D,I,E,x){var g=this;E.transmuxing.start=self.performance.now();var h=this.transmuxer,O=this.worker,w=S?S.start:T.start,b=T.decryptdata,W=this.frag,j=!(W&&T.cc===W.cc),C=!(W&&E.level===W.level),B=W?E.sn-W.sn:-1,k=this.part?E.part-this.part.index:1,y=!C&&(B===1||B===0&&k===1),H=self.performance.now();(C||B||T.stats.parsing.start===0)&&(T.stats.parsing.start=H),S&&(k||!y)&&(S.stats.parsing.start=H);var J=new Y.TransmuxState(j,y,I,C,w);if(!y||j){X.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+E.sn+" p: "+E.part+" level: "+E.level+" id: "+E.id+`
discontinuity: `+j+`
trackSwitch: `+C+`
contiguous: `+y+`
accurateTimeOffset: `+I+`
timeOffset: `+w);var se=new Y.TransmuxConfig(o,R,u,D,x);this.configureTransmuxer(se)}if(this.frag=T,this.part=S,O)O.postMessage({cmd:"demux",data:t,decryptdata:b,chunkMeta:E,state:J},t instanceof ArrayBuffer?[t]:[]);else if(h){var fe=h.push(t,b,E,J);Object(Y.isPromise)(fe)?fe.then(function(ve){g.handleTransmuxComplete(ve)}):this.handleTransmuxComplete(fe)}},s.flush=function(t){var u=this;t.transmuxing.start=self.performance.now();var o=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:t});else if(o){var T=o.flush(t);Object(Y.isPromise)(T)?T.then(function(S){u.handleFlushResult(S,t)}):this.handleFlushResult(T,t)}},s.handleFlushResult=function(t,u){var o=this;t.forEach(function(R){o.handleTransmuxComplete(R)}),this.onFlush(u)},s.onWorkerMessage=function(t){var u=t.data,o=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,o.trigger(u.event,u.data);break}}},s.configureTransmuxer=function(t){var u=this.worker,o=this.transmuxer;u?u.postMessage({cmd:"configure",config:t}):o&&o.configure(t)},s.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},c}()},"./src/demux/transmuxer-worker.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return r});var Z=U("./src/demux/transmuxer.ts"),G=U("./src/events.ts"),M=U("./src/utils/logger.ts"),Y=U("./node_modules/eventemitter3/index.js"),X=U.n(Y);function r(a){var c=new Y.EventEmitter,s=function(t,u){a.postMessage({event:t,data:u})};c.on(G.Events.FRAG_DECRYPTED,s),c.on(G.Events.ERROR,s),a.addEventListener("message",function(i){var t=i.data;switch(t.cmd){case"init":{var u=JSON.parse(t.config);a.transmuxer=new Z.default(c,t.typeSupported,u,t.vendor,t.id),Object(M.enableLogs)(u.debug),s("init",null);break}case"configure":{a.transmuxer.configure(t.config);break}case"demux":{var o=a.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(Z.isPromise)(o)?o.then(function(S){A(a,S)}):A(a,o);break}case"flush":{var R=t.chunkMeta,T=a.transmuxer.flush(R);Object(Z.isPromise)(T)?T.then(function(S){f(a,S,R)}):f(a,T,R);break}default:break}})}function A(a,c){if(p(c.remuxResult))return;var s=[],i=c.remuxResult,t=i.audio,u=i.video;t&&m(s,t),u&&m(s,u),a.postMessage({event:"transmuxComplete",data:c},s)}function m(a,c){c.data1&&a.push(c.data1.buffer),c.data2&&a.push(c.data2.buffer)}function f(a,c,s){c.forEach(function(i){A(a,i)}),a.postMessage({event:"flush",data:s})}function p(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return u}),U.d(Q,"isPromise",function(){return T}),U.d(Q,"TransmuxConfig",function(){return S}),U.d(Q,"TransmuxState",function(){return D});var Z=U("./src/events.ts"),G=U("./src/errors.ts"),M=U("./src/crypt/decrypter.ts"),Y=U("./src/demux/aacdemuxer.ts"),X=U("./src/demux/mp4demuxer.ts"),r=U("./src/demux/tsdemuxer.ts"),A=U("./src/demux/mp3demuxer.ts"),m=U("./src/remux/mp4-remuxer.ts"),f=U("./src/remux/passthrough-remuxer.ts"),p=U("./src/demux/chunk-cache.ts"),a=U("./src/utils/mp4-tools.ts"),c=U("./src/utils/logger.ts"),s;try{s=self.performance.now.bind(self.performance)}catch(I){c.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var i=[{demux:r.default,remux:m.default},{demux:X.default,remux:f.default},{demux:Y.default,remux:m.default},{demux:A.default,remux:m.default}],t=1024;i.forEach(function(I){var E=I.demux;t=Math.max(t,E.minProbeByteLength)});var u=function(){function I(x,g,h,O,w){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new p.default,this.observer=x,this.typeSupported=g,this.config=h,this.vendor=O,this.id=w}var E=I.prototype;return E.configure=function(g){this.transmuxConfig=g,this.decrypter&&this.decrypter.reset()},E.push=function(g,h,O,w){var b=this,W=O.transmuxing;W.executeStart=s();var j=new Uint8Array(g),C=this.cache,B=this.config,k=this.currentTransmuxState,y=this.transmuxConfig;w&&(this.currentTransmuxState=w);var H=o(j,h);if(H&&H.method==="AES-128"){var J=this.getDecrypter();if(B.enableSoftwareAES){var se=J.softwareDecrypt(j,H.key.buffer,H.iv.buffer);if(!se)return W.executeEnd=s(),R(O);j=new Uint8Array(se)}else return this.decryptionPromise=J.webCryptoDecrypt(j,H.key.buffer,H.iv.buffer).then(function(Be){var nt=b.push(Be,null,O);return b.decryptionPromise=null,nt}),this.decryptionPromise}var fe=w||k,ve=fe.contiguous,Se=fe.discontinuity,Ue=fe.trackSwitch,Te=fe.accurateTimeOffset,Ie=fe.timeOffset,be=y.audioCodec,q=y.videoCodec,_=y.defaultInitPts,L=y.duration,z=y.initSegmentData;if((Se||Ue)&&this.resetInitSegment(z,be,q,L),Se&&this.resetInitialTimestamp(_),ve||this.resetContiguity(),this.needsProbing(j,Se,Ue)){if(C.dataLength){var ee=C.flush();j=Object(a.appendUint8Array)(ee,j)}this.configureTransmuxer(j,y)}var $=this.transmux(j,H,Ie,Te,O),Ee=this.currentTransmuxState;return Ee.contiguous=!0,Ee.discontinuity=!1,Ee.trackSwitch=!1,W.executeEnd=s(),$},E.flush=function(g){var h=this,O=g.transmuxing;O.executeStart=s();var w=this.decrypter,b=this.cache,W=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return h.flush(g)});var C=[],B=W.timeOffset;if(w){var k=w.flush();k&&C.push(this.push(k,null,g))}var y=b.dataLength;b.reset();var H=this.demuxer,J=this.remuxer;if(!H||!J)return y>=t&&this.observer.emit(Z.Events.ERROR,Z.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),O.executeEnd=s(),[R(g)];var se=H.flush(B);return T(se)?se.then(function(fe){return h.flushRemux(C,fe,g),C}):(this.flushRemux(C,se,g),C)},E.flushRemux=function(g,h,O){var w=h.audioTrack,b=h.avcTrack,W=h.id3Track,j=h.textTrack,C=this.currentTransmuxState,B=C.accurateTimeOffset,k=C.timeOffset;c.logger.log("[transmuxer.ts]: Flushed fragment "+O.sn+(O.part>-1?" p: "+O.part:"")+" of level "+O.level);var y=this.remuxer.remux(w,b,W,j,k,B,!0,this.id);g.push({remuxResult:y,chunkMeta:O}),O.transmuxing.executeEnd=s()},E.resetInitialTimestamp=function(g){var h=this.demuxer,O=this.remuxer;if(!h||!O)return;h.resetTimeStamp(g),O.resetTimeStamp(g)},E.resetContiguity=function(){var g=this.demuxer,h=this.remuxer;if(!g||!h)return;g.resetContiguity(),h.resetNextTimestamp()},E.resetInitSegment=function(g,h,O,w){var b=this.demuxer,W=this.remuxer;if(!b||!W)return;b.resetInitSegment(h,O,w),W.resetInitSegment(g,h,O)},E.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},E.transmux=function(g,h,O,w,b){var W;return h&&h.method==="SAMPLE-AES"?W=this.transmuxSampleAes(g,h,O,w,b):W=this.transmuxUnencrypted(g,O,w,b),W},E.transmuxUnencrypted=function(g,h,O,w){var b=this.demuxer.demux(g,h,!1,!this.config.progressive),W=b.audioTrack,j=b.avcTrack,C=b.id3Track,B=b.textTrack,k=this.remuxer.remux(W,j,C,B,h,O,!1,this.id);return{remuxResult:k,chunkMeta:w}},E.transmuxSampleAes=function(g,h,O,w,b){var W=this;return this.demuxer.demuxSampleAes(g,h,O).then(function(j){var C=W.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,O,w,!1,W.id);return{remuxResult:C,chunkMeta:b}})},E.configureTransmuxer=function(g,h){for(var O=this.config,w=this.observer,b=this.typeSupported,W=this.vendor,j=h.audioCodec,C=h.defaultInitPts,B=h.duration,k=h.initSegmentData,y=h.videoCodec,H,J=0,se=i.length;J<se;J++)if(i[J].demux.probe(g)){H=i[J];break}H||(c.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:X.default,remux:f.default});var fe=this.demuxer,ve=this.remuxer,Se=H.remux,Ue=H.demux;(!ve||!(ve instanceof Se))&&(this.remuxer=new Se(w,O,b,W)),(!fe||!(fe instanceof Ue))&&(this.demuxer=new Ue(w,O,b),this.probe=Ue.probe),this.resetInitSegment(k,j,y,B),this.resetInitialTimestamp(C)},E.needsProbing=function(g,h,O){return!this.demuxer||!this.remuxer||h||O},E.getDecrypter=function(){var g=this.decrypter;return g||(g=this.decrypter=new M.default(this.observer,this.config)),g},I}();function o(I,E){var x=null;return I.byteLength>0&&E!=null&&E.key!=null&&E.iv!==null&&E.method!=null&&(x=E),x}var R=function(E){return{remuxResult:{},chunkMeta:E}};function T(I){return"then"in I&&I.then instanceof Function}var S=function(E,x,g,h,O){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=E,this.videoCodec=x,this.initSegmentData=g,this.duration=h,this.defaultInitPts=O},D=function(E,x,g,h,O){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=E,this.contiguous=x,this.accurateTimeOffset=g,this.trackSwitch=h,this.timeOffset=O}},"./src/demux/tsdemuxer.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"discardEPB",function(){return R});var Z=U("./src/demux/adts.ts"),G=U("./src/demux/mpegaudio.ts"),M=U("./src/demux/exp-golomb.ts"),Y=U("./src/demux/id3.ts"),X=U("./src/demux/sample-aes.ts"),r=U("./src/events.ts"),A=U("./src/utils/mp4-tools.ts"),m=U("./src/utils/logger.ts"),f=U("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},a=function(){function T(D,I,E){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=I,this.typeSupported=E}T.probe=function(I){var E=T.syncOffset(I);return E<0?!1:(E&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+E+", junk ahead ?"),!0)},T.syncOffset=function(I){for(var E=Math.min(1e3,I.length-3*188),x=0;x<E;){if(I[x]===71&&I[x+188]===71&&I[x+2*188]===71)return x;x++}return-1},T.createTrack=function(I,E){return{container:I==="video"||I==="audio"?"video/mp2t":void 0,type:I,id:p[I],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:I==="audio"?E:void 0}};var S=T.prototype;return S.resetInitSegment=function(I,E,x){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video",x),this._audioTrack=T.createTrack("audio",x),this._id3Track=T.createTrack("id3",x),this._txtTrack=T.createTrack("text",x),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=I,this.videoCodec=E,this._duration=x},S.resetTimeStamp=function(){},S.resetContiguity=function(){var I=this._audioTrack,E=this._avcTrack,x=this._id3Track;I&&(I.pesData=null),E&&(E.pesData=null),x&&(x.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(I,E,x,g){x===void 0&&(x=!1),g===void 0&&(g=!1),x||(this.sampleAes=null);var h,O=this._avcTrack,w=this._audioTrack,b=this._id3Track,W=O.pid,j=O.pesData,C=w.pid,B=b.pid,k=w.pesData,y=b.pesData,H=!1,J=this.pmtParsed,se=this._pmtId,fe=I.length;if(this.remainderData&&(I=Object(A.appendUint8Array)(this.remainderData,I),fe=I.length,this.remainderData=null),fe<188&&!g)return this.remainderData=I,{audioTrack:w,avcTrack:O,id3Track:b,textTrack:this._txtTrack};var ve=Math.max(0,T.syncOffset(I));fe-=(fe+ve)%188,fe<I.byteLength&&!g&&(this.remainderData=new Uint8Array(I.buffer,fe,I.buffer.byteLength-fe));for(var Se=ve;Se<fe;Se+=188)if(I[Se]===71){var Ue=!!(I[Se+1]&64),Te=((I[Se+1]&31)<<8)+I[Se+2],Ie=(I[Se+3]&48)>>4,be=void 0;if(Ie>1){if(be=Se+5+I[Se+4],be===Se+188)continue}else be=Se+4;switch(Te){case W:Ue&&(j&&(h=t(j))&&this.parseAVCPES(h,!1),j={data:[],size:0}),j&&(j.data.push(I.subarray(be,Se+188)),j.size+=Se+188-be);break;case C:Ue&&(k&&(h=t(k))&&(w.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),k={data:[],size:0}),k&&(k.data.push(I.subarray(be,Se+188)),k.size+=Se+188-be);break;case B:Ue&&(y&&(h=t(y))&&this.parseID3PES(h),y={data:[],size:0}),y&&(y.data.push(I.subarray(be,Se+188)),y.size+=Se+188-be);break;case 0:Ue&&(be+=I[be]+1),se=this._pmtId=s(I,be);break;case se:{Ue&&(be+=I[be]+1);var q=i(I,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,x);W=q.avc,W>0&&(O.pid=W),C=q.audio,C>0&&(w.pid=C,w.isAAC=q.isAAC),B=q.id3,B>0&&(b.pid=B),H&&!J&&(m.logger.log("reparse from beginning"),H=!1,Se=ve-188),J=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});O.pesData=j,w.pesData=k,b.pesData=y;var _={audioTrack:w,avcTrack:O,id3Track:b,textTrack:this._txtTrack};return g&&this.extractRemainingSamples(_),_},S.flush=function(){var I=this.remainderData;this.remainderData=null;var E;return I?E=this.demux(I,-1,!1,!0):E={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(E),this.sampleAes?this.decrypt(E,this.sampleAes):E},S.extractRemainingSamples=function(I){var E=I.audioTrack,x=I.avcTrack,g=I.id3Track,h=x.pesData,O=E.pesData,w=g.pesData,b;h&&(b=t(h))?(this.parseAVCPES(b,!0),x.pesData=null):x.pesData=h,O&&(b=t(O))?(E.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),E.pesData=null):(O!=null&&O.size&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),E.pesData=O),w&&(b=t(w))?(this.parseID3PES(b),g.pesData=null):g.pesData=w},S.demuxSampleAes=function(I,E,x){var g=this.demux(I,x,!0,!this.config.progressive),h=this.sampleAes=new X.default(this.observer,this.config,E);return this.decrypt(g,h)},S.decrypt=function(I,E){return new Promise(function(x){var g=I.audioTrack,h=I.avcTrack;g.samples&&g.isAAC?E.decryptAacSamples(g.samples,0,function(){h.samples?E.decryptAvcSamples(h.samples,0,0,function(){x(I)}):x(I)}):h.samples&&E.decryptAvcSamples(h.samples,0,0,function(){x(I)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(I,E){var x=this,g=this._avcTrack,h=this.parseAVCNALu(I.data),O=!1,w=this.avcSample,b,W=!1;I.data=null,w&&h.length&&!g.audFound&&(u(w,g),w=this.avcSample=c(!1,I.pts,I.dts,"")),h.forEach(function(j){switch(j.type){case 1:{b=!0,w||(w=x.avcSample=c(!0,I.pts,I.dts,"")),O&&(w.debug+="NDR "),w.frame=!0;var C=j.data;if(W&&C.length>4){var B=new M.default(C).readSliceType();(B===2||B===4||B===7||B===9)&&(w.key=!0)}break}case 5:b=!0,w||(w=x.avcSample=c(!0,I.pts,I.dts,"")),O&&(w.debug+="IDR "),w.key=!0,w.frame=!0;break;case 6:{b=!0,O&&w&&(w.debug+="SEI ");var k=new M.default(R(j.data));k.readUByte();for(var y=0,H=0,J=!1,se=0;!J&&k.bytesAvailable>1;){y=0;do se=k.readUByte(),y+=se;while(se===255);H=0;do se=k.readUByte(),H+=se;while(se===255);if(y===4&&k.bytesAvailable!==0){J=!0;var fe=k.readUByte();if(fe===181){var ve=k.readUShort();if(ve===49){var Se=k.readUInt();if(Se===1195456820){var Ue=k.readUByte();if(Ue===3){for(var Te=k.readUByte(),Ie=k.readUByte(),be=31&Te,q=[Te,Ie],_=0;_<be;_++)q.push(k.readUByte()),q.push(k.readUByte()),q.push(k.readUByte());o(x._txtTrack.samples,{type:3,pts:I.pts,bytes:q})}}}}}else if(y===5&&k.bytesAvailable!==0){if(J=!0,H>16){for(var L=[],z=0;z<16;z++)L.push(k.readUByte().toString(16)),(z===3||z===5||z===7||z===9)&&L.push("-");for(var ee=H-16,$=new Uint8Array(ee),Ee=0;Ee<ee;Ee++)$[Ee]=k.readUByte();o(x._txtTrack.samples,{pts:I.pts,payloadType:y,uuid:L.join(""),userData:Object(Y.utf8ArrayToStr)($),userDataBytes:$})}}else if(H<k.bytesAvailable)for(var Be=0;Be<H;Be++)k.readUByte()}break}case 7:if(b=!0,W=!0,O&&w&&(w.debug+="SPS "),!g.sps){var nt=new M.default(j.data),we=nt.readSPS();g.width=we.width,g.height=we.height,g.pixelRatio=we.pixelRatio,g.sps=[j.data],g.duration=x._duration;for(var Ne=j.data.subarray(1,4),Ye="avc1.",Xe=0;Xe<3;Xe++){var ht=Ne[Xe].toString(16);ht.length<2&&(ht="0"+ht),Ye+=ht}g.codec=Ye}break;case 8:b=!0,O&&w&&(w.debug+="PPS "),g.pps||(g.pps=[j.data]);break;case 9:b=!1,g.audFound=!0,w&&u(w,g),w=x.avcSample=c(!1,I.pts,I.dts,O?"AUD ":"");break;case 12:b=!1;break;default:b=!1,w&&(w.debug+="unknown NAL "+j.type+" ");break}if(w&&b){var wt=w.units;wt.push(j)}}),E&&w&&(u(w,g),this.avcSample=null)},S.getLastNalUnit=function(){var I,E=this.avcSample,x;if(!E||E.units.length===0){var g=this._avcTrack.samples;E=g[g.length-1]}if((I=E)!==null&&I!==void 0&&I.units){var h=E.units;x=h[h.length-1]}return x},S.parseAVCNALu=function(I){var E=I.byteLength,x=this._avcTrack,g=x.naluState||0,h=g,O=[],w=0,b,W,j,C=-1,B=0;for(g===-1&&(C=0,B=I[0]&31,g=0,w=1);w<E;){if(b=I[w++],!g){g=b?0:1;continue}if(g===1){g=b?0:2;continue}if(!b)g=3;else if(b===1){if(C>=0){var k={data:I.subarray(C,w-g-1),type:B};O.push(k)}else{var y=this.getLastNalUnit();if(y&&(h&&w<=4-h&&(y.state&&(y.data=y.data.subarray(0,y.data.byteLength-h))),W=w-g-1,W>0)){var H=new Uint8Array(y.data.byteLength+W);H.set(y.data,0),H.set(I.subarray(0,W),y.data.byteLength),y.data=H,y.state=0}}w<E?(j=I[w]&31,C=w,B=j,g=0):g=-1}else g=0}if(C>=0&&g>=0){var J={data:I.subarray(C,E),type:B,state:g};O.push(J)}if(O.length===0){var se=this.getLastNalUnit();if(se){var fe=new Uint8Array(se.data.byteLength+I.byteLength);fe.set(se.data,0),fe.set(I,se.data.byteLength),se.data=fe}}return x.naluState=g,O},S.parseAACPES=function(I){var E=0,x=this._audioTrack,g=this.aacOverFlow,h=I.data;if(g){this.aacOverFlow=null;var O=g.sample.unit.byteLength,w=Math.min(g.missing,O),b=O-w;g.sample.unit.set(h.subarray(0,w),b),x.samples.push(g.sample),E=g.missing}var W,j;for(W=E,j=h.length;W<j-1&&!Z.isHeader(h,W);W++);if(W!==E){var C,B;if(W<j-1?(C="AAC PES did not start with ADTS header,offset:"+W,B=!1):(C="no ADTS header found in AAC PES",B=!0),m.logger.warn("parsing error:"+C),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:B,reason:C}),B)return}Z.initTrackConfig(x,this.observer,h,W,this.audioCodec);var k;if(I.pts!==void 0)k=I.pts;else if(g){var y=Z.getFrameDuration(x.samplerate);k=g.sample.pts+y}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;W<j;)if(Z.isHeader(h,W)){if(W+5<j){var J=Z.appendFrame(x,h,W,k,H);if(J)if(J.missing)this.aacOverFlow=J;else{W+=J.length,H++;continue}}break}else W++},S.parseMPEGPES=function(I){var E=I.data,x=E.length,g=0,h=0,O=I.pts;if(O===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<x;)if(G.isHeader(E,h)){var w=G.appendFrame(this._audioTrack,E,h,O,g);if(w)h+=w.length,g++;else break}else h++},S.parseID3PES=function(I){if(I.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(I)},T}();a.minProbeByteLength=188;function c(T,S,D,I){return{key:T,frame:!1,pts:S,dts:D,units:[],debug:I,length:0}}function s(T,S){return(T[S+10]&31)<<8|T[S+11]}function i(T,S,D,I){var E={audio:-1,avc:-1,id3:-1,isAAC:!0},x=(T[S+1]&15)<<8|T[S+2],g=S+3+x-4,h=(T[S+10]&15)<<8|T[S+11];for(S+=12+h;S<g;){var O=(T[S+1]&31)<<8|T[S+2];switch(T[S]){case 207:if(!I){m.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:E.audio===-1&&(E.audio=O);break;case 21:E.id3===-1&&(E.id3=O);break;case 219:if(!I){m.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:E.avc===-1&&(E.avc=O);break;case 3:case 4:D?E.audio===-1&&(E.audio=O,E.isAAC=!1):m.logger.log("MPEG audio found, not supported in this browser");break;case 36:m.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((T[S+3]&15)<<8|T[S+4])+5}return E}function t(T){var S=0,D,I,E,x,g,h=T.data;if(!T||T.size===0)return null;for(;h[0].length<19&&h.length>1;){var O=new Uint8Array(h[0].length+h[1].length);O.set(h[0]),O.set(h[1],h[0].length),h[0]=O,h.splice(1,1)}D=h[0];var w=(D[0]<<16)+(D[1]<<8)+D[2];if(w===1){if(I=(D[4]<<8)+D[5],I&&I>T.size-6)return null;var b=D[7];b&192&&(x=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,b&64?(g=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,x-g>60*9e4&&(m.logger.warn(Math.round((x-g)/9e4)+"s delta between PTS and DTS, align them"),x=g)):g=x),E=D[8];var W=E+9;if(T.size<=W)return null;T.size-=W;for(var j=new Uint8Array(T.size),C=0,B=h.length;C<B;C++){D=h[C];var k=D.byteLength;if(W)if(W>k){W-=k;continue}else D=D.subarray(W),k-=W,W=0;j.set(D,S),S+=k}return I&&(I-=E+3),{data:j,pts:x,dts:g,len:I}}return null}function u(T,S){if(T.units.length&&T.frame){if(T.pts===void 0){var D=S.samples,I=D.length;if(I){var E=D[I-1];T.pts=E.pts,T.dts=E.dts}else{S.dropped++;return}}S.samples.push(T)}T.debug.length&&m.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function o(T,S){var D=T.length;if(D>0){if(S.pts>=T[D-1].pts)T.push(S);else for(var I=D-1;I>=0;I--)if(S.pts<T[I].pts){T.splice(I,0,S);break}}else T.push(S)}function R(T){for(var S=T.byteLength,D=[],I=1;I<S-2;)T[I]===0&&T[I+1]===0&&T[I+2]===3?(D.push(I+2),I+=2):I++;if(D.length===0)return T;var E=S-D.length,x=new Uint8Array(E),g=0;for(I=0;I<E;g++,I++)g===D[0]&&(g++,D.shift()),x[I]=T[g];return x}Q.default=a},"./src/errors.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"ErrorTypes",function(){return Z}),U.d(Q,"ErrorDetails",function(){return G});var Z;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(Z||(Z={}));var G;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(G||(G={}))},"./src/events.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"Events",function(){return Z});var Z;(function(G){G.MEDIA_ATTACHING="hlsMediaAttaching",G.MEDIA_ATTACHED="hlsMediaAttached",G.MEDIA_DETACHING="hlsMediaDetaching",G.MEDIA_DETACHED="hlsMediaDetached",G.BUFFER_RESET="hlsBufferReset",G.BUFFER_CODECS="hlsBufferCodecs",G.BUFFER_CREATED="hlsBufferCreated",G.BUFFER_APPENDING="hlsBufferAppending",G.BUFFER_APPENDED="hlsBufferAppended",G.BUFFER_EOS="hlsBufferEos",G.BUFFER_FLUSHING="hlsBufferFlushing",G.BUFFER_FLUSHED="hlsBufferFlushed",G.MANIFEST_LOADING="hlsManifestLoading",G.MANIFEST_LOADED="hlsManifestLoaded",G.MANIFEST_PARSED="hlsManifestParsed",G.LEVEL_SWITCHING="hlsLevelSwitching",G.LEVEL_SWITCHED="hlsLevelSwitched",G.LEVEL_LOADING="hlsLevelLoading",G.LEVEL_LOADED="hlsLevelLoaded",G.LEVEL_UPDATED="hlsLevelUpdated",G.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",G.LEVELS_UPDATED="hlsLevelsUpdated",G.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",G.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",G.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",G.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",G.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",G.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",G.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",G.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",G.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",G.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",G.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",G.CUES_PARSED="hlsCuesParsed",G.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",G.INIT_PTS_FOUND="hlsInitPtsFound",G.FRAG_LOADING="hlsFragLoading",G.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",G.FRAG_LOADED="hlsFragLoaded",G.FRAG_DECRYPTED="hlsFragDecrypted",G.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",G.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",G.FRAG_PARSING_METADATA="hlsFragParsingMetadata",G.FRAG_PARSED="hlsFragParsed",G.FRAG_BUFFERED="hlsFragBuffered",G.FRAG_CHANGED="hlsFragChanged",G.FPS_DROP="hlsFpsDrop",G.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",G.ERROR="hlsError",G.DESTROYING="hlsDestroying",G.KEY_LOADING="hlsKeyLoading",G.KEY_LOADED="hlsKeyLoaded",G.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",G.BACK_BUFFER_REACHED="hlsBackBufferReached"})(Z||(Z={}))},"./src/hls.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return T});var Z=U("./node_modules/url-toolkit/src/url-toolkit.js"),G=U.n(Z),M=U("./src/loader/playlist-loader.ts"),Y=U("./src/loader/key-loader.ts"),X=U("./src/controller/id3-track-controller.ts"),r=U("./src/controller/latency-controller.ts"),A=U("./src/controller/level-controller.ts"),m=U("./src/controller/fragment-tracker.ts"),f=U("./src/controller/stream-controller.ts"),p=U("./src/is-supported.ts"),a=U("./src/utils/logger.ts"),c=U("./src/config.ts"),s=U("./node_modules/eventemitter3/index.js"),i=U.n(s),t=U("./src/events.ts"),u=U("./src/errors.ts");function o(S,D){for(var I=0;I<D.length;I++){var E=D[I];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}function R(S,D,I){return D&&o(S.prototype,D),I&&o(S,I),S}var T=function(){S.isSupported=function(){return Object(p.isSupported)()};function S(I){I===void 0&&(I={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new s.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var E=this.config=Object(c.mergeConfig)(S.DefaultConfig,I);this.userConfig=I,Object(a.enableLogs)(E.debug),this._autoLevelCapping=-1,E.progressive&&Object(c.enableStreamingMode)(E);var x=E.abrController,g=E.bufferController,h=E.capLevelController,O=E.fpsController,w=this.abrController=new x(this),b=this.bufferController=new g(this),W=this.capLevelController=new h(this),j=new O(this),C=new M.default(this),B=new Y.default(this),k=new X.default(this),y=this.levelController=new A.default(this),H=new m.FragmentTracker(this),J=this.streamController=new f.default(this,H);W.setStreamController(J),j.setStreamController(J);var se=[y,J];this.networkControllers=se;var fe=[C,B,w,b,W,j,k,H];this.audioTrackController=this.createController(E.audioTrackController,null,se),this.createController(E.audioStreamController,H,se),this.subtitleTrackController=this.createController(E.subtitleTrackController,null,se),this.createController(E.subtitleStreamController,H,se),this.createController(E.timelineController,null,fe),this.emeController=this.createController(E.emeController,null,fe),this.cmcdController=this.createController(E.cmcdController,null,fe),this.latencyController=this.createController(r.default,null,fe),this.coreComponents=fe}var D=S.prototype;return D.createController=function(E,x,g){if(E){var h=x?new E(this,x):new E(this);return g&&g.push(h),h}return null},D.on=function(E,x,g){g===void 0&&(g=this),this._emitter.on(E,x,g)},D.once=function(E,x,g){g===void 0&&(g=this),this._emitter.once(E,x,g)},D.removeAllListeners=function(E){this._emitter.removeAllListeners(E)},D.off=function(E,x,g,h){g===void 0&&(g=this),this._emitter.off(E,x,g,h)},D.listeners=function(E){return this._emitter.listeners(E)},D.emit=function(E,x,g){return this._emitter.emit(E,x,g)},D.trigger=function(E,x){if(this.config.debug)return this.emit(E,E,x);try{return this.emit(E,E,x)}catch(g){a.logger.error("An internal error happened while handling event "+E+'. Error message: "'+g.message+'". Here is a stacktrace:',g),this.trigger(t.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:E,error:g})}return!1},D.listenerCount=function(E){return this._emitter.listenerCount(E)},D.destroy=function(){a.logger.log("destroy"),this.trigger(t.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(E){return E.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(E){return E.destroy()}),this.coreComponents.length=0},D.attachMedia=function(E){a.logger.log("attachMedia"),this._media=E,this.trigger(t.Events.MEDIA_ATTACHING,{media:E})},D.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(t.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(E){this.stopLoad();var x=this.media,g=this.url,h=this.url=Z.buildAbsoluteURL(self.location.href,E,{alwaysNormalize:!0});a.logger.log("loadSource:"+h),x&&g&&g!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(x)),this.trigger(t.Events.MANIFEST_LOADING,{url:E})},D.startLoad=function(E){E===void 0&&(E=-1),a.logger.log("startLoad("+E+")"),this.networkControllers.forEach(function(x){x.startLoad(E)})},D.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(E){E.stopLoad()})},D.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){a.logger.log("recoverMediaError");var E=this._media;this.detachMedia(),E&&this.attachMedia(E)},D.removeLevel=function(E,x){x===void 0&&(x=0),this.levelController.removeLevel(E,x)},R(S,[{key:"levels",get:function(){var E=this.levelController.levels;return E||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(E){a.logger.log("set currentLevel:"+E),this.loadLevel=E,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(E){a.logger.log("set nextLevel:"+E),this.levelController.manualLevel=E,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(E){a.logger.log("set loadLevel:"+E),this.levelController.manualLevel=E}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(E){this.levelController.nextLoadLevel=E}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(E){a.logger.log("set firstLevel:"+E),this.levelController.firstLevel=E}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(E){a.logger.log("set startLevel:"+E),E!==-1&&(E=Math.max(E,this.minAutoLevel)),this.levelController.startLevel=E}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(E){var x=!!E;x!==this.config.capLevelToPlayerSize&&(x?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=x)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(E){this._autoLevelCapping!==E&&(a.logger.log("set autoLevelCapping:"+E),this._autoLevelCapping=E)}},{key:"bandwidthEstimate",get:function(){var E=this.abrController.bwEstimator;return E?E.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var E=this.levels,x=this.config.minAutoBitrate;if(!E)return 0;for(var g=E.length,h=0;h<g;h++)if(E[h].maxBitrate>x)return h;return 0}},{key:"maxAutoLevel",get:function(){var E=this.levels,x=this.autoLevelCapping,g;return x===-1&&E&&E.length?g=E.length-1:g=x,g}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(E){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,E)}},{key:"audioTracks",get:function(){var E=this.audioTrackController;return E?E.audioTracks:[]}},{key:"audioTrack",get:function(){var E=this.audioTrackController;return E?E.audioTrack:-1},set:function(E){var x=this.audioTrackController;x&&(x.audioTrack=E)}},{key:"subtitleTracks",get:function(){var E=this.subtitleTrackController;return E?E.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var E=this.subtitleTrackController;return E?E.subtitleTrack:-1},set:function(E){var x=this.subtitleTrackController;x&&(x.subtitleTrack=E)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var E=this.subtitleTrackController;return E?E.subtitleDisplay:!1},set:function(E){var x=this.subtitleTrackController;x&&(x.subtitleDisplay=E)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(E){this.config.lowLatencyMode=E}},{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 t.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:c.hlsDefaultConfig},set:function(E){S.defaultConfig=E}}]),S}();T.defaultConfig=void 0},"./src/is-supported.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"isSupported",function(){return M}),U.d(Q,"changeTypeSupported",function(){return Y});var Z=U("./src/utils/mediasource-helper.ts");function G(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var X=Object(Z.getMediaSource)();if(!X)return!1;var r=G(),A=X&&typeof X.isTypeSupported=="function"&&X.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),m=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!A&&!!m}function Y(){var X,r=G();return typeof(r==null||((X=r.prototype)===null||X===void 0)?void 0:X.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return a}),U.d(Q,"LoadError",function(){return s});var Z=U("./src/polyfills/number.ts"),G=U("./src/errors.ts");function M(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,m(i,t)}function Y(i){var t=typeof Map=="function"?new Map:void 0;return Y=function(o){if(o===null||!A(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(o))return t.get(o);t.set(o,R)}function R(){return X(o,arguments,f(this).constructor)}return R.prototype=Object.create(o.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),m(R,o)},Y(i)}function X(i,t,u){return r()?X=Reflect.construct:X=function(R,T,S){var D=[null];D.push.apply(D,T);var I=Function.bind.apply(R,D),E=new I;return S&&m(E,S.prototype),E},X.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(i){return!1}}function A(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function m(i,t){return m=Object.setPrototypeOf||function(o,R){return o.__proto__=R,o},m(i,t)}function f(i){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},f(i)}var p=Math.pow(2,17),a=function(){function i(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var t=i.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(o,R){var T=this,S=o.url;if(!S)return Promise.reject(new s({type:G.ErrorTypes.NETWORK_ERROR,details:G.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var D=this.config,I=D.fLoader,E=D.loader;return new Promise(function(x,g){T.loader&&T.loader.destroy();var h=T.loader=o.loader=I?new I(D):new E(D),O=c(o),w={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};o.stats=h.stats,h.load(O,w,{onSuccess:function(W,j,C,B){T.resetLoader(o,h),x({frag:o,part:null,payload:W.data,networkDetails:B})},onError:function(W,j,C){T.resetLoader(o,h),g(new s({type:G.ErrorTypes.NETWORK_ERROR,details:G.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,response:W,networkDetails:C}))},onAbort:function(W,j,C){T.resetLoader(o,h),g(new s({type:G.ErrorTypes.NETWORK_ERROR,details:G.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,networkDetails:C}))},onTimeout:function(W,j,C){T.resetLoader(o,h),g(new s({type:G.ErrorTypes.NETWORK_ERROR,details:G.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,networkDetails:C}))},onProgress:function(W,j,C,B){R&&R({frag:o,part:null,payload:C,networkDetails:B})}})})},t.loadPart=function(o,R,T){var S=this;this.abort();var D=this.config,I=D.fLoader,E=D.loader;return new Promise(function(x,g){S.loader&&S.loader.destroy();var h=S.loader=o.loader=I?new I(D):new E(D),O=c(o,R),w={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};R.stats=h.stats,h.load(O,w,{onSuccess:function(W,j,C,B){S.resetLoader(o,h),S.updateStatsFromPart(o,R);var k={frag:o,part:R,payload:W.data,networkDetails:B};T(k),x(k)},onError:function(W,j,C){S.resetLoader(o,h),g(new s({type:G.ErrorTypes.NETWORK_ERROR,details:G.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,part:R,response:W,networkDetails:C}))},onAbort:function(W,j,C){o.stats.aborted=R.stats.aborted,S.resetLoader(o,h),g(new s({type:G.ErrorTypes.NETWORK_ERROR,details:G.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,part:R,networkDetails:C}))},onTimeout:function(W,j,C){S.resetLoader(o,h),g(new s({type:G.ErrorTypes.NETWORK_ERROR,details:G.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,part:R,networkDetails:C}))}})})},t.updateStatsFromPart=function(o,R){var T=o.stats,S=R.stats,D=S.total;if(T.loaded+=S.loaded,D){var I=Math.round(o.duration/R.duration),E=Math.min(Math.round(T.loaded/D),I),x=I-E,g=x*Math.round(T.loaded/E);T.total=T.loaded+g}else T.total=Math.max(T.loaded,T.total);var h=T.loading,O=S.loading;h.start?h.first+=O.first-O.start:(h.start=O.start,h.first=O.first),h.end=O.end},t.resetLoader=function(o,R){o.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},i}();function c(i,t){t===void 0&&(t=null);var u=t||i,o={frag:i,part:t,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},R=u.byteRangeStartOffset,T=u.byteRangeEndOffset;return Object(Z.isFiniteNumber)(R)&&Object(Z.isFiniteNumber)(T)&&(o.rangeStart=R,o.rangeEnd=T),o}var s=function(i){M(t,i);function t(u){for(var o,R=arguments.length,T=new Array(R>1?R-1:0),S=1;S<R;S++)T[S-1]=arguments[S];return o=i.call.apply(i,[this].concat(T))||this,o.data=void 0,o.data=u,o}return t}(Y(Error))},"./src/loader/fragment.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"ElementaryStreamTypes",function(){return a}),U.d(Q,"BaseSegment",function(){return c}),U.d(Q,"Fragment",function(){return s}),U.d(Q,"Part",function(){return i});var Z=U("./src/polyfills/number.ts"),G=U("./node_modules/url-toolkit/src/url-toolkit.js"),M=U.n(G),Y=U("./src/utils/logger.ts"),X=U("./src/loader/level-key.ts"),r=U("./src/loader/load-stats.ts");function A(t,u){t.prototype=Object.create(u.prototype),t.prototype.constructor=t,m(t,u)}function m(t,u){return m=Object.setPrototypeOf||function(R,T){return R.__proto__=T,R},m(t,u)}function f(t,u){for(var o=0;o<u.length;o++){var R=u[o];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(t,R.key,R)}}function p(t,u,o){return u&&f(t.prototype,u),o&&f(t,o),t}var a;(function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"})(a||(a={}));var c=function(){function t(o){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[a.AUDIO]=null,R[a.VIDEO]=null,R[a.AUDIOVIDEO]=null,R),this.baseurl=o}var u=t.prototype;return u.setByteRange=function(R,T){var S=R.split("@",2),D=[];S.length===1?D[0]=T?T.byteRangeEndOffset:0:D[0]=parseInt(S[1]),D[1]=parseInt(S[0])+D[0],this._byteRange=D},p(t,[{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(G.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),t}(),s=function(t){A(u,t);function u(R,T){var S;return S=t.call(this,T)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new r.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=R,S}var o=u.prototype;return o.createInitializationVector=function(T){for(var S=new Uint8Array(16),D=12;D<16;D++)S[D]=T>>8*(15-D)&255;return S},o.setDecryptDataFromLevelKey=function(T,S){var D=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(D=X.LevelKey.fromURI(T.uri),D.method=T.method,D.iv=this.createInitializationVector(S),D.keyFormat="identity"),D},o.setElementaryStreamInfo=function(T,S,D,I,E,x){x===void 0&&(x=!1);var g=this.elementaryStreams,h=g[T];if(!h){g[T]={startPTS:S,endPTS:D,startDTS:I,endDTS:E,partial:x};return}h.startPTS=Math.min(h.startPTS,S),h.endPTS=Math.max(h.endPTS,D),h.startDTS=Math.min(h.startDTS,I),h.endDTS=Math.max(h.endDTS,E)},o.clearElementaryStreamInfo=function(){var T=this.elementaryStreams;T[a.AUDIO]=null,T[a.VIDEO]=null,T[a.AUDIOVIDEO]=null},p(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&Y.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Z.isFiniteNumber)(this.programDateTime))return null;var T=Object(Z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),u}(c),i=function(t){A(u,t);function u(o,R,T,S,D){var I;I=t.call(this,T)||this,I.fragOffset=0,I.duration=0,I.gap=!1,I.independent=!1,I.relurl=void 0,I.fragment=void 0,I.index=void 0,I.stats=new r.LoadStats,I.duration=o.decimalFloatingPoint("DURATION"),I.gap=o.bool("GAP"),I.independent=o.bool("INDEPENDENT"),I.relurl=o.enumeratedString("URI"),I.fragment=R,I.index=S;var E=o.enumeratedString("BYTERANGE");return E&&I.setByteRange(E,D),D&&(I.fragOffset=D.fragOffset+D.duration),I}return p(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),u}(c)},"./src/loader/key-loader.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return Y});var Z=U("./src/events.ts"),G=U("./src/errors.ts"),M=U("./src/utils/logger.ts"),Y=function(){function X(A){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=A,this._registerListeners()}var r=X.prototype;return r._registerListeners=function(){this.hls.on(Z.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(Z.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var m in this.loaders){var f=this.loaders[m];f&&f.destroy()}this.loaders={}},r.onKeyLoading=function(m,f){var p=f.frag,a=p.type,c=this.loaders[a];if(!p.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=p.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(c&&(M.logger.warn("abort previous key loader for type:"+a),c.abort()),!s){M.logger.warn("key uri is falsy");return}var t=i.loader,u=p.loader=this.loaders[a]=new t(i);this.decrypturl=s,this.decryptkey=null;var o={url:s,frag:p,responseType:"arraybuffer"},R={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(o,R,T)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(Z.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(m,f,p){var a=p.frag;if(!a.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(m.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(Z.Events.KEY_LOADED,{frag:a})},r.loaderror=function(m,f){var p=f.frag,a=p.loader;a&&a.abort(),delete this.loaders[p.type],this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.NETWORK_ERROR,details:G.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:m})},r.loadtimeout=function(m,f){var p=f.frag,a=p.loader;a&&a.abort(),delete this.loaders[p.type],this.hls.trigger(Z.Events.ERROR,{type:G.ErrorTypes.NETWORK_ERROR,details:G.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},X}()},"./src/loader/level-details.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"LevelDetails",function(){return X});var Z=U("./src/polyfills/number.ts");function G(r,A){for(var m=0;m<A.length;m++){var f=A[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,f.key,f)}}function M(r,A,m){return A&&G(r.prototype,A),m&&G(r,m),r}var Y=10,X=function(){function r(m){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=m}var A=r.prototype;return A.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-f.lastPartSn,a=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!a||!!p,this.advanced=this.endSN>f.endSN||p>0||p===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},M(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||Y}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var p=this.driftEnd-this.driftStart;return p*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"LevelKey",function(){return X});var Z=U("./node_modules/url-toolkit/src/url-toolkit.js"),G=U.n(Z);function M(r,A){for(var m=0;m<A.length;m++){var f=A[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,f.key,f)}}function Y(r,A,m){return A&&M(r.prototype,A),m&&M(r,m),r}var X=function(){r.fromURL=function(m,f){return new r(m,f)},r.fromURI=function(m){return new r(m)};function r(A,m){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,m?this._uri=Object(Z.buildAbsoluteURL)(A,m,{alwaysNormalize:!0}):this._uri=A}return Y(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"LoadStats",function(){return Z});var Z=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(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return u});var Z=U("./src/polyfills/number.ts"),G=U("./node_modules/url-toolkit/src/url-toolkit.js"),M=U.n(G),Y=U("./src/loader/fragment.ts"),X=U("./src/loader/level-details.ts"),r=U("./src/loader/level-key.ts"),A=U("./src/utils/attr-list.ts"),m=U("./src/utils/logger.ts"),f=U("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,c=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),s=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function t(D){var I,E;return i.test((I=(E=G.parseURL(D))===null||E===void 0?void 0:E.path)!=null?I:"")}var u=function(){function D(){}return D.findGroup=function(E,x){for(var g=0;g<E.length;g++){var h=E[g];if(h.id===x)return h}},D.convertAVC1ToAVCOTI=function(E){var x=E.split(".");if(x.length>2){var g=x.shift()+".";return g+=parseInt(x.shift()).toString(16),g+=("000"+parseInt(x.shift()).toString(16)).substr(-4),g}return E},D.resolve=function(E,x){return G.buildAbsoluteURL(x,E,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(E,x){var g=[],h={},O=!1;p.lastIndex=0;for(var w;(w=p.exec(E))!=null;)if(w[1]){var b=new A.AttrList(w[1]),W={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:D.resolve(w[2],x)},j=b.decimalResolution("RESOLUTION");j&&(W.width=j.width,W.height=j.height),o((b.CODECS||"").split(/[ ,]+/).filter(function(B){return B}),W),W.videoCodec&&W.videoCodec.indexOf("avc1")!==-1&&(W.videoCodec=D.convertAVC1ToAVCOTI(W.videoCodec)),g.push(W)}else if(w[3]){var C=new A.AttrList(w[3]);C["DATA-ID"]&&(O=!0,h[C["DATA-ID"]]=C)}return{levels:g,sessionData:O?h:null}},D.parseMasterPlaylistMedia=function(E,x,g,h){h===void 0&&(h=[]);var O,w=[],b=0;for(a.lastIndex=0;(O=a.exec(E))!==null;){var W=new A.AttrList(O[1]);if(W.TYPE===g){var j={attrs:W,bitrate:0,id:b++,groupId:W["GROUP-ID"],instreamId:W["INSTREAM-ID"],name:W.NAME||W.LANGUAGE||"",type:g,default:W.bool("DEFAULT"),autoselect:W.bool("AUTOSELECT"),forced:W.bool("FORCED"),lang:W.LANGUAGE,url:W.URI?D.resolve(W.URI,x):""};if(h.length){var C=D.findGroup(h,j.groupId)||h[0];R(j,C,"audioCodec"),R(j,C,"textCodec")}w.push(j)}}return w},D.parseLevelPlaylist=function(E,x,g,h,O){var w=new X.LevelDetails(x),b=w.fragments,W=null,j=0,C=0,B=0,k=0,y=null,H=new Y.Fragment(h,x),J,se,fe,ve=-1,Se=!1;for(c.lastIndex=0,w.m3u8=E;(J=c.exec(E))!==null;){Se&&(Se=!1,H=new Y.Fragment(h,x),H.start=B,H.sn=j,H.cc=k,H.level=g,W&&(H.initSegment=W,H.rawProgramDateTime=W.rawProgramDateTime));var Ue=J[1];if(Ue){H.duration=parseFloat(Ue);var Te=(" "+J[2]).slice(1);H.title=Te||null,H.tagList.push(Te?["INF",Ue,Te]:["INF",Ue])}else if(J[3])Object(Z.isFiniteNumber)(H.duration)&&(H.start=B,fe&&(H.levelkey=fe),H.sn=j,H.level=g,H.cc=k,H.urlId=O,b.push(H),H.relurl=(" "+J[3]).slice(1),S(H,y),y=H,B+=H.duration,j++,C=0,Se=!0);else if(J[4]){var Ie=(" "+J[4]).slice(1);y?H.setByteRange(Ie,y):H.setByteRange(Ie)}else if(J[5])H.rawProgramDateTime=(" "+J[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),ve===-1&&(ve=b.length);else{if(J=J[0].match(s),!J){m.logger.warn("No matches on slow regex match for level playlist!");continue}for(se=1;se<J.length&&!(typeof J[se]!="undefined");se++);var be=(" "+J[se]).slice(1),q=(" "+J[se+1]).slice(1),_=J[se+2]?(" "+J[se+2]).slice(1):"";switch(be){case"PLAYLIST-TYPE":w.type=q.toUpperCase();break;case"MEDIA-SEQUENCE":j=w.startSN=parseInt(q);break;case"SKIP":{var L=new A.AttrList(q),z=L.decimalInteger("SKIPPED-SEGMENTS");if(Object(Z.isFiniteNumber)(z)){w.skippedSegments=z;for(var ee=z;ee--;)b.unshift(null);j+=z}var $=L.enumeratedString("RECENTLY-REMOVED-DATERANGES");$&&(w.recentlyRemovedDateranges=$.split(" "));break}case"TARGETDURATION":w.targetduration=parseFloat(q);break;case"VERSION":w.version=parseInt(q);break;case"EXTM3U":break;case"ENDLIST":w.live=!1;break;case"#":(q||_)&&H.tagList.push(_?[q,_]:[q]);break;case"DIS":k++;case"GAP":H.tagList.push([be]);break;case"BITRATE":H.tagList.push([be,q]);break;case"DISCONTINUITY-SEQ":k=parseInt(q);break;case"KEY":{var Ee,Be=new A.AttrList(q),nt=Be.enumeratedString("METHOD"),we=Be.URI,Ne=Be.hexadecimalInteger("IV"),Ye=Be.enumeratedString("KEYFORMATVERSIONS"),Xe=Be.enumeratedString("KEYID"),ht=(Ee=Be.enumeratedString("KEYFORMAT"))!=null?Ee:"identity",wt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(wt.indexOf(ht)>-1){m.logger.warn("Keyformat "+ht+" is not supported from the manifest");continue}else if(ht!=="identity")continue;nt&&(fe=r.LevelKey.fromURL(x,we),we&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(nt)>=0&&(fe.method=nt,fe.keyFormat=ht,Xe&&(fe.keyID=Xe),Ye&&(fe.keyFormatVersions=Ye),fe.iv=Ne));break}case"START":{var Bt=new A.AttrList(q),Wt=Bt.decimalFloatingPoint("TIME-OFFSET");Object(Z.isFiniteNumber)(Wt)&&(w.startTimeOffset=Wt);break}case"MAP":{var an=new A.AttrList(q);H.relurl=an.URI,an.BYTERANGE&&H.setByteRange(an.BYTERANGE),H.level=g,H.sn="initSegment",fe&&(H.levelkey=fe),H.initSegment=null,W=H,Se=!0;break}case"SERVER-CONTROL":{var Yt=new A.AttrList(q);w.canBlockReload=Yt.bool("CAN-BLOCK-RELOAD"),w.canSkipUntil=Yt.optionalFloat("CAN-SKIP-UNTIL",0),w.canSkipDateRanges=w.canSkipUntil>0&&Yt.bool("CAN-SKIP-DATERANGES"),w.partHoldBack=Yt.optionalFloat("PART-HOLD-BACK",0),w.holdBack=Yt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var qe=new A.AttrList(q);w.partTarget=qe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Qe=w.partList;Qe||(Qe=w.partList=[]);var bt=C>0?Qe[Qe.length-1]:void 0,xt=C++,ye=new Y.Part(new A.AttrList(q),H,x,xt,bt);Qe.push(ye),H.duration+=ye.duration;break}case"PRELOAD-HINT":{var ae=new A.AttrList(q);w.preloadHint=ae;break}case"RENDITION-REPORT":{var le=new A.AttrList(q);w.renditionReports=w.renditionReports||[],w.renditionReports.push(le);break}default:m.logger.warn("line parsed but not handled: "+J);break}}}y&&!y.relurl?(b.pop(),B-=y.duration,w.partList&&(w.fragmentHint=y)):w.partList&&(S(H,y),H.cc=k,w.fragmentHint=H);var me=b.length,Ce=b[0],de=b[me-1];if(B+=w.skippedSegments*w.targetduration,B>0&&me&&de){w.averagetargetduration=B/me;var pe=de.sn;w.endSN=pe!=="initSegment"?pe:0,Ce&&(w.startCC=Ce.cc,Ce.initSegment||w.fragments.every(function(De){return De.relurl&&t(De.relurl)})&&(m.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new Y.Fragment(h,x),H.relurl=de.relurl,H.level=g,H.sn="initSegment",Ce.initSegment=H,w.needSidxRanges=!0))}else w.endSN=0,w.startCC=0;return w.fragmentHint&&(B+=w.fragmentHint.duration),w.totalduration=B,w.endCC=k,ve>0&&T(b,ve),w},D}();function o(D,I){["video","audio","text"].forEach(function(E){var x=D.filter(function(h){return Object(f.isCodecType)(h,E)});if(x.length){var g=x.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});I[E+"Codec"]=g.length>0?g[0]:x[0],D=D.filter(function(h){return x.indexOf(h)===-1})}}),I.unknownCodecs=D}function R(D,I,E){var x=I[E];x&&(D[E]=x)}function T(D,I){for(var E=D[I],x=I;x--;){var g=D[x];if(!g)return;g.programDateTime=E.programDateTime-g.duration*1e3,E=g}}function S(D,I){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):I!=null&&I.programDateTime&&(D.programDateTime=I.endProgramDateTime),Object(Z.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/polyfills/number.ts"),G=U("./src/events.ts"),M=U("./src/errors.ts"),Y=U("./src/utils/logger.ts"),X=U("./src/utils/mp4-tools.ts"),r=U("./src/loader/m3u8-parser.ts"),A=U("./src/types/loader.ts"),m=U("./src/utils/attr-list.ts");function f(c){var s=c.type;switch(s){case A.PlaylistContextType.AUDIO_TRACK:return A.PlaylistLevelType.AUDIO;case A.PlaylistContextType.SUBTITLE_TRACK:return A.PlaylistLevelType.SUBTITLE;default:return A.PlaylistLevelType.MAIN}}function p(c,s){var i=c.url;return(i===void 0||i.indexOf("data:")===0)&&(i=s.url),i}var a=function(){function c(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var s=c.prototype;return s.registerListeners=function(){var t=this.hls;t.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(G.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(G.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.unregisterListeners=function(){var t=this.hls;t.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(G.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(G.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.createInternalLoader=function(t){var u=this.hls.config,o=u.pLoader,R=u.loader,T=o||R,S=new T(u);return t.loader=S,this.loaders[t.type]=S,S},s.getInternalLoader=function(t){return this.loaders[t.type]},s.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},s.destroyInternalLoaders=function(){for(var t in this.loaders){var u=this.loaders[t];u&&u.destroy(),this.resetInternalLoader(t)}},s.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},s.onManifestLoading=function(t,u){var o=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:A.PlaylistContextType.MANIFEST,url:o,deliveryDirectives:null})},s.onLevelLoading=function(t,u){var o=u.id,R=u.level,T=u.url,S=u.deliveryDirectives;this.load({id:o,groupId:null,level:R,responseType:"text",type:A.PlaylistContextType.LEVEL,url:T,deliveryDirectives:S})},s.onAudioTrackLoading=function(t,u){var o=u.id,R=u.groupId,T=u.url,S=u.deliveryDirectives;this.load({id:o,groupId:R,level:null,responseType:"text",type:A.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:S})},s.onSubtitleTrackLoading=function(t,u){var o=u.id,R=u.groupId,T=u.url,S=u.deliveryDirectives;this.load({id:o,groupId:R,level:null,responseType:"text",type:A.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:S})},s.load=function(t){var u,o=this.hls.config,R=this.getInternalLoader(t);if(R){var T=R.context;if(T&&T.url===t.url){Y.logger.trace("[playlist-loader]: playlist request ongoing");return}Y.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),R.abort()}var S,D,I,E;switch(t.type){case A.PlaylistContextType.MANIFEST:S=o.manifestLoadingMaxRetry,D=o.manifestLoadingTimeOut,I=o.manifestLoadingRetryDelay,E=o.manifestLoadingMaxRetryTimeout;break;case A.PlaylistContextType.LEVEL:case A.PlaylistContextType.AUDIO_TRACK:case A.PlaylistContextType.SUBTITLE_TRACK:S=0,D=o.levelLoadingTimeOut;break;default:S=o.levelLoadingMaxRetry,D=o.levelLoadingTimeOut,I=o.levelLoadingRetryDelay,E=o.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(t),(u=t.deliveryDirectives)!==null&&u!==void 0&&u.part){var x;if(t.type===A.PlaylistContextType.LEVEL&&t.level!==null?x=this.hls.levels[t.level].details:t.type===A.PlaylistContextType.AUDIO_TRACK&&t.id!==null?x=this.hls.audioTracks[t.id].details:t.type===A.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(x=this.hls.subtitleTracks[t.id].details),x){var g=x.partTarget,h=x.targetduration;g&&h&&(D=Math.min(Math.max(g*3,h*.8)*1e3,D))}}var O={timeout:D,maxRetry:S,retryDelay:I,maxRetryDelay:E,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(t,O,w)},s.loadsuccess=function(t,u,o,R){if(R===void 0&&(R=null),o.isSidxRequest){this.handleSidxRequest(t,o),this.handlePlaylistLoaded(t,u,o,R);return}this.resetInternalLoader(o.type);var T=t.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,o,"no EXTM3U delimiter",R);return}u.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,u,o,R):this.handleMasterPlaylist(t,u,o,R)},s.loaderror=function(t,u,o){o===void 0&&(o=null),this.handleNetworkError(u,o,!1,t)},s.loadtimeout=function(t,u,o){o===void 0&&(o=null),this.handleNetworkError(u,o,!0)},s.handleMasterPlaylist=function(t,u,o,R){var T=this.hls,S=t.data,D=p(t,o),I=r.default.parseMasterPlaylist(S,D),E=I.levels,x=I.sessionData;if(!E.length){this.handleManifestParsingError(t,o,"no level found in manifest",R);return}var g=E.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),h=E.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),O=r.default.parseMasterPlaylistMedia(S,D,"AUDIO",g),w=r.default.parseMasterPlaylistMedia(S,D,"SUBTITLES",h),b=r.default.parseMasterPlaylistMedia(S,D,"CLOSED-CAPTIONS");if(O.length){var W=O.some(function(j){return!j.url});!W&&E[0].audioCodec&&!E[0].attrs.AUDIO&&(Y.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),O.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m.AttrList({}),bitrate:0,url:""}))}T.trigger(G.Events.MANIFEST_LOADED,{levels:E,audioTracks:O,subtitles:w,captions:b,url:D,stats:u,networkDetails:R,sessionData:x})},s.handleTrackOrLevelPlaylist=function(t,u,o,R){var T=this.hls,S=o.id,D=o.level,I=o.type,E=p(t,o),x=Object(Z.isFiniteNumber)(S)?S:0,g=Object(Z.isFiniteNumber)(D)?D:x,h=f(o),O=r.default.parseLevelPlaylist(t.data,E,g,h,x);if(!O.fragments.length){T.trigger(G.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:E,reason:"no fragments found in level",level:typeof o.level=="number"?o.level:void 0});return}if(I===A.PlaylistContextType.MANIFEST){var w={attrs:new m.AttrList({}),bitrate:0,details:O,name:"",url:E};T.trigger(G.Events.MANIFEST_LOADED,{levels:[w],audioTracks:[],url:E,stats:u,networkDetails:R,sessionData:null})}if(u.parsing.end=performance.now(),O.needSidxRanges){var b,W=(b=O.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:W,isSidxRequest:!0,type:I,level:D,levelDetails:O,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}o.levelDetails=O,this.handlePlaylistLoaded(t,u,o,R)},s.handleSidxRequest=function(t,u){var o=Object(X.parseSegmentIndex)(new Uint8Array(t.data));if(!o)return;var R=o.references,T=u.levelDetails;R.forEach(function(S,D){var I=S.info,E=T.fragments[D];E.byteRange.length===0&&E.setByteRange(String(1+I.end-I.start)+"@"+String(I.start)),E.initSegment&&E.initSegment.setByteRange(String(o.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(t,u,o,R){this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===A.PlaylistContextType.MANIFEST,url:t.url,reason:o,response:t,context:u,networkDetails:R})},s.handleNetworkError=function(t,u,o,R){o===void 0&&(o=!1),Y.logger.warn("[playlist-loader]: A network "+(o?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var T=M.ErrorDetails.UNKNOWN,S=!1,D=this.getInternalLoader(t);switch(t.type){case A.PlaylistContextType.MANIFEST:T=o?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case A.PlaylistContextType.LEVEL:T=o?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case A.PlaylistContextType.AUDIO_TRACK:T=o?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case A.PlaylistContextType.SUBTITLE_TRACK:T=o?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}D&&this.resetInternalLoader(t.type);var I={type:M.ErrorTypes.NETWORK_ERROR,details:T,fatal:S,url:t.url,loader:D,context:t,networkDetails:u};R&&(I.response=R),this.hls.trigger(G.Events.ERROR,I)},s.handlePlaylistLoaded=function(t,u,o,R){var T=o.type,S=o.level,D=o.id,I=o.groupId,E=o.loader,x=o.levelDetails,g=o.deliveryDirectives;if(!(x!=null&&x.targetduration)){this.handleManifestParsingError(t,o,"invalid target duration",R);return}if(!E)return;x.live&&(E.getCacheAge&&(x.ageHeader=E.getCacheAge()||0),(!E.getCacheAge||isNaN(x.ageHeader))&&(x.ageHeader=0));switch(T){case A.PlaylistContextType.MANIFEST:case A.PlaylistContextType.LEVEL:this.hls.trigger(G.Events.LEVEL_LOADED,{details:x,level:S||0,id:D||0,stats:u,networkDetails:R,deliveryDirectives:g});break;case A.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(G.Events.AUDIO_TRACK_LOADED,{details:x,id:D||0,groupId:I||"",stats:u,networkDetails:R,deliveryDirectives:g});break;case A.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(G.Events.SUBTITLE_TRACK_LOADED,{details:x,id:D||0,groupId:I||"",stats:u,networkDetails:R,deliveryDirectives:g});break}},c}();Q.default=a},"./src/polyfills/number.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"isFiniteNumber",function(){return Z}),U.d(Q,"MAX_SAFE_INTEGER",function(){return G});var Z=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},G=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=function(){function G(){}return G.getSilentFrame=function(Y,X){switch(Y){case"mp4a.40.2":if(X===1)return new Uint8Array([0,200,0,128,35,128]);if(X===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(X===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(X===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(X===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(X===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(X===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(X===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(X===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},G}();Q.default=Z},"./src/remux/mp4-generator.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=Math.pow(2,32)-1,G=function(){function M(){}return M.init=function(){M.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 X;for(X in M.types)M.types.hasOwnProperty(X)&&(M.types[X]=[X.charCodeAt(0),X.charCodeAt(1),X.charCodeAt(2),X.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]);M.HDLR_TYPES={video:r,audio:A};var m=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=f,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,p,c,p,a),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,m))},M.box=function(X){for(var r=8,A=arguments.length,m=new Array(A>1?A-1:0),f=1;f<A;f++)m[f-1]=arguments[f];for(var p=m.length,a=p;p--;)r+=m[p].byteLength;var c=new Uint8Array(r);for(c[0]=r>>24&255,c[1]=r>>16&255,c[2]=r>>8&255,c[3]=r&255,c.set(X,4),p=0,r=8;p<a;p++)c.set(m[p],r),r+=m[p].byteLength;return c},M.hdlr=function(X){return M.box(M.types.hdlr,M.HDLR_TYPES[X])},M.mdat=function(X){return M.box(M.types.mdat,X)},M.mdhd=function(X,r){r*=X;var A=Math.floor(r/(Z+1)),m=Math.floor(r%(Z+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,X>>24&255,X>>16&255,X>>8&255,X&255,A>>24,A>>16&255,A>>8&255,A&255,m>>24,m>>16&255,m>>8&255,m&255,85,196,0,0]))},M.mdia=function(X){return M.box(M.types.mdia,M.mdhd(X.timescale,X.duration),M.hdlr(X.type),M.minf(X))},M.mfhd=function(X){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,X>>24,X>>16&255,X>>8&255,X&255]))},M.minf=function(X){return X.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(X)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(X))},M.moof=function(X,r,A){return M.box(M.types.moof,M.mfhd(X),M.traf(A,r))},M.moov=function(X){for(var r=X.length,A=[];r--;)A[r]=M.trak(X[r]);return M.box.apply(null,[M.types.moov,M.mvhd(X[0].timescale,X[0].duration)].concat(A).concat(M.mvex(X)))},M.mvex=function(X){for(var r=X.length,A=[];r--;)A[r]=M.trex(X[r]);return M.box.apply(null,[M.types.mvex].concat(A))},M.mvhd=function(X,r){r*=X;var A=Math.floor(r/(Z+1)),m=Math.floor(r%(Z+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,X>>24&255,X>>16&255,X>>8&255,X&255,A>>24,A>>16&255,A>>8&255,A&255,m>>24,m>>16&255,m>>8&255,m&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 M.box(M.types.mvhd,f)},M.sdtp=function(X){var r=X.samples||[],A=new Uint8Array(4+r.length),m,f;for(m=0;m<r.length;m++)f=r[m].flags,A[m+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return M.box(M.types.sdtp,A)},M.stbl=function(X){return M.box(M.types.stbl,M.stsd(X),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(X){var r=[],A=[],m,f,p;for(m=0;m<X.sps.length;m++)f=X.sps[m],p=f.byteLength,r.push(p>>>8&255),r.push(p&255),r=r.concat(Array.prototype.slice.call(f));for(m=0;m<X.pps.length;m++)f=X.pps[m],p=f.byteLength,A.push(p>>>8&255),A.push(p&255),A=A.concat(Array.prototype.slice.call(f));var a=M.box(M.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|X.sps.length].concat(r).concat([X.pps.length]).concat(A))),c=X.width,s=X.height,i=X.pixelRatio[0],t=X.pixelRatio[1];return M.box(M.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,c>>8&255,c&255,s>>8&255,s&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,t>>24,t>>16&255,t>>8&255,t&255])))},M.esds=function(X){var r=X.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(X.config).concat([6,1,2]))},M.mp4a=function(X){var r=X.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,X.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),M.box(M.types.esds,M.esds(X)))},M.mp3=function(X){var r=X.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,X.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},M.stsd=function(X){return X.type==="audio"?!X.isAAC&&X.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(X)):M.box(M.types.stsd,M.STSD,M.mp4a(X)):M.box(M.types.stsd,M.STSD,M.avc1(X))},M.tkhd=function(X){var r=X.id,A=X.duration*X.timescale,m=X.width,f=X.height,p=Math.floor(A/(Z+1)),a=Math.floor(A%(Z+1));return M.box(M.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,p>>24,p>>16&255,p>>8&255,p&255,a>>24,a>>16&255,a>>8&255,a&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,m>>8&255,m&255,0,0,f>>8&255,f&255,0,0]))},M.traf=function(X,r){var A=M.sdtp(X),m=X.id,f=Math.floor(r/(Z+1)),p=Math.floor(r%(Z+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,p>>24,p>>16&255,p>>8&255,p&255])),M.trun(X,A.length+16+20+8+16+8+8),A)},M.trak=function(X){return X.duration=X.duration||4294967295,M.box(M.types.trak,M.tkhd(X),M.mdia(X))},M.trex=function(X){var r=X.id;return M.box(M.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]))},M.trun=function(X,r){var A=X.samples||[],m=A.length,f=12+16*m,p=new Uint8Array(f),a,c,s,i,t,u;for(r+=8+f,p.set([0,0,15,1,m>>>24&255,m>>>16&255,m>>>8&255,m&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),a=0;a<m;a++)c=A[a],s=c.duration,i=c.size,t=c.flags,u=c.cts,p.set([s>>>24&255,s>>>16&255,s>>>8&255,s&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&240<<8,t.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*a);return M.box(M.types.trun,p)},M.initSegment=function(X){M.types||M.init();var r=M.moov(X),A=new Uint8Array(M.FTYP.byteLength+r.byteLength);return A.set(M.FTYP),A.set(r,M.FTYP.byteLength),A},M}();G.types=void 0,G.HDLR_TYPES=void 0,G.STTS=void 0,G.STSC=void 0,G.STCO=void 0,G.STSZ=void 0,G.VMHD=void 0,G.SMHD=void 0,G.STSD=void 0,G.FTYP=void 0,G.DINF=void 0,Q.default=G},"./src/remux/mp4-remuxer.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return u}),U.d(Q,"normalizePts",function(){return o});var Z=U("./src/polyfills/number.ts"),G=U("./src/remux/aac-helper.ts"),M=U("./src/remux/mp4-generator.ts"),Y=U("./src/events.ts"),X=U("./src/errors.ts"),r=U("./src/utils/logger.ts"),A=U("./src/types/loader.ts"),m=U("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(D){for(var I=1;I<arguments.length;I++){var E=arguments[I];for(var x in E)Object.prototype.hasOwnProperty.call(E,x)&&(D[x]=E[x])}return D},f.apply(this,arguments)}var p=10*1e3,a=1024,c=1152,s=null,i=null,t=!1,u=function(){function D(E,x,g,h){if(h===void 0&&(h=""),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=E,this.config=x,this.typeSupported=g,this.ISGenerated=!1,s===null){var O=navigator.userAgent||"",w=O.match(/Chrome\/(\d+)/i);s=w?parseInt(w[1]):0}if(i===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);i=b?parseInt(b[1]):0}t=!!s&&s<75||!!i&&i<600}var I=D.prototype;return I.destroy=function(){},I.resetTimeStamp=function(x){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=x},I.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},I.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},I.getVideoStartPts=function(x){var g=!1,h=x.reduce(function(O,w){var b=w.pts-O;return b<-4294967296?(g=!0,o(O,w.pts)):b>0?O:w.pts},x[0].pts);return g&&r.logger.debug("PTS rollover detected"),h},I.remux=function(x,g,h,O,w,b,W,j){var C,B,k,y,H,J,se=w,fe=w,ve=x.pid>-1,Se=g.pid>-1,Ue=g.samples.length,Te=x.samples.length>0,Ie=Ue>1,be=(!ve||Te)&&(!Se||Ie)||this.ISGenerated||W;if(be){this.ISGenerated||(k=this.generateIS(x,g,w));var q=this.isVideoContiguous,_=-1;if(Ie&&(_=R(g.samples),!q&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,_>0){r.logger.warn("[mp4-remuxer]: Dropped "+_+" out of "+Ue+" video samples due to a missing keyframe");var L=this.getVideoStartPts(g.samples);g.samples=g.samples.slice(_),g.dropped+=_,fe+=(g.samples[0].pts-L)/(g.timescale||9e4)}else _===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ue+" video samples"),J=!1);if(this.ISGenerated){if(Te&&Ie){var z=this.getVideoStartPts(g.samples),ee=o(x.samples[0].pts,z)-z,$=ee/g.inputTimeScale;se+=Math.max(0,$),fe+=Math.max(0,-$)}if(Te){if(x.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),k=this.generateIS(x,g,w)),B=this.remuxAudio(x,se,this.isAudioContiguous,b,Se||Ie||j===A.PlaylistLevelType.AUDIO?fe:void 0),Ie){var Ee=B?B.endPTS-B.startPTS:0;g.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),k=this.generateIS(x,g,w)),C=this.remuxVideo(g,fe,q,Ee)}}else Ie&&(C=this.remuxVideo(g,fe,q,0));C&&(C.firstKeyFrame=_,C.independent=_!==-1)}}return this.ISGenerated&&(h.samples.length&&(H=this.remuxID3(h,w)),O.samples.length&&(y=this.remuxText(O,w))),{audio:B,video:C,initSegment:k,independent:J,text:y,id3:H}},I.generateIS=function(x,g,h){var O=x.samples,w=g.samples,b=this.typeSupported,W={},j=!Object(Z.isFiniteNumber)(this._initPTS),C="audio/mp4",B,k,y;if(j&&(B=k=Infinity),x.config&&O.length&&(x.timescale=x.samplerate,x.isAAC||(b.mpeg?(C="audio/mpeg",x.codec=""):b.mp3&&(x.codec="mp3")),W.audio={id:"audio",container:C,codec:x.codec,initSegment:!x.isAAC&&b.mpeg?new Uint8Array(0):M.default.initSegment([x]),metadata:{channelCount:x.channelCount}},j&&(y=x.inputTimeScale,B=k=O[0].pts-Math.round(y*h))),g.sps&&g.pps&&w.length&&(g.timescale=g.inputTimeScale,W.video={id:"main",container:"video/mp4",codec:g.codec,initSegment:M.default.initSegment([g]),metadata:{width:g.width,height:g.height}},j)){y=g.inputTimeScale;var H=this.getVideoStartPts(w),J=Math.round(y*h);k=Math.min(k,o(w[0].dts,H)-J),B=Math.min(B,H-J)}if(Object.keys(W).length)return this.ISGenerated=!0,j&&(this._initPTS=B,this._initDTS=k),{tracks:W,initPTS:B,timescale:y}},I.remuxVideo=function(x,g,h,O){var w=x.inputTimeScale,b=x.samples,W=[],j=b.length,C=this._initPTS,B=this.nextAvcDts,k=8,y,H,J,se=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,ve=0,Se=!1;if(!h||B===null){var Ue=g*w,Te=b[0].pts-o(b[0].dts,b[0].pts);B=Ue-Te}for(var Ie=0;Ie<j;Ie++){var be=b[Ie];if(be.pts=o(be.pts-C,B),be.dts=o(be.dts-C,B),be.dts>be.pts){var q=9e4*.2;ve=Math.max(Math.min(ve,be.pts-be.dts),-1*q)}be.dts<b[Ie>0?Ie-1:Ie].dts&&(Se=!0)}Se&&b.sort(function(ir,Jt){var cn=ir.dts-Jt.dts,rn=ir.pts-Jt.pts;return cn||rn}),H=b[0].dts,J=b[b.length-1].dts;var _=Math.round((J-H)/(j-1));if(ve<0){if(ve<_*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(m.toMsFromMpegTsClock)(-_,!0)+" ms");for(var L=ve,z=0;z<j;z++)b[z].dts=L=Math.max(L,b[z].pts-_),b[z].pts=Math.max(L,b[z].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(m.toMsFromMpegTsClock)(ve,!0)+" ms to overcome this issue");for(var ee=0;ee<j;ee++)b[ee].dts=b[ee].dts+ve}H=b[0].dts}if(h){var $=H-B,Ee=$>_,Be=$<-1;if(Ee||Be){Ee?r.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)($,!0)+" ms ("+$+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(-$,!0)+" ms ("+$+"dts) overlapping between fragments detected"),H=B;var nt=b[0].pts-$;b[0].dts=H,b[0].pts=nt,r.logger.log("Video: First PTS/DTS adjusted: "+Object(m.toMsFromMpegTsClock)(nt,!0)+"/"+Object(m.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(m.toMsFromMpegTsClock)($,!0)+" ms")}}t&&(H=Math.max(0,H));for(var we=0,Ne=0,Ye=0;Ye<j;Ye++){for(var Xe=b[Ye],ht=Xe.units,wt=ht.length,Bt=0,Wt=0;Wt<wt;Wt++)Bt+=ht[Wt].data.length;Ne+=Bt,we+=wt,Xe.length=Bt,Xe.dts=Math.max(Xe.dts,H),Xe.pts=Math.max(Xe.pts,Xe.dts,0),se=Math.min(Xe.pts,se),fe=Math.max(Xe.pts,fe)}J=b[j-1].dts;var an=Ne+4*we+8,Yt;try{Yt=new Uint8Array(an)}catch(ir){this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:X.ErrorTypes.MUX_ERROR,details:X.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:an,reason:"fail allocating video mdat "+an});return}var qe=new DataView(Yt.buffer);qe.setUint32(0,an),Yt.set(M.default.types.mdat,4);for(var Qe=0;Qe<j;Qe++){for(var bt=b[Qe],xt=bt.units,ye=0,ae=0,le=xt.length;ae<le;ae++){var me=xt[ae],Ce=me.data,de=me.data.byteLength;qe.setUint32(k,de),k+=4,Yt.set(Ce,k),k+=de,ye+=4+de}if(Qe<j-1)y=b[Qe+1].dts-bt.dts;else{var pe=this.config,De=bt.dts-b[Qe>0?Qe-1:Qe].dts;if(pe.stretchShortVideoTrack&&this.nextAudioPts!==null){var ue=Math.floor(pe.maxBufferHole*w),Me=(O?se+O*w:this.nextAudioPts)-bt.pts;Me>ue?(y=Me-De,y<0&&(y=De),r.logger.log("[mp4-remuxer]: It is approximately "+Me/90+" ms to the next segment; using duration "+y/90+" ms for the last video frame.")):y=De}else y=De}var We=Math.round(bt.pts-bt.dts);W.push(new T(bt.key,y,ye,We))}if(W.length&&s&&s<70){var lt=W[0].flags;lt.dependsOn=2,lt.isNonSync=0}console.assert(y!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=B=J+y,this.isVideoContiguous=!0;var Ct=M.default.moof(x.sequenceNumber++,H,f({},x,{samples:W})),Ot="video",Nt={data1:Ct,data2:Yt,startPTS:se/w,endPTS:(fe+y)/w,startDTS:H/w,endDTS:B/w,type:Ot,hasAudio:!1,hasVideo:!0,nb:W.length,dropped:x.dropped};return x.samples=[],x.dropped=0,console.assert(Yt.length,"MDAT length must not be zero"),Nt},I.remuxAudio=function(x,g,h,O,w){var b=x.inputTimeScale,W=x.samplerate?x.samplerate:b,j=b/W,C=x.isAAC?a:c,B=C*j,k=this._initPTS,y=!x.isAAC&&this.typeSupported.mpeg,H=[],J=x.samples,se=y?0:8,fe=this.nextAudioPts||-1,ve=g*b;if(this.isAudioContiguous=h=h||J.length&&fe>0&&(O&&Math.abs(ve-fe)<9e3||Math.abs(o(J[0].pts-k,ve)-fe)<20*B),J.forEach(function(Ce){Ce.pts=o(Ce.pts-k,ve)}),!h||fe<0){if(J=J.filter(function(Ce){return Ce.pts>=0}),!J.length)return;w===0?fe=0:O?fe=Math.max(0,ve):fe=J[0].pts}if(x.isAAC)for(var Se=w!==void 0,Ue=this.config.maxAudioFramesDrift,Te=0,Ie=fe;Te<J.length;Te++){var be=J[Te],q=be.pts,_=q-Ie,L=Math.abs(1e3*_/b);if(_<=-Ue*B&&Se)Te===0&&(r.logger.warn("Audio frame @ "+(q/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*_/b)+" ms."),this.nextAudioPts=fe=Ie=q);else if(_>=Ue*B&&L<p&&Se){var z=Math.round(_/B);Ie=q-z*B,Ie<0&&(z--,Ie+=B),Te===0&&(this.nextAudioPts=fe=Ie),r.logger.warn("[mp4-remuxer]: Injecting "+z+" audio frame @ "+(Ie/b).toFixed(3)+"s due to "+Math.round(1e3*_/b)+" ms gap.");for(var ee=0;ee<z;ee++){var $=Math.max(Ie,0),Ee=G.default.getSilentFrame(x.manifestCodec||x.codec,x.channelCount);Ee||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ee=be.unit.subarray()),J.splice(Te,0,{unit:Ee,pts:$}),Ie+=B,Te++}}be.pts=Ie,Ie+=B}for(var Be=null,nt=null,we,Ne=0,Ye=J.length;Ye--;)Ne+=J[Ye].unit.byteLength;for(var Xe=0,ht=J.length;Xe<ht;Xe++){var wt=J[Xe],Bt=wt.unit,Wt=wt.pts;if(nt!==null){var an=H[Xe-1];an.duration=Math.round((Wt-nt)/j)}else if(h&&x.isAAC&&(Wt=fe),Be=Wt,Ne>0){Ne+=se;try{we=new Uint8Array(Ne)}catch(Ce){this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:X.ErrorTypes.MUX_ERROR,details:X.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ne,reason:"fail allocating audio mdat "+Ne});return}if(!y){var Yt=new DataView(we.buffer);Yt.setUint32(0,Ne),we.set(M.default.types.mdat,4)}}else return;we.set(Bt,se);var qe=Bt.byteLength;se+=qe,H.push(new T(!0,C,qe,0)),nt=Wt}var Qe=H.length;if(!Qe)return;var bt=H[H.length-1];this.nextAudioPts=fe=nt+j*bt.duration;var xt=y?new Uint8Array(0):M.default.moof(x.sequenceNumber++,Be/j,f({},x,{samples:H}));x.samples=[];var ye=Be/b,ae=fe/b,le="audio",me={data1:xt,data2:we,startPTS:ye,endPTS:ae,startDTS:ye,endDTS:ae,type:le,hasAudio:!0,hasVideo:!1,nb:Qe};return this.isAudioContiguous=!0,console.assert(we.length,"MDAT length must not be zero"),me},I.remuxEmptyAudio=function(x,g,h,O){var w=x.inputTimeScale,b=x.samplerate?x.samplerate:w,W=w/b,j=this.nextAudioPts,C=(j!==null?j:O.startDTS*w)+this._initDTS,B=O.endDTS*w+this._initDTS,k=W*a,y=Math.ceil((B-C)/k),H=G.default.getSilentFrame(x.manifestCodec||x.codec,x.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var J=[],se=0;se<y;se++){var fe=C+se*k;J.push({unit:H,pts:fe,dts:fe})}return x.samples=J,this.remuxAudio(x,g,h,!1)},I.remuxID3=function(x,g){var h=x.samples.length;if(!h)return;for(var O=x.inputTimeScale,w=this._initPTS,b=this._initDTS,W=0;W<h;W++){var j=x.samples[W];j.pts=o(j.pts-w,g*O)/O,j.dts=o(j.dts-b,g*O)/O}var C=x.samples;return x.samples=[],{samples:C}},I.remuxText=function(x,g){var h=x.samples.length;if(!h)return;for(var O=x.inputTimeScale,w=this._initPTS,b=0;b<h;b++){var W=x.samples[b];W.pts=o(W.pts-w,g*O)/O}x.samples.sort(function(C,B){return C.pts-B.pts});var j=x.samples;return x.samples=[],{samples:j}},D}();function o(D,I){var E;if(I===null)return D;for(I<D?E=-8589934592:E=8589934592;Math.abs(D-I)>4294967296;)D+=E;return D}function R(D){for(var I=0;I<D.length;I++)if(D[I].key)return I;return-1}var T=function(I,E,x,g){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=E,this.size=x,this.cts=g,this.flags=new S(I)},S=function(I){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=I?2:1,this.isNonSync=I?0:1}},"./src/remux/passthrough-remuxer.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/polyfills/number.ts"),G=U("./src/utils/mp4-tools.ts"),M=U("./src/loader/fragment.ts"),Y=U("./src/utils/logger.ts"),X=function(){function m(){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 f=m.prototype;return f.destroy=function(){},f.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(a,c,s){this.audioCodec=c,this.videoCodec=s,this.generateInitSegment(a),this.emitInitSegment=!0},f.generateInitSegment=function(a){var c=this.audioCodec,s=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(G.parseInitSegment)(a);c||(c=A(i.audio,M.ElementaryStreamTypes.AUDIO)),s||(s=A(i.video,M.ElementaryStreamTypes.VIDEO));var t={};i.audio&&i.video?t.audiovideo={container:"video/mp4",codec:c+","+s,initSegment:a,id:"main"}:i.audio?t.audio={container:"audio/mp4",codec:c,initSegment:a,id:"audio"}:i.video?t.video={container:"video/mp4",codec:s,initSegment:a,id:"main"}:Y.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},f.remux=function(a,c,s,i,t){var u=this.initPTS,o=this.lastEndDTS,R={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};Object(Z.isFiniteNumber)(o)||(o=this.lastEndDTS=t||0);var T=c.samples;if(!T||!T.length)return R;var S={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(T),D=this.initData),!D||!D.length)return Y.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(Z.isFiniteNumber)(u)||(this.initPTS=S.initPTS=u=r(D,T,o));var I=Object(G.getDuration)(T,D),E=o,x=I+E;Object(G.offsetStartDTS)(D,T,u),I>0?this.lastEndDTS=x:(Y.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var g=!!D.audio,h=!!D.video,O="";g&&(O+="audio"),h&&(O+="video");var w={data1:T,startPTS:E,startDTS:E,endPTS:x,endDTS:x,type:O,hasAudio:g,hasVideo:h,nb:1,dropped:0};return R.audio=w.type==="audio"?w:void 0,R.video=w.type!=="audio"?w:void 0,R.text=i,R.id3=s,R.initSegment=S,R},m}(),r=function(f,p,a){return Object(G.getStartDTS)(f,p)-a};function A(m,f){var p=m==null?void 0:m.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||f===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Q.default=X},"./src/task-loop.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return Z});var Z=function(){function G(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=G.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(X){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,X),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},G}()},"./src/types/cmcd.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"CMCDVersion",function(){return Z}),U.d(Q,"CMCDObjectType",function(){return G}),U.d(Q,"CMCDStreamingFormat",function(){return M}),U.d(Q,"CMCDStreamType",function(){return Y});var Z=1,G;(function(X){X.MANIFEST="m",X.AUDIO="a",X.VIDEO="v",X.MUXED="av",X.INIT="i",X.CAPTION="c",X.TIMED_TEXT="tt",X.KEY="k",X.OTHER="o"})(G||(G={}));var M;(function(X){X.DASH="d",X.HLS="h",X.SMOOTH="s",X.OTHER="o"})(M||(M={}));var Y;(function(X){X.VOD="v",X.LIVE="l"})(Y||(Y={}))},"./src/types/level.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"HlsSkip",function(){return M}),U.d(Q,"getSkipValue",function(){return Y}),U.d(Q,"HlsUrlParameters",function(){return X}),U.d(Q,"Level",function(){return r});function Z(A,m){for(var f=0;f<m.length;f++){var p=m[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(A,p.key,p)}}function G(A,m,f){return m&&Z(A.prototype,m),f&&Z(A,f),A}var M;(function(A){A.No="",A.Yes="YES",A.v2="v2"})(M||(M={}));function Y(A,m){var f=A.canSkipUntil,p=A.canSkipDateRanges,a=A.endSN,c=m!==void 0?m-a:0;return f&&c<f?p?M.v2:M.Yes:M.No}var X=function(){function A(f,p,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=p,this.skip=a}var m=A.prototype;return m.addDirectives=function(p){var a=new self.URL(p);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},A}(),r=function(){function A(m){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=[m.url],this.attrs=m.attrs,this.bitrate=m.bitrate,m.details&&(this.details=m.details),this.id=m.id||0,this.name=m.name,this.width=m.width||0,this.height=m.height||0,this.audioCodec=m.audioCodec,this.videoCodec=m.videoCodec,this.unknownCodecs=m.unknownCodecs,this.codecSet=[m.videoCodec,m.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return G(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(f){var p=f%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),A}()},"./src/types/loader.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"PlaylistContextType",function(){return Z}),U.d(Q,"PlaylistLevelType",function(){return G});var Z;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(Z||(Z={}));var G;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(G||(G={}))},"./src/types/transmuxer.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"ChunkMetadata",function(){return Z});var Z=function(Y,X,r,A,m,f){A===void 0&&(A=0),m===void 0&&(m=-1),f===void 0&&(f=!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=G(),this.buffering={audio:G(),video:G(),audiovideo:G()},this.level=Y,this.sn=X,this.id=r,this.size=A,this.part=m,this.partial=f};function G(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"AttrList",function(){return M});var Z=/^(\d+)x(\d+)$/,G=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function Y(r){typeof r=="string"&&(r=Y.parseAttrList(r));for(var A in r)r.hasOwnProperty(A)&&(this[A]=r[A])}var X=Y.prototype;return X.decimalInteger=function(A){var m=parseInt(this[A],10);return m>Number.MAX_SAFE_INTEGER?Infinity:m},X.hexadecimalInteger=function(A){if(this[A]){var m=(this[A]||"0x").slice(2);m=(m.length&1?"0":"")+m;for(var f=new Uint8Array(m.length/2),p=0;p<m.length/2;p++)f[p]=parseInt(m.slice(p*2,p*2+2),16);return f}else return null},X.hexadecimalIntegerAsNumber=function(A){var m=parseInt(this[A],16);return m>Number.MAX_SAFE_INTEGER?Infinity:m},X.decimalFloatingPoint=function(A){return parseFloat(this[A])},X.optionalFloat=function(A,m){var f=this[A];return f?parseFloat(f):m},X.enumeratedString=function(A){return this[A]},X.bool=function(A){return this[A]==="YES"},X.decimalResolution=function(A){var m=Z.exec(this[A]);return m===null?void 0:{width:parseInt(m[1],10),height:parseInt(m[2],10)}},Y.parseAttrList=function(A){var m,f={},p='"';for(G.lastIndex=0;(m=G.exec(A))!==null;){var a=m[2];a.indexOf(p)===0&&a.lastIndexOf(p)===a.length-1&&(a=a.slice(1,-1)),f[m[1]]=a}return f},Y}()},"./src/utils/binary-search.ts":function(ne,Q,U){"use strict";U.r(Q);var Z={search:function(M,Y){for(var X=0,r=M.length-1,A=null,m=null;X<=r;){A=(X+r)/2|0,m=M[A];var f=Y(m);if(f>0)X=A+1;else if(f<0)r=A-1;else return m}return null}};Q.default=Z},"./src/utils/buffer-helper.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"BufferHelper",function(){return M});var Z=U("./src/utils/logger.ts"),G={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function Y(){}return Y.isBuffered=function(r,A){try{if(r){for(var m=Y.getBuffered(r),f=0;f<m.length;f++)if(A>=m.start(f)&&A<=m.end(f))return!0}}catch(p){}return!1},Y.bufferInfo=function(r,A,m){try{if(r){var f=Y.getBuffered(r),p=[],a;for(a=0;a<f.length;a++)p.push({start:f.start(a),end:f.end(a)});return this.bufferedInfo(p,A,m)}}catch(c){}return{len:0,start:A,end:A,nextStart:void 0}},Y.bufferedInfo=function(r,A,m){A=Math.max(0,A),r.sort(function(S,D){var I=S.start-D.start;return I||D.end-S.end});var f=[];if(m)for(var p=0;p<r.length;p++){var a=f.length;if(a){var c=f[a-1].end;r[p].start-c<m?r[p].end>c&&(f[a-1].end=r[p].end):f.push(r[p])}else f.push(r[p])}else f=r;for(var s=0,i,t=A,u=A,o=0;o<f.length;o++){var R=f[o].start,T=f[o].end;if(A+m>=R&&A<T)t=R,u=T,s=u-A;else if(A+m<R){i=R;break}}return{len:s,start:t||0,end:u||0,nextStart:i}},Y.getBuffered=function(r){try{return r.buffered}catch(A){return Z.logger.log("failed to get media.buffered",A),G}},Y}()},"./src/utils/cea-608-parser.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"Row",function(){return u}),U.d(Q,"CaptionScreen",function(){return o});var Z=U("./src/utils/logger.ts"),G={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},M=function(x){var g=x;return G.hasOwnProperty(x)&&(g=G[x]),String.fromCharCode(g)},Y=15,X=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},m={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(E){E[E.ERROR=0]="ERROR",E[E.TEXT=1]="TEXT",E[E.WARNING=2]="WARNING",E[E.INFO=2]="INFO",E[E.DEBUG=3]="DEBUG",E[E.DATA=3]="DATA"})(a||(a={}));var c=function(){function E(){this.time=null,this.verboseLevel=a.ERROR}var x=E.prototype;return x.log=function(h,O){this.verboseLevel>=h&&Z.logger.log(this.time+" ["+h+"] "+O)},E}(),s=function(x){for(var g=[],h=0;h<x.length;h++)g.push(x[h].toString(16));return g},i=function(){function E(g,h,O,w,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=g||"white",this.underline=h||!1,this.italics=O||!1,this.background=w||"black",this.flash=b||!1}var x=E.prototype;return x.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},x.setStyles=function(h){for(var O=["foreground","underline","italics","background","flash"],w=0;w<O.length;w++){var b=O[w];h.hasOwnProperty(b)&&(this[b]=h[b])}},x.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},x.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},x.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},x.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},E}(),t=function(){function E(g,h,O,w,b,W){this.uchar=void 0,this.penState=void 0,this.uchar=g||" ",this.penState=new i(h,O,w,b,W)}var x=E.prototype;return x.reset=function(){this.uchar=" ",this.penState.reset()},x.setChar=function(h,O){this.uchar=h,this.penState.copy(O)},x.setPenState=function(h){this.penState.copy(h)},x.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},x.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},x.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},E}(),u=function(){function E(g){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var h=0;h<X;h++)this.chars.push(new t);this.logger=g,this.pos=0,this.currPenState=new i}var x=E.prototype;return x.equals=function(h){for(var O=!0,w=0;w<X;w++)if(!this.chars[w].equals(h.chars[w])){O=!1;break}return O},x.copy=function(h){for(var O=0;O<X;O++)this.chars[O].copy(h.chars[O])},x.isEmpty=function(){for(var h=!0,O=0;O<X;O++)if(!this.chars[O].isEmpty()){h=!1;break}return h},x.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>X&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=X)},x.moveCursor=function(h){var O=this.pos+h;if(h>1)for(var w=this.pos+1;w<O+1;w++)this.chars[w].setPenState(this.currPenState);this.setCursor(O)},x.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},x.insertChar=function(h){h>=144&&this.backSpace();var O=M(h);if(this.pos>=X){this.logger.log(a.ERROR,"Cannot insert "+h.toString(16)+" ("+O+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(O,this.currPenState),this.moveCursor(1)},x.clearFromPos=function(h){var O;for(O=h;O<X;O++)this.chars[O].reset()},x.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},x.clearToEndOfRow=function(){this.clearFromPos(this.pos)},x.getTextString=function(){for(var h=[],O=!0,w=0;w<X;w++){var b=this.chars[w].uchar;b!==" "&&(O=!1),h.push(b)}return O?"":h.join("")},x.setPenStyles=function(h){this.currPenState.setStyles(h);var O=this.chars[this.pos];O.setPenState(this.currPenState)},E}(),o=function(){function E(g){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var h=0;h<Y;h++)this.rows.push(new u(g));this.logger=g,this.currRow=Y-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var x=E.prototype;return x.reset=function(){for(var h=0;h<Y;h++)this.rows[h].clear();this.currRow=Y-1},x.equals=function(h){for(var O=!0,w=0;w<Y;w++)if(!this.rows[w].equals(h.rows[w])){O=!1;break}return O},x.copy=function(h){for(var O=0;O<Y;O++)this.rows[O].copy(h.rows[O])},x.isEmpty=function(){for(var h=!0,O=0;O<Y;O++)if(!this.rows[O].isEmpty()){h=!1;break}return h},x.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},x.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},x.insertChar=function(h){var O=this.rows[this.currRow];O.insertChar(h)},x.setPen=function(h){var O=this.rows[this.currRow];O.setPenStyles(h)},x.moveCursor=function(h){var O=this.rows[this.currRow];O.moveCursor(h)},x.setCursor=function(h){this.logger.log(a.INFO,"setCursor: "+h);var O=this.rows[this.currRow];O.setCursor(h)},x.setPAC=function(h){this.logger.log(a.INFO,"pacData = "+JSON.stringify(h));var O=h.row-1;if(this.nrRollUpRows&&O<this.nrRollUpRows-1&&(O=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==O){for(var w=0;w<Y;w++)this.rows[w].clear();var b=this.currRow+1-this.nrRollUpRows,W=this.lastOutputScreen;if(W){var j=W.rows[b].cueStartTime,C=this.logger.time;if(j&&C!==null&&j<C)for(var B=0;B<this.nrRollUpRows;B++)this.rows[O-this.nrRollUpRows+B+1].copy(W.rows[b+B])}}this.currRow=O;var k=this.rows[this.currRow];if(h.indent!==null){var y=h.indent,H=Math.max(y-1,0);k.setCursor(h.indent),h.color=k.chars[H].penState.foreground}var J={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(J)},x.setBkgData=function(h){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},x.setRollUpRows=function(h){this.nrRollUpRows=h},x.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,O=this.rows.splice(h,1)[0];O.clear(),this.rows.splice(this.currRow,0,O),this.logger.log(a.INFO,"Rolling up")},x.getDisplayText=function(h){h=h||!1;for(var O=[],w="",b=-1,W=0;W<Y;W++){var j=this.rows[W].getTextString();j&&(b=W+1,h?O.push("Row "+b+": '"+j+"'"):O.push(j.trim()))}return O.length>0&&(h?w="["+O.join(" | ")+"]":w=O.join(`
`)),w},x.getTextAndFormat=function(){return this.rows},E}(),R=function(){function E(g,h,O){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=g,this.outputFilter=h,this.mode=null,this.verbose=0,this.displayedMemory=new o(O),this.nonDisplayedMemory=new o(O),this.lastOutputScreen=new o(O),this.currRollUpRow=this.displayedMemory.rows[Y-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=O}var x=E.prototype;return x.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Y-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},x.getHandler=function(){return this.outputFilter},x.setHandler=function(h){this.outputFilter=h},x.setPAC=function(h){this.writeScreen.setPAC(h)},x.setBkgData=function(h){this.writeScreen.setBkgData(h)},x.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(a.INFO,"MODE="+h),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=h},x.insertChars=function(h){for(var O=0;O<h.length;O++)this.writeScreen.insertChar(h[O]);var w=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,w+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},x.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},x.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},x.ccAOF=function(){},x.ccAON=function(){},x.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},x.ccRU=function(h){this.logger.log(a.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},x.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},x.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},x.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},x.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},x.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},x.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},x.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},x.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},x.ccTO=function(h){this.logger.log(a.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},x.ccMIDROW=function(h){var O={flash:!1};if(O.underline=h%2===1,O.italics=h>=46,O.italics)O.foreground="white";else{var w=Math.floor(h/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];O.foreground=b[w]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(O)),this.writeScreen.setPen(O)},x.outputDataUpdate=function(h){h===void 0&&(h=!1);var O=this.logger.time;if(O===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=O:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,O,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:O),this.lastOutputScreen.copy(this.displayedMemory))},x.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},E}(),T=function(){function E(g,h,O){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var w=new c;this.channels=[null,new R(g,h,w),new R(g+1,O,w)],this.cmdHistory=I(),this.logger=w}var x=E.prototype;return x.getHandler=function(h){return this.channels[h].getHandler()},x.setHandler=function(h,O){this.channels[h].setHandler(O)},x.addData=function(h,O){var w,b,W,j=!1;this.logger.time=h;for(var C=0;C<O.length;C+=2){if(b=O[C]&127,W=O[C+1]&127,b===0&&W===0)continue;if(this.logger.log(a.DATA,"["+s([O[C],O[C+1]])+"] -> ("+s([b,W])+")"),w=this.parseCmd(b,W),w||(w=this.parseMidrow(b,W)),w||(w=this.parsePAC(b,W)),w||(w=this.parseBackgroundAttributes(b,W)),!w&&(j=this.parseChars(b,W),j)){var B=this.currentChannel;if(B&&B>0){var k=this.channels[B];k.insertChars(j)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!w&&!j&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+s([b,W])+" orig: "+s([O[C],O[C+1]]))}},x.parseCmd=function(h,O){var w=this.cmdHistory,b=(h===20||h===28||h===21||h===29)&&O>=32&&O<=47,W=(h===23||h===31)&&O>=33&&O<=35;if(!(b||W))return!1;if(D(h,O,w))return S(null,null,w),this.logger.log(a.DEBUG,"Repeated command ("+s([h,O])+") is dropped"),!0;var j=h===20||h===21||h===23?1:2,C=this.channels[j];return h===20||h===21||h===28||h===29?O===32?C.ccRCL():O===33?C.ccBS():O===34?C.ccAOF():O===35?C.ccAON():O===36?C.ccDER():O===37?C.ccRU(2):O===38?C.ccRU(3):O===39?C.ccRU(4):O===40?C.ccFON():O===41?C.ccRDC():O===42?C.ccTR():O===43?C.ccRTD():O===44?C.ccEDM():O===45?C.ccCR():O===46?C.ccENM():O===47&&C.ccEOC():C.ccTO(O-32),S(h,O,w),this.currentChannel=j,!0},x.parseMidrow=function(h,O){var w=0;if((h===17||h===25)&&O>=32&&O<=47){if(h===17?w=1:w=2,w!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[w];return b?(b.ccMIDROW(O),this.logger.log(a.DEBUG,"MIDROW ("+s([h,O])+")"),!0):!1}return!1},x.parsePAC=function(h,O){var w,b=this.cmdHistory,W=(h>=17&&h<=23||h>=25&&h<=31)&&O>=64&&O<=127,j=(h===16||h===24)&&O>=64&&O<=95;if(!(W||j))return!1;if(D(h,O,b))return S(null,null,b),!0;var C=h<=23?1:2;O>=64&&O<=95?w=C===1?r[h]:m[h]:w=C===1?A[h]:f[h];var B=this.channels[C];return B?(B.setPAC(this.interpretPAC(w,O)),S(h,O,b),this.currentChannel=C,!0):!1},x.interpretPAC=function(h,O){var w,b={color:null,italics:!1,indent:null,underline:!1,row:h};return O>95?w=O-96:w=O-64,b.underline=(w&1)===1,w<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(w/2)]:w<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((w-16)/2)*4,b},x.parseChars=function(h,O){var w,b=null,W=null;if(h>=25?(w=2,W=h-8):(w=1,W=h),W>=17&&W<=19){var j;W===17?j=O+80:W===18?j=O+112:j=O+144,this.logger.log(a.INFO,"Special char '"+M(j)+"' in channel "+w),b=[j]}else h>=32&&h<=127&&(b=O===0?[h]:[h,O]);if(b){var C=s(b);this.logger.log(a.DEBUG,"Char codes = "+C.join(",")),S(h,O,this.cmdHistory)}return b},x.parseBackgroundAttributes=function(h,O){var w=(h===16||h===24)&&O>=32&&O<=47,b=(h===23||h===31)&&O>=45&&O<=47;if(!(w||b))return!1;var W,j={};h===16||h===24?(W=Math.floor((O-32)/2),j.background=p[W],O%2===1&&(j.background=j.background+"_semi")):O===45?j.background="transparent":(j.foreground="black",O===47&&(j.underline=!0));var C=h<=23?1:2,B=this.channels[C];return B.setBkgData(j),S(h,O,this.cmdHistory),!0},x.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var O=this.channels[h];O&&O.reset()}this.cmdHistory=I()},x.cueSplitAtTime=function(h){for(var O=0;O<this.channels.length;O++){var w=this.channels[O];w&&w.cueSplitAtTime(h)}},E}();function S(E,x,g){g.a=E,g.b=x}function D(E,x,g){return g.a===E&&g.b===x}function I(){return{a:null,b:null}}Q.default=T},"./src/utils/codecs.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"isCodecType",function(){return G}),U.d(Q,"isCodecSupportedInMp4",function(){return M});var Z={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 G(Y,X){var r=Z[X];return!!r&&r[Y.slice(0,4)]===!0}function M(Y,X){return MediaSource.isTypeSupported((X||"video")+'/mp4;codecs="'+Y+'"')}},"./src/utils/cues.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/utils/vttparser.ts"),G=U("./src/utils/webvtt-parser.ts"),M=U("./src/utils/texttrack-utils.ts"),Y=/\s/,X={newCue:function(A,m,f,p){for(var a=[],c,s,i,t,u,o=self.VTTCue||self.TextTrackCue,R=0;R<p.rows.length;R++)if(c=p.rows[R],i=!0,t=0,u="",!c.isEmpty()){for(var T=0;T<c.chars.length;T++)Y.test(c.chars[T].uchar)&&i?t++:(u+=c.chars[T].uchar,i=!1);c.cueStartTime=m,m===f&&(f+=1e-4),t>=16?t--:t++;var S=Object(Z.fixLineBreaks)(u.trim()),D=Object(G.generateCueId)(m,f,S);(!A||!A.cues||!A.cues.getCueById(D))&&(s=new o(m,f,S),s.id=D,s.line=R+1,s.align="left",s.position=10+Math.min(80,Math.floor(t*8/32)*10),a.push(s))}return A&&a.length&&(a.sort(function(I,E){return I.line==="auto"||E.line==="auto"?0:I.line>8&&E.line>8?E.line-I.line:I.line-E.line}),a.forEach(function(I){return Object(M.addCueToTrack)(A,I)})),a}};Q.default=X},"./src/utils/discontinuities.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"findFirstFragWithCC",function(){return Y}),U.d(Q,"shouldAlignOnDiscontinuities",function(){return X}),U.d(Q,"findDiscontinuousReferenceFrag",function(){return r}),U.d(Q,"adjustSlidingStart",function(){return m}),U.d(Q,"alignStream",function(){return f}),U.d(Q,"alignPDT",function(){return a}),U.d(Q,"alignFragmentByPDTDelta",function(){return c}),U.d(Q,"alignMediaPlaylistByPDT",function(){return s});var Z=U("./src/polyfills/number.ts"),G=U("./src/utils/logger.ts"),M=U("./src/controller/level-helper.ts");function Y(i,t){for(var u=null,o=0,R=i.length;o<R;o++){var T=i[o];if(T&&T.cc===t){u=T;break}}return u}function X(i,t,u){return!!(t.details&&(u.endCC>u.startCC||i&&i.cc<u.startCC))}function r(i,t){var u=i.fragments,o=t.fragments;if(!o.length||!u.length){G.logger.log("No fragments to align");return}var R=Y(u,o[0].cc);if(!R||R&&!R.startPTS){G.logger.log("No frag in previous level to align on");return}return R}function A(i,t){if(i){var u=i.start+t;i.start=i.startPTS=u,i.endPTS=u+i.duration}}function m(i,t){for(var u=t.fragments,o=0,R=u.length;o<R;o++)A(u[o],i);t.fragmentHint&&A(t.fragmentHint,i),t.alignedSliding=!0}function f(i,t,u){if(!t)return;p(i,u,t),!u.alignedSliding&&t.details&&a(u,t.details),!u.alignedSliding&&t.details&&!u.skippedSegments&&Object(M.adjustSliding)(t.details,u)}function p(i,t,u){if(X(i,u,t)){var o=r(u.details,t);o&&Object(Z.isFiniteNumber)(o.start)&&(G.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),m(o.start,t))}}function a(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var u=t.fragments[0].programDateTime,o=i.fragments[0].programDateTime,R=(o-u)/1e3+t.fragments[0].start;R&&Object(Z.isFiniteNumber)(R)&&(G.logger.log("Adjusting PTS using programDateTime delta "+(o-u)+"ms, sliding:"+R.toFixed(3)+" "+i.url+" "),m(R,i))}function c(i,t){var u=i.programDateTime;if(!u)return;var o=(u-t)/1e3;i.start=i.startPTS=o,i.endPTS=o+i.duration}function s(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var u=t.fragments[0].programDateTime,o=t.fragments[0].start,R=u-o*1e3;i.fragments.forEach(function(T){c(T,R)}),i.fragmentHint&&c(i.fragmentHint,R),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/utils/ewma.ts"),G=function(){function M(X,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 Z.default(X),this.fast_=new Z.default(r)}var Y=M.prototype;return Y.update=function(r,A){var m=this.slow_,f=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new Z.default(r,m.getEstimate(),m.getTotalWeight())),this.fast_.halfLife!==A&&(this.fast_=new Z.default(A,f.getEstimate(),f.getTotalWeight()))},Y.sample=function(r,A){r=Math.max(r,this.minDelayMs_);var m=8*A,f=r/1e3,p=m/f;this.fast_.sample(f,p),this.slow_.sample(f,p)},Y.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},Y.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},Y.destroy=function(){},M}();Q.default=G},"./src/utils/ewma.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=function(){function G(Y,X,r){X===void 0&&(X=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=Y,this.alpha_=Y?Math.exp(Math.log(.5)/Y):0,this.estimate_=X,this.totalWeight_=r}var M=G.prototype;return M.sample=function(X,r){var A=Math.pow(this.alpha_,X);this.estimate_=r*(1-A)+A*this.estimate_,this.totalWeight_+=X},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var X=1-Math.pow(this.alpha_,this.totalWeight_);if(X)return this.estimate_/X}return this.estimate_},G}();Q.default=Z},"./src/utils/fetch-loader.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"fetchSupported",function(){return c});var Z=U("./src/polyfills/number.ts"),G=U("./src/loader/load-stats.ts"),M=U("./src/demux/chunk-cache.ts");function Y(o,R){o.prototype=Object.create(R.prototype),o.prototype.constructor=o,f(o,R)}function X(o){var R=typeof Map=="function"?new Map:void 0;return X=function(S){if(S===null||!m(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(S))return R.get(S);R.set(S,D)}function D(){return r(S,arguments,p(this).constructor)}return D.prototype=Object.create(S.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),f(D,S)},X(o)}function r(o,R,T){return A()?r=Reflect.construct:r=function(D,I,E){var x=[null];x.push.apply(x,I);var g=Function.bind.apply(D,x),h=new g;return E&&f(h,E.prototype),h},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(o){return!1}}function m(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function f(o,R){return f=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},f(o,R)}function p(o){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},p(o)}function a(){return a=Object.assign||function(o){for(var R=1;R<arguments.length;R++){var T=arguments[R];for(var S in T)Object.prototype.hasOwnProperty.call(T,S)&&(o[S]=T[S])}return o},a.apply(this,arguments)}function c(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}var s=function(){function o(T){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=T.fetchSetup||t,this.controller=new self.AbortController,this.stats=new G.LoadStats}var R=o.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(S,D,I){var E=this,x=this.stats;if(x.loading.start)throw new Error("Loader can only be used once.");x.loading.start=self.performance.now();var g=i(S,this.controller.signal),h=I.onProgress,O=S.responseType==="arraybuffer",w=O?"byteLength":"length";this.context=S,this.config=D,this.callbacks=I,this.request=this.fetchSetup(S,g),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){E.abortInternal(),I.onTimeout(x,S,E.response)},D.timeout),self.fetch(this.request).then(function(b){if(E.response=E.loader=b,!b.ok){var W=b.status,j=b.statusText;throw new u(j||"fetch, bad network response",W,b)}return x.loading.first=Math.max(self.performance.now(),x.loading.start),x.total=parseInt(b.headers.get("Content-Length")||"0"),h&&Object(Z.isFiniteNumber)(D.highWaterMark)?E.loadProgressively(b,x,S,D.highWaterMark,h):O?b.arrayBuffer():b.text()}).then(function(b){var W=E.response;self.clearTimeout(E.requestTimeout),x.loading.end=Math.max(self.performance.now(),x.loading.first),x.loaded=x.total=b[w];var j={url:W.url,data:b};h&&!Object(Z.isFiniteNumber)(D.highWaterMark)&&h(x,S,b,W),I.onSuccess(j,x,S,W)}).catch(function(b){if(self.clearTimeout(E.requestTimeout),x.aborted)return;var W=b.code||0;I.onError({code:W,text:b.message},S,b.details)})},R.getCacheAge=function(){var S=null;if(this.response){var D=this.response.headers.get("age");S=D?parseFloat(D):null}return S},R.loadProgressively=function(S,D,I,E,x){E===void 0&&(E=0);var g=new M.default,h=S.body.getReader(),O=function w(){return h.read().then(function(b){if(b.done)return g.dataLength&&x(D,I,g.flush(),S),Promise.resolve(new ArrayBuffer(0));var W=b.value,j=W.length;return D.loaded+=j,j<E||g.dataLength?(g.push(W),g.dataLength>=E&&x(D,I,g.flush(),S)):x(D,I,W,S),w()}).catch(function(){return Promise.reject()})};return O()},o}();function i(o,R){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(a({},o.headers))};return o.rangeEnd&&T.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),T}function t(o,R){return new self.Request(o.url,R)}var u=function(o){Y(R,o);function R(T,S,D){var I;return I=o.call(this,T)||this,I.code=void 0,I.details=void 0,I.code=S,I.details=D,I}return R}(X(Error));Q.default=s},"./src/utils/imsc1-ttml-parser.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"IMSC1_CODEC",function(){return m}),U.d(Q,"parseIMSC1",function(){return c});var Z=U("./src/utils/mp4-tools.ts"),G=U("./src/utils/vttparser.ts"),M=U("./src/utils/vttcue.ts"),Y=U("./src/demux/id3.ts"),X=U("./src/utils/timescale-conversion.ts"),r=U("./src/utils/webvtt-parser.ts");function A(){return A=Object.assign||function(E){for(var x=1;x<arguments.length;x++){var g=arguments[x];for(var h in g)Object.prototype.hasOwnProperty.call(g,h)&&(E[h]=g[h])}return E},A.apply(this,arguments)}var m="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function c(E,x,g,h,O){var w=Object(Z.findBox)(new Uint8Array(E),["mdat"]);if(w.length===0){O(new Error("Could not parse IMSC1 mdat"));return}var b=w[0],W=Object(Y.utf8ArrayToStr)(new Uint8Array(E,b.start,b.end-b.start)),j=Object(X.toTimescaleFromScale)(x,1,g);try{h(s(W,j))}catch(C){O(C)}}function s(E,x){var g=new DOMParser,h=g.parseFromString(E,"text/xml"),O=h.getElementsByTagName("tt")[0];if(!O)throw new Error("Invalid ttml");var w={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(w).reduce(function(k,y){return k[y]=O.getAttribute("ttp:"+y)||w[y],k},{}),W=O.getAttribute("xml:space")!=="preserve",j=t(i(O,"styling","style")),C=t(i(O,"layout","region")),B=i(O,"body","[begin]");return[].map.call(B,function(k){var y=u(k,W);if(!y||!k.hasAttribute("begin"))return null;var H=S(k.getAttribute("begin"),b),J=S(k.getAttribute("dur"),b),se=S(k.getAttribute("end"),b);if(H===null)throw T(k);if(se===null){if(J===null)throw T(k);se=H+J}var fe=new M.default(H-x,se-x,y);fe.id=Object(r.generateCueId)(fe.startTime,fe.endTime,fe.text);var ve=C[k.getAttribute("region")],Se=j[k.getAttribute("style")];fe.position=10,fe.size=80;var Ue=o(ve,Se),Te=Ue.textAlign;if(Te){var Ie=a[Te];Ie&&(fe.lineAlign=Ie),fe.align=Te}return A(fe,Ue),fe}).filter(function(k){return k!==null})}function i(E,x,g){var h=E.getElementsByTagName(x)[0];return h?[].slice.call(h.querySelectorAll(g)):[]}function t(E){return E.reduce(function(x,g){var h=g.getAttribute("xml:id");return h&&(x[h]=g),x},{})}function u(E,x){return[].slice.call(E.childNodes).reduce(function(g,h,O){var w;return h.nodeName==="br"&&O?g+`
`:(w=h.childNodes)!==null&&w!==void 0&&w.length?u(h,x):x?g+h.textContent.trim().replace(/\s+/g," "):g+h.textContent},"")}function o(E,x){var g="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(O,w){var b=R(x,g,w)||R(E,g,w);return b&&(O[w]=b),O},{})}function R(E,x,g){return E.hasAttributeNS(x,g)?E.getAttributeNS(x,g):null}function T(E){return new Error("Could not parse ttml timestamp "+E)}function S(E,x){if(!E)return null;var g=Object(G.parseTimeStamp)(E);return g===null&&(f.test(E)?g=D(E,x):p.test(E)&&(g=I(E,x))),g}function D(E,x){var g=f.exec(E),h=(g[4]|0)+(g[5]|0)/x.subFrameRate;return(g[1]|0)*3600+(g[2]|0)*60+(g[3]|0)+h/x.frameRate}function I(E,x){var g=p.exec(E),h=Number(g[1]),O=g[2];switch(O){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/x.frameRate;case"t":return h/x.tickRate}return h}},"./src/utils/logger.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"enableLogs",function(){return r}),U.d(Q,"logger",function(){return A});var Z=function(){},G={trace:Z,debug:Z,log:Z,warn:Z,info:Z,error:Z},M=G;function Y(m){var f=self.console[m];return f?f.bind(self.console,"["+m+"] >"):Z}function X(m){for(var f=arguments.length,p=new Array(f>1?f-1:0),a=1;a<f;a++)p[a-1]=arguments[a];p.forEach(function(c){M[c]=m[c]?m[c].bind(m):Y(c)})}function r(m){if(self.console&&m===!0||typeof m=="object"){X(m,"debug","log","info","warn","error");try{M.log()}catch(f){M=G}}else M=G}var A=M},"./src/utils/mediakeys-helper.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"KeySystems",function(){return Z}),U.d(Q,"requestMediaKeySystemAccess",function(){return G});var Z;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(Z||(Z={}));var G=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"getMediaSource",function(){return Z});function Z(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"bin2str",function(){return X}),U.d(Q,"readUint16",function(){return r}),U.d(Q,"readUint32",function(){return A}),U.d(Q,"writeUint32",function(){return m}),U.d(Q,"findBox",function(){return f}),U.d(Q,"parseSegmentIndex",function(){return p}),U.d(Q,"parseInitSegment",function(){return a}),U.d(Q,"getStartDTS",function(){return c}),U.d(Q,"getDuration",function(){return s}),U.d(Q,"computeRawDurationFromSamples",function(){return i}),U.d(Q,"offsetStartDTS",function(){return t}),U.d(Q,"segmentValidRange",function(){return u}),U.d(Q,"appendUint8Array",function(){return o});var Z=U("./src/utils/typed-array.ts"),G=U("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,Y=[].push;function X(R){return String.fromCharCode.apply(null,R)}function r(R,T){"data"in R&&(T+=R.start,R=R.data);var S=R[T]<<8|R[T+1];return S<0?65536+S:S}function A(R,T){"data"in R&&(T+=R.start,R=R.data);var S=R[T]<<24|R[T+1]<<16|R[T+2]<<8|R[T+3];return S<0?4294967296+S:S}function m(R,T,S){"data"in R&&(T+=R.start,R=R.data),R[T]=S>>24,R[T+1]=S>>16&255,R[T+2]=S>>8&255,R[T+3]=S&255}function f(R,T){var S=[];if(!T.length)return S;var D,I,E;"data"in R?(D=R.data,I=R.start,E=R.end):(D=R,I=0,E=D.byteLength);for(var x=I;x<E;){var g=A(D,x),h=X(D.subarray(x+4,x+8)),O=g>1?x+g:E;if(h===T[0])if(T.length===1)S.push({data:D,start:x+8,end:O});else{var w=f({data:D,start:x+8,end:O},T.slice(1));w.length&&Y.apply(S,w)}x=O}return S}function p(R){var T=f(R,["moov"]),S=T[0],D=S?S.end:null,I=f(R,["sidx"]);if(!I||!I[0])return null;var E=[],x=I[0],g=x.data[0],h=g===0?8:16,O=A(x,h);h+=4;var w=0,b=0;g===0?h+=8:h+=16,h+=2;var W=x.end+b,j=r(x,h);h+=2;for(var C=0;C<j;C++){var B=h,k=A(x,B);B+=4;var y=k&2147483647,H=(k&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var J=A(x,B);B+=4,E.push({referenceSize:y,subsegmentDuration:J,info:{duration:J/O,start:W,end:W+y-1}}),W+=y,B+=4,h=B}return{earliestPresentationTime:w,timescale:O,version:g,referencesCount:j,references:E,moovEndOffset:D}}function a(R){for(var T=[],S=f(R,["moov","trak"]),D=0;D<S.length;D++){var I=S[D],E=f(I,["tkhd"])[0];if(E){var x=E.data[E.start],g=x===0?12:20,h=A(E,g),O=f(I,["mdia","mdhd"])[0];if(O){x=O.data[O.start],g=x===0?12:20;var w=A(O,g),b=f(I,["mdia","hdlr"])[0];if(b){var W=X(b.data.subarray(b.start+8,b.start+12)),j={soun:G.ElementaryStreamTypes.AUDIO,vide:G.ElementaryStreamTypes.VIDEO}[W];if(j){var C=f(I,["mdia","minf","stbl","stsd"])[0],B=void 0;C&&(B=X(C.data.subarray(C.start+12,C.start+16))),T[h]={timescale:w,type:j},T[j]={timescale:w,id:h,codec:B}}}}}}var k=f(R,["moov","mvex","trex"]);return k.forEach(function(y){var H=A(y,4),J=T[H];J&&(J.default={duration:A(y,12),flags:A(y,20)})}),T}function c(R,T){return f(T,["moof","traf"]).reduce(function(S,D){var I=f(D,["tfdt"])[0],E=I.data[I.start],x=f(D,["tfhd"]).reduce(function(g,h){var O=A(h,4),w=R[O];if(w){var b=A(I,4);E===1&&(b*=Math.pow(2,32),b+=A(I,8));var W=w.timescale||9e4,j=b/W;if(isFinite(j)&&(g===null||j<g))return j}return g},null);return x!==null&&isFinite(x)&&(S===null||x<S)?x:S},null)||0}function s(R,T){for(var S=0,D=0,I=0,E=f(R,["moof","traf"]),x=0;x<E.length;x++){var g=E[x],h=f(g,["tfhd"])[0],O=A(h,4),w=T[O];if(!w)continue;var b=w.default,W=A(h,0)|(b==null?void 0:b.flags),j=b==null?void 0:b.duration;W&8&&(W&2?j=A(h,12):j=A(h,8));for(var C=w.timescale||9e4,B=f(g,["trun"]),k=0;k<B.length;k++){if(j){var y=A(B[k],4);S=j*y}else S=i(B[k]);w.type===G.ElementaryStreamTypes.VIDEO?D+=S/C:w.type===G.ElementaryStreamTypes.AUDIO&&(I+=S/C)}}if(D===0&&I===0){var H=p(R);if(H!=null&&H.references)return H.references.reduce(function(J,se){return J+se.info.duration||0},0)}return D||I}function i(R){var T=A(R,0),S=8;T&1&&(S+=4),T&4&&(S+=4);for(var D=0,I=A(R,4),E=0;E<I;E++){if(T&256){var x=A(R,S);D+=x,S+=4}T&512&&(S+=4),T&1024&&(S+=4),T&2048&&(S+=4)}return D}function t(R,T,S){f(T,["moof","traf"]).forEach(function(D){f(D,["tfhd"]).forEach(function(I){var E=A(I,4),x=R[E];if(!x)return;var g=x.timescale||9e4;f(D,["tfdt"]).forEach(function(h){var O=h.data[h.start],w=A(h,4);if(O===0)m(h,4,w-S*g);else{w*=Math.pow(2,32),w+=A(h,8),w-=S*g,w=Math.max(w,0);var b=Math.floor(w/(M+1)),W=Math.floor(w%(M+1));m(h,4,b),m(h,8,W)}})})})}function u(R){var T={valid:null,remainder:null},S=f(R,["moof"]);if(S){if(S.length<2)return T.remainder=R,T}else return T;var D=S[S.length-1];return T.valid=Object(Z.sliceUint8)(R,0,D.start-8),T.remainder=Object(Z.sliceUint8)(R,D.start-8),T}function o(R,T){var S=new Uint8Array(R.length+T.length);return S.set(R),S.set(T,R.length),S}},"./src/utils/output-filter.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return Z});var Z=function(){function G(Y,X){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=Y,this.trackName=X}var M=G.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(X,r,A){(this.startTime===null||this.startTime>X)&&(this.startTime=X),this.endTime=r,this.screen=A,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},G}()},"./src/utils/texttrack-utils.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"sendAddTrackEvent",function(){return G}),U.d(Q,"addCueToTrack",function(){return M}),U.d(Q,"clearCurrentCues",function(){return Y}),U.d(Q,"removeCuesInRange",function(){return X}),U.d(Q,"getCuesInRange",function(){return A});var Z=U("./src/utils/logger.ts");function G(m,f){var p;try{p=new Event("addtrack")}catch(a){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=m,f.dispatchEvent(p)}function M(m,f){var p=m.mode;if(p==="disabled"&&(m.mode="hidden"),m.cues&&!m.cues.getCueById(f.id))try{if(m.addCue(f),!m.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(c){Z.logger.debug("[texttrack-utils]: "+c);var a=new self.TextTrackCue(f.startTime,f.endTime,f.text);a.id=f.id,m.addCue(a)}p==="disabled"&&(m.mode=p)}function Y(m){var f=m.mode;if(f==="disabled"&&(m.mode="hidden"),m.cues)for(var p=m.cues.length;p--;)m.removeCue(m.cues[p]);f==="disabled"&&(m.mode=f)}function X(m,f,p){var a=m.mode;if(a==="disabled"&&(m.mode="hidden"),m.cues&&m.cues.length>0)for(var c=A(m.cues,f,p),s=0;s<c.length;s++)m.removeCue(c[s]);a==="disabled"&&(m.mode=a)}function r(m,f){if(f<m[0].startTime)return 0;var p=m.length-1;if(f>m[p].endTime)return-1;for(var a=0,c=p;a<=c;){var s=Math.floor((c+a)/2);if(f<m[s].startTime)c=s-1;else if(f>m[s].startTime&&a<p)a=s+1;else return s}return m[a].startTime-f<f-m[c].startTime?a:c}function A(m,f,p){var a=[],c=r(m,f);if(c>-1)for(var s=c,i=m.length;s<i;s++){var t=m[s];if(t.startTime>=f&&t.endTime<=p)a.push(t);else if(t.startTime>p)return a}return a}},"./src/utils/time-ranges.ts":function(ne,Q,U){"use strict";U.r(Q);var Z={toString:function(M){for(var Y="",X=M.length,r=0;r<X;r++)Y+="["+M.start(r).toFixed(3)+","+M.end(r).toFixed(3)+"]";return Y}};Q.default=Z},"./src/utils/timescale-conversion.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"toTimescaleFromBase",function(){return G}),U.d(Q,"toTimescaleFromScale",function(){return M}),U.d(Q,"toMsFromMpegTsClock",function(){return Y}),U.d(Q,"toMpegTsClockFromTimescale",function(){return X});var Z=9e4;function G(r,A,m,f){m===void 0&&(m=1),f===void 0&&(f=!1);var p=r*A*m;return f?Math.round(p):p}function M(r,A,m,f){return m===void 0&&(m=1),f===void 0&&(f=!1),G(r,A,1/m,f)}function Y(r,A){return A===void 0&&(A=!1),G(r,1e3,1/Z,A)}function X(r,A){return A===void 0&&(A=1),G(r,Z,1/A)}},"./src/utils/typed-array.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"sliceUint8",function(){return Z});function Z(G,M,Y){return Uint8Array.prototype.slice?G.slice(M,Y):new Uint8Array(Array.prototype.slice.call(G,M,Y))}},"./src/utils/vttcue.ts":function(ne,Q,U){"use strict";U.r(Q),Q.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Z=["","lr","rl"],G=["start","middle","end","left","right"];function M(m,f){if(typeof f!="string")return!1;if(!Array.isArray(m))return!1;var p=f.toLowerCase();return~m.indexOf(p)?p:!1}function Y(m){return M(Z,m)}function X(m){return M(G,m)}function r(m){for(var f=arguments.length,p=new Array(f>1?f-1:0),a=1;a<f;a++)p[a-1]=arguments[a];for(var c=1;c<arguments.length;c++){var s=arguments[c];for(var i in s)m[i]=s[i]}return m}function A(m,f,p){var a=this,c={enumerable:!0};a.hasBeenReset=!1;var s="",i=!1,t=m,u=f,o=p,R=null,T="",S=!0,D="auto",I="start",E=50,x="middle",g=50,h="middle";Object.defineProperty(a,"id",r({},c,{get:function(){return s},set:function(w){s=""+w}})),Object.defineProperty(a,"pauseOnExit",r({},c,{get:function(){return i},set:function(w){i=!!w}})),Object.defineProperty(a,"startTime",r({},c,{get:function(){return t},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");t=w,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",r({},c,{get:function(){return u},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");u=w,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",r({},c,{get:function(){return o},set:function(w){o=""+w,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",r({},c,{get:function(){return R},set:function(w){R=w,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",r({},c,{get:function(){return T},set:function(w){var b=Y(w);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",r({},c,{get:function(){return S},set:function(w){S=!!w,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",r({},c,{get:function(){return D},set:function(w){if(typeof w!="number"&&w!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=w,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",r({},c,{get:function(){return I},set:function(w){var b=X(w);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");I=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",r({},c,{get:function(){return E},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");E=w,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",r({},c,{get:function(){return x},set:function(w){var b=X(w);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");x=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",r({},c,{get:function(){return g},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");g=w,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",r({},c,{get:function(){return h},set:function(w){var b=X(w);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");h=b,this.hasBeenReset=!0}})),a.displayState=void 0}return A.prototype.getCueAsHTML=function(){var m=self.WebVTT;return m.convertCueToDOMTree(self,this.text)},A}()},"./src/utils/vttparser.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"parseTimeStamp",function(){return M}),U.d(Q,"fixLineBreaks",function(){return f}),U.d(Q,"VTTParser",function(){return p});var Z=U("./src/utils/vttcue.ts"),G=function(){function a(){}var c=a.prototype;return c.decode=function(i,t){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},a}();function M(a){function c(i,t,u,o){return(i|0)*3600+(t|0)*60+(u|0)+parseFloat(o||0)}var s=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?c(s[2],s[3],0,s[4]):c(s[1],s[2],s[3],s[4]):null}var Y=function(){function a(){this.values=Object.create(null)}var c=a.prototype;return c.set=function(i,t){!this.get(i)&&t!==""&&(this.values[i]=t)},c.get=function(i,t,u){return u?this.has(i)?this.values[i]:t[u]:this.has(i)?this.values[i]:t},c.has=function(i){return i in this.values},c.alt=function(i,t,u){for(var o=0;o<u.length;++o)if(t===u[o]){this.set(i,t);break}},c.integer=function(i,t){/^-?\d+$/.test(t)&&this.set(i,parseInt(t,10))},c.percent=function(i,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var u=parseFloat(t);if(u>=0&&u<=100)return this.set(i,u),!0}return!1},a}();function X(a,c,s,i){var t=i?a.split(i):[a];for(var u in t){if(typeof t[u]!="string")continue;var o=t[u].split(s);if(o.length!==2)continue;var R=o[0],T=o[1];c(R,T)}}var r=new Z.default(0,0,""),A=r.align==="middle"?"middle":"center";function m(a,c,s){var i=a;function t(){var R=M(a);if(R===null)throw new Error("Malformed timestamp: "+i);return a=a.replace(/^[^\sa-zA-Z-]+/,""),R}function u(R,T){var S=new Y;X(R,function(E,x){var g;switch(E){case"region":for(var h=s.length-1;h>=0;h--)if(s[h].id===x){S.set(E,s[h].region);break}break;case"vertical":S.alt(E,x,["rl","lr"]);break;case"line":g=x.split(","),S.integer(E,g[0]),S.percent(E,g[0])&&S.set("snapToLines",!1),S.alt(E,g[0],["auto"]),g.length===2&&S.alt("lineAlign",g[1],["start",A,"end"]);break;case"position":g=x.split(","),S.percent(E,g[0]),g.length===2&&S.alt("positionAlign",g[1],["start",A,"end","line-left","line-right","auto"]);break;case"size":S.percent(E,x);break;case"align":S.alt(E,x,["start",A,"end","left","right"]);break}},/:/,/\s/),T.region=S.get("region",null),T.vertical=S.get("vertical","");var D=S.get("line","auto");D==="auto"&&r.line===-1&&(D=-1),T.line=D,T.lineAlign=S.get("lineAlign","start"),T.snapToLines=S.get("snapToLines",!0),T.size=S.get("size",100),T.align=S.get("align",A);var I=S.get("position","auto");I==="auto"&&r.position===50&&(I=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.position=I}function o(){a=a.replace(/^\s+/,"")}if(o(),c.startTime=t(),o(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);a=a.substr(3),o(),c.endTime=t(),o(),u(a,c)}function f(a){return a.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new G,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var c=a.prototype;return c.parse=function(i){var t=this;i&&(t.buffer+=t.decoder.decode(i,{stream:!0}));function u(){var I=t.buffer,E=0;for(I=f(I);E<I.length&&I[E]!=="\r"&&I[E]!==`
`;)++E;var x=I.substr(0,E);return I[E]==="\r"&&++E,I[E]===`
`&&++E,t.buffer=I.substr(E),x}function o(I){X(I,function(E,x){},/:/)}try{var R="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;R=u();var T=R.match(/^()?WEBVTT([ \t].*)?$/);if(!T||!T[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var S=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;S?S=!1:R=u();switch(t.state){case"HEADER":/:/.test(R)?o(R):R||(t.state="ID");continue;case"NOTE":R||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){t.state="NOTE";break}if(!R)continue;if(t.cue=new Z.default(0,0,""),t.state="CUE",R.indexOf("-->")===-1){t.cue.id=R;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{m(R,t.cue,t.regionList)}catch(I){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var D=R.indexOf("-->")!==-1;if(!R||D&&(S=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
`),t.cue.text+=R}continue;case"BADCUE":R||(t.state="ID")}}}catch(I){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},c.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){i.onparsingerror&&i.onparsingerror(t)}return i.onflush&&i.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(ne,Q,U){"use strict";U.r(Q),U.d(Q,"generateCueId",function(){return p}),U.d(Q,"parseWebVTT",function(){return c});var Z=U("./src/polyfills/number.ts"),G=U("./src/utils/vttparser.ts"),M=U("./src/demux/id3.ts"),Y=U("./src/utils/timescale-conversion.ts"),X=U("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,A=function(i,t,u){return u===void 0&&(u=0),i.substr(u,t.length)===t},m=function(i){var t=parseInt(i.substr(-3)),u=parseInt(i.substr(-6,2)),o=parseInt(i.substr(-9,2)),R=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(Z.isFiniteNumber)(t)||!Object(Z.isFiniteNumber)(u)||!Object(Z.isFiniteNumber)(o)||!Object(Z.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return t+=1e3*u,t+=60*1e3*o,t+=60*60*1e3*R,t},f=function(i){for(var t=5381,u=i.length;u;)t=t*33^i.charCodeAt(--u);return(t>>>0).toString()};function p(s,i,t){return f(s.toString())+f(i.toString())+f(t)}var a=function(i,t,u){var o=i[t],R=i[o.prevCC];if(!R||!R.new&&o.new){i.ccOffset=i.presentationOffset=o.start,o.new=!1;return}for(;(T=R)!==null&&T!==void 0&&T.new;){var T;i.ccOffset+=o.start-R.start,o.new=!1,o=R,R=i[o.prevCC]}i.presentationOffset=u};function c(s,i,t,u,o,R,T,S){var D=new G.VTTParser,I=Object(M.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(r,`
`).split(`
`),E=[],x=Object(Y.toMpegTsClockFromTimescale)(i,t),g="00:00.000",h=0,O=0,w,b=!0,W=!1;D.oncue=function(j){var C=u[o],B=u.ccOffset,k=(h-x)/9e4;if(C!=null&&C.new&&(O!==void 0?B=u.ccOffset=C.start:a(u,o,k)),k&&(B=k-u.presentationOffset),W){var y=j.endTime-j.startTime,H=Object(X.normalizePts)((j.startTime+B-O)*9e4,R*9e4)/9e4;j.startTime=H,j.endTime=H+y}var J=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(J)),j.id||(j.id=p(j.startTime,j.endTime,J)),j.endTime>0&&E.push(j)},D.onparsingerror=function(j){w=j},D.onflush=function(){if(w){S(w);return}T(E)},I.forEach(function(j){if(b)if(A(j,"X-TIMESTAMP-MAP=")){b=!1,W=!0,j.substr(16).split(",").forEach(function(C){A(C,"LOCAL:")?g=C.substr(6):A(C,"MPEGTS:")&&(h=parseInt(C.substr(7)))});try{O=m(g)/1e3}catch(C){W=!1,w=C}return}else j===""&&(b=!1);D.parse(j+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(ne,Q,U){"use strict";U.r(Q);var Z=U("./src/utils/logger.ts"),G=U("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,Y=function(){function X(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 G.LoadStats,this.retryDelay=0}var r=X.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var m=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),m&&(m.onreadystatechange=null,m.onprogress=null,m.readyState!==4&&(this.stats.aborted=!0,m.abort()))},r.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(m,f,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=m,this.config=f,this.callbacks=p,this.retryDelay=f.retryDelay,this.loadInternal()},r.loadInternal=function(){var m=this.config,f=this.context;if(!m)return;var p=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var c=this.xhrSetup;try{if(c)try{c(p,f.url)}catch(t){p.open("GET",f.url,!0),c(p,f.url)}p.readyState||p.open("GET",f.url,!0);var s=this.context.headers;if(s)for(var i in s)p.setRequestHeader(i,s[i])}catch(t){this.callbacks.onError({code:p.status,text:t.message},f,p);return}f.rangeEnd&&p.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout),p.send()},r.readystatechange=function(){var m=this.context,f=this.loader,p=this.stats;if(!m||!f)return;var a=f.readyState,c=this.config;if(p.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),a===4){f.onreadystatechange=null,f.onprogress=null;var s=f.status;if(s>=200&&s<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var i,t;if(m.responseType==="arraybuffer"?(i=f.response,t=i.byteLength):(i=f.responseText,t=i.length),p.loaded=p.total=t,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(p,m,i,f),!this.callbacks)return;var o={url:f.responseURL,data:i};this.callbacks.onSuccess(o,p,m,f)}else p.retry>=c.maxRetry||s>=400&&s<499?(Z.logger.error(s+" while loading "+m.url),this.callbacks.onError({code:s,text:f.statusText},m,f)):(Z.logger.warn(s+" while loading "+m.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,c.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),c.timeout)},r.loadtimeout=function(){Z.logger.warn("timeout while loading "+this.context.url);var m=this.callbacks;m&&(this.abortInternal(),m.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(m){var f=this.stats;f.loaded=m.loaded,m.lengthComputable&&(f.total=m.total)},r.getCacheAge=function(){var m=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");m=f?parseFloat(f):null}return m},X}();Q.default=Y}}).default})},vHTk:function(Et,Pe,F){Et.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return Bt});var ne=F("rePB"),Q=F("VTBJ"),U=F("KQm4"),Z=F("U8pU"),G=F("ODXe"),M=F("q1tI"),Y=F("TSYQ"),X=F.n(Y),r=F("Gytx"),A=F.n(r),m=F("Kwbf"),f=F("t23M"),p=F("qx4F"),a=F("6eGT"),c=F("IBYe"),s=F("Ff2n"),i=F("c+Xe"),t=F("fyJ8"),u=F("biw7");function o(qe,Qe,bt,xt,ye){var ae=bt[qe]||{},le=bt[Qe]||{},me,Ce;ae.fixed==="left"?me=xt.left[qe]:le.fixed==="right"&&(Ce=xt.right[Qe]);var de=!1,pe=!1,De=!1,ue=!1,Me=bt[Qe+1],We=bt[qe-1];if(ye==="rtl"){if(me!==void 0){var lt=We&&We.fixed==="left";ue=!lt}else if(Ce!==void 0){var Ct=Me&&Me.fixed==="right";De=!Ct}}else if(me!==void 0){var Ot=Me&&Me.fixed==="left";de=!Ot}else if(Ce!==void 0){var Nt=We&&We.fixed==="right";pe=!Nt}return{fixLeft:me,fixRight:Ce,lastFixLeft:de,firstFixRight:pe,lastFixRight:De,firstFixLeft:ue,isSticky:xt.isSticky}}var R=F("sR1s");function T(qe){var Qe=qe.cells,bt=qe.stickyOffsets,xt=qe.flattenColumns,ye=qe.rowComponent,ae=qe.cellComponent,le=qe.onHeaderRow,me=qe.index,Ce=M.useContext(u.a),de=Ce.prefixCls,pe=Ce.direction,De;le&&(De=le(Qe.map(function(Me){return Me.column}),me));var ue=Object(R.a)(Qe.map(function(Me){return Me.column}));return M.createElement(ye,Object.assign({},De),Qe.map(function(Me,We){var lt=Me.column,Ct=o(Me.colStart,Me.colEnd,xt,bt,pe),Ot;return lt&&lt.onHeaderCell&&(Ot=Me.column.onHeaderCell(lt)),M.createElement(t.a,Object.assign({},Me,{ellipsis:lt.ellipsis,align:lt.align,component:ae,prefixCls:de,key:ue[We]},Ct,{additionalProps:Ot,rowType:"header"}))}))}T.displayName="HeaderRow";var S=T;function D(qe){var Qe=[];function bt(le,me){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Qe[Ce]=Qe[Ce]||[];var de=me,pe=le.filter(Boolean).map(function(De){var ue={key:De.key,className:De.className||"",children:De.title,column:De,colStart:de},Me=1,We=De.children;return We&&We.length>0&&(Me=bt(We,de,Ce+1).reduce(function(lt,Ct){return lt+Ct},0),ue.hasSubColumns=!0),"colSpan"in De&&(Me=De.colSpan),"rowSpan"in De&&(ue.rowSpan=De.rowSpan),ue.colSpan=Me,ue.colEnd=ue.colStart+Me-1,Qe[Ce].push(ue),de+=Me,Me});return pe}bt(qe,0);for(var xt=Qe.length,ye=function(me){Qe[me].forEach(function(Ce){!("rowSpan"in Ce)&&!Ce.hasSubColumns&&(Ce.rowSpan=xt-me)})},ae=0;ae<xt;ae+=1)ye(ae);return Qe}function I(qe){var Qe=qe.stickyOffsets,bt=qe.columns,xt=qe.flattenColumns,ye=qe.onHeaderRow,ae=M.useContext(u.a),le=ae.prefixCls,me=ae.getComponent,Ce=M.useMemo(function(){return D(bt)},[bt]),de=me(["header","wrapper"],"thead"),pe=me(["header","row"],"tr"),De=me(["header","cell"],"th");return M.createElement(de,{className:"".concat(le,"-thead")},Ce.map(function(ue,Me){var We=M.createElement(S,{key:Me,flattenColumns:xt,cells:ue,stickyOffsets:Qe,rowComponent:pe,cellComponent:De,onHeaderRow:ye,index:Me});return We}))}var E=I,x=F("hW8S");function g(qe){for(var Qe=qe.colWidths,bt=qe.columns,xt=qe.columCount,ye=[],ae=xt||bt.length,le=!1,me=ae-1;me>=0;me-=1){var Ce=Qe[me],de=bt&&bt[me],pe=de&&de[x.a];(Ce||pe||le)&&(ye.unshift(M.createElement("col",Object.assign({key:me,style:{width:Ce,minWidth:Ce}},pe))),le=!0)}return M.createElement("colgroup",null,ye)}var h=g;function O(qe,Qe){return Object(M.useMemo)(function(){for(var bt=[],xt=0;xt<Qe;xt+=1){var ye=qe[xt];if(ye!==void 0)bt[xt]=ye;else return null}return bt},[qe.join("_"),Qe])}var w=M.forwardRef(function(qe,Qe){var bt=qe.noData,xt=qe.columns,ye=qe.flattenColumns,ae=qe.colWidths,le=qe.columCount,me=qe.stickyOffsets,Ce=qe.direction,de=qe.fixHeader,pe=qe.offsetHeader,De=qe.stickyClassName,ue=qe.onScroll,Me=Object(s.a)(qe,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),We=M.useContext(u.a),lt=We.prefixCls,Ct=We.scrollbarSize,Ot=We.isSticky,Nt=Ot&&!de?0:Ct,ir=M.useRef(null),Jt=M.useCallback(function(yr){Object(i.b)(Qe,yr),Object(i.b)(ir,yr)},[]);M.useEffect(function(){var yr;function Sr(Nn){var Ar=Nn.currentTarget,An=Nn.deltaX;An&&(ue({currentTarget:Ar,scrollLeft:Ar.scrollLeft+An}),Nn.preventDefault())}return(yr=ir.current)===null||yr===void 0||yr.addEventListener("wheel",Sr),function(){var Nn;(Nn=ir.current)===null||Nn===void 0||Nn.removeEventListener("wheel",Sr)}},[]);var cn=ye[ye.length-1],rn={fixed:cn?cn.fixed:null,onHeaderCell:function(){return{className:"".concat(lt,"-cell-scrollbar")}}},In=Object(M.useMemo)(function(){return Nt?[].concat(Object(U.a)(xt),[rn]):xt},[Nt,xt]),ur=Object(M.useMemo)(function(){return Nt?[].concat(Object(U.a)(ye),[rn]):ye},[Nt,ye]),mr=Object(M.useMemo)(function(){var yr=me.right,Sr=me.left;return Object(Q.a)(Object(Q.a)({},me),{},{left:Ce==="rtl"?[].concat(Object(U.a)(Sr.map(function(Nn){return Nn+Nt})),[0]):Sr,right:Ce==="rtl"?yr:[].concat(Object(U.a)(yr.map(function(Nn){return Nn+Nt})),[0]),isSticky:Ot})},[Nt,me,Ot]),Qn=O(ae,le);return M.createElement("div",{style:Object(Q.a)({overflow:"hidden"},Ot?{top:pe}:{}),ref:Jt,className:X()("".concat(lt,"-header"),Object(ne.a)({},De,!!De))},M.createElement("table",{style:{tableLayout:"fixed",visibility:bt||Qn?null:"hidden"}},M.createElement(h,{colWidths:Qn?[].concat(Object(U.a)(Qn),[Nt]):[],columCount:le+1,columns:ur}),M.createElement(E,Object.assign({},Me,{stickyOffsets:mr,columns:In,flattenColumns:ur}))))});w.displayName="FixedHeader";var b=w,W=M.createContext(null),j=W;function C(qe){var Qe=qe.prefixCls,bt=qe.children,xt=qe.component,ye=qe.cellComponent,ae=qe.fixHeader,le=qe.fixColumn,me=qe.horizonScroll,Ce=qe.className,de=qe.expanded,pe=qe.componentWidth,De=qe.colSpan,ue=M.useContext(u.a),Me=ue.scrollbarSize;return M.useMemo(function(){var We=bt;return le&&(We=M.createElement("div",{style:{width:pe-(ae?Me:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Qe,"-expanded-row-fixed")},We)),M.createElement(xt,{className:Ce,style:{display:de?null:"none"}},M.createElement(t.a,{component:ye,prefixCls:Qe,colSpan:De},We))},[bt,xt,ae,me,Ce,de,pe,De,Me])}var B=C;function k(qe){var Qe=qe.className,bt=qe.style,xt=qe.record,ye=qe.index,ae=qe.rowKey,le=qe.getRowKey,me=qe.rowExpandable,Ce=qe.expandedKeys,de=qe.onRow,pe=qe.indent,De=pe===void 0?0:pe,ue=qe.rowComponent,Me=qe.cellComponent,We=qe.childrenColumnName,lt=M.useContext(u.a),Ct=lt.prefixCls,Ot=lt.fixedInfoList,Nt=M.useContext(j),ir=Nt.fixHeader,Jt=Nt.fixColumn,cn=Nt.horizonScroll,rn=Nt.componentWidth,In=Nt.flattenColumns,ur=Nt.expandableType,mr=Nt.expandRowByClick,Qn=Nt.onTriggerExpand,yr=Nt.rowClassName,Sr=Nt.expandedRowClassName,Nn=Nt.indentSize,Ar=Nt.expandIcon,An=Nt.expandedRowRender,Dn=Nt.expandIconColumnIndex,qn=M.useState(!1),fr=Object(G.a)(qn,2),Lr=fr[0],Or=fr[1],at=Ce&&Ce.has(qe.recordKey);M.useEffect(function(){at&&Or(!0)},[at]);var Fe=ur==="row"&&(!me||me(xt)),pt=ur==="nest",Le=We&&xt&&xt[We],xe=Fe||pt,ge;de&&(ge=de(xt,ye));var Hn=function(jt){if(mr&&xe&&Qn(xt,jt),ge&&ge.onClick){for(var dr,ct=arguments.length,Un=new Array(ct>1?ct-1:0),yn=1;yn<ct;yn++)Un[yn-1]=arguments[yn];(dr=ge).onClick.apply(dr,[jt].concat(Un))}},Lt;typeof yr=="string"?Lt=yr:typeof yr=="function"&&(Lt=yr(xt,ye,De));var ke=Object(R.a)(In),ut=M.createElement(ue,Object.assign({},ge,{"data-row-key":ae,className:X()(Qe,"".concat(Ct,"-row"),"".concat(Ct,"-row-level-").concat(De),Lt,ge&&ge.className),style:Object(Q.a)(Object(Q.a)({},bt),ge?ge.style:null),onClick:Hn}),In.map(function(Kn,jt){var dr=Kn.render,ct=Kn.dataIndex,Un=Kn.className,yn=ke[jt],ln=Ot[jt],Xt;jt===(Dn||0)&&pt&&(Xt=M.createElement(M.Fragment,null,M.createElement("span",{style:{paddingLeft:"".concat(Nn*De,"px")},className:"".concat(Ct,"-row-indent indent-level-").concat(De)}),Ar({prefixCls:Ct,expanded:at,expandable:Le,record:xt,onExpand:Qn})));var Pn;return Kn.onCell&&(Pn=Kn.onCell(xt,ye)),M.createElement(t.a,Object.assign({className:Un,ellipsis:Kn.ellipsis,align:Kn.align,component:Me,prefixCls:Ct,key:yn,record:xt,index:ye,dataIndex:ct,render:dr,shouldCellUpdate:Kn.shouldCellUpdate},ln,{appendNode:Xt,additionalProps:Pn}))})),Re;if(Fe&&(Lr||at)){var tn=An(xt,ye,De+1,at),cr=Sr&&Sr(xt,ye,De);Re=M.createElement(B,{expanded:at,className:X()("".concat(Ct,"-expanded-row"),"".concat(Ct,"-expanded-row-level-").concat(De+1),cr),prefixCls:Ct,fixHeader:ir,fixColumn:Jt,horizonScroll:cn,component:ue,componentWidth:rn,cellComponent:Me,colSpan:In.length},tn)}var pr;return Le&&at&&(pr=(xt[We]||[]).map(function(Kn,jt){var dr=le(Kn,jt);return M.createElement(k,Object.assign({},qe,{key:dr,rowKey:dr,record:Kn,recordKey:dr,index:jt,indent:De+1}))})),M.createElement(M.Fragment,null,ut,Re,pr)}k.displayName="BodyRow";var y=k,H=M.createContext(null),J=H;function se(qe){var Qe=qe.columnKey,bt=qe.onColumnResize,xt=M.useRef();return M.useEffect(function(){xt.current&&bt(Qe,xt.current.offsetWidth)},[]),M.createElement(f.a,{onResize:function(ae){var le=ae.offsetWidth;bt(Qe,le)}},M.createElement("td",{ref:xt,style:{padding:0,border:0,height:0}},M.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function fe(qe){var Qe=qe.data,bt=qe.getRowKey,xt=qe.measureColumnWidth,ye=qe.expandedKeys,ae=qe.onRow,le=qe.rowExpandable,me=qe.emptyNode,Ce=qe.childrenColumnName,de=M.useContext(J),pe=de.onColumnResize,De=M.useContext(u.a),ue=De.prefixCls,Me=De.getComponent,We=M.useContext(j),lt=We.fixHeader,Ct=We.horizonScroll,Ot=We.flattenColumns,Nt=We.componentWidth;return M.useMemo(function(){var ir=Me(["body","wrapper"],"tbody"),Jt=Me(["body","row"],"tr"),cn=Me(["body","cell"],"td"),rn;Qe.length?rn=Qe.map(function(ur,mr){var Qn=bt(ur,mr);return M.createElement(y,{key:Qn,rowKey:Qn,record:ur,recordKey:Qn,index:mr,rowComponent:Jt,cellComponent:cn,expandedKeys:ye,onRow:ae,getRowKey:bt,rowExpandable:le,childrenColumnName:Ce})}):rn=M.createElement(B,{expanded:!0,className:"".concat(ue,"-placeholder"),prefixCls:ue,fixHeader:lt,fixColumn:Ct,horizonScroll:Ct,component:Jt,componentWidth:Nt,cellComponent:cn,colSpan:Ot.length},me);var In=Object(R.a)(Ot);return M.createElement(ir,{className:"".concat(ue,"-tbody")},xt&&M.createElement("tr",{"aria-hidden":"true",className:"".concat(ue,"-measure-row"),style:{height:0}},In.map(function(ur){return M.createElement(se,{key:ur,columnKey:ur,onColumnResize:pe})})),rn)},[Qe,ue,ae,xt,ye,bt,Me,Nt,me,Ot])}var ve=M.memo(fe);ve.displayName="Body";var Se=ve,Ue=F("wRmb"),Te=F("xEkU"),Ie=F.n(Te);function be(qe){var Qe=Object(M.useRef)(qe),bt=Object(M.useState)({}),xt=Object(G.a)(bt,2),ye=xt[1],ae=Object(M.useRef)(null),le=Object(M.useRef)([]);function me(Ce){ae.current===null&&(le.current=[],ae.current=Ie()(function(){le.current.forEach(function(de){Qe.current=de(Qe.current)}),ae.current=null,ye({})})),le.current.push(Ce)}return Object(M.useEffect)(function(){return function(){Ie.a.cancel(ae.current)}},[]),[Qe.current,me]}function q(qe){var Qe=Object(M.useRef)(qe),bt=Object(M.useRef)(null);function xt(){window.clearTimeout(bt.current)}function ye(le){Qe.current=le,xt(),bt.current=window.setTimeout(function(){Qe.current=null,bt.current=null},100)}function ae(){return Qe.current}return Object(M.useEffect)(function(){return xt},[]),[ye,ae]}function _(qe,Qe,bt){var xt=Object(M.useMemo)(function(){for(var ye=[],ae=[],le=0,me=0,Ce=0;Ce<Qe;Ce+=1)if(bt==="rtl"){ae[Ce]=me,me+=qe[Ce]||0;var de=Qe-Ce-1;ye[de]=le,le+=qe[de]||0}else{ye[Ce]=le,le+=qe[Ce]||0;var pe=Qe-Ce-1;ae[pe]=me,me+=qe[pe]||0}return{left:ye,right:ae}},[qe,Qe,bt]);return xt}var L=_;function z(qe){var Qe=qe.className,bt=qe.children;return M.createElement("div",{className:Qe},bt)}var ee=z,$=F("n6Qo");function Ee(qe){var Qe,bt=qe.prefixCls,xt=qe.record,ye=qe.onExpand,ae=qe.expanded,le=qe.expandable,me="".concat(bt,"-row-expand-icon");if(!le)return M.createElement("span",{className:X()(me,"".concat(bt,"-row-spaced"))});var Ce=function(pe){ye(xt,pe),pe.stopPropagation()};return M.createElement("span",{className:X()(me,(Qe={},Object(ne.a)(Qe,"".concat(bt,"-row-expanded"),ae),Object(ne.a)(Qe,"".concat(bt,"-row-collapsed"),!ae),Qe)),onClick:Ce})}function Be(qe,Qe,bt){var xt=[];function ye(ae){(ae||[]).forEach(function(le,me){xt.push(Qe(le,me)),ye(le[bt])})}return ye(qe),xt}var nt=F("zT1h"),we=F("y0+3"),Ne=function(Qe,bt){var xt,ye,ae=Qe.scrollBodyRef,le=Qe.onScroll,me=Qe.offsetScroll,Ce=M.useContext(u.a),de=Ce.prefixCls,pe=((xt=ae.current)===null||xt===void 0?void 0:xt.scrollWidth)||0,De=((ye=ae.current)===null||ye===void 0?void 0:ye.clientWidth)||0,ue=pe&&De*(De/pe),Me=M.useRef(),We=be({scrollLeft:0,isHiddenScrollBar:!1}),lt=Object(G.a)(We,2),Ct=lt[0],Ot=lt[1],Nt=M.useRef({delta:0,x:0}),ir=M.useState(!1),Jt=Object(G.a)(ir,2),cn=Jt[0],rn=Jt[1],In=function(){rn(!1)},ur=function(Nn){Nn.persist(),Nt.current.delta=Nn.pageX-Ct.scrollLeft,Nt.current.x=0,rn(!0),Nn.preventDefault()},mr=function(Nn){var Ar,An=Nn||((Ar=window)===null||Ar===void 0?void 0:Ar.event),Dn=An.buttons;if(!cn||Dn===0){cn&&rn(!1);return}var qn=Nt.current.x+Nn.pageX-Nt.current.x-Nt.current.delta;qn<=0&&(qn=0),qn+ue>=De&&(qn=De-ue),le({scrollLeft:qn/De*(pe+2)}),Nt.current.x=Nn.pageX},Qn=function(){var Nn=Object(we.b)(ae.current).top,Ar=Nn+ae.current.offsetHeight,An=document.documentElement.scrollTop+window.innerHeight;Ar-Object(p.a)()<=An||Nn>=An-me?Ot(function(Dn){return Object(Q.a)(Object(Q.a)({},Dn),{},{isHiddenScrollBar:!0})}):Ot(function(Dn){return Object(Q.a)(Object(Q.a)({},Dn),{},{isHiddenScrollBar:!1})})},yr=function(Nn){Ot(function(Ar){return Object(Q.a)(Object(Q.a)({},Ar),{},{scrollLeft:Nn/pe*De||0})})};return M.useImperativeHandle(bt,function(){return{setScrollLeft:yr}}),M.useEffect(function(){var Sr=Object(nt.a)(document.body,"mouseup",In,!1),Nn=Object(nt.a)(document.body,"mousemove",mr,!1);return Qn(),function(){Sr.remove(),Nn.remove()}},[ue,cn]),M.useEffect(function(){var Sr=Object(nt.a)(window,"scroll",Qn,!1),Nn=Object(nt.a)(window,"resize",Qn,!1);return function(){Sr.remove(),Nn.remove()}},[]),M.useEffect(function(){Ct.isHiddenScrollBar||Ot(function(Sr){var Nn,Ar;return Object(Q.a)(Object(Q.a)({},Sr),{},{scrollLeft:ae.current.scrollLeft/((Nn=ae.current)===null||Nn===void 0?void 0:Nn.scrollWidth)*((Ar=ae.current)===null||Ar===void 0?void 0:Ar.clientWidth)})})},[Ct.isHiddenScrollBar]),pe<=De||!ue||Ct.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(p.a)(),width:De,bottom:me},className:"".concat(de,"-sticky-scroll")},M.createElement("div",{onMouseDown:ur,ref:Me,className:X()("".concat(de,"-sticky-scroll-bar"),Object(ne.a)({},"".concat(de,"-sticky-scroll-bar-active"),cn)),style:{width:"".concat(ue,"px"),transform:"translate3d(".concat(Ct.scrollLeft,"px, 0, 0)")}}))},Ye=M.forwardRef(Ne);function Xe(qe,Qe){return M.useMemo(function(){var bt=!!qe;return{isSticky:bt,stickyClassName:bt?"".concat(Qe,"-sticky-header"):"",offsetHeader:Object(Z.a)(qe)==="object"&&qe.offsetHeader||0,offsetScroll:Object(Z.a)(qe)==="object"&&qe.offsetScroll||0}},[qe,Qe])}var ht=[],wt={},Bt="rc-table-internal-hook",Wt=M.memo(function(qe){var Qe=qe.children;return Qe},function(qe,Qe){return A()(qe.props,Qe.props)?qe.pingLeft!==Qe.pingLeft||qe.pingRight!==Qe.pingRight:!1});function an(qe){var Qe,bt=qe.prefixCls,xt=qe.className,ye=qe.rowClassName,ae=qe.style,le=qe.data,me=qe.rowKey,Ce=qe.scroll,de=qe.tableLayout,pe=qe.direction,De=qe.title,ue=qe.footer,Me=qe.summary,We=qe.id,lt=qe.showHeader,Ct=qe.components,Ot=qe.emptyText,Nt=qe.onRow,ir=qe.onHeaderRow,Jt=qe.internalHooks,cn=qe.transformColumns,rn=qe.internalRefs,In=qe.sticky,ur=le||ht,mr=!!ur.length,Qn=M.useState(0),yr=Object(G.a)(Qn,2),Sr=yr[0],Nn=yr[1];M.useEffect(function(){Nn(Object(p.a)())});var Ar=M.useMemo(function(){return Object(R.c)(Ct,{})},[Ct]),An=M.useCallback(function(jn,Wn){return Object(R.b)(Ar,jn)||Wn},[Ar]),Dn=M.useMemo(function(){return typeof me=="function"?me:function(jn){var Wn=jn&&jn[me];return Wn}},[me]),qn=Object(x.c)(qe),fr=qn.expandIcon,Lr=qn.expandedRowKeys,Or=qn.defaultExpandedRowKeys,at=qn.defaultExpandAllRows,Fe=qn.expandedRowRender,pt=qn.onExpand,Le=qn.onExpandedRowsChange,xe=qn.expandRowByClick,ge=qn.rowExpandable,Hn=qn.expandIconColumnIndex,Lt=qn.expandedRowClassName,ke=qn.childrenColumnName,ut=qn.indentSize,Re=fr||Ee,tn=ke||"children",cr=M.useMemo(function(){return Fe?"row":qe.expandable&&Jt===Bt&&qe.expandable.__PARENT_RENDER_ICON__||ur.some(function(jn){return jn&&Object(Z.a)(jn)==="object"&&jn[tn]})?"nest":!1},[!!Fe,ur]),pr=M.useState(function(){return Or||(at?Be(ur,Dn,tn):[])}),Kn=Object(G.a)(pr,2),jt=Kn[0],dr=Kn[1],ct=M.useMemo(function(){return new Set(Lr||jt||[])},[Lr,jt]),Un=M.useCallback(function(jn){var Wn=Dn(jn,ur.indexOf(jn)),Ft,pn=ct.has(Wn);pn?(ct.delete(Wn),Ft=Object(U.a)(ct)):Ft=[].concat(Object(U.a)(ct),[Wn]),dr(Ft),pt&&pt(!pn,jn),Le&&Le(Ft)},[Dn,ct,ur,pt,Le]),yn=M.useState(0),ln=Object(G.a)(yn,2),Xt=ln[0],Pn=ln[1],hn=Object(Ue.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},qe),qn),{},{expandable:!!Fe,expandedKeys:ct,getRowKey:Dn,onTriggerExpand:Un,expandIcon:Re,expandIconColumnIndex:Hn,direction:pe}),Jt===Bt?cn:null),qt=Object(G.a)(hn,2),Mt=qt[0],Kt=qt[1],ar=M.useMemo(function(){return{columns:Mt,flattenColumns:Kt}},[Mt,Kt]),sr=M.useRef(),Fn=M.useRef(),bn=M.useRef(),Ut=M.useState(!1),Vt=Object(G.a)(Ut,2),Gt=Vt[0],Dt=Vt[1],Zn=M.useState(!1),On=Object(G.a)(Zn,2),fn=On[0],Vn=On[1],un=be(new Map),_n=Object(G.a)(un,2),Zt=_n[0],kn=_n[1],er=Object(R.a)(Kt),tr=er.map(function(jn){return Zt.get(jn)}),wn=M.useMemo(function(){return tr},[tr.join("_")]),Mn=L(wn,Kt.length,pe),dn=Ce&&Object(R.d)(Ce.y),or=Ce&&Object(R.d)(Ce.x),Xn=or&&Kt.some(function(jn){var Wn=jn.fixed;return Wn}),vr=M.useRef(),gr=Xe(In,bt),Gn=gr.isSticky,Bn=gr.offsetHeader,_r=gr.offsetScroll,Rn=gr.stickyClassName,En,Cn,vn;dn&&(Cn={overflowY:"scroll",maxHeight:Ce.y}),or&&(En={overflowX:"auto"},dn||(Cn={overflowY:"hidden"}),vn={width:Ce.x===!0?"auto":Ce.x,minWidth:"100%"});var Qt=M.useCallback(function(jn,Wn){kn(function(Ft){var pn=new Map(Ft);return pn.set(jn,Wn),pn})},[]),St=q(null),It=Object(G.a)(St,2),kt=It[0],At=It[1];function zt(jn,Wn){if(!Wn)return;typeof Wn=="function"?Wn(jn):Wn.scrollLeft!==jn&&(Wn.scrollLeft=jn)}var sn=function(Wn){var Ft=Wn.currentTarget,pn=Wn.scrollLeft,Ln=typeof pn=="number"?pn:Ft.scrollLeft,zn=Ft||wt;if(!At()||At()===zn){var mn;kt(zn),zt(Ln,Fn.current),zt(Ln,bn.current),zt(Ln,(mn=vr.current)===null||mn===void 0?void 0:mn.setScrollLeft)}if(Ft){var Ir=Ft.scrollWidth,jr=Ft.clientWidth;Dt(Ln>0),Vn(Ln<Ir-jr)}},nn=function(){bn.current&&sn({currentTarget:bn.current})},ft=function(Wn){var Ft=Wn.width;nn(),Pn(sr.current?sr.current.offsetWidth:Ft)};M.useEffect(function(){return nn},[]),M.useEffect(function(){or&&nn()},[or]),M.useEffect(function(){Jt===Bt&&rn&&(rn.body.current=bn.current)});var rt=An(["table"],"table"),$e=M.useMemo(function(){return de||(Xn?Ce.x==="max-content"?"auto":"fixed":dn||Kt.some(function(jn){var Wn=jn.ellipsis;return Wn})?"fixed":"auto")},[dn,Xn,Kt,de]),Ze,He={colWidths:wn,columCount:Kt.length,stickyOffsets:Mn,onHeaderRow:ir,fixHeader:dn},ot=M.useMemo(function(){return mr?null:typeof Ot=="function"?Ot():Ot},[mr,Ot]),et=M.createElement(Se,{data:ur,measureColumnWidth:dn||or||Gn,expandedKeys:ct,rowExpandable:ge,getRowKey:Dn,onRow:Nt,emptyNode:ot,childrenColumnName:tn}),mt=M.createElement(h,{colWidths:Kt.map(function(jn){var Wn=jn.width;return Wn}),columns:Kt}),Tt=Me&&M.createElement($.b,null,Me(ur)),gt=An(["body"]);if(dn||Gn){var Pt;typeof gt=="function"?(Pt=gt(ur,{scrollbarSize:Sr,ref:bn,onScroll:sn}),He.colWidths=Kt.map(function(jn,Wn){var Ft=jn.width,pn=Wn===Mt.length-1?Ft-Sr:Ft;return typeof pn=="number"&&!Number.isNaN(pn)?pn:(Object(m.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Pt=M.createElement("div",{style:Object(Q.a)(Object(Q.a)({},En),Cn),onScroll:sn,ref:bn,className:X()("".concat(bt,"-body"))},M.createElement(rt,{style:Object(Q.a)(Object(Q.a)({},vn),{},{tableLayout:$e})},mt,et,Tt),Gn&&M.createElement(Ye,{ref:vr,offsetScroll:_r,scrollBodyRef:bn,onScroll:sn})),Ze=M.createElement(M.Fragment,null,lt!==!1&&M.createElement(b,Object.assign({noData:!ur.length},He,ar,{direction:pe,offsetHeader:Bn,stickyClassName:Rn,ref:Fn,onScroll:sn})),Pt)}else Ze=M.createElement("div",{style:Object(Q.a)(Object(Q.a)({},En),Cn),className:X()("".concat(bt,"-content")),onScroll:sn,ref:bn},M.createElement(rt,{style:Object(Q.a)(Object(Q.a)({},vn),{},{tableLayout:$e})},mt,lt!==!1&&M.createElement(E,Object.assign({},He,ar)),et,Tt));var vt=Object(x.b)(qe),yt=M.createElement("div",Object.assign({className:X()(bt,xt,(Qe={},Object(ne.a)(Qe,"".concat(bt,"-rtl"),pe==="rtl"),Object(ne.a)(Qe,"".concat(bt,"-ping-left"),Gt),Object(ne.a)(Qe,"".concat(bt,"-ping-right"),fn),Object(ne.a)(Qe,"".concat(bt,"-layout-fixed"),de==="fixed"),Object(ne.a)(Qe,"".concat(bt,"-fixed-header"),dn),Object(ne.a)(Qe,"".concat(bt,"-fixed-column"),Xn),Object(ne.a)(Qe,"".concat(bt,"-scroll-horizontal"),or),Object(ne.a)(Qe,"".concat(bt,"-has-fix-left"),Kt[0]&&Kt[0].fixed),Object(ne.a)(Qe,"".concat(bt,"-has-fix-right"),Kt[Kt.length-1]&&Kt[Kt.length-1].fixed==="right"),Qe)),style:ae,id:We,ref:sr},vt),M.createElement(Wt,{pingLeft:Gt,pingRight:fn,props:Object(Q.a)(Object(Q.a)({},qe),{},{stickyOffsets:Mn,mergedExpandedKeys:ct})},De&&M.createElement(ee,{className:"".concat(bt,"-title")},De(ur)),M.createElement("div",{className:"".concat(bt,"-container")},Ze),ue&&M.createElement(ee,{className:"".concat(bt,"-footer")},ue(ur))));or&&(yt=M.createElement(f.a,{onResize:ft},yt));var on=M.useMemo(function(){return{prefixCls:bt,getComponent:An,scrollbarSize:Sr,direction:pe,fixedInfoList:Kt.map(function(jn,Wn){return o(Wn,Wn,Kt,Mn,pe)}),isSticky:Gn}},[bt,An,Sr,pe,Kt,Mn,pe,Gn]),$t=M.useMemo(function(){return Object(Q.a)(Object(Q.a)({},ar),{},{tableLayout:$e,rowClassName:ye,expandedRowClassName:Lt,componentWidth:Xt,fixHeader:dn,fixColumn:Xn,horizonScroll:or,expandIcon:Re,expandableType:cr,expandRowByClick:xe,expandedRowRender:Fe,onTriggerExpand:Un,expandIconColumnIndex:Hn,indentSize:ut})},[ar,$e,ye,Lt,Xt,dn,Xn,or,Re,cr,xe,Fe,Un,Hn,ut]),hr=M.useMemo(function(){return{onColumnResize:Qt}},[Qt]);return M.createElement(u.a.Provider,{value:on},M.createElement(j.Provider,{value:$t},M.createElement(J.Provider,{value:hr},yt)))}an.Column=c.a,an.ColumnGroup=a.a,an.Summary=$.a,an.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Yt=Pe.b=an},wRmb:function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return A});var ne=F("rePB"),Q=F("KQm4"),U=F("VTBJ"),Z=F("Ff2n"),G=F("q1tI"),M=F.n(G),Y=F("Kwbf"),X=F("Zm9Q"),r=F("hW8S");function A(c){return Object(X.a)(c).filter(function(s){return G.isValidElement(s)}).map(function(s){var i=s.key,t=s.props,u=t.children,o=Object(Z.a)(t,["children"]),R=Object(U.a)({key:i},o);return u&&(R.children=A(u)),R})}function m(c){return c.reduce(function(s,i){var t=i.fixed,u=t===!0?"left":t,o=i.children;return o&&o.length>0?[].concat(Object(Q.a)(s),Object(Q.a)(m(o).map(function(R){return Object(U.a)({fixed:u},R)}))):[].concat(Object(Q.a)(s),[Object(U.a)(Object(U.a)({},i),{},{fixed:u})])},[])}function f(c){for(var s=!0,i=0;i<c.length;i+=1){var t=c[i];if(s&&t.fixed!=="left")s=!1;else if(!s&&t.fixed==="left"){Object(Y.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var u=!0,o=c.length-1;o>=0;o-=1){var R=c[o];if(u&&R.fixed!=="right")u=!1;else if(!u&&R.fixed==="right"){Object(Y.a)(!1,"Index ".concat(o+1," of `columns` missing `fixed='right'` prop."));break}}}function p(c){return c.map(function(s){var i=s.fixed,t=Object(Z.a)(s,["fixed"]),u=i;return i==="left"?u="right":i==="right"&&(u="left"),Object(U.a)({fixed:u},t)})}function a(c,s){var i=c.prefixCls,t=c.columns,u=c.children,o=c.expandable,R=c.expandedKeys,T=c.getRowKey,S=c.onTriggerExpand,D=c.expandIcon,I=c.rowExpandable,E=c.expandIconColumnIndex,x=c.direction,g=c.expandRowByClick,h=G.useMemo(function(){return t||A(u)},[t,u]),O=G.useMemo(function(){if(o){var W,j=E||0,C=h[j],B=(W={},Object(ne.a)(W,r.a,{className:"".concat(i,"-expand-icon-col")}),Object(ne.a)(W,"title",""),Object(ne.a)(W,"fixed",C?C.fixed:null),Object(ne.a)(W,"className","".concat(i,"-row-expand-icon-cell")),Object(ne.a)(W,"render",function(H,J,se){var fe=T(J,se),ve=R.has(fe),Se=I?I(J):!0,Ue=D({prefixCls:i,expanded:ve,expandable:Se,record:J,onExpand:S});return g?G.createElement("span",{onClick:function(Ie){return Ie.stopPropagation()}},Ue):Ue}),W),k=h.slice();return j>=0&&k.splice(j,0,B),k}return h},[o,h,T,R,D,x]),w=G.useMemo(function(){var W=O;return s&&(W=s(W)),W.length||(W=[{render:function(){return null}}]),W},[s,O,x]),b=G.useMemo(function(){return x==="rtl"?p(m(w)):m(w)},[w,x]);return[w,b]}Pe.b=a},"y0+3":function(Et,Pe,F){"use strict";F.d(Pe,"a",function(){return m}),F.d(Pe,"b",function(){return p});var ne=/margin|padding|width|height|max|min|offset/,Q={left:!0,top:!0},U={cssFloat:1,styleFloat:1,float:1};function Z(a){return a.nodeType===1?a.ownerDocument.defaultView.getComputedStyle(a,null):{}}function G(a,c,s){if(c=c.toLowerCase(),s==="auto"){if(c==="height")return a.offsetHeight;if(c==="width")return a.offsetWidth}return c in Q||(Q[c]=ne.test(c)),Q[c]?parseFloat(s)||0:s}function M(a,c){var s=arguments.length,i=Z(a);return c=U[c]?"cssFloat"in a.style?"cssFloat":"styleFloat":c,s===1?i:G(a,c,i[c]||a.style[c])}function Y(a,c,s){var i=arguments.length;if(c=U[c]?"cssFloat"in a.style?"cssFloat":"styleFloat":c,i===3)return typeof s=="number"&&ne.test(c)&&(s="".concat(s,"px")),a.style[c]=s,s;for(var t in c)c.hasOwnProperty(t)&&Y(a,t,c[t]);return Z(a)}function X(a){return a===document.body?document.documentElement.clientWidth:a.offsetWidth}function r(a){return a===document.body?window.innerHeight||document.documentElement.clientHeight:a.offsetHeight}function A(){var a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:a,height:c}}function m(){var a=document.documentElement.clientWidth,c=window.innerHeight||document.documentElement.clientHeight;return{width:a,height:c}}function f(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function p(a){var c=a.getBoundingClientRect(),s=document.documentElement;return{left:c.left+(window.pageXOffset||s.scrollLeft)-(s.clientLeft||document.body.clientLeft||0),top:c.top+(window.pageYOffset||s.scrollTop)-(s.clientTop||document.body.clientTop||0)}}},"yTi+":function(Et,Pe,F){Et.exports=F.p+"static/AssistantCode3.fdd8db3c.jpeg"},zWo0:function(Et,Pe,F){Et.exports={flex_box_center:"flex_box_center___3zJMe",flex_space_between:"flex_space_between___13piC",flex_box_vertical_center:"flex_box_vertical_center___1Z05H",flex_box_center_end:"flex_box_center_end___3Vv0l",flex_box_column:"flex_box_column___3GJ6D",bg:"bg___1hpKT",containerTitle:"containerTitle___3ViW8",containerDesc:"containerDesc___X72Fr",d1:"d1___4bBm6",name:"name___2KzoA",diff:"diff___1fPyD",time:"time___3N9-e",d2:"d2___1kqjn",listItem:"listItem___1lLy6",info:"info___2vCxA",title:"title___bqOOF",titleLeft:"titleLeft___1gE5Z",titleRight:"titleRight___3_pXb",acitons:"acitons___3AN6t",formWrap:"formWrap___2GMGM",button:"button___KOTNG"}}}]);